RE: Referring Page in PHP/SQL

2002-06-22 Thread Peter Lovatt

if(ok)
{
include('zap.htm')

}
else
{
include('zip.htm')
}


---
Excellence in internet and open source software
---
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
---

 -Original Message-
 From: Tokunboh Oladejo [mailto:[EMAIL PROTECTED]]
 Sent: 21 June 2002 15:56
 To: '[EMAIL PROTECTED]'
 Subject: Referring Page in PHP/SQL


 Hi All,

 Can anyone help me on how to call up an HTML page in PHP after a succesful
 entry, example

 ?php
 
 

 if(!sql_result){
   call 'try_again.html'
 }
 else {
   call 'yadiyadiya.html'
  }

 ?

 I don't want to have to type the HTML code again in between the php code
 because the page I need is already at another URL. If anyone
 knows what I am
 talking about please help.


 Toks

 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Referring Page in PHP/SQL

2002-06-21 Thread Steve

This question is more appropriate for the PHP list. 

Here is an example:

// if row exists - login/pass is correct
if (mysql_num_rows($result) == 1)
{
// initiate a session
session_start();

// register the user's ID and permission level
list($uid, $uperms) = mysql_fetch_row($result);
$_SESSION{UID} = '$uid';
$_SESSION{UPERMS} = '$uperms';

// redirect to main menu page
header(Location:menu.php);
mysql_free_result ($result);

// close connection
mysql_close($connection);
}
else
// login/pass check failed
{
mysql_free_result ($result);
mysql_close($connection);
// redirect to error page
header(Location: error.php?e=0);
exit;
}

-Steve



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php