Dragosvr92 Posted June 30, 2010 Share Posted June 30, 2010 Hey i am making a page and i want the first page to have a title and when submitting the GET Form to change the title completly so i made myself this little script but it gives me this error at the unset line Parse error: parse error in C:\wamp\www\New Folder\index.php on line 8 <? if (unset($_GET['ID'])){ echo 'Title from the First page'; } else { if (isset($_GET['ID'])) echo 'Tracked'$_GET['ID']; } ?> Dos anyone have an idea how may i get it fixed? Link to comment https://forums.phpfreaks.com/topic/206332-change-tite-on-submit/ Share on other sites More sharing options...
marcus Posted June 30, 2010 Share Posted June 30, 2010 <?php if (unset($_GET['ID'])){ echo 'Title from the First page'; } else { if (isset($_GET['ID'])) echo 'Tracked' . $_GET['ID']; } ?> Link to comment https://forums.phpfreaks.com/topic/206332-change-tite-on-submit/#findComment-1079359 Share on other sites More sharing options...
Dragosvr92 Posted June 30, 2010 Author Share Posted June 30, 2010 Thanks but that wasnt the thing.. forgot to add a dor or a comma there but the problem is at the unset part test the script and you will see what i mean Link to comment https://forums.phpfreaks.com/topic/206332-change-tite-on-submit/#findComment-1079361 Share on other sites More sharing options...
marcus Posted June 30, 2010 Share Posted June 30, 2010 Ha, my error pick up was right off the bat didn't look at the beginning of the code. unset is to basically remove anything tied to the variable. For instance unset($_SESSION['username']) You want to do something like: <?php if(isset($_GET['ID'])){ echo "Tracked" . htmlentities($_GET['ID']); }else { echo "Title from the First page"; } ?> Link to comment https://forums.phpfreaks.com/topic/206332-change-tite-on-submit/#findComment-1079362 Share on other sites More sharing options...
Dragosvr92 Posted June 30, 2010 Author Share Posted June 30, 2010 Yeah ! that was the thing i wanted to do Thank You Very much i support here Link to comment https://forums.phpfreaks.com/topic/206332-change-tite-on-submit/#findComment-1079365 Share on other sites More sharing options...
Dragosvr92 Posted July 1, 2010 Author Share Posted July 1, 2010 Hmm i put all the script on a single line and i tryed to echo it (all the script) on a $string but it is giving me this error Parse error: parse error in C:\wamp\www\ym\index.php on line 17 Link to comment https://forums.phpfreaks.com/topic/206332-change-tite-on-submit/#findComment-1079442 Share on other sites More sharing options...
kenrbnsn Posted July 1, 2010 Share Posted July 1, 2010 Please post your entire script. Ken Link to comment https://forums.phpfreaks.com/topic/206332-change-tite-on-submit/#findComment-1079457 Share on other sites More sharing options...
Dragosvr92 Posted July 1, 2010 Author Share Posted July 1, 2010 the script is 2 posts upside... anyways here it is <?$TEST = if(isset($_GET['ID'])){echo "Tracked :" . ' ' .htmlentities(ucfirst($_GET['ID']));} else {echo "Yahoo! Messenger Tracker";}?> why is it giving me that Parse error: parse error in C:\wamp\www\ym\index.php on line 17 error? Link to comment https://forums.phpfreaks.com/topic/206332-change-tite-on-submit/#findComment-1079462 Share on other sites More sharing options...
kenrbnsn Posted July 1, 2010 Share Posted July 1, 2010 You can't do it that way. Try <?php $TEST = (isset($_GET['ID']))? "Tracked : " . htmlentities(ucfirst($_GET['ID'])):"Yahoo! Messenger Tracker"; ?> Ken Link to comment https://forums.phpfreaks.com/topic/206332-change-tite-on-submit/#findComment-1079470 Share on other sites More sharing options...
Dragosvr92 Posted July 1, 2010 Author Share Posted July 1, 2010 Thanks Ken ! i dont understand the php way u wroted it but it works great Link to comment https://forums.phpfreaks.com/topic/206332-change-tite-on-submit/#findComment-1079476 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.