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
Share on other sites

You don't actually need JavaScript, but if you want to use JavaScript, you'll need AJAX. You can do this entirely with PHP as you mentioned. Unless you find a report script, your method is easy and straight forward so I'm unsure of what complications you're having.

Link to comment
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
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.

Link to comment
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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