Jump to content

iMakeAngry

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

iMakeAngry's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yeah right after I posted it I realized it and changed the password.
  2. Sorry about the late reply, since I couldn't get it to work I didn't feel the need to save the code, but this is basically what I used last <?php $username="imakeang_angry"; $password="tpark701234"; $database="imakeang_records"; mysql_connect(localhost,$username,$password); mysql_select_db($database); $ip = $_SERVER['REMOTE_ADDR']; $query="SELECT * FROM ip WHERE address='$ip'" or die(mysql_error()); $result=mysql_query($query) or die("mysql_error() 1"); $ip_rec_address=mysql_result($result,$i,"address"); $ip_rec_sent=mysql_result($result,$i,"sent"); if ( $ip_rec_address == $ip ) { if ( $ip_rec_sent == 2 ) { echo "You have sent too many messages today, wait until tomorrow to send another."; } else { $query = "INSERT INTO global_sent VALUES ('$result + 1')"; mysql_query($query); echo "$result messages sent."; } } mysql_close(); ?> This returns "Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 5" on line 27 and 18. The Little Guy - I'll try that out right now.
  3. So, to keep this as short as possible, I am almost done making a website that lets visitors send already-made text messages to people. I just paid for hosting for the site, and they told me that I can only send 100 messages in one hour. This is fine as I was already intending on setting limits per ip address. So, I've set up MySQL and everything else works correctly. My only problem is that on the test script I've been working on over the weekend doesn't successfully check to see if an ip address exists in the database. Let me try and better explain what I need to do: I need the visitor's ip address to be logged on to the database the first time that they send a message in a day. (This part works.) But before it logs their ip address, it needs to check to see if it was already logged for the day. If their ip IS there then it will check to see how many messages they've sent today, if it is less than 5 then it will let them send the message and add 1 to the log. Otherwise it won't let them send the message. Tell me if it sounds too complicated.
×
×
  • 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.