new_to_php Posted June 27, 2007 Share Posted June 27, 2007 Hi , I am using url rewriting in my php script. How can I set the variables so that I can access them in another PHP pages which are referenced by this page ? means .. If we use sessions we can use session variables so that we can access them in another another pages. how it can be done in url rewriting ?? if(version_compare(phpversion(),'4.3.0')>=0) { if(!ereg('^SESS[0-9]+$',$_REQUEST['SESSION_NAME'])) { $_REQUEST['SESSION_NAME']='SESS'.uniqid(''); } output_add_rewrite_var('SESSION_NAME',$_REQUEST['SESSION_NAME']); session_name($_REQUEST['SESSION_NAME']); } Quote Link to comment Share on other sites More sharing options...
gerkintrigg Posted June 27, 2007 Share Posted June 27, 2007 if you're referencing the variables from the includING file in a file that's an "include" you do it in the same way as any other variable... I'm not sure if that's what you mean though. Quote Link to comment Share on other sites More sharing options...
new_to_php Posted June 28, 2007 Author Share Posted June 28, 2007 Hi , I mean to say : I have a array in Test.php as $test_array = array(); Contents of that array are set at when you click any button on that page (at run time). echo(" <a href=\"$PHP_SELF?page=$i\">CLICK ME</a>"); In Test.php I have link called "CLICK ME" , again it will refer to that same php file , at that point of time I want to use the array "test_array". I am using the URL rewriting. how can i get the array in the new page ? Thank you Quote Link to comment Share on other sites More sharing options...
teng84 Posted June 28, 2007 Share Posted June 28, 2007 use session Quote Link to comment Share on other sites More sharing options...
new_to_php Posted June 28, 2007 Author Share Posted June 28, 2007 Hi , First I started with sessions only.But I have problems with sessions. In a browser if i open 2 tabs , they share same session. If i make changes in tab2 then tab1 will also be affected because they sahre same session. So instead of session i want to go for url rewriting. Is there any way other than sessions ? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted June 28, 2007 Share Posted June 28, 2007 I think if you are running php 5 there are settings for browsers with tabs Quote Link to comment Share on other sites More sharing options...
new_to_php Posted June 28, 2007 Author Share Posted June 28, 2007 But I am using PHP 4.3.2 , than hpw to resolve the problem ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.