I get this error when i try seeing if my server works
Fatal error: Call to undefined function mssql_connect() in C:\wamp\www\index.php on line 47
Help
I followed the instructions almost exactly
i didn't delete anything in www folder
Printable View
I get this error when i try seeing if my server works
Fatal error: Call to undefined function mssql_connect() in C:\wamp\www\index.php on line 47
Help
I followed the instructions almost exactly
i didn't delete anything in www folder
Hello? Anyone Bump-
Open your index.php(or whatever you named it), in notepad, then find the red text:
[code]<html>
<head>
<title>GunZ User Account Register</title>
<style>
body {
color: #003300;
font-family: Verdana, Arial, Serif;
font-size: 10pt;
}
input {
border: 1px solid #003300;
color: #003300;
background: #DDDDDD;
font-family: Verdana, Arial, Serif;
font-size: 10pt;
}
tr {
font-size: 10pt;
}
a:link {
text-decoration: none;
color: #003300;
}
a:visited {
text-decoration: none;
color: #003300;
}
a:active {
text-decoration: none;
color: #003300;
}
a:hover {
text-decoration: none;
color: #FF6600;
}
</style>
</head>
<body>
<div align="center">
<?php
$srvip = "snaity.no-ip.org";
$srvport = "6000";
$mssql_user = "sa";
$mssql_pass = "******";
$mssql_database = "gunzsrv";
$mssql_host = "LOCALMACHINE\SQLEXPRESS";
$conn = mssql_connect($mssql_host, $mssql_user, $mssql_pass);
mssql_select_db($mssql_database);
?>
<FORM METHOD=POST ACTION="<?php echo $_SERVER['PHP_SELF']; ?>?act=register">
<table cellspacing=0 border=0>
<tr>
<td colspan=2 style="border: 1px solid #003300; background: #DDDDDD;"><CENTER><A HREF="<?php echo $_SERVER['PHP_SELF']; ?>">GunZ User Account Register</A></CENTER></td>
</tr>
<tr>
<td style="border-left: 1px solid #003300"> User ID:</td>
<td style="border-right: 1px solid #003300"><INPUT TYPE="text" NAME="login" ></td>
</tr>
<tr>
<td style="border-left: 1px solid #003300"> Password:</td>
<td style="border-right: 1px solid #003300"><INPUT TYPE="password" NAME="senha1"> </td>
</tr>
<tr>
<td style="border-left: 1px solid #003300"> Retype Password: </td>
<td style="border-right: 1px solid #003300"><INPUT TYPE="password" NAME="senha2"> </td>
</tr>
<tr>
<td style="border-left: 1px solid #003300"> Email:</td>
<td style="border-right: 1px solid #003300"><INPUT TYPE="text" NAME="email"> </td>
</tr>
<tr>
<td style="border: 1px solid #003300; border-top: 0px;" colspan=2><CENTER><INPUT NAME="Cadastrar" VALUE="Cadastrar" TYPE="submit"></CENTER></td>
</tr>
</table>
</FORM>
<?php
if ($_GET['act'] == 'register')
{
$user = anti_injection($_POST['login']);
$pass1 = anti_injection($_POST['senha1']);
$pass2 = anti_injection($_POST['senha2']);
$email = anti_injection($_POST['email']);
if (valida(Array($user,$pass1,$pass2,$email)) == true)
{
if ($pass1 == $pass2)
{
if (ereg("([0-9,a-z,A-Z])", $user))
{
if (ereg("^([0-9,a-z,A-Z]+)([.,_]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[.]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$", $email))
{
$query = mssql_query("SELECT * FROM Accounts WHERE UserID='$user'");
$num_rows = mssql_num_rows($query);
if ($num_rows == 0)
{
$query = mssql_query("SELECT * FROM Accounts WHERE E_Mail='$email'");
$num_rows = mssql_num_rows($query);
if ($num_rows == 0)
{
$query = mssql_query("INSERT INTO Accounts (UserID, Password, E_Mail) VALUES ('$user','$pass1','$email')");
if (!$query)
{
echo ":: Error on account register try later ::<br>";
}
else
{
echo ":: Account has been registered ::<br>";
}
}
else
{
echo ":: Email in use ::<br>";
}
}
else
{
echo ":: User in use ::<br>";
}
}
else
{
echo ":: Invalid Email ::<br>";
}
}
else
{
echo ":: Only use Numbers and Letters in User ID ::<br>";
}
}
else
{
echo ":: Password not equal with other ::<br>";
}
}
}
$query = mssql_query("SELECT * FROM Accounts");
$num_rows = mssql_num_rows($query);
echo "Total Accounts: ".$num_rows."<br>";
echo "<br><B>Server Status:</B> ";
$fp = @fsockopen($srvip, $srvport, $errno, $errstr, 1);
if (!$fp) {
echo "<font style='color: #FF3300'><B>Offline</B></font></br>";
} else {
echo "<font style='color: #009933'><B>Online</B></font></br>";
fclose($fp);
}
// Fun
I don't Get it i Did everything you said and i got the same error
Here look at mine i am using hamachi
<html>
<head>
<title>GunZ User Account Register</title>
<style>
body {
color: #003300;
font-family: Verdana, Arial, Serif;
font-size: 10pt;
}
input {
border: 1px solid #003300;
color: #003300;
background: #DDDDDD;
font-family: Verdana, Arial, Serif;
font-size: 10pt;
}
tr {
font-size: 10pt;
}
a:link {
text-decoration: none;
color: #003300;
}
a:visited {
text-decoration: none;
color: #003300;
}
a:active {
text-decoration: none;
color: #003300;
}
a:hover {
text-decoration: none;
color: #FF6600;
}
</style>
</head>
<body>
<div align="center">
<?php
$srvip = "5.126.40.169";
$srvport = "6000";
$mssql_user = "";
$mssql_pass = "";
$mssql_database = "GunDB";
$mssql_host = "ROBERT-LB6DUZU1/SQLEXPRESS";
$conn = mssql_connect($mssql_host, $mssql_user, $mssql_pass);
mssql_select_db($mssql_database);
?>
<FORM METHOD=POST ACTION="<?php echo $_SERVER['PHP_SELF']; ?>?act=register">
<table cellspacing=0 border=0>
<tr>
<td colspan=2 style="border: 1px solid #003300; background: #DDDDDD;"><CENTER><A HREF="<?php echo $_SERVER['PHP_SELF']; ?>">GunZ User Account Register</A></CENTER></td>
</tr>
<tr>
<td style="border-left: 1px solid #003300"> User ID:</td>
<td style="border-right: 1px solid #003300"><INPUT TYPE="text" NAME="login" ></td>
</tr>
<tr>
<td style="border-left: 1px solid #003300"> Password:</td>
<td style="border-right: 1px solid #003300"><INPUT TYPE="password" NAME="senha1"> </td>
</tr>
<tr>
<td style="border-left: 1px solid #003300"> Retype Password: </td>
<td style="border-right: 1px solid #003300"><INPUT TYPE="password" NAME="senha2"> </td>
</tr>
<tr>
<td style="border-left: 1px solid #003300"> Email:</td>
<td style="border-right: 1px solid #003300"><INPUT TYPE="text" NAME="email"> </td>
</tr>
<tr>
<td style="border: 1px solid #003300; border-top: 0px;" colspan=2><CENTER><INPUT NAME="Cadastrar" VALUE="Cadastrar" TYPE="submit"></CENTER></td>
</tr>
</table>
</FORM>
<?php
if ($_GET['act'] == 'register')
{
$user = anti_injection($_POST['login']);
$pass1 = anti_injection($_POST['senha1']);
$pass2 = anti_injection($_POST['senha2']);
$email = anti_injection($_POST['email']);
if (valida(Array($user,$pass1,$pass2,$email)) == true)
{
if ($pass1 == $pass2)
{
if (ereg("([0-9,a-z,A-Z])", $user))
{
if (ereg("^([0-9,a-z,A-Z]+)([.,_]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[.]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$", $email))
{
$query = mssql_query("SELECT * FROM Accounts WHERE UserID='$user'");
$num_rows = mssql_num_rows($query);
if ($num_rows == 0)
{
$query = mssql_query("SELECT * FROM Accounts WHERE E_Mail='$email'");
$num_rows = mssql_num_rows($query);
if ($num_rows == 0)
{
$query = mssql_query("INSERT INTO Accounts (UserID, Password, E_Mail) VALUES ('$user','$pass1','$email')");
if (!$query)
{
echo ":: Error on account register try later ::<br>";
}
else
{
echo ":: Account has been registered ::<br>";
}
}
else
{
echo ":: Email in use ::<br>";
}
}
else
{
echo ":: User in use ::<br>";
}
}
else
{
echo ":: Invalid Email ::<br>";
}
}
else
{
echo ":: Only use Numbers and Letters in User ID ::<br>";
}
}
else
{
echo ":: Password not equal with other ::<br>";
}
}
}
$query = mssql_query("SELECT * FROM Accounts");
$num_rows = mssql_num_rows($query);
echo "Total Accounts: ".$num_rows."<br>";
echo "<br><B>Server Status:</B> ";
$fp = @fsockopen($srvip, $srvport, $errno, $errstr, 1);
if (!$fp) {
echo "<font style='color: #FF3300'><B>Offline</B></font></br>";
} else {
echo "<font style='color: #009933'><B>Online</B></font></br>";
fclose($fp);
}
// Fun
Mine has these errors:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: LOCALMACHINE\SQLEXPRESS in (*):\Program Files\WAMP\www\index.php on line 47
Warning: mssql_select_db() [function.mssql-select-db]: Unable to connect to server: (null) in (*):\Program Files\WAMP\www\index.php on line 48
Warning: mssql_select_db() [function.mssql-select-db]: A link to the server could not be established in (*):\Program Files\WAMP\www\index.php on line 48
Warning: mssql_query() [function.mssql-query]: Unable to connect to server: (null) in (*):\Program Files\WAMP\www\index.php on line 137
Warning: mssql_query() [function.mssql-query]: A link to the server could not be established in F:\Program Files\WAMP\www\index.php on line 137
Warning: mssql_num_rows(): supplied argument is not a valid MS SQL-result resource in (*):\Program Files\WAMP\www\index.php on line 138
Total Accounts:
Server Status: Offline
(*) = Can't tell.
What do I do? I fixed the ini.
</style>
</head>
<body>
<div align="center">
<?php
$srvip = "5.126.40.169";
$srvport = "6000";
$mssql_user = "";
$mssql_pass = "";
$mssql_database = "GunDB";
$mssql_host = "ROBERT-LB6DUZU1/SQLEXPRESS";
$conn = mssql_connect($mssql_host, $mssql_user, $mssql_pass);
mssql_select_db($mssql_database);
?>
The Stuff In Read Is Line 47 Were the problem is Fatal error: Call to undefined function mssql_connect() in C:\wamp\www\index.php on line 47