Jump to content

[SOLVED] Need for help Implement Javascript in my PHP file


sivanath.nagendran

Recommended Posts

Need for help Implement Javascript in my PHP file

  I am newbie to Javascript and also PHP.
Can anyone pls tell me how to Use javascript into php coding file also I need one sample program  (simple program combines of PHP and Javascript).

  Pls clarify the basic concept of using PHP with Javascript. I already know about PHP coding.

Millions of thanks for yours help

By
Sivanath.N

 
Link to comment
Share on other sites

[code]
<html>
  <head>
    <title>test</title>
    <scripting language="javascript">
      function foo() {
        document.write("this is foo");
      }
    </script>
  </head>
  <body onload='foo();'>
<?php
  echo "this is php";
?>
</html>
[/code]
Link to comment
Share on other sites

Look, that was a simple untested example. The point is, javascript is just like html in that it can be mixed in or outputed with php. Unless you have something specific you want to do I don't see the point.

Anyway... i think the error in my example is this....

[code]
<scripting language="javascript">
[/code]

should be...

[code]
<script language="javascript">
[/code]
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.