[SOLVED] global variables
Hi to all,
maybe someone can help my with this one. On my local wamp server I have global variables activated and I can use sessions for one plugin I modified. The plugin in question is restrict-categories and based from which category (when a category is displayed I added a link to post-new.php) the user wants to post a new post it should give him the option to only check one category the post will be added to (basically all other categories are hidden except the one that the post will belong to). In atahualpa center-column I added this: session_start(); $eu_scattitle = single_cat_title("", false); $eu_scatid = get_cat_ID($eu_scattitle); $eu_curr_cat = get_category($eu_scatid); $eu_slug=$eu_curr_cat->category_nicename; $_SESSION['eu_slug'] = $eu_slug; //this is what I need to be stored and later use in restrict-categories Now, because globals are disabled, the session variable is lost when the execution enters into another .php file. Is there a way to declare the variable I need inside the center-column (or in one .php file that belongs to atahualpa) and later to be available in the restrict-categories function?... like global $wpdb; or something? Thank you. |
Try adding
HTML Code:
Global $eu_slug; |
It's not working,
as soon as another .php file starts execution, the variable is lost.... don't know what to do.... this happens on the site I have hosted by a company.... on my local computer, session variables work but.... |
No, I can't access php.ini
I just can't figure out why the variable is lost |
Contact your host and get them to turn them on. If they won't help you, I'd move hosts.
|
Yes I think that is what I'll do, thank you. However, I understood that turning global variables on is quite risky, even if the entire platform only uses 1 session variable, will I have any hacker problems?
Thanks |
Fixed, thank you so very much.... :)
|
All times are GMT -6. The time now is 01:59 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.