What is the difference in submitting form in IE and FF?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wvxvw
Forum Newbie
Posts: 22
Joined: Sat May 17, 2008 10:55 am

What is the difference in submitting form in IE and FF?

Post by wvxvw »

Hi all.
I've tried googling, but, probably, I'm looking for something wrong...
So, I have a form for uploading images, it submits to the same file that renders it. In IE it works ok, but in Mozilla, instead of reloading the page containing the form it shows the white screen with the name of the php file being called...
Here's the code I use to upload images, may be it causes problems...

Code: Select all

$is_upload = false;
if (isset($_FILES['uploadedfile']['name'])) {
    $target_path = 'uploads/';
    $preview_path = 'previews/';
    $target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
    $preview_path = $preview_path . basename( $_FILES['uploadedfile']['name']);
    if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
        //------------------------------------- 
        header('Content-type: image/jpeg') ; 
        list($width, $height) = getimagesize($target_path) ; 
        $modwidth = 90; 
        $modheight = $height * (90 / $width); 
        $tn = imagecreatetruecolor($modwidth, $modheight) ; 
        $image = imagecreatefromjpeg($target_path) ; 
        imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; 
        imagejpeg($tn, $preview_path, 100) ;
        $is_upload = true;
        //----------------
    }
}
And later:

Code: Select all

function output_success () {
    global $is_upload;
    if ($is_upload) {
        include ('manage_uploads.php'); // this file renders the form for uploading / removing images
    }
}
The form looks smth like this (it may be different / have different number of controlls depending on the situation:

Code: Select all

<form name="doc" enctype="multipart/form-data" action="db_admin.php" method="POST"><input type="hidden" name="MAX_FILE_SIZE" value="5242880" />Choose a file to upload: <input name="uploadedfile" type="file" /><br />Max file size: 5Mb<br /><input type="submit" value="Upload File" /></form>
TIA
Mr.RED
Forum Newbie
Posts: 8
Joined: Sat May 31, 2008 1:23 pm

Re: What is the difference in submitting form in IE and FF?

Post by Mr.RED »

Can you list the steps, its hard to understand what you mean...

For example, i understood you have a form to upload a file but then i got lost when you were talking about rendering... Do you want to display the uploaded image?
Post Reply