Eliminating Spammers From Adding Records?
I have a website that allows users to add records for their events. Recently I've had a bunch of spammers coming in.
Do you have any tips on how to keep them from entering bogus information.
I have started checking for any "http" in some of the fields but I want to make it even harder for them. Is there a way to check what the referring page is and if it is not the right one to produce an error?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Prevent Adding Duplicate Records
theres a XML file located on the internet. every week or so. this xml file gets updated with one or two new entry's. i have a php script which can read all the entrys i want from this xml file. and then put it into a database. the problem is say i run the php script again to update the database and add the new entry's that the xml file has. every thing gets added again. each time the script is run. the enter xml file entry's are added again. so the database get full with duplicates triplcate records ect ect. how would i go about preventing the same record being added over and over.
Form Scrolling Through Records/adding Removing Data
I can display my data in a HTML but i was wondering how i would display it in a form view. I want the data to be displayed in a text field so that i can scroll through records individually and add and edit data. (Similar to Access) Code:
Eliminating Frames
I have a html thing with a frame. The top has buttons controlling the site and the bottom has info. I get the redirection working but don't know how to get rid of the bottom frame. What happens is that the top frame gets stuffed with the second pages stuff an dhte bottom frame stays static. If I could eliminate the second frame when I redirect, it would work perfectly.
Pulldowns (eliminating Doubles)
I have one table with (amongst others) SUBJECTS. Now every user has subjects so there are doubles (user 1 has NEWS, user 2 had NEWS). On 1 page I want a pulldown that lists these subjects and currently I'm using this: $q = "select onderwerp from mailupdate;"; $r = mysql_query($q); echo "<select name="onderwerp">"; for($i=0;$i<mysql_num_rows($r);++$i) { $arr = mysql_fetch_row($r); echo "<option value="".$arr[0]."">".$arr [0]."</option>"; } echo "</select>"; But I want to eliminate the doubles (just one timme NEWS and not every time it appears in the table.
Eliminating File Extensions
I would like all of my webpages to stop displaying the ".php" or ".html" extensions. How do I do this without rewriting the URLs?
Eliminating Passed URL Variables For Multiple Listings On A Page
I have a page with a list of several users, each hyperlinked to another page of 'more info' about that user. The hyperlink contains the UserNumber, UserRegion, and UserStatus, and the receiving page picks up the data in the passed URL. This works well, but I'd like to eliminate the passing of these variables in the URL. One way is to make a graphic ('More Info') that can be clicked to submit a form. Each 'More info' graphic from the dynamically created page could hold the UserNumber, but how can I pass several variables with a single click? On some pages, there can be 100+ users, and I hate to have 100+ separate forms and hidden fields. I thought of using session variables, how can I know which user was clicked to set the session variables?
My Php Email Script Is Getting Used By Spammers.
I have been using a vert basic php form that sends its contents via email. But recently I am getting hundreds of spam emails that are using my script. Basically, I use a HTML form that sends the value to a PHP script, which sends me an email with the contents. I was told I need to use a ramdom numbers/letters generator or block multiple script uses from the same IP. Could somebody please help me with that or giving me other solutions? I already get the IP information with: $message .= ( "IP = " . $REMOTE_ADDR . ""); Is there a way I could leverage that to avoid the spamming?
Secure (from Spammers) Mail() Script
Does anybody have examples of a secure mail script using the local mail() function in php. I want to write a script that can send email out to external domains that can contain html and text alternative, but is also secure from spammers. I have written many mail functions in the past, just not to external domains that are spam resistant.
How Do You Make A Form Unusable By Spammers Please?
How do you make a form unusable by spammers please? Hi all, I'm desperately trying to get a php form to not be used by spammers, I don't want anything to do with javascript or captcha's. Can anyone please let me know what changes I would need to make to the code on the link below?
Email Forms - Blocking Spammers
I have a couple of email forms I have created that use PHP to email the collected data to the appropriate recipient. A concern has been raised by clients about the form being hacked by spammers. Is this likely to be a problem? If so what is the best way to stop it happening. All I can think of is to maintain a log of, say, users ip addresses and use this the limit the frequency with which the form can be used.
Hiding Email Links From Spammers
Instead of a mailto link, put in a link to a PHP script that contains these lines: <?php header("Location: mailto:test@test.nz"); ?> and this will create a new blank email message with the address in the To field.
Protect Script From Being Hijacked By Spammers?
Recently found out AOL has blocked our company's IP for e-mail for spam. We don't send spam. So I had our server host check it out, and they said huge amounts of spam are being sent through us via a compromised PHP script we have for a Web support form. How is this possible? How can they do this? We validate if certain fields are blank, what else can we do to prevent someone from using our PHP pages to send spam? I don't know if it helps, but here's the last few actual lines we use to send the mail on that page in question: $msg .= "Problem: "; $msg .= "$problem "; $mailheaders = "From: (our domain) Support "; $mailheaders .= "Reply-To: $useremail "; mail("customerservice@(our domain).com", "Customer Service", $msg, $mailheaders);
Stoping Spammers Posting Junk Using IP Address!!!
I have a colomb which stores the users IP I use this code to insert data : <?php mysql_select_db("databse", $con); $IP=GetHostByName($REMOTE_ADDR); $Date = date("Y/m/d"); $tim = localtime(time(),true); $Time=($tim['tm_hour'].":".$tim['tm_min'].":".$tim['tm_sec']); $query="INSERT INTO ads (Email, Title, Date, Time, IP) VALUES ('$Email', '$Title', '$Date', '$Time', '$IP')"; print "Data was inserted successfully"; ?> How can I stop the same IP adding to databse unless minium 6 hours pass by what should i add.
Displaying Priorty Records And Normal Records In The One Dataset.
I have a page which displays the records from the database and uses paging to display the records in groupes of 10 per page. I now want to be able to show results depending on the database field (display) in the database (can be set to either "full" or "limited"). If the record and the field display is equal to "full" i want to then display this record at the top of the record set and display all the fields. If the record is equal to "limited" i want to display different results and they must show after all the records which are equal to "full". I can't output two different recordsets as i use paging and only want to show 10 records per page. Code:
DNS Records
Hey everyone, I'm trying to get a DNS record of an IP using PHP's checkdnsrr() and getmxrr(). I used echo checkdnsrr($REMOTE_ADDR); and echo getmxrr($REMOTE_ADDR); but I receive an error that the PHP build does not support it, but I am using PHP 4.0.5 and in the manual, it shows that PHP 3 and 4 supports the two commands. Any help?
Next N Records
how do I create a "next n records" interface? I want to initially output a specific number of rows, and have a next/previous scenario where the user can click on either and scroll forward or back through the records. I'm currently outputting all rows through mysql_fetch_array: Code:
HOW TO GET HOW MANY RECORDS YOU HAVE IN DB
I finally discover the way how to get what I need. Let's look to my code: ----------------------- CODE ------------------------> $res = @mysql_query("SELECT COUNT(*) AS ToT FROM table_name"); $dato = mysql_fetch_array($res); echo($dato[ToT]); ----------------------- CODE ------------------------> With this code you will get how much records do you have in DB. PS: Whan you think that everything is over and that you are at bottom of trying push harder to see what is under.
Last 5 Records
is there an easy way to grab the last 5 distinct records from an unindexed database? (php/mysql)
Number Of Records
I want to find out how many records, but I am using LIMIT in mySQL so if set the limit to 20 and I have 56 records then it will display 20 instead of 56. I have been using: mysql_num_rows What should I be using?
What To Do If There Are No Records In The Database
I am pulling data from the database and displaying it using the code below: $db = mysql_connect("localhost", "root"); mysql_select_db("pyramid",$db); $result = mysql_query("SELECT * FROM table where area='Wales'",$db); while ($myrow = mysql_fetch_row($result)) { echo "blah blah"; } ?> What do I do if there are no records? At the moment it just doesn't display anything. How do I get it to display a message saying there are no records?
Updating Records
I am know to PHP i've been tring to do this **** for days now could someone PLEASE help me. Ok Im tring make an admin page where user can update multiple records at same time using checkboxes.Im using email as primary key. Here is the code **form page** <form action="update.php" method="post"> <input type="submit" name="submit" value="Select First 10 Names"> </form> **update.php** <?php if ($submit =="Select First 10 Names") { ?> <form method="post" action="<?php echo $PHP_SELF; ?>"> <hr size=3> <?php $query = mysql_query("select * from Names order by Last_Name limit 10"); while($row = mysql_fetch_array($query)) { $first_name= $row["First_Name"]; $middle_name = $row["Middle_Name"]; $last_name = $row["Last_Name"]; $email = $row["Email"]; $photo=$row["Photo"]; ?> <table width="100%" border="0" > <tr> <td align=right width=50%> <?php echo "First Name: <input type=text name="first_name" size="30" maxlength="40"value="$first_name" ><br> "; echo "Middle Name: <input type=text name="middle_name" size="30" maxlength="40" value="$middle_name"><br> "; echo "Last Name: <input type=text name="last_name" size="30" maxlength="40" value="$last_name"><br><br> "; echo "Email: <input type=text name="email" size="30" maxlength="40" value="$email" readonly><br><br> "; echo "Photo: <input type=text name="photo" size="30" maxlength="70" value="$photo"><br><br> "; echo "<input type="checkbox" name="email[]" value="$email"><b>Update?</b> "; ?> </td> <td align=right width=50%> <?php echo "$photo"; ?> </td> </tr> </table> <hr size=3><br> <?php } ?> <input type=submit name=submit value="Update Enteries"> <input type=reset> </form> <?php } if ($submit=="Update Enteries") { if (is_array($email)) { while (list($key,$value) = each($email)) { $query= mysql_query ("update Names set First_Name = '$first_name' Middle_Name= '$middle_name' Last_Name='$last_name' where Email='$value'"); } } } ?>
Need Help With Deleting Records
I'm trying to add a link on the display of a record to delete that record. The main part of the record is stored in pw_event, then there are several rating fields for that record stored in pw_rate, and there is also several records for the first record stored in pw_whois. I need to have a link that will deleted everything for that record in all three tables. Here is my display script: PHP Code:
Retrieving Records With Between
I am trying to convert my asp website to php. So far so good, but I am having a problem with my SQL Statement that needs to us the Between. Here is what I am using: $sql = "Select * From tblTrack Where DateEntered Between $start and $end"; the vars start and end come from the same form. I don't have a problem when I hard code the dates, but when I use the variables, it won't retrieve anything.
Delete Records
I`m just trying to figure out the best method to delete my records and wondered if it was possible to do a DELETE statement to remove any records that don`t match. Here is my code so far: $Query="select blah its huge:-)"; $RESULT=mysql_query($Query); $my_rows=mysql_num_rows($RESULT); for ($a=0; $a<$my_rows; $a++){ mysql_data_seek($RESULT, $a); $Array = mysql_fetch_array($RESULT); printf("%s<BR>", $Array['Email']);} My Query returns Matched Records, what I would like to achieve is deletion of the records that didn`t match, would it be possible to do that under the printf statement. So delete all the records in the table that don`t match up to $Array['Email']??
PHP/MySQL Records Per Row
Is there any way to have the records pulled from a mysql database display like this in a table: record1 | record2 record3 | record4 etc: I've been thinking about this for about three months and have yet to come to a good solution.
Inserting Records
I'm trying to insert as many as records as possible but less than 100 into a table. First, i get the count inorder how many to add and then depending on the count, i get so many blank form fields to enter. Now, I noticed something really strange. 1.Only the last entered record is inserted into the table. 2.For example, when I type a name, Let us assume "WORLD", only w is inserted into the table and the rest is not.It is the same with all the form fields.whether, i'm trying to enter text or a number,only the first character is inserted.This sounds weird. Could somebody pls tell me why is this peculiar behaviour Here is the code:
Insert Records
When I try to insert a records in the database "socios", it doesn't inserted at all. Code:
Different Hyperlinks To Different Records
I'm displaying few records from a mysql table - pretty straight forward one. For each record i display on the form, i want to add a link to it.so, each link would display a different page(an html). PHP Code:
Displaying Some Records Once Only
I'm building a database via mysql/php which brings back records of events. My problem is that I only want to show the Venue for the event once and then list the events for that venue. ie Code:
Deleting Records
I've been trying to delete records since a week and i'm not able to do it. Before with this script, i was doing so many things at a time and i was confused.But, now, i just displaying the records from a table N trying to delete them.Would somebody pls guide me. I just wanna set the delete flag(i.e, i want to set the RBS_DELETE column to Y or something) when i check a check box to delete it. I've some 5 records displaying on my form and i want to check 3 of them and when i check them and hit submit, i want the RBS_DELETE column to have some value. PHP Code:
How Do You Sort Records?
I have a db table "person" that I can sort by title, first_name, last_name, or city with no problems at all because "title", "first_name", "last_name", and "city" are columns in the table. The requirement is to ALSO sort by department NAME. Problem is, I can't do that in the "person" table because the column is "department_id" which is a foreign key constraint to the department table. How do I sort the person records by department_name based on this? I am using PHP 4.3.2 and MySQL 4.0.10 Now, second problem and even more of a problem: The requirement is to ALSO sort by state NAME and country NAME. The fields "state" and "country" in the "person" table contain only an abbreviation of state and country; the corresponding full name of each state and country are found in respective XML files in /xml/state.xml and /xml/country.xml
Compare Records
is it possible to write a query to compare records in 2 tables, like if the number of records in the 2 tables are equal the query should return 1 if not equal the query should return 0. this can also be done in php like, get the number of records from one table and get number of records in another table, compare it and do the operation. but i wanted to know if its possible to do the compare records using the query itself. for example, if one table has 5 records, this should be compared with another table, if this table has 5 records, then the result of the query should be 1 else 0. if i use joints, it will return all the 5 records. so not sure how to make this in a query. anyone have any idea ?
Display Records
I want it to display all the records meeting the criteria specified in the script, but it only shows one records and should show about ten. any thoughts or pointers to get it to display more than one record. Code:
DESC Records
i want to make all the records be shown in a decending order, i've tried using: $sql = 'SELECT * FROM `repair` ORDER BY `repair` . `id` DESC';
Records Won't Delete
mysql_query("DELETE FROM guestbook WHERE id = '$recnum'"); It works fine on my local server but it doesn't delete records on the remote server. any ideas?
Count Records
How can I count how many records are in a table that match a news_id? I have this at the moment, but it doesn't seem to work. Code:
Retreiving All Records From Sql Db
IM trying to get cost values out of the db with a specific ID which is assigned to an item ID but i only get the last record in the database. $lala = mysql_query("SELECT `cost` FROM `table` WHERE `ID` = '1'"); while ($la = mysql_fetch_row($lala)){ $start = 0; $overall = $start+=$la[0]; } echo("$overall"); ...
Return Last 3 Records
I want to return the last 3 records added to my table called towns. sql = "select * from towns limit 3" This only returns the first three rows, I want the last 3. My primary key field is townID.
Getting ALL My Records To Display
In this code, almost everything is working perfectly, but for my second query, I have six records that I want displayed in their own table like I have. I know that a loop would probably work, but I am just really not sure how to go about this. I would like the code to display a table of each of the records. Code:
Deleteing From Records
Ive created a mailing list using php3, and i'm trying to make an unsubscribe, so far i have it set up to mail me with the email of the person(s) wishing to unsubscribe, and i have to do it manually. Code:
DELETE RECORDS
iv got the database adding new records, and now I want it to display all of the records that are there buy name and id number, then i want u to be able to type in the id number of the customer u wish to delete and it shoudl delete it, sounds good buts its not actually deleting the record. it says it does, but its not doing it. Code:
Printing Records With A Twist
I have a problem that I have been working on for weeks and I cannot get it to work. I thought someone might have done this or could be of assistance. I have name and football positions in a database. I want to retrieve those names print them on the screen. The twist is, I have a certain number of positions (3 QB, 4 RB, 6 WR, etc.). If I have only 1 QB I want to leave 2 blank lines before I print the RB position and if I have 2 RB, I want to leave 2 blank lines before I print the WR Position, etc. Name, QB Blank Line Blank Line Name, RB Name, RB Blank Line Blank Line Name, WR If anyone has a way to loop through the recordset and do these, I would really appreciate it. It is probably pretty easy but I am new at PHP and I have just not had any luck.
Updating Multiple Records
I'll try and explain my problem!! Database table : Book Table : BookWords Fields : BookWordID Word Description I want to show : The word is $word add your description $description using th code below: [PHP]$db = mysql_connect("localhost", "root",""); mysql_select_db("Books",$db); $result=mysql_query("select * from Bookwords",$db); while ($rec=mysql_fetch_array($result)){ $wordid = $rec["BookWordid"]; $description = $rec["description"]; echo "$wordid: <input type=text name=quantity[$description]><br> "; } This is ok so far. Now i want the user to be able to add the description from the form and have the db automatically updated. I've tried the different methods I've found on this forum and I cant get anything to work!!!
Displaying # Of Records In A Table
Can anyone throw me a link to some prefab code, or a tutorial on how I can get a page to display the number of records that meet a certain criteria. example: I have a page that stores information on audio FX. I'd like to include a feature that would let the users know how many items are in a particular section. Player (10) Items (5) Weapons (0) etc. All help appreciated,
Finding Records Within The Last 48 Hours?
I can't seem to find anything on querying to find records dated within the last 48 hours. Not just two days/calendar dates, but 48 actual hours. I'm hoping to do something like: SELECT record FROM table WHERE postdate > (NOW - 48hrs) does that make sense?
Limited Records Showing
When I read from mysql database it shows all the records. How can i make them show by 5 each page?
Counting Records In A Table
Ok, I am trying to count the number of records in one of my tables. Seems simple. BUT! its not working. It returns a 2 no matter how many records are in there. Heres the code. <?php $sql = "SELECT count(*) from cam"; $result = mysql_query($sql); ?> I would think this would work. I have also tried mysql_num_rows, and max(), and sum()... a little help would be appreciated, and why is it returning a 2?
Counting Number Of Records
I am trying to do 2 things. First, i want to count all the records that i get when i query the db. Second i want run a loop to display all of the info. The loop works fine, (it displays all the results) but when i try to count the records, it only echo's 1. Here is the code i'm using. PHP Code:
|