php form action : second action ??
I am trying to build an online multiple choice test and got some fantastic help here: http://www.linuxquestions.org/questions/programming-9/replace-numbers-with-a-sequence-in-php-ising-vim-or-geany-4175539014/">
When I click the "submit" button on the test page, the script displays the total correct: Code:
echo "<div id='results'> $totalCorrect / 100 correct</div>"; Code:
<?php Code:
echo "<div id='results'> $totalCorrect / 100 correct</div>"; I hope this makes sense. I'm really at the edge of my (current) abilities :) Thanks |
Here's an example email form that I recently did in my web design class at school.
Code:
<?php |
Yes, you can do two different things in a PHP program.
Code:
<?php |
I am trying to add the mail function to my php file. Unfortunately, things aren't going as smoothly as I would like.
I started from the ground and worked upwards. The following worked: Code:
mail('me@myaddress.com', 'test test test', 'my message'); Code:
$to = 'me@myaddress.com'; Code:
if ( isset($_POST [submit]) ) So. The following fails to send an email: Code:
if ( isset($_POST [submit]) ) I can see that the issue is with the "if" part - when I remove it, a message (without the $totalCorrect / 100) comes through. What am I doing wrong? :) |
Did you double-check that "submit" is properly defined as the name for your Submit button?
Code:
<input type="submit" name="submit" value="Send" /> |
Quote:
Code:
|
Code:
$message = $totalCorrect; Actually, I mean that it gives me what I want until I hit my next road block. Onwards and upwards. Thanks. |
It's very useful ... critical, really ... to use the debugging ("developer") facilities of your browser to s-e-e what is actually being sent to the server, and what the server actually sends back.
Very often, the hardest thing about troubleshooting a program is: to s-e-e what it is now doing. |
All times are GMT -5. The time now is 02:34 PM. |