...

View Full Version : Header Help



shaileshpatil
11-14-2006, 06:10 AM
Hi All

I am taking all the user input in one form and submit the data on to another form for processing the data. Once the data is processed i use the below code for redirecting it to another page.

header("Location: http://www.example.com/folder/mypage.php");

On development server it works perfect, but on my production its not working.
What couid be the issue in this? Plz Help me out.


Thanks
Shailesh

_Aerospace_Eng_
11-14-2006, 06:19 AM
Do you have a link to your site? Are you sure your server even supports php?

shaileshpatil
11-14-2006, 09:12 AM
Do you have a link to your site? Are you sure your server even supports php?
Yes. production server supports php. Its an linux FC3.
This strange situation has arised after 3 years of my php work on same server. All other sites work absolutely fine. its the problem only with this website.
Any guess what could be the problem?

_Aerospace_Eng_
11-14-2006, 06:59 PM
Try using a relative url.


header("Location: folder/mypage.php");
If that doesn't work then you need to post a link to your page.

shaileshpatil
11-15-2006, 07:24 AM
Hi

thanks for your time.

Just tried with ur suggestion, but still the same problem.
On same server, i am using
header("Location: folder/mypage.php"); in many of websites. It works.
The issue is with only this website. After processing the data, an blank page is returned, and redirection do not take place.
This is the only website i am not being redirected.
Hence, i am doing redirection through javascript.

Can you suggest some other alternative.

thanks in advance

CFMaBiSmAd
11-15-2006, 07:41 AM
Some content is likely being output to the browser prior to the header(...) statement. Someone recently had a problem in that the editor being used was inserting characters at the start of the files due to language encoding and they were FTPing the files to the server in binary mode. Perhaps something similar is occurring here.

Turn on and/or check for any warning messages about output already being sent...

Perhaps create a new blank file and copy/paste the contents from this file into it and upload the new file to the server making sure that the transfer is in ascii mode and not binary mode.

_Aerospace_Eng_
11-15-2006, 08:05 AM
Be sure to upload your files using ascii and not binary. Binary will add some weird characters to your files.

shaileshpatil
11-15-2006, 12:48 PM
Hi

Many many thanks for your valuable inputs. i did copy/paste and checked it. didnt worked out.
I am doing my file upload using file manager (webmin).
Any Hints?

Just have a look at this code. This is same piece of code which i m using for inserting and updating the tables.



<?
include('../include.php');
if ($action=='save') {
// get the max id
$documentid=$db->getMaxID('documentation','documentid',3);
unset($dict);
$dict['documentid'] = $db->squote($documentid);
$dict['type'] = $db->squote($type);
$dict['documentname'] = $db->squote(strtoupper($documentname));
$dict['commodityid'] = $db->squote($commodityid);
$dict['inspections'] = $db->squote($inspectionid);
$dict['notes'] = $db->squote($notes);
$db->dbinsert($dict,"documentation");
header("Location: documentview.php");
exit();
}
// for updating
if ($action=='update') {
unset($dict);
$dict['type'] = $db->squote($type);
$dict['documentname'] = $db->squote(strtoupper($documentname));
$dict['commodityid'] = $db->squote($commodityid);
$dict['inspections'] = $db->squote($inspectionid);
$dict['notes'] = $db->squote($notes);
$db->dbupdate($dict,"documentation", " documentid='$documentid' and companyid='$companyid'");
header("Location: documentation/documentview.php");
exit();
}
// end for update
?>
<!-- <script>
location.href="documentview.php";
</script> -->

SeeIT Solutions
11-15-2006, 01:10 PM
Try remove the exit();

Sometimes php keeps processing and won't redirect because you called exit which stops everything.

shaileshpatil
11-16-2006, 10:58 AM
No. It still not working.


Try remove the exit();

Sometimes php keeps processing and won't redirect because you called exit which stops everything.

SeeIT Solutions
11-16-2006, 11:03 AM
Can you post the code of the entire page? Or at least everything above that part.

shaileshpatil
11-16-2006, 11:13 AM
Its already there in my earlier post.




<?
include('../include.php');
if ($action=='save') {
// get the max id
$documentid=$db->getMaxID('documentation','documentid',3);
unset($dict);
$dict['documentid'] = $db->squote($documentid);
$dict['type'] = $db->squote($type);
$dict['documentname'] = $db->squote(strtoupper($documentname));
$dict['commodityid'] = $db->squote($commodityid);
$dict['inspections'] = $db->squote($inspectionid);
$dict['notes'] = $db->squote($notes);
$db->dbinsert($dict,"documentation");
header("Location: documentview.php");
exit();
}
// for updating
if ($action=='update') {
unset($dict);
$dict['type'] = $db->squote($type);
$dict['documentname'] = $db->squote(strtoupper($documentname));
$dict['commodityid'] = $db->squote($commodityid);
$dict['inspections'] = $db->squote($inspectionid);
$dict['notes'] = $db->squote($notes);
$db->dbupdate($dict,"documentation", " documentid='$documentid' and companyid='$companyid'");
header("Location: documentation/documentview.php");
exit();
}
// end for update
?>
<!-- <script>
location.href="documentview.php";
</script> -->

SeeIT Solutions
11-16-2006, 11:32 AM
Could you give a link to this page?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum