List Info

Thread: Feedback form problem........




Feedback form problem........
country flaguser name
United States
2008-03-27 03:38:45

Hi friends,

I am new to PHP with just one month experience. I am facing
a problem with my feedback FORM PHP SCRIPT.

=========================================================

<?php

$txtname = $_POST['txtname'];

$txtemail = $_POST['txtemail'];

$txttel = $_POST['txttel'];

$txtcity = $_POST['txtcity'];

$txtselect = $_POST['txtselect'];

$txtcomments = $_POST['txtcomments'];

$subject = $txtselect;

$from = $txtname

$notes = stripcslashes($notes);

$message = "From: $txtname ($txtemail)n

Tel No: $txttel n

City: $txtcity n

Type: $txtselect n

Comments: $txtcomments n";

mail(&quot; email%40mydomain.com">emailmydomain.com", $subject, $message, $from);

?>

=============================================================

Now the script is working fine, the only thing I want is that when I receive
the email, The FROM section in my Email Inbox should show the name of the
sender , that is 'txtname'

Please tell me where am I wrong.

Thanks a lot in advance.

Waiting for the reply..

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
Re: Feedback form problem........
country flaguser name
United States
2008-03-27 18:46:42

from what i can see your code is correct and $from
should be able to pick up the name of the person
assigned in the $txtname variable, however one thing i
noticed is there is a semicolon missing in
$from = $txtname

add the semicolon and see if that makes any difference
OR use $from = $_POST['txtname'];

--- Hitesh < php%40hitesh.in">phphitesh.in> wrote:

> Hi friends,
>
> I am new to PHP with just one month
&gt; experience. I am facing
&gt; a problem with my feedback FORM PHP SCRIPT.
>
>
>
>
=========================================================
&gt;
>
>
> <?php
>
>
>
> $txtname = $_POST['txtname'];
>
> $txtemail = $_POST['txtemail'];
>
> $txttel = $_POST['txttel'];
>
> $txtcity = $_POST['txtcity'];
>
> $txtselect = $_POST['txtselect'];
>
> $txtcomments = $_POST['txtcomments'];
>
>
>
> $subject = $txtselect;
>
> $from = $txtname
>
>
>
> $notes = stripcslashes($notes);
>
>
>
> $message = "From: $txtname ($txtemail)n
>
> Tel No: $txttel n
>
> City: $txtcity n
>
> Type: $txtselect n
>
> Comments: $txtcomments n";
>
>
>
> mail("; email%40mydomain.com">emailmydomain.com", $subject, $message,
> $from);
>
>
>
> ?>
&gt;
>
>
>
=============================================================
>
>
>
> Now the script is working fine, the only thing I
> want is that when I receive
> the email, The FROM section in my Email Inbox should
&gt; show the name of the
> sender , that is 'txtname'
>
>
>
> Please tell me where am I wrong.
&gt;
>
>
> Thanks a lot in advance.
>
>
>
> Waiting for the reply..
>
>
>
> [Non-text portions of this message have been
>; removed]
>
>

__________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping

__._,_.___
.

__,_._,___
Re: Feedback form problem........
country flaguser name
United States
2008-03-28 10:13:58

- As has been pointed out already, check your error log - find out where it is by looking
in php.ini.

- You OVER code. I noted that you pulled stuff in from $_POST and then just moved it to
another variable. Why? It's much simpler to just fetch stuff from $_POST, into the
variables that you're eventually going to use.

- You also had a variable $notes, which merely did a 'stripslashes($notes)' ... BUT you
never assigned any value to $notes - at least in the snippet of code supplied.

- The biggest problems you will run into in PHP, are not ending statements with semi-
colon and misspelling.

Simplified code:

<?php

$from = $_POST['txtname'];
$email = $_POST['txtemail'];
$phone = $_POST['txttel'];
$city = $_POST['txtcity'];
$subject = $_POST['txtselect'];
$comments = stripslashes($_POST['txtcomments']);

$message = "From: $from ($email)n
Tel No: $phonen
City: $city n
Type: $subject n
Comments: $comments n";

mail (" email%40mydomain.com">emailmydomain.com", $subject, $message, $from);

?>

__._,_.___
.

__,_._,___
Re: Re: Feedback form problem........
country flaguser name
United States
2008-03-28 13:15:08

U should Use

$message= $txtname.&quot;<&quot;.$txtemail.";>" ;

or

$message="$txtname<$txtemail&gt;";

instead of

$message = "From: $txtname ($txtemail)n

On Fri, Mar 28, 2008 at 8:43 PM, Larry Helms < larr_helms%40yahoo.com">larr_helmsyahoo.com> wrote:
&gt;
>
>
&gt;
>
>
>; - As has been pointed out already, check your error log - find out where it
> is by looking
> in php.ini.
>
>; - You OVER code. I noted that you pulled stuff in from $_POST and then just
>; moved it to
> another variable. Why? It's much simpler to just fetch stuff from $_POST,
> into the
> variables that you're eventually going to use.
>;
> - You also had a variable $notes, which merely did a 'stripslashes($notes)'
> ... BUT you
> never assigned any value to $notes - at least in the snippet of code
>; supplied.
>
&gt; - The biggest problems you will run into in PHP, are not ending statements
> with semi-
&gt; colon and misspelling.
>
> Simplified code:
&gt;
> <?php
>
>; $from = $_POST['txtname'];
> $email = $_POST['txtemail'];
> $phone = $_POST['txttel'];
> $city = $_POST['txtcity'];
> $subject = $_POST['txtselect'];
> $comments = stripslashes($_POST['txtcomments']);
&gt;
> $message = "From: $from ($email)n
> Tel No: $phonen
> City: $city n
> Type: $subject n
> Comments: $comments n";
>
>;
> mail (" email%40mydomain.com">emailmydomain.com", $subject, $message, $from);
>
> ?>
&gt;
>

__._,_.___
.

__,_._,___
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )