Jump to content

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


mayu_bt

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

}

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.