I need someone that knows PHP.

tyurekes

Beta member
Messages
3
Location
USA
I'm building a website and I am using a ton of PHP scripts. All of the PHP scripts are in a folder within the Public_HTML directory. I need it to forward back to the main website, but when I enter that in, it automatically adds in the folder name in front of where I want it to go.

PHP script in question:
Code:
<!--
window.location='account.html';
//-->

The folder this script is in is called plus_signup_v1. The account.html is in the main directory. The code above redirects to plus_signup_v1/account.html

Any help?
 
Hi Tyurekes,

I believe you need to use something like this

Code:
<!--
window.location='../account.html';
//-->

Let me know how it goes
 
This code that you're using to redirect someone is actually Javascript. You should implement a fallback for the redirect via PHP, as a user could be browsing with Javascript disabled in their browser. Any time that you're using Javascript for validation, redirects, or something else.. try to have PHP (or another language, if applicable) in there as a fall-back.

An explanation on using the header() function in PHP is here, within the first answer.

Are you building this site for educational purposes, or for use in a production environment? If you're building a site for a production environment, I'd suggest that you have someone with a bit more experience look over it first. Improperly done could be both inefficient, and insecure. I'm not trying to be insulting or demeaning in any way, but I do recall going through this phase of coding years ago, and had to learn some lessons the hard way.
 
Back
Top Bottom