Jump to content

Does Anyone Know Php, $Var Global $Var Sessions Host Etc?

Recommended Posts

Hi,

I'm trying to add some customization to a wordpress site, and im having trouble working with variables across the php pages.

 

Does anyone had PHP basics who have give me some pointers? I'll post more details if needed.

 

 

Share this post


Link to post
Share on other sites

I know a little bit, I've done some Wordpress plugins and stuff with php. What are you trying to do?

 

Reading your OP though, if you're trying to pass variables between pages; I don't think that's something I've ever done.

Edited by Waldo

Share this post


Link to post
Share on other sites
9 hours ago, Waldo said:

I know a little bit, I've done some Wordpress plugins and stuff with php. What are you trying to do?

 

Reading your OP though, if you're trying to pass variables between pages; I don't think that's something I've ever done.

Hi Waldo,

Thanks for your reply, I think I cracked it through trial and error last night.

I have lets say page1.php and page2.php.

Page1 had a $test with a value I need on page 2.

 

I put this into page 1.

$_SESSION["testinfo"] = "$test";

 

Then on page 2 I can retrieve it with this for example

echo $_SESSION["testinfo"];

 

 

Share this post


Link to post
Share on other sites

Cool. Best of luck with the rest of your project.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.