Jump to content

DarkShadowWing

Members
  • Posts

    79
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

DarkShadowWing's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. can someone show me an example of how to create and use an id for a person to identify who that certain person is?
  2. thats it! im closing this thread. im tired of u ppl making fun of me!
  3. Hi all. After lots of research, I finally got this darn code to work. The only problem is I don't know how to detect which user is banned on the website and which user is not, or which user has a warning, and which 1 does not. i want to detect which user is what by the user's 1st name, and last name. or should i make a table that hold's their ip? if so, how would i do that? a working example would be GREAT! Code: $query = "SELECT $warning1, $banned1 FROM $tbl;"; var_dump($query."<br>\n"); $result = mysql_query($query) or die(mysql_error()); //now lets go through every row returned. while($row = mysql_fetch_assoc($result)){ $warning = $row[$warning1]; $banned = $row[$banned1]; $rows = mysql_num_rows($result); echo "query: ".$query."<br>\n"; echo "result: ".$result."<br>\n"; echo "row: ".$row."<br>\n"; echo "warning: ".$warning."<br>\n"; echo "banned: ".$banned."<br>\n"; echo "rows: ".$rows."<br>\n"; if($warning > 0){ ANY help is GREATLY appreciated!
  4. If I wanted to create a table in my database with TIMESTAMP DEFAULT CURRENT_TIMESTAMP, and wanted to check if the same person submitted data before the next day and send an error message depending on if 24 hours has passed on the same person, how would i do that? how could i use this "WHERE timesamp >NOW() +INTERVAL 1 DAY", to detect if its been 24 hours or not since that person's 1st submit? here's the table: <?php $conn = "localhost"; $user = "myuser"; $pass = "mypass"; $dbname = "metaldetect02"; $tbl2 = "users0002"; $con = mysql_connect($conn,$user,$pass); if (!$con) { die('Could not connect to database: "' . $dbname . '" because ' . mysql_error()); } mysql_select_db($dbname, $con); $sql="INSERT INTO $tbl2 (item, firstname, lastname) VALUES ('".$_POST[requireditem]."','".$_POST['requiredfirstname']."','".$_POST['requiredlastname']."')"; echo "Thanks for submitting your item, ".$_POST['requiredfirstname'].", ".$_POST['requiredlastname']."!<br>"; echo "Returning you to the previous page..."; echo "<script>setTimeout('document.location = \"./\";', 2000);</script>"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con); ?> ANY help is GREATLY appreciated!
  5. Ok, using this code, can someone at least help me modify it to detect whether or not its 24 hours later since the 1st submit? <?php $thismonth = date("m"); if ($thismonth=="01") // list January's dates { echo "<ul id=\"dateslist\">"; echo "<li>Wed, 7th January</li>"; echo "<li>Wed, 14th January</li>"; echo "<li>Wed, 21st January</li>"; echo "<li>Wed, 28th January</li>"; echo "</ul>"; } elseif ($thismonth=="02") // list February's dates { echo "<ul id=\"dateslist\">"; echo "<li>Wed, 4th February</li>"; echo "<li>Wed, 11th February</li>"; echo "<li>Wed, 18th February</li>"; echo "<li>Wed, 25th February</li>"; echo "</ul>"; } ?> <?php $conn = "localhost"; $user = "myuser"; $pass = "mypass"; $dbname = "metaldetect02"; $tbl2 = "users0002"; $con = mysql_connect($conn,$user,$pass); if (!$con) { die('Could not connect to database: "' . $dbname . '" because ' . mysql_error()); } mysql_select_db($dbname, $con); $sql="INSERT INTO $tbl2 (item, firstname, lastname) VALUES ('".$_POST[requireditem]."','".$_POST['requiredfirstname']."','".$_POST['requiredlastname']."')"; echo "Thanks for submitting your item, ".$_POST['requiredfirstname'].", ".$_POST['requiredlastname']."!<br>"; echo "Returning you to the previous page..."; echo "<script>setTimeout('document.location = \"./\";', 2000);</script>"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con); ?>
  6. i cant store it in a database because technically nobody has submitted data yet. what i need to do is use php to detect if after submission, it's the next day, if not then return error, if so, then allow for another submission. can someone please show me a working example?
  7. Hi all. I need to know how after a person submits some data, that it will return an error message until the next day? Example: I submit my data. it returns an error message until the next day. then it lets me submit again. <?php $conn = "localhost"; $user = "myuser"; $pass = "mypass"; $dbname = "metaldetect02"; $tbl2 = "users0002"; $con = mysql_connect($conn,$user,$pass); if (!$con) { die('Could not connect to database: "' . $dbname . '" because ' . mysql_error()); } mysql_select_db($dbname, $con); $sql="INSERT INTO $tbl2 (item, firstname, lastname) VALUES ('".$_POST[requireditem]."','".$_POST['requiredfirstname']."','".$_POST['requiredlastname']."')"; echo "Thanks for submitting your item, ".$_POST['requiredfirstname'].", ".$_POST['requiredlastname']."!<br>"; echo "Returning you to the previous page..."; echo "<script>setTimeout('document.location = \"./\";', 2000);</script>"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_close($con); ?>
  8. hey kingphillip, no offense,but i DO have a friggin learning disability. It's called ADD and i dont CARE what u all think, Im NOT afraid to say it.
  9. good. anybody else who thinks my learning disability needs improvement? leave now..
  10. i AM appreciative. You people don't seem to understand. I HAVE A LEARNING DISABILITY. and u bringing me out like that in front of the crowd. thats LOW... So I'm sorry if I don't understand u like u "want me to"..
  11. sheesh, u coulda been nice to me instead of all mean like that.
  12. well excuse me for barely being able to understand some of what YOU guys say to.. so i think im doing just fine.
×
×
  • 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.