In my code, there is a form where you enter some information and it grabs some stats based on your entered information. The url looks something like this:
[/url]http://localhost/API%20Module/insert_character.php?apiKey=D4FA7D5A748D4BF38B42F608177E4EF431EBB989CB484EBEB73E96A0FC43F4B0&userID=714244[/url]
When the user is directed there, it lists up to 3 entries, all of which have a link to
[/url]http://localhost/API%20Module/insert_character.php?apiKey=D4FA7D5A748D4BF38B42F608177E4EF431EBB98[/url]
9CB484EBEB73E96A0FC43F4B0&userID=714244&charID=07146415726&insert_characters=Submit+Characters
where charID=07146415726 is a unique number based on the entry the user clicks.
My problem is there when the user clicks submit the first time on the original form, it takes the userID and the apiKey and inserts it into the database no problem. However, when the user clicks an entry instead of grabbing the charID from the URL and putting it into the database, it just outputs the success message without inputting it.
My Code used:
IF statement handling the charID portion:
if($_GET['submitted'] == 'yes')
{
$charID = $_GET['charID'];
$api = $_GET['apiKey'];
$user_ID = $_GET['userID'];
echo "Successful";
insert_charID($api, $user_ID, $charID);
}
Insert_charID Function
function insert_charID($api, $userid, $charid)
{
$update_query = "UPDATE user_info SET char_id = '$charid' WHERE api_key = '$api' AND user_id = '$userid'";
mysql_query($update_query) or die(mysql_error());
$text = "Char ID Update Successfully";
echo $text;
}