Jump to content

Recommended Posts

I am working on a voucher website where companies post offers on the site, then a user clicks a button to get a generic voucher BUT with the companies offer and contact details etc done through a php script using a SQL resultset.

 

Problem is, in Firefox, when you go to print preview and and also print it off the data is there.....BUT in Internet Explorer, the data shows but when you go to print preview and also print it off the data is missing.....this is annoying as the whole point the site is to get companies offers as stated.

 

Am a bit stuck has anyone got any ideas?

 

Here is the code I am using

<?php

$string1= $_POST['Link'];
$string2= $_POST['Link2'];
$string3= $_POST['Link3'];
$ImageLoc =$_POST['ImageLoc'];

header("content-type: image/jpeg");
$wm = imagecreatefromjpeg($ImageLoc);
$img = imagecreatefromjpeg("Vouchernew.jpg");
$wmsize = getimagesize($ImageLoc);
$imgsize = getimagesize("banner2.jpg");


imagecopymerge($img,$wm,125,5, 0, 0, $wmsize[0], $wmsize[1], 100);//last numeric is image transparancy
$text_colour = imagecolorallocate( $img, 0, 0, 0 );
imagestring( $img, 4, 270, 310, $string1,$text_colour );//Compname
imagestring( $img, 4, 650, 310, $string3, $text_colour ); //Phone
imagestring( $img, 4, 270, 350, $string2, $text_colour ); //Deal

imagejpeg($img);
imagedestroy($img);
imagedestroy($wm);
?>

the code works fine, just it wont print the data in IE

Are any of the $_POST variables from an image being used as a submit button? If so, read the following link on how you should be accessing the data so that it works in all browsers (according to the w3.org HTML specification) - http://us.php.net/manual/en/faq.html.php#faq.html.form-image

If you have data present on one page, but it is not being submitted to another page as $_POST variables, it is highly likely that your form is invalid HTML and one browser is ignoring the markup errors while a different browser is not.

 

You have not posted the code of the page that is submitting to the code you did post, so it will be a little hard for anyone to directly help with what is causing the problem. You have just posted the code that is using the data and are expecting that someone can tell why it is not receiving data that is being produced somewhere else.

With respect, if you actually read what I have said, it is not an issue of the data not showing when the page is loaded. THAT works fine on both IE and FF.

 

The data is there on BOTH, it is when I click on print preview and also print the page that the data dissapears in IE, so it prints a blank voucher (again ONLY in IE, it prints off fine in FF and is also visible in print preview)

 

The previous pages code simply returns an SQL string, places required values in hidden boxes and on a BUTTON click passes that data to the main voucher page.

 

 

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.