Re: Beginner Questions regarding Mail and Forms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi jochem,

thanks. i've tripplechecked on the names, but just in case I miss something
obvious, I'll post the entire snippets.

+++ HTML form +++
<form action="templates/prokop/submit.php" method="post">
<input  type="hidden" name="_type" value="2">

<div class="FormLabel">Name <span class="translate">Name</span>:</div>
<input type="text" name="_txtName" maxlength=50>

<div class="FormLabel">Email-Address <span class="translate">E-Mail
Adresse</span>:</div>
<input type="text" name="_txtEmail" maxlength=50>

<div class="FormLabel">Age <span class="translate">Alter</span>:</div>
<input type="text" name="txtAge" maxlength=50 style="width:70px";>

<div class="FormLabel">Gender <span
class="translate">Geschlecht</span>:</div>
<select name="_optGender" style="width:150px;">
<option value="female" selected>female | weiblich
<option value="male">male | mÃnnlich
</select>

<div class="FormLabel">Anything more to say? <span class="translate">Noch
ein Kommentar?</span></div>
<textarea name="_txtInfo" rows="3"></TEXTAREA>

<div class="SubmitButton">
<input type="submit" name="_btnSubmit"  value="Submit">
</div>

<br>
</form>
+++
+++ PHP file +++
$name = $_POST['_txtName'];
$email = $_POST['_txtEmail'];
$age = $_POST['txtAge'];
$gender = $_POST['_optGender'];
$info = $_POST['_txtInfo'];

$message = "Name: " . $name . "\n";
$message .= "Email: " .$email . "\n";
$message .= "Age: " . $age . "\n";
$message .= "Gender: " . $gender . "\n";
$message .= "Info: " . $info;
try {
mail("bla@xxxxxxxx", "Request", $message, _getMailHeaders($name, §email));
}
catch(Exception $e)
{
    ...
}
+++


"Jochem Maas" <jochem@xxxxxxxxxxxxx> schrieb im Newsbeitrag
news:45D069F4.5070905@xxxxxxxxxxxxxxxx
> Matthias S. wrote:
> > hi zoltan,
> >
> > thanks for your reply. i've tried the -f switch but the only effect it
has
> > is an error message ;)
> >
> > Warning: mail() [function.mail]: SAFE MODE Restriction in effect. The
fifth
> > parameter is disabled in SAFE MODE.
>
> which another way of saying 'my hosting env sucks' - but that's besides
the point.
> (short story: 'safe mode' isn't)
>
> >
> > as for the age value:
> > it is simply incorrect because it is always empty... input might be for
> > example 25, but the var $age contains always an empty string.
> >
> > Can you help? I'm a programmer (C++)
>
> so the concept of debugging code should not be new to you.
> so hello to print_r(), var_dump() and echo - they are your friends.
>
> e.g. stick the following at the top of your script (to start with):
>
> var_dump(
> $_POST['_txtAge'],
> $_POST
> );
>
> my guess is your form element name and post array key are not identical.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux