Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 13th, 2003, 12:35 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Germany.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Redirection

On topic ends, another starts :)

I'm playing around with http://www.phpbb.org for my (future) site.

No easy stuff, though!

Now, how can I implement a simple redirection to some other script. In that forum software they make use of meta redirection, but I believe there must be somethings like
Response.Redirect(url)



Cheers,
Frank
__________________
-----------------------
--Frank
http://www.insidesql.de
-----------------------
  #2 (permalink)  
Old June 13th, 2003, 04:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

header("Location: http://www.url_for_redirect.com/");

Make sure that you have not sent any output to the browser before
calling a heder function.

Regs,
NotNowJohn

...but the Soon is eclipsed by the Moon
  #3 (permalink)  
Old June 13th, 2003, 04:31 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Germany.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

simple as that, although I saw it, I didn't realise that is seems to be a builtin function.

Thanks again!

Cheers,
Frank
  #4 (permalink)  
Old June 15th, 2003, 06:19 AM
Dai Dai is offline
Authorized User
 
Join Date: Jun 2003
Location: Swansea, west glamorgan, United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What do you do if you want to automatically redirect to another page after an if statement. Do yu use meterefresh or is there some php code to deal with this?


What ever makes life easy
  #5 (permalink)  
Old June 19th, 2003, 02:24 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Dai
 What do you do if you want to automatically redirect to another page after an if statement. Do yu use meterefresh or is there some php code to deal with this?
Well, if you want to do it via Javascript or with an HTML meta refresh tag, you should only output that code if your conditions are met within PHP.

example:

<?php

if( some condition )
{
   echo "<meta http-equiv=\"refresh\" content=\"5\" />\n";
}
// else don't generate refresh code.

...
?>


Simple as that.


Take care,

Nik
http://www.bigaction.org/


Similar Threads
Thread Thread Starter Forum Replies Last Post
URL Redirection santhosh.irtt Apache Tomcat 1 July 1st, 2006 08:07 PM
Redirection andyw ASP.NET 2.0 Basics 2 May 29th, 2006 05:23 PM
Download and Redirection wolverine4277 PHP How-To 5 December 23rd, 2004 05:32 PM
Redirection in webservice suparba .NET Web Services 3 October 27th, 2004 01:15 PM
automatic 'redirection' stu9820 Flash (all versions) 4 September 20th, 2004 07:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.