6 Replies Latest reply on Sep 27, 2009 2:00 PM by Günter Schenk

    conditional region expression builder GET Multiple Variables

    Joseph07888

      Hi All,

       

      I hope some one can help (if Master Günter Schenk  thank your in advance).

       

      I am at a loss with selecting multiple variables for an IF Conditional Region.

       

      If there is a simple way for someone to provide an example that would be great or please read the below relating to what I am tring to accomplish.

       

      What I need to do

       

      I have 2 images (1 is a button) with the command of a submission form the other is just a message saying already sent to this user.

       

      When the form submits it gets a URL generated result unique to each submission which I need to check agaist the IF Conditional.

       

      So if already exists the submit button does not show but the other saying you have already sent message.

       

      The IF conditional is been checked agaist a recordset using two of the main values by URL which are VenueID & VFSENQI but not checking the RandomEnquirySent.

       

      So the Recordset checks the the first 2 variables which then produces the info to check the URL.

       

      Or another way to do this would be to check the

       

      Info

       

      Expression 1: <?php @$row_rsCKEnqSent['RandomEnquirySent'] ?> or @$row_rsCKEnqSent['RandomEnquirySent']

       

      Which is the result from the recordset from database based on the below URL which is submitted by a form.

       

      {GET.VFSRAND}IDENQ{SESSION.VFSENQID}IDVEN{GET.VenueID}

       

      Expression 2: needs to be ->

      <?php echo $_GET['VFSRAND']; ?>&IDENQ<?php echo $_GET['VFSENQID']; ?>&IDVEN<?php @$_GET['VenueID'] ?>

       

      or

       

      @$_GET['VFSRAND']&IDENQ@$_GET['VFSENQID']&IDVEN@$_GET['VenueID']

       

      This is the URL paramiter sent to the Database for unique references to the message.

       

      <?php echo $_GET['VFSRAND']; ?>&IDENQ<?php echo $_GET['VFSENQID']; ?>&IDVEN<?php @$_GET['VenueID'] ?>

       

      This is also the second part of the expression which needs to be pulled from the URL & or a Session.

       

       

      Finish

       

      So if i know how to get the the IF Conditional to pull the information from the URL to check agast the recordset result <?php @$row_rsCKEnqSent['RandomEnquirySent'] ?> i would be a very happy man.

       

       

      Please let me know either or way if it can or can't be done I would be very grateful.

       

      Kind Regards,

      Joseph

        • 1. Re: conditional region expression builder GET Multiple Variables
          Günter Schenk Level 4

          Just to clarify: is the value of the variable...

           

          $row_rsCKEnqSent['RandomEnquirySent']

           

          ...expected to equal the compound values of all three $_GET variables, example:

           

          123456 (RandomEnquirySent) == 123456 (12: $_GET variable 1; 34: $_GET variable 2; 56: $_GET variable 3)

           

          If the expected result follows from a different pattern, please provide some examples.

           

          ---------------

          This is the URL paramiter sent to the Database for unique references to the message.

           

          <?php echo $_GET['VFSRAND']; ?>&IDENQ<?php echo $_GET['VFSENQID']; ?>&IDVEN<?php @$_GET['VenueID'] ?>

          ---------------

           

          You supposedly do store the URL parameter values, but not the parameter names (&IDENQ), correct ? If this is true, using these names in Expression 2 doesn´t make any sense and will lead to inaccurate results, because $row_rsCKEnqSent['RandomEnquirySent'] would have to contain these strings as well

           

          Cheers,

          Günter

          • 2. Re: conditional region expression builder GET Multiple Variables
            Joseph07888 Level 1

            Hi Gunter,

             

            Thank your for your prompt reply.

             

            Yes the additional variables (e.g. IDENQ & IDVEN are only used once the data has been inserted in to the database but dont hold any real value as a variable in a URL)

             

            Example:

             

            <?php echo $_GET['VFSRAND']; ?> - Is the 32 character random code provided to the user at login/registration to produce a totally unique identifyer.

             

            <?php echo $_GET['VFSENQID']; ?> - Is the message id relating to the message sent (Which can be sent to multiple people)

             

            <?php @$_GET['VenueID'] ?> - Is the ID of the message of the user who is receiving the message

             

             

            The use of

             

            INDENQ & IDVEN - Are just text identifyers in the submitted unique code maker to break the database stored record for the message

             

            So this is what gets stored to the RandomEnquirySent column in the table and the

             

            {GET.VFSRAND}IDENQ{SESSION.VFSENQID}IDVEN{GET.VenueID}

             

            Stored example: 32randomcodeIDENQ12IDVEN77

             

             

            Anything after the 32 random code can be identified should there be any future problems that may arise.

             

            I know this might seem a very strange way of checking a record but also this code is used to retrieve the message without logging in to the person who the message has been sent to.

             

             

            Other Suggestion

             

            Even if expression 1 & 2 could be something like:

             

            (recordstored1)&(recordstored2) == ($_GET variable 1; 34: $_GET variable 2)

             

            but the first would really help as this would be a work round.

             

            Again Gunter thank you for your time.

             

            Kind Regards,

            Joseph

            • 3. Re: conditional region expression builder GET Multiple Variables
              Günter Schenk Level 4

              Hi Joseph,

               

              if the column value you´re checking against does not contain any ampersand char (&) at all like in the "stored example" you provided, you shouldn´t be using it in your condition as well, because as it´s now, it´s considered a part of the string.

               

              Cheers,

              Günter

              • 4. Re: conditional region expression builder GET Multiple Variables
                Günter Schenk Level 4

                Another important fact to keep in mind: when mixing static strings (e.g. IDENQ) with dynamic values (e.g. $_GET['VFSRAND']) inside the "if" condition of a Conditional Region, the final outcome is to be considered one string and hence has to be assembled like the following, what´s - by the way - something called "string concatenation":

                 

                method 1)

                 

                $cond_combined = $_GET['variable_1']."IDENQ".$_GET['variable_2']."IDVEN".$_GET['variable_3'];

                 

                method 2)

                 

                $cond_combined =  "{$_GET['variable_1']}IDENQ{$_GET['variable_2']}IDVEN{$_GET['variable_3']}";

                 

                Both methods work identically, the only difference to Dreamweaver is, that method 2 loses the PHP syntax colorization for dynamic values which are wrapped in curly braces. Well, I´d personally consider this a bug actually, but who am I to say ;-)

                 

                However, I´ve been playing with your stuff a little using DW/ADDT. Please have a look at the attached screenshots and try to figure what I did and - in particular - *why* I did what I did

                 

                Cheers,

                Günter

                • 5. Re: conditional region expression builder GET Multiple Variables
                  Joseph07888 Level 1

                  Hi Gunter,

                   

                  Yet again your knowledge is outstanding!!!

                   

                  You are the Master Yoda to DW/ADDT.

                   

                  Can I ask your thoughts on Adobes discontinuation of ADDT and what this means or what alternatives they may develop if any?

                   

                  thanks again

                   

                  Cheers,

                  Joe

                  • 6. Re: conditional region expression builder GET Multiple Variables
                    Günter Schenk Level 4

                    Hi Joe,

                     

                    thanks for your nice words :-)

                     

                    Can I ask your thoughts on Adobes discontinuation of ADDT

                    Maybe some day I´ll be writing some - certainly controversial - stuff and publish it on my own website

                     

                    what this means

                    To me ? ADDT is still an extremely valuable tool which has 99% of the features I´ll ever need when developing database backends

                     

                    what alternatives they may develop if any?

                    I really don´t have the slightest idea about Adobes plans, but I strongly doubt they´d be willing to invest time/money/staff in a proprietary PHP application development framework again, considering that the "not controlled by Adobe" marketplace is crowded with similar (in terms of features, and occasionally technically even more advanced by now) frameworks. What I´d personally wish for future DW versions:

                     

                    1. a drastic improvement of the built-in PHP server behaviours which remained unchanged for quite some years, and IMO at least some of ADDT´s "framework independant" features such as the Query Builder would deserve to become inherited.

                     

                    2. now that ADDT has been phased out, the integratability of at least the major players among the 3rd party PHP application develoment frameworks and - of course - the major Content Management Systems such as WordPress, Joomla, Drupal, Typo3 or ModX (my favorite ;-) etc.

                     

                    Cheers,

                    Günter

                    1 person found this helpful