this is a tough one

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
deezin
Forum Newbie
Posts: 9
Joined: Sat May 11, 2002 3:21 pm

this is a tough one

Post by deezin »

Hi -

I own a jobboard and I have a problem that I want to run a script to fix. If I have a job that someone posts that is scammy - usually the person says to go to a certain url and / or says go to their site and go to job #.

so for example the job is:
==========
You must apply for this job at http://www.randomjobs.com/job.asp?id=456

Looking for a graphic designer, please apply by going to randomjobs.com and going to job#456
==========
Would it be something like this? (I know I have a lot of this wrong, so please help me out.

$query = "SELECT id, description FROM projects";

$result = mysql_query($query,$SESS_DBH);

while ($row = mysql_fetch_array($result)) {

$id = $row["id"];

$description = str_replace("You must apply for this job at http://www.randomjobs.com/job.asp?id=", "", $row["description"]);



$updatequery = "UPDATE projects SET description = '$description' WHERE id = $id";

mysql_query($updatequery,$SESS_DBH);

}

What would you do? Thank you for your help.
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

Your best bet would be to either (a) Check each entry manually for that sort of stuff, or (b) check for any links to any sites, and remove them from the listing.
Post Reply