Ask a Question related to PHP Development, Design and Development.
-
Wayne... #1
login that accesses remopte db wont work on that machine but works while on my local machine????!! HELP!
I knocked up a simple login for a CMS for one of my sites.... now itr will
work fine and authemticate with data on the online server by the IP number,
but when I came to upload it [seemed finished!] it wont work...it'lll only
work from this local machine... everything else works pulling and filtering
from the mysql DB. I cant understand how it wont login online but will work
fine from my machine.... HELLLPPPP!
password and username have been double and triple checked. and below is the
code and I've got some info from echoing the session, global and post
vairiables.
what i get echoed from the those (its long!)
------------------------------------------
GLOBALSArray
(
[HTTP_POST_VARS] => Array
(
)
[_POST] => Array
(
)
[HTTP_GET_VARS] => Array
(
)
[_GET] => Array
(
)
[HTTP_COOKIE_VARS] => Array
(
)
[_COOKIE] => Array
(
)
[HTTP_SERVER_VARS] => Array
(
[ALLUSERSPROFILE] => C:\\Documents and Settings\\All Users
[APP_POOL_ID] => DefaultAppPool
[ClusterLog] => C:\\WINDOWS\\Cluster\\cluster.log
[CommonProgramFiles] => C:\\Program Files\\Common Files
[COMPUTERNAME] => BOTAKHOSTING
[ComSpec] => C:\\WINDOWS\\system32\\cmd.exe
[NUMBER_OF_PROCESSORS] => 1
[OS] => Windows_NT
[Path] =>
C:\\PROGRA~1\\MAILEN~1\\BIN;C:\\Perl\\bin\\;C:\\Pr ogram Files\\Common
Files\\VERITAS
Shared;c:\\PROGRA~1\\VERITAS\\\\NetBackup\\bin;C:\ \WINDOWS\\system32;C:\\WIN
DOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Microsoft SQL
Server\\80\\Tools\\Binn\\
[PATHEXT] =>
..COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH; .VBS
[PROCESSOR_ARCHITECTURE] => x86
[PROCESSOR_IDENTIFIER] => x86 Family 15 Model 2 Stepping 9,
GenuineIntel
[PROCESSOR_LEVEL] => 15
[PROCESSOR_REVISION] => 0209
[ProgramFiles] => C:\\Program Files
[SystemDrive] => C:
[SystemRoot] => C:\\WINDOWS
[TEMP] => C:\\WINDOWS\\TEMP
[TMP] => C:\\WINDOWS\\TEMP
[USERPROFILE] => C:\\Documents and Settings\\NetworkService
[windir] => C:\\WINDOWS
[HTTP_CONNECTION] => Keep-Alive
[HTTP_ACCEPT] => image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, application/vnd.ms-excel, application/msword,
application/x-shockwave-flash, */*
[HTTP_ACCEPT_LANGUAGE] => en-gb
[HTTP_HOST] => [url]www.secretwebdesign.com[/url]
[HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.0; .NET CLR 1.1.4322)
[HTTP_~~~~~~~~~~~~~~~] => ~~~~~ ~~~~~~~
[AUTH_TYPE] =>
[AUTH_PASSWORD] =>
[AUTH_USER] =>
[CERT_COOKIE] =>
[CERT_FLAGS] =>
[CERT_ISSUER] =>
[CERT_SERIALNUMBER] =>
[CERT_SUBJECT] =>
[CONTENT_LENGTH] => 0
[CONTENT_TYPE] =>
[GATEWAY_INTERFACE] => CGI/1.1
[HTTPS] => off
[HTTPS_KEYSIZE] =>
[HTTPS_SECRETKEYSIZE] =>
[HTTPS_SERVER_ISSUER] =>
[HTTPS_SERVER_SUBJECT] =>
[INSTANCE_ID] => 1569
[LOCAL_ADDR] => 69.*.*.*
[LOGON_USER] =>
[PATH_INFO] => /login.php
[PATH_TRANSLATED] =>
c:\\domains\\secretwebdesign.com\\wwwroot\\login.p hp
[QUERY_STRING] =>
[REMOTE_ADDR] => 213.*.*.*
[REMOTE_HOST] => 213.*.*.*
[REMOTE_USER] =>
[REQUEST_METHOD] => GET
[SCRIPT_NAME] => /login.php
[SERVER_NAME] => [url]www.secretwebdesign.com[/url]
[SERVER_PORT] => 80
[SERVER_PORT_SECURE] => 0
[SERVER_PROTOCOL] => HTTP/1.1
[SERVER_SOFTWARE] => Microsoft-IIS/6.0
[UNMAPPED_REMOTE_USER] =>
[PHP_SELF] => /login.php
[argv] => Array
(
)
[argc] => 0
)
[_SERVER] => Array
(
[ALLUSERSPROFILE] => C:\\Documents and Settings\\All Users
[APP_POOL_ID] => DefaultAppPool
[ClusterLog] => C:\\WINDOWS\\Cluster\\cluster.log
[CommonProgramFiles] => C:\\Program Files\\Common Files
[COMPUTERNAME] => BOTAKHOSTING
[ComSpec] => C:\\WINDOWS\\system32\\cmd.exe
[NUMBER_OF_PROCESSORS] => 1
[OS] => Windows_NT
[Path] =>
C:\\PROGRA~1\\MAILEN~1\\BIN;C:\\Perl\\bin\\;C:\\Pr ogram Files\\Common
Files\\VERITAS
Shared;c:\\PROGRA~1\\VERITAS\\\\NetBackup\\bin;C:\ \WINDOWS\\system32;C:\\WIN
DOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Microsoft SQL
Server\\80\\Tools\\Binn\\
[PATHEXT] =>
..COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH; .VBS
[PROCESSOR_ARCHITECTURE] => x86
[PROCESSOR_IDENTIFIER] => x86 Family 15 Model 2 Stepping 9,
GenuineIntel
[PROCESSOR_LEVEL] => 15
[PROCESSOR_REVISION] => 0209
[ProgramFiles] => C:\\Program Files
[SystemDrive] => C:
[SystemRoot] => C:\\WINDOWS
[TEMP] => C:\\WINDOWS\\TEMP
[TMP] => C:\\WINDOWS\\TEMP
[USERPROFILE] => C:\\Documents and Settings\\NetworkService
[windir] => C:\\WINDOWS
[HTTP_CONNECTION] => Keep-Alive
[HTTP_ACCEPT] => image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, application/vnd.ms-excel, application/msword,
application/x-shockwave-flash, */*
[HTTP_ACCEPT_LANGUAGE] => en-gb
[HTTP_HOST] => www.secretwebdesign.com
[HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.0; .NET CLR 1.1.4322)
[HTTP_~~~~~~~~~~~~~~~] => ~~~~~ ~~~~~~~
[AUTH_TYPE] =>
[AUTH_PASSWORD] =>
[AUTH_USER] =>
[CERT_COOKIE] =>
[CERT_FLAGS] =>
[CERT_ISSUER] =>
[CERT_SERIALNUMBER] =>
[CERT_SUBJECT] =>
[CONTENT_LENGTH] => 0
[CONTENT_TYPE] =>
[GATEWAY_INTERFACE] => CGI/1.1
[HTTPS] => off
[HTTPS_KEYSIZE] =>
[HTTPS_SECRETKEYSIZE] =>
[HTTPS_SERVER_ISSUER] =>
[HTTPS_SERVER_SUBJECT] =>
[INSTANCE_ID] => 1569
[LOCAL_ADDR] => 69.93.5.2
[LOGON_USER] =>
[PATH_INFO] => /login.php
[PATH_TRANSLATED] =>
c:\\domains\\secretwebdesign.com\\wwwroot\\login.p hp
[QUERY_STRING] =>
[REMOTE_ADDR] => 213.78.156.250
[REMOTE_HOST] => 213.78.156.250
[REMOTE_USER] =>
[REQUEST_METHOD] => GET
[SCRIPT_NAME] => /login.php
[SERVER_NAME] => www.secretwebdesign.com
[SERVER_PORT] => 80
[SERVER_PORT_SECURE] => 0
[SERVER_PROTOCOL] => HTTP/1.1
[SERVER_SOFTWARE] => Microsoft-IIS/6.0
[UNMAPPED_REMOTE_USER] =>
[PHP_SELF] => /login.php
[argv] => Array
(
)
[argc] => 0
)
[HTTP_ENV_VARS] => Array
(
[ALLUSERSPROFILE] => C:\\Documents and Settings\\All Users
[APP_POOL_ID] => DefaultAppPool
[ClusterLog] => C:\\WINDOWS\\Cluster\\cluster.log
[CommonProgramFiles] => C:\\Program Files\\Common Files
[COMPUTERNAME] => HOSTING
[ComSpec] => C:\\WINDOWS\\system32\\cmd.exe
[NUMBER_OF_PROCESSORS] => 1
[OS] => Windows_NT
[Path] =>
C:\\PROGRA~1\\MAILEN~1\\BIN;C:\\Perl\\bin\\;C:\\Pr ogram Files\\Common
Files\\VERITAS
Shared;c:\\PROGRA~1\\VERITAS\\\\NetBackup\\bin;C:\ \WINDOWS\\system32;C:\\WIN
DOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Microsoft SQL
Server\\80\\Tools\\Binn\\
[PATHEXT] =>
..COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH; .VBS
[PROCESSOR_ARCHITECTURE] => x86
[PROCESSOR_IDENTIFIER] => x86 Family 15 Model 2 Stepping 9,
GenuineIntel
[PROCESSOR_LEVEL] => 15
[PROCESSOR_REVISION] => 0209
[ProgramFiles] => C:\\Program Files
[SystemDrive] => C:
[SystemRoot] => C:\\WINDOWS
[TEMP] => C:\\WINDOWS\\TEMP
[TMP] => C:\\WINDOWS\\TEMP
[USERPROFILE] => C:\\Documents and Settings\\NetworkService
[windir] => C:\\WINDOWS
[HTTP_CONNECTION] => Keep-Alive
[HTTP_ACCEPT] => image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, application/vnd.ms-excel, application/msword,
application/x-shockwave-flash, */*
[HTTP_ACCEPT_LANGUAGE] => en-gb
[HTTP_HOST] => www.secretwebdesign.com
[HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.0; .NET CLR 1.1.4322)
[HTTP_~~~~~~~~~~~~~~~] => ~~~~~ ~~~~~~~
[AUTH_TYPE] =>
[AUTH_PASSWORD] =>
[AUTH_USER] =>
[CERT_COOKIE] =>
[CERT_FLAGS] =>
[CERT_ISSUER] =>
[CERT_SERIALNUMBER] =>
[CERT_SUBJECT] =>
[CONTENT_LENGTH] => 0
[CONTENT_TYPE] =>
[GATEWAY_INTERFACE] => CGI/1.1
[HTTPS] => off
[HTTPS_KEYSIZE] =>
[HTTPS_SECRETKEYSIZE] =>
[HTTPS_SERVER_ISSUER] =>
[HTTPS_SERVER_SUBJECT] =>
[INSTANCE_ID] => 1569
[LOCAL_ADDR] => 69.93.5.2
[LOGON_USER] =>
[PATH_INFO] => /login.php
[PATH_TRANSLATED] =>
c:\\domains\\secretwebdesign.com\\wwwroot\\login.p hp
[QUERY_STRING] =>
[REMOTE_ADDR] => 213.78.156.250
[REMOTE_HOST] => 213.78.156.250
[REMOTE_USER] =>
[REQUEST_METHOD] => GET
[SCRIPT_NAME] => /login.php
[SERVER_NAME] => www.secretwebdesign.com
[SERVER_PORT] => 80
[SERVER_PORT_SECURE] => 0
[SERVER_PROTOCOL] => HTTP/1.1
[SERVER_SOFTWARE] => Microsoft-IIS/6.0
[UNMAPPED_REMOTE_USER] =>
)
[_ENV] => Array
(
[ALLUSERSPROFILE] => C:\\Documents and Settings\\All Users
[APP_POOL_ID] => DefaultAppPool
[ClusterLog] => C:\\WINDOWS\\Cluster\\cluster.log
[CommonProgramFiles] => C:\\Program Files\\Common Files
[COMPUTERNAME] => HOSTING
[ComSpec] => C:\\WINDOWS\\system32\\cmd.exe
[NUMBER_OF_PROCESSORS] => 1
[OS] => Windows_NT
[Path] =>
C:\\PROGRA~1\\MAILEN~1\\BIN;C:\\Perl\\bin\\;C:\\Pr ogram Files\\Common
Files\\VERITAS
Shared;c:\\PROGRA~1\\VERITAS\\\\NetBackup\\bin;C:\ \WINDOWS\\system32;C:\\WIN
DOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Microsoft SQL
Server\\80\\Tools\\Binn\\
[PATHEXT] =>
..COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH; .VBS
[PROCESSOR_ARCHITECTURE] => x86
[PROCESSOR_IDENTIFIER] => x86 Family 15 Model 2 Stepping 9,
GenuineIntel
[PROCESSOR_LEVEL] => 15
[PROCESSOR_REVISION] => 0209
[ProgramFiles] => C:\\Program Files
[SystemDrive] => C:
[SystemRoot] => C:\\WINDOWS
[TEMP] => C:\\WINDOWS\\TEMP
[TMP] => C:\\WINDOWS\\TEMP
[USERPROFILE] => C:\\Documents and Settings\\NetworkService
[windir] => C:\\WINDOWS
[HTTP_CONNECTION] => Keep-Alive
[HTTP_ACCEPT] => image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, application/vnd.ms-excel, application/msword,
application/x-shockwave-flash, */*
[HTTP_ACCEPT_LANGUAGE] => en-gb
[HTTP_HOST] => www.secretwebdesign.com
[HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.0; .NET CLR 1.1.4322)
[HTTP_~~~~~~~~~~~~~~~] => ~~~~~ ~~~~~~~
[AUTH_TYPE] =>
[AUTH_PASSWORD] =>
[AUTH_USER] =>
[CERT_COOKIE] =>
[CERT_FLAGS] =>
[CERT_ISSUER] =>
[CERT_SERIALNUMBER] =>
[CERT_SUBJECT] =>
[CONTENT_LENGTH] => 0
[CONTENT_TYPE] =>
[GATEWAY_INTERFACE] => CGI/1.1
[HTTPS] => off
[HTTPS_KEYSIZE] =>
[HTTPS_SECRETKEYSIZE] =>
[HTTPS_SERVER_ISSUER] =>
[HTTPS_SERVER_SUBJECT] =>
[INSTANCE_ID] => 1569
[LOCAL_ADDR] => 69.*.*.*
[LOGON_USER] =>
[PATH_INFO] => /login.php
[PATH_TRANSLATED] =>
c:\\domains\\secretwebdesign.com\\wwwroot\\login.p hp
[QUERY_STRING] =>
[REMOTE_ADDR] => 213.78.*.*
[REMOTE_HOST] => 213.78.*.*
[REMOTE_USER] =>
[REQUEST_METHOD] => GET
[SCRIPT_NAME] => /login.php
[SERVER_NAME] => www.secretwebdesign.com
[SERVER_PORT] => 80
[SERVER_PORT_SECURE] => 0
[SERVER_PROTOCOL] => HTTP/1.1
[SERVER_SOFTWARE] => Microsoft-IIS/6.0
[UNMAPPED_REMOTE_USER] =>
)
[HTTP_POST_FILES] => Array
(
)
[_FILES] => Array
(
)
[_REQUEST] => Array
(
)
[GLOBALS] => Array
*RECURSION*
[hostname_secretwebdesign] => 69.*.*.*
[database_secretwebdesign] => databasename
[username_secretwebdesign] => username
[password_secretwebdesign] => password
[secretwebdesign] => Resource id #2
[query_users] => SELECT * FROM users
[users] => Resource id #3
[row_users] => Array
(
[id_num] => 1
[username] => cmsusername
[password] => passwordhere
)
[totalRows_users] => 2
[HTTP_SESSION_VARS] => Array
(
)
[_SESSION] => Array
(
)
[loginFormAction] => /login.php
)
SESSION
Array
(
)
POST
Array
(
)
The main login Code:
--------------------
<?php require_once('Connections/secretwebdesign.php'); ?>
<?php
mysql_select_db($database_secretwebdesign, $secretwebdesign);
$query_users = "SELECT * FROM users";
$users = mysql_query($query_users, $secretwebdesign) or die(mysql_error());
$row_users = mysql_fetch_assoc($users);
$totalRows_users = mysql_num_rows($users);
?><?php
// *** Validate request to login to this site.
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');
}
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "admin.php";
$MM_redirectLoginFailed = "login.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_secretwebdesign, $secretwebdesign);
$LoginRS__query=sprintf("SELECT username, password FROM users WHERE
username='%s' AND password='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername),
get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $secretwebdesign) or
die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;
//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Content Management System</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<form ACTION="<?php echo $loginFormAction; ?>" method="POST"
name="form1" class="dobox" id="form1">
<p align="center">Log In</p>
<br>
<br>
Username
<input name="username" type="text" id="username" />
<br>
Password
<input name="password" type="password" id="password" />
<br>
<input type="submit" name="Submit" value="Submit" />
<br>
<br>
</form>
<br>
<?php
echo "<pre><p>";
echo "GLOBALS" ;
print_r($GLOBALS);
echo"<p>SESSION</p>";
print_r($_SESSION);
echo"<p>POST</p>" ;
print_r($_POST); ?>
<p></p>
</div>
</body>
</html>
<?php
mysql_free_result($users);
?>
connection string :
-----------------
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_secretwebdesign = "69.*.*.*";
$database_secretwebdesign = "mainsql";
$username_secretwebdesign = "username";
$password_secretwebdesign = "password";
$secretwebdesign = mysql_pconnect($hostname_secretwebdesign,
$username_secretwebdesign, $password_secretwebdesign) or
trigger_error(mysql_error(),E_USER_ERROR);
?>
------------------
ok so there isd it.... and it's driving me round the bend! Anyone who can
help is sure to go to heaven;) [if ya belive in that sort of thing ;-) ]
thanks in advance
Wayne...
Wayne... Guest
-
onload error.. works on local machine, but not on site...
I'm getting a weird error on XML.onLoad(): When I try to access the Del.cio.us API via XML, the code works perfectly when running from the C:... -
filecopy from remote machine to local machine
Hi, I am tryin to copy a tar file from remote machine to local machine using Net:Telnet. I am using the following logic : my(@Out) =... -
SSL on local machine...
Hi folks, Is there any way to setup SSL certificates on a locally (workstation) installed IIS server? Thanks in advance...P -
Why Redirection works on 1 machine but not on another
Hi, I have this peculiar problem, my header header( "Refresh:2;url=$g_prog_path/$l_refresh_url" ); is set up correctly to be the FULL... -
Can't use 'local' to find sql server instances on local machine
My computer (connected to a domain) is having trouble connecting to the local MSDE when using 'local' or '(local)' as server name. The only way I... -
eclipsboi #2
Re: login that accesses remopte db wont work on that machine but works while on my local machine????!! HELP!
Wiithout knowing exactly how it works remotely, versus how it works
locally, I could only guess that it's obviously something to do with
the differences in configuration between the remote and local servers.
On Wed, 16 Jun 2004 11:51:22 +0100, "Wayne..."
<wayne@secretwebdesign.com> wrote:
>I knocked up a simple login for a CMS for one of my sites.... now itr will
>work fine and authemticate with data on the online server by the IP number,
>but when I came to upload it [seemed finished!] it wont work...it'lll only
>work from this local machine... everything else works pulling and filtering
>from the mysql DB. I cant understand how it wont login online but will work
>fine from my machine.... HELLLPPPP!
>password and username have been double and triple checked. and below is the
>code and I've got some info from echoing the session, global and post
>vairiables.
>what i get echoed from the those (its long!)
> . . . .eclipsboi Guest
-
Wayne... #3
Re: login that accesses remopte db wont work on that machine but works while on my local machine????!! HELP!
"eclipsboi" <eclipsboi@hotmail.com> wrote in message
news:tfdd90halc73ossa0oegfnuicsed89h0ia@4ax.com...> Wiithout knowing exactly how it works remotely, versus how it works
> locally, I could only guess that it's obviously something to do with
> the differences in configuration between the remote and local servers.
but surely as I specify the ip number it shouldn't matter.... as all the
other queries work fine using teh same connection string and same query
format, just this login page.............
it always throws me back as if the wrong username and password have been
entered even when they haven't.
the local server is win2k running IIS.... the remote is win 2003 al;so
running IIS.
If this keeps on stumping me I might try handling the login with sessions
instead! (lol life was so much easier without computers.... but less fun)
Wayne...
Wayne... Guest



Reply With Quote

