I've created a three step order form and I need help with the third step.
1. form is filled out by the business and clicks on "preview order"
2. business views their order and clicks "confirm" (should be on "bizform.php" but I haven't tried it because I have no clue on how to do it.)
3. by clicking "confirm" the "Web page" or data from "bizform.php" is sent to the business and myself.
Questions: Is it possible? If so, can you point me in the right direction? TYVM
My form:
<div class="span4 diff">
<h3>Business Information</h3>
<br/>
<form action="bizform.php" method="post">
<label for="bizName" class="control-label">
Business:</label>
<input type="text" id="bizName" name="bizName" class="input-large">
<label for="bizAddress" class="control-label">
Business Address:</label>
<input type="text" id="bizAddress" name="bizAddress" class="input-large">
<label for="bizCity" class="control-label">
City:</label>
<input type="text" id="bizCity" name="bizCity" class="input-large">
<label for="bizState" class="control-label">
State:</label>
<input type="text" id="bizState" name="bizState" class="input-large">
<label for="bizZip" class="control-label">
Zip code:</label>
<input type="text" id="bizZip" name="bizZip" class="input-large">
<label for="fullName" class="control-label">
Full Name:</label>
<input type="text" id="fullName" name="fullName" class="input-large">
<label for="bizEmail" class="control-label">
E-mail:</label>
<input type="text" id="bizEmail" name="bizEmail" class="input-large">
</div>
<div class="span7">
<h3>Choose Products</h3>
<br/>
<table class="table table-bordered table-striped">
<thead>
<tr class="diffhead">
<th>Product</th>
<th>Price</th>
<th>Training</th>
<th>Total</th>
<th>Qty</th>
</tr>
</thead>
<tbody>
<tr>
<td>Product One</td>
<td>$1000.00</td>
<td>$100.00</td>
<td>$1100.00</td>
<td>
<label class="input" for="productOne"></label>
<input type="text" class="input-mini" value="0" id="productOne" name="productOne">
</td>
</tr>
<tr>
<td>Product Two</td>
<td>$1000.00</td>
<td>$100.00</td>
<td>$1100.00</td>
<td>
<label class="input" for="productTwo"></label>
<input type="text" class="input-mini" value="0" id="productTwo" name="productTwo">
</td>
</tr>
<tr>
<td>Product Three</td>
<td>$1000.00</td>
<td>$100.00</td>
<td>$1100.00</td>
<td>
<label class="input" for="productThree"></label>
<input type="text" class="input-mini" value="0" id="productThree" name="productThree">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="form-actions">
<button class="btn btn-danger" type="reset" style="float:left">
<i class="icon-remove-sign icon-white"></i> Cancel Order</button>
<button class="btn btn-primary" type="submit" style="float:right">Preview Order
<i class="icon-circle-arrow-right icon-white"></i></button>
</form>
<?php
include '_inc/footer.html';
?>
My form processor:
<?php
include '_inc/header.html';
?>
<?php
$bizName = $_POST['bizName'];
$bizAddress = $_POST['bizAddress'];
$bizCity = $_POST['bizCity'];
$bizState = $_POST['bizState'];
$bizZip = $_POST['bizZip'];
$fullName = $_POST['fullName'];
$bizEmail = $_POST['bizEmail'];
$productOne = $_POST['productOne'];
$productTwo = $_POST['productTwo'];
$productThree = $_POST['productThree'];
$moneyOff = '';
$totalPro = $productOne + $productTwo + $productThree;
define('PRODPRICE', 1100);
$totalMoney = $productOne * PRODPRICE
+ $productTwo * PRODPRICE
+ $productThree * PRODPRICE;
if ( $totalMoney == 2200 )
{
echo '<div class="alert alert-success">Go Back! You can get a product for free!</div>';
}
if ( $totalMoney == 3300 )
{
$moneyOff = 1100;
}
else
{
$moneyOff = 0;
}
define('STOCKFEE', 10);
$stockFee = $productOne * STOCKFEE
+ $productTwo * STOCKFEE
+ $productThree * STOCKFEE;
?>
<h1 align="center">Order Agreement</h1>
<br/>
<?php
echo '<strong>' .$bizName. '</strong> is purchasing the following products and services from CBE:</p>';
echo '<div class="well">
<table cellspacing="0" cellpadding="0" width="800px">
<thead>
<th>Qty</th>
<th>Product</th>
<th>Price</th>
</thead>
<tbody>
<tr>
<td align="center">'. $productOne .'</td>
<td align="center">Product One</td>
<td align="center">$1,100.00</td>
</tr>
<tr>
<td align="center">'. $productTwo .'</td>
<td align="center">Product Two</td>
<td align="center">$1,100.00</td>
</tr>
<tr>
<td align="center">'. $productThree .'</td>
<td align="center">Product Three</td>
<td align="center">$1,100.00</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="right">Sub Total:</td>
<td align="center">'.number_format($totalMoney,2).'</td>
</tr>
<tr>
<td> </td>
<td align="right">Discount:</td>
<td align="center">'.number_format($moneyOff,2).'</td>
</tr>
<tr>
<td> </td>
<td align="right">Grand Total:</td>
<td align="center">'.number_format($totalMoney - $moneyOff,2).'</td>
</tr>
</tbody>
</table>
</div>';
echo '<p>Business agrees to pay <strong> '.number_format($totalMoney - $moneyOff,2).' </strong>for these products and services. In addition, Business will pay an additional <strong> '.number_format($stockFee,2).' </strong>to cover stock fee.</p>';
?>
<div class="row"> </div>
<div class="row">
<div align="left">
<table cellspacing="10" cellpadding="10" width="850px">
<tbody>
<tr><td> </td></tr>
<tr>
<td valign="top">
<?php
echo '<strong>' .$bizName. '</strong> <br/>';
echo $bizAddress.'<br/>';
echo $bizCity.', ';
echo $bizState.' ';
echo $bizZip.'';
?>
</td>
<td valign="top">
<strong>CBE</strong><br/>
Corporate Headquarters<br/>
555 Main Street<br/>
PHPLAND, DB 78987-3849<br/>
888-098-3049
</td>
</tr>
</tbody>
</table>
</div>
</div>
<?php
include '_inc/footer.html';
?>
To store the the data across multiple forms:
<?php
session_start(); // Initiates the session, and loads the _SESSION variable
var_dump($_SESSION); // Show the data in the _SESSION variable
// Load data into the sessions
$_SESSION['a'] = 1;
$_SESSION['b'] = 'hello world';
if (!isset($_SESSION['c'])) $_SESSION['c'] = 0;
else $_SESSION['c'] += 2;
At first, you should see an empty array. Then, refresh and you will see your session data.
http://php.net/manual/en/features.sessions.php - for reference and further education...
Since you can easily access the data via $_POST array, to send all this information to the respective recipients use the mail() function of php to create an email and send it over to whoever you want.
When you submit the form to bizform.php, store you post variables in hidden input fields, and submit those to your form processor on step 3.
EDIT:
In other words, have your Confirm process post your hidden fields to another processor that creates your email content from the POST, and send TO the business, and yourself as a CC or BCC header.
<input name="AID" type="hidden" id="AID" value="<?php echo $_POST['AID']; ?>" size="32" />
Related
I am trying to append table row which contains HTML form. The append form data not passing to controller. My Code is -
<form method="post" action="<?=base_url()?>controller/function_name">
<table class="table table-bordered tbsize tb_wp" id="">
<thead>
<tr >
<th class="firstrow">Item No.</th>
<th class="firstrow">Part No.</th>
<th class="firstrow">Qty</th>
<th class="firstrow">Price Quoted </th>
<th class="firstrow"> Notes </th>
<th class="firstrow">Internal Notes</th>
<th colspan="3" class="firstrow2">
<div class="pcrsec">
<div class="row"><span class="pcrsecbor">Perior Customer RFQ</span></div>
<div class="row">
<div class="pcrsec2">
<ul class="list-inline">
<li>Date</li>
<li>Cust No</li>
<li>Price</li>
</ul>
</div>
</div>
</div>
</th>
<th colspan="3" class="firstrow3">
<div class="pcrsec">
<div class="row"><span class="pcrsecbor">Perior Customer P/O</span></div>
<div class="row">
<div class="pcrsec2">
<ul class="list-inline">
<li>Date</li>
<li>Cust No</li>
<li>Price</li>
</ul>
</div>
</div>
</div>
</th>
<th colspan="3" class="firstrow4">
<div class="pcrsec">
<div class="row"><span class="pcrsecbor">Perior Vendor P/O</span></div>
<div class="row">
<div class="pcrsec2">
<ul class="list-inline">
<li>Date</li>
<li>Cust No</li>
<li>Price</li>
</ul>
</div>
</div>
</div>
</th>
<th class="firstrow">MU%</th>
<th></th>
</tr>
</thead>
<tbody id="what_i_do">
<tr>
<td><input type="text" name="item_no[]"></td>
<td colspan="3">
<table>
<tr>
<td><input type="text" class="smlbox" name="part_no[]" onblur="checkavailpart(this)"></td>
<td><input type="number" class="smlbox" name="qty[]"></td>
<td>
<input type="number" class="smlbox price_quotd_cls" name="price_quotd[]">
</td>
</tr>
<tr>
<td colspan="3"><input type="text" class="smlbox2" name="part_desc[]"></td>
</tr>
</table>
</td>
<td><input type="text" name="part_note[]"></td>
<td><input type="text" name="part_internal_note[]"></td>
<td><input type="text" class="datepicker" name="pc_rfq_date[]"></td>
<td><input type="text" name="pc_rfq_cus_no[]"></td>
<td><input type="text" name="pc_rfq_price[]"></td>
<td><input type="text" class="datepicker" name="pc_po_date[]"></td>
<td><input type="text" name="pc_po_cus_no[]"></td>
<td><input type="text" name="pc_po_price[]"></td>
<td><input type="text" class="datepicker" name="pv_po_date[]"></td>
<td><input type="text" name="pv_po_cus_no[]"></td>
<td><input type="text" name="pv_po_price[]"></td>
<td><input type="text" name="mu_per[]" onblur="calculate_quote_rate(this)"></td>
<td><i class="fa fa-plus-circle fa-2x" onclick="what_i_do(this);"></i></td>
</tr>
</tbody>
</form>
And JQuery is:-
<script>
function what_i_do(that) {
initid++;
var objTo = document.getElementById('what_i_do');
var divtest = document.createElement("tr");
divtest.setAttribute("class", "removeclass" + initid);
divtest.setAttribute("id", "removeclass" + initid);
var rdiv = 'removeclass' + initid;
divtest.innerHTML = '<td><input type="text" name="item_no[]"></td><td colspan="3"> <table> <tr> <td><input type="text" class="smlbox" name="part_no[]" onblur="checkavailpart(this)"></td><td><input type="number" class="smlbox" name="qty[]"></td><td> <input type="number" class="smlbox price_quotd_cls" name="price_quotd[]"> </td></tr><tr> <td colspan="3"><input type="text" class="smlbox2" name="part_desc[]"></td></tr></table> </td><td><input type="text" name="part_note[]"></td><td><input type="text" name="part_internal_note[]"></td><td><input type="text" class="datepicker" name="pc_rfq_date[]"></td><td><input type="text" name="pc_rfq_cus_no[]"></td><td><input type="text" name="pc_rfq_price[]"></td><td><input type="text" class="datepicker" name="pc_po_date[]"></td><td><input type="text" name="pc_po_cus_no[]"></td><td><input type="text" name="pc_po_price[]"></td><td><input type="text" class="datepicker" name="pv_po_date[]"></td><td><input type="text" name="pv_po_cus_no[]"></td><td><input type="text" name="pv_po_price[]"></td><td><input type="text" name="mu_per[]" onblur="calculate_quote_rate(this)"></td><td><i class="fa fa-times-circle fa-2x" style="color:red" onclick="remove_education_fields(' + initid + ');"></i></td>';
objTo.appendChild(divtest);
}
</script>
When I am submitting the form I use to get only zero index data. I have tried to clone the table row but there also I am not getting the value of the form which have been appended by the JQuery.
Please Help me out of this Problem
Thank You in advance.
in your appended html :
divtest.innerHTML = '<td><input type="text" name="item_no[]"></td><td colspan="3"> <table> <tr> <td>.....
remove all spaces between tags
First make sure that your submit button is inside form tag,
then you can just append your html code inside tbody tag :
#what_i_do refer to tbody tag
$("#what_i_do tr").append('<tr class="removeclass'+id+'" id="removeclass'+id+'">'+ 'html code'+ '</tr>');
I am trying to send my dynamic table to mysql database but I am having difficulties. I've tried using a for to get it to send but I'm not getting very far. At the moment I am just displaying it but I really want to send it to mysql. I want all the data to be in one row with the rest of the data like test case name, test case number and so on. But the dynamic table must be put into the same row where the rest of the data goes.
Below you will see what I have done and maybe you can see what my intentions are...
<div class="col-md-6">
<label>Test Case Number:</label>
<?php
$sql = "SELECT test_case_number FROM qa_testing_application ORDER BY id desc LIMIT 1";
$result = mysqli_query($database, $sql) or trigger_error("SQL", E_USER_ERROR);
while ($row = mysqli_fetch_assoc($result)) {
?>
<input class="form-control" style="display: none" type="text" name="test_case_number" readonly="readonly" value="<?php echo $row['test_case_number']+3?>">
<?php } ?>
<label>Company Name:</label>
<input class="form-control" type="text" name="test_case_company_name"/>
<label>Tester:</label>
<input class="form-control" style="display: none" type="text" name="user_username" value="<?php echo $user_username ?>" readonly/>
<label>System:</label>
<input class="form-control" type="text" name="test_case_system"/>
<label>URL:</label>
<input class="form-control" type="text" name="test_case_url"/>
</div>
<div class="col-md-12" style="border: 1px solid #28415b; padding-bottom: 12px; padding-top: 12px;margin-top: 20px; margin-bottom: 15px">
<p>
<INPUT class="btn btn-primary ladda-button" type="button" value="Add row" onclick="addRow('dataTable')" />
<INPUT class="btn btn-primary ladda-button" type="button" value="Delete row" onclick="deleteRow('dataTable')" />
</p>
<div class="clear"></div>
<p>'All fields below are compatible to use markdowns for editing' </p>
<table class="table table-hover">
<thead>
<tr>
<th style="width: 15px">Chk</th>
<th style="width: 335px">Action:</th>
<th style="width: 326px;">Expected System Response:</th>
<th style="width: 151px;">Pass/ Fail</th>
<th>Comment</th>
</tr>
</thead>
</table>
<table id="dataTable" class="table table-hover">
<tbody>
<tr>
<td style="width:20px;"><INPUT type="checkbox" name="chk[]" id="chk"/></td>
<td><INPUT class="form-control" type="text" name="step[]" autocomplete="on" placeholder="Action" required/></td>
<td><INPUT class="form-control" type="text" name="url[]" autocomplete="on" placeholder="Expected Outcome" required/></td>
<td>
<select name="passfail[]" class="form-control" style="width:120px;">
<OPTION value="Pass">....</OPTION>
<OPTION value="Pass">Pass</OPTION>
<OPTION value="Fail">Fail</OPTION>
</select>
</td>
<td>
<TEXTAREA class="form-control" type="text" name="comment[]" rows="2" cols="15" placeholder="Comment" required></TEXTAREA>
</td>
</tr>
</tbody>
</table>
Thats my table that i am dynamically making...
In my PHP file i display the dynamic table as follows:
<table class="table table-bordered">
<thead>
<tr>
<td>Step</td>
<td>process</td>
<td>Expected System Response</td>
<td>
<center>Pass/ Fail</center>
</td>
<td>Comment</td>
</tr>
</thead>
<?php
if (isset($_POST)) {
$step = $_REQUEST['step'];
$url = $_REQUEST['url'];
$pass_fail = $_REQUEST['passfail'];
$comment = $_REQUEST['comment'];
$countPass = 0;
$countFail = 0;
foreach ($step as $key => $row) {
?>
<tbody>
<tr>
<td><?php echo $key + 1; ?></td>
<td><?php echo $step[$key]; ?></td>
<td><?php echo $url[$key]; ?></td>
<td style="color:<?php if ($pass_fail[$key] == 'Fail') {
echo 'color: red';
} else {
echo 'limegreen';
} ?>"><b>
<center><?php echo $pass_fail[$key]; ?></center>
</b></td>
<td><?php echo $comment[$key]; ?>
</td>
</tr>
</tbody>
</table>
Now how do i insert it into mysql???
So basically what you need to do to insert it into your database is doing a sql query in PHP.
Let me show you an code example:
//establish db connection
$con=mysqli_connect("dbhost","username","dbpassword","dbname");
$sql = "INSERT INTO tablename (name_of_row1,
name_of_row2,
name_of_row3)
VALUES ('".$value1."',
'".$value2."',
'".$value3."')";
mysqli_query($con, $sql);
mysqli_close($con);
So you have to open a sql connection and then insert your data to the table you want. I hope this it's clear enough. Now if the PHP file gets called the SQL query is beeing made.
my requirement form link
I have made an html form that displays data from an PHP variable. The Form contains a table and that table has number of rows based on a PHP variable.
but problem is that form is not responsive can you please give some idea how can i made a responsive form with table that will load data from an PHP variable. my current code is below:
<div class="row">
<div class="col-md-8">
<form method="POST" action="/updateInfo" enctype="multipart/form-data" name="InfoForm">
<div style ="width:100%; height:250px;">
<table style = "width:100%;border:2px;height:60%;">
<tr style = "border-bottom: thin solid;background-color:#9a004b;color:White">
<th></th>
<th>Register Date</th>
<th>Reconciliation Date</th>
<th>Amount</th>
<th>IBAN</th>
<th>Withhold</th>
</tr>
<?php foreach($overpayment as $key=>$value){
if(empty($value['ReconciliationDate'])){
?> <tr style="border:1px solid #9a004b;background-color: White">
<div class="row">
<td><input type="hidden" name=OverpaymentNr[] value="<?php echo $value['OverpaymentNr']?>"</td>
<td><label name=Paydate[] value=""/><?php echo $value['RegisterDate']?></td>
<td><label name=ReconciliationDate[] value=""/><?php echo $value['ReconciliationDate']?></td>
<td><label name=Amount[] value=""/><?php echo $value['Amount']?></td>
<td><input type="text" style="width:186px; height:35px;" name=IBAN[] value="<?php echo $value['IBAN']?>"/> </td>
<td><label name=Withhold[] value=""/><?php echo $value['Withhold']?></td>
</div>
</tr>
<?php }
}
?>
<tr style="border-top:1px solid #9a004b;">
<td></td>
<td></td>
<td></td>
<td align="center"><input type="Submit" class="btn btn-danger pull-right" name= Submit value = Submit /> </td>
<td></td>
</tr>
</table>
</div>
</form>
</div>
</div>
I need help with this php code... it doesn't redirect to the specified url
<?php
if(isset($_POST['submit'])){
$to = "email#domain.com"; // this is your Email address
$firstName = $_POST['$inf_tTzSYWEgQfQ4dJf9'];
$lastName = $_POST['lastName'];
$phoneNumber = $_POST['phoneNumber'];
$company = $_POST['company'];
$addressLine1 = $_POST['addressLine1'];
$addressLine2 = $_POST['addressLine2'];
$city = $_POST['city'];
$state = $_POST['state'];
$country = $_POST['country'];
$emailAddress = $_POST['emailAddress'];
$subject = "New Order - " . $firstName . " " . $lastName;
$body = "First Name: $firstName\n Last Name: $lastName\n Phone Number: $phoneNumber\n Company: $company\n Address Line 1: $addressLine1 \n Address Line 2: $addressLine2 \n City: $city\n State: $state\n Country: $country\n Email Address:$emailAddress";
header('Location: http://stackoverflow.com/');
}
?>
here's the HTML form
<form method="post" name="orderForm" id="orderForm" action="ordersubmithandler.php">
<div id="header">
<div class="CUSTOM_HTML">
<div id="customHeader">
</div>
</div>
<div id="IMAGE">
<div id="companyLogoTopBanner">
<img src="orderpage_files/jp126-666e1bad-894a-41bd-9d30-be234e2bf638-v2.png">
</div>
</div>
</div>
<div id="content">
<input id="previewMode" name="previewMode" type="hidden" value="false">
<div id="ORDER_FORM_PRODUCT_LIST">
<table class="viewCart tabular grid">
<tbody>
<tr>
<th class="leftAlign">Products</th>
<th></th>
<th class="rightAlign priceCell">Price</th>
<th class="centerAlign qtyCell">Quantity</th>
<th class="rightAlign priceCell">Total</th>
</tr>
<tr>
<td colspan="2" class="productCell">
<h1>Lorem ip</h1>
<p class="productDescription">Lorem ipLorem ipLorem ipLorem ipLorem ipLorem ipLorem ipLorem ip</p>
<span class="subscriptionPlan">One Time Payment of $80.00</span>
</td>
<td class="rightAlign priceCell">
<span class="price">$80.00</span>
</td>
<td class="centerAlign qtyCell">1 </td>
<td class="rightAlign priceCell">$80.00</td>
</tr>
<tr class="subtotal">
<td class="leftAlign"><span class="totalPrice">Subtotal</span></td>
<td co="" colspan="2"></td>
<td class="qtyCell"></td>
<td class="rightAlign priceCell"><span class="priceBold">$80.00</span></td>
</tr>
</tbody>
</table>
</div>
<div id="CUSTOM_HTML">
<div id="productInformation">
<input name="" type="checkbox" checked="yes" value=""> <font color="black"><b> I understand and agree I will be charged one payment today of $80.00 as FULL payment for the product. </b></font><b> <br> <br>
</b></div>
</div>
<b>
<div id="UP_SELLS">
</div>
<div id="ORDER_FORM_BILLING_ENTRY">
<link href="./orderpage_files/anti_spam.jsp" rel="stylesheet" type="text/css">
<script type="text/javascript">(function() {
var styleArray = ["/css/anti_spam.jsp"];
if (window.Infusion) {
Infusion.stylesLoaded(styleArray);
} else if (window.InfusionStyles) {
window.InfusionStyles.concat(styleArray);
} else {
window.InfusionStyles = styleArray;
}
})();</script>
<div id="orderFormBillingEntry">
<table class="billingTable tabular grid">
<tbody>
<tr>
<th colspan="2" class="leftAlign">Billing Information</th>
</tr>
<tr>
<td class="rightAlignTop"><label class="checkoutLabel">* First Name</label></td>
<td>
<input class="regula-validation checkoutTop" data-constraints="#Required(label="First Name", groups=[customer])" id="firstName" name="firstName" size="10" type="text">
<input class="inf_a2f0ec38ba2014366540402764cde59e" id="inf_tTzSYWEgQfQ4dJf9" name="inf_tTzSYWEgQfQ4dJf9" type="text">
</td>
</tr>
<tr>
<td class="rightAlign"><label class="checkoutLabel">* Last Name</label></td>
<td><input class="regula-validation checkout" data-constraints="#Required(label="Last Name", groups=[customer])" id="lastName" name="lastName" size="12" type="text"></td>
</tr>
<tr>
<td class="rightAlign"><label class="checkoutLabel">Company Name</label></td>
<td><input class="checkout" id="company" name="company" size="25" type="text"></td>
</tr>
<tr>
<td class="rightAlign"><label class="checkoutLabel">* Address - Line 1</label></td>
<td><input class="regula-validation checkout" data-constraints="#Required(label="Address - Line 1", groups=[customer])" id="addressLine1" name="addressLine1" size="25" type="text"></td>
</tr>
<tr>
<td class="rightAlign"><label class="checkoutLabel">Address - Line 2</label></td>
<td><input class="checkout" id="addressLine2" name="addressLine2" size="25" type="text"></td>
</tr>
<tr>
<td class="rightAlign"><label class="checkoutLabel">* City</label></td>
<td><input class="regula-validation checkout" data-constraints="#Required(label="City", groups=[customer])" id="city" name="city" size="15" type="text"></td>
</tr>
<tr>
<td class="rightAlign"><label class="checkoutLabel"><div id="stateRequired">* State</div></label></td>
<td><select class="regula-validation checkout" data-constraints="#StateRequiredForSpecificCountries(countryFieldName="country", label="State", groups=[customer])" id="state" name="state" data-on="Component.Select"><option value="Lagos">Lagos</option></select></td>
</tr>
<tr>
<td class="rightAlign"><label class="checkoutLabel">* Country</label></td>
<td><select class="regula-validation checkout" data-constraints="#Required(label="Billing Country", groups=[customer])" id="country" name="country" data-on="Component.Select"><option value="Nigeria">Nigeria</option></select></td>
</tr>
<tr>
<td class="rightAlign">* Phone Number</td>
<td><input class="regula-validation checkout" data-constraints="#Required(label="Phone Number", groups=[customer])" id="phoneNumber" name="phoneNumber" size="25" type="text"></td>
</tr>
<tr>
<td class="rightAlign">* Email Address</td>
<td><input class="regula-validation checkoutBottom" data-constraints="#Required(label="Email Address", groups=[customer]) #Email(label="Email Address", groups=[customer])" id="emailAddress" name="emailAddress" size="15" type="text"></td>
</tr>
<tr>
<td> </td>
</tr>
</tbody>
</table>
</div>
<script type="text/javascript">jQuery(document).ready(function() {
var $country = jQuery('#country');
if ($country.val() == 'United States' || $country.val() == 'Canada') {
jQuery('#stateRequired').html('* State');
}
if ($country.length > 0 && "SELECT" == $country.get(0).tagName) {
$country.change(function() {
if ($country.val() == 'United States' || $country.val() == 'Canada') {
jQuery('#stateRequired').html('* State');
} else {
jQuery('#stateRequired').html('State');
}
});
}
});
jQuery('#addressLine1, #city, #zipCode, #country, #state').change(function() {
Infusion.Ecomm.OrderForms.submitFormUponChangeOnBilling('orderForm', 'Profit-Academy-2015--Payment-Plan', 'RENDER_ORDER_FORM');
});</script>
</div>
<div id="ORDER_FORM_SHIPPING_ENTRY">
<div id="orderFormShippingEntry">
</div>
</div>
<div id="SHIPPING_OPTIONS">
<div id="shippingOptionsContainer">
</div>
</div>
<div id="PAYMENT_PLANS">
</div>
<div id="ORDER_FORM_SUMMARY">
<table class="orderSummary tabular grid">
<tbody>
<tr>
<th class="leftAlign">Summary Of What You Are Getting</th>
<th class="rightAlign"></th>
</tr>
<tr>
<td colspan="2">
<img src="bonus.png">
</td>
</tr>
<tr>
<th class="leftAlign">Order Summary</th>
<th class="rightAlign"></th>
</tr>
<tr>
<td class="listCell">Subtotal</td>
<td class="rightAlign">$80.00</td>
</tr>
<tr>
<td class="subtotal">Total Due</td>
<td class="rightAlign subtotal">$80.00</td>
</tr>
</tbody>
</table>
</div>
<div id="PAYMENT_SELECTION">
<table class="paymentMethodTable tabular grid">
<tbody>
<tr>
<td>
<button type="submit" style="align-content: center"><img src="bbbbbb.png" alt="a"></button>
</td>
</tr>
</tbody>
</table>
</div>
</b>
</div>
<b>
<br clear="all">
<div id="footer">
<div id="CUSTOM_HTML">
<div id="customFooter">
<!--<center><img src="./orderpage_files/payment-logos.jpg" alt="a"></center> --><br>
<center>
<font color="red">NOTICE: <i></i></font><i><font color="black"><b>Lorem ipsum, Please contact us at: mail#mail.com</b></font></i><b>
<br> <br>
<font color="black"><b>Copyright © . All rights reserved.<br></b></font>
<br>
<br>
<font color="black"><b> NEED HELP? Please contact us at: mail#mail.com </b></font></b>
</center>
<b><font color="black"></font></b>
</div>
<b><font color="black"></font></b>
</div>
<b><font color="black"></font></b>
</div>
<b><font color="black"></font></b>
</b>
</form>
I have tried editing severally but haven't been able to figure out what is wrong with the code.
Need help with this... thanks!
Your help is REALLY REALLY appreciated :)
It may not be working because your button isn't called "submit"
<button type="submit" style="align-content: center">
Try putting name = "submit" in there..
Plus, you could always put some debug in the php code, so it echo'd out what its doing to check values are what you thought.. Also, you set a bunch of variables and do nothing with it - didnt you mean to actually send the email?
$_POST['$inf_tTzSYWEgQfQ4dJf9']; with the $ in the array shouldn't be there, because of it being treated as another variable.
Then your submit button isn't named which is why your code isn't executing inside the first conditional statement.
You need to add the name attribute for it, as in name="submit".
I am creating an application in Html, php with Mysql. On one of my webform I am using Tabs created with Radio buttons as tab heads to select the tab perticular tab. I am facing the issue to insert tab1 values into the database while other 4 tabs fire same query and their data is easily inserted. Its the problem with the 1st Tab only and I realized it when I changed the tabs order. Please help me I want to work with Tabbed pane to provide multiple input forms to the user. Thanks in advance.
Here here is my web form Tab1.php
<form action="" enctype="multipart/form-data" method="post">
<table width="100%" border="0" align="center">
<tr>
<td> Date </td>
<td><input type="DATE" required name="ClaimDate"/></td>
</tr>
<tr>
<td>From</td>
<td><input type="text" maxlength="" required size="20" Placeholder="Source" name="ClaimFrom"></td>
<td align="center">To</td>
<td><input type="text" size="20" maxlength="" required Placeholder="Destination" name="ClaimTo"></td>
</tr>
<tr>
<td>Amount</td>
<td><input type="number" size="5" name="ClaimAmt" required Placeholder="In Rupees" ></td>
<td colspan = 3><input type="file" name="ClaimReceipt"></td>
</tr>
<tr>
<td colspan="6" ><table border="0" Width="30%" height=40px >
<tr>
<td width="20%" ><input type="submit" name="Add" value="Add"></td>
<td width="20%" ><input name="AdBtn3" type="reset" value="clear" width="48" height="40" ></td>
</tr>
</table></td>
</tr>
</table>
</form>
InsertData.php
include('dbcon.php');
$User = 'abc';
$ExCategory = mysql_real_escape_string($_REQUEST['ExCategory']);
$ClaimDate = mysql_real_escape_string($_REQUEST['ClaimDate']);
if(isset($_REQUEST['ClaimFrom']) && isset($_REQUEST['ClaimTo']))
{
$ClaimFrom = mysql_real_escape_string($_REQUEST['ClaimFrom']);
$ClaimTo = mysql_real_escape_string($_REQUEST['ClaimTo']);
}
$ClaimAmt = mysql_real_escape_string($_REQUEST['ClaimAmt']);
$ClaimClass = mysql_real_escape_string($_REQUEST['ClaimClass']);
$ClaimReceipt = $_FILES['ClaimReceipt']['size'];
$ClaimRowid = "";
if (isset($_POST['Add']))
{
mysql_query("INSERT INTO `test`.`tbluserexpenses` VALUES('$User','$ExCategory','$ClaimDate','$ClaimFrom','$ClaimTo','$ClaimAmt','$ClaimClass','$ClaimReceipt','$ClaimRowid');");
}
<div style="position:relative; z-index:1; top:85px; left:390px;"><ul class="tabs">
<li>
<input type="radio" name="tabs" id="tab1" checked />
<label for="tab1">Local</label>
<div id="tab-content1" class="tab-content">
<?php include 'Tab1.php';?>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab2" />
<label for="tab2">Express</label>
<div id="tab-content2" class="tab-content">
<?php include 'Tab2.php';?>
</div>
</li>
This way Tab1.php is attached to my mainform as a tabbed pane.