Jump to content

Search the Community

Showing results for tags 'contact form'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 10 results

  1. PHP contact form

    Hello. A couple of weeks ago I concluded a couple of front end development courses and we only touched upon php coding. Since we didn't do much of it I used w3schools.com to learn some basics. I used the tutorial to make a contact form but I have a little problem. Currently the form is set (or rather was until I removed some code) to show anything that was entered in to the form on the site (basically like in this tutorial: https://www.w3schools.com/php/php_forms.asp). What I want the form to do is send the entered information to a predefined email address. But that's not all. It's going to be used on a singlepage website layout. I want the form to also show a prompt box that warns the user that either something went wrong or that the message was sent and reload the page back to the same position (I realise I need to use index#pageposition to do this but I don't know how to implement the link). Currently this only warns the user of what he did wrong (but not in a prompt box that something wrong happened) and reloads the page to the top. I'm a PHP noob (big noob), and I would appreciate if someone can help me out with this. Thank you :). <?php // define variables and set to empty values $nameErr = $emailErr = $genderErr = $websiteErr = ""; $name = $email = $gender = $comment = $website = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) { $nameErr = "Vpiši ime!"; } else { $name = test_input($_POST["name"]); if (!preg_match("/^[a-zA-Z ]*$/",$name)) { $nameErr = "Dovoljene so samo črke in presledki!"; } } if (empty($_POST["email"])) { $emailErr = "Vpiši email naslov!"; } else { $email = test_input($_POST["email"]); if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $emailErr = "Vpišite veljaven email naslov!"; } } if (empty($_POST["subject"])) { $subjectErr = "Vpiši naslov sporočila!"; } else { $subject = test_input($_POST["subject"]); } if (empty($_POST["message"])) { $messageErr = "Vpiši sporočilo!"; } else { $message = test_input($_POST["message"]); } } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?> <!DOCTYPE html> <html> <link rel="stylesheet" href="style.css" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet"> <meta name="kontakt"> <head> </head> <body> <div class="col-md-12"> <div class="form-area"> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <br style="clear:both"> <h3>Piši nam</h3> <div class="form-group"> <input type="text" class="form-control" name="name" placeholder="Ime"> <span class="error">* <?php echo $nameErr;?></span> </div> <div class="form-group"> <input type="text" class="form-control" name="email" placeholder="Email"> <span class="error">* <?php echo $emailErr;?></span> </div> <div class="form-group"> <input type="text" class="form-control" name="subject" placeholder="Naslov"> <span class="error">* <?php echo $subjectErr;?></span> </div> <div class="form-group"> <textarea class="form-control" type="textarea" placeholder="Sporočilo" name=message rows="8"></textarea> <span class="error">* <?php echo $messageErr;?></span> </div> <input type="submit" class="btn btn-primary" name="submit" value="Submit"> <!--<button type="button" name="submit" class="btn btn-primary pull-right" value="Submit">Pošlji</button>--> </form> </div> </div> </body>
  2. Contact Form container

    I created a contact form inside a wordpress container using the column selection. When I apply the code only inside the container it changes the color of the entire page to that background color of the form. Also, the form has side by side fields but for some reason onilne the fields are stacked. See photos. As you can see in the first picture I removed the background color. Thank you.
  3. Form Responsiveness Issues

    I am making a contact form in a new template liquid for a shopify website. Everything works and looks great in desktop mode but I've noticed as you drag the screen to a skinnier size some inline-block elements jump down perfectly as they are supposed to, the problem is other smaller text boxes are jumping up over other text fields to try and fill that gap. Also I've had issues with the legend and labels abandoning the text box they belong to jump up the form and fill space. Obviously I do not want this, how can I fix it?
  4. Need help

    How do I get the following contact form to work: <form action="contact_form.php" method="post"> <div class="tm-contact-form"> <div class="form-group"> <input type="text" id="contact_name" class="form-control" placeholder="Name..." /> </div> <div class="form-group"> <input type="email" id="contact_email" class="form-control" placeholder="Email..." /> </div> <div class="form-group"> <input type="text" id="contact_subject" class="form-control" placeholder="Subject..." /> </div> <div class="form-group"> <textarea id="contact_message" class="form-control" rows="8" placeholder="Message..."></textarea> </div> </div> <button type="submit" class="btn text-uppercase templatemo-btn templatemo-send-btn">Send</button> </form>
  5. Send email function()

    Im having a problem with respect to sending out emails using XAMPP as my local server. After some resarches and videos... I found out that the mail function doesn't work automatically with local web Servers such as (xampp, wampp. ampps .... and all other kind of "amppss out there!"). I know that in order to the function work properly i have to reformat some php.ini and sandmail.ini files in the root of my server. My question is : Is there any other way of doing this ? i mean using the mail() function with my local server ON ? Do i really have to buy a server in order to use this ? oh! there's also this guy on youtube that discovered a tool called "Test mail server tool". here's the link if you're interested: http://www.toolheap.com/test-mail-server-tool/ What basically this tool allows us to do is: it will catch any email that are sent from the mail function and display them in a textEditor. And that would be fine for me since i just want to test. But that tool doesn't work for windows 8.1 -.- So im getting a little bit frustaded over this Any advice on what i should do ? Thank you Maybe the problem is in my code ? <?php $to = 'example1@example.com';$subject = 'this is the subject';$header =' from: $email';$name = $_POST['name'];$email = $_POST['email'];$message = $_POST['message']; $body = <<<EMAIL Person name: $name Person Email: $email $message From: $name EMAIL;if($_POST){ if($name ==''|| $email=='' || $message==''){ $feedback='feed back message'; }else{ mail($to, $subject, $body, $header); $feedback = ' feedback message'; } } ?>
  6. PHP/HTML Contact Form Help

    I am having problems with a contact form. The form uses both HTML and PHP. The form itself, which is visible to the public, is in HTML, however it used PHP as part of the internal code. I have attached both the PHP and the HTML code in a txt document, now these are two different pages. I hope someone can help. Contact Form coding.txt
  7. Hi folks! I have been using relatively clean and simple PHP contact forms for quite some time now. They fit my needs and are easy to work with. However, after submitting the message, it takes me to a gray screen with the nothing but text I programmed it to echo. It isn't an error or bug, but it's an ugly redirect and does not look professional. I would like to learn how to work with this in one of two ways: either submit the message without leaving the contact page, or add a redirect of some sort. This is the contact.php file I use. If anyone has input on how to do this, it'd be greatly appreciated!! <?phpfunction spamcheck($field) { //filter_var() sanitizes the e-mail //address using FILTER_SANITIZE_EMAIL $field=filter_var($field, FILTER_SANITIZE_EMAIL); //filter_var() validates the e-mail //address using FILTER_VALIDATE_EMAIL if(filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } }if (isset($_REQUEST['email'])) {//if "email" is filled out, proceed //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); if ($mailcheck==FALSE) { echo "Invalid input. Please enter a valid email address."; } else {//send email $name = $_POST['name'] ; $email = $_POST['email'] ; $message = $_POST['message'] ; $totalmessage = " Name: $name n Details: $message n"; mail("email@email.com", "Email: $email", $totalmessage, "From: $email" ); echo "Thank you for contacting me. I'll get back with you ASAP."; } }else { //if "email" is not filled out, display the form?> <form method="post" action="contact.php"> <div class="row half"> <div class="6u"><input type="text" name="name" placeholder="Name" /></div> <div class="6u"><input type="email" name="email" placeholder="Email" /></div> </div> <div class="row half"> <div class="12u"><textarea name="message" placeholder="Message" rows="6"></textarea></div> </div> <div class="row"> <div class="12u"> <ul class="actions"> <li><input type="submit" value="Send Message" name="submit" /></li> </ul> </div> </div> </form><?php}?>
  8. Hello Is there any way to make my form set its width automatically based on the width of my fields? The problem I have is this, when I set the width of my form (e.g. 350px) and reduce the screen resolution to the minimum (Ctrl + mouse wheel) then the fields inside the form get totally messed up, i.e. the form frame becomes even smaller than the actual text areas. I wonder if there's any way I can achieve this so that regardless of the screen resolution they still preserve the same layout? thanks a lot. ps sorry about the formatting of my html code, aren't the tags supposed to indent it?. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /><title>Contact Form</title><link href="css/styles.css" rel="stylesheet" type="text/css" /> <style type="text/css">form{border:#333333 1px dotted;padding:10px;background:#EAEAEA;border-radius:7px;margin:15px;}form td{padding:1px;}th{background:#B1D8FF;padding:5px;}textarea{resize:none;}h1{font-family:"Times New Roman", Times, serif;text-align:left;font-size:20px;}label{color:#292929;}#below-title-text{font-style:italic;font-size:16px;text-align:left;padding:10px 0;}#submit-button{width:130px;height:40px;background:#B1D8FF;border-radius:5px;}</style> </head> <body><p>Any questions, doubts or suggestions?</p><form action="donate.php" method="post" name="donation form"><table><th colspan="2"><h1 >Contact Us!</h1></th><tr><td width="74"><label for ="name">Name</label></td><td width="180"><input type="text" name="name" maxlength="50" size="30"/></td></tr><tr><td><label for ="password">Email</label></td><td><input type="text" name="email" maxlength="50" size="30"/></td></tr><tr><td><label for="donation">Subject</label></td><td><input type="text" name="subject" maxlength="50" size="30"/></td></tr><tr><td colspan="2"><label for="comments">Comments</label></td></tr><tr><td colspan="2"><textarea id="ta1" name="comments" rows=10 cols=40 onKeyDown="textCounter('ta1','ta1count',300);" onKeyUp="textCounter('ta1','ta1count',300);"></textarea></td></tr><tr><td></td><td ><input name="submit" type="submit" id="submit-button" value="Submit" /></td></tr></table></form></body></html>
  9. security question for contact script.

    Hello, Does somebody know a simple security question script for my contact form.like what is 2+2 or what number comes after 7. Thanks.
  10. Please Help With My Php Contact Form

    I have this contact form and really ned help with my php file. What would i need in my SendContact.php file in order for this form to work?? Thanks <div id="left"><div id="contact_form"><font size="+2"><b>Contact us?</b></font><p><font size="-2">Please use the form below to send us a message.</p></font><form method="post" onsubmit="return sendContact();" action="sendContact.php"><p><label for="name" id="lname">Full name:</label><input type="text" class="text" name="name" id="name" onfocus="input_focus('name');" onblur="input_blur('name');" /></p> <p><label for="email" id="lemail">Email address:</label><input type="text" class="text" name="email" id="email" onfocus="input_focus('email');" onblur="input_blur('email');" /></p><div class="x"></div><p class="error" id="email-error">You must enter your email address.</p> <p><label for="category" id="lcategory">Category:</label><select name="category" id="category" onfocus="input_focus('category');" onblur="input_blur('category');"><option value="software">Website Related</option><option value="hardwae">Content Related</option><option value="consulting">Complaint Related</option></select></p> <p><label for="message" id="lmessage">Message:</label><textarea name="message" id="message" onfocus="input_focus('message');" onblur="input_blur('message');"></textarea></p><div class="x"></div> <div class="x"></div> <input type="submit" class="submit" name="send_contact" value="Send" /> </form> </div> <div id="message_sent" style="display:none;"><h1>Your message has been sent</h1><p>We'll contact you in a shortest possible time.</p><p>You can now <a href="index.html" class="read-more">go back</a> to home page.</p></div> </div> </body></html>
×