Jump to content

[SOLVED] if based on address bar


forumnz

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/58862-solved-if-based-on-address-bar/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.