configuring Ubuntu web server

Fullmetal Chocobo

Moderator<br>Distributed Computing
Moderator
May 13, 2003
13,704
7
81
I have a project that involves PHP, HTML, and MySQL that works fine on one server, but not on another. The server that works is the university's Computer Science server, and the server that it doesn't is a server I'm building for development.

What happens, or doesn't happen to be more specific, is that when I click on a submit button anywhere in the form, nothing happens. I have all the major stuff setup on the new server, and phpinfo() works correctly. I guess the next step is an in-depth stare-and-compare between the phpinfo() returns.

Just wondering if there are any ideas for something simple I'm missing...

Link to working project...
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,597
4,502
75
Hey, FMC! :)

Define, "Nothing happens". Does anything get sent to the server? (I'd check that by putting a proxy in the middle, killing the proxy while the page is up, launching NetCat listening on that same port, and clicking the submit button.)

Does the path "/~ds1397/CS_2320/final/index.php" exist on your new server?
 

Fullmetal Chocobo

Moderator<br>Distributed Computing
Moderator
May 13, 2003
13,704
7
81
Hey, FMC! :)

Define, "Nothing happens". Does anything get sent to the server? (I'd check that by putting a proxy in the middle, killing the proxy while the page is up, launching NetCat listening on that same port, and clicking the submit button.)

Does the path "/~ds1397/CS_2320/final/index.php" exist on your new server?

In the working version, if you hit the submit button for the login, it displays an error saying "Please enter your username or netID." On the broken server, literally nothing happens--it just refreshes the page. No error, no nothing. Same for the following section and it's submit button.

No, the path does not exist, but all files are included at the current working directory. I created it, and copies the project to the appropriate folder, and it still had the same result.
 

Fullmetal Chocobo

Moderator<br>Distributed Computing
Moderator
May 13, 2003
13,704
7
81
I created this simple ldap authorization form, and the same thing happens with it. One on server, it works with all error checking, and the other server it does nothing but refresh the form...

PHP:
<html>
<head>
<title>Auth Test...</title>
</head>
<body>

<?php

$form_login = "

<form name=\"form_login\" method=\"POST\" action=\"$PHP_SELF\" >

<div>
   <label for=\"username\">Username:</label>
   <input type=\"text\" name=\"username\" value=\"$username\" />
   <br />
   <label for=\"password\">Password:</label>
   <input type=\"password\" name=\"password\" value=\"$password\" />
   <br />
   <input type=\"hidden\" name=\"l_written\" value=\"yes\" />
   <input type=\"submit\" name=\"submit\" value=\"submit\" />
</div>
</form>

";

if ( $l_written != "yes")
{
   echo $form_login;
}

else if ( $l_written == "yes" )
{
   if ( $username == "" )
   {
      $error_user = "Please enter yoru username or netID.</br />";
      $ready = "no";
   }

   if ( $password == "" )
   {
      $error_passwd = "Plesae enter your password.<br />";
      $ready = "no";
   }

   if ( $ready != "no" )
   {
      $ldap = ldap_connect('matrix.txstate.edu');
      if ( $ldap )
      {
         $result = @ldap_bind( $ldap, 'txstate\\'.$_POST['username'], $_POST['password']);
         if ( $result && !empty($_POST['password']))
         {
            echo "<strong>Logged in.</strong>";
            $_SESSION['status'] = "valid";
         }
         else
         {
            echo "<strong>Incorrect login.</strong>";
            echo $form_login;
            $_SESSION['status'] = "invalid";
         }
      }
   }

   else if ( $ready == "no" )
   {
      echo $error_user;
      echo $error_passwd;
      echo $form_login;
   }
}
?>

</body>
</html>
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,597
4,502
75
It sounds like the server is ignoring all POST data. :confused:

I found a good suggestion here: "I suggest putting a simple server in place that just prints back the params that are sent to it, with no security... then try it again."
 

Fullmetal Chocobo

Moderator<br>Distributed Computing
Moderator
May 13, 2003
13,704
7
81
It sounds like the server is ignoring all POST data. :confused:

I found a good suggestion here: "I suggest putting a simple server in place that just prints back the params that are sent to it, with no security... then try it again."

I added the following function and ran it. Once submit is clicked, it shows:
  • username --
  • password --
  • l_written -- yes
  • submit -- submit

So that part of the form appears to be working correctly, and it is pulling from the SUBMIT data.

PHP:
# outputs elements of form for troubleshooting purposes
function write_elements()
{
	  echo "<ul>\n";

      foreach ($_POST As $PostKey => $PostValue) 
      {
         echo "<li> $PostKey -- $PostValue </li>\n";
      }
      echo "</ul>\n";
}

EDIT: Could it for some reason be the fact that these linux boxes aren't on the domain? I have tested this on several VMs, and it's all with the same effect. I'm a bit lost at this point.
 
Last edited:

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Unless your web server or Linux itself does something with AD that shouldn't be the issue.