/    Sign up×
Community /Pin to ProfileBookmark

escaping html tags

can i automate the escapes ()? ps i use dreamweaver if that helps

[CODE]<?php
$location = 1;

if (isset($location)) {
print “<font color=”#990000″ size=”4″ face=”Georgia, Times New Roman, Times, serif”><font face=”Verdana, Arial, Helvetica, sans-serif”><strong>* <font color=”003399″>Location: </font></strong></font></font><font color=”#666666″ face=”Verdana, Arial, Helvetica, sans-serif”><strong>the moon </strong></font><br />”;
}

?>
<font color=”#990000″ size=”4″ face=”Georgia, Times New Roman, Times, serif”><font face=”Verdana, Arial, Helvetica, sans-serif”><strong>* <font color=”#003399″>Location: </font></strong></font></font><font color=”#666666″ face=”Verdana, Arial, Helvetica, sans-serif”><strong>the moon</strong></font><br />[/CODE]

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyJun 14.2006 — You can just change your outer most " to ' ieecho '&lt;font color="#990000" size="4" face="Georgia, Times New Roman, Times, serif"&gt;&lt;font face="Verdana, Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;* &lt;font color="#003399"&gt;Location: &lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#666666" face="Verdana, Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;the moon&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;';
Copy linkTweet thisAlerts:
@IfrebornauthorJun 14.2006 — i would also like to print a variables value in the statement :/

<?php

$location = 1;

if (isset($location)) {

print "<font color="#990000" size="4" face="Georgia, Times New Roman, Times, serif"><font face="Verdana, Arial, Helvetica, sans-serif"><strong>* <font color="003399">Location: </font></strong></font></font><font color="#666666" face="Verdana, Arial, Helvetica, sans-serif"><strong>the moon </strong></font><br />";

}

?>[/QUOTE]


i guess i could do this:

<?php

$location = moon;

print '<font color="#990000" size="4" face="Georgia, Times New Roman, Times, serif"><font face="Verdana, Arial, Helvetica, sans-serif"><strong>* <font color="#003399">Location: </font></strong></font></font><font color="#666666" face="Verdana, Arial, Helvetica, sans-serif"><strong>'."$location".'</strong></font><br />';

?>[/QUOTE]
Copy linkTweet thisAlerts:
@bathurst_guyJun 14.2006 — you mean this&lt;?php
$location = moon;
print '&lt;font color="#990000" size="4" face="Georgia, Times New Roman, Times, serif"&gt;&lt;font face="Verdana, Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;* &lt;font color="#003399"&gt;Location: &lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#666666" face="Verdana, Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;'.$location.'&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;';
?&gt;
Copy linkTweet thisAlerts:
@WebnerdJun 14.2006 — Or just do:

[code=php]

print <<<EOF;

<h1>hi></h1><a href="">sdfdsf</a>

EOF;
[/code]


And you don't have to escape anything
×

Success!

Help @Ifreborn spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...