Jump to content

A Timestamp Wtf


dark dude

Recommended Posts

Ok, I've been in need of timestamps, and all was going well, but for some reason, it doesnt like to put the timestamp onto my database...

Look at my script:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?
session_start();
?>

<body bgcolor='#000033' text='#CCFFFF'>

<?

$Username = $_SESSION['Username'];

$Reciever=$_POST['Reciever'];
$Type=$_POST['Type'];
$Subject=$_POST['Subject'];
$MessageBody=$_POST['MessageBody'];

include("dbinfo.inc.php");

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query = "SELECT * FROM Users WHERE Username='$Reciever'";
$result = mysql_query($query) or die(mysql_error());

$Username3=mysql_result($result,$i,"Username");

$quotes_array = file('gamemods.txt');

if($Username3==''){
echo "The Reciepant does not exist!";
}
else {

if($Type=="Report"){
$quote = $quotes_array[rand(0, count($quotes_array) - 1)];
$quote = trim($quote);

$query = "INSERT INTO Messages VALUES ('',UNIX_TIMESTAMP(),'$Username','$quote','$Subject','$MessageBody','$Type')";
mysql_query($query);
} else {
$query = "INSERT INTO Messages VALUES ('',UNIX_TIMESTAMP(),'$Username','$Reciever','$Subject','$MessageBody','$Type')";
mysql_query($query);
}
mysql_close();

?>

Your <?
if($Type=="Report"){
echo "Report ";
}
elseif($Type=="PM"){
echo "Private Message ";
}
elseif($Type=="SPM"){
echo "Anonymous Private Message (This type of Private Message is not shown in Mod Message logs) ";
}
else{
echo "$Type ";
}
?>
has been sent!<br><br>
Please note that Reports are automatically sent to Game Moderators to prevent confusion.

<?
}
[/quote]

Everything seems to be ok, but look what happens when I go through the script:

[a href=\"http://img327.imageshack.us/img327/1303/tsprob1nf.png\" target=\"_blank\"]http://img327.imageshack.us/img327/1303/tsprob1nf.png[/a]

Incase you needed to know, here's the databases settings that it goes to:
[a href=\"http://img288.imageshack.us/img288/7987/fissue5nv.png\" target=\"_blank\"]http://img288.imageshack.us/img288/7987/fissue5nv.png[/a]

Any help that works will be much appreciated [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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