Open a document in a frame
Hi
I've got a login form which submits data to another php file, the output from this file is then displayed in the original frame, I also depending upon the result of the login want to load a new page into another frame. Is there a function to do this or do i need to revert to a javascript call?
Thanks
Code:
login.php
<form method="post"
action="/issueTracking/phpfunctions/authenticate.php" target="auth" name="login"> <small><small><span
style="font-family: monospace;"> Username:</span></small></small><br><input
maxlength="25" size="10" tabindex="1" name="username"> <br>
<small><small><span style="font-family: monospace;">Password:</span></small></small><br><input maxlength="25" size="10" tabindex="2" name="password" type="password"><br>
<input type="hidden" name="action" value="submitted" />
<button type="submit" accesskey="l" tabindex="3" value="login" name="submit"><small><small>Login</small></small></button>
<button type="reset" accesskey="c" tabindex="4" value="clear"
name="Clear"><small><small>Clear</small></small></button>
<a href="/issueTracking/pages/register.php" target="main"><small><small>Register</small></small></a>
<a href="/issueTracking/phpfunctions/authenticate.php?username=logout&password=logout" target="auth"><small><small>Logout</small></small></a>
<iframe name="auth" width="95"
height="25" frameborder="0" marginheight="0" marginwidth="0">
</iframe>
</form>
Code:
authenticate.php
<?php
include 'executeSQL.php';
import_request_variables('gp', 'p_');
$sql = "SELECT username FROM issueTracking.it_users WHERE username = '$p_username' AND password = '$p_password'";
$retval = execute_return_column_0($sql);
if ($retval != "")
{
echo "<small><small>Authenticated</small></small>";
// OPEN NEW PAGE HERE
}
else
{
echo "<small><small>Authentication Failed</small></small>";
}
?>