zgkhoo Posted August 18, 2007 Share Posted August 18, 2007 if(isset($_REQUEST['button'])) { <a href=home.php>home</a> <--this line got error.. } i intend to write after the user click the button then appear a "HOME" word link and when the user click the "HOME", then it bring user back to the main page. but i write like that got error, and if i put the bellow which with <html> tagas..also cant.. if(isset($_REQUEST['button'])) { <html> <a href=home.php>home</a> <--this line got error.. </html> thanks.. Link to comment https://forums.phpfreaks.com/topic/65589-solved-link-appear-after-button-clicked-problem/ Share on other sites More sharing options...
Fadion Posted August 18, 2007 Share Posted August 18, 2007 if(isset($_REQUEST['button'])) { echo "<a href=\"home.php\">home</a>"; } If u want to print html inside php u have to echo it and also consider escaping double quotes with slashes. An alternative may be: <?php if(isset($_REQUEST['button'])) { ?> <a href=home.php>home</a> <?php } ?> In this way u have html and php code working individually, but that probably a good way when dealing with large amount of html code which may be frustrating to echo and escape. Link to comment https://forums.phpfreaks.com/topic/65589-solved-link-appear-after-button-clicked-problem/#findComment-327488 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.