Page 1 of 1

Add Login Page To Html file?

Posted: Wed Mar 24, 2010 7:41 am
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!

Re: Add Login Page To Html file?

Posted: Wed Mar 24, 2010 12:02 pm
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) :)

Re: Add Login Page To Html file?

Posted: Wed Mar 24, 2010 1:27 pm
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

Re: Add Login Page To Html file?

Posted: Wed Mar 24, 2010 2:42 pm
by flying_circus
Short answer: If there is any php in the file to be processed, it needs to be in a php extension.

Re: Add Login Page To Html file?

Posted: Thu Mar 25, 2010 5:06 pm
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