Jump to content

PHP_SELF


ki

Recommended Posts

Thanks, also, its for a forum I used like

if (!$_SESSION[logg] == 0) or something { include(file.login) } else { display forum crap } but when i post it it goes to a blank screen, buit it set the variables i needed to logon but i need it to display the other page contents? any suggestions?

Link to comment
Share on other sites

Thanks, also, its for a forum I used like

if (!$_SESSION[logg] == 0) or something { include(file.login) } else { display forum crap } but when i post it it goes to a blank screen, buit it set the variables i needed to logon but i need it to display the other page contents? any suggestions?

 

Can you post the code maybe?

Link to comment
Share on other sites

SAMPLE:

if ($_SESSION['logged_in'] == 0) { include("login.php.inc"); } else {
$forum_id = $_GET['forum']; }

 

LOGIN.PHP.INC

<? ob_start();
require_once('config.php'); 
session_start();

if(isset($_POST['submit'])) {
mysql_crap_here


$_SESSION['logged_in'] = 1;
$_SESSION['username'] = $_POST['username']; 
$_SESSION['password'] = $_POST['password']; 
session_write_close();
} else {
echo "INPUT HERE";
}
?>

Link to comment
Share on other sites

SAMPLE:

if ($_SESSION['logged_in'] == 0) { include("login.php.inc"); } else {
$forum_id = $_GET['forum']; }

 

LOGIN.PHP.INC

<? ob_start();
require_once('config.php'); 
session_start();

if(isset($_POST['submit'])) {
mysql_crap_here


$_SESSION['logged_in'] = 1;
$_SESSION['username'] = $_POST['username']; 
$_SESSION['password'] = $_POST['password']; 
session_write_close();
} else {
echo "INPUT HERE";
}
?>

 

The second code, start it with <?php ?

Link to comment
Share on other sites

Would it matter?

 

But also login.php.inc is processed after the check to see if the user is logged in. So refresh? Or anyone know a code to refresh the page?

 

Just use a simple javascript code:

 

<FORM>

<INPUT TYPE="button" onClick="history.go(0)" VALUE="Refresh">

</FORM>

 

And dont you need "<?php" in front of all codes?

Link to comment
Share on other sites

And dont you need "<?php" in front of all codes?

 

Not if you have short tags (<? code ?>)or asp tags (<% code %>)enabled, but it's highly suggested you use <?php, as that's compatible in all configurations.

 

As for the problem at hand, besides the question being vague, I'm thinking it may have to do with your file extension. Is your web server setup to handle .inc as a PHP file?

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.