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? Quote Link to comment 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']; } ?> Quote Link to comment 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 Quote Link to comment 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"; } ?> Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted July 1, 2010 Share Posted July 1, 2010 Please post your entire script. Ken Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Solution kenrbnsn Posted July 1, 2010 Solution 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 Quote Link to comment 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 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.