Form problem

From: Date: Tue, 16 Oct 2001 18:25:12 +0000
Subject: Form problem
Groups: php.general 
Request: Send a blank email to php-general+get-71247@lists.php.net to get a copy of this message
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"); } ?>

« previous php.general (#71247) next »