[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 08-25-2006, 12:54 PM   #1 (permalink)
Account Closed
 
Join Date: Nov 2005
Posts: 70
137.63 NP$ (Donate)

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.


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, 03:07 PM   #2 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

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


Quote:
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.
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, 03:11 PM   #3 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
 
Join Date: Feb 2006
Posts: 2,801
56.00 NP$ (Donate)

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, 03:52 PM   #4 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

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


Quote:
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.
You get sent to: http://www.testdumbies.com/Forum/.%20$URL%20.
Barrucadu is offline  
Old 08-25-2006, 04:09 PM   #5 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
 
Join Date: Feb 2006
Posts: 2,801
56.00 NP$ (Donate)

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_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.
Dan is offline  
Closed Thread


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 03:45 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85