nameez
07-18-2005, 02:41 AM
this code is supposed to echo "YES" once clicked on it...but it doesnt, can anyone explain it to me..i'm new here...
code:
<a href="test.php?live=yes">Page Status Live =<? if(isset($live)) { echo "Yes";}else{echo "No";}?>
and how does the isset work?
Thanks
VolkNet
07-18-2005, 03:31 AM
I tested the code and it does work.
Remember to include the closing </a> tag and to save the document as a .php document.
Additionally, your server must be php compatible.
Burhan
07-18-2005, 03:34 AM
if your PHP version has register_globals turned off (as it should by default), then you need to alter it thus:
<a href="test.php?live=yes">Page Status<?php (isset($_GET['live'] && $_GET['live'] == 'yes') ? echo 'Yes' : echo 'No'; ?></a>
kailash
07-20-2005, 01:47 AM
<a href="test.php?live=yes">Page Status Live =<?php if(isset($live)) { echo "Yes";} else {echo "No"; }?></a>
This works for me. Is $live a variable that is POSTed or passed through the query string or is it internal?
nameez
07-20-2005, 02:21 AM
OK Guys Thanks for the reply and i'll check out with the replied fyrestrtr's code...and i think it should work...cos i see the $_GET there which i wonder why not in my code...
and if pssble fyrestrtr wat rae register_globals...:-(
kailash
07-20-2005, 02:56 AM
register_globals is a variable that you find in your PHP configuration file, that is php.ini
You need to have root previlages to edit it, else you might want to contact your hosting company
Burhan
07-20-2005, 03:28 AM
For more information on register globals, please read:
http://php.net/register_globals