homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

PHTML Form problem
This form USED to work!

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

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)

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)

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved