View Single Post

  #2 (permalink)  
Old 10-18-2004
Website Managers, LLC
 
Posts: n/a
Default Re: Fieldforwarder PHP script doesn't forward fields the second time around


"Marc de Winter" <marc@cura.net> wrote in message
news:BD99463D.7215%marc@cura.net...
> Hello all,
>
> I'm new to this newsgroup and have tried to search through the archives
> first, before posting this question. I don't think it has been addressed
> before. Also, this question is about a script I found on zend.com, and I
> have also emailed the author of the script, unfortunately without any
> replies sofar.
>
> Here goes:
>
> I am working on a website for pizza delivery. Through this website people
> need to be able to order a pizza or pasta online.
>
> The ordering proces will be a form with multiple pages. The visitor will

be
> guided through the menu in 5 steps. Step 1 being the pizzas, step 2 the
> pastas, and so on.
> On each page there is always the possibility to add an "side-order" to

their
> order. So, on the right is always the same list of side-orders.
>
> I am using a script called fieldforwarder.php (see this page for the

script:
> http://www.zend.com/zend/spotlight/c...7.php#Heading9)
>
> It works perfectly, however one challenge still remains and it has to do
> with the side-order. I think it has something to do with the
> fieldforwarder.php file.
>
> The side-orders can be choosen during any step. So, if one chooses a side
> order in step 1, it needs to remain chosen in the following steps. I have
> this working, by using if statements. One pulldown menu in the side-order
> menu looks like this:
>
> <select name="italianchefsalad_junior" class="orderpulldown"
> id="italianchefsalad_junior">
> <option value="0"<?php if ($italianchefsalad_junior==0) echo "selected";
> ?>>0</option>
> <option value="1"<?php if ($italianchefsalad_junior==1) echo "selected";
> ?>>1</option>
> <option value="2"<?php if ($italianchefsalad_junior==2) echo "selected";
> ?>>2</option>
> </select>
>
> Although starting from step 2 the code looks this actually.
> Well, it does work in a way that it shows me when i clicked something in

the
> side orders on the first page. However, when i try to choose something in
> step 2 (or 3 or 4 or 5) it won't "remember" it.
> I guess that the fieldforwarder.php file doesn't check for changes in
> fields, it already has indexed? I'm not quite sure, because the code of

the
> file is a little bit too advanced for me.
>
> Hopefully someone on here can help me out. I really hope so.
>
> Sincerely,
> Marc de Winter
>
>


It's been my experience that if you do not use a space between your option
and
<?php you will not get the desired results because it would be returned as
"0"selected
instead of "0" selected. So that's your first step.

<option value="0" <?php if ($italianchefsalad_junior==0) echo "selected";

The second step is on each page either use sessions $_SESSION["item"] to
track
the items, or use $_POST["item"] $_GET["item"] or $_REQUEST["item"] to track
each item in the order. The REQUEST option does not care of it's a POST or
GET.

Jim Hutchinson
Website Managers, LLC
http://www.websitemanagers.net



Reply With Quote