user wrote:[color=blue]
> On Sun, 17 Oct 2004 06:09:46 GMT, Lüpher Cypher
> <lupher.cypher@verizon.net> wrote:
>
>[color=green]
>>user wrote:
>>[color=darkred]
>>>On Sun, 17 Oct 2004 01:11:30 GMT, Lüpher Cypher
>>><lupher.cypher@verizon.net> wrote:
>>>
>>>
>>>
>>>>user wrote:
>>>>
>>>>
>>>>>when i first load index.php with arguments ie: "index.php?page=x", the
>>>>>$_SERVER['argv']value is null. I then get the session id appended to
>>>>>each link. If i refresh the page, I get the $_SERVER['argv'] I want,
>>>>>but if i click a link $_SERVER['argv'] returns the value I want and
>>>>>the session id.
>>>>>Any ideas as to how I can get the $_SERVER['argv'] to return the
>>>>>arguments on first page load?
>>>>>
>>>>
>>>>Have you tried $_GET["page"]? This should return "x" on the first page
>>>>load. It obviously won't return the session id. You can't get the
>>>>session id on the first load, that's when you start a session.
>>>
>>>
>>>no freak'n way!
>>>here I was going to try and write a function to parse it and
>>>everything ;)[/color]
>>
>>Why reinvent the wheel? :)
>>
>>parse_str($_SERVER['QUERY_STRING'],$params);
>>echo $params["page"]; // outputs "x"
>>
>>This will create an associative array in $params :)[/color]
>
>
>
> cool man. Thanks again...
> the $_GET["page"] doesn't get a value on the first load either...
>
> so confused...
>
>
http://www.internetdefender.net
>
> I have index.php displaying, and starting the session, and I've
> included a display.php that stores arrays of dynamic content. based on
> page, it loads the content into a div.
> It works... I just can't hotlink to say
>
http://internetdefender.net/index.php?page=safety
>
> IF I refresh, it grabs the value, but not on first load...
> I've tried setting the page from index, and display.php using:
> <?php session_start();
> $_SESSION['args'] = $_GET["page"];
> ?>[/color]
Hmm.. Are you trying to set "page" in session? I'd do session_register()
first, then :) As for $_GET, I can't think of a reason why it's not
there - it has to be.. If I stumble on an error like this, when
something is wrong with a variable or value that I pass through whatever
global, I usually check up on it using
echo "<pre>".print_r($GLOBALS)."</pre>";
This will output everything that's been passed to the script :) (notice
the pre tag :), you can also use print_r(nl2br($GLOBALS))) :)