This is just a test page I am working on. Trying to get my submit button to load the next page "order.php"

It just keeps loading the same page. Should I be writing this in PHP or HTML?

If you look at my submit button, I am thinking this should work.



          $customer = $_POST['customer'];
          $Email = $_POST['Email'];

          $query = "INSERT INTO tbl_cust 
                (CName, email)
                (:customer, :Email)";

          $sth = $db->prepare($query);
          $sth->bindValue(':customer', $customer, PDO::PARAM_STR);
          $sth->bindValue(':Email', $Email, PDO::PARAM_STR);

          echo 'Form Submitted and data saved!';

<!DOCTYPE html>
<html class="html" lang="en-US">
      <meta http-equiv="Content-type" content="text/html;     <title>Home</title>
      <div class="clearfix" id="page">
         <form class="form-grp clearfix colelem" id="widgetu75" method="post" enctype="multipart/form-data" action="">
           <input type="hidden" name="action" value="submit-form">
            <input class="wrapped-input" type="text" spellcheck="false" id="widgetu86_input" name="customer" tabindex="1"/>
            <input class="wrapped-input" type="text" spellcheck="false" id="widgetu82_input" name="Email" tabindex="2"/>
            <input class="submit-btn NoWrap grpelem" id="u81-17" type="submit" value="Submit" href="order.php" target="_blank"" ttabindex="3"/>
  • 2
    try changing your action from "" to "order.php" – cybernard Oct 11 '15 at 22:48
  • it worked. i'm a bonehead. :) – David Oct 12 '15 at 0:05
  • Glad I could help. I have made simple mistakes that way also. – cybernard Oct 12 '15 at 0:07
  • @cybernard better post your comment as answer, so it would be easier for other users to know that this question has been answered already. – artsylar Oct 19 '15 at 6:43

try changing your action from "" to "order.php"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.