forumnz Posted July 7, 2007 Share Posted July 7, 2007 Ok I want one text to show if the address bar reads ....com/page1.php?id=1 and another text to read if id=2 I have this code I made but Im a noob and it doesnt work. Please help. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php if ($id == 1) echo "Test 1"; if ($id == 2) echo "Test 2"; ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
king arthur Posted July 7, 2007 Share Posted July 7, 2007 Just add $id = $_GET["id"] at the start of your php. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.