Current location: Hot Scripts Forums » General Web Coding » JavaScript » PHP inside JavaScript?

PHP inside JavaScript?

 
Prev Previous Post   Next Post Next
  #1  
Old 07-15-07, 06:35 PM
pikaz pikaz is offline
Newbie Coder
 
Join Date: Nov 2005
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
PHP inside JavaScript?

Ok, hoping I chose the right forum. Anyways I want to play around a bit with PHP/ JavaScript only I don't know how to go about doing it.

You see I'm using PHP on my current web page, but the reloading every time you want to do something is horrible. JavaScript’s ability to change the page without reloading is awesome! So combining the two would be great only I know its not an easy task.

For example I would love to run some php code on the click of a button but if I try to run this:
Code:
document.write("<?php echo 'hello!'; ?>");
nothing happens. I realize this is because PHP is server side and therefore it needs to contact the server.... but I want to alter variables using JavaScript and then get them back into my php to save them into a database. Can anyone guide me on how to do this?

If you need more of a demonstration of what I mean I'll draw of a dummy script.


Thanks!,


pikaz
Reply With Quote
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create image using php and pass its site to javascript method PHP 4 04-03-07 09:19 AM
How to pass server response to Perticuler/Unique client javascript using php method PHP 1 03-25-07 07:02 AM
How to recive data from php script inside javascript? method JavaScript 10 03-23-07 08:49 PM
how can i use javascript in PHP sfaizanh PHP 3 01-25-04 02:31 PM


All times are GMT -5. The time now is 07:51 PM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 (Unregistered)