pandik70 pandik70 - 1 year ago 125
PHP Question

Fatal error: Can't use function return value in write context on line 50

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

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
For full code I am pasting link

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

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download