Page 1 of 1

Need advise on what php programming way to use

Posted: Mon Feb 01, 2010 3:59 pm
by Rippie
Hi everyone,

This might be a stupid question, but would very much like some clarification on something.

I am looking at object orientated php programming and i really like how when you go from page to page that you dont have newpage.php?id=$_POST['something'] . so just wondering is there a way without objects where i if i am on index.php and click on a link that takes me to newpage.php but on index.php i create a variable $myVar = "something"; and i still want to use that var on my newpage.php ?

If anyone have some good guides for object orientated programmers, please post them here.

I hope my wording dont cause too much confusion, i am basically just trying to figure out if it is worth getting my head around OO at this time of my learning curve.

Rippie

Re: Need advise on what php programming way to use

Posted: Mon Feb 01, 2010 4:11 pm
by AbraCadaver
This doesn't have anything to do with OOP versus procedural code. To pass a var from one page to another as you have described you use sessions: http://us.php.net/manual/en/intro.session.php

Re: Need advise on what php programming way to use

Posted: Mon Feb 01, 2010 5:11 pm
by Rippie
Abra,

Cheers for that, interesting stuff :)