WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old August 16th, 2004, 09:06 AM
hasson28 hasson28 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: UK/Jordan
Posts: 6 hasson28 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Red face i have problem with inserting data

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>");
}
?>

Reply With Quote
  #2  
Old August 16th, 2004, 12:17 PM
andymoo's Avatar
andymoo andymoo is offline
Timelord
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Loughborough, Leicestershire
Posts: 605 andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 5 h 53 m 46 sec
Reputation Power: 63
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

Reply With Quote
  #3  
Old August 18th, 2004, 10:11 AM
hasson28 hasson28 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: UK/Jordan
Posts: 6 hasson28 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks.

well, i am new in this field and i dont know how deal with such things...

thanks again

Reply With Quote
  #4  
Old August 18th, 2004, 10:32 AM
andymoo's Avatar
andymoo andymoo is offline
Timelord
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Loughborough, Leicestershire
Posts: 605 andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level)andymoo User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 5 h 53 m 46 sec
Reputation Power: 63
www.php.net/addslashes
www.php.net/mysql_error

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > i have problem with inserting data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway