473,811 Members | 3,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Fieldforwarder PHP script doesn't forward fields the second timearound

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="italianch efsalad_junior" class="orderpul ldown"
id="italianchef salad_junior">
<option value="0"<?php if ($italianchefsa lad_junior==0) echo "selected";
?>>0</option>
<option value="1"<?php if ($italianchefsa lad_junior==1) echo "selected";
?>>1</option>
<option value="2"<?php if ($italianchefsa lad_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
Jul 17 '05 #1
2 1970

"Marc de Winter" <ma**@cura.ne t> wrote in message
news:BD99463D.7 215%ma**@cura.n et...
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="italianch efsalad_junior" class="orderpul ldown"
id="italianchef salad_junior">
<option value="0"<?php if ($italianchefsa lad_junior==0) echo "selected";
?>>0</option>
<option value="1"<?php if ($italianchefsa lad_junior==1) echo "selected";
?>>1</option>
<option value="2"<?php if ($italianchefsa lad_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 ($italianchefsa lad_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

Jul 17 '05 #2
Marc de Winter wrote:
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)


I don't have experience of the Zend script you're referring to, but this
sounds to me like a classic situation for an array session variable.

What you're describing is a shopping cart, really. I would suggest
registering a session variable called somthing like $order, and adding
things to it. It'll be an array (arbitrarily deep), so the order
information could be stored in that. For example the array might contain
(untested):

$_SESSION['order'] = array(
pizza => array (type => 'quattro formaggi', quantity => 1),
pasta => array (item => 'carbonara', quantity => 2),
italianchefsala d_junior => array (quantity => 1)
)

etc, etc.

That way, you could always refer to the session array $order to find out
what was on the buyers list (untested):

foreach ($_SESSION['order'] as $dish => $details) {
echo $dish.":<br>";
foreach ($details as $detail => $information) {
echo $detail.": ".$information. "<br>";
}
echo "<br>";
}

this will give you something like:

pizza:
type: quattro formaggi
quantity: 1

pasta:
type: carbonara
quantity: 2

italianchefsala d_junior:
quantity: 1

Or you could find the quantity of italianchefsala d_junior at
$_SESSION['order']['italianchefsal ad_junior']['quantity'].

Clearly the data structure needs to be carefully thought through, and my
suggested one is probably totally inappropriate for your application,
but you might get the idea.

For more info on PHP sessions and session variables, the PHP website is
essential reading (UK mirrors given):

http://uk2.php.net/manual/en/function.session-start.php
http://uk2.php.net/manual/en/functio...n-register.php

Ed


Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
3998
by: Fox | last post by:
I merged and modified these script which work perfectly fine as long as I use server.execute to access the VBS part (which is itself in another ASP file). When these I use a session variable to pass an email address from the database. I have had timeout problems and buffer problems and as I understand it, maybe a problem with changing the session variable too many times in one session. So I tried putting the two scripts on one page. When...
6
12990
by: Mike Daniel | last post by:
I am attempting to use document.write(pageVar) that displays a new html page within a pop-up window and the popup is failing. Also note that pageVar is a complete HTML page containing other java scripts. Being a javascript newbie and after significant testing, I suspect that the document.write fails after finding a </script> within pageVar. Does a trick exist that enables one to slightly alter pageVar whereby enabling...
8
4236
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link, which when you click it bookmarks the site (much easier). The favicon is never saved if the site is bookmarked this way. Does anyone have any ideas how to fix this?? This is the code: <script language="JavaScript">
7
7620
by: Dr. Know | last post by:
I am working on an ASP page that writes to several databases, ranging from MDBs to x-base. One of the tasks involves using an existing highest value from the DB and incrementing it before inserting a new record. I am using Application.Lock and .Unlock together with an application variable to negotiate access to the DB routine to one session (user) at a time. This is to ensure that the ID numbers are cleanly incremented, and that no...
6
6109
by: nate | last post by:
Hello, Does anyone know where I can find an ASP server side script written in JavaScript to parse text fields from a form method='POST' using enctype='multipart/form-data'? I'd also like it to parse the filename. <form name='form1' method='POST' enctype='multipart/form-data' action='sub.asp'> <input type='text' name='title1' value='value1'> <input type='file' name='file1'>
1
2916
by: Dan | last post by:
This is one that has me stumped and I need an expert's input. Any ideas why the values from the second script-generated drop down list isn't recognized by the script to add time values to the text boxes? What this script is suppose to do is change the value of a second drop down list based on the selection from the first. Then a value is chosen from the script generated drop down list in the
5
6192
by: Todd Huish | last post by:
I have noticed something disturbing when retrieving datasets over a relatively slow line (multiple T1). I am looking at about 25 seconds to retrieve 500 rows via a php-odbc link. This same select from the cli is for all intents practicaly instantaneous. After much research I discovered that PHP by default uses a dynamic cursor type which can be quite a bit slower than a forward only cursor. BTW I have been searching forward only/read...
3
11303
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
4
4594
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet reservation of available resources (laptops, beamers, etc). The MySql database queries are already in place, as is the ASP administration panel. The frontend that users will see however, still needs some work. I'm really close, but since I'm no...
0
9731
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.