Jump to content

Archived

This topic is now archived and is closed to further replies.

mayu_bt

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

Recommended Posts

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"; ?>
}

}

.
.
.
.
.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.