RE: [PHP] Form problem
| From: | Dana Holt | Date: | Tue, 16 Oct 2001 18:34:21 +0000 |
| Subject: | RE: [PHP] Form problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71248@lists.php.net to get a copy of this message | ||
OOPS! I forgot to tell you my problem.
The $USERNAME variable is ALWAYS set on my client's machine, even before the
form is submitted. It's not on the other systems I've tried.
Basically on my client's machine it never show the login form.
Thanks!
-----Original Message-----
From: Dana Holt [mailto:danah@home.com]
Sent: Tuesday, October 16, 2001 1:25 PM
To: PHP Mailing List (E-mail)
Subject: [PHP] Form problem
Hello,
I am having a strange problem with some form code. This is a login form, and
most of the time I just put both the HTML form generation code and the
actual database code in the same file. In the code I just check if the
variable for the form element is empty/set or not.
This works on my dev server and a few others I've tried it on, but it
doesn't work on the production web server of my client. Both are Apache, and
both use PHP 4.0.6.
At first I was using "isset" instead of "empty" to test, but they both
produce the same problem.
Any ideas why this works on one server and not another?
Thanks in advance for any help.
Here's the code:
<?
require_once "./php/cfasttemplate.php";
require_once "./php/cuser.php";
// Are we submitting the login form?
if (!empty($USERNAME)) {
$user = new CUser;
if ($user->login($USERNAME, $PASSWORD) != CUSER_SUCCESS) {
echo phpversion();
exit();
}
// Insert user into the online table (EXPIRE the record after 300 seconds)
$query_insert = "INSERT INTO ONLINE VALUES($ses_userid, UNIX_TIMESTAMP(),
(UNIX_TIMESTAMP()+300))";
$database = new CDatabase;
$database->query($query_insert);
// Reload page to show login changes
$js = "<script language='javascript'>\n";
$js .= "window.opener.parent.location.reload(1);\n";
$js .= "window.close();\n";
$js .= "</script>";
echo $js;
} else {
// Produce the login form
$tpl = new FastTemplate("./templates/");
$tpl->define(array("login" => "login.html"));
$tpl->parse("LOGIN", "login");
$tpl->FastPrint("LOGIN");
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net