Variable not passing in HTML form to PHP sendmail script 
Author Message
 Variable not passing in HTML form to PHP sendmail script

Here is some code I am using that will not work. The problem I am having is
that the variables that are POSTed to the PHP page are not coming through.
The E-Mail is sent but, the variables show as nothing. What is wrong???

Thank,

Steve

HTML Form Page
===============================
<html>
<head>
<title>Sample Form</title>
</head>
<body>
<h1>Sample Form</h1>
<hr>
<form method="post" action=" http://www.*-*-*.com/ ;>
<p>
<b>Subject:</b><input type="text" name="subject" size="30"><br>
<input type="submit" value="Send">
<input type="reset" value="Clear">
</form>
<p>
<hr>
</body>
</html>

PHP Code
==============================
<?

$toSubject = $subject;
$toMessage = "This is only a TEST";
mail($toEmail, $toSubject, $toMessage);
?>



Sat, 23 Jul 2005 07:02:36 GMT  
 Variable not passing in HTML form to PHP sendmail script
*another* register_globals question ---- use $_POST['subject']

--

PHP POSTERS: Please use comp.lang.php for PHP related questions,
              alt.php* groups are not recommended.



Sat, 23 Jul 2005 07:06:42 GMT  
 Variable not passing in HTML form to PHP sendmail script

Quote:
> Here is some code I am using that will not work. The problem I am having
> is that the variables that are POSTed to the PHP page are not coming
> through. The E-Mail is sent but, the variables show as nothing. What is
> wrong???

<snip>

rtfm
http://www.php.net/manual/en/language.variables.predefined.php



Sat, 23 Jul 2005 07:11:46 GMT  
 Variable not passing in HTML form to PHP sendmail script

Quote:


>>Here is some code I am using that will not work. The problem I am having
>>is that the variables that are POSTed to the PHP page are not coming
>>through. The E-Mail is sent but, the variables show as nothing. What is
>>wrong???

> <snip>

> rtfm
> http://www.php.net/manual/en/language.variables.predefined.php

I think that it may be a good idea to post the FAQ url one a week so
that when newsservers expire the messages, the message with the FAQ is
still alive for users that may want to view it. Maybe a thread with the
subject "comp.lang.php FAQ <date>"

--

PHP POSTERS: Please use comp.lang.php for PHP related questions,
              alt.php* groups are not recommended.



Sat, 23 Jul 2005 22:03:55 GMT  
 Variable not passing in HTML form to PHP sendmail script
God guys make me feel stupid for asking the question..ha, I read 2 tutorials
and none of them instructed using $_POST...so I was lost. Where they using a
differant version what was their problem???

Steve


Quote:


> >>Here is some code I am using that will not work. The problem I am having
> >>is that the variables that are POSTed to the PHP page are not coming
> >>through. The E-Mail is sent but, the variables show as nothing. What is
> >>wrong???

> > <snip>

> > rtfm
> > http://www.php.net/manual/en/language.variables.predefined.php

> I think that it may be a good idea to post the FAQ url one a week so
> that when newsservers expire the messages, the message with the FAQ is
> still alive for users that may want to view it. Maybe a thread with the
> subject "comp.lang.php FAQ <date>"

> --

> PHP POSTERS: Please use comp.lang.php for PHP related questions,
>               alt.php* groups are not recommended.



Sun, 24 Jul 2005 03:29:18 GMT  
 Variable not passing in HTML form to PHP sendmail script

Quote:
> God guys make me feel stupid for asking the question..ha, I read 2 tutorials
> and none of them instructed using $_POST...so I was lost. Where they using a
> differant version what was their problem???

The superglobal arrays ($_GET, $_POST, $_SESSION, ...)  were added with
PHP 4.1.0. The default for register_globals in the php.ini is off since
4.2.0.

So the tutorials might have been written before 4.1.0 existed or with
register_globals activated (which is not a good idea).

    Matthias



Sun, 24 Jul 2005 04:09:38 GMT  
 Variable not passing in HTML form to PHP sendmail script

Quote:
> God guys make me feel stupid for asking the question..ha, I read 2
> tutorials and none of them instructed using $_POST...so I was lost. Where
> they using a differant version what was their problem???

> Steve

OMG RTFM dude! It says right on the page that I linked to that
register_globals() is off by default in 4.2.0+, and that as such you must
use the new superglobal $_ arrays. RTFM!

--
// Agelmar
-
"The high office of President has been used to foment a plot to destroy the
Americans freedom, and before I leave office I must inform the citizen of
his plight." - JFK



Sun, 24 Jul 2005 07:44:50 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. HTML form variables into a PHP function

2. Passing information to TCL scripts through html forms

3. Value entered in form is not processed by PHP script

4. php variables not passing through

5. config xitami/php: variables not passed

6. Help: PHP works with .php but not .html

7. Simple Question - Run .php form an html directory

8. Newbie Ques: PHP, MySQL & HTML Search Form

9. openMP: threadprivate not effected and function variables not passed

10. HTML Hidden Values Passed to PHP

11. newbie with a php validation form mail script problem

12. HTML Form to Python Script Problem

 

 
Powered by phpBB® Forum Software