darkninja_com Posted January 31, 2007 Share Posted January 31, 2007 For a link like: http://localhost/project/company_news_details.php?news_id=0000000015 On some server, I was able to use the variable $news_id (with value 0000000015) but on other servers the value couldn't be extracted. (echo $news_id didn't print anything) Does anyone know what made the difference? And how to solve it? Thank you, Quote Link to comment https://forums.phpfreaks.com/topic/36507-solved-extract-variables/ Share on other sites More sharing options...
s0c0 Posted January 31, 2007 Share Posted January 31, 2007 For starters that link isn't going to work for anyone but you. Either replace localhost with a FQDN or an IP Address so we can actually see the site. Quote Link to comment https://forums.phpfreaks.com/topic/36507-solved-extract-variables/#findComment-173809 Share on other sites More sharing options...
Jessica Posted January 31, 2007 Share Posted January 31, 2007 You need to use $news_id = $_GET['news_id']; Read about register_globals. Quote Link to comment https://forums.phpfreaks.com/topic/36507-solved-extract-variables/#findComment-173810 Share on other sites More sharing options...
The Little Guy Posted January 31, 2007 Share Posted January 31, 2007 jesirose's way is on way, or if you don't want to make a variable you can do it this way: echo $_GET['news_id']; Quote Link to comment https://forums.phpfreaks.com/topic/36507-solved-extract-variables/#findComment-173900 Share on other sites More sharing options...
darkninja_com Posted February 1, 2007 Author Share Posted February 1, 2007 Oh, i love u guys. This is what I've been looking for all the time. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/36507-solved-extract-variables/#findComment-174625 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.