
August 3rd, 2001, 07:29 AM
|
|
Contributing User
|
|
Join Date: Feb 2001
Location: USA
Posts: 830
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 13
|
|
hi thedanmichael,
I think I see a couple of problems with your code:
Where you have the link, it looks like you've got 'java script'. It should be 'javascript' -- no space.
This part
Code:
echo "<a href=\"java script:alert('$description');\">";
I think what you're trying to do is insert the value of PHP variable 'description' in the JavaScript alert(), in which case I believe you need to concatenate the strings you're echoing, like this
Code:
echo "<a href=\"javascript:alert('", $description, "');\">";
or this
Code:
echo "<a href=\"javascript:alert('" . $description . "');\">";
When I use the PHP echo statement with HTML, I use single quotes for the echo statement because with HTML you're almost always using double quotes (of course you frequently use single quotes in JS, but...)
I hope this helps
|