Link to home
Start Free TrialLog in
Avatar of KLM56
KLM56

asked on

Add php log-in script to html page.

Hi,

I am working with a html website template that came with fields for user name and password. I have a working php script that user logs into to access restricted pages. My question to you guys,  how can I  make it so that existing html user name and passwords be entered on my html page instead of having to direct the user to php page?

Sample html page is at shawunaa.com/test

php pages is shawunaa.com/membership/index.php

Thanks
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

That's a bit confusing.  You can have the original form on an HTML page but the 'action' has to be the PHP page.  In addition, every other page that is being 'protected' by the login must be PHP so you can check the login every time someone accesses the page.
Avatar of KLM56
KLM56

ASKER

I know it must be confusing, cause I don't even know what I am doing. When you say the action must be the php page. Can you explain for a new be? I read somewhere, that I can add some php script to the html page, but I have to research that some more.

Thanks for your response.
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KLM56

ASKER

OK, Thank you....I will do some more research on this.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KLM56

ASKER

Thanks rinfo...

The login php script works fine, I just can't figure how to use my main login as the user input. I will look at your examples and see if it gets me closer. Do appreciate the help.
I have checked your source code .

you just need to put name of your php script which verified login here
<form method="post" action="">
this line should be changed to
<form method="post" action="your php script file name">
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KLM56

ASKER

Thank you guys. This is so much to take in at once, but I want to learn it, so I will read up on all provided information.
Here are the technologies you will want to master:

Client side:
HTML (5)
CSS (3)
JavaScript, especially jQuery

Server side:
PHP
MySQLi or PDO

If you like technical books, search Amazon.com for those topics.  Techies are great about reviewing books, so if you find books with lots of positive reviews, those are the ones to go for!
Avatar of KLM56

ASKER

Guys any suggestion for converting the existing website to php? Is there a program that would convert all the existing pages to php. Would I have to manually go into each folder and change if file within the website?

Thanks
I would not suggest converting your site to PHP until you had learned at least the basics.  Of course, the Very first step is to back up your current site, burn it to a CD and save it... just in case.
There is no one click solution for converting an html site to php.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
...suggestion for converting the existing website to php
This is like converting a bushel of apples into an apple pie -- there are a lot of steps and processes.  But at its simplest, you probably want to make the HTML documents into "units" of the page that can be rendered by PHP.  That means copying the HTML into PHP string variables and using echo to write the strings to the browser output stream.  You can do this best by breaking the HTML up into smaller files and reading the files from the server.  Templating scripts do this sort of thing in all the major frameworks and CMS systems.

I were just starting on this journey, I would start here:
http://www.sitepoint.com/books/phpmysql5/