Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHTML Form problem

This form USED to work!



9:34 pm on Oct 3, 2002 (gmt 0)

10+ Year Member

I have been using this as a form for about 10 months, I have NOT changed the code at all. It is used to gather e-mail addresses off a website now I am getting:
"Notice: Undefined variable: email in 'mydomainandfile.phtml' on line 17"

The PHTML page I have looks like this (I deleted all the HTML lines at the top so line 17 is actually line 2 now):

if ($email) {



//send the mail

/* comments

mail ("myemail@whatever.com", "**Mailing List**", $email, "From: $email\n");

echo "<h4>Thanks...You'll be getting really cool stuff now.<br>
<a href=/originalhtml.html>No place like Home</a></h4>


} else {
echo "
<h3>I'm sorry please try again.</h3>

<p><a href=\"javascript:history.back()\">



What the heck am I doing wrong!?!?! This stuff USED TO work! I can't figure it out.


9:51 pm on Oct 3, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Perhaps your hosting provider turned off the register_globals option for php. Try importing all the external variables you use explicitly from the $_GET or $_POST arrays, depending on what method you are using to submit the form..


$form_field = $_POST['form_field'];

or, if you have a version of PHP prior to 4.1,

$form_field = $HTTP_POST_VARS['form_field'];


10:50 pm on Oct 3, 2002 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

did dingman get it?

sounds like the right answer to me. One question for anyone who wants to answer. What is this?


I could be thick at the moment, no more than other times, but I don't get that.


Featured Threads

Hot Threads This Week

Hot Threads This Month