Topic awaiting preservation: links in PHP |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: New York City |
posted 05-31-2003 18:15
Alrighty. A few months ago I (with the assistance of you kind folks and the people at devshed) developed this PHP/MySQL database for my client where people can search dealers that sell his product. My client is inquiring about how to make the email, webpage, and mapquest map links people can click on. How can I do this? Just point me in the right direction and I will make my best effort: |
Bipolar (III) Inmate From: Berlin (almost) |
posted 05-31-2003 18:31
It's not all that difficult. All you'll have to do is inserting <a> tags around the data you already have. |
Bipolar (III) Inmate From: New York City |
posted 05-31-2003 19:18
hey! Yup. I caught that "mailto:" as well. Thanks so much Now, I am trying to use what you gave me and apply it to the website link. Go back to the database drop down menu and choose "California." From the retrieved info, click on any of the homepage links. What is happening is that PHP is assuming the URL is on the same server. I was thinking of using a target=_blank somewhere . . . what do you think? |
Bipolar (III) Inmate From: Berlin (almost) |
posted 05-31-2003 20:03
That's because the URLs you have there don't start with "http://" - if you're sure that it's the same with all other links in the db you could just let PHP add it. |
Bipolar (III) Inmate From: New York City |
posted 05-31-2003 20:14
quote:
|
Paranoid (IV) Inmate From: Milwaukee |
posted 05-31-2003 20:18
Putting \r characters in your code will put carriage-returns in the site source, not the browser output; for best results, use "<br />\r\n" if you're on a Windows server, or "<br />\n" if you're on Unix/Linux. My advice is to use just "\n" exclusively; since the web is pretty much built on Unix, that'll give you accurate results across the board. ("\n" is UNIX-style, "\r\n" is Windows style, and just "\r" is Mac style.) |
Bipolar (III) Inmate From: New York City |
posted 05-31-2003 20:53
Thanks PF- I will follow your suggestion. |
Bipolar (III) Inmate From: Berlin (almost) |
posted 05-31-2003 21:45
You'll have to realise what exactly the single quotes and dots do in that line... |
Bipolar (III) Inmate From: New York City |
posted 05-31-2003 22:34
Thanks for explaining Kuckus. I still am having problems with this portion of code. I took out the quotes surrounding the "Link to Map" words like you instructed but was unclear about missing double-quotes around URL in href: |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 05-31-2003 23:28
CR08 |
Bipolar (III) Inmate From: New York City |
posted 06-01-2003 00:01
Thank you both for taking the time to explain. I think I now beginning to understand. Single quotes surround html strings, double quotes are used only when applying to html (ie <a href=" "> </a> ), and PHP variables are separated from the main string by a dot. |
Bipolar (III) Inmate From: Berlin (almost) |
posted 06-01-2003 10:18
CRO8: Yup, that's looking good |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 06-01-2003 10:18
in that case you'll have to check first, if it's a null field, and only print the link when there is data in it. |
Bipolar (III) Inmate From: New York City |
posted 06-01-2003 22:35
Thanks! I am going to hold off for now checking for empty field as all fields will have map links- I will repost if necessary. |