phphtmlhtml-frames

Passing php variable through html frameset url


I have a php variable. I want to pass this variable through frameset url. I tried using different techniques ut no success so far. Can any one give me a tip? This is the example of my code and what I tried:

<?php $var = 2+3 ?>

   <frameset>
 <frame src="myurl.php?var = <?php echo $var ?>">   
  </frameset>

In the myurl.php, I included the following:

 $new_var = $_GET['var'];  

Thank you in advance!


Solution

  • You dont need $ before var

     <?php $var = 2+3; ?>
    
       <frameset>
     <frame src="myurl.php?var=<?php echo $var; ?>">  
      </frameset>