Jump to content

[SOLVED] need help report button


MDanz

Recommended Posts

this is how i echo a reply.

while ($runrows = mysql_fetch_assoc($run)){
             
             $id = $runrows['id'];
             $username1 = $runrows['username'];
             $image = $runrows['image'];
$report=$runrows['report'];
             $reply = str_replace ("\r\n", '<br />',$runrows['reply']);


             echo '<td><tr>';
                       echo "</tr><font color=white><strong><img src='$image' width='50px' height='50px'> $username1 - $reply <img src='http://www.u-ssfdsdf.com/report.jpg'>[b]<input type='submit' name='report' value='report'>[/b]</center><br><br><hr size='1'></strong></font></td>";

 

 

 

 

what i'm trying to do is a submit button is pressed it updates the reply record, report value to 1.

 

this is how i was trying to change the report value in mysql

 

	  $report1 = htmlentities($_GET['report']); //get report button pressed

if (!$report1)
{
    $check = mysql_query("SELECT $username1 FROM Reply WHERE id='$id'");
    $checknum = mysql_num_rows($check);
    
    if ($checknum==1)
    {
        //run a query to 
        $report1 = mysql_query("UPDATE Reply SET report ='1' WHERE id='$id'");
        die("This post will be investigated. <a href='http://www.u-sxgddf.com/index.php'><b>Click Here</b></a>");
    }
    else
        die("Invalid ID ");

}

else
     die("Data missing");

        }   

 

the report button is not changing the value to 1 in the report field?

 

what do i have to change or is there a better way to do this?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/172693-solved-need-help-report-button/
Share on other sites

let me rephrase if it sound complicated.

 

reply.php.. this is how i echo a reply

while ($runrows = mysql_fetch_assoc($run)){
             
             $id = $runrows['id'];
             $username1 = $runrows['username'];
             $image = $runrows['image'];
$report=$runrows['report'];
             $reply = str_replace ("\r\n", '<br />',$runrows['reply']);


             echo '<td><tr>';
                       echo "</tr><font color=white><strong><img src='$image' width='50px' height='50px'> $username1 - $reply <img src='http://www.u-ssfdsdf.com/report.jpg'>[b]<input type='submit' name='report' value='report'>[/b]</center><br><br><hr size='1'></strong></font></td>";

 

 

the bolded is the report post button.

 

 

in the reply table in mysql. Each post has the field report. Which type is tinyINT. 0 is default. If 1 then the post has been reported.

 

What i'm having trouble is making the report button update the record so it changes 0 to 1...

 

how do i do this?  .. my way above didnt work..

 

 

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.