Programatic php 'a' link goes to 403

Username (e.g. epiz_XXX) or Website URL

Error Message

403: Forbidden

Other Information

Here’s the php echo code that puts a button on the web page:

echo "<a href=\"\"><button>Volver al inicio</button></a>";

When I click on that button, I end up at a beautiful “403: Forbidden”, instead of the main page of my site.
How can I effectively add a “Go to Home” button and make it work? Is it the “A” anchor tag? is it sth else?
I already tried setting up the button outside the php script, and be plain HTML instead of the effect of “echo” (not sure how that would change anything, echo is just the same as writing the pure html right down on the document itself).

echo '<a href="/"><button>Volver al inicio</button></a>';

I don’t think the URL href=\"\" goes where you think it goes.

If you specify a URL like that, it’s assumed to be a path. So if you are currently on the URL, that link will go to the URL, which is probably not what you want.

This StackOverflow answer has a quite detailed explanation on how you can write URLs, and how they will be interpreted:


This worked.
I don’t know why, but it leaves me with a strange feeling, like the answer was so simple and beginner-level, that I can’t believe I didn’t figure it out myself earlier.
Thank you all who contributed with an answer.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.