Web Hosting Talk







View Full Version : Help!!!!!


Anime Master
01-05-2002, 09:23 PM
can anyone tell me how do do links in PHP? the normal html form for linking doesnt work for me!!! I need to know!!!!

Varun Shoor
01-05-2002, 09:34 PM
Originally posted by Anime Master
can anyone tell me how do do links in PHP? the normal html form for linking doesnt work for me!!! I need to know!!!!

<?php echo "<a href='http://www.yahoo.com'>Click Here to Yahoo!</a>" ?>

??? :confused: :confused: :confused:

serve-you
01-05-2002, 09:34 PM
HTML works exactly the same in PHP. You just need to make sure that the PHP knows what to do with it. For example, you can do the HTML outside of the actual PHP. like this
<?php
code goes here
?>
<HTML>
<HEAD>
</HEAD>
<BODY>
<A HREF="blah">blah</A>
</BODY>
</HTML>
<?php
more code here
?>

or you can use "echo" to post the HTML within your PHP. Example:
echo "<HTML>"
."<HEAD></HEAD>"
."<BODY>"
."<A HREF=\"blah\">blah</A>"
."</BODY>"
."</HTML>"

-Dan

cheesysticks
01-05-2002, 09:55 PM
Escaping quotes within echoed php :

."<A HREF=\"blah\">blah</A>"

(not needed when using ')

serve-you
01-05-2002, 10:01 PM
Originally posted by cheesysticks
Escaping quotes within echoed php :

."<A HREF=\"blah\">blah</A>"

(not needed when using ')

Doh!
Thats what I get for typing too fast. Edited the post, thanks cheesysticks.

-Dan