abitlikehomer Posted January 10, 2010 Author Share Posted January 10, 2010 Huh.... I didn't actually notice you already had a random number appended to the url. Not sure where to go from here really. The code in question could not possibly produce the output firebug is saying. No me neither lol, not that that counts for much. It is obviously picking up the old code from somewhere but they are completely separate files with different links so I have no idea why it is doing this. Thank you for all your help anyway though Quote Link to comment https://forums.phpfreaks.com/topic/187746-undefined-index-error-trying-to-pass-variable-to-another-page/page/3/#findComment-992101 Share on other sites More sharing options...
trq Posted January 10, 2010 Share Posted January 10, 2010 It is obviously picking up the old code from somewhere but they are completely separate files with different links so I have no idea why it is doing this. So are you sure you requesting the correct file? Quote Link to comment https://forums.phpfreaks.com/topic/187746-undefined-index-error-trying-to-pass-variable-to-another-page/page/3/#findComment-992102 Share on other sites More sharing options...
abitlikehomer Posted January 10, 2010 Author Share Posted January 10, 2010 FOUND IT!!! Look in the selectNewsTest.js page. The variable to pass the URL - it is still set to the old link selectNews.js. I have changed it now and it is almost working. It throws up one error message though: Notice: Undefined index: NewsID in /customers/2asmooth.com/2asmooth.com/httpd.www/Kingfisher_Trust/getNewsTest.php on line 9 Quote Link to comment https://forums.phpfreaks.com/topic/187746-undefined-index-error-trying-to-pass-variable-to-another-page/page/3/#findComment-992103 Share on other sites More sharing options...
abitlikehomer Posted January 10, 2010 Author Share Posted January 10, 2010 It is obviously picking up the old code from somewhere but they are completely separate files with different links so I have no idea why it is doing this. So are you sure you requesting the correct file? I wasn't doing - but I noticed it at about the same time as you must have done. Quote Link to comment https://forums.phpfreaks.com/topic/187746-undefined-index-error-trying-to-pass-variable-to-another-page/page/3/#findComment-992104 Share on other sites More sharing options...
abitlikehomer Posted January 10, 2010 Author Share Posted January 10, 2010 One last problem - it now won't pick up the UserID for some reason. So when I finally click save it shows the URL as http://www.2asmooth.com/Kingfisher_Trust/editReceipt.php?NewsID=b%3EN Why is this? Final request I promise. Quote Link to comment https://forums.phpfreaks.com/topic/187746-undefined-index-error-trying-to-pass-variable-to-another-page/page/3/#findComment-992109 Share on other sites More sharing options...
trq Posted January 10, 2010 Share Posted January 10, 2010 The undefined index is easy fixed. <?php include "connection.php"; if (isset($_GET['NewsID'])) { $NewsID = mysql_real_escape_string($_GET['NewsID']); $query = "SELECT Title, `Date`, Content FROM News WHERE NewsID = $NewsID LIMIT 1"; if ($result = mysql_query($query)) { if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); echo $NewsID . '||' . htmlentities($row['Title']) . '||' . htmlentities($row['Date']) . '||' . htmlentities($row['Content']); } } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/187746-undefined-index-error-trying-to-pass-variable-to-another-page/page/3/#findComment-992111 Share on other sites More sharing options...
trq Posted January 10, 2010 Share Posted January 10, 2010 Sorry, but I have never seen any code that points to editReciept.php Quote Link to comment https://forums.phpfreaks.com/topic/187746-undefined-index-error-trying-to-pass-variable-to-another-page/page/3/#findComment-992112 Share on other sites More sharing options...
abitlikehomer Posted January 10, 2010 Author Share Posted January 10, 2010 Sorry, but I have never seen any code that points to editReciept.php Sorry - that is part of the code when the second form is called. However I have corrected the mistake now and everything works! Thorpe I cannot thank you enough for all the help and support you've given me the last couple of days - you're a life saver. If your in the UK and ever up north I owe you many a pint!! Thanks I can finally mark this as closed! YAY!!!!!!!!! Quote Link to comment https://forums.phpfreaks.com/topic/187746-undefined-index-error-trying-to-pass-variable-to-another-page/page/3/#findComment-992117 Share on other sites More sharing options...
trq Posted January 10, 2010 Share Posted January 10, 2010 Sweet, I didn't think we where ever going to get there! Glad its all working now. Quote Link to comment https://forums.phpfreaks.com/topic/187746-undefined-index-error-trying-to-pass-variable-to-another-page/page/3/#findComment-992119 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.