
Originally Posted by
bunglebrown
wow that is pretty impressive...
Thanks!

Originally Posted by
bunglebrown
So do I need to set up a mySQL database? To explain a bit further for my project - there will be 4 pages submitting different information on each, also it is not a registry so users don't require passwords - only to be sent to unique pages so that they cannot skip (as understood).
As far as I understand it, you do not have a "registry" i.e. no users.
The MySQL is purely a backend database that stores information. If you don't need to store anything for future reference, you don't need the database and php is perectly capable of operating without it.

Originally Posted by
bunglebrown
1) How is $memid randomly generated?
Simple:
I have a function that can in the main page script or as a seperate file:
PHP Code:
<?php
//function to create random string
function createRandomString() {
//specify characters to be used
$chars = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
//specify the string length
while ($i <= 25) {
$num = rand() % 70;
$tmp = substr($chars, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
?>
This function can then be called for any number of uses.
PHP Code:
<?php
// Usage
$randomwhatever = createRandomString();
$memid = createRandomString();
$boguscharacterstring = createRandomString();
?>

Originally Posted by
bunglebrown
2) How is this achieved?
This unfortunately does require MySQL as you have to store some values for verification - as a minimum, you need to store the e-mail address.
To ensure fully that an e-mail is valid (not just formatted correctly), you need to send an e-mail to the e-mail address supplied and allow that person to reply to it. If you don't get a response, the user has either not botheres or it was not valid.
PHP Code:
<?php
$email = $_POST['email'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= 'From: you(you@yoursite.com)' . "\r\n";
$headers .= 'Reply-To: you@yoursite.com' . "\r\n";
$headers .= 'Return-Path:'.$email. "\r\n";
$headers .= 'X-Sender: '.$email. "\r\n";
$headers .= 'X-Mailers: PHP /'.phpversion() . "\r\n";
$subject = "E-mail address Verification";
$message = '
<html>
<body>
<font size="2" face="Arial">
<p>Thank you for .... whatever.</p>
<p>Please click on the link below to complete your registration. </p>
<p><a href="http://www.yoursite.com/verify.php?memid='.$memid.'"> www.yoursite.comverify.php?memid='.$memid.' </a></p>
<p><em>
Do not reply to this e-mail. If you have received this e-mail in error, please ignore it.
</em></p>
</font>
</body>
</html>
';
ini_set(sendmail_from,$email);
if (@mail('<'.$email.'>',stripslashes($subject),stripslashes($message),stripslashes($headers)))
{
echo ('
<p>Verification e-mail successfully sent to '. $email . '</p>
');
}
else
{
echo ('
<p>Error! The verification e-mail has failed to send to ' . $email . '. Please try again.</p>
');
}
ini_restore( sendmail_from );
?>
The verification page creates a recordset from the carried $memid (obtained by using $_GET['memid']) and using that to verify that a response has been had from the e-mail address.
Without knowing exactly what you are after, it is difficult to specify what you shoud be doing, which is why this explanation is a little obscure....