Jump to content
xisto Community
sachavdk

A Php Loginscript For Your Site For everybody

Recommended Posts

@Aevum Decessus:

You forgot to close your <select> with the </select> tag. It's not obligated but some browsers (like IE) aren't that strict with html and can cause display errors. (Firefox shouldn't give problems with this as far as I know)

So here's the correct form:

<form name="registration" action="file:///C|/Documents%20and%20Settings/Administrator.MASTER/Desktop/Loginscript/registration.php" method="post"><h1>Create your account</h1>Valid E-mail address: <input type="text" size ="30" name="email">Verify E-mail address: <input type="text" size="30" name="e-mail2"Desired username: <input type="text" name="username"><br>Desired password: <input type="password" name="password">Confirm password: <input type="password" name="password2"><br>Master: XXXX<select name='AAAA' style='border: 1px solid #FFFFFF; background-color: #000000; color: white'><option value="life">Aevum</option><option value="death">Decessus</option></select><input type="submit" value="Register!" name="submit"><input type="button" value="Login" onClick="javascript:window.location='login.html'"></form>
For your second question, the value from the selectresult will be stored in $_POST["AAAA"], and it will contain "life" or "death".

Another thing. To use php you need a server running so I expect you have. But for which reason are you using the absolute path of your script as action? Place everything in your server folder and just begin from the path where this form is located. That will be enough :P

 

@el_exorcista:

encryption is indeed a something that I forgot. But I "forgot" it deliberatly. Nevertheless if you use the md5 encryption method guests aren't able to request their password if they have forgotten it since md5 is a one-way encryption method. If you want to decrypt the password you'd better write one yourself.

It still remains extremely difficult to write one that is somewhat safe and above all one that works in two ways.

For people who want to use encryption, md5() is a good opportunity but when you want to decrypt you can also use base64_encode() and base64_decode(). For a personal site encryption to transfer the data is enough. I don't think with a (My)(MS)(PostGre)SQL database it will be a serious damage if you don't use encryption (it probably won't be attacked). That's why I advise the base64_encode() method.

Encryption is only very important for a professional site for companies etc. who mostly use Oracle.

 

Anyway you people might think different -_-

Share this post


Link to post
Share on other sites

For your second question, the value from the selectresult will be stored in $_POST["AAAA"], and it will contain "life" or "death".

Another thing. To use php you need a server running so I expect you have. But for which reason are you using the absolute path of your script as action? Place everything in your server folder and just begin from the path where this form is located. That will be enough :D

 

 

Anyway you people might think different :)

175099[/snapback]

yeah, the reason for the absolute path is using dreamweaver and drag and drop. thanks for pointing that out gotta fix it, and thanks for all of your help, Gotta go do some coding now

Share this post


Link to post
Share on other sites

Could you by any chance list something this an be used for?

And it looks extremely long, is there anyway to shorten it up a bit?

175440[/snapback]

your first question is to yourself. You can use the script to make a login for your site, a site you are making for somebody else, etc... It gives a little more control over your site (people have to login to post a reaction on a news system, to post your gb (ie with a portalsite),.... whatever you like

 

For your second one, the answer is simple: "probably yes", but not much. This loginscript is a really basic one and doesn't offer very much protection of your data, but it's safe enough for a personal site. To give you an example; a friend of mine works with a company who writes websites. The average loginscript-length is 10000 lines of code. It's not written by one person, but I think in compare mine is really short and simple :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.