As the title says, here is the code :

<?php

$lvl=1;
$xp=0;
if ($xp <50)
{
echo $lvl ;
};
if ($xp >51)
{
echo $lvl+1;
}
return $lvl;

if ($xp >101)
{
echo $lvl+1;
};


?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Xp : <input name="xp" type="text" />
<input type="submit" name="add" />
</form>

The script will not post my lvl after i introduce xp.
When i tested the script i allready have show 1. And i didnt even insert my xp.
Where i did wrong or what is missing.


P.S. im new to php please be gentle.

A) Use code tags
B) It's always going to echo 1
C) You're not retrieving data from the request (in this case $_POST D) Go read the PHP manual http://php.net and w3schools.com

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.