including html and javascript within a php

Hi,
the foll is my html and javascript file which i want to include in my php

<head>
   <script type = "text/javascript" src="../utils/js/jquery-1.11.0.min.js"></script>
      
    <script type="text/javascript">
	$(document).ready( function () {
          $('#hello').append('hi this is my content');
        });
<body style="overflow:hidden;">
<div id="hello">
I have two php variables which i wan to check in javascript and then echo the same in the div hello. if the php var is "hello" echo it in the div else no

As long as the page is a php extension you can open and close php tags where ever you need and place the code you want within those tags for that part.
[php]

<head>
   <script type = "text/javascript" src="../utils/js/jquery-1.11.0.min.js"></script>
     
    <script type="text/javascript">
  $(document).ready( function () {
          $('#hello').append('<?php echo ($var == "hello") ? 'Hello World!' : 'This is my content'?>');
        });
<body style="overflow:hidden;">
[/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service