473,385 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Redirecting a site visitor based an a certain condition

ifedi
60
What's the neatest way to redirect a site visitor to another page using php, based on one or more conditions? I've already used header('Loacation: another.php') in many of my scripts, but I find that there are problems sometimes.
I tried http_redirect(), but it seems I needed to put a number of things together to let my 'localhost' be able to word with it.
Any help'll be appreciated!
Feb 12 '08 #1
3 1122
Markus
6,050 Expert 4TB
As far as i know header("Location: ... is the best way to deal with redirecting..
Feb 12 '08 #2
ronverdonk
4,258 Expert 4TB
What's the neatest way to redirect a site visitor to another page using php, based on one or more conditions? I've already used header('Loacation: another.php') in many of my scripts, but I find that there are problems sometimes.
I tried http_redirect(), but it seems I needed to put a number of things together to let my 'localhost' be able to word with it.
Any help'll be appreciated!
I agree with markusn00b. When you say you are (sometimes) having problems with header(..), you should solve that problem (probably "Cannot modify headers ...etc.... " msg) and then use the header() command to redirect.

Ronald
Feb 12 '08 #3
ifedi
60
I agree with markusn00b. When you say you are (sometimes) having problems with header(..), you should solve that problem (probably "Cannot modify headers ...etc.... " msg) and then use the header() command to redirect.

Ronald
Thanks guys for your comments. Don't really think it was a "Cannot modify headers ...etc.... " msg (which has to do with placing any browser output before the headers() is called), though I can't now pull out the exact situation where I had problems (limitations) with header().
At any rate, what's http_redirect() about, what has it got over headers() and how can I build its support into php?
As always, thanks.
Ifedi.
Feb 13 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: For Example: John Smith | last post by:
Hi, I thought this was simple to do but I have not had any luck. I would like to have two versions of my web site which are optimised for different browsers. One version for IE and one version...
64
by: Dave | last post by:
A friend of mine pointed out the other day that certain elements on my web site are too small. But in most of what I publish, fonts are at default size or smaller, and my images are easy to see. I...
1
by: Steven (remove wax and invalid for reply) | last post by:
Hello to all. I'm a member of this non-profit organization: http://www.hitagroup.org/ For several reasons, we need to move our web host and I got volunteered. The person who created it is no...
2
by: Hari | last post by:
Hi, How can I find out what site a visitor has come from using ASP? Suppose my website is sample.com and I have one page in the website that is used by the visitor to request products and...
6
by: J Rieggle | last post by:
Hi there, I am stuck on a problem that relates to eCommerce sites, but isnt ASP.NET specific (sorry). The ecommerce site is working in the UK, and products will be sold in pounds stirling. ...
6
by: Brad | last post by:
I have a win2003 server workstation with multiple webs, each web has it's own ip address. In VS2005, if I select to open an existing web site, select Local IIS, the dialog correctly displays a...
0
by: lj | last post by:
How do I get an asp.net datagrid to set certain records as tedittemplate based on a certain condition. It is for a simple workflow. The user will have permission to see a list of records. He...
1
by: JosAH | last post by:
Greetings, this week we let go of all that algebraic stuff and concentrate a bit more on what object oriented programming is all about. Java claims to support OO, so why not use it? In this...
4
by: exrcizn | last post by:
I am creating a query in Access 2003 that basically displays data in certain fields in a table (plain and simple basic stuff). I have a field in the table that may or may not contain data. If the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.