johnh2009 Posted October 1, 2009 Share Posted October 1, 2009 Introductions 1st Hi all im john, im very new to PHP. I made a fansite for F1 sim racing a few years ago but didnt carry it on, now im reteaching myself but its not going too well. I woul dbe very grateful for any help anyone can give I made a website for my F1 simracing a while back, anyway the linking i used is no longer working. i use this link: echo “”. $shownews .”…….Read More“; the url address has the id in it ie: news.php?nid=13 and the news page has the following in it: $kysely = mysql_query(”select * FROM igpcnews WHERE id=’$nid’”,$yhteys); but i always get Notice: Undefined variable: nid in C:\wamp\www\site\news.php on line 41 This used to work a few years ago, im guessing the newer PHP dont work the same as the older because i dont know whats up with it. Can anyone help?? Link to comment https://forums.phpfreaks.com/topic/176199-link-issues/ Share on other sites More sharing options...
thebadbad Posted October 1, 2009 Share Posted October 1, 2009 I'm guessing you were relying on the register_globals setting being On back then. You access GET variables (the ones set via the URL) with $_GET['name'], so in your case you could simply assign the correct variable to $nid, before using it: $nid = $_GET['nid']; This also applies to POST variables (the ones sent via an HTML form), where the value of a text field named name is accessed with $_POST['name']. Link to comment https://forums.phpfreaks.com/topic/176199-link-issues/#findComment-928538 Share on other sites More sharing options...
johnh2009 Posted October 1, 2009 Author Share Posted October 1, 2009 excellent, thank you that worked Thank you for the quick reply, i felt like i could not carry on until i had this working Link to comment https://forums.phpfreaks.com/topic/176199-link-issues/#findComment-928542 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.