i have one big form.. there have some so many select option. and its from to mail function. bellow is my code
<label>Type of Event? </label>
<select id="eventtype" title="" name="eventtype" class="required select">
<option value="">Select Your Event Type</option>
<option value="WEDDINGS">WEDDINGS</option>
<option value="CORPORATE">CORPORATE EVENT</option>
<option value="SPECIAL">SPECIAL EVENT</option>
<option value="OTHER">OTHER SINGLE SERVICES</option>
</select>
<div class="cls"></div>
<div class="container">
<div class="WEDDINGS">
<label>Package</label>
<select name="Package" id="Package">
<option value="Day Of Coordination">Day Of Coordination</option>
<option value="Week of Coordination">Week of Coordination</option>
<option value="Month of Coordination">Month of Coordination</option>
</select>
</div>
<div class="CORPORATE">
<label>Package</label>
<select name="Package" id="Package">
<option value="Meetings">Meetings</option>
<option value="Client Appreciation">Client Appreciation</option>
<option value="Conference & Conventions">Conference & Conventions</option>
<option value="Corporate Shows">Corporate Shows</option>
<option value="Employee Appreciation">Employee Appreciation</option>
</select>
</div>
<div class="SPECIAL">
<label>Package</label>
<select name="Package" id="Package">
<option value="Engagements">Engagements</option>
<option value="Bar Mitzvah">Bar Mitzvah</option>
<option value="Quincearas">Quincearas</option>
<option value="Birthdays">Birthdays</option>
<option value="Fashion Shows">Fashion Shows</option>
<option value="Showers">Showers</option>
</select>
</div>
<div class="OTHER">
<label>Package</label>
<select name="Package" id="Package">
<option value="Wedding Consultation and Guidance Only">Wedding Consultation and Guidance Only</option>
<option value="Venue Search Only">Venue Search Only</option>
<option value="Coordination of Engagement Party Only">Coordination of Engagement Party Only</option>
<option value="Providing Qualified and Screened Vendors Only">Providing Qualified and Screened Vendors Only</option>
</select>
js code for realtion with drop down
<script>
$(document).ready(function() {
$('#eventtype').bind('change', function() {
var elements = $('div.container').children().hide();
var value = $(this).val();
if (value.length) {
elements.filter('.' + value).show();
}
}).trigger('change');
});
</script>
my from is like if select WEDDING then show Wedding div so show there another drop down.. and if select CORPORATE EVENT then show CORPORATE EVENT div... but no matter what drop down i select when mail go correct data not pass. its goes always OTHER div 1st select value mean "Wedding Consultation and Guidance Only" ... i have no idea why... may be i mistake something... bellow is part of php mail code
if($violation)
{
$eventtype = $_POST['eventtype'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$datepicker = $_POST['datepicker'];
$datepicker2 = $_POST['datepicker2'];
$time = $_POST['time'];
$EMAIL = $_POST['EMAIL'];
$phone = $_POST['phone'];
$Package = $_POST['Package'];
$otherfound = $_POST['otherfound'];
if (isset($_POST['found_group'])) {
$found = $_POST['found_group'];
for ($i=0; $i<count($found); $i++) {
//echo $found[$i]."<br />";
$found=implode("<br />",$found);
}
}
all i want to correct data will go .. can you tell me where i am mistaking... thanks
you may need to do something like this
<label>Type of Event? </label>
<select id="eventtype" title="" name="eventtype" name="eventtype" class="required select">
<option value="">Select Your Event Type</option>
<option value="WEDDINGS">WEDDINGS</option>
<option value="CORPORATE">CORPORATE EVENT</option>
<option value="SPECIAL">SPECIAL EVENT</option>
<option value="OTHER">OTHER SINGLE SERVICES</option>
</select>
<div class="cls"></div>
<div class="container">
<div class="WEDDINGS">
<label>Package</label>
<select name="WEDDINGSPackage" id="WEDDINGSPackage">
<option value="Day Of Coordination">Day Of Coordination</option>
<option value="Week of Coordination">Week of Coordination</option>
<option value="Month of Coordination">Month of Coordination</option>
</select>
</div>
<div class="CORPORATE">
<label>Package</label>
<select name="CORPORATEPackage" id="CORPORATEPackage">
<option value="Meetings">Meetings</option>
<option value="Client Appreciation">Client Appreciation</option>
<option value="Conference & Conventions">Conference & Conventions</option>
<option value="Corporate Shows">Corporate Shows</option>
<option value="Employee Appreciation">Employee Appreciation</option>
</select>
</div>
.......
and at PHP end you have to do something like this
if (isset($_POST['eventtype'])) {
$subOptSelect = $_POST['eventtype'] . 'Package';
if (isset($_POST[$subOptSelect])){
$sub = $_POST[$subOptSelect];
}
}
I have prefixed the value of the first select to the sub selects and it becomes easier at php end.
Edit: Here is the code you may require.
$package='';
if (!empty($eventtype)) {
if (!empty($_POST[$eventtype.'Package'])){
$package = $_POST[$eventtype.'Package'];
//$package contains the option selected in the sub option.
}else{
//nothing selected in the sub dropdown. you have to add code to handle this
}
}else{
//nothing selected in the first dropdown. you have to add code to handle this
}
And your email can be:
<table width='95%' cellpadding='0' cellspacing='11'>
<tr>
<td width='189'>Event Type :</td>
<td>$eventtype</td>
</tr>
<tr>
<td>Package :</td><td>$package</td>
</tr>
<tr>
<td>First Name :</td><td>$firstname</td>
</tr>
<tr>
You can't reuse the name attribute in html, and you're html form has the same name for each select tag. What is happening is the markup is processed sequentially so it only uses the last declaration of the name="Package" select so the selected value from that will always be passed to the server as the $_POST['package']. Do something like this instead:
<label>Type of Event? </label>
<select id="eventtype" title="" name="eventtype" class="required select">
<option value="">Select Your Event Type</option>
<option value="WEDDINGS">WEDDINGS</option>
<option value="CORPORATE">CORPORATE EVENT</option>
<option value="SPECIAL">SPECIAL EVENT</option>
<option value="OTHER">OTHER SINGLE SERVICES</option>
</select>
<div class="cls"></div>
<div class="container">
<div class="WEDDINGS">
<label>Package</label>
<select name="Weddings-Package" id="Weddings-Package">
<option value="Day Of Coordination">Day Of Coordination</option>
<option value="Week of Coordination">Week of Coordination</option>
<option value="Month of Coordination">Month of Coordination</option>
</select>
</div>
<div class="CORPORATE">
<label>Package</label>
<select name="Corporate-Package" id="Corporate-Package">
<option value="Meetings">Meetings</option>
<option value="Client Appreciation">Client Appreciation</option>
<option value="Conference & Conventions">Conference & Conventions</option>
<option value="Corporate Shows">Corporate Shows</option>
<option value="Employee Appreciation">Employee Appreciation</option>
</select>
</div>
<div class="SPECIAL">
<label>Package</label>
<select name="Special-Package" id="Special-Package">
<option value="Engagements">Engagements</option>
<option value="Bar Mitzvah">Bar Mitzvah</option>
<option value="Quincearas">Quincearas</option>
<option value="Birthdays">Birthdays</option>
<option value="Fashion Shows">Fashion Shows</option>
<option value="Showers">Showers</option>
</select>
</div>
<div class="OTHER">
<label>Package</label>
<select name="Other-Package" id="Other-Package">
<option value="Wedding Consultation and Guidance Only">Wedding Consultation and Guidance Only</option>
<option value="Venue Search Only">Venue Search Only</option>
<option value="Coordination of Engagement Party Only">Coordination of Engagement Party Only</option>
<option value="Providing Qualified and Screened Vendors Only">Providing Qualified and Screened Vendors Only</option>
</select>
when the post data is sent to the server it is sent in the $_POST variable as an associative array with the names as the key, if you make the name of each select unique then you should be able to achieve what you want. You might want to pass the name of which select was used to the server so you know which variable to grab in php. As another note the id value for every tag should be unique, as that is the purpose of an id attribute.
Related
User already choose the option value and the data will entered database. I wanted to display back the data choose by user in option ways so when they wanted to edit just click on the option value.
`
<div class="row">
<div class="col-25">
<label for="sector">1. Type of Sectors</label>
</div>
<div class="col-75">
<select id="sector" name="sector" required>
<option value ="choose">Choose type of sector...</option>
<option value="National DefenceSecurity">National Defence and Security</option>
<option value="banking & Finance">Banking and Finance</option>
<option value="Information & Communication">Infomation and Communication</option>
<option value="Energy">Energy</option>
<option value="Transportation">Transportation</option>
<option value="Water">Water</option>
<option value="Health services">Health Services</option>
<option value="Government">Government</option>
<option value="Emergency Services">EmergencyServices</option>
<option value="Agriculture&food">Agriculture and Food</option>
<option value="Other">Other</option>
</select>
`
what should I change on this code ? or have to add other code to insert the function.
should be display the user option before want to exchange the data/Update
At the time of update you come with a previously selected value
like your previously selected value stored in a variable $slctr
you have to check all the option one by one with $slctr variable if value match any option make it select.
Then your edit code will be like.
<div class="row">
<div class="col-25">
<label for="sector">1. Type of Sectors</label>
</div>
<div class="col-75">
<select id="sector" name="sector" required>
<option value ="choose" <?= $slctr=="choose"?"selected":"" ?> >Choose type of sector...</option>
<option value="National DefenceSecurity" <?= $slctr=="National DefenceSecurity"?"selected":"" ?> >National Defence and Security</option>
<option value="banking & Finance" <?= $slctr=="banking & Finance"?"selected":"" ?>>Banking and Finance</option>
<option value="Information & Communication" <?= $slctr=="Information & Communication"?"selected":"" ?>>Infomation and Communication</option>
<option value="Energy" <?= $slctr=="Energy"?"selected":"" ?>>Energy</option>
<option value="Transportation" <?= $slctr=="Transportation"?"selected":"" ?>>Transportation</option>
<option value="Water" <?= $slctr=="Water"?"selected":"" ?>>Water</option>
<option value="Health services" <?= $slctr=="Health services"?"selected":"" ?>>Health Services</option>
<option value="Government" <?= $slctr=="Government"?"selected":"" ?>>Government</option>
<option value="Emergency Services" <?= $slctr=="Emergency Services"?"selected":"" ?>>EmergencyServices</option>
<option value="Agriculture&food" <?= $slctr=="Agriculture&food"?"selected":"" ?>>Agriculture and Food</option>
<option value="Other" <?= $slctr=="Other"?"selected":"" ?>>Other</option>
</select>
</div>
</div>
You can done it by using jquery also
var response = {};
response.val = "Energy";
$("#sector option[value='" + response.val +"']").attr("selected", "selected");
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select id="sector" name="sector" required>
<option value ="choose">Choose type of sector...</option>
<option value="National DefenceSecurity">National Defence and Security</option>
<option value="banking & Finance">Banking and Finance</option>
<option value="Information & Communication">Infomation and Communication</option>
<option value="Energy">Energy</option>
<option value="Transportation">Transportation</option>
<option value="Water">Water</option>
<option value="Health services">Health Services</option>
<option value="Government">Government</option>
<option value="Emergency Services">EmergencyServices</option>
<option value="Agriculture&food">Agriculture and Food</option>
<option value="Other">Other</option>
</select>
I wonder if anyone can help my problem, in which way I can get value from combobox selection into next url by clicking so I can make it as a parameter to the pdf report.
this is my code to add some combobox :
<form method="GET">
<label class="col-sm-3 control-label">Bulan</label>
<div class="col-sm-2">
<select name="bln" class="form-control">
<option value="1">Januari</option>
<option value="2">Februari</option>
<option value="3">Maret</option>
<option value="4">April</option>
<option value="5">Mei</option>
<option value="6">Juni</option>
<option value="7">Juli</option>
<option value="8">Agustus</option>
<option value="9">September</option>
<option value="10">Oktober</option>
<option value="11">November</option>
<option value="12">Desember</option>
</select>
</div>
<br>
<br>
<label class="col-sm-3 control-label">Tahun</label>
<div class="col-sm-2">
<select name="thn" class="form-control">
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
<option value="2021">2021</option>
<option value="2022">2022</option>
<option value="2023">2023</option>
<option value="2024">2024</option>
<option value="2025">2025</option>
</select>
</div>
</form>
<?php
if (isset($_GET['bln'])) {
$bln = $_GET['bln'];
$thn = $_GET['thn'];
}
?>
<a class="btn btn-success" href="rep-cuti-tahunan-all.php?bln="$bln"&thn="$thn"">Print</a>
so I would like to put $bln and $thn into <a class="btn btn-success" href="rep-cuti-tahunan-all.php?bln="$bln"&thn="$thn"">Print</a>
and get my report in pdf exactly according to that parameters
any suggestions?
You don't have to add it as a parameter.Just change your form like this.
<form method="GET" action ="rep-cuti-tahunan-all.php">
....
</form>
then on your php file, you fetch the selected value.
<?php
....
if (isset($_GET['bln'])) {
$bln = $_GET['bln'];
$thn = $_GET['thn'];
}
....
//Do your print method ...
?>
I am currently working on a project where a user can review a product then when they "Submit", the UserID & PreferenceID are picked up from the DB & passed into another table in the DB using php/mysql.
The UserID is displayed when they are logged in.
Here is some of the code:
$user_id = $_GET['CustomerID'];
$DissCustPref_PrefID = $_GET['DissCustPref_PrefID'];
$Cigar_CigarID = $_GET['Cigar_CigarID'];
$SmokingTime = $_GET['SmokingTime'];
$CigarFlavour = $_GET['CigarFlavour'];
$FlavourStrength = $_GET['FlavourStrength'];
$Body = $_GET['Body'];
$AfterTaste = $_GET['AfterTaste'];
$Age = $_GET['Age'];
$ValueForMoney = $_GET['ValueForMoney'];
$OverallRating = $_GET['OverallRating'];
$user_id = $row->CustomerID;
print "<br>User ID: ";
echo($user_id);
$query = "INSERT INTO DissReview values
('null','.$user_id','.$DissCustPref_PrefID','$Cigar_CigarID',
'$SmokingTime','$CigarFlavour','$FlavourStrength','$Body',
'$AfterTaste','$Age','$ValueForMoney','$OverallRating')";
At the moment the URL looks like: http://www.somewebsite/foldername/Login/PreviousReviews.php?CustomerID=%24user_id&CustPref_PrefID=%24PrefID&CigarID=2&SmokingTime=2&CigarFlavour=6&FlavourStrength=5&Body=4&AfterTaste=2&Age=2&ValueForMoney=2&OverallRating=4
as you can see it is not getting the userID or the Preference ID.
It should look like CustomerID=1.... and so on.
I have tried using '".UserID."' but this does not work.
Any suggetions?
EDIT ------ Here is the form used to send the data:
Please add your review of the cigar here!
CIGAR
<textarea style="display:none;"></textarea>
<!--This is the rating for the amount of time it took to smoke.-->
<p> Units below are represented in minutes.</p>
<select name="SmokingTime">
<option value="0"> Please Select an Option</option>
<option value="1">15</option>
<option value="2">30</option>
<option value="3">45</option>
<option value="4">60</option>
<option value="5">61+</option>
</select>
<div id="FChart" class="FChart">
<p> <img src="cigar-flavors-wheel.png" alt="Cigar Flavour Wheel" style="width:500px;height:500px;"></p>
</div>
<!--This is the rating for how the cigar tastes.-->
<p> Please select what the cigar tastes like.</p>
<select name="CigarFlavour">
<option value="0"> Please Select an Option</option>
<option value="1">Flowers</option>
<option value="2">Plants</option>
<option value="3">Herbs and Spices</option>
<option value="4">Earths and Minerals</option>
<option value="5">Fruit</option>
<option value="6">Nuts</option>
<option value="7">Chocolate</option>
<option value="8">Coffee</option>
<option value="9">Cream</option>
<option value="10">Leather</option>
</select>
<!--This is the rating for the strength of the flavour.-->
<p> Please select how strong the taste is.</p>
<select name="FlavourStrength">
<option value="0"> Please Select an Option</option>
<option value="1">Very Weak</option>
<option value="2">Weak</option>
<option value="3">Mild</option>
<option value="4">Strong</option>
<option value="5">Very Strong</option>
</select>
<!--This is the rating for how the cigar is: Medium body for example.-->
<p> Please Select the body of the cigar.</p>
<select name="Body">
<option value="0"> Please Select an Option</option>
<option value="1">Mild</option>
<option value="2">Medium</option>
<option value="3">Medium Full</option>
<option value="4">Full</option>
</select>
<!--This is the rating for the strength of the after taste.-->
<p> Please Describe the Strength of the After taste.</p>
<select name="AfterTaste">
<option value="0"> Please Select an Option</option>
<option value="1">Very Weak</option>
<option value="2">Weak</option>
<option value="3">Mild</option>
<option value="4">Strong</option>
<option value="5">Very Strong</option>
</select>
<!--This is the rating for the age of the cigar.-->
<p> Please select a rough age of the cigar.</p>
<select name="Age">
<option value="0"> Please Select an Option</option>
<option value="1">6 Months</option>
<option value="2">1 Year</option>
<option value="3">2 Years</option>
<option value="4">3 Years</option>
<option value="5">4 years</option>
<option value="6">4+ years</option>
</select>
<!--This is the rating for the value for money.-->
<p> Please Describe the value for money aspect.</p>
<select name="ValueForMoney">
<option value="0"> Please Select an Option</option>
<option value="1">Very Poor</option>
<option value="2">Poor</option>
<option value="3">Reasonable</option>
<option value="4">Good</option>
<option value="5">Very Good</option>
</select>
<!--This is the overall rating of the cigar.-->
<p> Please select an overall rating of the cigar.</p>
<select name="OverallRating">
<option value="0"> Please Select an Option</option>
<option value="1">Very Poor</option>
<option value="2">Poor</option>
<option value="3">Reasonable</option>
<option value="4">Good</option>
<option value="5">Very Good</option>
</select>
">
I am echoing the $UserID as debugging to see if it is picking it up.
It just show the $user_id
because you have this code :
echo($user_id);
And you should have some controls on user inputs ! hackers can easily do some Sql injections.
for example use :
mysqli_real_escape_string($input);
I'm creating a system which provide a report generator, now my problem is i dont know how to call data with the variables that i want. For example I only want the data from January // 2014 // from the account department and so on. Now, i don't know what code to show but below is the menu where user select their variables
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
function showForm() {
var selopt = document.getElementById("opts").value;
if (selopt == "Tenaga Nasional Berhad") {
document.getElementById("f1").style.display = "block";
document.getElementById("f2").style.display = "none";
}
if (selopt == "Telekom Malaysia") {
document.getElementById("f2").style.display = "block";
document.getElementById("f1").style.display = "none";
}
if (selopt == 0) {
document.getElementById("f2").style.display = "none";
document.getElementById("f1").style.display = "none";
}
}
</script>
<div id="contact_form">
<h4>Pilih Ketetapan Laporan</h4>
<form method="post" name="pilih_kategori_daftar">
<label for="daerah">Daerah:</label>
<select class="required input_field" name="daerah" id="daerah" required/>
<option value="">--Pilih Daerah--</option>
<option value="Kuantan">Kuantan</option>
<option value="Maran">Maran</option>
<option value="Bentong">Bentong</option>
<option value="Raub">Lipis</option>
<option value="Jerantut">Jerantut</option>
<option value="Cameron Highlands">Cameron Highlands</option>
<option value="P.Tenggara">Pahang Tenggara</option>
<option value="Pekan">Pekan</option>
<option value="Rompin">Rompin</option>
<option value="Temerloh">Temerloh</option>
<option value="Bera">Bera</option>
<option value="Ibu Pejabat">Ibu Pejabat</option>
</select>
<div class="cleaner_h10"></div>
<label for="bulan_bill">Bulan</label>
<select class="required bill_caj" name="bulan_bill" id="bulan_bill" width="300px" required/>
<option value="">--Pilih Bulan--</option>
<option value="Januari">Januari</option>
<option value="Februari">Februari</option>
<option value="Mac">Mac</option>
<option value="April">April</option>
<option value="Mei">Mei</option>
<option value="Jun">Jun</option>
<option value="Julai">Julai</option>
<option value="Ogos">Ogos</option>
<option value="September">September</option>
<option value="Oktober">Oktober</option>
<option value="November">November</option>
<option value="Disember">Disember</option>
</select>
<div class="cleaner_h10"></div>
<label for="tahun_bill">Tahun</label>
<input type="text" maxlength="4" size="4" id="tahun_bill" name="tahun_bill" class="required year_field" placeholder="Tahun" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" required/>
<div class="cleaner_h10"></div>
<label for="kategori_akaun">Kategori</label>
<select id="opts" onchange="showForm()" class="input_field" required>
<option value="0">--Pilih Kategori--</option>
<option value="Tenaga Nasional Berhad">Akaun TNB</option>
<option value="Telekom Malaysia">Akaun TM</option>
</select>
<div class="cleaner_h10"></div>
<div id="f1" style="display:none">
<form name="akaun_tnb">
<label for="jenis">Jenis Akaun</label>
<select id="opts" onchange="showForm()"class="input_field">
<option value="0">--Pilih Jenis Akaun--</option>
<option value="Rumah Pam">Rumah Pam</option>
<option value="Loji Air">Loji Air</option>
<option value="Stor">Stor</option>
</select>
</form>
</div>
<div id="f2" style="display:none">
<form name="akaun_tm">
<label for="jenis">Jenis Akaun</label>
<select id="opts" onchange="showForm()"class="input_field">
<option value="0">--Pilih Jenis Akaun--</option>
<option value="Telefon">Telefon</option>
<option value="Telefon/Streamyx">Telefon/Streamyx</option>
<option value="Streamyx">Streamyx</option>
<option value="SMS Blast">SMS Blast</option>
<option value="TM NET">TM NET</option>
</select>
</form>
</div>
</form>
</div>
search in google:
1, How to create mysqli database, tables, columns.
2, PHP, how to connect, extract, insert data from mysqli using php,
3. How to echo mysqli data into html, 4. how to submit form to php and insert data to mysqli, 5. Learn to use AJAX & JSON...this you may leave for few months:)
Im trying to get form post values and if they match certain criteria redirect only my page doesnt seem to...
I have a form with multiple input fields
HTML
<form method="post" action="?page_id=151">
<div style="display: block;" id="Q1">
<label for="vehicleType">1. What type of vehicles do you have?</label>
<select id="vehicleType" name="vehicleType">
<option selected="selected" value="choose">Please choose</option>
<option value="hgv">HGV</option>
<option value="psv">PSV</option>
<option value="lgv">LGV</option>
<option value="car">Car</option>
<option value="mixed">Mixed Fleet</option>
</select>
</div>
<div id="Q2group1">
<label for="coverageRegion">2. Do you require national or international coverage?</label>
<select id="coverageRegion" name="coverageRegion">
<option selected="selected" value="choose">Please choose</option>
<option value="national">National</option>
<option value="international">International</option>
</select>
</div>
<div id="Q2others">
<label for="pricing">2. Do you prefer a fixed weekly price or a pump-related price?</label>
<select id="pricing" name="pricing">
<option selected="selected" value="choose">Please choose</option>
<option value="fixed">Weekly fixed price</option>
<option value="pump">Pump-related price</option>
</select>
</div>
<div id="Q3group1">
<label for="locationType">3. What type of site do you prefer?</label>
<select id="locationType" name="locationType">
<option selected="selected" value="choose">Please choose</option>
<option value="truckstops">Truck stops at lowest price</option>
<option value="motorway">Branded motorway sites</option>
</select>
</div>
<div id="Q3others">
<label for="siteCoverage">3. What site coverage do you need?</label>
<select id="siteCoverage" name="siteCoverage">
<option value="choose">Please choose</option>
<option value="countysites">County</option>
<option value="nationalsites">National</option>
</select>
</div>
<div id="Q4others">
<label for="county">4. Select your county:</label>
<select id="county" name="county">
<option value="choose">Please choose</option>
<optgroup label="England">
<option>Bedfordshire</option>
<option>Berkshire</option>
<option>Bristol</option>
<option>Tyrone</option>
</optgroup>
</select></div>
<div id="searchbuttondiv"> <input type="submit" id="searchbutton" onclick="_gaq.push(['_trackEvent', 'Fuel Card Search', 'Homepage Select Criteria'])"> </div>
</form>
PHP
if ($_POST['vehicleType'] == 'car' && $_POST['pricing'] == 'fixed' && $_POST['coverageRegion'] == 'national') {
echo '<script>alert("hi");</script>';
// header('Location: /car-weekly-national/');
}
One of your conditions is falling (and because they are all bound by AND, all of the if statement fails.
Have an else statement where you var_dump all relevant variables and see what's wrong.
Sorry everyone, oversight by me, I was checking to see if the wrong variable had been posted, wouldn't have found it if it wasn't for the suggestions to add an else statement, thanks!