Real Estate Forums

Coding HTML, ASP, PHP, JAVA MYSQL and more. All coding questions should be asked here.

Reply
 
Thread Tools Display Modes
Old 05-18-2007, 09:48 PM
RESteve's Avatar
RESteve RESteve is offline
Moderator
 
Join Date: Sep 2005
Location: Houston, TX
Posts: 1,473
RESteve is on a distinguished road
Default Coding a HTML Link in PHP

Hi guys,
I'm having trouble formatting a link to this line of PHP code:

Code:
DEFINE("LANG_FORM_RESTRICTED","Please login or register to post comments.");
What is the correct format for making the word, "register" a link with a title tag as well?
__________________
Steve Castaneda, Realtor
Keller Williams Realty
The MyHomeHouston Team

Specializing in Houston Real Estate. Feel free to visit my Houston Real Estate Blog or read about Real Estate Technology for agents.
Reply With Quote
Old 05-19-2007, 12:25 AM
ChiliPepperWeb ChiliPepperWeb is offline
Advancing Webmaster
 
Join Date: May 2007
Location: Houston, TX
Posts: 70
ChiliPepperWeb is on a distinguished road
Default Re: Coding a HTML Link in PHP

There may be a little more to it since my PHP is largely self-taught, but I know that putting html tags inside PHP usually requires you to put backslashes in front of all the interior quote marks. I would try it like this:

Quote:
DEFINE("LANG_FORM_RESTRICTED","Please login or <a href=\"myfile.html\">register</a> to post comments.");
If I'm missing some information here somebody please correct me, but I know I've had to do this before and it's at least partially right, it's just been a while.
__________________
Stacy Clifford
ChiliPepperWeb.net
Open-Realty Hosting
Reply With Quote
Old 05-19-2007, 01:09 AM
DCVegas's Avatar
DCVegas DCVegas is offline
Advancing Webmaster
 
Join Date: May 2007
Location: Las Vegas
Posts: 34
DCVegas is on a distinguished road
Default Re: Coding a HTML Link in PHP

Code:
DEFINE("LANG_FORM_RESTRICTED","Please login or <a href=\"register.php\" title=\"Register Here\">register</a> to post comments.");
__________________
Jeff
admin@dcvegas.com
Diversified Computation
http://www.dcvegas.com
Reply With Quote
Old 05-19-2007, 01:44 AM
ChiliPepperWeb ChiliPepperWeb is offline
Advancing Webmaster
 
Join Date: May 2007
Location: Houston, TX
Posts: 70
ChiliPepperWeb is on a distinguished road
Default Re: Coding a HTML Link in PHP

Yeah, I didn't fill out the whole href tag, but at least I was on the right track. Use DCVegas's line Steve, it's more correct.
__________________
Stacy Clifford
ChiliPepperWeb.net
Open-Realty Hosting
Reply With Quote
Old 05-19-2007, 08:43 AM
RESteve's Avatar
RESteve RESteve is offline
Moderator
 
Join Date: Sep 2005
Location: Houston, TX
Posts: 1,473
RESteve is on a distinguished road
Default Re: Coding a HTML Link in PHP

That worked great, thanks guys!

Just so I understand, the "\" character in PHP escapes the next character from being recognized in PHP, right? Or something like that? I know that the " character caused issues in the syntax since it is used elsewhere in this line of code.
__________________
Steve Castaneda, Realtor
Keller Williams Realty
The MyHomeHouston Team

Specializing in Houston Real Estate. Feel free to visit my Houston Real Estate Blog or read about Real Estate Technology for agents.
Reply With Quote
Old 05-19-2007, 12:50 PM
DCVegas's Avatar
DCVegas DCVegas is offline
Advancing Webmaster
 
Join Date: May 2007
Location: Las Vegas
Posts: 34
DCVegas is on a distinguished road
Default Re: Coding a HTML Link in PHP

The backslash escapes double quotes in php - so php doesnt 'see' the double quotes, but only prints out the whole string constnat you defined.
__________________
Jeff
admin@dcvegas.com
Diversified Computation
http://www.dcvegas.com
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



For our members

Main Sections

IDX Coverage Areas

Spiders Welcome

All times are GMT -7. The time now is 11:38 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.