Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Header Question

  1. #1
    New Coder
    Join Date
    Oct 2008
    Posts
    28
    Thanks
    4
    Thanked 0 Times in 0 Posts

    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'); 

  • #2
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    No the form can be in the same script. Can you please post your coding?

  • #3
    New Coder
    Join Date
    Oct 2008
    Posts
    28
    Thanks
    4
    Thanked 0 Times in 0 Posts
    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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •