Jump to content

[SOLVED] link appear after button clicked problem


zgkhoo

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.