Passing php variable through html frameset url

1.5k Views Asked by At

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!

2

There are 2 best solutions below

2
Insyte On BEST ANSWER

You dont need $ before var

 <?php $var = 2+3; ?>

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

Remove the $ from the URL and it should work;

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