Re: trouble with "if" command... VERY URGENT!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



use == in all IFs

where your code is
and $_SESSION['uccverified'] = 1

it should be
and $_SESSION['uccverified'] == 1

regards,

Fernando

On 10/31/07, aalley218 <aaron@xxxxxxxxxxxxxxxxxxxx> wrote:
>
>   I'm working on a Joomla component (don't let that scare you) for
> forms. I'm trying to limit access to specific forms until the
> previous ones have been completed. I started by using a $_SESSION
> variable set at a specific point that each user must pass to go on.
> That worked marvelously. I'm trying to add a second step and the page
> is not being stopped. Here is my code as is (I'm very green at
> writing PHP, please be nice).
>
> if ( $_REQUEST['formid'] == 2 and $_SESSION['uccverified'] != 1) {
>
> $_SESSION['uccverified'] = 1;
>
> header ("Location:
> http://www.floracraft.com/index.php?option=performs&formid=1";);
>
> exit;
>
> }
>
> elseif ( $_REQUEST['formid'] == 2 and $_SESSION['uccverified'] = 1) {
>
> $_SESSION['uccverified'] = '2';
>
> }
> elseif ( $_REQUEST['formid'] == 3 and $_SESSION['uccverified'] != 2) {
>
> unset ($_SESSION['uccverified']);
>
> header ("Location:
> http://www.floracraft.com/index.php?option=performs&formid=1";);
>
> exit;
>
> }
>
> elseif ( $_REQUEST['formid'] == 3 and $_SESSION['uccverified'] = 2) {
>
> unset ($_SESSION['uccverified']);
>
> }
>
> The first checkpoint works. If you try to access formid=2 and you
> have not passed the checkpoint where the $_SESSION variable is set,
> you get automatically sent back to formid=1. If I try to browse to
> formid=3, however, I am not reverted back to formid=1. L My deadline
> on this is about an hour. This was a last minute change for security
> measures and I need to get this going. Please help!
>
> Aaron
>
>  
>


[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux