Jump to content

Storing username & pw's into a database ( or w/e you do ) and other stuff


Recommended Posts

OK, im so happy WOOT WOOT i got it working, with help from peoples on here:)

Now, I've made a simple username & password thingy, with a button that links to another page...

Now QUESTION 1, how do I check the entered name & password is, greater than 4 characters, if not, display an error on the page, saying "username & pw, must be atleast 5 characters long", but not in an "Alert" box like in javascript, and ALSO checking through the database to see if the username is taken or not,

For Q1 this is what i've got so far
[code]
<html>
<body>


<form action="signup.php" method="post">
Username: <input type="text" name="user" />
<br />
<br />
Password: <input type="text" name="pw" />
</br>
<input type="submit" value="Submit" />
</form>

</body>
</html>[/code]

QUESTION 2:
How do I put on an image for the background ( I make my own XD )
How do I put a banner up ( Same way I guess ? )
How do I colour text O_O ( Hard one for me lol )

QUESTION 3: I forgot, will replace this with something useful later
Please use code blocks so your code is easy to read.

You'll find strlen(string) handy, and basically run a query like [code]"SELECT id FROM accounts WHERE username='".mysql_real_escape_string($_POST['user'])."'";[/code]  Something along those lines should help you.
errm, I didnt get that at all, I dont even know how to use MySQL

lol, O well, i'll learn soon enough, ( thank you )

How do I align text? and objects, E.G my signup boxes, are at the left, how do I position them on the screen?

how do I increase the width/height of a text box

<input type="text" height="5"?> sort of a thing
As much as I like to help out, you're going way way back to the basics.  It's probably not a bad idea to look around for some tutorials rather than ask around on a forum that is more geared to moderate to advanced users.  If you have trouble figuring something out on your own I'd be glad to help, but you're going to have to try to learn some things on your own :(
lol, you think I have tried:P I've spent the past uhh 7-9 hours learning HTML, then realizing Javascript is better, then learning that, finally the last 1 hour, i've been reading PHP tutorials

So dont think im a noob, just tryin to take the easy way, im serious bout this, I wanna design a fully functional online MMORPG or MMO game :) lol

Now can I ask you questions:P

How can I move the stuff on the page without using &nbsp; ( For spaces )

Cus its really bloomin MESSY Lolz

[url=http://www.w3schools.com/php/php_date.asp]http://www.w3schools.com/php/php_date.asp[/url]

^ thats the tutorial im looking at, perhaps you can sugguest a easier one?
I was bored so I edited your code a bit with formatting , hopefull that shows you enough so that you can style it a bit easier ,

[code]
<html>
<body>

<table style="width:asyouwant%; align:asyoulike; font-size:11px;">
<form action="signup.php" method="post">
<tr><td>Username:</td><td><input type="text" name="user" /></td></tr>
<tr><td>Password:</td><td><input type="text" name="pw" /></td></tr>

<tr><td>Submit :</td><td><input type="submit" value="Submit" /></td></tr>
</form>

</body>
</html>
[/code]

basicly what you will need to do is eigther  manually hard code the styling by using things like width="100%"  or you can use a style= " "  tag which is hard coded css as apose to normal html formatting  just remember that after the item ( eg width ) you need to put a : and after the value ( eg 100%) you need to put a ; also with any custom css classes you will need to put them as .classname , not just classname  in the css file , you can  use a class="" tag to referance the info in your css file however if your still grasping basic html formatting you may want to hold off on that at first





Ok thanks, both of you

I am trying to e-mail myself, can you tell me why I keep getting parse error

It says line 5, this is the line

$to="$_POST["email"];

Im trying to get the e-mail entered in the form from last page, anyone help?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.