Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

php include from my https area?

Featured Replies

Hi all,

 

With regards to the secure socket layer (https) does a user have to login from here or can i include a php login form that will connect to the database through the https?

 

In other words say my main root directory is http//www.mysite.com/index.php and in the homepage I have an include file called login.php from https//secure.mysite.com/

 

will this work or will this be essentially negating the point of having the SSL?

 

Thanks in advance

 

Wayne.

Hi all,

 

With regards to the secure socket layer (https) does a user have to login from here or can i include a php login form that will connect to the database through the https?

 

In other words say my main root directory is http//www.mysite.com/index.php and in the homepage I have an include file called login.php from https//secure.mysite.com/

 

will this work or will this be essentially negating the point of having the SSL?

 

Thanks in advance

 

Wayne.

 

To be honest as long as the script thats passing the information is on the SSL connection yes u should be able to include the login form :)

Hi all,

 

With regards to the secure socket layer (https) does a user have to login from here or can i include a php login form that will connect to the database through the https?

 

In other words say my main root directory is http//www.mysite.com/index.php and in the homepage I have an include file called login.php from https//secure.mysite.com/

 

will this work or will this be essentially negating the point of having the SSL?

 

Thanks in advance

 

Wayne.

 

Hi Wayne,

 

Short: Your login page has to be https://secure.mysite.com/index.php for it to all be secure.

 

Long: HTTPS works between the users browser and the web server. Generally I think php includes from a remote location are a "bad thing", and you gain nothing from it because the user is still seeing the un-secure page. In order for the login process to be secured, it should start and finish on a https page. This is so that the information the user submits is encrypted, which is the entire point of https.

 

Hope that wasn't too rambly :) First time giving advice like this in a while!

 

Rob

  • Author

Thanks guys for your responses.

 

Nice bit of info.

 

Will keep the login to the HTTPS area

 

Cheers,

 

Wayne.

 

 

Just to clarify say I wanted to still include the login.php as mentioned above on my index.php page (which is not in the https domain) would i need to use something like an iframe as I dont really see any other way around it?

It doesn't really matter what PHP is including and where its getting it from, as long as the login form action is posting data to the https server then its fine.

Yea i agree with jock, like i said earlier its ok if u include files outside of the https server just as long as the script that is processing the login info is on the SSL connection it will be secure.

Includes have nothing to do with the http/https

Does your hosting separate the two? ie have folders for your https and http in separate locations?

You include using the file system of the server, not over http/https. If you do that, then the PHP of the include will be executed before it's added to your script, making any php in it effectively useless

  • Author

No my hosting server does not have http / https folders, just public_html etc.

 

So if I understand this right I can include a php file from any location in the http but as long as the form submits to the https area its ok?

 

Thanks for the replies

Umm well yeah, but I just think you need to forget includes and http as one combined entity

When PHP includes a file, it is essentially adding the content of a file to the location it's included and executing it as part of the script

This is done through the file system, and can get any file on the server whatsoever that the user the script is running under has access to that file and location

This is just a normal file read, it doesn't require you to use HTTP or HTTPS, hell you don't even need a web server running on the machine to include the file

 

As for the form posting, it would be best if the whole thing was in a secure area. say for instance someone passes their email and password via HTTPS, but they get the pass wrong and you send them back to a HTTP url with their email filled in again, you're kind of defeating the object. Just stick to HTTPS for all of it

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.