Welcome to WebmasterWorld Guest from 54.167.40.25

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Repeating a GD image

     
3:04 am on Apr 10, 2006 (gmt 0)

New User

10+ Year Member

joined:July 8, 2005
posts:31
votes: 0


I have a form that will be printing a barcode sticker XXX amount of times due to a form value on a previous page. How do I go about generating the image so many times based on the form value?
12:25 pm on Apr 10, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 12, 2003
posts:155
votes: 0


You'll want to use the PHP 'for loop' to output the <img> code x (formValue) number of times, where x is a value passed to the page containing the loop from your form:

<?php
$formValue=$_GET['formValue'];
for ( $i = 0; $i < $formValue; $i++) {
echo "<img src=\"image.gif\">";
}
?>