Garnet Posted March 23, 2006 Share Posted March 23, 2006 Basically , i got my php 5.12 installed , using keyfocus and mysql.. When i start to test my database and run out the php i get this error :Fatal error: Call to undefined function mysql_connect() in C:\Program Files\KeyFocus\KFWS\htdocs\Logintest\checklogin.php on line 16Can anyone help me out in this? i need to finish my project Anyone can intro me some cool webbies for reference , currently doing a project on Business Management System. thanks a lot.. Link to comment Share on other sites More sharing options...
Webworldx Posted March 23, 2006 Share Posted March 23, 2006 Do you have MySQL installed on your server? Link to comment Share on other sites More sharing options...
Garnet Posted March 23, 2006 Author Share Posted March 23, 2006 Yea. I did installed everything accordingly... I been stuck on this error for 2 weeks... . I wasnt sure is it because the libraries in mysql is not turn on . *headache* Link to comment Share on other sites More sharing options...
Selacius Posted March 23, 2006 Share Posted March 23, 2006 Can you paste the php code that your using? We really have no idea wats wrong unless you tell us. Link to comment Share on other sites More sharing options...
Garnet Posted March 23, 2006 Author Share Posted March 23, 2006 all the php i done came out all the same errors .here are the codes.. Please help me checklogin.php<!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head> <title>Login check</title> </head> <body> <?php ob_start(); $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name="test"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); if($result){ echo "go"; } //mysql_num_row is counting table row $count=mysql_num_rows($result); //if result match $myusername and mypassword table row must be 1 row if($count==1){ session_register("myusername"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ob_end_flush(); ?> </body> </html>main_login.php<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><form name="form1" method="post" action="checklogin.php"><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td colspan="3"><strong>Member Login </strong></td></tr><tr><td width="78">Username</td><td width="6">:</td><td width="294"><input name="myusername" type="text" id="myusername"></td></tr><tr><td>Password</td><td>:</td><td><input name="mypassword" type="text" id="mypassword"></td></tr><tr><td> </td><td> </td><td><input type="submit" name="Submit" value="Login"></td></tr><a href="register.php">Not a member? Join now!</a> </table></td></form></tr></table>login_successful.php// Check if session is not registered , redirect back to main page. // Put this code in first line of web page. <? session_start();if(!session_is_registered(myusername)){header("location:main_login.php");}?><html><body>Login Successful</body></html> Link to comment Share on other sites More sharing options...
Garnet Posted March 24, 2006 Author Share Posted March 24, 2006 Anyone can help me?? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now