try another color scheme:


Go Back   TECH6.0 > Get Techie > Programming > PHP/MySQL


Move to a new URL

This is a discussion on Move to a new URL within the PHP/MySQL section, part of the Programming category; I know I am missing something simple, and I have looked at the W3 schools stuff on PHP, so I ...

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 22-09-2008, 11:59 AM
No Avatar

Techie
 
Join Date: Aug 2008
Location: United States
Posts: 54
MisawaPlayer is on a distinguished road
Send a message via Yahoo to MisawaPlayer
Default Move to a new URL

I know I am missing something simple, and I have looked at the W3 schools stuff on PHP, so I need someone's help.

I simply want a PHP "command" or function, or whatever, that allows me to give it a URL, and it will move me to that URL. I want to do it from within code, not as a hyperlink on my webpage. I want the user to enter some data on a form, then depending upon the data entered, move to a different URL. Must be done behind the scenes in code.

Any PHP experts that can help me would be greatly appreciated.
Reply With Quote
  #2  
Old 22-09-2008, 04:39 PM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Default

Hii... nice to see you !

ok..Does this help ?

PHP Code:
if($this)
{
    
header('Location: pass.php');  
    exit;
}
else
{
    
header('Location: fail.php');  
    exit;

I had always used header() whenever I need to move to another page/url from within PHP code.
http://www.w3schools.com/php/func_http_header.asp
http://in.php.net/header

Note: In vBulletin we use $vbulletin->url
__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
  #3  
Old 22-09-2008, 09:12 PM
No Avatar

Techie
 
Join Date: Aug 2008
Location: United States
Posts: 54
MisawaPlayer is on a distinguished road
Send a message via Yahoo to MisawaPlayer
Default

Now see, this is why your site is so great. Webwizzy knows everything. Well, maybe not everything, but pretty much.

I said I had missed something. I missed the "Location:" part of it. Add that in, and everything works great!

Thanks.
Reply With Quote
  #4  
Old 22-09-2008, 09:38 PM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Default

Glad you got it working..
__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
  #5  
Old 22-09-2008, 11:36 PM
No Avatar

Techie
 
Join Date: Aug 2008
Location: United States
Posts: 54
MisawaPlayer is on a distinguished road
Send a message via Yahoo to MisawaPlayer
Default

Thanks, Stupid 2am type error. Reading - it sometimes helps.
Reply With Quote
Reply

Bookmarks

Tags
header, location, new url, php


Thread Tools
Display Modes




All times are GMT +5.5. The time now is 06:42 PM.

Contact Us - Tech6.com - Link to Us - Advertise - Submit Site - Privacy Statement - TOS - Top