PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Citizen
Forum Contributor
Posts: 300 Joined: Wed Jul 20, 2005 10:23 am
Post
by Citizen » Fri May 12, 2006 9:25 am
Code: Select all
echo "
<td style='vertical-align:bottom;'>
<div class='item2' onmouseover='this.className="item2"; onmouseout='this.className="item2";'>
<a href='$VAR[0]/arcade.php'>Random</a>
</div>
</td>
";
What do I do about "item2" when it is incased in a '?
Wont that end my echo command?
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Fri May 12, 2006 9:30 am
You need to escape your double quotes. Also your variable won't parse the way you have it. you need to do something like this:
Code: Select all
echo "
<td style='vertical-align:bottom;'>
<div class='item2' onmouseover='this.className=\"item2\"; onmouseout='this.className=\"item2\";'>
<a href='" . $VAR[0] . "/arcade.php'>Random</a>
</div>
</td>
";
Citizen
Forum Contributor
Posts: 300 Joined: Wed Jul 20, 2005 10:23 am
Post
by Citizen » Fri May 12, 2006 9:38 am
Thanks a ton!
Also, I thought that you dont need to close and reopen the string to include a variable if you use " instead of ' when using the echo command.
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Fri May 12, 2006 9:54 am
Citizen wrote: Thanks a ton!
Also, I thought that you dont need to close and reopen the string to include a variable if you use " instead of ' when using the echo command.
You don't. Just a (Good) habit