| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Member | Hello Here is what i need to achieve. A php contact form with validation. Name: ..... * mandatory Email.... same thing checkbox....not mandatory and 1 multiple choice field with mandatory things (either 1 of them): Do you want to buy this: yes no. Now when they don't fill a field a pop-up must tell them to complete it and also when i receive the email i must see the fields name like: Name.... Email... and so on. thank you |
| |
| | #2 (permalink) |
| Senior Member | well i feel that spoonfeeding isn't useful, so i'll give you some starting points. start with making the form in html, and making sure you have name= for each input. then, in PHP, to call the input, use the variables $_POST['nameofinputgoeshere']. do some checks on them like if($_POST['username']=="") { echo "Fill in username"; }. make sure you addslashes and strip_tags on the $_POST vars just to prevent injection. once all the checkings done, use the mail function. references to all these functions can be found on php.net.
__________________ Hacksar.com - Your source for random computer tips and tricks! MySiteMemberships.com - Keep track of your site registration information! Like my post? Rep is appreciated! |
| |
| | #3 (permalink) |
| NamePros Legend | just use the .php form i've uploaded from secondversion.com it's contactbox.txt rename it to whatever you like make sure it's extension will be .php for it to run, replace my email there william[@]nabaza.com with your email address or an email address where you want the form field data to be sent to. use the sample codes of javascript to validate your form field entries. http://www.w3schools.com/js/js_form_validation.asp HTH |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |