Jump to content

Reload page


brittny85

Recommended Posts

I'm working on setting up a page that I need to have reload if it gets to a certain point in the code, but I can't seem to find anywhere what the code is to reload a page in PHP.  If it gets to this point then I don't want the form that is coded in below it to show up but for it to just go to the rest of the code.  I'll post the code and see if I can make my question make more sense...
[code]
//this is here to check if someone is logged in or not
function checkLogin()
{
if(!isset($_SESSION['memberid']))
{
include("headers/loginform.php");
exit;
}
}


//..lots of content that i only want loaded if checkLogin() succeeds

//this is essentially what is contained in loginform.php
if (isset($_POST['login']))
{
$user = $_POST['user'];
$pass = $_POST['pass'];
require("../headers/dbheader.php");
$person = mysql_query("SELECT * FROM [i]databasename[/i] WHERE uname = '$user' AND pw = '$pass'") or die(mysql_error());

if(mysql_num_rows($person) >0)
{
$person = mysql_fetch_array($person);
session_start();
$_SESSION['memberid'] = $person['memberid'];
[b][i]//This is where I want to get the page to reload[/i][/b]
else
{
$error = true;
}
}
<form method="post" action="<?=$_SERVER['PHP_SELF'];?>">
<p>Username: <input type="text" name="user" /></p>
<p>Password: <input type="password" name="pass" /></p>
<p><input type="submit" name="login" value="Log In" /> code]

I hope my question makes sense!  Thank you!
-Brittny[/code]
Link to comment
https://forums.phpfreaks.com/topic/13796-reload-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.