PHP generates qr code online of google api

  • 2020-06-03 06:02:11
  • OfStack

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>2 D code generated -www.ibtf.net</title> 
<SCRIPT LANGUAGE=JavaScript> 
function post(){ 
if(document.getElementById('content').value==''){alert(' The content cannot be empty !');document.getElementById('content').focus();return false;} 
if(ckregdatapost()==false){return false;} 
} 
</SCRIPT> 
</head> 
<body> 
<style> 
body{text-align:center;background:#f5f5f5;line-height:22px;font-size:14px;color:#888;} 
.newcrop{margin:10;} 
.er{width:700px;margin:0px auto;border:1px solid gray} 
span{background:#645;color:#fff} 
body form {text-align:center;padding: 3px 6px 3px 6px;} 
input.txt{color: #00008B;background-color: #ADD8E6;border: 1px inset #00008B;width: 200px;} 
input.btn {color: #00008B;background-color: #ADD8E6;border: 1px outset #00008B;padding: 2px 4px 2px 4px;} 
input.smallInput{border:1 solid black;FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 18px; LINE-HEIGHT: normal} 
</style> 
<body class="newcrop"><div class="er"> 
<?php 
$content=$_GET['content']; 
$width=$_GET['width']?$_GET['width']:300; 
$height=$_GET['height']?$_GET['height']:300; 
if($content){ 
echo " The text you type is : <span>$content </span><BR />"; 
echo " The width you choose is : <span>$width </span><BR />"; 
echo " The height you choose is : <span>$height </span><BR /> "; 
echo " The generated 2 The dimension code image is: <BR /> "; 
$wen = urlencode(mb_convert_encoding($content, 'utf-8', 'gb2312')).""; 
echo "<img id=qrcode_img src=https://chart.googleapis.com/chart?cht=qr&chld=H&chs={$width}x{$height}&chl={$wen} /><br /> 
 Picture address :<a href='https://chart.googleapis.com/chart?cht=qr&chld=H&chs={$width}x{$height}&chl={$wen}' target='_blank'>https://chart.googleapis.com/chart?cht=qr&chld=H&chs={$width}x{$height}&chl={$wen}</a><br /> 
 Copy and send to your friends.  <a href='javascript:history.go(-1);'> On the back 1 page </a>"; 
}else{ 
?> 
<form action="" method="get" onsubmit="return post();"> 
<h1> 
2 Dimension code generation tool </h1> 
<p>width:<select name="width"> 
<option value="100">100</option> 
<option value="200">200</option> 
<option value="300" Selected>300</option> 
<option value="400">400</option> 
<option value="500">500</option> 
</select> 
height: <select name="height"> 
<option value="100">100</option> 
<option value="200">200</option> 
<option value="300" Selected>300</option> 
<option value="400">400</option> 
<option value="500">500</option> 
</select></p> 
 Enter the url or text :<br /> 
<textarea rows="5" cols="30" name="content" id="content" ></textarea> 
<br /><br /> 
<input type="submit" value=" Generate images " /> &nbsp;&nbsp;&nbsp;<INPUT TYPE="RESET" VALUE=" To fill in "> 
<br /> 
</form><? }?> 
<div></body></html> 

Related articles: