Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Help Form Processing info from one page to the other

    Ok!!! I know I'm being a noob asking this. I've been programming in php, on and off for the past year. I'm at the stage where I'm trying to create an order form where 2 things happen. Viewing the order before submitting and parsing it for email. I'm kinda okay with the email for now but really need help on this lil project.

    1) Where only the items that are selected on the order form is passed to the next page that I call the validation page before being pass to the processing page. This is a sample code of what I'm working with.

    <table width="118%" style="width: 100%">
    <tr>
    <td style="width: 280px">&nbsp;</td>
    <td class="style31" style="width: 50px"><br class="style28" />
    <span class="style28">Units</span></td>
    <td class="style31" style="width: 50px"><br class="style28" />
    <span class="style28">Cases</span></td>
    <td style="width: 25px">&nbsp;</td>
    <td style="width: 266px">&nbsp;</td>
    <td class="style31" style="width: 50px"><br class="style28" />
    <span class="style28">Units</span></td>
    <td class="style31" style="width: 50px"><br class="style14" />
    <span class="style14">Cases</span></td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td class="style34" style="width: 280px">Order 115</td>
    <td class="style32" style="width: 50px">
    <input name="order115_units" type="text" id="order115_units" value="0" size="4" maxlength="4"
    onblur="order115_127units()" style="height: 16px; width: 29px" class="style34" /></td>
    <td class="style32" style="width: 50px">
    <input name="order115_cases" type="text" id="order115_cases" value="0" size="4" maxlength="4"
    onblur="order115_127cases()" style="height: 15px; width: 29px" class="style34" /></td>
    <td class="style34" style="width: 25px">&nbsp;</td>
    <td class="style34" style="width: 266px">Order 116</td>
    <td class="style32" style="width: 50px">
    <input name="order116_units" type="text" id="order116_units" value="0" size="4" maxlength="4"
    onblur="order115_127units()" style="height: 16px; width: 29px" class="style34" /></td>
    <td class="style32" style="width: 50px">
    <input name="order116_cases" type="text" id="order116_cases" value="0" size="4" maxlength="4"
    onblur="order115_127cases()" style="height: 15px; width: 29px" class="style34" /></td>
    <td class="style34">&nbsp;</td>
    </tr>
    <tr>
    <td class="style34" style="width: 280px">Order 117</td>
    <td class="style32" style="width: 50px">
    <input name="order117_units" type="text" id="order117_units" value="0" size="4" maxlength="4"
    onblur="order115_127units()" style="height: 16px; width: 29px" class="style34" /></td>
    <td class="style32" style="width: 50px">
    <input name="order117_cases" type="text" id="order117_cases" value="0" size="4" maxlength="4"
    onblur="order115_127cases()" style="height: 15px; width: 29px" class="style34" /></td>
    <td class="style34" style="width: 25px">&nbsp;</td>
    <td class="style34" style="width: 266px">Order 118 </td>
    <td class="style32" style="width: 50px">
    <input name="order118_units" type="text" id="order118_units" value="0" size="4" maxlength="4"
    onblur="order115_127units()" style="height: 16px; width: 29px" class="style34" /></td>
    <td class="style32" style="width: 50px">
    <input name="order118_cases" type="text" id="order118_cases" value="0" size="4" maxlength="4"
    onblur="order115_127cases()" style="height: 15px; width: 29px" class="style34" /></td>
    <td class="style34">&nbsp;</td>
    </tr>
    <tr>
    <td class="style34" style="width: 280px">Order 119</td>
    <td class="style32" style="width: 50px">
    <input name="order119_units" type="text" id="order119_units" value="0" size="4" maxlength="4"
    onblur="order115_127units()" style="height: 16px; width: 29px" class="style34" /></td>
    <td class="style32" style="width: 50px">
    <input name="order119_cases" type="text" id="order119_cases" value="0" size="4" maxlength="4"
    onblur="order115_127cases()" style="height: 15px; width: 29px" class="style34" /></td>
    <td class="style34" style="width: 25px">&nbsp;</td>
    <td class="style34" style="width: 266px">Order 120</td>
    <td class="style32" style="width: 50px">
    <input name="order120_units" type="text" id="order120_units" value="0" size="4" maxlength="4"
    onblur="order115_127units()" style="height: 16px; width: 29px" class="style34" /></td>
    <td class="style32" style="width: 50px">
    <input name="order120_cases" type="text" id="order120_cases" value="0" size="4" maxlength="4"
    onblur="order115_127cases()" style="height: 15px; width: 29px" class="style34" /></td>
    <td class="style34">&nbsp;</td>
    </tr>
    <tr>
    <td class="style34" style="width: 280px">Order 121</td>
    <td class="style32" style="width: 50px">
    <input name="order121_units" type="text" id="order121_units" value="0" size="4" maxlength="4"
    onblur="order115_127units()" style="height: 16px; width: 29px" class="style34" /></td>
    <td class="style32" style="width: 50px"><span class="style32" style="width: 50px">
    <input name="order121_cases" type="text" id="order121_cases" value="0" size="4" maxlength="4"
    onblur="order115_127cases()" style="height: 15px; width: 29px" class="style34" />
    </span></td>
    <td class="style34" style="width: 25px">&nbsp;</td>
    <td class="style34" style="width: 266px">Order 126</td>
    <td class="style32" style="width: 50px">
    <input name="order126_units" type="text" id="order126_units" value="0" size="4" maxlength="4"
    onblur="order115_127units()" style="height: 16px; width: 29px" class="style34" /></td>
    <td class="style32" style="width: 50px">
    <input name="order126_cases" type="text" id="order126_cases" value="0" size="4" maxlength="4"
    onblur="order115_127cases()" style="height: 15px; width: 29px" class="style34" /></td>
    <td class="style34">&nbsp;</td>
    </tr>
    <tr>
    <td class="style34" style="width: 280px">Order 127</td>
    <td class="style32" style="width: 50px">
    <input name="order127_units" type="text" id="order127_units" value="0" size="4" maxlength="4"
    onblur="order115_127units()" style="height: 16px; width: 29px" class="style34" /></td>
    <td class="style32" style="width: 50px">
    <input name="order127_cases" type="text" id="order127_cases" value="0" size="4" maxlength="4"
    onblur="order115_127cases()" style="height: 15px; width: 29px" class="style34" /></td>
    <td class="style34" style="width: 25px">&nbsp;</td>
    <td class="style34" style="width: 266px">&nbsp;</td>
    <td class="style32" style="width: 50px">&nbsp;</td>
    <td class="style32" style="width: 50px">&nbsp;</td>
    <td class="style34">&nbsp;</td>
    </tr>
    <tr>
    <td class="style33" style="width: 280px">
    <span class="style34">Units</span>
    <input name="UNITS115_UNITS127" type="text" value="0" size="4" maxlength="4" style="width: 29px; height: 16px;"
    class="style34" />
    <span class="style5">=
    <input name="UNITS115_127total" type="text" id="UNITS115_127total" onfocus="order115_127units()" value="0" size="4"
    maxlength="4" style="width: 29px; height: 16px;" class="style34" />
    <input type="hidden" name="units115_127" value="0" id="units115_127" />
    <input type="hidden" name="UNITS115_127" value="36" id="UNITS115_127" />
    <span class="style36">Cases</span></span>
    </td>
    <td class="style32" style="width: 50px">&nbsp;</td>
    <td class="style32" style="width: 50px">&nbsp;</td>
    <td class="style34" style="width: 25px">&nbsp;</td>
    <td class="style33" style="width: 266px">
    <span class="style34">Whole Case </span>
    <input name="CASES115_CASES127" type="text" value="0" size="4" maxlength="4" style="width: 29px; height: 16px;"
    class="style34" />
    <input name="CASES115_127total" type="hidden" id="CASES115_127total" onfocus="order115_127cases()" value="0" size="4"
    maxlength="4" style="width: 29px; height: 16px;" class="style34" />
    <input type="hidden" name="cases115_127" value="0" id="cases115_127" />
    <input type="hidden" name="CASES115_127" value="36" id="CASES115_127" />
    </td>

    <td class="style32" style="width: 50px">&nbsp;</td>
    <td class="style32" style="width: 50px">&nbsp;</td>
    <td class="style34">&nbsp;</td>
    </tr>
    </table>

    I'm helping out a local non profit org by doing their website "and earning points on my resume" when I get it completed. So my question is how do I parse this information with php. The original order.php I used was just to email me the order but I'm trying to create it for whoever the client is will be able to view the order before submitting it for processing.

    Any help at all whether comments or critique is welcome. I've got to learn somehow. So thanks to all.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Is that a "hard-coded" page, or is it being generated from a database?

    Curious why some variables are CAPS and others small:
    <input type="hidden" name="cases115_127" value="0" id="cases115_127" />
    <input type="hidden" name="CASES115_127" value="36" id="CASES115_127" />


    My thought process is to use session variables to remember the values and those
    can be recalled on any other pages. But maybe there is a problem with they way
    the items are defined? Not sure why variable names are duplicated with CAPS and small.

    Also,
    Does the user log into the site?
    Is there any PHP or MySQL involved anywhere on the site?

    Maybe you can also show us the actual site so we can see what it's about.

  • #3
    New Coder
    Join Date
    Jan 2009
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts
    its not generated its hardcoded and no one logs in. i haven't gotten that far yet but plan to as i learn it

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Sorry, but by doing the forms and items and everything by hand, the scripting to
    do what you want will be a lot of work ... and if they wish to change one small thing,
    all of the scripts will need to be edited for every single little change. Too much coding,
    and too much work to show using this forum. You'll have to hire someone to script it
    for you and edit it every time there is a change.

    And when you get into the depth of it ... you'll want to also look into processing
    payment online. That's a whole other topic.

    I realize you're new to PHP and MySQL ... but your situation is one where a simple
    MySQL database would make all the difference in the world. It would put all of the
    item add/edit/delete into the hands of your client ... so you would not have to even
    touch it anymore.

    Keep on learning PHP/MySQL ... and good luck with it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •