Go Back   Computer Forums > General Computing > Programming
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 05-22-2015, 11:21 AM   #1
Beta Member
Join Date: May 2015
Location: USA
Posts: 3
Exclamation I need someone that knows PHP.

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:
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?

tyurekes is offline   Reply With Quote
Old 05-26-2015, 01:48 PM   #2
Beta Member
Join Date: May 2015
Location: England
Posts: 5
Default Re: I need someone that knows PHP.

Hi Tyurekes,

I believe you need to use something like this

Let me know how it goes

Mike Charlie is offline   Reply With Quote
Old 06-01-2015, 12:54 PM   #3
Fully Optimized
Bahawolf's Avatar
Join Date: May 2005
Location: United States
Posts: 2,599
Smile Re: I need someone that knows PHP.

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.
Bahawolf is offline   Reply With Quote

html, php, redirect, script, window.location

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 Off

All times are GMT -5. The time now is 12:27 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0