|
Posted by Joseph Melnick on 06/15/05 23:59
Hello Peter,
There are lots of reasons that your code works on windows but not in this
setup.
Multiple Components (OS, Server, Database, PHP)
Configuration Differences
Versions Differences
And the unlikely chance that you have one of these bits misconfigured.
The suggestion I made earlier will allow your code to do the right thing
when the request variable is not set.
Joseph Melnick
JM Web Consultants
http://www.jphp.com/
"Peter Wilson" <pwilson@sci-comm.clara.net> wrote in message
news:cd$wshA7c2rCFwJ5@zen.co.uk...
> Hi joseph
>
> yes I do start session earlier and I use 2 other session variables in
> teh page.
>
> I am running version
> 5.0.2 php
> Apache 2.0.52
> mysql 4.0.21
>
> I have not tried you code yet will try it tomorrow many thank.
> Just wondering why it not working on my unix box yet worked on my
> windows one?
>
> Many thanks
>
> In article <IPednV5HbrH5hzPfRVn-gA@rogers.com>, Joseph Melnick
> <jmelnick@jphp.com> writes
>>Hello Peter,
>>
>>do you start your session at the start of your page?
>>
>>session_start();
>>
>>which version of PHP are you running on Solaris?
>>
>>You may want to change your if statement to look at the $_SESSION global
>>array like this:
>>
>>if (array_key_exists('ono_details',$_SESSION))
>>{
>> echo $_SESSION['ono_details'];
>>}
>>else {
>>...
>>}
>>
>>Hope that this helps.
>>
>>Joseph Melnick
>>JM Web Consultants
>>
>>"Peter Wilson" <pwilson@sci-comm.clara.net> wrote in message
>>news:hGmJWIAOu4qCFwnS@zen.co.uk...
>>>I am trying to set up PHP MYSQL and Apache2 on a solaris 10 system
>>>
>>> it all works apart from a small bit of code in a page that I have code
>>> previously and did work on my windows system.
>>>
>>> this bit of code is
>>>
>>> <?php if (isset($HTTP_SESSION_VARS['ono_details']))
>>> {
>>> echo $ono_details;
>>> }
>>> else
>>> {
>>> session_register ("ono_details");
>>> $onot = 0;?>
>>> <?php
>>> do
>>> {?>
>>> <?php
>>> $onot = $onot + 1;
>>> mysql_select_db($database_games, $games);
>>> $query_buy = "SELECT ono FROM orders WHERE ono = $onot";
>>> $buy = mysql_query($query_buy, $games) or die(mysql_error());
>>> $row_buy = mysql_fetch_assoc($buy);
>>> $totalRows_buy = mysql_num_rows($buy);
>>> ?>
>>> <?php }
>>> while (mysql_num_rows($buy)>0);
>>> ?>
>>> <?php
>>> $ono_details = $onot;
>>> echo $ono_details;
>>> }?>
>>>
>>> what happens is that this does not generate a number the first time it
>>> is run.
>>>
>>> page displays fine but the number is just not generated.
>>>
>>> Anyone got any ideas please
>>>
>>> Many thanks
>>>
>>> Peter
>>> Motto "A smile aday keeps the blues away"
>>>
>>> http://www.sci-comm.clara.net/
>>>
>>
>>
>
>
> Peter
> Motto "A smile aday keeps the blues away"
>
> http://www.sci-comm.clara.net/
>
[Back to original message]
|