Jump to content

Undefined index error: Trying to pass variable to another page


abitlikehomer

Recommended Posts

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 :)

Link to comment
Share on other sites

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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
Link to comment
Share on other sites

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']);
    }
  }
}
?>

Link to comment
Share on other sites

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 :D

 

I can finally mark this as closed! YAY!!!!!!!!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.