[TC] Gaming Forums

Full Version: MySQL Help Needed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am trying to create an online exam. Similar to Island Life Gaming.
Some of the ready made projects are for downloads only. I need one which brings up/redirects to a page that is not accessible via the directories. One with a unique link that expires once used.

If anyone could help me find one or make one, that would be much appreciated.

Thanks,
Raz!
I think that with Google you can create something that only can enter 1 time with 1 email...
Hello, I have created a system so that when this page is viewed, it updates the password in the database.
This is the code:

Code:
<html>
<head>
<title>Password Generator</title>
</head>
<body>
<?php
function generatePassword($length = 19) {
    $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
    $count = mb_strlen($chars);

    for ($i = 0, $result = ''; $i < $length; $i++) {
        $index = rand(0, $count - 1);
        $result .= mb_substr($chars, $index, 1);
    }
    return $result;
}
echo generatePassword();
$dbhost = '*********';
$dbuser = '*********';
$dbpass = '*********';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
  die('Could not connect: ' . mysql_error());
}
$sql = "UPDATE mst_user
   SET pass = '$result'
   WHERE user_id = 2";
mysql_select_db('a2097679_quiz');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
  die('Could not update data: ' . mysql_error());
}
echo "<br>Password Changed\n";
mysql_close($conn);
?>
</body>
</html>

When this is ran, in the database the password (pass) value shows empty. If I change the 'SET' Value to 'TEST' it will show up.
Reference URL's