| | |
New to php and getting frustrated
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2005
Posts: 3
Reputation:
Solved Threads: 0
Hello,
( Sorry I originally posted this on the wrong forum)
I am trying to do a simple form (text fields only). The users enter, submit, then there is a confirmation page and information is sent to an email. When 'submit' is clicked there is no information returned from the $_POST variable. Here is the code:
[PHP]
$to="MyEmail@MyAddress.com";
$subject=$_POST['course'];
echo "<p>Thank you" $_POST['name'] "!<br>";
echo "Your assignment for" $_POST['course'] "has been submitted.";
//mail string to send to email
$msg = "NAME: " $_POST['name'];
$msg .= "LICENSE NO: " $_POST['license'];
$msg .= "EMAIL: " $_POST['email'];
$msg .= "DATE: " $_POST['mydate'];
$msg .= "QUESTION 1: " $_POST['q1'];
$msg .= "QUESTION 2:" $_POST['q2'];
$headers ="FROM: " $_POST['email'];
//set up mail
mail($to,$subject,$msg,$headers);
?>
[/PHP]
The form action and textfields values are correct. I get the "text" but nothing from the html form. Now, my remote host supports php, so thats not an issue. I am working in DWMX 2003, PHP 5.0.2, on WinXP pro.
I am getting very frustrated and could really use some expertise.
Thanks.
( Sorry I originally posted this on the wrong forum)
I am trying to do a simple form (text fields only). The users enter, submit, then there is a confirmation page and information is sent to an email. When 'submit' is clicked there is no information returned from the $_POST variable. Here is the code:
[PHP]
$to="MyEmail@MyAddress.com";
$subject=$_POST['course'];
echo "<p>Thank you" $_POST['name'] "!<br>";
echo "Your assignment for" $_POST['course'] "has been submitted.";
//mail string to send to email
$msg = "NAME: " $_POST['name'];
$msg .= "LICENSE NO: " $_POST['license'];
$msg .= "EMAIL: " $_POST['email'];
$msg .= "DATE: " $_POST['mydate'];
$msg .= "QUESTION 1: " $_POST['q1'];
$msg .= "QUESTION 2:" $_POST['q2'];
$headers ="FROM: " $_POST['email'];
//set up mail
mail($to,$subject,$msg,$headers);
?>
[/PHP]
The form action and textfields values are correct. I get the "text" but nothing from the html form. Now, my remote host supports php, so thats not an issue. I am working in DWMX 2003, PHP 5.0.2, on WinXP pro.
I am getting very frustrated and could really use some expertise.
Thanks.
maybe the html isn't setup correctly in the form (did you set the name correctly)?
http://www.daniweb.com/techtalkforums/thread16533.html
i think this is accomplishing what you are trying to do!
http://www.daniweb.com/techtalkforums/thread16533.html
i think this is accomplishing what you are trying to do!
![]() |
Similar Threads
- PHP / My SQL Web developer (Web Development Job Offers)
- system("ls") okay, system("cp") not. Why? (PHP)
- Java or PHP? (IT Professionals' Lounge)
- New to php and getting frustrated (HTML and CSS)
- PHP > Alaric (PHP)
- IE is hijacked by http://th.msie.cc/index.php?aid=20035 (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: What program .....
- Next Thread: PHP Query, Make users login before accessing a movie?
Views: 1938 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery js limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube





