can someone please tell me how to modify this code so that instead of it it adding a new field to the observation table i would like it to update the table instead where the username is equal to :user and the child_ID is equal to :child_id
<?php
//load and connect to MySQL database stuff
require("config.inc.php");
if (!empty($_POST)) {
//initial query
$query = "INSERT INTO observation ( username, elg1, elg2, elg3, elg4, elg5,elg6, elg7, elg8, elg9, elg10, elg11, elg12, elg13, elg14, elg15, elg16, elg17, col1, col2, col3, child_id ) VALUES ( :user, :elg1, :elg2, :elg3, :elg4, :elg5, :elg6, :elg7, :elg8, :elg9, :elg10, :elg11, :elg12, :elg13, :elg14, :elg15, :elg16, :elg17, :col1, :col2, :col3, :child_id )";
//Update query
$query_params = array(
':user' => $_POST['username'],
':elg1' => $_POST['elg1'],
':elg2' => $_POST['elg2'],
':elg3' => $_POST['elg3'],
':elg4' => $_POST['elg4'],
':elg5' => $_POST['elg5'],
':elg6' => $_POST['elg6'],
':elg7' => $_POST['elg7'],
':elg8' => $_POST['elg8'],
':elg9' => $_POST['elg9'],
':elg10' => $_POST['elg10'],
':elg11' => $_POST['elg11'],
':elg12' => $_POST['elg12'],
':elg13' => $_POST['elg13'],
':elg14' => $_POST['elg14'],
':elg15' => $_POST['elg15'],
':elg16' => $_POST['elg16'],
':elg17' => $_POST['elg17'],
':col1' => $_POST['col1'],
':col2' => $_POST['col2'],
':col3' => $_POST['col3'],
':child_id' => $_POST['child_id']
);
//execute query
try {
$stmt = $db->prepare($query);
$result = $stmt->execute($query_params);
}
catch (PDOException $ex) {
// For testing, you could use a die and message.
//die("Failed to run query: " . $ex->getMessage());
//or just use this use this one:
$response["success"] = 0;
$response["message"] = "Database Error. Couldn't add post!" . $ex->getMessage();
die(json_encode($response));
}
$response["success"] = 1;
$response["message"] = "Post Successfully Added!";
echo json_encode($response);
} else {
?>
<h1>Add Comment</h1>
<form action="elg.php" method="post">
Username:<br />
<input type="text" name="username" placeholder="username" />
<br /><br />
elg1:<br />
<input type="text" name="elg1" placeholder="elg1" />
<br /><br />
elg2:<br />
<input type="text" name="elg2" placeholder="elg2" />
<br /><br />
elg3:<br />
<input type="text" name="elg3" placeholder="elg3" />
<br /><br />
elg4:<br />
<input type="text" name="elg4" placeholder="elg4" />
<br /><br />
elg5:<br />
<input type="text" name="elg5" placeholder="elg5" />
<br /><br />
elg6:<br />
<input type="text" name="elg6" placeholder="elg6" />
<br /><br />
elg7:<br />
<input type="text" name="elg7" placeholder="elg7" />
<br /><br />
elg8:<br />
<input type="text" name="elg8" placeholder="elg8" />
<br /><br />
elg9:<br />
<input type="text" name="elg9" placeholder="elg9" />
<br /><br />
elg10:<br />
<input type="text" name="elg10" placeholder="elg10" />
<br /><br />
elg11:<br />
<input type="text" name="elg11" placeholder="elg11" />
<br /><br />
elg12:<br />
<input type="text" name="elg12" placeholder="elg12" />
<br /><br />
elg13:<br />
<input type="text" name="elg13" placeholder="elg13" />
<br /><br />
elg14:<br />
<input type="text" name="elg14" placeholder="elg14" />
<br /><br />
elg15:<br />
<input type="text" name="elg15" placeholder="elg15" />
<br /><br />
elg16:<br />
<input type="text" name="elg16" placeholder="elg16" />
<br /><br />
elg17:<br />
<input type="text" name="elg17" placeholder="elg17" />
<br /><br />
col1:<br />
<input type="text" name="col1" placeholder="col1" />
<br /><br />
col2:<br />
<input type="text" name="col2" placeholder="col2" />
<br /><br />
col3:<br />
<input type="text" name="col3" placeholder="col3" />
<br /><br />
child_id:<br />
<input type="text" name="child_id" placeholder="child_id" />
<br /><br />
<input type="submit" value="Add Comment" />
</form>
<?php
}
?>
You can essentially use the same statement. But update the syntax to an UPDATE statement.
$query = "UPDATE observation SET elg1=:elg1,elg2=:elg2,[etc]
where child_id=:child_id and user=:user";
Try this:
<?php
//load and connect to MySQL database stuff
require("config.inc.php");
if (!empty($_POST)) {
//initial query
$query = "UPDATE observation SET elg1 = :elg1, elg2 = :elg2, elg3 = :elg3, elg4 = :elg4, elg5 = :elg5, elg6 = :elg6, elg7 = :elg7, elg8 = :elg8, elg9 = :elg9, elg10 = :elg10, elg11 = :elg11, elg12 = :elg12, elg13 = :elg13, elg14 = :elg14, elg15 = :elg15, elg16 = :elg16, elg17 = :elg17, col1 = :col1, col2 = :col2, col3 = :col3 WHERE username = :user AND child_id = :child_id";
//Update query
$query_params = array(
':user' => $_POST['username'],
':elg1' => $_POST['elg1'],
':elg2' => $_POST['elg2'],
':elg3' => $_POST['elg3'],
':elg4' => $_POST['elg4'],
':elg5' => $_POST['elg5'],
':elg6' => $_POST['elg6'],
':elg7' => $_POST['elg7'],
':elg8' => $_POST['elg8'],
':elg9' => $_POST['elg9'],
':elg10' => $_POST['elg10'],
':elg11' => $_POST['elg11'],
':elg12' => $_POST['elg12'],
':elg13' => $_POST['elg13'],
':elg14' => $_POST['elg14'],
':elg15' => $_POST['elg15'],
':elg16' => $_POST['elg16'],
':elg17' => $_POST['elg17'],
':col1' => $_POST['col1'],
':col2' => $_POST['col2'],
':col3' => $_POST['col3'],
':child_id' => $_POST['child_id']
);
//execute query
try {
$stmt = $db->prepare($query);
$result = $stmt->execute($query_params);
}
catch (PDOException $ex) {
// For testing, you could use a die and message.
//die("Failed to run query: " . $ex->getMessage());
//or just use this use this one:
$response["success"] = 0;
$response["message"] = "Database Error. Couldn't add post!" . $ex->getMessage();
die(json_encode($response));
}
$response["success"] = 1;
$response["message"] = "Post Successfully Added!";
echo json_encode($response);
} else {
?>
<h1>Add Comment</h1>
<form action="elg.php" method="post">
Username:<br />
<input type="text" name="username" placeholder="username" />
<br /><br />
elg1:<br />
<input type="text" name="elg1" placeholder="elg1" />
<br /><br />
elg2:<br />
<input type="text" name="elg2" placeholder="elg2" />
<br /><br />
elg3:<br />
<input type="text" name="elg3" placeholder="elg3" />
<br /><br />
elg4:<br />
<input type="text" name="elg4" placeholder="elg4" />
<br /><br />
elg5:<br />
<input type="text" name="elg5" placeholder="elg5" />
<br /><br />
elg6:<br />
<input type="text" name="elg6" placeholder="elg6" />
<br /><br />
elg7:<br />
<input type="text" name="elg7" placeholder="elg7" />
<br /><br />
elg8:<br />
<input type="text" name="elg8" placeholder="elg8" />
<br /><br />
elg9:<br />
<input type="text" name="elg9" placeholder="elg9" />
<br /><br />
elg10:<br />
<input type="text" name="elg10" placeholder="elg10" />
<br /><br />
elg11:<br />
<input type="text" name="elg11" placeholder="elg11" />
<br /><br />
elg12:<br />
<input type="text" name="elg12" placeholder="elg12" />
<br /><br />
elg13:<br />
<input type="text" name="elg13" placeholder="elg13" />
<br /><br />
elg14:<br />
<input type="text" name="elg14" placeholder="elg14" />
<br /><br />
elg15:<br />
<input type="text" name="elg15" placeholder="elg15" />
<br /><br />
elg16:<br />
<input type="text" name="elg16" placeholder="elg16" />
<br /><br />
elg17:<br />
<input type="text" name="elg17" placeholder="elg17" />
<br /><br />
col1:<br />
<input type="text" name="col1" placeholder="col1" />
<br /><br />
col2:<br />
<input type="text" name="col2" placeholder="col2" />
<br /><br />
col3:<br />
<input type="text" name="col3" placeholder="col3" />
<br /><br />
child_id:<br />
<input type="text" name="child_id" placeholder="child_id" />
<br /><br />
<input type="submit" value="Add Comment" />
</form>
<?php
}
?>
Related
I am trying to remove the last two commmas of an array using the trim function but can't get it to work....Is my syntax correct?
I have tried to use the trim function after imploding the array into a string
if(isset($_POST['doctors'])) {
$doctors = $_POST['doctors'];
$doctors = implode(', ', $doctors);
$doctors = strip_tags($doctors);
$doctors = trim($doctors);
} else {
$doctors = 'Not Supplied';
}
I also used rtrim but still can't remove the last commas... I will also include my form html, just in case I did something wrong there:
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="medical_form">
<div class="medical_form_title">
<h2>Submit a Review of a Medical Clinic</h2>
</div>
<form class="medical_form" action="medical_review_process.php" method="POST">
<br />
<label>Name of Medical Clinic:</label>
<br />
<br />
<input type="text" name="clinic_name" >
<br />
<br />
<label>Address of the Clinic:</label>
<br />
<br />
<input type="text" name="clinic_address" >
<br />
<br />
<label>Phone number of the Clinic:</label>
<br />
<br />
<input type="text" name="clinic_number" >
<br />
<br />
<label>Are you a healthcare professional or a patient?</label>
<br />
<br />
<input type="radio" name="type_of_profession" value="healthcare">Healthcare
<br />
<br />
<input type="radio" name="type_of_profession" value="patient">Patient
<br />
<br />
<label>Which of the following services does your clinic provide?</label>
<br />
<br />
<input type="checkbox" name="services[]" value="skin_cancer">Skin cancer check-ups<br />
<input type="checkbox" name="services[]" value="pregnancy">Pregnancy/antenatal check-ups<br>
<input type="checkbox" name="services[]" value="pap_smears">Pap smears<br>
<input type="checkbox" name="services[]" value="immunisations">Immunisations<br>
<input type="checkbox" name="services[]" value="ear_syringe">Ear syringe<br>
<input type="checkbox" name="services[]" value="ear_irrigation">Ear irrigation<br>
<input type="checkbox" name="services[]" value="ear_suctioning">Ear suctioning<br>
<input type="checkbox" name="services[]" value="eye_check-ups">Eye check-ups<br>
<input type="checkbox" name="services[]" value="blood test">Blood test<br>
<br />
<br />
<label>Other Services:</label>
<br />
<br />
<input type="text" name="others" >
<br />
<br />
<label>Recommended Doctors:</label>
<br />
<br />
<input type="text" name="doctors[]" >
<br />
<br />
<label>Recommended Doctors(2):</label>
<br />
<br />
<input type="text" name="doctors[]" >
<br />
<br />
<label>Recommended Doctors(3):</label>
<br />
<br />
<input type="text" name="doctors[]" >
<br />
<br />
<label>Upload pictures here to support information</label>
<br />
<br />
<input type="text" name="pictures" >
<br />
<br />
<button type="submit" name="submit">Register</button>
</form>
</div>
</body>
</html>
I have 3 doctors input but users can only type just one and if they typed just one doctor, I would like to remove the last two commas:
I still have the following image:
There are two possibilities as far as I can see.
trim() only removes spaces, so to trim commas as well you need to add what characters it should trim (commas and spaces in this example)...
$doctors = trim($doctors, ", ");
Or you could remove empty entries from the array before implodeing it using array_filter()...
$doctors = array_filter($_POST['doctors']);
You can try it
rtrim(',',$doctors);
I have been having problems with the second button not running like the first button. this is the code I have:
<p>
<form method="POST">
<input placeholder="Username" type="text" name="username"><br /><br />
<input placeholder="password" type="password" name="password"><br /><br />
<input value="Login" type="submit" name="log_In">
</form>
</p>
</div>
<?php
if(isset($_POST['log_In'])) {
#$f_name = $_POST['fname'];
#$s_name = $_POST['sname'];
#$stud_Id = $_POST['studId'];
#$uname = $_POST['uname'];
#$pass = $_POST['pass'];
#$rpass = $_POST['rpass'];
#$email = $_POST['email'];
#$remail = $_POST['remail'];
#var_dump($f_name);
header("Location:home.php");
}
?>
</div>
<div align="right">
<div>
<p>
<h2>Sign Up</h2>
</p>
<p>
<form>
<input placeholder="Forename" type="text" name="fname" id="Forename"><br /><br />
<input placeholder="Surname" type="text" name="sname"><br /><br />
<input placeholder="Student Id" type="text" name="studId"><br /><br />
<input placeholder="Username" type="text" name="uname"><br /><br />
<input placeholder="password" type="password" name="pass" min="6" max="32"><br /><br />
<input placeholder="Re-type password" type="password" name="rpass" min="6" max="32"><br /><br />
<input placeholder="Email" type="" name="email"><br /><br />
<input placeholder="Re-type Email" type="remail" name="remail"><br /><br />
<input value="Sign Up" type="submit" name="sign_Up">
</form>
</p>
</div>
<?php
if(isset($_POST['sign_Up'])) {
header("Location:home.php");
}
?>
</div>
"if(isset($_POST['sign_up'])) {" is not being run and is just refreshing the page and removing all items from the form.
thanks
By default <form> method is GET. So if(isset($_POST['sign_Up'])) won't work. Change it to if(isset($_GET['sign_Up'])).
Or change your second form tag to:
<form method="POST">
Remember not to use header function after generating HTML content, move it to top!
header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP.
So it will be better if it is like this:
<?php
if(isset($_POST['log_In']) || isset($_POST['sign_Up'])) {
header("Location:home.php");
}
?>
<form method="POST">
<input placeholder="Username" type="text" name="username">
<br />
<br />
<input placeholder="password" type="password" name="password">
<br />
<br />
<input value="Login" type="submit" name="log_In">
</form>
<div align="right">
<div>
<p>
<h2>Sign Up</h2>
</p>
<p>
<form method="post">
<input placeholder="Forename" type="text" name="fname" id="Forename">
<br />
<br />
<input placeholder="Surname" type="text" name="sname">
<br />
<br />
<input placeholder="Student Id" type="text" name="studId">
<br />
<br />
<input placeholder="Username" type="text" name="uname">
<br />
<br />
<input placeholder="password" type="password" name="pass" min="6" max="32">
<br />
<br />
<input placeholder="Re-type password" type="password" name="rpass" min="6" max="32">
<br />
<br />
<input placeholder="Email" type="" name="email">
<br />
<br />
<input placeholder="Re-type Email" type="remail" name="remail">
<br />
<br />
<input value="Sign Up" type="submit" name="sign_Up">
</form>
</p>
</div>
</div>
You forgot to add method="post"
<form method="post">
<input placeholder="Forename" type="text" name="fname" id="Forename"><br /><br />
<input placeholder="Surname" type="text" name="sname"><br /><br />
<input placeholder="Student Id" type="text" name="studId"><br /><br />
<input placeholder="Username" type="text" name="uname"><br /><br />
<input placeholder="password" type="password" name="pass" min="6" max="32"><br /><br />
<input placeholder="Re-type password" type="password" name="rpass" min="6" max="32"><br /><br />
<input placeholder="Email" type="" name="email"><br /><br />
<input placeholder="Re-type Email" type="remail" name="remail"><br /><br />
<input value="Sign Up" type="submit" name="sign_Up">
</form>
in second form you have not define the method if method is not defined it will accept the GET method default so change your second form tag by
<form action="" method="POST">
there are already values inside the texboxes which i filtered inside the table(score) but i wanna update it by changing the values inside on it and click update.
Can anyone help with my code..i wanna update the values inside the (texboxes) but my code wont work can anyone help me locate the code that messing with the program?
php code:
<?php
if(isset($_POST['update'])){
//1
$u1id = $_POST['id1'];
$u1name = $_POST['name1'];
$u1score1 = $_POST['optA1'];
$u1score2 = $_POST['optB1'];
$u1other_qual = $_POST['other_qual1'];
$u1interview = $_POST['interview1'];
$u1total = $_POST['total1'];
//2
$u2id = $_POST['id2'];
$u2name = $_POST['name2'];
$u2score1 = $_POST['optA2'];
$u2score2 = $_POST['optB2'];
$u2other_qual = $_POST['other_qual2'];
$u2interview = $_POST['interview2'];
$u2total = $_POST['total2'];
//1
mysql_query("UPDATE score SET score1='$u1score1', score2='$u1score2', total='$u1total' WHERE id='$u2id'");
//2
mysql_query("UPDATE score SET score1='$u2score1', score2='$u2score2', total='$u2total' WHERE id='$u2id'");
}
?>
html code:
<form method="post" id="frm" name="frm" action="" />
<table>
<tr>
<td>
ID: <br />
<input type="text" name="id1" value="<?php if(empty($id[0])){$id[0] = array(NULL);}else{echo $id[0];} ?>" readonly /> <br />
<input type="text" name="id2" value="<?php if(empty($id[1])){$id[1] = array(NULL);}else{echo $id[1];} ?>" readonly /> <br />
</td>
<td>
Name: <br />
<input type="text" name="name1" value="<?php if(empty($name[0])){$name[0] = array(NULL);}else{echo $name[0];} ?>" readonly /> <br />
<input type="text" name="name2" value="<?php if(empty($name[1])){$name[1] = array(NULL);}else{echo $name[1];} ?>" readonly /> <br />
</td>
<td>
Score 1: <br />
<input type="text" name="optA1" value="<?php if(empty($score1[0])){$score1[0] = array(NULL);}else{echo $score1[0];} ?>" onchange="optTotal1()" /> <br />
<input type="text" name="optA2" value="<?php if(empty($score1[1])){$score1[1] = array(NULL);}else{echo $score1[1];} ?>" onchange="optTotal2()" /> <br />
</td>
<td>
Score 2: <br />
<input type="text" name="optB1" value="<?php if(empty($score2[0])){$score2[0] = array(NULL);}else{echo $score2[0];} ?>" onchange="optTotal1()" /> <br />
<input type="text" name="optB2" value="<?php if(empty($score2[1])){$score2[1] = array(NULL);}else{echo $score2[1];} ?>" onchange="optTotal2()" /> <br />
</td>
<td>
Other Qualification: <br />
<input type="text" name="other_qual1" value="<?php if(empty($other_qual[0])){$other_qual[0] = array(NULL);}else{echo $other_qual[0];} ?>" readonly /> <br />
<input type="text" name="other_qual2" value="<?php if(empty($other_qual[1])){$other_qual[1] = array(NULL);}else{echo $other_qual[1];} ?>" readonly /> <br />
</td>
<td>
Interview: <br />
<input type="text" name="interview1" value="<?php if(empty($interview[0])){$interview[0] = array(NULL);}else{echo $interview[0];} ?>" readonly /> <br />
<input type="text" name="interview2" value="<?php if(empty($interview[1])){$interview[1] = array(NULL);}else{echo $interview[1];} ?>" readonly /> <br />
</td>
<td>
Total: <br />
<input type="text" name="total1" value="<?php if(empty($total[0])){$total[0] = array(NULL);}else{echo $total[0];} ?>" readonly onKeyUp="optTotal1()" /> <br />
<input type="text" name="total2" value="<?php if(empty($total[1])){$total[1] = array(NULL);}else{echo $total[1];} ?>" readonly onKeyUp="optTotal2()" /> <br />
</td>
</tr>
</table>
<input type="submit" value="update" />
</form>
It's in your submit button:
<input type="submit" value="update" />
You have given it a value, but not a name. If you change it to:
<input type="submit" name="update" value="yespleasedososir" />
it will end up in your post var
A few thoughts: 1. Have you echoed out your sql statements to see what you are getting? 2. Try add the tilde symbol before and after each column name...like score1 = 'whatever'. 3. You should really be using the mysqli statemnts.
I have a uploader in my page that is design to work from iPad and have 8 upload boxes.
When i upload pictures in the uploader, only one files is saved.
How can i get it to save all the pictures that gets uploaded?
folder is set to 777.
The Page
PHP:
<?
if ( isset( $_POST['submit'] ) ){
foreach ($_FILES['file']['name'] as $_key => $_value){
if($_FILES['file']['size'][$_key] !==0){
$randomizer = rand(0000000, 9999999);
$f=$randomizer.$_FILES['file']['name'][$_key];
echo $f;
echo "<br>";
$t=$_FILES['file']['tmp_name'][$_key];
echo $t;
echo "<br>";
//echo $_FILES['file']['size'][$_key]."<br />";
$file_mb = round(($_FILES["file"]["size"][$_key] / 1048576), 2);
echo "Size: " . $file_mb . " Mb<br />";
echo $_FILES['file']['type'][$_key]."<br />";
if( file_exists($t) ){ move_uploaded_file($t, 'upload/' . $f); }
//move_uploaded_file($_FILES['file']['tmp_name'][$_key], "upload"/$_FILES['file']['name'][$_key]);
echo "ok file";
echo "<br>";
}
}
}
?>
<form id="main_form" action="" method="POST" enctype="multipart/form-data">
<? for($i = 0; $i < 9; $i++) {
echo "<input type=\"file\" name=\"file[]\" /> <br>";
}
?>
<input type="submit" name="submit" value="send">
</form>
HTML:
<input type="file" name="image1" /><br /> <br /> <br />
<input type="file" name="image2" /><br /> <br /> <br />
<input type="file" name="image3" /><br /> <br /> <br />
<input type="file" name="image4" /><br /> <br /> <br />
<input type="file" name="image5" /><br /> <br /> <br />
<input type="file" name="image6" /><br /> <br /> <br />
<input type="file" name="image7" /><br /> <br /> <br />
<input type="file" name="image8" /><br /> <br /> <br />
I am trying to make a quote forum that sends the input to an email. I have PHP sending the email, displaying the subject and the senders email, but it doesn't display the main body of content in the email that is sent.. here is my code:
<?php
$action=$_REQUEST['action'];
if ($action=="") /* display the contact form */
{
?>
<div class="quote_text">Send us some of your information and we will get back to you as soon as possible. Let's get this ball rolling.</div>
<br /><br />
<span class="important">* = required fields</span><br />
<form action="" method="POST" enctype="multipart/form-data">
<table width="814" height="310" border="0">
<tr>
<td width="419">
<input type="hidden" name="action" value="submit">
Your Name:<span class="important">*</span><input name="name" type="text" value="" size="30"/><br /><br />
Your Email:<span class="important">*</span><input name="email" type="text" value="" size="30" placeholder="example#example.com"/><br /><br />
Phone Number:<input name="phone" type="text" value="" size="10" maxlength="12" placeholder="(xxx)-xxx-xxxx" /><br /><br />
Company Name:<input name="company_name" type="text" value="" size="30"/><br /> <br />
</td>
<td width="385">
Address of Installation:<span class="important">*</span>
<input name="install_address" type="text" value="" size="30"/><br /><br />
City:<span class="important">*</span><input name="city" type="text" value="" size="30"/><br /><br />
State:<span class="important">*</span><input name="state" type="text" value="" size="30"/><br /><br />
Zip Code:<span class="important">*</span><input name="zip" type="text" value="" size="30"/><br /><br /><br /><br />
</td>
</tr>
<tr>
<td height="102">
Fence Type Description:<br /><textarea name="description" rows="6" cols="45"></textarea>
Number of Corners:<input name="corners" type="text" value="" size="30"/>
</td>
<td><br />
Linear Feet:<input name="linear" type="text" value="" size="30"/><br />
OR<br />
Acres:<input name="acres" type="text" value="" size="30"/><br /><br />
Number of Gate Openings:<input name="gate_opening" type="text" value="" size="30"/>
</td>
</tr>
</table><br><br>
<input type="submit" value="Send email"/>
</form>
<?php
} else {
// Grab forum elements and push into variables for the email
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$company_name = $_REQUEST['company_name'];
$install_address = $_REQUEST['install_address'];
$city = $_REQUEST['city'];
$state = $_REQUEST['state'];
$zip = $_REQUEST['zip'];
$description = $_REQUEST['description'];
$corners = $_REQUEST['corners'];
$linear = $_REQUEST['linear'];
$acres = $_REQUEST['acres'];
$gate_opening = $_REQUEST['gate_opening'];
//Build Email
$message="$name<br />
$email<br />
$phone<br />
$company_name<br />
$install_address<br />
$city<br />
$state<br />
$zip<br />
$description<br />
$corners<br />
$linear<br />
$acres<br />
$gate_opening<br />";
$message=$_REQUEST['message'];
if (($name=="")||($email=="")||($install_address="")||($city="")||($state="")|| ($zip=""))
{
echo "Please fill the required fields. Click here to try again.";
}
else{
$from="From: $name<$email>\r\nReturn-path: $email";
$subject="Blue Ridge Fencing - Quote Forum";
mail("info#blueridgefenceco.com", $subject, $message, $from);
echo "Email sent! We will get back to you as soon as possible.";
}
}
?>
Thank you so much for you help!