Newbie looking for some help and tips

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
php-forum Active User
php-forum Active User
Posts: 300
Joined: Sun Dec 11, 2011 12:51 am
Location: Shrewsbury, Shropshire

Sun Oct 21, 2012 11:29 pm

Firstly I would simplify your code by removing the functions (not needed as such a simple if else) and remove the last empty else as not required. The reason it is not working though is because you need to use == to compare variable values, not just =.

Code: Select all

$action = $_GET['action'];

if ($action == "next") 
{ echo 'NEXT'; }
elseif ($action == "back") 
{ echo 'BACK'; }

Post Reply