Is there a way to pass a value from on html page to another on a different
server through a URL and have that value input into a form.
The value trying to be passed is a record id from a database.

I tried retrieving the value from the URL with <?=id?>

It carries the id number over in the URL, however it's not extracting the
number out of the url and into the form.

Instead it translates it to <br />
with the following error:
<b>Notice</b>:  Use of undefined constant idno - assumed 'idno' in
<b>C:\Program Files\Apache Group\Apache2\htdocs\fileupload3.php</b> on line
<b>45</b><br />
idno

Any help would be greatly appreciated.

In kindness
Stephen



<html>
<head>
<Title>File Upload</Title>
</head>

<BODY>
<?

$filename = $HTTP_POST_FILES["userfile"]["name"];
$tmpname  = $HTTP_POST_FILES["userfile"]["tmp_name"];
$newname = $_REQUEST["newname"];

// echo "filename = " . $filename . "<BR>\n";
// echo "newname = " .  $newname . "<BR>\n";
// echo "tmpname = " . $tmpname . "<BR>\n";

if(!empty($filename))
{

   //copy the file
   copy($tmpname, "logos/$newname");

   //destroy the uploaded file
   unlink($tmpname);

}
else
{
   echo "You have to enter a file name to upload";
}

   // write javascript to store the newname
   echo "\n<script language='javascript'>\n";
   echo "newname = '" . $newname . "';\n";
   echo "</script>\n";
?>


<FORM name="info" action="http://209.158.200.167:591/FMPro?"; method="Post" >
<INPUT Type="hidden" Name="-db" value="picturetest.fp5">
<INPUT Type="hidden" Name="-lay" value="cgi">
<INPUT Type="hidden" Name="-format" value="result.htm">
<INPUT Type="hidden" Name="picture_name" value="">
<INPUT Type="hidden" Name="-recid" value="<?=id?>">
<INPUT Type="hidden" Name="-edit" value="">
</FORM>



<script language="javascript">

     // set the filename in the hidden form
    document.info.picture_name.value = newname;

    // post the data from the form to FMPro
    document.info.submit() ;

</script>

</body>

</html>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to