jurass1c Posted April 26, 2010 Share Posted April 26, 2010 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 More sharing options...
Ken2k7 Posted April 26, 2010 Share Posted April 26, 2010 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 https://forums.phpfreaks.com/topic/199796-report-link-script/#findComment-1048780 Share on other sites More sharing options...
jurass1c Posted April 27, 2010 Author Share Posted April 27, 2010 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 More sharing options...
jurass1c Posted April 27, 2010 Author Share Posted April 27, 2010 any ideas ? Link to comment https://forums.phpfreaks.com/topic/199796-report-link-script/#findComment-1049340 Share on other sites More sharing options...
NTSmarkv Posted April 27, 2010 Share Posted April 27, 2010 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 https://forums.phpfreaks.com/topic/199796-report-link-script/#findComment-1049415 Share on other sites More sharing options...
jurass1c Posted April 28, 2010 Author Share Posted April 28, 2010 can i possibly get some sample code ? I understand the process just hard putting the code together. Thanks heaps for your help. I knew i was on the right track. Link to comment https://forums.phpfreaks.com/topic/199796-report-link-script/#findComment-1049719 Share on other sites More sharing options...
Ken2k7 Posted April 28, 2010 Share Posted April 28, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.