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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.