Jump to content


Photo

pass PHP data to HTML form

php html form iphone

Best Answer davidannis, 16 May 2013 - 12:15 PM

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;
}
Go to the full post


  • Please log in to reply
2 replies to this topic

#1 mastubbs

mastubbs

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts

Posted 16 May 2013 - 11:20 AM

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....ml-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>

 



#2 davidannis

davidannis

    Freak Dr.

  • Members
  • PipPipPip
  • 617 posts
  • LocationOkemos, MI USA

Posted 16 May 2013 - 12:15 PM   Best Answer

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, 16 May 2013 - 12:15 PM.


#3 mastubbs

mastubbs

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts

Posted 19 May 2013 - 10:27 AM

yep, solved. thanks for the help.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com