This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Dick Fast Fart
almost 11 years

PLZ HELP!!!

I dont see the error in my code i pressend the submit button 2000 times nothink changes it keep writing Oops, try again! Did you create a function called greetings using the function greetings() syntax? Check the Hint if you need help!

Answer 519e7c10820523f28400095d

2 votes

Permalink

function PHP.

   <?php 
   $name= "andres";
    function greetings ($name){
        echo "Greetings," . $name. "!";
    }
    
    greetings($name);
    
    ?>
points
Submitted by Carlos Hernandez
almost 11 years

1 comments

Ilya over 10 years

No argument passed to the function, like this greetings(“Your Name”);

Answer 515f8f10fe3fec54c8000b5d

0 votes

Permalink

Your code should look like this:

<?php
function greetings ($name) {
echo "Greetings, " . $name . "!";
}
greetings("Tom");
?>

Your setting your parameter when your calling your greetings function.

points
Submitted by lucaz5520
almost 11 years

2 comments

Ilya almost 11 years

Wrong! “=” not need after “function”

lucaz5520 almost 11 years

yeah it worked for me.. but instead of function = greetings ($name) you have to remove the = sign and just function greetings ($name).. thats how it worked for me I just copied his code and didn’t catch the error with the = sign

Answer 515fcaad5f8fb34c86001694

0 votes

Permalink

When the check is fixed? I click “submit” every day again and again and it’s shows me “Oops, try again! It looks like nothing was printed! Did you remember to call your function? (Check the Hint if you need help.)”! alt text But my code is right, i checked it on local web-sever:

<?php
        function greetings ($name) {
        echo "Greetings, " . $name . "!";
        }
        greetings("Ilya");
 ?>
points
Submitted by Ilya
almost 11 years

Answer 516129015b08ed3e720034e9

0 votes

Permalink

I added parentheses around the output line. I also added a line between the function definition and the call.

Don’t know which fix, if any, made the difference, but they didn’t seem to hurt, and the code ran.

    <?php
    function greetings ($name) {
        echo ("Greetings, " . $name . "!");
    }
    
    greetings ("Gary");
    ?>
points
Submitted by Gary Davison
almost 11 years

Answer 540c70d59c4e9d61e4008d78

0 votes

Permalink

it worked for me.

points
over 9 years