Help me im only a novice

Security issues related to php and mysql usage. How to make your code secure? Security measures and configurations? It's all in here!

Moderators: macek, egami, gesf

cute0gre
New php-forum User
New php-forum User
Posts: 6
Joined: Tue Jul 26, 2005 7:05 pm

Help me im only a novice

Postby cute0gre » Tue Jul 26, 2005 7:09 pm

Hello im using apache php5 and mysql4.1..
i am just trying to connect to the database with a password and username..but an error occuer

Fatal error: Call to undefined function mysql_connect() in c:\webs\test\connect.php5 on line 5

Please help me

Here is my code


Code: Select all

<html>
<head><title>Connect Server</title></head>
<body>
<?
$link = mysql_connect("localhost",$_POST['username'],$_POST['password'])or die("Connect

Eror: ".mysql_error());
print "Successfully connected.\n";
mysql_close($link);
?>
</body>
</html>

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Wed Jul 27, 2005 2:54 am

in your php.ini file find extentions section.

find extention=php_mysql.dll and uncomment it
if it doesnt exists: find extention=php_mysqli.dll and copy that line, then paste it before/after the original line and uncomment it, and remove i from one of the lines.. this will assure you have the correct syntax and also make sure that you are loading the mysql extention... then restart your server..


Return to “PHP & MySQL Security”

Who is online

Users browsing this forum: No registered users and 0 guests

cron