Add Login Page To Html file?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fredted40x
Forum Newbie
Posts: 3
Joined: Wed Mar 24, 2010 7:37 am

Add Login Page To Html file?

Post by fredted40x »

Hi,

I have been given the task of creating a online website that allows users to log in and register. It also must use sessions. At the moment i have a .html file that uses xhtml 1.0 strict, for the layout it uses a external style sheet.

Is it possible to create a login and register page in php that uses the style sheet?

E.G. the login and register forms should be in the

<div id="main">
login/register form here
</div>

code.

Is there a simple tutorial for this online that works? I would like to be able to learn how to do this as im going to need it next year as well.

Thank you!
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: Add Login Page To Html file?

Post by flying_circus »

PHP does back end processing and then spits out data. You can format the data any way you want. PHP wont necessairly use your stylesheet, but php can be made to spit out data, that when rendered on the client side, will leverage your stylesheet.

fredted40x wrote:Is it possible to create a login and register page in php that uses the style sheet?

E.G. the login and register forms should be in the

<div id="main">
login/register form here

</div>
In the question above, the "login/register form here" is typically a standard HTML form. When the form is submitted, it sends the form data to a php page that will parse, validate, and take action on the submitted data.

We wont write a script for you, so take a stab at it and post code where you encounter a problem. Usually we can lead you in the right direction to solve the problem on your own (i.e. learn) :)
fredted40x
Forum Newbie
Posts: 3
Joined: Wed Mar 24, 2010 7:37 am

Re: Add Login Page To Html file?

Post by fredted40x »

Thanks for your reply, ive found a couple of guides online so will try them out tomorrow when im at uni, hopefully they are good enough for someone like me who has never touched php before :). wish me luck.

does the file that has the xhtml and the form in need a .html file extension or a .php ext?

thanks again
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: Add Login Page To Html file?

Post by flying_circus »

Short answer: If there is any php in the file to be processed, it needs to be in a php extension.
fredted40x
Forum Newbie
Posts: 3
Joined: Wed Mar 24, 2010 7:37 am

Re: Add Login Page To Html file?

Post by fredted40x »

all sorted :), none of the tutorials worked, not sure why maybe they are using a older/newer version of php but i brought a book and spent a bit of time learning php and made one myself :D. Even added a couple of validation bits to it.

Next task is to add some java so it validates it before they click login or register.

Thanks
Post Reply