Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

a contact form question so basic, im embarrassed.

Featured Replies

As the title might suggest, I'm not so hot with PHP, and have decided to try use a PHP contact form on my brother in laws site, I can confirm this to be true.



As it stands, the Form is posting, but only one variable seems to be sent correctly from the form to the PHP mailing code, so all I see in the test emails are:



Name:


Email Address:


Phone Number:


Subject: The subject is working...


Message:



The code was taken from a basic enough example on a website. Here is the form table:


http://pastebin.com/FN5z1RAm



And here is the 'send-email.php'


http://pastebin.com/qkpip4Z5



As I said.. the 'subject' field is the only one that works, so I'd love to hear how dopey im being ;)


Thanks a lot guys.


In line 16 the variable for the Full Name field is set to $name

$name = $_POST['fullname']; // required

In line 29 you validate $name

   if(!preg_match($string_exp,$name)) {

However in line 47 you use $fullname

    $email_message .= "Name: ".clean_string($fullname)."\n";

Try using

    $email_message .= "Name: ".clean_string($name)."\n";

as line 47

  • Author

thank you! solved it! got my wires crossed a bit. thanks again chief!

No probs. Glad it was an easy one.

 

Actually it is quite a simple yet common error to make and I dare say we've all done it and will continue to do it now and again. :)

No probs. Glad it was an easy one.

 

Actually it is quite a simple yet common error to make and I dare say we've all done it and will continue to do it now and again. :)

 

Guilty! I find I end up writing down the form field names whilst developing helps prevent this sort of thing :D

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.