PDA

View Full Version : missing . in variable


renoboi
02-10-2003, 08:42 PM
ok, i've been up all night and i think i'm having a brain meltdown. but i cant figure out what is wrong with this stupid script. i've narrowed it down to this line:

$fileName = $user.jpg;

it's part of a file upload script. what's supposed to happen is whatever file they upload gets renamed to whatever.jpg the script is removing all the funny characters, and verifying that it's the proper format and all that good stuff before it gets to this line. it's workin just fine except the '.' between $user and jpg disappears, so i end up with a file called whateverjpg.

i thought maybe escaping the . would work, but then i just get a server error.

can someone please tell me the stupidly obvious error that i've made?

pb&j
02-10-2003, 08:46 PM
Perhaps try...

$fileName = $user . ".jpg";

Or it may require the escape...

$fileName = $user . "\.jpg";

(Sorry, still new to PHP myself.)

renoboi
02-10-2003, 08:52 PM
no, quotes aren't working either.

renoboi
02-10-2003, 09:37 PM
ok, thanks anyway everyone. i'm just an idiot.

i just found the same line later on in the script without the . in it. so it was just changing it back.

:o