homepage Welcome to WebmasterWorld Guest from 54.196.199.46
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Visit PubCon.com
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!
pillageTHENburn




msg:1260748
 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) {

"
Email:$email

";

//send the mail

/* comments
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()\">
Click</a></p>

";
}

?>

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

 

dingman




msg:1260749
 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..

eg,

$form_field = $_POST['form_field'];

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

global $HTTP_POST_VARS;
$form_field = $HTTP_POST_VARS['form_field'];

jatar_k




msg:1260750
 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?

"Email:$email";

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