Page 1 of 1

echo href?

Posted: Sun Dec 27, 2009 1:43 pm
by Jamiee
Hey guys.

Completely new to PHP and MySQL.

Was wondering if you knew how to generate a href in PHP...
Probably the stupidest question going but still important to me :)

So in raw HTML form:

Code: Select all

<a href="example.php>Click</a>
How would i translate that to functioning php?

Here's what i have now...

Code: Select all

echo "<a href="upload/">Upload More.</a>"';'
Thanks in advance!
Regards,

Re: echo href?

Posted: Sun Dec 27, 2009 2:46 pm
by omniuni
Tip: Using single-quotes you can use double-quotes in your statement:

Code: Select all

<?php echo '<a href="example.php">Click</a>';?>
Otherwise, you need BACKslashes, not forward slashes.

Code: Select all

<?php echo "<a href=\"example.php\">Click</a>";?>