Jump to content

help?


JamesWat

Recommended Posts

hi, im very new to using php, i eventually want to use it to control a mysql db but for now i have a few questions...

a) when i want to use php to ad a link to a page ie echo "<a href="www.example.com>Click Here</a>"; i always get an error i am assuming because what is sees it the "s around the link, how do i include these?

 

b) i want my headings and menu to be used as an included file, however one line of text changes depending on what page you are viewing, ie home, about us, links etc what is the best way to do this?

 

thanks for your help :)

Link to comment
https://forums.phpfreaks.com/topic/41722-help/
Share on other sites

Guest footballkid4

As for the first question, it should look like:

echo "<a href=\"sitename\">Site Text</a>";

Notice the slashes in front of the quotes.  PHP needs to know where the string ends.  By adding a slash before a quote, PHP knows that's not the end of the string, and continues to look for the next quote.  This process of adding slashes is called escaping characters.

Link to comment
https://forums.phpfreaks.com/topic/41722-help/#findComment-202274
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.