sure thing, everything works except retrieving the info
here is the code that is supposed to output data
<?
include ("dbconnect.php");
mysql_select_db("maverick") or die(mysql_error());
$id = $_GET['id'];
$query = "SELECT * FROM information WHERE id = '$id' ";
$result = mysql_query($query) or die (mysql_error());
$row = mysql_fetch_array($result);
echo "To: $row[recipiant]<br />";
echo "From: $row[sender]<br />";
echo "Email: $row[email]<br />";
?>
When the user submits info, it is submitted to a table, the only variable i have trouble with is the ID. I get a unique id created, and stored, i Just can't retrieve the ID and therefor the data.
Code for Submit Page
<?
session_start();
include ("dbconnect.php");
mysql_select_db("maverick");
$recipiant = $_POST['recipiant'];
$sender = $_POST['sender'];
$email = $_POST['email'];
function CreateID($length=16){
$Pool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$Pool .= "1234567890wwwdesign";
for($index = 0; $index < $length; $index++){
$id .= substr($Pool,(rand()%(strlen($Pool))), 1);
}
return($id);
}
$id=CreateID();
$query = "create table information" . "(id varchar(16) NULL, recipiant varchar(255), sender varchar(255), email varchar(255))";
$result = mysql_db_query ("maverick", $query);
if ($result){
echo "Table Created";
}
else{
echo mysql_errno().": ".mysql_error()."<BR>";
}
$query2 = "insert into information values ('$id','$recipiant','$sender','$email') ";
$result2 = mysql_db_query ("maverick", $query2);
if ($result2){
echo "Success!";
}
else{
echo mysql_errno().": ".mysql_error()."<BR>";
}
$mailTo = "$email";
$mailSubject = "You an ecard from WWW Design!";
$mailHeader = "From: $sender";
$message = "Hello $recipiant, $sender has sent u an Ecard. You can view this card at the following webpage: ";
//display link
$message .= "http://maverick.sifen7.com/card/viewcard.php?ID=";
//display randomly created id
$message .= $id;
mail($mailTo, $mailSubject, $message, $mailHeader) or die (mysql_error());
$query3 = "SELECT * FROM information";
$result = mysql_query($query3);
$row = mysql_fetch_array($result);
echo "To: $row[recipiant]<br />";
echo "From: $row[sender]<br />";
echo "Email: $row[email]<br />";
session_destroy();
mysql_close ();
?>
Even though i already have a table created, i just left create table in there for testing purposes, and i always test to make sure the data is stored by outputting it. Thanks for the help in advance