PDA

Click to See Complete Forum and Search --> : Combining strings in PHP ? [Resolved]


Allen Schoessler
Jul 29th, 2005, 02:14 PM
I don't know a whole lot about PHP... what I'm doing is taking the argument passed to a site name like this:

http://www.mysite.com/main.php?page=pics

...and have it read two .htm files on the server and display one on the left and one on the right. If the agument passed is nothing (http://www.mysite.com/main.php), then it loads homer.htm and homel.htm

generatetop();

$page=$_GET['page'];

if($page=="")
{
echopage("homel");
}
else
{
echopage($page + "l");
}

generatemiddle();

if($page=="")
{
echopage("homer");
}
else
{
echopage($page + "r");
}

generatebottom();

I don't know PHP very well, but that only works when I go to (http://www.mysite.com/main.php) ... If I set page equal to something, it crashes. Is + not the right thing to use to combine strings in PHP ? I think it's sending 0 to the echopage function.

Warning: fopen("0.htm", "r") - No such file or directory in /usr7/home/spadeapp/public_html/xchange/main.php on line 49

Any ideas ?

grilkip
Jul 29th, 2005, 02:33 PM
$page . "r"

Allen Schoessler
Jul 29th, 2005, 02:45 PM
Thanks heaps...