FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


2 things that dont work





jabapyth
1: any code designed to get the IP adress
2: fwrite

why is this? am i diong something wrong?
jabapyth
wait...
i fixed the IP thing (i was doing something wrong), but what about the fwrite?
raver
jabapyth wrote:
wait...
i fixed the IP thing (i was doing something wrong), but what about the fwrite?

Depend on your script, fwrite is used to write contents to a .txt file, which you previously opened with fopen("w");
yjwong
You'll need a file pointer for fwrite(), this pointer can be created using the fopen() resource handler.

Code:

fopen(str file, str mode);


The usage of fwrite():
Code:

fwrite(str data_to_write, str fp);


Example:
Code:

// Opens the file in writing mode
$fp = fopen("file.txt", "w+");
$data = "Hello World!";

fwrite($data, $fp);

// Closes the file pointer
fclose($fp);
jabapyth
ya i know thats what it IS, i keep getting an Error "Permission denied"
krazycapital
You have to chmod it to 755
n0obie4life
krazycapital wrote:
You have to chmod it to 755


I hope you meant 666 or 777 Wink.
jabapyth
so, basicly, enable Global Write?
Related topics
Xbox 360 vs PS3
Am I wired for life ?
[c++]random number generator doesnt work
New Template
My first slice.
Cabbie killed in street racing incident
OK, really easy html script...
Sigs and avtars don`t work
Need Mods installed.... payin a healthy amount of frih's !!!
Describe your typical day at work
 EASY 40 frih$ IF YOU KNOW PHP+MySQL 
going from BBedit to Dreamweaver
100 days free licence for Kaspersky Internet Security 2009
We are ALL personally responsible
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.