/    Sign up×
Community /Pin to ProfileBookmark

Hi

I ve a header redirection to a page with certain arguments. The code is something as follows in page1.php for the header redirection….

header(“Location:page2.php?fname=$fname_fld&lname=$lname_fld&addr=$addr_fld&city=$city_fld&state=$state_fld&country=$country_fld&zip=$zip_fld&phone=$phone_fld&email=$email_fld”);

… where the arguments will be having values from certain variables of page1.php.

On the local machine the arguments are forwarding correct values from Page1.php to Page2.php but on the remote server where the pages are uploaded I m not getting the values of page1 to page2 through header, the fields are blank in the address bar.i.e.they do not contain any data.

Is it any issue with the limit of data which the header() can take and is there any setting to be adjusted in php.ini to enable header.php to do so

Plz help

Arpan

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyMar 14.2006 — you may have global variables turned off on the remote server, therefore try $_GET['fname_fld'] or $_POST['fname_fld']for each of the variables
Copy linkTweet thisAlerts:
@bfsogMar 14.2006 — Well it is not a PHP issue, but using the querystring, most browsers can cope with upto 100 characters.
Copy linkTweet thisAlerts:
@arpan_biswasauthorMar 14.2006 — If it is a querystring issue then how is it workin on localhost
Copy linkTweet thisAlerts:
@bokehMar 14.2006 — Change this: [code=php]header("Location: age2.php?fname=$fname_fld&lname=$lname_fld&addr=$addr_fld&city=$city_fld&state=$state_fld&country=$country_fld&zip=$zip_fld&phone=$phone_fld&email=$email_fld"); [/code]
to this: [code=php]print("Location: age2.php?fname=$fname_fld&lname=$lname_fld&addr=$addr_fld&city=$city_fld&state=$state_fld&country=$country_fld&zip=$zip_fld&phone=$phone_fld&email=$email_fld"); [/code]
This should let you see what is wrong.
Copy linkTweet thisAlerts:
@bokehMar 14.2006 — Also it should be [code=php]header('Location: http://domain.com/path/file.php');[/code] Note: HTTP/1.1 (as per RFC 2616) requires an absolute path for a header redirect.
Copy linkTweet thisAlerts:
@arpan_biswasauthorMar 14.2006 — I m getting correct redirection with the relative path ... so thats not an issue.
Copy linkTweet thisAlerts:
@bokehMar 14.2006 — I m getting correct redirection with the relative path ... so thats not an issue.[/QUOTE]Of course it is an issue. [I]Location:[/I] is not your average header that is sent as is to the client, it is a special header that is processed by the server and obviously your input is confusing the server. [I]Location:[/I] is handled by the server because it is not simply a matter of sending that one header the server also needs to send a 302 response.
×

Success!

Help @arpan_biswas spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...