help in dis small code

Started on the old forum in July 2010 · view the original in the archive · old links redirect here

6 replies · 544 views · started 16 years ago · 1 min read

5 participants
rukiya Lead · 569 posts #4

crazybrumi wrote:

<img src=\"image.gif\" width=\"400\" height=\"150\" alt=\"image.gif\"/>

Wrong. There will be no \ in html.

I dont know why, but in some php and all static html pages "" are not necessary...

in html you don't need . you will need \ to escape " only when you will use echo in double qoutes, if you don't use \ you see ASCII=92 error. But if you use echo in single qoutes you don't need to use \ before "

like

echo 'External image (may be gone)';

something else Fellow · 2,296 posts #5
$size = getimagesize($banner);
if($size[0]>140||$size[1]>$150){
$size[2] = "width=\"140\" height=\"150\"";
}
echo "<img src=\"$banner\" $size[2] alt=\"banner\"/>";

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close