NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page I have and upload (user only) script that won't work.

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 08-25-2006, 01:54 PM THREAD STARTER               #1 (permalink)
Account Closed
Join Date: Nov 2005
Posts: 70
Phat-Cat is an unknown quantity at this point
 



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


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.
????: NamePros.com http://www.namepros.com/programming/231479-i-have-upload-user-only-script.html


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.
Phat-Cat is offline  
Old 08-25-2006, 04:07 PM   #2 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




Originally Posted by Phat-Cat
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.
????: NamePros.com http://www.namepros.com/showthread.php?t=231479
Its with your META redirect.

I dont know what the error IS, but use a php redirect instead:
PHP Code:
header('Location: ' $URL); 
Barrucadu is offline  
Old 08-25-2006, 04:11 PM   #3 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,796
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
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.
Dan is offline  
Old 08-25-2006, 04:52 PM   #4 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




Originally Posted by Dan Friedman
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.
????: NamePros.com http://www.namepros.com/showthread.php?t=231479
You get sent to: http://www.testdumbies.com/Forum/.%20$URL%20.
Barrucadu is offline  
Old 08-25-2006, 05:09 PM   #5 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,796
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
PHP Code:
<?
define
('IN_PHPBB'true);
include(
'extension.inc');
include(
'common.'.$phpEx);

// Start session management
$userdata session_pagestart($user_ipPAGE_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
????: NamePros.com http://www.namepros.com/showthread.php?t=231479
    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.
Dan is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:41 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger