Passing Strings from HTML to PHP

the mail() function

Moderators: macek, egami, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 2
Joined: Sat Feb 18, 2017 10:07 pm

Passing Strings from HTML to PHP

Post by quarinteen » Mon Mar 13, 2017 10:58 am

Hello have what is probably a basic question. Cant seem to get strings to pass from a HTML form to a PHP script. Below is just a snipe

<input id="name" type="text" name="name" placeholder="Your Full Name" />

passes to separate form
$Name = Trim(stripslashes($_POST['name']));

then it is put in the body of an email and sent
$Body = "";
$Body .= "Name: ";
$Body .= $Name;

When it comes to my email all thats there is Name: then the string is missing. Any help would be appreciated. Thank you.

php-forum Active User
php-forum Active User
Posts: 286
Joined: Mon Feb 22, 2016 5:52 pm

Re: Passing Strings from HTML to PHP

Post by hyper » Wed Mar 15, 2017 11:34 am

Do you have a full form, or just the input field?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest