Closed (fixed)
Project:
Drupal Developer
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Support request
Assigned:
Reporter:
Created:
23 Mar 2009 at 00:41 UTC
Updated:
23 Mar 2009 at 20:09 UTC
Hi,
I have inserted a php function on a node, that is suppose to return a number but when the submit button is clicked, it will take you to index.php instead of returning the result number.
here is my code:
$num_to_guess = 42;
$num_tries = (isset($_POST[num_tries])) ? $_POST[num_tries] + 1: 1;
if (!isset($_POST[guess])) {
$message = "Welcome to the guessing machine!";
} elseif ($_POST[guess] > $num_to_guess) {
$message = "$_POST[guess] is too big! Try smaller number";
} elseif ($_POST[guess] < $num_to_guess) {
$message = "$_POST[guess] is too small! Try a larger number";
} else { // must be equivalent
$message = "Well done!";
}
$guess = $_POST[guess];
echo $message
Guess a number: echo $num_tries;
Type your guess here
echo $guess; ">
echo $num_tries; ">
Thanks
Comments
Comment #1
snufkin commentedThis is the issue queue of the installation profile drupal_developer, please ask this question on the forums as you will likely receive more attention there. Thank you.