Redirect

Reply

Join Date: Nov 2004
Posts: 257
Reputation: sam1 is an unknown quantity at this point 
Solved Threads: 1
sam1's Avatar
sam1 sam1 is offline Offline
Posting Whiz in Training

Redirect

 
0
  #1
Feb 16th, 2009
Hi,

I am using redirect on my index.php to redirect to a directory in server. I havent used any html tags etc just <?php redirect ?>
i want to use html meta data and tags as well.

as i am a newbie i need your help on this. because google cannot crawl and create the sitemap. help please

thanks
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro

Re: Redirect

 
0
  #2
Feb 16th, 2009
Not sure exactly what you are asking, but in PHP redirection can be done as follows:
  1. <?php
  2. header("Location:http://www.somesite.com");
  3. ?>
and Meta:
  1. <meta http-equiv="refresh" content="5; url=http://www.somesite.com">
this goes in the <head> tag
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 257
Reputation: sam1 is an unknown quantity at this point 
Solved Threads: 1
sam1's Avatar
sam1 sam1 is offline Offline
Posting Whiz in Training

Re: Redirect

 
0
  #3
Feb 16th, 2009
thanks for the reply. basically i have a php file but when i include html tags the redirect doesnt work. what should i do to make it work .

should i create .html file and have html tags then redirect using php or this php file is fine.......
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro

Re: Redirect

 
0
  #4
Feb 16th, 2009
You can either echo the HTML tags echo "<some_tag>html</some_tag>"; If you do this the remember to escape your quotes with \s

Or another way:
  1. <?php
  2. // Some PHP code
  3. ?>
  4. some HTML code
  5. <?php
  6. // Some more PHP code
  7. ?>
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 357
Reputation: death_oclock will become famous soon enough death_oclock will become famous soon enough 
Solved Threads: 37
death_oclock's Avatar
death_oclock death_oclock is offline Offline
Posting Whiz

Re: Redirect

 
0
  #5
Feb 16th, 2009
Originally Posted by sam1
when i include html tags the redirect doesnt work
Very true. You can't send header information (thats where you're redirecting) after outputting anything. All you could do is put your meta tags after the redirection code. That would be useless though, because your program will never get to this point.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC