Page 1 of 1

Trouble: insert into table & display confirmation of res

Posted: Tue Jul 20, 2004 2:31 pm
by cdickson
I'm still quite new at PHP and I'm registered for a class but need some help with this project before the class starts.

The scenario:
- User registers, then logs in through PHP user area (which someone else wrote)
- When user clicks to login, gets page where they can choose to Logout or to Order
- Order form displays current user name and related company info, then has various fields through which order is placed

The problem: Confirmation
I am trying to get the order confirmation page to display the same user/company info, which is already in the database and which I was able to successfully display on the Order page - but it won't show here. I also want it to display the new order information that the user just entered.

The database is updating properly, but I can't get the information to display in the Order Confirmation page.

Database structure:
TABLE = Login_users >> user/company info
TABLE = orders >> order info

It might freak you out that there is a combination of regular PHP and Dreamweaver MX PHP - which I hate - and it may be part of my problem.

The code in my confirmation page is:

Code: Select all

<form name="confirmorder" method="post">
        <table width="425" border="0" align="center" cellpadding="1" cellspacing="2">
          <tr class="navtext">
            <td height="25" class="navtext"><b class="heading">Order Date </b></td>
            <td><?php echo date('F d, Y',$_POST['order_date']); ?></td>
          </tr>
          <tr class="navtext">
            <td height="25" class="navtext"><b class="heading">Order Number</b></td>
            <td><?php echo $_POST['order_no']; ?></td>
          </tr>
          <tr class="navtext">
            <td width="40%" valign="top" class="navtext"><b class="heading">Lender Information</b></td>
            <td><p><?php echo $row_rsLenders['lender_name']; ?><br>
                <?php echo $row_rsLenders['lender_address']; ?><br>
                <?php echo $row_rsLenders['lender_city']; ?>, <?php echo $row_rsLenders['lender_state']; ?> <?php echo $row_rsLenders['lender_zip']; ?><br>
                <?php echo $row_rsLenders['lender_phone']; ?></p>
            <p>&nbsp;</p></td>
          </tr>
          <tr class="navtext">
            <td valign="top" class="navtext"><b class="heading">Property Information </b></td>
            <td><?php echo $_POST['loan_no']; ?><br>              
			<?php echo $_POST['collateral_owner']; ?><br>
            <?php echo $_POST['collateral_address']; ?><br>
            <?php echo $_POST['collateral_city']; ?>, <?php echo $_POST['collateral_state']; ?>&nbsp; <?php echo $_POST['collateral_zip']; ?><br>
            <?php echo $_POST['county']; ?><br>
            <?php echo $_POST['collateral_twp']; ?><br>
            <?php echo $_POST['legal_descr']; ?></td>
          </tr>
        </table>
      </form>
I have also tried using GET for the form method, but with the same results.

Posted: Tue Jul 20, 2004 2:34 pm
by feyd
you have to select it again, or find a way to transfer it from the order page to this one.. maybe through sessions..

Posted: Tue Jul 20, 2004 2:37 pm
by cdickson
Thanks, feyd. I haven't used sessions before, but what better time than the present to give it a try.

Back to http://www.php.net!