Jump to content

Allowing users to remove inappropriate listings (Flagging) How to?


Modernvox

Recommended Posts

Hello Brothers,

 

I am attempting to create a flagging system where a user can just click a link and flag an Ad that violates a site policy. (Identical to Craigslist)

I have set up the DB Tables> ID, VenueID, Reason and username.

 

My question is this:

How would I set up the page to allow users to flag an Ad? Do I just echo out a form with the flagging info?

 

My current code:

 

if ($category= "class") {
$dbname= "classifieds";
mysql_select_db($dbname, $conn);
        $result = mysql_query("SELECT * FROM musicians WHERE location = '$st'");
        While($musicians = mysql_fetch_array($result))
        {
            echo "<a href=\"{$musicans[title]}\" target=\"_blank\">{$musicans[actual_location]}<font size=\"3\"></font></a><br />";
   print "<BR />\n";

//Include Flagging Option here??
echo " $venue[title] " . " $musicans[actual_location] <br/><br/> $musicans[name] <br/> $musicans[genre] <br/> $musicans[ratings]";
echo " a href=\"http://dezi9er.net16.net/flagsystem.php\" target=\_blank\">Flag this listing</a>";
echo "<form action=\"flagsystem.php\" name= \"flagsystem\" method= \"post\">";
echo "<select name= \"flagReason\">";
echo "<option value= \"dontExist\">Venue doesn't exist\"</option>";
echo "<option value= \"notHiring\">Venue no longer hiring musicians\"</option>";
echo "<option value= \"misplaced\">Misplaced listing\"</option>";
echo "<option value= \"prohibited\"Prohibited listing\"</option>";
echo "</select>";
echo "input type= \"submit\" value= \"Flag this for removal\" name=\"submit\" /></form>";

 

Is this the proper way? Will the flag go into the venue id field?

I would recommend that you make your Flag a link to a separate page perhaps. The php can take the variable and place according. So for instance:

 

FLAG <a href="wherever.com/flag.php?flag=1">

 

If someone clicks on the flag then flag.php would be

 

$flag = $_GET['flag'];

 

If ($flag == 1){

Echo out your form here

}

 

then the submit button would go to flagthankyou.php

 

Flagthankyou.php would tell the visitor thanks for helping to keep the sites content up.

 

The php would simply $_POST your vars from the form into the DB on this page.

 

Hope that gives you some direction.

 

-K.candiotti

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.