You are here: Re: Hyperlinks in PHP anyone? « PHP Programming Language « IT news, forums, messages
Re: Hyperlinks in PHP anyone?

Posted by Guido Winkelmann on 09/09/05 02:02

monomaniac21 wrote:

> Hi i'm trying to write a piece of code which writes the message on
> screen "access denied" telling the user he can't access this page
> without logging in and then offering a hyperlink to the login page.
>
> Like this:
>
> if ($queryrows)
> {
> echo("Welcome to the birthdays page");
> }
> else
> {
> echo("Access denied<br>");
> echo("<a href="index.php">click here to access the login page</a>");
> }
[...]

As R. Rajesh Jeba Anbiah already pointed out, you can use HTML directly.

Another thing you should be aware of is that you cannot have "'s inside a
string delimited by ". Your <a href="index.php"> does exactly that, causing
PHP to think the string ends right after href=. If you need "'s inside a
string you will either have to use another delimiter (like ') or escape
them with backslashes like this:
echo("<a href=\"index.php\">click here to access the login page</a>");

Guido

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация