Re: javascript, php and mysql
| From: | Jake Malone | Date: | Sat, 26 Apr 2003 03:10:14 +0000 |
| Subject: | Re: javascript, php and mysql | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145329@lists.php.net to get a copy of this message | ||
hello,
javascript is a strictly client side language...meaning it's not at all
dependant on the server that's running it, nor does it really have any
ability to work with/access the server running it.
the only way to really mix php and javascript is by placing your php within
javascript code .if you're gonna do this in a .js file, make sure your web
server recognizes '.js' as a valid php extension (if you're using apache,
you'll need access to your apache config files). here's an example:
<SCRIPT LANGUAGE="javascript">
function showTotal() {
document.products.totalProducts.value='<?=$totalProducts;?>';
alert('There are currently <?=$totalProducts;?> products.');
}
</SCRIPT>
-jake
"Prince" <friendly@kaltelnet.net> wrote in message
news:004501c30b8e$bad09800$5304a40c@andy...
> hi...
>
> was just given a chance to see/try a little javascript with a few simple
> scripts.. its pretty cool and seems not very hard to use but is there a
way
> that you can mix php/javascript in a single script? how would you use both
> of them together either way it goes and does anybody know if javascript
has
> any mysql functions like php does?
>
>
>