Jump to content

Recommended Posts

Hi all. My first post!

 

I am not a PHP programmer (sorry .NET man  :-\) but have been asked to add an image resizing script into a php page.

The page in question processes form data ready for a MYSQL query after uploading and resizing images.

 

This work successfully; images resized and uploaded and query posted no problem.

 

The problem is that the closing commands which redirect the page are not being excuted.

Here are the bare bones of the last part of the page:

 

$catInfo = explode("|", $_POST[selectCategory]);

$CategoryID = $catInfo[0];

$SubcategoryID = $catInfo[1];

 

$q1 = "insert into etc . . . .";

 

mysql_query($q1);

 

$last = mysql_insert_id();

 

}

 

header("location:info.php?id=$last");

exit();

 

?>

 

The page however remains blank and does not redirect. My knowledge of programming, whilst pretty profound, doesn't extend to PHP and I don't have the time to learn the entire language to debug this part.

Is this a common fault and one easily remedied?

If someone can point me int he right direction I'd be very grateful.

 

Thanks.

 

 

Add this to the top of your page:

 

<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);

 

If there are any errors (my bet is that "Output already Sent" error) then it will display them. If it is the output already sent, you cannot have any output (not even a whitespace at the top before <?php) to the browser before you call a header, as once output has been sent you are already in the body.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.