Welcome to WebmasterWorld Guest from 54.145.176.120

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Repeating a GD image

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

5+ Year Member



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)

10+ Year Member



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\">";
}
?>

 

Featured Threads

Hot Threads This Week

Hot Threads This Month