Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Alternative Command To HEADER For Page Redirection


Is there an alternative command to HEADER for page redirection using PHP? How can I use this alternative within buttons to go to a page when I onClick the button?




View Complete Forum Thread with Replies

Related Forum Messages:
Page Redirection - Warning: Cannot Modify Header Information Headers Already Sent
Warning: cannot modify header information headers already sent( at start of D:search.php: 108) in d:search_play.php on line 242.i suggest a way I redirect or be automatically sent to a nother page without using header()? HTML Code:

//search.php is the html form
<form action="<php echo $SERVER['PHP_SELF'];?>" method = "post"> <!--line 108-->

PHP Code:

<?
//search_play.php process and display results
header("Location:../user_info.php"); //line 242

?>

View Replies !
Alternative To Include Or Header?
I have a main page index.php with css divs and includes for the 3 pages, include topbar.php ,navbar.php and mainpage.php.

And mainpage.php exceps a url get parameter to display the page in its place.

This all seems to work fine untill now, I may be burned out and missing the obvious here, but its reloading the same top page twice? then the mainpage or something to this effect!?

firstly i have a link from companydata_details.php to this php/mysql script , its called by users clicking... Code:

View Replies !
Header Redirection In A Frameset??
Tell me how (if at all ) you can use: header (Location: URL) to redirect to a page and display it within another frame within a frameset.

View Replies !
Header Redirection And Adress Bar
I have a problem with redirection using the header function. The page
towards which I redirect loads correctly, but the url in the browser's
address bar is different is that of the redirecting page. Both pages are
located in different directories, so that my relative links don't work in
the page, because the browser retrieves the current directory from the wrong
url in the location bar.
This problem occurs only on the server of my webhosting provider, not on my
local machine where I can see the correct url after redirection. So I
assume, this is a server specific setting. But how can I change ist?

View Replies !
Header Error - Add A Header Command
I have some code that works fine until I add a header command. The code is:

if ($_SERVER['QUERY_STRING'] == NULL) {
print "No Query String";
}
if ($_SERVER['QUERY_STRING'] == NULL) {
header( "Location: http://mysite.com" );
exit;
}

View Replies !
Page Redirection - Link Index.html Page To A .php Pag
I have an index.html page with a link to a .php page This is the complete code of the .php page Code:

View Replies !
Page Redirection - Allow The User To Click A Button That Sent Them To A New Page
I am writing a little section of a home made shopping basket. I collect information and put it in the basket / db. However, I want to update into a new database the final order as and when I click a button that directs the usuer to Pay Pal. My thought was to allow the user to click a button that sent them to a new page that updates the final order database and then redirects to PayPal the information required for billing without the user having to press another button. Would this be a sensible wat to go about it.

View Replies !
Including A File (redirecting Using Header Command)
When including a file in the script or redirecting using header command, for example, should I use a file path:

../../x.php
or
ab/cd/x.php

say cd and ab are previously defined as constants that are the names of immediate parent directory and grandparent directory respectively, which one is better in design, using .. or using constants?

View Replies !
Redirect To My Homepage Without Using The Standard Header Command
I have a php contact script and I want it to redirect to my homepage without using the standard header command.

<?php
header("location:http://www.johndoe.com/index.html");
exit;
?>

View Replies !
Regarding Page Redirection
I have a form which when updated takes the user to an update screen. I was wondering if it was possible to redirect the user back to the screen where they entered the information and refresh the data basically just refreshing the page (and obviously updating the data in the database which is working fine).

I have tried using some code and I can easily redirect back to the right page but I also need to have the 'id' selected so that it displays the recently updated record. Below is the code I attempted to use (i have tried everything I can think of).

header('Location: OrganiseIDASX.php?id=echo $_GET[$id]');

View Replies !
Page Redirection
I'm building a site that has a notes/blog on it. I have the blog set up so that there will only be a certain number of posts per page. The posts are submitted via a simple form. I'm trying to figure out how to redirect the browser to the page that the post will show up on after it is submitted. Right now it just goes back to page one even though you're making a post that will display on page two, for example. I have this line in my code:

header("Location: index.php?page=notes");I'm thinking that I need to set up some kind of variable to pass the page info to so that it goes back to the corresponding page after the post is submitted. Something like this:
header("Location: index.php?page=notes&pagenumber=some variable");How would I set this up?

View Replies !
Redirection To Another Page
I'm interested in doing something like what follows in PHP. php. By default, it shows them an HTML page without leaving page.php. However, if the user enters page.php?id=1 , then it will redirect them to another page, such as http://www.google.com. ID 2 would be different and so on and so forth. Could you do this with a switch or something?

View Replies !
Redirection To Previous Page
I'm trying to make a script that would upon execution would redirect current page to previous page. I'm integrating a user comment system for my website and when I do no specify "After inserting, go to page" it reloads current page but user comment is not visible, so I decided after adding a comment to send user to say redirect.php page, what would instantly send user back to submition page to see it's comment.

I cannot seem to find a suitable script to do this. Or maybe there is some other way to reload current page and for the comment to appear just after submition? Because I do not want people to reload page manualy to see their comments, in which case it would sumbit the comment twice.

View Replies !
Redirection Back To The Page Before You Log In When You Log In.
how to do redirection back to the page before you log in when you log in.

View Replies !
Entrance Page Cookie/redirection
I'm trying to find a way to allow visitors to my website who have already seen my entrance page to skip that and go directly to the main page. I'm not sure how to do this, or what my options are, but I think it's possible to do this with php and setting up a cookie.

I found some code online for this task, but it didn't seem to work (I made sure to enable all cookies in my browser). It seems to generate the cookie because I can see the cookie file on my computer, but it still doesn't skip the entrance page like it's supposed to. Code:

View Replies !
Login Script W/ Page Redirection
I am in need of help in forming a script that will log users in securely and redirect each user to a user-specific page if login is successful. For example - login: user1 would be redirected to http://www.mydomain.com/users1.php or user1.html

I understand setting up the table with 3 variables - username / password / destinationpage. But how do I get it to redirect after the login? Can someone provide the script fo rme to edit or point me in the right direction?

View Replies !
Page Redirection - Submit Button
file name: index.php

echo "<form action='swversion.php' METHOD=POST>";
echo "<input type=hidden name='action'value='swlist'>";
echo "<INPUT TYPE=HIDDEN NAME='entry' VALUE='.'>
";
echo "<input type='submit' value='List Software' class = 'formstyle'>";
echo "</form>";

I wanted to add something to this little form code; How do i redirect this index.php, once I click on the submit button it will take to me swversion.php as you could see that my action is doin that. I want that to happen after 5 secs or right away. As soon as hit the button, I want to that page to go back to this index.php again.

View Replies !
Login Script Redirection To A Other Page
I am new to programming and have been given the task of creating 3 login area's on our site that will allow multiple users to login, but to only one of the 3 area's using 1 login box. It is apparently some sort of redirection that needs to occur but I cannot figure it out. I have spent 3 days looking all over the internet for any information to help, but anything I found was a dead end.

View Replies !
Warning: Cannot Modify Header Information - Redirect From Login Page To Logged In Page
I am trying to redirect from login page to logged in page, but using the {header( 'Location: C:wampwww' ) ;} is giving me this error {
Warning: Cannot modify header information - headers already sent by (output started at C:wampwwwpassword.php:14) in C:wampwwwpassword.php on line 35}, find below my code:

View Replies !
Send Header Info To A Page, Retrieve Response And Send That As Header
I am sending a header to page.html from sender.php using fgets(). I am then trying to retrieve that page's response, and set that as a header in sender.php in order to set any cookies etc.... that page.html might want to set. Right now I am using the following code:

View Replies !
Running A Windows Command Line From A Web Page
I have a web page on an intranet, i need to run a command in the local windows run from the webpage. for example when you press a button button on a webpage it has the same effect as running cmd from the run prompt on the local machine. Anyone know how to do this?

View Replies !
What's Wrong With This Fopen Command? Just Blank Page
<?php
fopen("drive:filefilePhoneList.mht", "r");
?>

gone onto php.net and looked up a load of others that do the same thing? some of them anyway

fgetss() fread(), fgetc(), stream_get_line(), fopen(), popen(), fsockopen(), and stream_set_timeout(), file(), fgets() , fread(), readfile(), file_put_contents(), stream_get_contents()

View Replies !
Execute MySQL Command After Viewed The Page For 20 Seconds
Is it possible to somehow wait for a user to stay on the site for 20 seconds and after that issue a MySQL command? I'm creating a system that gives registered users points for viewing pages etc.

I thought it might be done with Javascript, but a quick glance to the Javascript DevTalk teached me that it is not possible, because Javascript works on the client.

View Replies !
PHP CLI Command Line On Win XP Pro Calling External Page With CURL
I wanted to avoid using VBSCRIPT to process a local script running on a win xp pro box. Being that I know php pretty well, I thought I might try it to solve the problem of not knowing vbscript.

I have it running fine on this machine. even have it so I can just type in the php script name instead of c:/php5/php.exe before the script. Cool stuff.

I need to call a php script on another server when this runs and receive a response. (preferrably using POST). I had a test working with vbscript using MS's XMLHTTP.

Not knowing what else to use. I got a quick test working with cURL but it doesnt seem to like the curl_setopt settings. without them, it calls the page (As GET) and receives a response.

So my question is. is there a better method than CURL to receive a response from a script running on the command line? and how can I get it to use POST if I cant use curl_setopt.

View Replies !
Use The Php Include Command In Source Code To Insert External Page
Hello, i am trying to use the php include command in source code to insert external page when a main page loads, but get the following errors.. can you help?

View Replies !
Header() To Redirect A Page
I know that you can use header() to redirect a page, but that you have to use it before any script executes; How do you redirect the page after the script executes?

View Replies !
Include Header On Every Page
Is there a way to include this header on every page by calling it from my directory instead of copying and pasting all of that code on every page?

View Replies !
Location Page In A Header
I have tested several options in trying to resolve the following problem w/o success, Code:

View Replies !
Redirect To Another Page Without Using Header()?
I've seen a lot of PHP redirect using headers. However, is there a way to redirect to another page without using header()? I have already outputted an html and did a validation using PHP. So, how can I redirect after the HTML page has been sent, say after 30 seconds after they've read that the registration is successful? Much like the way the Refresh works after a successful posting in WebmasterWorld.

View Replies !
Non Header Page Redirect
I want to do a page redirect but without using:

header("Location: http://somesite.com");

as it needs to be done at the end of a page after other code has been run... is there an equivalent to the ASP response.redirect?

View Replies !
Header Redirect From 404 Page
Due to a change of supplier I have to remove around 900 pages from my site all from within a sub-directory. These pages are all doing okay in the search engines so I'd like to be able to handle visitors who click on these pages in the serps.

My plan is to use my custom 404 page to redirect requests for pages in this sub-directory to the root page of this section using header("Location: index.php"). Would this cause any problems with the search engine spiders? I don't want the spiders being redirected as I want them to drop the old pages asap. Would a javascript redirect be a better option?

View Replies !
Header Redirects Me To A Blank Page
Ive a problem with the command.

header("Location : index.php3") , it works on PWS , but on Apache it redirects me to a blank page (and no errors ).

View Replies !
Using An Include Header Pushes My Page.
When I try to use the "include" to add in a header file, php put my header flush left and the all the html flush right. The footer seems to work fine but for some reason I cant get the header to work right any ideas? ....

View Replies !
Send The Header To The Client Only At The End Of The Page?
a quick question.
is it possible to send the header to the client only at the end of the page?
I mean when the build of the page by the PHP server is finished.

This is because I want to redirect the user to a error.php page each time an
error occurs.
But when doing that, I get an error saying that the header has already been
sent.

View Replies !
Header Function To Redirect A Page
I am using the header function to redirect a page. Which works great except when I want to send info to the redirected page.

example:
2 pages
a.php
b.php


If I am on page a.php which has a form on it and I hit submit there which normal refreshes back to its self but one of the check boxes are checked I have it redirecting to page b.php. The redirect works great but I would also like the rest of the variables that where submitted in the form to be accessed on page b.php.

Is that at all possible?

View Replies !
Printing New Table Header On Every Page
I query a database and print the info in a table.I need to print a new table header on each new page. Do I need to embed another loop somewhere so that like every 20 rows print a new table header, if so how, and where? Thank you so much for any help. Here is my code:

View Replies !
On Windows I Only Get The Header Of The Last Page I Was Redirected To.
I'm making a HTTP request to a source where I get redirected. Let's assume this page is "https://www.example.com" and it redirects me to "https://www.example.com/redirect.html". My request looks like this:

$html = file_get_contents('https://www.example.com');

Now, when I print out $http_response_headers I get different output on MacOS/Linux and Windows:

MacOS/Linux:

HTTP/1.1 302 Found
Connection: close
Date: Mon, 26 Feb 2007 15:28:46 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Location: /redirect.html
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 266
HTTP/1.1 200 OK
Connection: close
Date: Mon, 26 Feb 2007 15:28:46 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 7830

Windows:

HTTP/1.1 200 OK
Connection: close
Date: Mon, 26 Feb 2007 15:28:46 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 7830

So on Windows I only get the header of the last page I was redirected to. But I need all the headers on Windows. Does anybody know which setting is responsible for that? In both cases (MacOS 10.4 and Windows XP SP2) I am using the latest XAMPP.

View Replies !
Header(location: Page.php?error=something)
i have a login form that looks like this: PHP Code:

<?php
if(!isset($_POST['submit'])) {
  //form here
}
else {
  //code here
}
?>

now in the code i check for errors in the fields like usuall. If an error is found, like the text in the password field is to short, then it need to be redirected to the login page with page.php?

error=something.but i cant use header(location: page.php?error=something) because headers already send by. Also i dont want the code in a seperated file for some reasons. And i want the error be displayed at the login form.
how can i do this?

View Replies !
How To Get Rec Id And Use Header() To Open New Page And Pass Rec Id
1. After the record is inserted I would like to open page_add.php and pass the record id (there is an auto_increment field in the table called ID) to the new page "page_add.php". I was thinking of using header() to open the new page and passing the id as parameter (i.e. page_add.php?rec_id=what ever) is there a better way to do this?

2. how would I get the record id after I store the new record?

3. Also not sure how to write header() with a variable in it?

Code:

View Replies !
Pass Details To The Next Page Using Header?
Is it possible to pass details to the next page using header? I've tried the below but it doesn't work.

View Replies !
Header Function And Reloading Of Page
i don't understand about the header function. I have a script that downloads files from my server. How i have it now is that the file name is a link to the same page with a variable appended telling it to download the file.

when i click the link the file does download but the page doesn't reload and the attached variables aren't in the URL. the reason i want the page to reload is that everytime the file is downloaded it updates my mysql database telling it how many times it has been downloaded, and i want the new value to be displayed. Code:

View Replies !
Can I Carry The Session_id() Over To The Next Page On A Header?
Can I carry the session_id() over to the next page on a header?

header("LOCATION:
http://domainname.com/view_error.php?sessionid=".$sessionid);
exit();

OR

Inside an if statement, how can I branch to the page
view_error.php?session_id() without using a header.

View Replies !
Include Google Ads/header.txt On Page
I know we can include txt file with google ads init:

like <?php include("header.txt"); ?>

or add ads the code simply above/insde the code...

but i have differnet problem here... If i add include header.txt
or add any code above/inside the original php code I can't
able to login to Admin panel... it gives error messege

is there anyhow i can include header.txt differnet way so it wouldn't effect the admin configuration area. Code:

View Replies !
Redirecting The Page - Cannot Modify Header Information
I have one doubt regarding redirecting the page..

If I run the redirect code that is header("Location: www.sampels.com") in the
local server it works well but If I upload the same PHP file to the web server It gives warning and didnt work.

Warning: Cannot modify header information - headers already sent by (output
started at /usr/local/etc/httpd/htdocs/project/index.php:7) in
/usr/local/etc/httpd/htdocs/prjoect/index.php on line 108

what can I do to do solve this problem.. please can anyone help me.

View Replies !
How The Referer Header Works If Sent On A Php Page On Domain Z.
I wasn't too clear about how the referer header works if sent on a php page on domain Z. Does it mean that it will send to the destination server a referer specified in the header, even if it is not the actual referer of the site?

e.g.

header("Referer: http://www.wanttosendthis.com");
header("Location: http://www.anothersite.com");

With anothersite.com show in it's logs the referer as wanttosendthis.com?

View Replies !
Google Page Rank And 'header' Redirects
If I have a links page that uses php header calls,
for each link, to jump to an external page, does
Google see those links as "internal to my site"
or do they get counted as links to the redirect?

IE: people ask me to exchange links all the time.
Sometimes (usually not) I do it, but always with a
link to in interal-to-my site file that has a

header("Location: http://someothersite.com");

So, in other words, in Google terms, do those
people get the page rank credit they are seeking,
when I do it that way?

View Replies !
How To Strip Header Section From An HTML Page?
I have an html page returned from a curl session in a variable. I want to
strip off the header portion of the file and replace with a new header.

It seemed to me that this is probably a well-known thing to want to do, but
before I try to write the code myself, anyone have any code examples of how
to do this?

View Replies !
How To Print Data On Paper With Header In Each New Page?
I am getting stuck at a point in my project.

I would like to give functionality of print data from site. but there
is a problem is that if there are lots of data which takes multiple
pages to print then I need to show header that indicates coloum name at
top of each page so can any one help me how to do that.

the main problem is there are muliple line for each row so I could not
make condition depends on some fixed rows concept. So Please keep this
in mind.

Let me give u visual for my problem.

First Page will prints as follow:

View Replies !
Cannot Modify Header - Html Page With A Form
my code was working fine yesterday. I have a html page with a form and a php page that plugs the posted fields into a .rtf file.

All of a sudden i get this error:

Warning: Cannot modify header information - headers already sent by (output started at.

View Replies !
Page Continues Parsing AFTER A Header() Redirect?
i was just misunderstanding the way the header() redirect works. Is it true that PHP code continues to parse beyond a line like

header('Location: http://www.someurl.com');

EXAMPLE: Would CODE PORTION 2 still execute? Because it is for me...lol

CODE PORTION 1
CODE PORTION 1
CODE PORTION 1
header('Location: http://www.someurl.com');
CODE PORTION 2
CODE PORTION 2
CODE PORTION 2

View Replies !
Index.php?page=download Vs Header An Footer
I've been programming for a couple of years, but still I'm not sure which is the best solution.

solution 1:

index.php?page=download
- here you call you index and it will load a page in it

solution 2

download.php

- here you load download.php and you load the menu etc with header.php

what do you think is the best solution? and why?

View Replies !
How To Send The User To The Page Is Using The Header() Function.
I am writing a page with sessions. At the start of every page I check to make sure that the user actually has a session by checking for some SESSION variables. On one of my pages I have a form that is to add guests for an event.

I have no idea how many guests a particular member is giong to bring and the number of guests is not limited. So to save myself time I wrote a form that will allow you to add one guest and then hit add guest.

This will save that guest to the guest table in my MySQL database but then I want to reload the page to have them add another guest. The only problem I am having is that the only way I know how to send the user to the page is using the header() function.

This is not working because I have already output data. Is there a better way to do this so that I can one form and not have to have a form input for guests up to 20?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved