Re: php's variables & javascript
| From: | Brad McCrorey | Date: | Tue, 28 May 2002 04:44:40 +0000 |
| Subject: | Re: php's variables & javascript | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-99437@lists.php.net to get a copy of this message | ||
Or something easier...
<?
$size = 222;
print <<<HTML
<script language="JavaScript">
width = $size;
</script>
HTML;
?>
Just make sure the "HTML;" bit is all the way on the left margin, regardless of tabstops in your code.
cheers,
Brad
Boyan Nedkov wrote:
Try something like that: <? //$size = GetImageSize ("images/$resim"); $size = 222; echo "<script language=\"JavaScript\">"; echo "width="; echo $size; echo ";"; echo "</script>"; ?> Cheers, boyan -- Boyan Nedkov bnekdov@home.nl-----Original Message----- From: burak delice [mailto:bdelice@abt.com.tr] Sent: Monday, May 27, 2002 11:59 PM To: php-general@lists.php.net Subject: [PHP] php's variables & javascript hi everyone, I want to make a php that include javascript that use a php variable. Code is below: <? $size = GetImageSize ("images/$resim"); echo "<script language=\"JavaScript\"> wdth=";$size;echo";"; echo "</script>"; ?> (I am calling that php file as below) http://localhost/Aksu/web/getimage.php?> resim=K00.jpg But explore gives me an javascript error that syntax error. Why? and how can do my purpose? thanks burak delice -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php