1st: in the admin cp of my news, im having it so when u post a news, it puts the username of the poster, i got it working with the comments, but for some reason it doesnt work for posting the news. heres the code:
<div align='center'><form name='form1' method='post' action='newsadmin.php?action=add'> <input size="20" type='hidden' value='<? echo $_SESSION['s_username'] ?>' name='username' maxlength='100' /><br> Title: <input name="title" type="text" class="textarea" id="title"> <br> <br> <input type="hidden" name="id"> <textarea name='newstext' cols='50' rows='10' wrap='VIRTUAL' class='textarea' id="newstext"></textarea> <br> <input class="textarea" type="reset" name="Reset" value="Reset"> <input class="textarea" type="submit" name="Submit" value="Submit"> </form></div><br>Thats for the add form, and this is the insert sql
$date = time();
$sql = mysql_query("INSERT INTO news (id,title,newstext,username,date)"."VALUES ('NULL', '$title', '$newstext', '$username', '$date')");
header( 'refresh: 0; url=http://gamingreloaded.com/zp/news%20cms/newsadmin.php' );
What happens is that it puts the name of the database, not the username, i had this happen before, but i forgot how to fix it.2nd: when i post the news, it puts the date automaticly, using the sql above, but even tho i posted it at 1:55PM, it says 7:55PM, it adds 6 hours.
to show the date on the news page, i put
$date = date('D, F j, Y \a\t h:i A', $r["date"] + $trow["timezone"]);
PS: the
+ $trow["timezone"])doesnt change it
please help me, i need to get this fixed, fast
Edited by venomsnake, 31 December 2005 - 03:15 PM.
