Mythic Fr0st Posted December 1, 2006 Share Posted December 1, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/29073-storing-username-pws-into-a-database-or-we-you-do-and-other-stuff/ Share on other sites More sharing options...
projectshifter Posted December 1, 2006 Share Posted December 1, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/29073-storing-username-pws-into-a-database-or-we-you-do-and-other-stuff/#findComment-133250 Share on other sites More sharing options...
Mythic Fr0st Posted December 1, 2006 Author Share Posted December 1, 2006 errm, I didnt get that at all, I dont even know how to use MySQLlol, 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 Quote Link to comment https://forums.phpfreaks.com/topic/29073-storing-username-pws-into-a-database-or-we-you-do-and-other-stuff/#findComment-133254 Share on other sites More sharing options...
projectshifter Posted December 1, 2006 Share Posted December 1, 2006 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 :( Quote Link to comment https://forums.phpfreaks.com/topic/29073-storing-username-pws-into-a-database-or-we-you-do-and-other-stuff/#findComment-133256 Share on other sites More sharing options...
Mythic Fr0st Posted December 1, 2006 Author Share Posted December 1, 2006 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 tutorialsSo 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 :) lolNow can I ask you questions:PHow can I move the stuff on the page without using ( 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? Quote Link to comment https://forums.phpfreaks.com/topic/29073-storing-username-pws-into-a-database-or-we-you-do-and-other-stuff/#findComment-133265 Share on other sites More sharing options...
projectshifter Posted December 1, 2006 Share Posted December 1, 2006 lol, well if you really need some help, you can find me on ICQ (255601059) and you can come distract me while I finish some work for clients :P Quote Link to comment https://forums.phpfreaks.com/topic/29073-storing-username-pws-into-a-database-or-we-you-do-and-other-stuff/#findComment-133273 Share on other sites More sharing options...
Fallen_angel Posted December 1, 2006 Share Posted December 1, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/29073-storing-username-pws-into-a-database-or-we-you-do-and-other-stuff/#findComment-133289 Share on other sites More sharing options...
Mythic Fr0st Posted December 1, 2006 Author Share Posted December 1, 2006 Ok thanks, both of youI am trying to e-mail myself, can you tell me why I keep getting parse errorIt 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? Quote Link to comment https://forums.phpfreaks.com/topic/29073-storing-username-pws-into-a-database-or-we-you-do-and-other-stuff/#findComment-133292 Share on other sites More sharing options...
Fallen_angel Posted December 1, 2006 Share Posted December 1, 2006 so so close it is $to=$_POST['email']; instead of $to="$_POST["email"];notice the difference ? ( ' ' instead of " " ) and also you had in a needless " Quote Link to comment https://forums.phpfreaks.com/topic/29073-storing-username-pws-into-a-database-or-we-you-do-and-other-stuff/#findComment-133299 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.