I am sending information to a php file through a AJAX post mat hod and the PHP can echo the data but will not assign it to a variable and I can not seem to understand why. The first echo works but the second echo only seems to get the hours. The AJAX in not encoded.
I just learned PHP a few weeks ago so I expect this problem to be very simple to fix.
Thank you
<?php
echo ($_POST['userName']);
$usernam = ($_POST['userName']);
$eventid = ($_POST['eventid']);
$hours = ($_POST["hours"]);
echo $eventid+$usernam+$hours+"<br><br><br>";
?>
"are parsed, strings inside single quotes'are not. Soecho "$a";gives the value of a, the same asecho $a;butecho '$a';gives the literal string$anot its value. Parentheses()like in math are used to force precedence (isolate a calculation/condition), e.g.($a - $b) * $cmay not equal$a - $b * $candif (($a || $b) && $c)may not equalif ($a || $b && $c)