You are here: Re: php set up work but not! « All PHP « IT news, forums, messages
Re: php set up work but not!

Posted by Joseph Melnick on 06/13/05 23:50

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/
>

 

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

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