Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-22-2006, 07:24 PM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Rep Power: 12
dirkfirst is on a distinguished road
Default PHP Redirection

Is it better to add an HTML redirection or to do PHP redirection?
How is redirection done using PHP?
__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 06-22-2006, 07:56 PM
TkTech TkTech is offline
 
Join Date: Jun 2006
Posts: 992
Last Blog:
Having trouble with yo...
Rep Power: 20
TkTech is on a distinguished road
Send a message via MSN to TkTech
Default

in php its simple:
Code:
<?php
header("Location: http://google.com");
?>
simply put that on the top of your php page and change "http://google.com" to whatever.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-22-2006, 10:22 PM
the-chad the-chad is offline
Newbie
 
Join Date: Jun 2006
Posts: 23
Rep Power: 9
the-chad is on a distinguished road
Default

your browser will not cache the page if you do that tho.

use this if you want the browser to cache the page:

PHP Code:
<?php
 header
("HTTP/1.1 301 Moved Permanently");
 
header("Location: http://google.com");
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-23-2006, 02:32 PM
Crane's Avatar   
Crane Crane is offline
Programming Expert
 
Join Date: Nov 2005
Posts: 399
Rep Power: 14
Crane is on a distinguished road
Default

I'd say PHP.

Isn't it better if the browser doesn't cache?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-23-2006, 04:05 PM
the-chad the-chad is offline
Newbie
 
Join Date: Jun 2006
Posts: 23
Rep Power: 9
the-chad is on a distinguished road
Default

depends on what your doing. If its a perm redirect it would be good if the browser cached the page.

But if you change it alot then no it will be a bad idea.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 07-05-2006, 10:44 PM
Kaabi's Avatar   
Kaabi Kaabi is offline
Programming God
 
Join Date: Jul 2006
Posts: 884
Rep Power: 14
Kaabi is on a distinguished road
Default

A PHP redirect looks a lot simpler than an HTML redirect. I thought it was going to be all complicated, but it wasn't.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 4 end of life announcement Jordan Programming News 4 08-30-2007 10:55 AM
PHP Introduction clookid PHP Tutorials 10 01-16-2007 08:17 AM


All times are GMT -5. The time now is 04:15 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads