Jump to content


Photo

<?PHP //some statements like sql statements ?>


  • Please log in to reply
3 replies to this topic

#1 mayu_bt

mayu_bt
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 20 March 2006 - 11:35 AM

Hi Gurus,

Please tell me what to do when its needed to run PHP server scripts in the condition statements of JAVA script..

When I enter any PHP script in the body of a function of javascript and want that to run only when some conditions are met, its not happening... it runs whether the condition is met or not... I mean the if statement is simply not being checked!!..

eg:

<script-javascript>
function start(){

if(document.option.blah blah..)
{
<?PHP ech "Hi Mayu"; ?>
}

}

.
.
.
.
.


#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 20 March 2006 - 12:39 PM

PHP runs on the server and is run before the browser sees the javascript to run. If you want to do something like this, you need to look at AJAX programming, which allows javascript scripts to run another script on the server that returns information back to the script.

Ken

#3 mayu_bt

mayu_bt
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 20 March 2006 - 07:23 PM

Hi kenrbnsn,

What is that AJAX programming? is it a new concept or a new language? plese tell me how and where to get more information on that to get my current problem solved..

#4 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 20 March 2006 - 07:27 PM

AJAX is not new, and it's not a specific language. It is a combination of JavaScript and calls to backend scripts, whether it be Perl, PHP, ColdFusion, etc.

www.ajaxfreaks.com is another site that is part of the webfreaks network. Check it out.

Info: PHP Manual





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users