Java Script with PHP

4 posts by 3 authors in: Forums > CMS Builder
Last Post: July 10, 2008   (RSS)

By grauchut - July 10, 2008

Is there a way I can use CMS Builder for my clients to add something like this.

http://simplythebest.net/scripts/DHTML_scripts/dhtml_script_120.html

I tried to set it up but it will not display the php entry. Thanks Glenn
Glenn Rauchut (Owner) Emergency Designz

Re: [grauchut] Java Script with PHP

By Donna - July 10, 2008

Hi Glenn!

PHP & Javascript can definitely work together. The main thing you need to remember is the order that the scripts are executed.

The biggest differences between PHP & Javascript is that PHP is server-side, and Javascript is client-side. In other words, PHP is executed on the server before the content ever reaches your browser -- so your browser is never seeing the <?php?> code... whereas the Javascript is sent over to your browser in plain text, and your browser decides what to do with it.

What this basically means is that the PHP will ALWAYS be executed first.

The next issue you might run into is that this script requires adding JavaScript within the program for the links that you want, and if you're using the WYSIWYG editor, that can often cause issues.. since the WYSIWYG editor is itself written in JavaScript. But you should be able to enter the required code into a plain text field.

I hope this helps! Let me know if you have any other questions or concerns. :)
Donna

--
support@interactivetools.com

Re: [Donna] Java Script with PHP

By grauchut - July 10, 2008

I did try to make it work using single text entry from the CMS but it would'nt display anything. I replace the text area with the php code. Thanks Glenn
Glenn Rauchut (Owner) Emergency Designz