thelee Posted November 22, 2012 Share Posted November 22, 2012 i have create a table for customer to make order. but i do not know how i can build a customer order confirmation,which mean the page will show what is the customer name.ordered product and it will ask the customer to confirm to make the order or back to the order form back. here is the orderform <?php error_reporting(E_ALL); session_start(); if(!isset($_SESSION['MM_Username'])) { echo "You are not logged in or registered / Click <a href='login.php'>Here</a> to login !"; } else { ?> <style type="text/css"> <!-- body { background:#000; background-attachment:fixed; background-repeat:no-repeat; color:#fff; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; } table { background:#000; border:1px solid white;} --> </style> </head> <body> <p><b>Welcome <?PHP echo $_SESSION['MM_Username']; ?> !</b></p> <form name="form1" method="post" action="order_product_process.php"> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10">Order Form:</p> <div align="center"> <table width="500" > <tr> <td width="239">Username</td> <td width="249"> <input name="username" type="text" id="username" value="<?PHP echo $_SESSION['MM_Username']; ?>" readonly="true"></td> </tr> <tr> <td>Address</td> <td><textarea name="address" id="address"></textarea></td> </tr> <tr> <td>Phone</td> <td><input name="phone" type="text" id="phone" maxlength="30"></td> </tr> <tr> <td>IC Number</td> <td><input name="ic" type="text" id="ic" maxlength="30"></td> </tr> <tr> <td>Product Name</td> <td><input name="product_name" type="text" id="product_name" maxlength="30"></td> </tr> <tr> <td>Quantity</td> <td> <input name="quantity" type="text" id="quantity" maxlength="30"></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Order"> <input name="Reset" type="reset" id="Reset" value="Reset"></td> </tr> </table> </div> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </form> </body> </html> <?php } ?> here is the orderconnect.php <? mysql_connect("localhost", "root", "") or die("Cannot connect to server."); mysql_select_db("order") or die("Cannot select database."); ?> can someone help me please Quote Link to comment https://forums.phpfreaks.com/topic/271024-how-to-create-customer-order-confirmation/ Share on other sites More sharing options...
Beeeeney Posted November 22, 2012 Share Posted November 22, 2012 You need a table in your database that stores everything they enter into the form, which you can then echo back to the browser for them to confirm. If they confirm, have it submit to another table where the confirmed orders are kept. That way you can keep track of who's ordering and going through with it and who's cancelling at the last minute. Quote Link to comment https://forums.phpfreaks.com/topic/271024-how-to-create-customer-order-confirmation/#findComment-1394338 Share on other sites More sharing options...
thelee Posted November 22, 2012 Author Share Posted November 22, 2012 (edited) here is it the order table structure CREATE TABLE `order` ( `order_id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(30) NOT NULL DEFAULT '', `address` varchar(30) NOT NULL DEFAULT '', `phone` varchar(30) NOT NULL DEFAULT '', `ic` varchar(30) NOT NULL DEFAULT '', `product_name` varchar(30) NOT NULL DEFAULT '', `quantity` int(30) NOT NULL DEFAULT '0', PRIMARY KEY (`order_id`) ) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 Edited November 22, 2012 by thelee Quote Link to comment https://forums.phpfreaks.com/topic/271024-how-to-create-customer-order-confirmation/#findComment-1394345 Share on other sites More sharing options...
thelee Posted November 22, 2012 Author Share Posted November 22, 2012 CREATE TABLE `order` ( `order_id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(30) NOT NULL DEFAULT '', `address` varchar(30) NOT NULL DEFAULT '', `phone` varchar(30) NOT NULL DEFAULT '', `ic` varchar(30) NOT NULL DEFAULT '', `product_name` varchar(30) NOT NULL DEFAULT '', `quantity` int(30) NOT NULL DEFAULT '0', PRIMARY KEY (`order_id`) ) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 Quote Link to comment https://forums.phpfreaks.com/topic/271024-how-to-create-customer-order-confirmation/#findComment-1394346 Share on other sites More sharing options...
Beeeeney Posted November 22, 2012 Share Posted November 22, 2012 Just echo the table back to the browser. Let them read it and confirm, then submit it to a 'confirmed orders' table. Quote Link to comment https://forums.phpfreaks.com/topic/271024-how-to-create-customer-order-confirmation/#findComment-1394366 Share on other sites More sharing options...
thelee Posted November 22, 2012 Author Share Posted November 22, 2012 how can i echo it back ? Quote Link to comment https://forums.phpfreaks.com/topic/271024-how-to-create-customer-order-confirmation/#findComment-1394374 Share on other sites More sharing options...
Beeeeney Posted November 22, 2012 Share Posted November 22, 2012 With the "echo" function? Quote Link to comment https://forums.phpfreaks.com/topic/271024-how-to-create-customer-order-confirmation/#findComment-1394382 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.