QRcode

Hello ppls,

i have one problem and am hoping someone can help me.
Am making .php which will on insert data in table in my database read ID of new inserted data and convert it in qr code. After that qr code will be saved like .jpg in some folder.
So, i started with little steps. First i made qrcode from some basic url and after that i wanted to save that in some folder but there started problems…i dunno how to save it.

[php]

<?php $urlToEncode="http://www.myproject.com/project1/check.php?ID=79"; generateQRwithGoogle($urlToEncode); function generateQRwithGoogle($chl,$widhtHeight ='150',$EC_level='L',$margin='0') { $image = 'QR code'; echo $image; //part where i must read picture and save it in some folder $img = imagecreatefromstring($image); imagejpeg($img,"79.jpg"); } ?>

[/php]

I hope someone will know how to help me.
Thanks

Well i found solution. So if someone will need it here it is. QRcode is maid by google so u just need to specify what u need for QRcode.
U can do it like this:

[php]$source = “http://chart.apis.google.com/chart?chs=150x150&cht=qr&chld=L|0&chl= …here goes your text,url, or something…”;[/php]

[php]

<? function filecopy($urlsrc,$localdst) { $fp_urlsrc = fopen($urlsrc,"r"); $del_File = fopen($localdst,"w"); fwrite($del_File,""); fclose ($del_File); while (!feof($fp_urlsrc)) { $fp_localdst = fopen($localdst,"a"); fwrite ($fp_localdst, fread($fp_urlsrc, 1)); fclose ($fp_localdst); } fclose($fp_urlsrc); } function archive(){ $source = "http://chart.apis.google.com/chart?chs=150x150&cht=qr&chld=L|0&chl=http://www.myproject.com/project1/check.php?ID=79"; $dest = "image/79.jpeg"; $fd = fopen("$source", "r" ) or die("Unable to access source page"); $pagina = fread($fd, 200000); echo "pagina=$pagina"; fclose( $fd ); if (file_exists($dest)) { if (intval(date("Ymd", filectime($dest)))< intval(date("Ymd"))) { filecopy($source,$dest); } } else { filecopy($source,$dest); } } archive(); ?>

[/php]

Hello,

am still on that problem. :-\

Code i gave works on my pc perfectly, but when i try to put it on linux server or windows server there starts problems. I cant open webpage because i get error Fatal error: Maximum execution time of 30 seconds exceeded and it tells how it cant be connected to host or on web location. I tried with changing max_execution_time in php.ini …but no effects.

Can anyone know whats problem?

Sponsor our Newsletter | Privacy Policy | Terms of Service