Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-08-2009, 07:09 PM   PM User | #1
Papajo
New Coder

 
Join Date: Oct 2008
Posts: 28
Thanks: 4
Thanked 0 Times in 0 Posts
Papajo is an unknown quantity at this point
Header Question

Hi
I have a image resize script that has a content header, when I try to put a submit form on the same page the form codes show up as html, I tried inclosing the form in a php tag and that didn't help either. Do I have to put the submit form on a separate page? Thanks Joe




PHP Code:
header('Content-type: image/gif'); 
Papajo is offline   Reply With Quote
Old 05-08-2009, 07:31 PM   PM User | #2
masterofollies
Senior Coder

 
Join Date: May 2005
Posts: 2,137
Thanks: 96
Thanked 72 Times in 72 Posts
masterofollies can only hope to improve
No the form can be in the same script. Can you please post your coding?
masterofollies is offline   Reply With Quote
Old 05-08-2009, 07:38 PM   PM User | #3
Papajo
New Coder

 
Join Date: Oct 2008
Posts: 28
Thanks: 4
Thanked 0 Times in 0 Posts
Papajo is an unknown quantity at this point
PHP Code:
$filename $_POST["url"];
$percent $_POST["per"]; 
$XXX $_POST["xxx"]; 
 
header('Content-type: image/gif');

// Get new dimensions 
list($width$height) = getimagesize($filename); 
$new_width $width $percent
$new_height $height $percent

// Resample 
$image_p imagecreatetruecolor($new_width$new_height); 
$image imagecreatefromgif($filename); 
imagecopyresampled($image_p$image0000$new_width$new_height$width$height); 
imagejpeg($image_pnull$XXX); 


<form action='A1.php' method='post'>
Image URL: <input type='text' name='url' size='45' value='' />
Image Quality: <input type='text' name='xxx' size='4' value='100' />
Reset: <input type='reset' value='Reset'><br /><br />
<select name='per'>
<option>Select Size</option>
<option value='0.25'>1/4</option>
<option value='0.5'>1/2</option>
<option value='0.75'>3/4</option>
<option value='1' selected>Full</option>
<option value='1.25'>1-1/4</option>
<option value='1.5'>1.5</option>
<option value='1.75'>1-3/4</option>
<option value='2'>2</option>
</select>
<input type='submit' onclick='return validate(this.form)' value='Submit'>
</form>
Papajo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:10 PM.


Advertisement
Log in to turn off these ads.