Getting a variable from another page using session, ! please

Hi guys, just need your guidance on something. I would like to simply write out the “hello thar” string on the html page, but im getting blank results, whats going wrong? Any help would be greatly appreciated, please dont flame a noob.

I have one HTML page called one.html where the code is:

[sub]<?php session_start(); ?>

Untitled Document


<?php echo $_SESSION['hello']; ?> [/sub]

And the second page PHP page one.php where the code is:



$_SESSION[‘hello’]=“hello thar”;

echo $_SESSION[‘hello’];

?> [/sub]


The reason the html page is coming up with sadasd and no “hello thar” is because normally you can’t run php inside a .html file

Try renaming the one.html to somethingelse.php and it should work fine.

Sponsor our Newsletter | Privacy Policy | Terms of Service