Hello, I'm requesting assistance with making an image being used as a button execute a sql command of selecting a link from a database and then loading the link as a new page to the user's browser.
Perfect example, User clicks a video thumbnail, the click calls a PHP function which grabs a variable from the click and the executes a sql select to pull the appropriate video link from the mysql database and display this link as a web page.
I understand I need ajax to make this happen. Can anyone help?
The code I have so far is as follows:
include_once "db.php";
$result = mysql_query("SELECT id, thumbnail, title, descrip, embed, fblike, fbcom, fbimg, thumblk FROM media ");
while($row = mysql_fetch_array($result))
{
echo ' <FORM name="mediaselect" method="GET" action="showimage.php">';
echo ' <input type="text" name="title" '. $row["title"] .' /> ';
echo ' <input type="submit" value="View" />';
echo ' </FORM>';
//////////////////////////////////////////////////////////////////////////
I would like the user to be able to click the video thumbnail to send the required variable to PHP and then have PHP send the sql command to display the results.
Any help is appreciated.
Thanks.