/    Sign up×
Community /Pin to ProfileBookmark

mysql connection not working.

Hello
I am working on windows 2003 server with PHP 5.0.0. I am trying out some admin/login scripts, but my mysql db is on the internet (not company network). So when I run the login script I get the following error:

[code]
Unable to connect to the serverPHP Warning: mysql_connect() [function.mysql-connect]: Can’t connect to MySQL server on ‘mysql3.secureserver.net’ (10060)[/code]

Can some one help me with this?

Thanks

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@BuezaWebDevJul 20.2004 — [i]Originally posted by tasneem [/i]

[B]Hello

I am working on windows 2003 server with PHP 5.0.0. I am trying out some admin/login scripts, but my mysql db is on the internet (not company network). So when I run the login script I get the following error:

<i>
</i>Unable to connect to the serverPHP Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mysql3.secureserver.net' (10060)

Can some one help me with this?

Thanks [/B][/QUOTE]


Do you have the correct username/password for your login? hehe.
Copy linkTweet thisAlerts:
@tasneemauthorJul 20.2004 — [i]Originally posted by BuezaWebDev [/i]

[B]Do you have the correct username/password for your login? hehe. [/B][/QUOTE]


Of course. the login form from that website works, just not from my local webserver!?
Copy linkTweet thisAlerts:
@BuezaWebDevJul 20.2004 — [i]Originally posted by tasneem [/i]

[B]Of course. the login form from that website works, just not from my local webserver!? [/B][/QUOTE]


Please post your coding here so we (the community) can help heheh.
Copy linkTweet thisAlerts:
@tasneemauthorJul 20.2004 — Hi

Heres the code for the login page:
[code=php]<?php
$target=$_SERVER["PHP_SELF"];
include("common.php"); //this holds my db uname,
//pwd and connect funtion.
connect_database();
if (isset($_SESSION['level'])) {
if (isset($logout)){
session_unregister("level");
}else{
echo"
<form name=form1 method=post action=$target>
<table border=0 cellspacing=0 cellpadding=0 class=content>
<tr>
<td>You are logged</td>
</tr>
<tr>
<td >
<input name=logout type=hidden value=logout>
<input type=hidden value=1 name=reload>
<input name=submit type=image src=assets/logout.gif border=0 >
</td>
</tr>
</table>
</form>";
}
}
if (!isset($_SESSION['level'])) {
if (isset($username)){
$query = "SELECT level FROM users WHERE username='$username' AND password='$password'" or die("Wrong Password");
$sql_results = mysql_query($query,$connection);
while ($row = mysql_fetch_array($sql_results)) {
$level = $row['level'];
session_register("level");
}
}
if (isset($_SESSION['level'])) {
echo"
<form name=form1 method=post action=$target>
<table border=0 cellspacing=0 cellpadding=0 class=content>
<tr>
<td>You are logged in</td>
</tr>
<tr>
<td >
<input name=logout type=hidden value=logout>
<input type=hidden value=1 name=reload>
<input name=submit type=image src=assets/logout.gif border=0 >
</td>
</tr>
</table>
</form>";
}else{
echo"
<form name=form1 method=post action=$target>
<table border=0 cellspacing=0 cellpadding=0 class=content>
<tr>
<td>username:</td>
</tr>
<tr>
<td><input type=text name=username class=form></td>
</tr>
<tr>
<td>password:</td>
</tr>
<tr>
<td><input type=text name=password class=form></td>
</tr>
<tr>
<td align=right><input type=hidden value=1 name=reload>
<input name=submit type=image src=assets/go.gif border=0 ></td>
</tr>
</table>
</form>";
}
}
?>
[/code]


Hope this helps in figuring out the error!

Thanks
Copy linkTweet thisAlerts:
@BuezaWebDevJul 20.2004 — Please post the coding in commons.php. The problem is within the connection part of the coding.
×

Success!

Help @tasneem spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...