Return to Home Page????
Moderator: General Moderators
Return to Home Page????
I am new to PHP and trying to learn enough to help me with my web site. I have several pages on my site defined as follows:
These were written using HTML:
Home page = WoodArt.shtml
OrderForm page = Form.html
PHP code page = Test.php
This is what's happening: On the ORDERFORM page when I click the SUBMIT button, the PHP code page is called and executed. When the execution is complete, I have a blank page on my screen. I would like to have it automatically return to the HOME page. Can someone explain to me and show me the code I need to do this?
Thank you,
Sam
These were written using HTML:
Home page = WoodArt.shtml
OrderForm page = Form.html
PHP code page = Test.php
This is what's happening: On the ORDERFORM page when I click the SUBMIT button, the PHP code page is called and executed. When the execution is complete, I have a blank page on my screen. I would like to have it automatically return to the HOME page. Can someone explain to me and show me the code I need to do this?
Thank you,
Sam
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Return to Home Page????
Code: Select all
header('Location: example.com/WoodArt.shtml');
exit;mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Return to Home Page????
put this in the end of ur code:
Code: Select all
header("Location: ../woodarts.html");- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Return to Home Page????
No, don't do that. Location headers require a absolute URL (though they may work without one) and why the ../?liamallan wrote:put this in the end of ur code:Code: Select all
header("Location: ../woodarts.html");
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Return to Home Page????
Everyone: Thank you for your suggestions but using that code, I could not get it to work. I did add this code to the bottom of my PHP code and finally got it to work.
Thanks Again,
Sam
Code: Select all
<meta http-equiv="refresh" content="0;url=WoodArt.shtml" />
Sam
Re: Return to Home Page????
i use the ../ to take me back to the root folder in case the processing file is in its own directory
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Return to Home Page????
Suppose it's 2 directories deepliamallan wrote:i use the ../ to take me back to the root folder in case the processing file is in its own directory
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Return to Home Page????
works if its 3,4,5,6 or 7 directories deep.
infact u can have as many directories as u want
infact u can have as many directories as u want
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Return to Home Page????
What?liamallan wrote:works if its 3,4,5,6 or 7 directories deep.
infact u can have as many directories as u want
http://www.example.com/index.php is the home page.
http://www.example.com/content/products/index.php contains this code:
Code: Select all
header('Location: ../index.php');mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.