I'm trying to attribute a value to a var depending of its text value. I can't just attribute the numerical value directly (via my form) because i'm also saving in my database the text value.
$section = $_POST['section']; // required
$page = $_POST['page']; // required
if ($_POST['page'] == 'Template') { $Code == '00'; }
elseif ($_POST['page'] == 'Menu') { $Code == '01'; }
elseif ($_POST['page'] == 'Home Page') { $Code == '02'; }
elseif ($_POST['page'] == 'About Us') { $Code == '03'; }
elseif ($_POST['page'] == 'Contact Us') { $Code == '04'; }
$Code_Page = $Code.''.$section;
Exemple, the code for the section 18 of the Home Page is 0218.
I don't understand why it doesn't work ? Only the second part is saved ($section), not the first 2 numbers.
Thanks in advance