Jump to content

Report link script


jurass1c

Recommended Posts

Heja

 

i was wondering if their is any example of a report link script. My situation is this,  I have a database of hyperlinked videos. Lets say one of the video links goes down (dead or removed) i want the user to be able to report the dead video, and the reported video displayed in my admin area.

 

i was thinking this could be done by ofcourse getting the ID of the dead video link (<a href='report.php?id=" .$row['id']. "' >REPORT</a>) notice it will be directed to "report.php. In report.php get the values of the video by using something like this ?:

 

if($_GET['id'] != ""){

$report = $_GET['id'];

}

from this somehow get the values of the video (name, provider, length etc) and INSERT those values into a database table. From here in the admin section which i can only access i could use mysql SELECT to show the recent reported link.

 

So i am presuming that is 1 method of doing it, i was hoping someone could lead me in the right direction or provide me with some sample code of how to exactly do this. I mean grabbing the video's values by using if($_GET['id'] != "") and then inserting them, can it be done with a simple javascript alert popup ? saving the whole page having to refresh using my presumed method, is their a easier alternative ?

 

thanks.

Link to comment
https://forums.phpfreaks.com/topic/199796-report-link-script/
Share on other sites

My method is straight forward and if i was to go ahead and code it up the complications i would have is the whole page refreshing when "REPORT" is hit because the hyperlink will direct it to "report.php" i want to know the method of being able to do this live with a simple "alert" and "confirm" either with ajax or Js.

 

Next complication i would have is the process of inserting the dead links values into the database. I can display the values of a video using ($_GET['id']) BUT inserting those values into a separate table ? how would i go about that ?

 

Link to comment
https://forums.phpfreaks.com/topic/199796-report-link-script/#findComment-1049092
Share on other sites

1). Dont use $_GET or $_POST anymore... Please use $_REQUEST it does them both.

2). Create another table called Report or whatever you want.

3). Make a <a href like you did, add the variables include an onclick() to check if sent or make a popup. go from there.

If you're using $_POST, I suggest you keep it and NOT use $_REQUEST. Though, you may want to read up on filter_input.

Link to comment
https://forums.phpfreaks.com/topic/199796-report-link-script/#findComment-1049872
Share on other sites

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.