|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hi all;
i am doing my final project and i am stuck on the code where i want to insert data to my database. i built my wap with xhtml-mp with php and mysql... when i make a user to register through a form then try to login , it doesnt work, however when i insert a record from the mysql by my self and then login it logs in succfuly ! do and one knows why ! plzz this is my code for the inserting data: <? $firstn=$_POST['fname']; $lastn=$_POST['lname']; $password=$_POST['Pass']; $email=$_POST['email']; $mobile=$_POST['mnumber']; $txt=$_POST['txt']; $mail=$_POST['mail']; mysql_connect("","",""); mysql_select_db ("users"); mysql_query("INSERT INTO members (fname,lname,mobile,pass,email,txt,mail) VALUES ('$firstn','$lastn','$mobile','$password','$email','$txt','$mail')"); echo "Thank u 4 registration.<br/> U can now<a href=\"book.php\">Login!</a>"; mysql_close(); ?> and for log in: <? $mobile=$_POST['mnumber']; $password=$_POST['password']; mysql_connect ("","","") mysql_select_db ("users"); $stuff = mysql_query("SELECT * FROM `members` WHERE mobile='".$mobile."' AND pass='".$password."'") if (mysql_num_rows($stuff) > 0) { $row=mysql_num_rows($stuff); echo "Welcome...<br/><a href=\"room.php\">Check for room avilability.</a>"; } else { echo("Login Incorrect. Please Try Again! <br/> Or <a href=\"new.php\">Register!</a>"); } ?> |
|
#2
|
||||
|
||||
|
show us your form code
Hiya,
Do you want to show us the code you use on the form. Is it really posting or is it getting? Why does post Pass have a capital P and the rest are lower? You could run mysql_error to debug that way. Why not give us a url to try so we can see how it fails from a users perspective. I'd put some checking in there before I insert into the database, just to make sure that all required fields are there and that they don't contain any nasty chars you don't want that might mess things up.
__________________
Andy Moore << oh no it's got a blog..... Word Press WAP Plugin with Ad Mob Advertising revenue PHP developer deploying ringtones, mp3 downloads and realtones I'm a geek who's obsessed with stats and gadgets |
|
#3
|
|||
|
|||
|
thanks.
well, i am new in this field and i dont know how deal with such things... thanks again |
|
#4
|
||||
|
||||
|
www.php.net/addslashes
www.php.net/mysql_error |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > i have problem with inserting data |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|