Sorry to ask an old question, but I cant seem to get this simple php
to work. Ive looked at old postings and for whatever reason cant seem
to
get this to work. Any help is greatly appreciated. Im new to PHP.
My PHP works just fine (apparently), but doesnt work the way I want it
to.
All I want to do is accept a login and password and then send it off to
a perl script on 'submit'. It never appears to get into my 'if'
section,
any suggestions? I cant seem to get the following to work:
<html>
<body>
<?php
if (isset($_POST['Submit']) && ($_POST['login'] == 'login'))
{
print "Login: $login\n";
print "Pass: $pass\n";
$file = popen("/home/http/website/cgi-bin/gs_do_search.pl $login
$pass","r");
while ($line = fgets($file,1024)) {
// display it now
}
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Login: <input type="text" name="login"><br>
Password: <input type="password" name="pass"><br>
<br>
<input type="Submit" name="Submit" value="login">
</form>
</body>
</html>