I have a problem when I create a login form. Please help.
Posted by: anle (---)
Date: January 06, 2010 11:30AM

I have a simple form login.htm which has 2 fields: username & password and 1 button to login. The login.htm form has action="login.php" which has the code below:

<?php
if(!empty($_GET["txtUserName"])&& !empty($_GET["txtPassword"])){
$Username= $_GET["txtUserName"];
$Password= $_GET["txtPassword"];

$con = mysql_connect("localhost","root","" ) ;
mysql_select_db("anle",$con) ;

$sql_select = "select * from contact where Password='$Password'" ;
$result=mysql_query($sql_select,$con);

echo ($result) ;
if($result!=" " ){
echo ("Your password or User name is not correct" ) ;

}else{
echo("Welcome" ) ;

}

mysql_close();
}else{
echo ("Please input all information" ) ;
}
?>


When I run the login.htm, fill all the fields on it and click the login button, it appears a message

Problem signature:
Problem Event Name: APPCRASH
Application Name: httpd.exe
Application Version: 2.2.11.0
Application Timestamp: 493f5d44
Fault Module Name: php_mysql.dll
Fault Module Version: 5.3.0.0
Fault Module Timestamp: 4a492311
Exception Code: c0000005
Exception Offset: 00002072
OS Version: 6.0.6001.2.1.0.256.1
Locale ID: 1066
Additional Information 1: c7db
Additional Information 2: ae42b9a901477bc30e02003a5e74faf8
Additional Information 3: e910
Additional Information 4: a1813aab827d72a47d7b80b5e48f9ba2

Read our privacy statement:
[go.microsoft.com]


What the problem do I have? Please help me resolve it....(^_^)

Options: ReplyQuote
Re: I have a problem when I create a login form. Please help.
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: January 06, 2010 11:43AM

mysql_close();

shud be

mysql_close($con);

Basicallly the mysql connection needs to be specified.

This is only with php 5.3.0.


Fault Module Version: 5.3.0.0


this is not an issue in previous php versions and has been fixed in ver 5.3.1

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]



Edited 2 time(s). Last edit at 01/06/2010 11:44AM by stevenmartin99.

Options: ReplyQuote
Re: I have a problem when I create a login form. Please help.
Posted by: anle (---)
Date: January 07, 2010 04:56PM

Dear Steven Martin,

I appreciate your help. It's my problem that I meet. Thank you very much (^_^)

Options: ReplyQuote
Re: I have a problem when I create a login form. Please help.
Posted by: pervyi (---.static.vega-ua.net)
Date: February 01, 2010 09:25PM

Look php form tutorials - on this resource has information to customize the Web forms.

Options: ReplyQuote
Re: I have a problem when I create a login form. Please help.
Posted by: khnuy (---.clicknet.com.kh)
Date: February 04, 2010 04:36AM

please help me. now I am currently using wamp serve but i don't know how to create database with this server and i don't how to connect to database and use it database.

Options: ReplyQuote
Re: I have a problem when I create a login form. Please help.
Posted by: yfastud (Moderator)
Date: February 04, 2010 05:29AM

to setup db, follow this
[blog.jlbn.net]

here is sample to use db
$connection = mysql_connect("host","user","pass" ) ;
mysql_select_db("database",$connection) ; 

/*
some codes
*/
mysql_close(connection);

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote


Sorry, only registered users may post in this forum.