Zubrag.com
May 16, 2012, 04:21:41 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Password Protection PHP Help!  (Read 2965 times)
Just1nCase
Newbie
*
Posts: 4


« on: April 06, 2007, 12:48:54 am »

I would like to use your Password Protection PHP into my website.. but Im have no idea how to use it.  From reading the instructions, I need to add a short line script provided from your website into PHP pages and upload the PHP script into my hosting.  However, I have a bunch of *.HTML files instead of *.PHP files ready to be password protected.

Would I need to change my file extensions of my *.HTML file to *.PHP?  When I need to convert my *.HTML to *.PHP files, will I lose any of my HTML markups? I just want to a simple password protection implemented into my current web design just like this website www.lynnetteandjulius.com...Please let me know.  Thanks.  Also, do I need a separate page for the login?

Btw, I'm new to PHP so if I don't make any sense, let me know.

Logged
zubrag
Administrator
Hero Member
*****
Posts: 753


WWW
« Reply #1 on: April 06, 2007, 04:00:35 am »

Password protector can do what you need (similar to site you mentioned). But it can only protect php pages. Markup will not be lost if you rename your files from html to php. However I would not suggest renaming files to php because all inbound links which link to html will be broken. If you do not care - than it is ok to rename and use password protector.

Better solution would be to setup web server to treat html files like php. In this case you would not have to rename to php, and will be able to insert php code into html files. You'll need to contact your hosting provider if they can setup it for your site.

Here is what your hosting provider have to setup for you: Make html pages work like php without changing extension
Logged
Just1nCase
Newbie
*
Posts: 4


« Reply #2 on: April 06, 2007, 06:35:47 pm »

Thanks for the reply.  I haven't purchase a web hosting for my website yet, but I am planning to purchase my Web Site hosting at GoDaddy (The Economy Plan).  So, I am going to ask GoDaddy right now. 

In the meantime, if I find it too difficult to allow my webserver to parse my *.HTML files to PHP, how would I rename my HTML files?  Would I simply go to my files and rename *.php or do I need to go through dreamweaver and "Save as" PHP extension.

Thanks again.
-Justin
Logged
zubrag
Administrator
Hero Member
*****
Posts: 753


WWW
« Reply #3 on: April 07, 2007, 06:03:03 pm »

Simple renaming to php may not work because links you have in pages would still be pointing to html. What you will have to do is rename files to php, and fix all links. Remember to backup before renaming, you may need it in case something goes wrong...
Logged
Just1nCase
Newbie
*
Posts: 4


« Reply #4 on: April 08, 2007, 01:13:17 am »

Thanks, it works. You're awesome. Just one more thing though.  I'm getting an "Warning" message:
Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/u/s/just1ngaspar/html/main.php:Cool in /home/content/j/u/s/just1ngaspar/html/Scripts/password_protect.php on line 268

How will I be able to fix this problem? Thanks.
Logged
Just1nCase
Newbie
*
Posts: 4


« Reply #5 on: April 08, 2007, 03:18:57 pm »

I found the answer to my problem.  I had to move PHP script to the very beginning of my PHP files.  Thanks!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC