Ell20 Posted November 28, 2007 Share Posted November 28, 2007 Hi, Im attempting to make a link which when clicked gets the data for a specific result then displays the results, I have done a couple before but for some reason this one isnt working: Link Code: <a href='<?=$_SERVER['PHP_SELF']."?result_id=$resultid";?>&mode=view'>View</a> Code to execute when link is pressed: <?php if ($_GET['mode'] == "view"){?> [color=red]= line 224[/color] etc etc <?php } ?> The error I have is displayed on the screen all the time, its not even when I click View: An error occured in script /home/mysport/public_html/results.php on line 224: Undefined index: mode Thanks for your help Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted November 28, 2007 Share Posted November 28, 2007 That means the code was being executed without the link being invoked. Try: <?php if (isset($_GET['mode']) && $_GET['mode'] == 'view') { ?> Ken Quote Link to comment Share on other sites More sharing options...
Ell20 Posted November 28, 2007 Author Share Posted November 28, 2007 Excellent, thanks alot, you answered my next question without me even asking it, genius 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.