You are here: Page reloading problem « PHP Programming Language « IT news, forums, messages
Page reloading problem

Posted by Dave Moore on 12/21/05 00:56

Hi All,
Here's my problem. I'm having trouble managing the additional variables
on the end of my URL. For example, I might have a URL like the following:

http://www.mydomain.com/index.php&option1=5&option2=7

It's the 'option' variables I'm having problems with. I would typically use
variables of this form to control various aspects of the current page.
However, the actual options present will be dependant on the current mode of
the page. Now lets say that I want to put a link on my page that adds a new
'option3' variable and reloads the page. The php might look like:


echo '<A
HREF="'.$_SERVER['PHP_SELF'].'?'.SID.'&option1=5&option2=7&option3=6'."\">ne
w link with new option</A>\n";

But I can't really use this because this page might not actually contain
option1 and option2 - it may have option5 and option6 instead. What I want
to be able to do is to leave the current options alone and just add the ones
I want to add. What is the best way of doing this?.

I reckon the best way to handle it would be to have a $_SERVER variable that
would give me the full current URL including all of the options. That way I
could a line similar to:

echo '<A HREF="'.$_SERVER['FULL_URL'].'?'.SID.'&option3=5'."\">new link with
new option</A>\n";

and it would just work. Is there such a variable?, or is there a better way
of doing this?.

Ta in advance,
Dave

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация