1

I am doing sharing form and I can´t find out the problem. What am I doing wrong?

<?php 
        if ($hlaska)
            echo('<p>' . htmlspecialchars($hlaska) . '</p>');

        $vasemail = (isset($_POST['vasemail'])) ? $_POST['vasemail'] : '';
        $email = (isset($_POST['email'])) ? $_POST['email'] : '';
        $predmet = (isset($_POST('predmet')) ? $_POST['predmet'] : '';
        $zprava = (isset($_POST['zprava'])) ? $_POST['zprava'] : '';
?>

This is code about line 50. Line 50 is starting with $predmet

If I comment or delete all code contenting something with $predmet it works as it should. $predmet is in English $subject FYI.

1
  • now u have 2 solutions given below, test it Commented Oct 28, 2016 at 10:47

1 Answer 1

5

Just because of this $_POST('predmet')

This should be:

$predmet = (isset($_POST['predmet'])) ? $_POST['predmet'] : '';

You are getting the Fatal Error because this $_POST('predmet') consider here as a method which is wrong this is Super Global.

Sign up to request clarification or add additional context in comments.

4 Comments

Waah Bhai. Umda
@NanaPartykar: :)
Thank you, didn´t realise it.
@pandik70: glad to help u

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.