Jump to content

dark dude

Members
  • Posts

    53
  • Joined

  • Last visited

    Never

Everything posted by dark dude

  1. [code]<input name="uploadedfile" type="file"  READONLY>[/code] :) That should work
  2. Why not use "READONLY" instead of "DISABLED"? That might help
  3. Yea, I use phpmyadmin, the table definition? I think that's this right?: BannedUntil timestamp No 0000-00-00 00:00:00             Browse distinct values Change Drop Primary Unique Index Fulltext (Sorry for late reply, couldnt get to the internet because the modem died)
  4. Offtopic: Also, is bumping topics legal?
  5. I tried, but it wont let me change it to anything out of 0000-00-00 00:00:00 format  :(
  6. [quote author=kenrbnsn link=topic=101430.msg401667#msg401667 date=1153578631] That's because your field is not type timestamp, but type datetime. BTW, if you had asked the original question in the context of MySQL, like you just did above, you would have gotten a different answer. Ken [/quote] Oh sorry, my apologies. Also, it is type timestamp: http://img95.imageshack.us/img95/2646/timestampcs5.png
  7. Your table 'chinese.sponsors' doesn't exist... Remember, it is Caps sensitive, and I'm guessing you want that date to be now, in which case, in your statement, use CURRENT_TIMESTAMP(NOW()). Ie: [code]$query = "UPDATE sponsors SET status='-1' WHERE end_date<=CURRENT_TIMESTAMP(NOW())"; mysql_query($query);[/code]
  8. Um... explain it slowly and I might be able to help you.. Do you mean the script takes information from the checkbox form, then puts it into "adminmeny"?
  9. Game Development I guess... If PHP-based online games count ;)
  10. I'm dark dude, started HTML and CGI when I was 10, learned C when I was 12, now know PHP and learning C++. I am just 14.
  11. If "Assembly language" is C/C+/C++ then yes, I do knowa small amount of Assembly language =]
  12. Sessions, most users' browsers are set to block cookies anyway
  13. Ok, so far so good, but I want to know how to put that into a database, with its field-type as "timestamp". At the moment, I input it like this: [code]$query="UPDATE Users SET Status='Banned', BannedBy='$Username', BannedOn=CURRENT_TIMESTAMP(NOW()), BannedFor='$Banreason', BannedUntil='$Banlength' WHERE Username='$Victim'"; mysql_query($query);[/code] and when it's put on the databse, it reads on the database that they're banned until 0000-00-00 00:00:00 Any assistance for this bit? It should read the date off the database as 10,000 days into the future, not the beginning of time...
  14. I can't seem to get the following to work... [quote]if($Category=='Multi'){ $Banlength = UNIX_TIMESTAMP(NOW()) + 864000000; echo $Banlength; } else { echo 'I r t3h h4x'; }[/quote] It should return 10,000 days into the future if the category is multi, but it doesnt... It doesnt print anything except the usual page markup (So it's not a fault in php). Anybody got any advice?
  15. [code]<input name="uid" type="text" name="uid" value="<? echo $uid; ?>" maxlength="30" />[/code] Use name="" not id="" ;)
  16. This isnt working: [quote] <? include("dbinfo.inc.php"); mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $2days = TIMESTAMP(NOW()) - 172800; $query="DELETE FROM Messages WHERE DateSent<'$2days'"; mysql_query($query); echo "Messages Updated"; ?>[/quote] I want it to delete all files older than 2 days from the database when the script activates, but it doesnt work full stop (Blank screen comes up). Help much appreciated ^_^
  17. Oh, it's because I didnt escape properly, it's fixed now, but thanks for telling me about the echo bug check thing, that saved my neck =] Thanks
  18. What's the problem with my script? I get a white page opening it, indicating a problem with the script, but I cant find the problems... [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<? session_start(); $Username = $_SESSION['Username']; 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='$Username'"; $result = mysql_query($query) or die(mysql_error()); $results = mysql_fetch_array($result); $query = "SELECT * FROM Alliances WHERE AllianceName='$results[Alliance]'"; $result2 = mysql_query($query) or die(mysql_error()); $results2 = mysql_fetch_array($result2); $query = "SELECT * FROM Diplomacy WHERE AllianceName='$results[Alliance]'"; $result3 = mysql_query($query) or die(mysql_error()); $results3 = mysql_fetch_array($result3); if($results[Alliance]==""){ ?> <table><tr><th>Alliance Search</th></tr><tr><td><form name="search" method="post" action="alliancesearch.php">Search Alliance Tag <input name="Search" type="text" size="20" maxlength="18"/> <input type="submit">Search</input></form></td></tr></table> <? } else { ?> <table><tr><th>Alliance "<? echo $results2[AllianceName] ?>"'s Panel</th></tr> <tr><td><center>Alliance Name: <? echo $results2[AllianceName] ?></td></tr> <tr><td>Alliance Tag: <? echo $results2[AllianceTag] ?></td></tr> <tr><td>Members: <? echo $results2[Members] ?></td></tr> <tr><td>Rank: <? echo $results[AllianceRank] ?></td></tr> <tr><td><? echo $results2[Description] ?></td></tr> <tr><th>Diplomacy Status</th></tr> <tr><td><? if($results3[War]==""){ echo '<span style=color:red><b>Wars:</b></span> The Alliance is at Peace'; } else { echo '<span style=color:red><b>Wars:</b></span> 1.'.$results3[War].'<br>2.'.$results3[War2].'<br>3.'.$results3[War3].'<br>4.'.$results3[War4].'<br>5.'.$results3[War5].'; } ?> </td></tr> <tr><td><? if($results3[Ally]==""){ echo '<span style=color:red><strong>Wars:</strong></span> The Alliance is Unified'; } else { echo '<span style=color:red><strong>Wars:</strong></span> 1.'.$results3[Ally].'<br>2.'.$results3[Ally2].'<br>3.'.$results3[Ally3].'<br>4.'.$results3[Ally4].'<br>5.'.$results3[Ally5].'; } ?> </td></tr> </table> <? }[/quote] Thanks for any help ^_^, ~Dark dude~
  19. Wow! Thanks very much! I've been to 4 different forums/help teams, and they all havent helped, but you have ^_^
  20. 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\" /]
  21. Ok, i'm trying to create a form where you can update your profile information, or in otherwords, update the data under your logged in field on the database using a script. So far, i've done these scripts: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<body bgcolor='#000033' text='#CCFFFF'> <? session_start(); $Username=$_SESSION['Username']; include("dbinfo.inc.php"); mysql_connect(localhost,$username,$password); $query = "SELECT * FROM Users WHERE Username='$Username'"; $result = mysql_query($query) or die(mysql_error()); $Password=mysql_result($result,$i,"Password"); $Email=mysql_result($result,$i,"Password"); ?> <form action="updated.php" method="post"> <input type="hidden" name="ud_Username" value="<? echo $Username; ?>"> Current Username: <? echo $Username; ?><br> Current Email Address: <? echo $Email; ?><br><br> New Username: <input type="text" name="ud_Username" value="<? echo $Username; ?>"><br> New Password: <input type="text" name="ud_Password" value="<? echo $Password; ?>"><br> New Email Address: <input type="text" name="ud_Email" value="<? echo $Email; ?>"><br> <input type="Submit" value="Update"> </form>[/quote] And this is the updated.php script: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] <? session_start(); $Username=$_SESSION['Username']; $ud_Username=$_POST['ud_Username']; $ud_Password=$_POST['ud_Password']; $ud_Email=$_POST['ud_Email']; include("dbinfo.inc.php"); mysql_connect(localhost,$username,$password); $query="UPDATE Users SET Username='$ud_Username', Password='$ud_Password', Email='$ud_Email' WHERE Username='$Username'"; mysql_query($query); echo "Record Updated"; ?>[/quote] It doesnt seem to work, though it seems right. What am I doing wrong, and how do I make it work properly? Thanks, ~Dark dude~
  22. Wow, thanks, you answered everything in almost as few words as possible ^_^
  23. Ok, firstly, how do I block IP addresses from using my site? I know it has something to do with htaccess, but I dont know anything about htaccess files lol... Secondly, how do you get it so when you type in your password, it stars it out? Thanks.
  24. Ok, I know how to assign sessions, you get the information from the Form and assign it to the Session like: $_POST['Username'] = $Username $Username = $_SESSION['Username'] What I wanna know is how you take data from the database where the Session Username == The database username, and assign that to a session, if you get what I mean.
  25. Aaaaah, thanks a lot, and extra thanks for the super-efficient responses =P I think I remember there being a tutorial here about session ids, so i'll find that to answer my other question =] ~Dark dude~
×
×
  • 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.