syntax/parse error


#1

hi all,

ive got this syntax/parse error

i tried almost everything, but cant seem to get it right :

heres the code:

$handle = @fopen("articles/"$_POST["name"].", "w"); 

btw anyone know of any php syntax checkers? i cant find one on google

many thanks
c0lin :)


#2

I think it is supposed to be like this:

$handle = @fopen(“articles/$_POST[“name”]”, “w”);

double quotes allow the replacement of variables.


#3

Im confused as to why their are double quotes on the inside of the global variable anyways? Those are suppose to be single quotes, right?.. Try this…

$handle = @fopen(“articles/{$_POST[‘name’]}”, “w”);


#4

Thanks for the replies, drewbees version worked a treat :)

but now i have another problem…

whenever i try to submit data to this script it gives me ‘a cannot find server’ page : (ive tried a few times now)

any ideas?

Thanks
c0lin


#5

anyone? :-?


#6

what is the rest of the code?? Either that, or your server is down. :)


#7

heres the rest of my code:


i dont think my server is down as i can get to my main page

thanks for the reply btw drewbee :)

Colin


#8

Make sure the form is pointing to the right script.