Richter12x2 Posted September 11, 2007 Share Posted September 11, 2007 I did some searching and haven't been able to find any useful information. I have a simple page that I'm trying to use as a shortcut for activating a user in a SQL database, but I can't seem to capture the variable. I've found 5 or 6 pages now that say "This is how you do it" but obviously I'm missing something. Whenever the page is called - "activate.php?user_id=27" it displays "There has been an error processing your request" so I added the echo statements to confirm the variable is blank, and nothing prints, so it is. If I manually set the variable $user_id = '27' then it processes perfectly. What am I missing? Here's the entire text of the page - <? require("../dbsql.php"); $user_id = $_get['user_id']; echo $_get['user_id']; echo $user_id; if ($user_id != '') { $sqlcUseredit="update userinfo set status ='A' where user_id=$user_id"; dbSQLinsert($sqlcUseredit); echo $user_id." activated!"; } else { echo "There has been an error processing your request."; } ?> Link to comment https://forums.phpfreaks.com/topic/68862-solved-php-_get-from-a-url/ Share on other sites More sharing options...
pocobueno1388 Posted September 11, 2007 Share Posted September 11, 2007 I'm not sure if the $_GET is case sensitive or not...but try to capitalize it and see if it works. $user_id = $_GET['user_id']; echo $_GET['user_id']; EDIT: Yeah, thats the problem. I just tested it. Link to comment https://forums.phpfreaks.com/topic/68862-solved-php-_get-from-a-url/#findComment-346110 Share on other sites More sharing options...
Richter12x2 Posted September 11, 2007 Author Share Posted September 11, 2007 Son of a . . . Thank you! Link to comment https://forums.phpfreaks.com/topic/68862-solved-php-_get-from-a-url/#findComment-346134 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.