Layouts Myspace - Wordpress Theme - Discount Perfume - Debt Consolidation - Discount Perfume

PDA

View Full Version : Including Javascript variables into PHP?


Handsofmodder
Aug 11th 2008, 4:39 pm
Is it possible to insert variables from your javascript variable into your PHP variable?

Property_Control
Aug 11th 2008, 4:53 pm
You could set the variable as a cookie in JS, but it wouldn't work too well

skript
Aug 11th 2008, 5:05 pm
PHP is a server side scripting language and javascript is a client side one. This means the php code executes itself on the server and the javscript code executes on your computer.
This mens that you cannot insert javascript variables into the php script that has already executed.
You can insert javascript variables into a php script by GET or POST through XMLHttpRequest (XHR) (http://en.wikipedia.org/wiki/XMLHttpRequest). This way you can get a response from your PHP script without leaving the page.

Handsofmodder
Aug 11th 2008, 5:25 pm
I just wanted to know because I want to create a dyanamic website, and I was hoping to include some sort of text editor so my visitors can post articles. Does anyone have any suggestions?

skript
Aug 11th 2008, 11:40 pm
I have a suggestion about that text editor: you can use http://www.fckeditor.net/