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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem with submit button

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <title>FAQ</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="css/reset.css" type="text/css" media="screen">
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen">
    <link rel="stylesheet" href="css/layout.css" type="text/css" media="screen">
    <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="js/cufon-yui.js" type="text/javascript"></script>
    <script src="js/cufon-replace.js" type="text/javascript"></script>
    <script src="js/Dynalight_400.font.js" type="text/javascript"></script>
    <script src="js/FF-cash.js" type="text/javascript"></script>
    <!--[if lt IE 8]>
    <div style=' clear: both; text-align:center; position: relative;'>
    <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
    <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." />
    </a>
    </div>
    <![endif]-->
    <!--[if lt IE 9]>
    <script type="text/javascript" src="js/html5.js"></script>
    <![endif]-->
    </head>
    <body id="page5">
    <!--==============================header=================================-->
    <header>
    <div class="row-top">
    <div class="main">
    <div class="wrapper">
    <h1 align="right"><a href="index.html">DT Donair &amp; Kebab</a>&nbsp;&nbsp; </h1>
    <nav>
    <ul class="menu">
    <li><a class="active" href="index.html">
    <font size="3" style="font-size: 13pt">About</font></a></li>
    <li><a href="menu.html">
    <font size="3" style="font-size: 13pt">Menu</font></a></li>
    <li><a href="catalogue.html">
    <font size="3" style="font-size: 13pt">Hot Deals
    </font></a></li>
    <li></li>
    <li><a href="contact.html">
    <font size="3" style="font-size: 13pt">Contact</font></a></li>
    </ul>
    </nav>
    </div>
    </div>
    </div>
    <div class="row-bot">
    <div class="row-bot-bg">
    <div class="main">
    <h2>Impressive Selection <span>for any Occasion</span></h2>
    </div>
    </div>
    </div>
    </header>

    <!--==============================content================================-->
    <section id="content"><div class="ic"></div>
    <div id="main_area">
    <form method="POST" action="">
    <div id="products"></div>

    <div id="cart-container">
    <div id="cart"></div>
    <div class="clear" style="text-align:right;">
    <input style="width:50px;border:none;" readonly="readonly" id="sum" name="sum" value="" />
    <input style="display:none;padding:3px;" type="submit" value="submit" name="submit" id="submit-btn" />
    </div>
    </div>
    <input type="hidden" name="countloop" id="countloop" value="0"/>
    <input type="hidden" name="page" value="page1"/>
    </form>

    <div id="second_page">
    <?php
    if($_POST['submit']) {

    if($_POST['page'] == 'page1') {

    $countloop=$_POST['countloop'];
    //echo $countloop;
    $body='<h2 style="text-align:center;margin-bottom:10px;">YOU HAVE ORDERED</h2>';
    $body=$body.'<table>';
    $body =$body.'<th>DISH</th><th>Qty.</th><th>Price</th><th>Total</th>';

    for ($i=1; $i<=$countloop; $i++)
    {
    $body = $body. '<tr>';
    $body=$body. '<td width="100px;" align="center">'.$_POST[$i].'</td>';
    $body=$body.'<td width="100px;" align="center">'.$_POST[$i.'_qty'].'</td>';
    $body=$body.'<td width="100px;" align="center">'.$_POST[$i.'_price'].'</td>';
    $body=$body.'<td width="100px;" align="center">'.$_POST[$i.'_qtyresult'].'</td>';
    $body=$body. '</tr>';
    }

    $body=$body.'<tr style="margin:10px 0px 10px 0px">';
    $body=$body. '</tr>';
    $body=$body.'<tr style="margin:10px 0px 10px 0px">';
    $body=$body. '<td width="100px;" align="center" style="font-weight:bold;">Total:</td><td></td><td></td><td align="right">$'.$_POST['sum'].'</td>';
    $body=$body.'</tr>';
    $body =$body.'</table>';

    echo $body;
    $_SESSION['body'] = $body;
    }

    ?>
    <form id="form1" name="form1" method="POST" action="">
    <input type="hidden" name="pages" value="true"/>
    <p style="margin: 15px 0px 0px 30px;">
    <label><input type="radio" name="Radio" value="radio1" />&nbsp;I want to get delivery at home</label><br/>
    <label><input type="radio" name="Radio" value="radio2" />&nbsp;I want to get order at restaurant</label><br />
    <input type="submit" name="submit2" value="Submit" style="margin-top: 5px; padding:5px;"/>
    </p>

    </form>
    <?php } ?>
    </div>

    <div id="third_page">

    <?php

    if(isset($_POST['pages']) and ($_POST['pages']) == 'true') {
    echo '<input type="hidden" name="pages" value="false"/>';

    $body=$_SESSION['body'];
    echo $body;

    if($_POST['Radio'] == 'radio2') {

    $body = $_SESSION['body'];
    echo $body;
    $headers = array(
    'MIME-Version: 1.0',
    'Content-Type: text/html; charset="UTF-8";',
    'Content-Transfer-Encoding: 7bit',
    'Date: ' . date('r', $_SERVER['REQUEST_TIME']),
    'Message-ID: <' . $_SERVER['REQUEST_TIME'].md5($_SERVER['REQUEST_TIME']).'@'.$_SERVER['SERVER_NAME'] . '>',
    'X-Mailer: PHP v' . phpversion(),
    'X-Originating-IP: ' . $_SERVER['SERVER_ADDR'],
    );


    $message = '<b>Will take from Resturant</b>'.'<br>';
    $message .= $body;
    $to = 'ghrehman@gmail.com, nescafe.pk@gmail.com, burnhall.1@hotmail.com';
    $subject = 'you have NEW ORDER';

    $email = mail($to, $subject, $message, implode("\n", $headers)); // this is email function..

    if($email == true) {

    $_SESSION['body'] = '';
    echo 'Your order has been sent to Company'.'<br>';
    echo "You can collect your order from".'<br>';
    echo " ADRESS: abc road".'<br>';
    echo "Canada".'<br>';

    }
    }

    else if($_POST['Radio'] == 'radio1') {

    echo '<form name="" method="post" action="">';
    echo "<label>Enter the address:</label>";
    echo '<input type="text" name="address">';
    echo "<label>Enter the phone num:</label>";
    echo '<input type="text" name="phone">';
    echo "<label>Enter the email address:</label>";
    echo '<input type="text" name="email">';
    echo "<label></label>";
    echo '<input type="submit" name="checkout" value="Submit">';
    echo "</p>";
    echo '<input type="hidden" name="end_page" value="page3"/>';
    echo "</form>";
    }

    }

    if(isset($_POST['end_page']) and ($_POST['end_page']) == 'page3') {


    $body = $_SESSION['body'];
    echo $body;
    $add=$_POST['address'];
    $phone=$_POST['phone'];
    $from=$_POST['email'];

    $headers = array(
    'MIME-Version: 1.0',
    'Content-Type: text/html; charset="UTF-8";',
    'Content-Transfer-Encoding: 7bit',
    'Date: ' . date('r', $_SERVER['REQUEST_TIME']),
    'Message-ID: <' . $_SERVER['REQUEST_TIME'].md5($_SERVER['REQUEST_TIME']).'@'.$_SERVER['SERVER_NAME'] . '>',
    'From: ' . $from,
    //'Reply-To: ' . $from,
    //'Return-Path: ' . $from,
    'X-Mailer: PHP v' . phpversion(),
    'X-Originating-IP: ' . $_SERVER['SERVER_ADDR'],
    );

    $message = '<b>Address:</b> '. $add.'<br/>';
    $message .= '<b>Phone:</b> '.$phone.'<br/>';
    $message .= '<b>Email:</b> '.$from.'<br/>';
    $message .= $body;

    //$add.'<br/>'.$from.'<br/>'.$body;
    $to = ' burnhall.1@hotmail.com';
    $subject = 'you have NEW ORDER';

    $email = mail($to, $subject, $message, implode("\n", $headers)); // this is email function..

    if($email == true) {

    $_SESSION['body'] = '';
    echo 'Your order has been sent to Company'.'<br>';
    echo "You can collect your order from".'<br>';
    echo " ADRESS: abc road".'<br>';
    echo "Canada".'<br>';
    }

    }


    ?>
    </div>
    </div>

    </section>

    <!--==============================footer=================================-->
    <footer>
    <div class="main">
    <div class="aligncenter">
    <span>DT D&amp;K &copy; 2012</span> Developed by: 9Sixty Solutions.
    </div>
    </div>
    </footer>
    <script type="text/javascript"> Cufon.now(); </script>
    </body>
    </html>

  • #2
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,376
    Thanks
    263
    Thanked 32 Times in 31 Posts
    Can you please elaborate on your issue. What issue are you having with the submit button? You have not told us what you are having a problem with.


  •  

    Posting Permissions

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