WEB Help with using a php form...

Discussion in 'OT Technology' started by MSupply, Dec 27, 2007.

  1. MSupply

    MSupply New Member

    Joined:
    Aug 16, 2004
    Messages:
    488
    Likes Received:
    0
    I need to implement some type of php order processing form into my site for customers who choose not to use credit cards or paypal to pay me. I would like to set it up with simple quantity forms next to each type of product, display the total, and when the customer orders I need it sent out in email form. I have a very basic site and dont believe that it would be difficult to accomplish this. I am fairly new to programming though and just need some advice on where to look. I was told to look into php but that is really all I know. I can provide a visual example of how I want things to look if only someone could help me create the proper script. Thank you for your time :)
     
  2. Slid.

    Slid. I'm a guy.

    Joined:
    Oct 25, 2001
    Messages:
    1,928
    Likes Received:
    0
    Location:
    NH
    My guess is that unless you have a very limited number of products (<10) you'll need to mix in some javascript and a cart-type system. PHP will really only be there to send the actual email and do validation if you want (check quantities or something) javascript can do the validation for phone numbers, email address and the like.

    Give more information/examples in this thread.
     
  3. Slid.

    Slid. I'm a guy.

    Joined:
    Oct 25, 2001
    Messages:
    1,928
    Likes Received:
    0
    Location:
    NH
    Do you already have a shopping cart in place? I'd think so if you already take CC and PayPal payments.
     
  4. MSupply

    MSupply New Member

    Joined:
    Aug 16, 2004
    Messages:
    488
    Likes Received:
    0
    Yeah I have a paypal business account and I use the buttons for customers who pay that way. I just want a simple form site that can email me a copy of someones order in case they are somewhat hesitant to use a credit card. I sell to mostly industrial-oriented companies and many of them hate sales calls but dont trust their employees with a company credit card. They like something quick and easy like a site.

    I tried to make an example of what i want, dont laugh im new at this :)

    http://www.maintenancesupplyinc.com/

    None of my forms work or anything, its just how i want it set up. A lot of my customers are nowhere near computer literate, so it has to be stupid easy to use. I just want them to fill out the quantities, have a total display somewhere, and then hit order.
     
  5. Slid.

    Slid. I'm a guy.

    Joined:
    Oct 25, 2001
    Messages:
    1,928
    Likes Received:
    0
    Location:
    NH
    Okay, that looks fine.

    I'd assume you'd be adding Customer Name, Phone and all that jazz. Here's some PHP code that I posted in another thread that will allow you to get started right away:

    submitOrder.php:
    Code:
    <?
    
      $formData = print_r($_REQUEST, true);
      mail([email protected]','Online Order',$formData);
    
    ?>
    
    That will basically email you everything they put into the form along with the names of the associated fields. Make sure you change the email address to your actual address. The output will look something like:

    So where you have

    Code:
    <form name="form1" method="post" action="">
    
    change it to:

    Code:
    <form name="form1" method="post" action="submitOrder.php">
    
    and create submitOrder.php with the code I posted at the top.





    [you don't need the stuff below to get started..]

    If you wanted to get fancy you could do something like:

    submitOrder.php:
    Code:
    <?
    
      $customerName = $_REQUEST['customerName'];
      $item1 = $_REQUEST['item1'];
      $item2 = $_REQUEST['item2'];
      
      $item1Price = $item1 * 9.95;
      $item2Price = $item2 * 14.95;
    
    $formData = "
    $customerName
    $item1 ($$item1Price)
    $item2 ($$item2Price)";
    
      mail([email protected]','Online Order',$formData);
    
    ?>
    
     

Share This Page