PHP - Controls Not Working After Form Filled
Hello there,
I have a problem with a form, as soon as I fill the for using a query. The buttons doesn't work anymore. They work when i open the page, they have somoe js to emable and diable controls. but when i do a search and get the form filled, non of the controls work anymore. Any advise? Similar TutorialsI have php code that uses mp3 audio files stored in a database for the user to listen to. The page loads and the audio controls work and the files play on a desktop and laptop just fine. When trying to play a file on an android or IPhone, when you press the play (or any other control) nothing happens. It acts like the page is static. There is a home button on the webpage and it works so I know the page is interactive. Below is the code. I would appreciate any help. Thank you.
<?php I've got a basic form setup on my site that requires the user to fill out the required fields. When one of the fields isn't filled out, the error message for that specific input area is displayed, etc. However, all the information from the form that the user filled out is removed.. I want the user to be able to fill out the form, hit submit, and if any errors, show the specific error but also keep the input boxes populated with the data the user filled out so he/she does not have to re type everything. if(!empty($_POST['submitFeature'])) { // set variables $featurename = mysql_real_escape_string($_POST['featurename']); $name = mysql_real_escape_string($_POST['name']); $email = mysql_real_escape_string($_POST['email']); $email2 = mysql_real_escape_string($_POST['email2']); $age = mysql_real_escape_string($_POST['age']); $city = mysql_real_escape_string($_POST['city']); $state = mysql_real_escape_string($_POST['state']); $src = $_FILES['featureupload']['tmp_name']; $featuresize = $_FILES['featureupload']['size']; $limitsize = 3000000; if(!empty($featurename) && !empty($name) && !empty($email) && !empty($email2) && !empty($city) && !empty($state) && ($email == $email2) && !empty($_FILES['featureupload']['tmp_name']) && ($featuresize < $limitsize)) { // IF ALL IS CORRECT, SUBMIT INFO } else { print ' <ul class="errorlist"> <li class="alert">Please fill out the required fields.</li> '; if (empty($name)) { echo ' <li>* Full Name</li>' . "\n"; $errorname = 'TRUE'; } if (empty($email)) { echo ' <li>* Email</li>' . "\n"; $erroremail = 'TRUE'; } print ' </ul> '; } // 1 - B. END REQUIRED FIELDS ERROR CODES } ?> <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data"> <div style="float: left;"> <span class="copy-answer">Your Information</span> <div class="formSec"><label for="name" class="required">Full Name: <?php if(isset($errorname)){echo '<span class="error">*<span>';}?></label> <input type="text" name="name" id="name" value="" maxlength="25" /></div> <div class="formSec"><label for="email" class="required">Email: <?php if(isset($erroremail)){echo '<span class="error">*<span>';}?></label> <input type="text" name="email" id="email" value="" /></div> <input class="submit" type="submit" name="submitFeature" value="Submit Your Feature" /> </form> I am adding line items in my invoice script, while adding i validate the data. if validation fails, it will display error message with entered data filled in the form. If it clears the validation, data gets submitted to database and displays the same . Here i can add many line items, so this process should keep repeating. Everything is working fine. But when the form submits it should display error in one place and display the submitted data in other place. Here is my form
<form action="" method="post"> <div class="form-row"> <div class="col-md-4 mb-30"> <label for="validationDefault01">Select Customer</label> <select name="customer" class="form-control" id="validationDefault01" required> <option value=""></option> <?php $c1 = mysqli_query($con, "SELECT * FROM customers WHERE status='Active'") or die (mysqli_error($con)); while($c2 = mysqli_fetch_array($c1)) { ?> <option value="<?php echo $c2["cid"]; ?>" <?php if($c2["cid"] == $_POST['customer'] ) { echo "selected"; } ?> ><?php echo $c2["name"]; ?></option> <?php } ?> </select> </div> <div class="col-md-4 mb-30"> <label for="validationDefault02">Date</label> <input type="text" class="form-control" name="edate" id="datepicker" value="<?php echo isset($_POST["edate"]) ? $_POST["edate"] : $today; ?>" required /> </div> </div> <!-- line item --> <div class="table-responsive"> <table class="table table-active table-bordered table-sm"> <thead class="thead-active"> <tr> <th>Name</th> <th>Description</th> <th>UOM</th> <th>Price</th> <th>Stock</th> <th>Qty</th> </tr> </thead> <tr> <td><input type="text" id="productname" name="productname" value="<?php echo isset($_POST["productname"]) ? $_POST["productname"] : ''; ?>" required ></td> <input type="hidden" id="productcode" name="productcode" value="<?php echo isset($_POST["productcode"]) ? $_POST["productcode"] : ''; ?>" /> <td><textarea id="description" name="description"><?php echo isset($_POST["description"]) ? $_POST["description"] : ''; ?></textarea></td> <td><select name="uom" id="uom"> <?php $su1 = mysqli_query($con, "select * from uom"); while($su2 = mysqli_fetch_array($su1)) { ?> <option value="<?php echo $su2["uom_name"]; ?>" <?php if($su2["uom_name"] == $_POST['uom'] ) { echo "selected"; } ?> ><?php echo $su2["uom_name"]; ?></option> <?php } ?> </select> </td> <td><input type="text" required id="price" name="price" value="<?php echo isset($_POST["price"]) ? $_POST["price"] : ''; ?>" /></td> <td><input type="text" readonly id="stock" name="stock" value="<?php echo isset($_POST["stock"]) ? $_POST["stock"] : ''; ?>" /></td> <td><input type="text" required id="quantity" name="quantity" value="<?php echo isset($_POST["quantity"]) ? $_POST["quantity"] : ''; ?>" /></td> </tr> </table> <!-- line item ends---> <div class="form-row"> <div class="col-md-4 mb-30"> <input name="add" class="btn btn-success" type="submit" value="Add" /> </div> </div> </form> form submission <?php if(isset($_POST['add'])) { $customer = $_POST['customer']; $edate1 = $_POST['edate']; $edate = date('Y-m-d', strtotime((str_replace('/','-',$edate1)))); $pname = $_POST['productname']; $pcode = $_POST['productcode']; $uom = $_POST['uom']; $price = $_POST['price']; $quantity = $_POST['quantity']; $pc = mysqli_query($con, "SELECT min_price FROM items WHERE item_id=".$pcode."") or die (mysqli_error($con)); $prow = mysqli_fetch_array($pc); // This error part should be displayed inside <div id="error"></div> which is above the form if($price<$prow['min_price']) { echo '<div class="alert alert-inv alert-inv-danger alert-wth-icon alert-dismissible fade show" role="alert"> <span class="alert-icon-wrap"><i class="zmdi zmdi-bug"></i></span> Price should not be lesser than minimum price defined. <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div>'; } else { //data gets inserted into invoice table and displays submited data in table format // this part should be displayed below the form inside <div id="success"></div> } }
Hi everyone. I am David and I am new to web design and php. I am following a Lynda.com tutorial on php and sql. I have reached a certain point in the tutorial where I am reading values back from my database in to a php variable. The variable is holding an array data type and I am accessing the element within the array. I want a HTML select control and 2 radios buttons to reflect the values in the database. Therefore the Select control should read a numeric value of type int and the radio buttons are reflecting either a 1 or a 0. Firstly the code for the Select control uses a for loop to count the array elements and load the count into the Select control. The example uses php mixed with html. The for loop will count the number of element and add a number to the select control. The an If statment is used to make a decision if the count variable equals the value in the array element $sel_subject['position'] then select that value. This does not happen, and I can not seem to get it to work. <p>Position: <select name="position"> <!--use a php block so as to use some php variables --> <!--Use these variables with the get_all_sublects function. --> <!-- This function will return all the dataset --> <?php $sel_subject = get_all_subjects(); //Then use the mysql fuction to retuen the numberic value of all the rows. $subject_count = mysql_num_rows($sel_subject); //$subject_count + 1 becauce we are adding a subject for($count=1; $count <= $subject_count+1; $count++) { echo "<option value=\"{$count}\""; if ($sel_subject['position'] == $count) { echo " selected"; } echo ">{$count}</option>"; } ?> </select> </p> Secondly the radio buttons do something similar in that i want them to reflect the value in the array element. If a 1 then True and so be checked or 0 and so false and so be unchecked. <p>Visible: <input type= "radio" name= "visible" value= "0" <?php if ($sel_subject['visible'] == 0) { echo 'checked=" checked"'; } ?> >No</input> <input type= "radio" name= "visible" value= "1" <?php if ($sel_subject['visible'] == 1) { echo 'checked=" checked"'; } ?> >Yes</input> </p> Again this doesn't work either. So in summary, I cant get the php code to affect the html form controls and relay the stored data to the user. I have been racking my brain for days and getting no where. Please can anyone help me with this. I would be very grateful. All the best Irish_Dave I have a form where people will be putting in specific info such as their names and other info. When the form is posted I need to add a "." between the fields on the output depending on if it is filled out or not if field is blank do not need a "." Example if they put in their name Bob Marley on the form I need it to appear on the output as Bob.Marley. Here is the code using currently which also excludes blank fields echo $_POST["First"]; if(isset($_POST["Middle"])){ echo $_POST["Middle"]; } echo $_POST["Last"]; How is it possible, in PHP, to display an error message next to a form input text field if a user is attempting to submit a form with empty fields? Moreover, how is it possible to remove the same error message when the user fills in the input field with the required data and/or refreshes the page? I have 2 files that I am working with: application.php and process.php.
application.php mainly has the HTML of the form. I am very new to learning PHP (I started learning it last week) and I have been searching for hours for a clear answer. I have already tried different methods for generating the error message including: using empty(), !isset, $_POST["name"] = "", etc, and have tried using session_start();, $row, echo, print, and other variables to try and display error message on the page, and I have tried using unset();, and = null, to try and remove the error message once the input field has been filled but all to no avail. Either the method I try only half works, or nothing works, and I cannot pinpoint which is the part that is not working. I only have 2 files to work with, and as an example of what I want to do is:
1. If the first name field is empty when the user clicks submit, an error message should appear next to the input. Is this possible with PHP? Hi everyone. I have a combo box which lists usernames and onchange, the username value is passed to a textbox. however, I have 3 textboxes i need to populate based on the selection of the combobox: username. department and email. i have the username going into a textbox, but i'm not sure how to pass department and email into two other textboxes. I'd appreciate any help you could provide. Thanks. Code: [Select] <script> function CBtoTB() {document.getElementById("username").value=document.getElementById("usernameselect").value} </script> <?php $result=mysql_query("select Username, EMail, Department from users"); $options=""; while ($row=mysql_fetch_array($result)) { $username=$row["Username"]; $options.="<OPTION VALUE=\"$username\">".$username.'</option>'; } ?> <select name="usernameselect" id="usernameselect" onchange="CBtoTB()"> <option value="">< select user ><?php echo $options ?></option> </select> <input name="username" type="text" id="username" value="<?php echo $username ?>" size="25" readonly="readonly" /> Hello friends; Is there a controls for php like asp (Grid-dropbox - listbox) and so on and what is best editor for php Thank you so much I have Wordpress based site where i've included a class for the main menu that produces a hover and shadow effect. Problem is it breaks the menu in the fully responsive mode when the display adjusts for the viewing dimensions. So I need to remove that class from the menu for anything related to the @media controls.
The site is viewable he http://ailimconsulting.com
If you view it full screen then you'll see the hover effect. Shrink it down and you'll see the menu collapses (it's designed to) but when you use the menu the shadow/hover effect is still present and 'breaks' the menu (loooks like jumbled crap). We just want to remove the hover effect for viewing on mobile devices.
I'm not sure if there's a CSS way to 'remove' a class. This may have to be done with jQuery. I'm looking for options and if anyone knows how I would either remove or counteract the float-shadow class.
Thanks.
Hello! My name is DJ and I am new to PHP. Basically I designed a website with dreamweaver and on one of the pages I have a contact form. I used an internet tutorial to use php in order to finish the form. But now when someone submits their form, I don't receive an email and they just end up at a blank page. I don't understand why it's not working. Can you help me? Code: [Select] <?php /* Subject and Email Variables */ $emailSubject = 'Sales Inquiry'; $webMaster = 'sales@endorsebro.com'; /* Gathering Data Variables */ $name = $_POST['name']; $business_name = $_POST['business_name']; $phone_number = $_POST['phone_number']; $Email = $_POST['Email']; $website = $_POST['website']; $state = $_POST['state']; $budget = $_POST['budget']; $comments = $_POST['comments']; $body = <<<EOD <br><hr><br> Name: $name <br> Business Name: $business_name <br> Phone Number: $phone_number <br> Email Address: $Email <br> Website: $website <br> State: $state <br> Budget: $budget <br> Comments: $comments <br> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as html */ $theResults = <<<EOD <html> <head> <title>Endorsebro</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { background-color: #f1f1f1; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: normal; color: #666666; text-decoration: none; } --> </style> </head> <div> <div align="left">Thank you for your interest! We will be in contact soon!</div> </div> </body> </html> EOD; echo "$theResults"; ?> Thank you for your time. I am using this code to build a form: echo '<form method="post" action="mysql.php">'; echo '<table>'; echo '<tr><td>UserID:</td>'; echo '<td><input type="text" name="username"></td></tr>'; echo '<tr><td>Password:</td>'; echo '<td><input type="password" name="password"></td></tr>'; echo '<tr><td colspan="2" align="center">'; echo '<input type="submit" value="Log In"></td></tr>'; echo '</table></form>'; Alone, this form works, but when I add script above it to make it more functional, everything loads properly and I get no errors, but the form will not submit. The submit button is like a dead button. Anyone know why this could be happening? Heres my code for the whole thing.. <?php if($_GET['view'] == 'vote') { $id="{$_GET['id']}"; if ($list_q = mysql_query("SELECT * FROM toplist WHERE id='$id'")) { if (mysql_num_rows($list_q)) { while($list_b=mysql_fetch_array($list_q)) { if ($list_b['ban'] == 0) { if ($list_b['staff'] == 0) { function capitalizeFirstCharacter($value) { $capitalize = preg_replace('/[a-z]/ie', 'strtoupper($0);', $value, 1); return $capitalize; } if(!empty($_POST['Submit'])) { if($_POST['spampre'] == "4iubg") { mysql_query("UPDATE toplist SET vote++ WHERE id = ". $_SESSION['id']) or die (mysql_error()); echo "<tr><td class='trow2'><span class='smalltext'> Thanks for voting. </span></td></tr>"; }else{ echo "<center>Spam Prevention is wrong.</center>"; } } $result = mysql_query("SELECT * FROM toplist WHERE id='$id'") or die(mysql_error()); $row = mysql_fetch_assoc($result); $id = $row["id"]; ?> <div class="navigation"> <!-- start: nav_bit --> <a href="http://runelegend.com/index.php">Runelegend</a> <!-- end: nav_bit --><!-- start: nav_sep_active --> / <!-- end: nav_sep_active --><!-- start: nav_bit_active --> <a href="http://runelegend.com/toplist">Server List</a> / <span class="active">Viewing <?php echo capitalizeFirstCharacter($list_b['servername']);?></span> <!-- end: nav_bit_active --> </div> <!-- end: nav --> <br /> <!-- end: header --> <form action="server.php?view=vote&id<?php ?>" method="post" id="registration_form"> <table border="0" cellspacing="0" cellpadding="5" class="tborder"> <script type="text/javascript" src="http://runelegend.com/jscripts/captcha.js?ver=1400"></script> <tr> <td><span class="smalltext">Please enter the text contained within the image on the right in to the text box below it. This process is used to prevent automated signups.</span></td> <td rowspan="2" align="center"><img src="http://runelegend.com/captcha.php?action=regimage&imagehash=35a910bc839af4d3c4e36faf471c600c" alt="Image Verification" title="Image Verification" id="captcha_img" /><br /><span style="color: red;" class="smalltext">(don't use caps)</span> </td> </tr> <tr> <td><input type="text" class="textbox" name="spampre" value="" id="spampre" style="width: 100%;" /><input type="hidden" name="imagehash" value="35a910bc839af4d3c4e36faf471c600c" id="imagehash" /></td> </tr> </table> <div align="center"> <input type="submit" class="button" name="Submit" value="Submit Registration!" /> </div> </form> <!-- end: member_profile_adminoptions --> </td> </tr> <?php } else { echo '<font color="red" align="center">There is no need to see this server, It isn\'t even a server, it is a staff member.</font><br/>'; } } else { echo '<font color="red" align="center">This server has been banned.<br>If you are the owner of this server, and wish to know why the server is banned from the list, login and go to the <a href="usercp">UserCP</a></font><br/>'; } }}}} ?> I am pretty much trying to make a Vote for system, but the only Problem Im having is the Form code. When I don't have a php code in the (action) part of the code it works, but If I do then it acts as if it's not even there. Edit: Fixed it. I know this is very simple, but... Any way here is the code for my form, but it doesn't post to my database and there are no errors shown. Any ideas? thanks <? include("include/session.php");?> <? include('include/headder_login.php'); ?> <h1>Event Information : <? echo $session->username; ?></h1> <form> <form action="protimes.php" method="post" name="event information"> <input name="id" type="text" value=""> <input name="name" type="number" value="name" size="30"> <select name="event"> <option value="1">50 Front</option> <option value="2">50 Back</option> <option value="3">100 Front</option> </select> <input name="time" type="time" value"time" > <input name="date" type="date" value="date"> <input name="submit" type="button" value="submit" align="right"> <input type="reset" name="reset" value="reset"aligh="right"> </form> protimes.php file $sql="INSERT INTO `cbcrusta_test3`.`info` ( `id` , `name` , `event` , `time` , `date` ) VALUES ('$_POST[id]','$_POST[name]','$_POST[event]','$_POST[time]','$_POST[date')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } echo "1 record added"; Hey there, Basically I'm having some difficulty getting this form to work: Code: [Select] <form action=getitem.php method=post name=form2><input type=hidden name=itemid value='1'> <input type=image src=items/ricketyoldsledge.png name=free class=img></form> It'll work if it's at the top of the code for the page I want it on, however I want it to be in a later position (I've included the PHP for the whole page below, so hopefully you can see what I mean). The error I get is that the form appears to send, only instead of sending me to getitem.php it just goes back to sledmakers.php. Code: [Select] <?php include('connect.php'); include('header.php'); include('loggedin.php'); echo 'blah blah"'; // Check profession $result = mysql_query("SELECT * FROM players WHERE id=".$_SESSION['id']) or die(mysql_error()); while($row = mysql_fetch_array( $result )) { $profession = $row['profession']; $level = $row['level'];} // if they're unemployed still if($profession == 'Unemployed'){ echo '<br><br><form action=sledmakers.php?talk=yes method=post name=form1> <input type=submit name=submit value="Talk to the man?"><bR><Br>'; } // if they're a Sledmaker elseif($profession == 'Sledmaker'){ echo 'Sledmaker';} // if they're not a Sledmaker else{ echo 'What? You\'re not a Sledmaker! Go away.';} $talk = $_GET['talk']; // if they're unemployed and pressed to speak with her if($talk == 'yes') { echo 'blahblah'; echo 'You look in the corner and find what you\'re looking for...<bR><br>'; ?> <form action=getitem.php method=post name=form2><input type=hidden name=itemid value='1'><input type=image src=items/ricketyoldsledge.png name=free class=img></form> <br><br><form action=sledmakers.php method=post name=form3> <input type=submit name=submit2 value="Become the Master Sledmakers's Apprentice?"><bR><Br> <?php } else{ echo '';} if(isset($_POST['submit2'])){ echo 'You are now an Apprentice Sledmaker!'; } include('footer.php'); ?> Can anybody help me out? :/ If you need more info, please just ask! Okay, the following php form is "somewhat" working. .I am not receiving all of the variables to my inbox.
This is the current form that i'm working on.
http://www.rodriguez...cr/schedule.php
The following fields are the ones are not passing through.
The Drop Down Menu: am, pm, the all day
Video
Case Option:
Additional Requests:
Firm Physical Address:
Fax No:
Here is the code
<?php function displayRequired($fieldName) { echo " \".$fieldName\"is required.<br />n"; } function validateInput($data, $fieldName){ global $errorCount; if (empty($data)){ displayRequired($fieldName); ++$errorCount; $retval = ""; } else { $retval = trim($data); $retval = stripslashes($retval); } return ($retval); } $Deposition = validateInput(safe($_POST['deposition']), "Deposition"); $Time = validateInput(safe($_POST['time']), "Time"); $Delivery = validateInput(safe($_POST['delivery']), "Delivery"); $Witness = validateInput(safe($_POST['witness']), "Witness"); $Location = validateInput(safe($_POST['location']), "Location"); $Attorney = validateInput(safe($_POST['attorney']), "Attorney"); $Name = validateInput(safe($_POST['name']), "First Name"); $Firm = validateInput(safe($_POST['firm']), "Firm Name"); $Phone = validateInput(safe($_POST['phone']), "Phone"); $Email = validateInput(safe($_POST['email']), "Email"); if ($errorCount>0){ echo "Please re-enter the information below.<br />\n"; redisplayForm($Deposition, $Time , $Ampm, $Timeday, $Delivery, $Video, $Co1, $Co2, $Witness, $Location, $Additional, $Attorney, $Name, $Firm, $Address, $Phone, $Fax, $Email); } else { $To = "service@rodriguezstudios.com"; $Subject = "The test"; $From = "Schedule a Deposition - Professional Court Reporters"; $Message .= "Deposition Date: " . $Deposition . "\n"; $Message .= "Time: " . $Time . $Ampm. $Timeday . "\n\n"; $Message .= "Transcript Delivery: " . $Delivery . "\n\n\n"; $Message .= "Video: " . $Video . "\n\n\n\n"; $Message .= "Case Option: " . $Co1. "vs: " . $Co2 . "\n\n\n\n\n"; $Message .= "Witness: " . $Witness . "\n\n\n\n\n\n"; $Message .= "Location: " . $Location . "\n\n\n\n\n\n\n"; $Message .= "Additional Requests: " . $Additional. "\n\n\n\n\n\n\n\n"; $Message .= "Attorney Name: " . $Attorney . "\n\n\n\n\n\n\n\n\n"; $Message .= "Your Name: " . $Name . "\n\n\n\n\n\n\n\n\n\n"; $Message .= "Firm Name: " . $Firm. "\n\n\n\n\n\n\n\n\n\n\n"; $Message .= "Firm Physical Address: " . $Address . "\n\n\n\n\n\n\n\n\n\n\n\n"; $Message .= "Phone No: " . $Phone . "\n\n\n\n\n\n\n\n\n\n\n\n\n"; $Message .= "Fax No: " . $Fax. "\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; $Message .= "Email: " . $Email . "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; $Headers = "From: ". $From . "<" . $To. ">\r\n"; $Headers .= "Reply-To: " . $Email . "\r\n"; $Headers .= "Return-path: ". $Email; $result = mail($To, $Subject, $Message, $Headers); if ($result) $resultMsg = "You message was sucessfully sent."; else $resultMsg = "There was a problem sending your message."; /*insert anti spam fragement here */ ?> <p style="line-height:200%; text-align:center; font-family:Verdana, Geneva, sans-serif; color:#000000">Your deposition has been scheduled<?php if(!empty($fieldName)) { echo " , {$fieldName}. {$resultMsg}"; } echo "</p>"; } ?> <?php function redisplayForm($Deposition, $Time , $Ampm, $Timeday, $Delivery, $Video, $Co1, $Co2, $Witness, $Location, $Additional, $Attorney, $Name, $Firm, $Address, $Phone, $Fax, $Email){ ?> <form action="" method="POST"> <fieldset class="first"> <fieldset class="first"> <p> <label class="labelone"for="deposition">*Deposition Date:</label> <input type="text" id="datepicker" name="deposition" value="<?php echo $Deposition; ?>" /> </p> <p> <label for="*Time:" name="time">*Time: </label> <input type="text" name="time" value="<?php echo $Time; ?>"> <select name="ampm" id="Ampm"> <option value="am">A.M.</option> <option value="pm">P.M.</option> </select> <select name="timeday" id="Timeday"> <option value="all">All Day</option> <option value="half">Half Day</option> <option value="hours">1-2 hrs</option> </select> </p> <p> <label for="*Transcript Delivery:" name="transcript"/> *Transcript Delivery:</label> <select> <option value="regular">Regular Delivery (10 day)</option> <option value="same">Same Day</option> <option value="1day">1 Day</option> <option value="2day">2 Day</option> <option value="3day">3 Day</option> <option value="4day">4 Day</option> <option value="5day">5 Day</option> </select> </p> <p> <label for="*Video" name="video">*Video:</label> <select name="video" id="video"> <option value="yes">Yes</option> <option value="no">No</option> </select> </label> </p> <p> <label for ="caseoption">Case Option:</label> <input type="text" name="co1" value="<?php echo $Co1; ?>"/> vs. <input type="text" name="co2" value="<?php echo $Co2; ?>" /> </p> <p> <label for ="witness">*Witness:</label> <input type="text" name="witness" value="<?php echo $Witness; ?>" /> </p> </fieldset> <fieldset> <legend>LOCATION OF DEPOSITION, TELEPHONE NUMBER, AND NAME OF CONTACT PERSON:</legend> <p> <label for="location">*Location:</label> <textarea name="location" id="Location" value="<?php echo $Location; ?>"></textarea> </p> <p> <label for="additional">Addtional Requests (i.e. Realtime):</label> <input type="text" name="additional" value="<?php echo $Additional; ?>" /> </p> <p> <label for ="attorney">*Attorney Name:</label> <input type="text" name="attorney" value="<?php echo $Attorney; ?>" /> <p> <label for ="name">*Your Name:</label> <input type="text" name="name" value="<?php echo $Name; ?>" /> </p> <label for ="firm">*Firm Name:</label> <input type="text" name="firm" value="<?php echo $Firm; ?>" /> </p> <p> <label for ="firmaddress">Firm's Physical Address:</label> <input type="text" name="address" value="<?php echo $Address; ?>" /> </p> <p> <label for ="phone">*Phone No:</label> <input type="text" name="phone" value="<?php echo $Phone; ?>"/> </p> <p> <label for ="fax">Fax No:</label> <input type="text" name="fax" value="<?php echo $Fax; ?>"/> </p> <p> <label for ="email">*Email:</label> <input type="text" name="email" value="<?php echo $Email; ?>" /> </p> </fieldset> <fieldset> <input class="btn" name="submit" type="submit" value="Send Email"/> <input class="btn" name="reset" type="reset" value="Clear Form" /> </fieldset> </form> <?php } ?> <?php function safe($string) { $pattern = "/\r|\n|\%0a|\%0d|Content\-Type:|bcc:|to:|cc:/i"; return preg_replace($pattern, '', $string); } ?>The extra pair of eyes would be greatly appreciated! I changed web hosting companies and now a php form that was working is no longer working. I haven't been able to figure out what the problem is. The form is a simple text input form that adds the text to a database. Every time the user inserts text with a comma, an error occurs. Below is the code for the form. Any help is much appreciated. http://www.apnapaisa...ia/compare.html
just like the form in this page.
Can anybody help me out.
Hi, php newbie here, web developer newbie too! Some time ago I did a website which included a course registration form which someone else created for me in php. This worked fine and I amended the original to work on another website. I am currently updating this second website and the php has stopped working, and I am no longer in contact with the original developer of the code. The form is at: http://www.bisntechnologies.com/register.htm, and the php is: <?php /* ------- Stuff You Can Change --------- */ $recipient = 'registration@bisntechnologies.com'; $redirect = 'confirmation.php'; /* -------------------------------------- */ $name = $HTTP_POST_VARS['name']; $company = $HTTP_POST_VARS['company']; $position = $HTTP_POST_VARS['position']; $telephone = $HTTP_POST_VARS['telephone']; $email = $HTTP_POST_VARS['email']; $interest = $HTTP_POST_VARS['interest']; $clientip = $_SERVER['REMOTE_ADDR']; $msg = "Name: $name\nCompany: $company\nPosition: $position\nTelephone: $telephone\nE-mail: $email\nInterest: $interest\n\nIP Address: $clientip"; $replymsg = "<html><body style=\"font-family: Trebuchet MS; font-size: 13px\"><p>Dear $name,</p><p>Thank you for registering.</p><p><a href=\"http://www.bisntechnologies.com\"><img border=0 src=\"http://www.bisntechnologies.com/images/NewLogo.jpg\" alt=\"BiSN Technologies Ltd\"></a></p></body></html>"; if (mail($email,'Registration',$replymsg,"MIME-Version: 1.0\r\nContent-type: text/html;charset=iso-8859-1\r\nFrom: registration@bisntechnologies.com")) { mail($recipient,'Registration Confirmation',$msg,"From: $email"); include($redirect); } else { echo "<h4>\"$email\" is an invalid e-mail address. Please click the browser's Back button.</h4>"; } ?> Putting in valid information gives the error: "" is an invalid e-mail address. Please click the browser's Back button." which it didn't used to do. I expect it is a very simple mistake but I cannot trace it. Any help to pinpoint the problem greatly appreciated. Hey guys, I'm using a PHP form for my website & I can't get it to send the email correctly, all it send me is the first and last name, but none of the other boxes, any help? Also how can I secure it?
This is the PHP file:
<!DOCTYPE html> |