Jump to content

Recommended Posts

I am using this QRCode https://github.com/jeromeetienne/jquery-qrcode.

 

No I need to turn it into an image so I can use it like

<img src="qrcode.php">

 

I have added "header("Content-type: image/png");"

 

but I cannot get this to work.

 

Any and all help/advice is greatly appreciated. It is starting to really annoy me :)

 

Cheers in advance.

Link to comment
https://forums.phpfreaks.com/topic/251059-php-image/
Share on other sites

The qrcode.php file is just the class definition. You would need to include/require it and then call the methods along with outputting the header, followed by the image data. Did you read through the examples at the page where you got the grcode.php file - http://d-project.googlecode.com/svn/trunk/misc/qrcode/php/

Link to comment
https://forums.phpfreaks.com/topic/251059-php-image/#findComment-1287832
Share on other sites

This is the current code

 


<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="../js/qrcode.js"></script>

<?php
header("Content-type: image/png");
?>

<div id="qrcode"></div>

<script>
jQuery('#qrcode').qrcode({
	width: 60,
	height: 60,
	text : "1"
});
</script>

 

If i was to visit http://mysite.com/qr.php

I see the QRcode

 

if i try to use <img src="http://mysite.com/qr.php">

it does not work!

Link to comment
https://forums.phpfreaks.com/topic/251059-php-image/#findComment-1287833
Share on other sites

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.