NameSilo

I have and upload (user only) script that won't work.

Spaceship Spaceship
Watch

Phat-Cat

Account Closed
Impact
1
The script

<?
define('IN_PHPBB', true);
include('extension.inc');
include('common.'.$phpEx);
?>
<?
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_VIEWMEMBERS);
init_userprefs($userdata);
//
// End session management
//
?>
$URL = ".$phpbb_root_path."login.php?redirect=http://www.testdumbies.com/Forum/submit.php";

if($userdata['session_logged_in']){
$to_echo = <<<EOM
hi
EOM;
echo $to_echo;
}
else{
echo '<META HTTP-EQUIV="refresh" content="0;URL=' . $URL . '">';)}

// that will redirect the user to a login page that will then log them in and send them straight back to the upload page.

The error

http://www.testdumbies.com/Forum/submit.php


it automatically sends people from that page to fast. It should stop and let them upload granted i don't have the actual up load script in there yet.


well can anyone help me >< can anyone use whats above to make it so that only users can upload and provide a upload script fo rme >< much appreciated thx.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Phat-Cat said:
The error

http://www.testdumbies.com/Forum/submit.php


it automatically sends people from that page to fast. It should stop and let them upload granted i don't have the actual up load script in there yet.


well can anyone help me >< can anyone use whats above to make it so that only users can upload and provide a upload script fo rme >< much appreciated thx.

Its not an error with your php - php gets executed when the page is requested, so before anything else happens.
Its with your META redirect.

I dont know what the error IS, but use a php redirect instead:
PHP:
header('Location: ' . $URL);
 
0
•••
It's setup to send them there only if they aren't logged in.

Apparently, it is saying they aren't and sending them there. Using a PHP redirect won't help.
 
0
•••
Dan Friedman said:
It's setup to send them there only if they aren't logged in.

Apparently, it is saying they aren't and sending them there. Using a PHP redirect won't help.

But, if you notice its the wrong url that people are sent to.
You get sent to: http://www.testdumbies.com/Forum/.%20$URL%20.
 
0
•••
PHP:
<?
define('IN_PHPBB', true);
include('extension.inc');
include('common.'.$phpEx);

// Start session management
$userdata = session_pagestart($user_ip, PAGE_VIEWMEMBERS);
init_userprefs($userdata);
// End session management

$URL = $phpbb_root_path."login.php?redirect=http://www.testdumbies.com/Forum/submit.php";

if ($userdata['session_logged_in']) {
  $to_echo = <<<EOM
    hi
EOM;
  echo $to_echo;
} else {
  echo '<META HTTP-EQUIV="refresh" content="0;URL=' . $URL . '">';
}
?>
The problem was that you ended PHP, so the meta refresh was just being placed everytime, whether or not you were logged in.
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back