RE: [PHP-DB] php variables to JS
| From: | xxx xxxx | Date: | Mon, 06 Jan 2003 09:48:36 +0000 |
| Subject: | RE: [PHP-DB] php variables to JS | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24582@lists.php.net to get a copy of this message | ||
Forget hidden form!!!!
all you have to do is to insert in javascript code php code like this:
<?php
$variable1=1234;
$variable2=87;
?>
.....
<script>
...
weight=<?php echo $variable1; ?>
height=<?php echo $variable2; ?>
..and so on....
</script>
it's simple no???
i hope it's good for your needs....
cybercop78
On Sun, 5 Jan 2003 08:36:20 -0600, Bryan McLemore wrote
> Could always pass it through a hidden form.
>
> Bryan
>
> -----Original Message-----
> From: Bruce Levick [mailto:bruce@vivamotion.com]
> Sent: Sunday, January 05, 2003 1:09 AM
> To: php-db@lists.php.net
> Subject: [PHP-DB] php variables to JS
>
> Bruce Levick - VivamotionI am opening a chromless window with some JS
> code.
> I need to pass some variables which come from rows in my database
> into the jscript which will determine the size and URL of the window.
>
> Before I go about drawing the info from the database I have set up some
> hard
> code php variables just so i could test how to pass these into js.
>
> Does anybody know how I can code these variables into my jscript??
>
> Cheers
>
> ##################################################
> <?php
> $h = 600;
> $w = 343;
> $theURL = test.php;
> $wname = test;
> ?>
> ###################################################
>
> ##################################################
> <script language="javaScript" type="text/javascript"
> SRC="js/java.js"></SCRIPT>
>
> <script>
> <!--
> function openIT() {
> theURL="wesley.php" //php variable here
> wname ="CHROMELESSWIN" //php variable here
> W=300; //php variable here
> H=100; //php variable here
> windowCERRARa = "images/close_a.gif"
> windowCERRARd = "images/close_d.gif"
> windowCERRARo = "images/close_o.gif"
> windowNONEgrf = "images/none.gif"
> windowCLOCK = "images/clock.gif"
> windowREALtit = " ? Task title"
> windowTIT = "<font face=verdana size=1> your chromless</font>"
> windowBORDERCOLOR = "#000000"
> windowBORDERCOLORsel = "#000000"
> windowTITBGCOLOR = "#FF0033"
> windowTITBGCOLORsel = "#FF0033"
> openchromeless(theURL, wname, W, H, windowCERRARa, windowCERRARd,
> windowCERRARo, windowNONEgrf, windowCLOCK, windowTIT, windowREALtit ,
> windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR,
> windowTITBGCOLORsel)
> }
> //-->
> </script>
> ##############################################################
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
http://www.idilis.ro - Stiri, e-mail gratuit, download,
SMS, server de counter-strike, hosting gratuit, servicii internet...
Fii cu un pas inaintea celorlati!