Jump to content

cardoso

Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.cardoso.ca

Profile Information

  • Gender
    Not Telling
  • Location
    Toronto

cardoso's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you for the replies... I will try these solutions and let you know how it goes. Thank you.
  2. Hi all, someone seems to be spamming a forum of mine. I setup a field that captures ip, host, etc. on the database when a new record is added. I noticed that my "ip catching" field has a NULL value when those spam messages get inserted. The other records (the real ones) all get populated with the IP address and other info. So, I figured I'd validate the user's ip as they are about to insert a record... I figured I could stop the insert if the user doesn't show an IP address. So I use the following if statement to check for user info... if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form_add") && ($_SERVER['REMOTE_ADDR'] != NULL) && ($_SERVER['REMOTE_ADDR'] != 'NULL') && ($_SERVER['REMOTE_ADDR'] != "NULL") && ($_SERVER['REMOTE_ADDR'] != '') && (gethostbyaddr($_SERVER['REMOTE_ADDR']) != "")) { $insertSQL = sprintf("INSERT INTO...... etc. } Notice my overkill of checking for a NULL or empty value... but none of these seem to work. Can someone explain to me what check I have to do to avoid a record insert when the user doesn't show an IP address? Thanks a million... I know this might be easy, but I'm new. Nelson
  3. Wow!!!  This forum is fantastic!!!  You people have been a great help.... HuggieBear... the only change I made was "I took out the '!'"... because I want them to submit if there is an ip address. You got me 99% over that hurdle (I have to do some thinking for myself)... thanks so much! Take care. Nelson
  4. ToonMariner, not sure if you're still following this thread... can you help with one more thing (or anyone else)? I added what another snippet to my if statement before my insert code: if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "malta_add") && ($_SERVER['REMOTE_ADDR'] != "")) {....... I added the:  && ($_SERVER['REMOTE_ADDR'] != "") This was to try to avoid the hacker from even submitting if the ip was empty.  But it didn't work because he was able to submit... and when I look at the database, no value was captured in my "user ip" field.  Have I written this wrong?  Shouldn't that addition have stopped a post if there was no value for $_SERVER['REMOTE_ADDR'? Thanks a million!! Nelson
  5. Hi wildteen88... any gotcha's that I should look out for?  Any "recommends" for solutions? Thanks for replying to my email Nelson
  6. Good call!!!  I've already implimented your idea.  I'm a bit of a newbie with sql so I hadn't thought of that. Thank you soooooooooo much. Nelson Cardoso
  7. Hi All,  I have a community site that I've created as a hobby.... over the past month os so, there's been this guy/girl who has made it their mission to enter loads of crap on my site.  At first it was only 2 or 3 a day... yesterday it was 160. So I implimented one of those "captcha" thing to make it harder... that only helped for a few hours.  Then I started filtering the content in my sql statement... that's getting to be more work then it's worth... he/she has far too many words for me to keep up.  Now I decided to capture and write to the DB the user's info based on ip... so I get the following: $ip = $_SERVER['REMOTE_ADDR']; $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); $referrer_page = $_SERVER['HTTP_REFERER']; $requested_page = $_SERVER['REQUEST_URI']; $AllUserInfo = "----IP:".$ip."----HOSTNAME:".$hostname."----REFERRER PAGE:".$referrer_page."----REQUESTED PAGE:".$requested_page; But that did not work...  I get a NULL value... he's somehow blocking that information. Can someone help?  This is a free site I've created out of the love for my community and this person is making it so hard for me to want to continue. Thanks for any help you might throw my way. Nelson Cardoso
  8. Hi, I have a form where I dynamically create fields using PHP and a while loop. Basically, I display: swimmer name Field | Pace Field | Time Field | Date Field swimmer name Field | Pace Field | Time Field | Date Field swimmer name Field | Pace Field | Time Field | Date Field etc... one line for every swimmer in the table. I want to insert all of these records into a mysql table when they hit submit. I know how to do this with one record but I\'m new and have never done this with multiple records with the same field name. Can you please help me out and please provide a small example as I have a feeling I have to use arrays... and I\'m new at this. Thank you so much! Nelson
×
×
  • 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.