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

 
[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]
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]

Archived

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

×
×
  • 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.