...

View Full Version : T_constant_encapsed_string



martynball
01-14-2010, 06:33 PM
Error:


Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/martynba/public_html/portfolio/upload.php on line 118


PHP:


$image_name=$date'.'$imageTitle'.'$extension;


I don't understand :(

Rowsdower!
01-14-2010, 06:35 PM
Error:


Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/martynba/public_html/portfolio/upload.php on line 118


PHP:


$image_name=$date'.'$imageTitle'.'$extension;


I don't understand :(

You have your text right up against your variables with no period to attach them. Try this instead:

$image_name=$date.'.'.$imageTitle.'.'.$extension;

Unless you don't want to add periods between the variables. In that case you would use this:

$image_name=$date.$imageTitle.$extension;

JAY6390
01-14-2010, 06:37 PM
$image_name=$date.$imageTitle.$extension;You had quotes around places they werent meant to be
If you look at your code hilighted you can see the problem area

$image_name=$date'.'$imageTitle'.'$extension;. If you meant for those dots to be actual dots and not to concatenate the strings then you need to have dots around them too. For example this

$image_name=$date.'.'.$imageTitle.'.'.$extension;

martynball
01-14-2010, 06:38 PM
That worked, cheers :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum