homepage Welcome to WebmasterWorld Guest from 54.237.71.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Repeating a GD image
transmutated




msg:1281870
 3:04 am on Apr 10, 2006 (gmt 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?

 

ryan26




msg:1281871
 12:25 pm on Apr 10, 2006 (gmt 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\">";
}
?>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved