[FX.php List] Cannot get redirects to work

Jon Montgomery igsmasupport at igsmasouth.org
Thu Dec 20 03:24:30 MST 2007


Thank you both Steve and ggt. It now works like a charm!  I can now sleep
for an hour or two before my school day starts!  The information you
supplied was dynamite!

Jon


On 12/20/07 3:47 AM, "Gjermund Gusland Thorsen" <ggt667 at gmail.com> wrote:

> Do not forget the exit; on the line below header();
> 
> ggt
> 
> 2007/12/20, Steve Winter <steve at bluecrocodile.co.nz>:
>> Hi Jon,
>> 
>> So what does happen...??
>> 
>> Have you tried
>>   echo 'Paid_Membership = '.$_SESSION['Paid_Membership'].'<br />';
>> just before the if to see what value the session variable actually has at
>> that point...??
>> 
>> I presume from what you're saying that the session variables have been set
>> by a previous page to the one you give the code for below...? and that the
>> user is then redirected to this page, which determines what to do with them
>> next based on the value of Paid_Membership...??
>> 
>> Why don't you just do the redirect at the point at which you get the data
>> from FMP...?
>> 
>> if($fmData['data'][key($fmData['data'])]['membershipStatus'][0] ==  'NOT
>> PAID')
>>   header('location: igsma_dues.php');
>> else
>>   header('location: igsma_first.php');
>> 
>> A bit more information might help to offer better solutions advice...
>> 
>> Cheers
>> Steve
>> 
>> -----Original Message-----
>> From: fx.php_list-bounces at mail.iviking.org
>> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Jon Montgomery
>> Sent: 20 December 2007 09:23
>> To: FX.php_List at mail.iviking.org
>> Subject: [FX.php List] Cannot get redirects to work
>> 
>> I have a site in which members login with ID and Password.  Then session
>> variables are set to include if they have paid their membership dues. The
>> FMP DB contains this membership status.
>> 
>> Here is what I need:
>> 
>> If membership is marked "PAID", then I need it to continue to the first step
>> page first.php.
>> 
>> If the membership is marked "NOT PAID", then I need it to go to a pay your
>> dues page.
>> 
>> I have tried the following:
>> 
>> The Session variable being $_SESSION['Paid_Membership']
>> 
>> <?php if(!session_id()) session_start();?>
>> 
>> <?php
>> 
>> $_SESSION['School_ID'];
>> 
>> $_SESSION['password'];
>> 
>> $_SESSION['Paid_Membership'];
>> 
>> if($_SESSION['Paid_Membership'] == 'NOT PAID')
>> 
>> 
>> include_once('igsma_dues.php');
>> 
>> else
>> 
>> 
>> 
>> include_once('igsma_first.php');
>> 
>> 
>> 
>> Now in my mind, this code tells me if the user has NOT paid their
>> membership, it should go to the igsma_due.php page.  If the user has PAID
>> their membership, then it would load the current page.
>> 
>> However, this does not work.  I have even tried reversing the order of the
>> pages and changing the if criteria.  This seems so simple and yet I am not
>> able to get the results I expect.
>> 
>> Any light you could shed would be helpful.
>> 
>> Jon Montgomery
>> Illinois Grade School Music Association
>> 
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>> 
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
> 




More information about the FX.php_List mailing list