echoing post variables

Hey guys, I’m having trouble with echoing some post variables. My goal is to echo some post variables that may or may not have been submitted by the user.

if ($_POST['charname']) { echo " $_POST['level']"</br>"; #line30 $_POST['class']"</br>"; "}

I keep on getting

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in something.php on line 30

Thanks for any help.

Your asking if $_POST[‘charname’]. What about it? You need to define what it is about $_POST[‘charname’] that you are wanting to check. For example, does it equal a particular value? Or you can just see if it has been set (isset) by a form submit. Try this…

if (isset($_POST['charname'])) {
echo $_POST['level'] . "</br>" . $_POST['class'] . "</br>";
}
Sponsor our Newsletter | Privacy Policy | Terms of Service