Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
WHY CANT I PASS THE SIZE VARIABLE FROM Gorder.html

Posted by kingwiqid (kingwiqid), 28 February 2008


here is the setup - end user is on a page that asks them to build
a sandwich online. They start by clicking on what size they want.
As soon as they click the size they want - it takes them to a page
where they can order meats, cheeses and condiments. Once they
pick all of that and click submit - then they are linked to the
last page which is supposed to confirm what they orderd before
posting it to the server.

So far it posts the size to the server - as you can see it is
set up to do this as soon as they are linked to Gorder.php

then it takes them to then next page and they add more info aboput their order.
when they click submit - they are taken to the last page that confirms
what they ordered.

i know this probably sounds stupid - but how the heck do i pass
all the variables (including SIZE from the first page) to the last
confirmation page and THEN post to the server?

I am able to capture the data from page 1 into the Gorder.php page
and even insert to the database.( but i really dont want to do that until
user verifies the order is correct)  But i cant pass that same variable to
the confirmation page so that i can submit it to database once the order
is confirmed.

I also need to know how to display the info back to the customer before
posting it to the database. I know how to DISPLAY it  using the echo command  -
but how do i take that same data now and pass it to the database.

I know how to insert to database from Order.php .. but just like the SIZE variable -
i dont know how to patch it through to the last confirmation page before
submiting to databse.


any assiatnce is appreciated - I included some samples of the of the code minus html table formating


Gorder.html
--------------------------------------------

<form action="Gorder.php" method="get">

<input type="radio" name="size" value="large">12 inch Large</input>
<input type="radio" name="size" value="medium">9 inch Medium</input>
<input type="radio"  name="size" value="small">6 inch Small</input>
<input type="submit" value="Submit"></input>
</form>


// after clicking SUBMIT they are linked to Gorder.php where they answer
questions about what kind of meats, cheeses and condiments they would like.
After that they are linked to Gconfirm.php where it displays their order
and asks them  to confirm the order.




Gorder.php
------------------------------


$sizes=$_GET['size'];
$sql="INSERT INTO Sub_Orders (Size)
VALUES
('$_GET[size]')";


// insert size variable to database - then ask what condiments they want




<form action="Gconfirm.php" method="post">
<input type="hiddden" name="size" vaue=<? $sizes ?></input>
<input type="radio" name="bread" value="White">White</input>
 <input type="radio" name="cheese" value="American">American</input



//  you can see by the hidden tag that i am
   trying to pass SIZE variable that i collected on  Gorder.html
   from Gorder.php to Gconfirm.php but i dont htink im doing
   it right ( or it would work)

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


Gconfirm.php
-----------------------------------------

<h2>Confirm your Order</h2>


$sizes=$_GET['size'];


   <?php  echo $sizes; ?>
     
   <br/>
   <?php echo $_POST["bread"]; ?>
   <br/>

      <?php echo $_POST["cheese"]; ?>
   <br/>

   <br/>

// i havn't tried to post any of the data on to
  the database cause i havnt even been able to
  pass the SIZE variable to the confirmation page to view it.
  once i figure out how to even see the data from Gorder.html(on Gconfirm.php)
  i will then post it to the database - that shouldn't be a
  problem at that point.

// i am able to see the bread & cheese variable (on Gconfirm.php) wich was collected on
  the previous page ( Gorder.php)
-  but i am unable to see the SIZE variable  ( which was collected on Gorder.html)  



can anybody point out what i am doing wrong -

my basic questiion :

WHY CANT I PASS THE SIZE VARIABLE FROM Gorder.html TO Gconfirm.php ??

thanks again -



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho