| | #1 |
| Active Warrior Join Date: 2011
Posts: 42
Thanks: 2
Thanked 18 Times in 12 Posts
|
Hi to all, I need help with this line of code $data[1]["Category"]["body"] = str_replace("[!LOCATION!]", $data[2]["Location"]["name"], " ".$data[1]["Category"]["name"]." text text text ".$data[1]["Category"]["name"]." text text text"); I want to add <href link to this line of code (where the "text" words are),so it shoud look something like this: $data[1]["Category"]["body"] = str_replace("[!LOCATION!]", $data[2]["Location"]["name"], " ".$data[1]["Category"]["name"]." text text LINK GOES HERE text ".$data[1]["Category"]["name"]." text text text"); I added: "LINK GOES HERE" beacuse i 'm not allowed to post links But when i add the link,my site collapse Can you please help me with that? |
| |
| | #2 |
| HyperActive Warrior War Room Member Join Date: 2010 Location: Tokyo
Posts: 314
Thanks: 27
Thanked 43 Times in 42 Posts
|
The code you have there looks for ['!LOCATION'] and if it finds that text it replaces it with the value in the $data[2]["Location"]["name"] please explain "my site collapse" If its a fixed link that doesn't change im guessing that your issue is probably non-escaped quotes. the " are stuffing things up because <a href="link to someoehrere">the link</a> has quotes in it. Try using single quotes ' or escaping them with a backslash (depending on what language it is) <a href=\"link to someoehrere\">the link</a> |
|
"Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers." | |
| |
| | #3 |
| Active Warrior Join Date: 2011
Posts: 60
Thanks: 0
Thanked 4 Times in 4 Posts
|
Yes. There are many ways. One of them is: <html> <?php echo '<b>' . htmlspecialchars( $name ) . '</b>,<br />'; echo 'Sorry there's a problem sending your message. '; echo 'Please <a href="/mail.html">try again</a>.'; ?> </html> another: <html> <b><?php htmlspecialchars( $name ); ?></b>,<br /> Sorry there's a problem sending your message. Please <a href="/mail.html">try again</a>. </html> |
| | |
| |
|
| Bookmarks |
| Tags |
| <, add, href, php |
| |