Jump to content

[SOLVED] getting section of a url


chocopi

Recommended Posts

thats what i thought.

 

could you please try and sort this:

 

<?

require_once ('page_header.php');

require_once ('url.php');

$code = urlpart();

$query = "SELECT active FROM users WHERE code = '$code'";

$update = "UPDATE users SET active ='1' WHERE code = '$code'";
mysql_query($update) or die (mysql_error());

print ("<br /> \n");
print ("<center> \n");
print ("$username, your account is now active, please login on the homepage. \n");
print ("<br /> \n");
print ("<br /> \n");
print ("<a href=\"index.php\">Home Page</a> \n");
print ("</center> \n");

?>

 

url.php is where the code you gave me earlier and page_header.php is the database connection.

 

so what this is meant to do is just update the active field from 0 to 1 using the code you gave me to get the activation code

 

thanks,

 

~ Chocopi

<?php

require_once ('page_header.php');

require_once ('url.php');

$inputcode = urlpart();

$query = "SELECT * FROM users WHERE code = '$inputcode'";
$result = mysql_query($query) or die(mysql_error());
$result = mysql_fetch_assoc($result);

$realcode = $result['code'];
$username = $result['username'];

$update = "UPDATE users SET active ='1' WHERE username = '$username'";
mysql_query($update) or die (mysql_error());

print ("<br /> \n");
print ("<center> \n");
print ("$username, your account is now active, please login on the homepage. \n");
print ("<br /> \n");
print ("<br /> \n");
print ("<a href=\"index.php\">Home Page</a> \n");
print ("</center> \n");

?>

Try that

Archived

This topic is now archived and is closed to further replies.

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