techiefreak05 Posted November 19, 2006 Share Posted November 19, 2006 I have the following code that has a list of themes for a layout im designing na dit sets a variable "t" in the url...[code]Theme: <A HREF="table_layout.php?t=#F0FFF0">Green</a> | <A HREF="table_layout.php?t=#FFFFFF">White</a> | <?php echo $_GET[t]; ?>[/code]and then i also have this:[code]<body bgcolor="<?php echo $_GET[t]; ?>">[/code]the background dpes not change. and when i echo $_GET['t], it has no value. what am i doing wrong? Link to comment https://forums.phpfreaks.com/topic/27760-_get-problems/ Share on other sites More sharing options...
ronverdonk Posted November 19, 2006 Share Posted November 19, 2006 The problem lies with the # sign used. So encode the url parm. See this snippet[code]A.PHP:<?php$a=urlencode("#123456");echo "<a href='b.php?parm=$a'>Click</a>";?>B.PHP<?phpecho ' parm='.urldecode($_GET['parm']);?>[/code]Ronald 8) Link to comment https://forums.phpfreaks.com/topic/27760-_get-problems/#findComment-127012 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.