• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

PHP在线生成二维码(google api)的实现代码详解_PHP

php 搞代码 3年前 (2022-01-25) 24次浏览 已收录 0个评论

通过google在线生成二维码的api在线生成二维码。
代码如下:
复制代码 代码如下:



<meta http-¥本文来源gaodai#ma#com搞@@代~&码网^搞gaodaima代码equiv=”Content-Type” content=”text/html; charset=utf-8″ />
二维码生成-www.jbxue.com
<script LANGUAGE=JavaScript>
function post(){
if(document.getElementById(‘content’).value==”){alert(‘内容不能为空!’);document.getElementById(‘content’).focus();return false;}
if(ckregdatapost()==false){return false;}
}
</script>

<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”>


<?php
$content=$_GET[‘content’];
$width=$_GET[‘width’]?$_GET[‘width’]:300;
$height=$_GET[‘height’]?$_GET[‘height’]:300;
if($content){
echo “你输入的文字是: $content
“;
echo “你选择的宽度是: $width
“;
echo “你选择的高度是: $height
“;
echo “生成的二维码图像是:
“;
$wen = urlencode(mb_convert_encoding($content, ‘utf-8’, ‘gb2312’)).””;
echo “

图片地址:https://chart.googleapis.com/chart?cht=qr&chld=H&chs={$width}x{$height}&chl={$wen}

复制发给你的朋友。 返回上一页”;
}else{
?>


二维码生成工具


width:
100
200
300
400
500

height:
100
200
300
400
500


输入网址或者文字:






<? }?>


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:PHP在线生成二维码(google api)的实现代码详解_PHP
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址