Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 21st, 2006, 12:45 AM   #1
KyrinComaBlack
Programmer
 
KyrinComaBlack's Avatar
 
Join Date: Dec 2005
Location: Toronto, Ontario, Canada
Posts: 48
Rep Power: 0 KyrinComaBlack is on a distinguished road
Send a message via MSN to KyrinComaBlack
Php Https

I just need it for certain files like login and out. And submitting info.

Like say I go to http://something.com/app.php I want it to hit https://something.com/app.php and if the user tried to hit http://something.com/app.php it would give an error. And also I just want to like when they hit the file it is auto https://

sorry if its confusing

Server Info
--------------
Apache/2.2.0 (Win32) DAV/2 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_autoindex_color PHP/5.1.1
KyrinComaBlack is offline   Reply With Quote
Old Jan 21st, 2006, 4:32 AM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
HTTP Redirects, perhaps? Or some fiddling of the Apache configuration might do it, though I wouldn't like to try the latter
Arevos is offline   Reply With Quote
Old Jan 22nd, 2006, 5:50 PM   #3
KyrinComaBlack
Programmer
 
KyrinComaBlack's Avatar
 
Join Date: Dec 2005
Location: Toronto, Ontario, Canada
Posts: 48
Rep Power: 0 KyrinComaBlack is on a distinguished road
Send a message via MSN to KyrinComaBlack
If I use https://www.something.com/login.php?user=XXX. It works but I can easyily change teh https to http and it works I don't want the users to do that. And I want to use https on logins, uploads, and downloads and also on the forums login
KyrinComaBlack is offline   Reply With Quote
Old Jan 22nd, 2006, 11:24 PM   #4
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
can you set a different secure site directory via apache?
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Jan 23rd, 2006, 12:00 AM   #5
KyrinComaBlack
Programmer
 
KyrinComaBlack's Avatar
 
Join Date: Dec 2005
Location: Toronto, Ontario, Canada
Posts: 48
Rep Power: 0 KyrinComaBlack is on a distinguished road
Send a message via MSN to KyrinComaBlack
how do I do that im not that strong in the apache configurations
KyrinComaBlack is offline   Reply With Quote
Old Jan 30th, 2006, 9:56 PM   #6
Mocker
Hobbyist Programmer
 
Mocker's Avatar
 
Join Date: Oct 2005
Location: Indiana
Posts: 216
Rep Power: 0 Mocker is an unknown quantity at this point
Send a message via AIM to Mocker
Look up mod_rewrite and editing your .htaccess file. You can set the .htaccess to automatically turn requests for http://somedomain.com/app.php to https://somedomain.com/app.php use RewriteEngine ON
(google the specific syntax, i cant think of it off the top of my head)

Depending on the webserver you are using, https may be loading files from a different directory, so you need to have your copy of your app there. Plesk systems use a different directory, I think default systems or cPanel systems use the same files. Other systems I wouldn't know


If you just want to do this in the php code itself you could have something like (correct me if i'm wrong, this also depends on if the server uses these)
if($_SERVER['HTTPS']){ //page was accessed using https, continue
}
{
else { //page was not accessed using https
echo '<html><head><title>Error - redirecting</title><META HTTP-EQUIV="Refresh"
      CONTENT="5; URL=http://somedomain.com/app.php"></head><body>Error - you accessed the wrong page. You will be redirected in 5 seconds</body></html>

Thats an example, but yea, either way I guess depends on preference
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi
freelance scripts - http://ryanguthrie.com/index.html
Mocker is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:02 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC