Just want to do $_SERVER['PHP_SELF']
as a link with ?logout=1 appended to it.
<a href="<?php echo ''$_SERVER['PHP_SELF']'.logout=1' ?>" id="add"><input type="button" value="LOGOUT" /></a>
gives
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in F:\export\srv\www\vhosts\main\htdocs\php\assign3\m_a2_functions.php on line 90
Change:
To:
This may be a place where
printf()
would come in handy.This cuts down on the number of times we hop in and out of a string.
have you tried:
Your quotes are all over the place:
You are defining an anchor (<a>) and putting a button inside it, but the button will not send you to that url. You should make the "onclick" event of the button redirect the user to the page you want.
Also, if you just want to add a variable to the current URL you don't really need to use PHP_SELF, the browser will know what to do.