Jump to content

pass PHP data to HTML form


Go to solution Solved by davidannis,

Recommended Posts

Hi all,

 

I found this nice php script which uses an iphone barcode scanner to return the barcode EAN number in a URL. I want to pass it to an HTML form on another webpage. Does anyone know how to do this? I suspect its pretty simple im just very new to PHP and HTML.

 

Thanks in advance for any replies,

 

Matt

 

 

<?php
$code = $_REQUEST['ean'];
echo '<' . '?xml version="1.0" encoding="UTF-8" ?' . '>';
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>test barcode reader</title>
</head>
<body>
<div>
<h1>test barcode reader</h1>
<?php
 if ( $code ) :
?>
<p>
The barcode was <?php echo htmlentities( $code ); ?>
</p>
<?php
 endif;
?>
<p>
</p>
<p>
This web page is for iPhone users only and needs
<a href=""http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=308740640&mt=8">pic2shop</a>
installed (it is free), which allows third party web apps and iPhone apps to use its bar code reading software as a form of local web service.
</p>
</div>
</body>
</html>

 

Link to comment
https://forums.phpfreaks.com/topic/278075-pass-php-data-to-html-form/
Share on other sites

  • Solution

I would put something like this on the third line right below the line that starts $code=


 if ( $code!='' ) {
header ("Location: http;//mydomain.com/myscript.php?code=$code");
exit;
}
Edited by davidannis
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.