sirbrent
04-07-2008, 12:22 AM
Hi,
I have a simple script that spits out an html table,
i am having some problem with how to insert the variable correctly in this situation (i am new to php)
so, there is a variable set by a included script
it sets this:
$userdir = "www.example.com/user/";
the script thats generating the table has this line
tableoutput .= "<div class=\"hcbfooter\" style=\"width: 150px; margin-top: 0px; margin-left: auto; margin-right: auto; margin-bottom: 5px; text-align: center; background-image: url($userdirpic2008.jpg); height: 200px;\"></div>";
but that doesnt work, it sees the variable as $userdirpic2008,
i cant figure out how to seperate the variable from the rest of the string, without making it stop working.
i have tried some stuff
i thought i has seen this somewhere, but it didnt work:
$userdir.pic2008
and i cant seperate it with a "/" because there is already one trailing the variable's value (which i cant change because other stuff relies on it):
i am sure there is a simple answer, i just dont know it... and google failed me this time :-(
Thanks for your help.
I have a simple script that spits out an html table,
i am having some problem with how to insert the variable correctly in this situation (i am new to php)
so, there is a variable set by a included script
it sets this:
$userdir = "www.example.com/user/";
the script thats generating the table has this line
tableoutput .= "<div class=\"hcbfooter\" style=\"width: 150px; margin-top: 0px; margin-left: auto; margin-right: auto; margin-bottom: 5px; text-align: center; background-image: url($userdirpic2008.jpg); height: 200px;\"></div>";
but that doesnt work, it sees the variable as $userdirpic2008,
i cant figure out how to seperate the variable from the rest of the string, without making it stop working.
i have tried some stuff
i thought i has seen this somewhere, but it didnt work:
$userdir.pic2008
and i cant seperate it with a "/" because there is already one trailing the variable's value (which i cant change because other stuff relies on it):
i am sure there is a simple answer, i just dont know it... and google failed me this time :-(
Thanks for your help.