Jump to content

[SOLVED] PHP $_GET from a URL


Richter12x2

Recommended Posts

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
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.