Noob Help: Showing Search results in text fields

I will try to explain this the best i can…and i thank anyone in advance for any help.

Im trying to set up a form to add a record to SQL… when I type in the title…and hit “Get Description”,
I would like to populate the title & description fields with results from tvrage.com…they supply a script but I dont know how to show the results in those fields. I would also like to grab an image from Amazon and have it populate the image field with the URL and to show the date and time already in there.

I know this is probably asking alot but Im kinda lost. I am using Dreamweaver. I include the code butchering below. again thanks for any help.

[php]<?php require_once('Connections/LiveFiles.php'); ?>

<?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) { $insertSQL = sprintf("INSERT INTO TV_MOVIE (Category, Title, `Description`, Image, `DL Link`, `ST Link`) VALUES (%s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['Category'], "text"), GetSQLValueString($_POST['Title'], "text"), GetSQLValueString($_POST['Description'], "text"), GetSQLValueString($_POST['Image'], "text"), GetSQLValueString($_POST['DL_Link'], "text"), GetSQLValueString($_POST['ST_Link'], "text")); mysql_select_db($database_LiveFiles, $LiveFiles); $Result1 = mysql_query($insertSQL, $LiveFiles) or die(mysql_error()); $insertGoTo = "videoadded.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } mysql_select_db($database_LiveFiles, $LiveFiles); $query_Recordset1 = "SELECT * FROM TV_MOVIE ORDER BY Category ASC"; $Recordset1 = mysql_query($query_Recordset1, $LiveFiles) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); mysql_select_db($database_LiveFiles, $LiveFiles); $query_usernames = "SELECT * FROM usernames"; $usernames = mysql_query($query_usernames, $LiveFiles) or die(mysql_error()); $row_usernames = mysql_fetch_assoc($usernames); $totalRows_usernames = mysql_num_rows($usernames); ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['user'])) { $loginUsername=$_POST['user']; $password=$_POST['user']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "add.php"; $MM_redirectLoginFailed = "http;//www.hell.com"; $MM_redirecttoReferrer = false; mysql_select_db($database_LiveFiles, $LiveFiles); $LoginRS__query=sprintf("SELECT username, password FROM usernames WHERE username=%s AND password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $LiveFiles) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();} //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> Untitled Document




























Category: >Television >Movie >Sports >Music >Documentary
Title: Get Description <?php function get_show($show,$exact="",$episode="") {

if ( !$show ) { return FALSE; }

if ( $fp = fopen(“http://www.tvrage.com/quickinfo.php?show=".urlencode($show)."&ep=".urlencode($episode)."&exact=".urlencode($exact),"r”) )
{
while ( !feof($fp))
{
$line = fgets($fp,1024);
list ($sec,$val) = explode(’@’,$line,2);
if ($sec == “Show Name” )
{
$ret[0] = $val;
}
elseif ( $sec == “Latest Episode” )
{
list ($ep,$title,$airdate) = explode(’^’,$val);
$ret[3] = $ep.", “”.$title."" aired on “.$airdate;
}
elseif ( $sec == “Episode Info” )
{
list ($ep,$title,$airdate) = explode(’^’,$val);
$ret[5] = $ep.”, “”.$title."" aired on ".$airdate;
}
}
fclose($fp);
if ( $ret[0] )
{
return $ret;
}
}
else
{
return FALSE;
}
}?>

Description:

Image:
FileServe Link:
MegaShares Link:
Username:

Date / Time:
<input value=“echo date(“l, F d, Y h:i” ,time());” type=“text” name=“datetime” id=“datetime” />
  <?php echo $totalRows_Recordset1 ?> (Total Records)

 

<?php mysql_free_result($Recordset1);

mysql_free_result($usernames);
?>[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service