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.





How Can I Use Php To Redirect To A Different Page?


This is my situation:

echo "text";
header("location:http://www.blah.com");

That doesn't work. Is there a different way of doing this, a way to redirect the page using PHP after text has been entered into the browser?




View Complete Forum Thread with Replies

Related Forum Messages:
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 !
How Do I Redirect A User From A Page To A Different Page ?
How do i redirect a user from a page to a different page ? i don't want variables to follow behind the url of the pageg being redirected to.

View Replies !
Redirect To New Page.
<?
if ($sitestyle == " ")
{
XXX
}
?>

Above is a simple if statement. Is there a function I can replace the XXX with to make the browser goto a different URL without a link. At the moment this sits at the top of each page I want it so that if $sitestyles has no value then the browser is automatically forwarded to a different page without continuing to load the present one. Is this possible in php?

View Replies !
How Do I Redirect To Another Page
I have a contact form which submits to the php script (processMail.php) but I want that processMail.php page to send straight on to another page (thanks.html). how do i do this without javascript?

View Replies !
Redirect To Another Page
user information collected in a page and added to the database when submit happens,
at the same time after updation of database,

i want to redirect to tsome other page, i used header it's not working becoz of the constraints it had. i am restricted to use only server side scripting,not other client side scripting is allowed to use including jscript.

View Replies !
How Can I Redirect A Page Using PHP?
How can I redirect a page using PHP?

View Replies !
Redirect Php Page
i have been using this java script to redirect my php page when i am done with the page.the java script is:

<script type="text/javascript">
<!--
alert("Created!");
window.location='../new_main.php'
-->
</script>

Can anyone tell me how to redirect a php page to the destinated location using php functions or codes.

View Replies !
The Page Can Not Be Redirect!!!
I can not redirect from one page to another. But I can see all the database info from the page by using PrintVars(). My PHP version is 5.2.3, just wondering how can I solve this problem!

View Replies !
To Redirect To Another Page
I want to redirect to another file, isn't this the right code to do so

header("Location:http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/images/$file_name");

the interpreter give me this erorr instead of redirecting

Warning: Cannot modify header information - headers already sent by
(output started at E: ryphpdirect.php:9) in E: ryphpdirect.php on
line 70

what's wrong in the code coz i don't understand the erorr

View Replies !
Page Redirect
I am trying to make a new post which requires user to login...just like the one used in here.... as you see, in the URL above, there is some value to pass "action", "s" ....
how can I get these values again after redirect...Code:

View Replies !
How Do I Redirect A Web Page?
How do i redirect a web page
Ive using this meta tag:
<meta http-equiv="REFRESH" content="4; url=http://www.redirect_here.com">
Not working, is there something else.

View Replies !
What Is The Best Way To Redirect To Other Page?
what is the best way known and also faster to redirect from htm/html page to other page, instantly.

View Replies !
Redirect To A Page In Php
Is it possable to redirect to a page in php. but not using the header("include"); function ??

View Replies !
Redirect To A Thank You Page
Got this nice little contact form that is called into the page with the 'include' command.

So that I can use conversion tracking I now need to direct the user to a 'Thank You' page to be able to count the form submission as a 'conversion'.

Is it something simple to just change in the echo command below to do that? Code:

View Replies !
How To Redirect A Page By Using Php?
how to redirect a page by using php? I am doing it by javascript, but how in php? I use header("Location: success.php"); but it some time warning coomon error cannot sent header already sent.

View Replies !
Redirect Page At The End
I looked and looked for half a day and have not found a solution for my problem, hence i am posting it here.

I want to reload my php page once.I can't use header func as i need to run a lot of code and html tags before i require the reload. (say in the middle of the php page.) so its safe to assume i have given a load of chars to the browser before i want to reload/redirect to the same page. :-)
Can anyone suggest any ideas on how to go about doing this automatically?

View Replies !
Redirect To Another *.php Page
Please guide me in php command to redirect from current *.php to another *.php page.

View Replies !
Redirect Page
When someone clicks a link on my page, I want them to go to redirect.php. This page will send them to either URL A or URL B. There is a 50:50 chance they will go to either page.

How would redirect.php look?

View Replies !
Trying To Redirect Page
I have a page that submits users info. then it takes it to a page where it checks for validation. if validation is correct, it takes it back to the orginal page in which the form was submited with a defined session var.

When i run the page. I type in my information into the form and when i press submit. I get the error below
Warning: Cannot modify header information - headers already sent by (output started at C:wwwapachehtdocscheck.php:9) in C:wwwapachehtdocscheck.php on line 23

whats the problem ?

View Replies !
Redirect A Page
I'm trying to send the viewer back to the previous page viewed after something has been written to the page(or without changing the header). Right now I'm using a javascript redirect function to do it, but it doesn't look like javascript can do what I want it to do.

What I mean is, I'm using an RPC(remote produce call) function to dynamically change a page. When someone clicks a link it takes them to another page in the site. When they click the link to go back to the dynamic page, I want them to go back to the changed page and not for the browser to reload the page and start them over.

View Replies !
Redirect A Web Page
like asp response.redirect , is it any command in php to redirect a wab page. i am already used header() function , how is it work .

View Replies !
Redirect To A Page
When i am using

header(location: url);
in meddle or end of my php script or html
i am facing following problem
Header already sent.

while when i am using

header(location: url);
in the start of page it works fine,

Is there any redirect('url') function in php like asp or any other alternitive that i can redirect to a page instead of using header() function becuase it is not working when we call it from meddle of html page.

View Replies !
How To Redirect A Page Using Php?
Anybody how to redirect a page using php?

View Replies !
Page Does Not Redirect
The following code is intended to look in my database to see if there is a matching ipaddress and if there is, set action=1 in the records' action field. But instead, I just get a blank screen, no redirect and no action=1.. If I eliminate the database code section, it redirects. What is wrong with my code? Code:

View Replies !
How Do I Redirect To A Page
I am working on some simple authentication code where someone logs in with a name and password. I have been testing out where it does the following on success:

{//variables match

echo "<h3 class='loginmsg'>It worked!</h3>";
}

So now that I have it working if I wanted to bring up myfile.pdf when they succeed what would I need to replace the echo line with?

View Replies !
Redirect To Page
I have 9 different pages and I want that each time the user clicks on the link he will be redirected to different page starting from page1,page2,page3.. page9 en then again page1. I don’t need random page that starts from page5 en than page8,page3 it has to start from page1.

View Replies !
Redirect A Link To Another Page After It Has Been First Used?
Is there any way to redirect a link to another page after it has been first used? Or even kill the link after its first use?

View Replies !
Redirect At Other Link Page
by php which the fast solution for make redirection at homepage ?
Time ago read some solutions, but one most fast because not load
or not make a reload of itself page, not remember
exactly but was a solution more fast...

View Replies !
Redirect The User To Another Page
i want redirect the user to another page for that what can i do in Php3? i.e.,what function i used?

View Replies !
Redirect Home Page
I have a "new" homepage. How do I automatically direct clients to this new
home page, i.e. when clients enter "OldHomePage.php", they will
automatically be directed to "NewHomePage.php."

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 !
Registration Page & Redirect
I would like to put a redirect on the following line shown below in the code if registration is successful: Code:

View Replies !
Redirect To The HTML Page
I have a page which is all PHP processing. It outputs errors via echo.

Since I am using echos for errors, I can not use header("location:http://wwhatever.com") after the code to redirect to the HTML page depending on the success of my operation. The user arrives at this page after clicking a submit button. Form action gets me to the page. The page is all PHP right now.

What is a good way to get around this? I do need the echos in case there are errors - also to keep the user apprised of what is happening in the processing.

View Replies !
Redirect If Page Does Not Load
I have a form that will not submit if certain data cannot be found in Mysql or it will take very long to submit. Is there a way i can have the form go to an error page if it does not submit or load results in 5 seconds.

If it does take long i need the following:
$msg[] = $error10;
header("Location: quote_error.php?");

View Replies !
PHP Drop Down To Redirect URL On The Same Page
I have a "Go" button and drop down list of the following:

Yahoo
MSN
Google

How do I link the Yahoo to www.yahoo.com, MSN to www.msn.com and Google to www.google.com upon pressing "Go"? The redirect will display the website on the same page.

View Replies !
Redirect To Same Page After Login..
I have login box running across all pages for login, template based.. so the script is module based ..

on login script page

tep_redirect(tep_href_link(FILENAME_DEFAULT)); and it goes to index.php  -- I want the filename to go the same page after login....    ie stay on the same page... how can I define this ?  I thought I could define a _DEFAULT2 and define that where the filenames.php are located... what is the script for redirecting to the self/ same page in php..tried a few things but no luck,,,should be pretty simple?

View Replies !
Pausing A Page Before Redirect
I have seen many pages that pause before re-directing. I have been unable to find anything to help me in coding something like this. Anyone have an example I can looke at? I even searched the these forums.

View Replies !
Redirect, After Page Has Loaded
on my 'Register Member Page', if a user successfully fill's in all the fields, then they get sent to a new page where it say's "You have successfully Registered"

if( (!$fname == null) or (!$sname == null) or (!$email == null) or (!$username == null) or (!$password == null))
{
   $query = "INSERT INTO members (Firstname, Surname, email, username, password)
   VALUES('$fname', '$sname', '$email', '$username', '$password')";
   mysql_query($query) or die(mysql_error());
   mysql_close();

   echo "You have successfully Registered";
}
endif;

What i wanted to do was show this page for about 10 seconds then, the user gets automatically directed to the login page.

View Replies !
Redirect To Another Page With If Statement
I was hoping to get a little help structuring a script that I'm trying to devise. I'd like an if statement that basically says: If there is no ZipCode in the current record in the database, then go to the ZipCode entry page, otherwise keep loading the current document.

View Replies !
Page Redirect From Within If Statement?
I would like to have users login, and based on this login, if they're one type of customer I want to take them to pagex.php, if they're another, I want to take them to pagey.php.

Since I don't know what type of customer they are until they've logged in, I can't redirect with the header function, so I thought maybe I could do it by grabbing their login info, and seeing if they're type x, then go to pagex.php if they're type y, go to pagey.php: Code:

View Replies !
How To Fix URL And Redirect The Page To Other Directory?
I want to keep the URL fix in the address bar and redirect the page to a different directory.how can i achieve this.

say for example-my URL is http://www.example.com ,I want to keep this fix but I want ,if someone clicks on this URL he will see the page of some other directory like - http://www.example.com/home/.

but in the address bar the URL will be shown as http://www.example.com

how can i achieve this.please help me to solve this problem.

View Replies !
Quickform Redirect Page
I am using quickform to display and process a form (email data) and need to redirect the page on successful submission. I've tried:

Code:
if ($form->validate()) {
$form->process('email_message');
header("thanks.php");
}

But I get header already sent errors.

View Replies !
Redirect To Home Page
I have three php files, one.php, two.php, three.php these three files need to be accessed in sequence. if one.php is submitted it displays two.php. if two.php is submitted, then three.php is displayed. if three.php is submitted then one.php will be displayed.

alternately, these three files can be accessed individually. like in the address bar user can type localhost:8080/one.php, localhost:8080/two.php or localhost:8080/three.php. when accessed individually, user should be redirected to one.php because two.php and three.php are getting some values from one.php and error is getting displayed when the later action is performed.

View Replies !
Redirect To Another Page If The Criteria Is Not Met.
I am trying to redirect to another page if the following criteria is not met. Headers are already sent to the client so I tried header and this did not work. What am I doing wrong with this code? PHP Code:

$fMemberProfile = f(q("select status from dt_profile where member_id='$fMember[id]'"));

if($fMemberProfile['status'] == 1 || $fMemberProfile['status'] == 3 || $fMemberProfile['status'] == 5) {
$steps_done++;
$pro_lb = $pro_le="";

}
else{
            $URL="http://www.example.com/index.php?page=create_profile";
            Redirect:("$URL");
        }

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 !
Login Page Doesn't Always Redirect
Form login.php page user post username and passwd. in login_ckh.php page it validated usename and passwd from Mysql DB. but the problem is --> login_chk.php not redirect user automatically every time (some time it does,some time it does not).

when it does not redirect, if i press F5/refresh then it redirects to desired page. Their is a BUG in the script. Hours passed but i cannt find any solution. (note: i m new in PHP and session concept). Code:

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 !
Redirect To A Temporary Page
Sometimes when the database can't be reached, the page only show error message. I want to add a conditional redirect into my code so that if the database can't be reached, the user goes to a temporary page.

View Replies !
How Do I Redirect A User To A Page After Say 5 Seconds?
how do i redirect a user to a page after say 5 seconds?

View Replies !
Solution For Redirect At Page Index
by php which the fast solution for make redirection at homepage ?
Time ago read some solutions, but one most fast because not load
or not make a reload of itself page, not remember
exactly but was a solution more fast...

View Replies !
Redirect The Contents Of Form To Another Page
I just got a new web host and all they support is PHP. I am going to learn PHP, but I need a quick script to help me with something and was wondering if one of you could help me out.

What I want to do is submit a form to a php script and simply redirect the contents of that form to another page to acutally handle the data that is sent through the form post.

Example:
abc.htm ----> redirect.php ----> SomeSite

SomeSite will actually process the form data for me and I have no control over the script on that site. I know what data I have to send to the script on SomeSite, but I want the form post to pass through redirect.php

Now in the IIS/ASP world I would be able to use server.transfer to do this. How would I do this in PHP?

View Replies !

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