Re: [PHP] Re: php 4 to 5

2004-11-28 Thread Lester Caine
Travis Conway wrote:
Well,  I look at other people's code sice I am new to the whole 
language.  I have only been working with it for about a month and half 
now.  I do have prior experience with languages such as ASP (both 
JScript and VBscript based).  I am probably not going to upgrade now 
since my stuff "just works". I was just wondering what would be the main 
advantage.
I switched to PHP over a year ago, and decided that as I was just 
starting I'd work with PHP5 from day one. The production releases just 
about kept pace with what I had to ship ( couple of sites used RC 
without problems for a while ).
If you ARE just starting then while the volume of PHP4 code is nice, 
working clean with PHP5 is not a problem. All my stuff 'borrows' from 
PHP4 without any problem, and I am learning quickly how to switch to 
tidier PHP5 'rules'.
I actually bought a book to help - Advanced PHP Programming by George 
Schlossnagle - from which I've had to rewrite some of the stuff to dump 
the MySQL crap ;) but gives a good grounding in getting things right.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: php 4 to 5

2004-11-28 Thread Shen Kong
Travis Conway wrote:
I do not know much about the history of php and do not know why there is 
active development on both the 4 and 5 major versions, but is there a 
definite reason for me to migrate from 4 to 5 on my servers?

Trav
here can help you .
http://www.php.net/manual/en/history.php
http://www.php.net/manual/en/migration5.php
http://www.php.net/manual/en/language.oop.php
http://www.php.net/manual/en/language.oop5.php
--
-- ShenKong ([EMAIL PROTECTED])
-- http://www.openphp.cn
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Help with DB.php in PHP5

2004-11-28 Thread ShenKong
[EMAIL PROTECTED] wrote:
I upgraded to PHP 5 and now I am having some problems with DB.php.
2 problems:
1. I get this notice
Notice: Undefined property: DB_mysql::$disconnect
2: the $db->query no longer works.  I have gone as far as to place this line
at the beginning of the file:
set_include_path(".:/usr/local/lib/php"); //this is where DB.php resides.  I
also have QueryTool in the DB directory in this path.
Here is my code:
function db_connect($sql)
{
global $dsn;
$db = DB::connect($dsn, TRUE);
$r = $db->query($sql);
if(DB::isError($db)){
die($db->getMessage());
} else {
$success = true;
}//end if
$s = array();
$i =0;
if($success){
while($data = mysql_fetch_assoc($r->result)){
$i++;
array_push($s, $data);
}
$i =0;
$db->disconnect;
} else {
die("Query for content failed.");
}
return $s;

}

Thanks for your help!
Tim
hi :
DB::connect MUST be static . such as:
class DB {
public static connect(){}
public $disconnect;
}
I think you can only use DB::disconnect to access constant not variable
--
-- ShenKong ([EMAIL PROTECTED])
-- http://www.openphp.cn
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Weird sessions problem

2004-11-28 Thread Jason Wong
On Monday 29 November 2004 06:46, steve wrote:

> No to both. When I arrive at the new page, the sessions vars (as expected)
> contain the values set by the previous page. $ref_page is not set. The
> values are transferred to $ref_page by the function. That works as planned.
> I then reset the value of the session vars, at which point, $ref_page also
> gets set. From printing out the values after each line, I find this:
>
> Let's say we've come from the page /community.php and have arrived
> at /market.php. Here are the values at each stage:
>
> $_SESSION['ref_page] = '/community.php'
> $_SESSION['ref_pagequery'] = 'pagemode=index' // as an example
> 53. $ref_page = get_ref_page();
> $ref_page['name'] =  '/community.php'
> $ref_page['query'] = 'pagemode=index'
> $_SESSION['ref_page] = '/community.php'
> $_SESSION['ref_pagequery'] = 'pagemode=index'
> 54. $_SESSION['ref_page'] = THIS_PAGE;
> $ref_page =  '/community.php' // now a scalar
> $_SESSION['ref_page] = '/market.php'
>
> register_globals is off (in php.ini and there are no .htaccess files).

The only thing that I can think of that will cause such behaviour (that is 
setting $_SESSION['xyz'] will change $xyz) is the register_globals setting 
being enabled. If you're certain that this is not the case I suggest that you 
post some *concise* code that illustrates the problem so that others can test 
whether they can reproduce what you're seeing.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Besides, I think Slackware sounds better than 'Microsoft,' don't you?
 -- Patrick Volkerding
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] newbie web services

2004-11-28 Thread Andras Kende
Hello,

I want to create a simple web service.
So far tried NuSoap but don't know how to modify its default xml envelope..

I could create REST for response but not sure about how to process the
request,
maybe with simplexml ?

RAW DATA:

Request:

5


Response:

Jones




Please give any info for an easy implementation..

It will hosted on IIS6 PHP5.

Thanks,

Andras Kende
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] and statement

2004-11-28 Thread John Nichel
Brad Ciszewski wrote:
is there an 'and' statement for mysql, when you are doing multiple "where"s?
Is there a PHP question in your MySQL question?
--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: exclude - mysql query

2004-11-28 Thread David Robley
On Mon, 29 Nov 2004 10:58, Brad Ciszewski wrote:

> i have several tables with data, and they all have a server column. there
> are a few tables which i need to exclude a particular server from that
> table. i am currently running an array to extract the data, and was
> wondering if i could either use PHP code or a mysql-query exclude function
> or something so these servers are available. below is the php script i
> currently have... which needs the excluding script/query.
> 
> 
>// List servers from game \\
> $get_servers = mysql_query("SELECT * FROM game_$game ORDER BY server
> ASC"); while($gs=mysql_fetch_array($get_servers)){
> extract($gs);
> echo ?>
>?>
>   
> 
> 
> any ideas at all?

Seems to me there are at least two ways to do it. For the php solution, test
the value of $server in the above while loop and if the value matches a
list of exclusions, don't echo the value.

For mysql, in the select use WHERE NOT IN('a','b'...) for a comma separated
list of exclude values, or simply WHERE server <> 'badname' for one server.

You may find this a useful reference:

http://dev.mysql.com/doc/mysql/en/Tutorial.html

-- 
David Robley

Do vegetarians eat animal crackers?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] similar function like getimagesize for Quicktime?

2004-11-28 Thread Dustin Krysak
Hi there - I was wondering if there was some kind of PHP function to 
determine hte pixel size of a quicktime movie. Something like what 
GetImageSize() is to images, but for quicktime.

thanks!
d
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: and statement

2004-11-28 Thread Robert Cummings
On Sun, 2004-11-28 at 21:56, Brad Ciszewski wrote:
> err i mean ... an 'or' statement sry

Two comments:

1. This is the "PHP" General list. See the PHP part... that means
   it's NOT the MYSQL General list.

2. For such a trivial question you could have spent a whole 5 seconds
   executing the query to find out, or God forbid, RTF-MYSQL-M.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: and statement

2004-11-28 Thread Larry E . Ullman
err i mean ... an 'or' statement sry

is there an 'and' statement for mysql, when you are doing multiple 
"where"s?
MySQL allows SQL statements that support both AND and OR. With OR, you 
can often use IN instead.
SELECT columns FROM tablename WHERE (condition1) AND (condition2)...

All of this is in the MySQL manual, of course.
Larry
PS Technically speaking, this question would have been more appropriate 
on a MySQL list (or the PHP-DB list).

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: and statement

2004-11-28 Thread Brad Ciszewski
err i mean ... an 'or' statement sry

www.BradTechnologies.com
99.9% Uptime
24/7 FREE Support
Plans starting at $3.50 per month
www.BradTechnologies.com

"Brad Ciszewski" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> is there an 'and' statement for mysql, when you are doing multiple
"where"s?
>
> www.BradTechnologies.com
> 99.9% Uptime
> 24/7 FREE Support
> Plans starting at $3.50 per month
> www.BradTechnologies.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] and statement

2004-11-28 Thread Brad Ciszewski
is there an 'and' statement for mysql, when you are doing multiple "where"s?

www.BradTechnologies.com
99.9% Uptime
24/7 FREE Support
Plans starting at $3.50 per month
www.BradTechnologies.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php 4 to 5

2004-11-28 Thread Michael Leung
Hi all,
   I am developing a new application in PHP 5.  OO design is so great!
If you are developing a new application, I think you can have a look on PHP 5.

yours,
Michael

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php 4 to 5

2004-11-28 Thread Curt Zirzow
* Thus wrote Travis Conway:
> I do not know much about the history of php and do not know why there is 
> active development on both the 4 and 5 major versions, but is there a 
> definite reason for me to migrate from 4 to 5 on my servers?

The active development on php4 is strictly to fix bugs or security
issues. If your current code works on any 4.3.X versions, it probably
is best to keep it there unless something you need to require an
application that is dependent on php5.

php5 is the newest version available, providing (as mentioned) an
improved OOP interface and includes (by default) xmllib 2 for xml
processing.

>From my experience, I've had to just modify about 5 lines of code
to make a 1000+ line php4 application to run on php5.

At this point of time it isn't really necessary to upgrade unless
you are developing new applications for php.


Curt
-- 
Quoth the Raven, "Nevermore."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Help with DB.php in PHP5

2004-11-28 Thread [EMAIL PROTECTED]
I upgraded to PHP 5 and now I am having some problems with DB.php.

2 problems:
1. I get this notice

Notice: Undefined property: DB_mysql::$disconnect

2: the $db->query no longer works.  I have gone as far as to place this line
at the beginning of the file:
set_include_path(".:/usr/local/lib/php"); //this is where DB.php resides.  I
also have QueryTool in the DB directory in this path.

Here is my code:

function db_connect($sql)
{
global $dsn;
$db = DB::connect($dsn, TRUE);

$r = $db->query($sql);
if(DB::isError($db)){
die($db->getMessage());
} else {
$success = true;
}//end if

$s = array();
$i =0;
if($success){
while($data = mysql_fetch_assoc($r->result)){
$i++;
array_push($s, $data);
}
$i =0;
$db->disconnect;
} else {
die("Query for content failed.");
}

return $s;

}

Thanks for your help!
Tim


Re: [PHP] Re: php 4 to 5

2004-11-28 Thread Travis Conway
Well,  I look at other people's code sice I am new to the whole language.  I 
have only been working with it for about a month and half now.  I do have 
prior experience with languages such as ASP (both JScript and VBscript 
based).  I am probably not going to upgrade now since my stuff "just works". 
I was just wondering what would be the main advantage.
- Original Message - 
From: "Greg Beaver" <[EMAIL PROTECTED]>
To: "Travis Conway" <[EMAIL PROTECTED]>
Cc: "PHP-GEMERAL" <[EMAIL PROTECTED]>
Sent: Sunday, November 28, 2004 6:15 PM
Subject: [PHP] Re: php 4 to 5


Travis Conway wrote:
I do not know much about the history of php and do not know why there is 
active development on both the 4 and 5 major versions, but is there a 
definite reason for me to migrate from 4 to 5 on my servers?
Depends on what you wish to do with php.
PHP 5 has far better support for xml and soap than php 4.  It has a 
stricter object model and supports native exceptions for error handling. 
Iterators, reflection, and __call()/__get()/__set() provide incredibly 
flexibility.  It is new, and so not nearly as stable as PHP 4.  Any 
solutions would need to be custom-written for PHP 5 at this point, 
although options are beginning to appear.

PHP 4 has a big history and is very stable.  There are shortcomings that 
are addressed in PHP 5, but there is a huge codebase.

So, the question is, do you rely on other people's code, or your own? If 
you rely on other people's code, I would wait a year or two to upgrade. 
Otherwise, what are you waiting for?

:)
Greg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] exclude - mysql query

2004-11-28 Thread Brad Ciszewski
i have several tables with data, and they all have a server column. there
are a few tables which i need to exclude a particular server from that
table. i am currently running an array to extract the data, and was
wondering if i could either use PHP code or a mysql-query exclude function
or something so these servers are available. below is the php script i
currently have... which needs the excluding script/query.


  
  
  


any ideas at all?

www.BradTechnologies.com
99.9% Uptime
24/7 FREE Support
Plans starting at $3.50 per month
www.BradTechnologies.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Getting static member for a class which name is stored

2004-11-28 Thread Jake Press
Greg Beaver wrote:
How about:

echo Myclass::$myvar;
?>
The only problem is if you want to be able to generically access a 
static variable from any class that has it, like $Myclass::$myvar.

Greg
Hi Greg,
Yup, Exactly
That is the problem we are attempting to deal with :)
(hence the name of this thread)
Best Regards
Jake Press
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: php 4 to 5

2004-11-28 Thread Greg Beaver
Travis Conway wrote:
I do not know much about the history of php and do not know why there is 
active development on both the 4 and 5 major versions, but is there a 
definite reason for me to migrate from 4 to 5 on my servers?
Depends on what you wish to do with php.
PHP 5 has far better support for xml and soap than php 4.  It has a 
stricter object model and supports native exceptions for error handling. 
  Iterators, reflection, and __call()/__get()/__set() provide 
incredibly flexibility.  It is new, and so not nearly as stable as PHP 
4.  Any solutions would need to be custom-written for PHP 5 at this 
point, although options are beginning to appear.

PHP 4 has a big history and is very stable.  There are shortcomings that 
are addressed in PHP 5, but there is a huge codebase.

So, the question is, do you rely on other people's code, or your own? 
If you rely on other people's code, I would wait a year or two to 
upgrade.  Otherwise, what are you waiting for?

:)
Greg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php 4 to 5

2004-11-28 Thread Travis Conway
I do not know much about the history of php and do not know why there is 
active development on both the 4 and 5 major versions, but is there a 
definite reason for me to migrate from 4 to 5 on my servers?

Trav 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Weird sessions problem

2004-11-28 Thread Andre Dubuc
On Sunday 28 November 2004 05:46 pm, steve wrote:
> Jason Wong wrote:
> > On Sunday 28 November 2004 22:46, steve wrote:
> >> I tried printing out the values before and after each of those lines.
> >> After line 53, $ref_page is an array containing precisely the values I
> >> expect, so the function is working. After line 54, the session var has
> >> been reset, as expected, to match the current page - but $ref_page has
> >> also changed and is now equal to $_SESSION['ref_page'], which is what I
> >> found very weird - ie, resetting $_SESSION['ref_page'] simultaneously
> >> reset $ref_page.
> >
> > Is $ref_page getting set to what the _previous_ value of
> > $_SESSION['ref_page'] was? If so, it sounds like you have
> > register_globals enabled.
>
> No to both. When I arrive at the new page, the sessions vars (as expected)
> contain the values set by the previous page. $ref_page is not set. The
> values are transferred to $ref_page by the function. That works as planned.
> I then reset the value of the session vars, at which point, $ref_page also
> gets set. From printing out the values after each line, I find this:
>
> Let's say we've come from the page /community.php and have arrived
> at /market.php. Here are the values at each stage:
>
> $_SESSION['ref_page] = '/community.php'
> $_SESSION['ref_pagequery'] = 'pagemode=index' // as an example
> 53. $ref_page = get_ref_page();
> $ref_page['name'] =  '/community.php'
> $ref_page['query'] = 'pagemode=index'
> $_SESSION['ref_page] = '/community.php'
> $_SESSION['ref_pagequery'] = 'pagemode=index'
> 54. $_SESSION['ref_page'] = THIS_PAGE;
> $ref_page =  '/community.php' // now a scalar
> $_SESSION['ref_page] = '/market.php'
>
> register_globals is off (in php.ini and there are no .htaccess files).
>
> --
> @+
> Steve

Hi Steve,

As a late-comer to this thread, I'd like to toss about a few ideas.

I gather that all of the script occurs on one page, and that the page is 
'refreshed' by some action of the user (i.e. that the user has 
clicked/entered login info on some other page, and that this page then needs 
to detect that change.)

What may be happening is that the refresh action triggers the script twice: 
once for the initial loading and again for the reset values. Hence, $ref_page 
gets reset by line 53 ($ref_page = get_ref_page();

I experienced the same difficulty once, and essentially solved the problem by 
adding an extra page that is called, by a simple switch statement, if there 
is a change: i.e, from 'community' to 'market'. Another question, by any 
chance, are you switching into https by any chance?

Hth,
Andre

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Weird sessions problem

2004-11-28 Thread steve
Jason Wong wrote:

> On Sunday 28 November 2004 22:46, steve wrote:
> 
>> I tried printing out the values before and after each of those lines.
>> After line 53, $ref_page is an array containing precisely the values I
>> expect, so the function is working. After line 54, the session var has
>> been reset, as expected, to match the current page - but $ref_page has
>> also changed and is now equal to $_SESSION['ref_page'], which is what I
>> found very weird - ie, resetting $_SESSION['ref_page'] simultaneously
>> reset $ref_page.
> 
> Is $ref_page getting set to what the _previous_ value of
> $_SESSION['ref_page'] was? If so, it sounds like you have register_globals
> enabled.

No to both. When I arrive at the new page, the sessions vars (as expected)
contain the values set by the previous page. $ref_page is not set. The
values are transferred to $ref_page by the function. That works as planned.
I then reset the value of the session vars, at which point, $ref_page also
gets set. From printing out the values after each line, I find this:

Let's say we've come from the page /community.php and have arrived
at /market.php. Here are the values at each stage:

$_SESSION['ref_page] = '/community.php'
$_SESSION['ref_pagequery'] = 'pagemode=index' // as an example
53. $ref_page = get_ref_page();
$ref_page['name'] =  '/community.php'
$ref_page['query'] = 'pagemode=index'
$_SESSION['ref_page] = '/community.php'
$_SESSION['ref_pagequery'] = 'pagemode=index'
54. $_SESSION['ref_page'] = THIS_PAGE;
$ref_page =  '/community.php' // now a scalar
$_SESSION['ref_page] = '/market.php'

register_globals is off (in php.ini and there are no .htaccess files). 

-- 
@+
Steve

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sql insert into 2 tables

2004-11-28 Thread Larry E . Ullman
Hi there - I was wondering if anyone could point me in the right 
direction to be able to add data to two different tables (I am using 
mysql and php V4). I understand joins, etc for the query of the data, 
however adding the data - still getting my head wrapped around it 
(multiple tables).
You'll need to run separate INSERT queries, I suspect. If one query 
relies upon a primary key created by the other, make use of the 
mysql_insert_id() function.

Larry
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] sql insert into 2 tables

2004-11-28 Thread Dustin Krysak
Hi there - I was wondering if anyone could point me in the right 
direction to be able to add data to two different tables (I am using 
mysql and php V4). I understand joins, etc for the query of the data, 
however adding the data - still getting my head wrapped around it 
(multiple tables).

Thanks!
d
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Overriding static members?

2004-11-28 Thread Greg Beaver
Matthew Weier O'Phinney wrote:
* Francisco M. Marzoa Alonso <[EMAIL PROTECTED]>:
Can I override static members in someway under PHP5? Is the answer is 
negative, Why not?

If they are marked public (or not marked at all as public, private, or
protected, in which case the default is public), then yes, you can
override them.
Override is misleading.  Since they can only be access by 
Classname::$var, unless you use Reflection, code designed to work with 
the parent class can't access the child class's static variables.

Greg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Getting static member for a class which name is stored

2004-11-28 Thread Greg Beaver
Jake Press wrote:
Simas Toleikis wrote:
Jake Press wrote:
Hi Francisco,
Your not alone, a number of other users have enountered this bug.

string get_class ( object obj )
Its not a bug...
You are getting class name as a string for output purposes etc..
Doing something like "TestClass"::some_static is ofcourse illegal wih 
strings.

Morning,
Umm, it is an unclear syntax limitation, which is a bug.
... either language or manual.
i understand what you are saying, i beleive i disclaimer'd my own 
examples somewhere down the line in those threads ;)

i beleive there should be a better way to do this without:
- using reflection
- instantiating the class and using a method to retrieve the variable
- eval
Also please notice the existance of the "call_user_func" and what this 
gives us ;)
= this gives us a solution (workaround??) to access static functions 
within a class

Perhaps we need a similar function to provide access to our static 
variables! :)
How about:

echo Myclass::$myvar;
?>
The only problem is if you want to be able to generically access a 
static variable from any class that has it, like $Myclass::$myvar.

Greg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] buffer

2004-11-28 Thread Greg Donald
On Sun, 28 Nov 2004 12:48:57 -0600, Brad Ciszewski <[EMAIL PROTECTED]> wrote:
> is there a code you can put at the top of the your php files so that the
> imgs etc. load as the are put on to your computer, and it doesnt wait for
> the whole site to be downloaded until it is loaded to the user? *turning off
> the buffer basicly*

You can control PHP's output buffering.
http://us2.php.net/manual/en/ref.outcontrol.php#ini.output-buffering

You cannot control the web client's display buffering with PHP.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mass MySQL INSERT

2004-11-28 Thread Jason Wong
On Monday 29 November 2004 03:54, Travis Conway wrote:
> I am fairly new to the concept of working wity mysql and php. 

Questions regarding the use of databases with PHP should be posted to the 
php-db list.

> I am looping 
> thru a text file full of county names and attempting to add these to a
> database.

> Now the table exists and if I enter the SQL statement manually against the
> database it works.  The user also has read and write permissions to the
> table and the columns in the table.
>
> Here is my php code:
>  $lines = file("/tmp/new1.txt");
>  foreach ($lines as $line_num => $line) {
>   echo($line . '... ');
>$link = mysql_connect('naabe', 'naabe', 'x')

The connection should be made only once outside of the loop.

> or die('could not connect: ' . mysql_error());

Using mysql_error() is good, use it more often ...

> // I use substr to remove the space at the end of every line.
>$sql = "INSERT INTO countries (country) VALUES ('" .
> substr($line,0,strlen($line)-1) . "')"; echo ($sql . ' ...');
>mysql_query($sql);

... like here. If your query barfs you'll want to know about it.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If you see an onion ring -- answer it!
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Weird sessions problem

2004-11-28 Thread Jason Wong
On Sunday 28 November 2004 22:46, steve wrote:

> I tried printing out the values before and after each of those lines. After
> line 53, $ref_page is an array containing precisely the values I expect, so
> the function is working. After line 54, the session var has been reset, as
> expected, to match the current page - but $ref_page has also changed and is
> now equal to $_SESSION['ref_page'], which is what I found very weird - ie,
> resetting $_SESSION['ref_page'] simultaneously reset $ref_page.

Is $ref_page getting set to what the _previous_ value of $_SESSION['ref_page'] 
was? If so, it sounds like you have register_globals enabled.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I think we're in trouble.
  -- Han Solo
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Mass MySQL INSERT

2004-11-28 Thread Travis Conway
I am fairly new to the concept of working wity mysql and php.  I am looping 
thru a text file full of county names and attempting to add these to a database.

Now the table exists and if I enter the SQL statement manually against the 
database it works.  The user also has read and write permissions to the table 
and the columns in the table.

Here is my php code:
 $lines = file("/tmp/new1.txt");
 foreach ($lines as $line_num => $line) {
  echo($line . '... ');
   $link = mysql_connect('naabe', 'naabe', 'x')
or die('could not connect: ' . mysql_error());
// I use substr to remove the space at the end of every line.
   $sql = "INSERT INTO countries (country) VALUES ('" . 
substr($line,0,strlen($line)-1) . "')";
   echo ($sql . ' ...');
   mysql_query($sql);
   mysql_close();
  flush();
 }

This is how I configured php4.3.9
./configure --enable-so --with-mysql=/usr/local/mysql --enable-filepro 
--with-apx2=/usr/local/apache2/bin/apxs --with-jpg --with-png --with-xml

It will print to the screen the line and the SQL statement correctly.  The 
password is correct.  The database name is naabe, the user is naabe.

Anyone know what I could be doing wrong?

Trav

Re: [PHP] automatic responder

2004-11-28 Thread John Nichel
Please set your mailer to *NOT* ask for reply reciepts when mailing to a 
mailing list.

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Newbie question

2004-11-28 Thread Brad Ciszewski
try, 

www.BradTechnologies.com
99.9% Uptime
24/7 FREE Support
Plans starting at $3.50 per month
www.BradTechnologies.com


"Pascal Platteeuw" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello everyone,
>
> Here is a newbie question for you guys who are much more advanced than me
> :-)
> I want ot do an automatic redirection in a php page... Is there something
> equivalent to "response.redirect" used in ASP?
>
> Thanks in advance,
>
> Pascal Platteeuw

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] buffer

2004-11-28 Thread Brad Ciszewski
is there a code you can put at the top of the your php files so that the
imgs etc. load as the are put on to your computer, and it doesnt wait for
the whole site to be downloaded until it is loaded to the user? *turning off
the buffer basicly*

Brad Ciszewski

www.BradTechnologies.com
99.9% Uptime
24/7 FREE Support
Plans starting at $3.50 per month
www.BradTechnologies.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] automatic responder

2004-11-28 Thread Alessandro Rosa
> This seems like a very weak re-implementation of cron. Seriously, this 
> problem has been solved.
> 
> -ryan

Then, what do you exactly mean for cron job?

Alessandro

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] automatic responder

2004-11-28 Thread Ryan King
On Nov 28, 2004, at 10:38 AM, Alessandro Rosa wrote:
Yes, but perhaps every 5 minutes. You have to solve this too, either
cron job if you have it available or it can be trigered by user http
requests (not very reliable).
Thanks again!
Yours e-mail fixed some procedural doubts I have been thinking about
such automatic responder.
Solution might be easy to achieve by implementing, on my own opinion,
a Javascript code with a nested 'SetTimeOut' function recursively 
calling
itself every 5 mins (for example) and re-direction to a php code 
performing
the POP3 mailbox checking.
(obviously the php code shall include ECHOes to the timing Javascript
code again...)
This seems like a very weak re-implementation of cron. Seriously, this 
problem has been solved.

-ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newbie question

2004-11-28 Thread John Nichel
Pascal Platteeuw wrote:
Hello everyone,
Here is a newbie question for you guys who are much more advanced than me
:-)
I want ot do an automatic redirection in a php page... Is there something
equivalent to "response.redirect" used in ASP?
Thanks in advance,
Pascal Platteeuw
http://us4.php.net/header
--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Newbie question

2004-11-28 Thread Mike
Look at header()

http://us2.php.net/manual/en/function.header.php

-M 

> -Original Message-
> From: Pascal Platteeuw [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, November 28, 2004 11:34 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Newbie question
> 
> Hello everyone,
> 
> Here is a newbie question for you guys who are much more 
> advanced than me
> :-)
> I want ot do an automatic redirection in a php page... Is 
> there something equivalent to "response.redirect" used in ASP?
> 
> Thanks in advance,
> 
> Pascal Platteeuw
> 
> --
> PHP General Mailing List (http://www.php.net/) To 
> unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Newbie question

2004-11-28 Thread Pascal Platteeuw
Hello everyone,

Here is a newbie question for you guys who are much more advanced than me
:-)
I want ot do an automatic redirection in a php page... Is there something
equivalent to "response.redirect" used in ASP?

Thanks in advance,

Pascal Platteeuw

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] automatic responder

2004-11-28 Thread Alessandro Rosa
> Yes, but perhaps every 5 minutes. You have to solve this too, either 
> cron job if you have it available or it can be trigered by user http 
> requests (not very reliable).

Thanks again!
Yours e-mail fixed some procedural doubts I have been thinking about
such automatic responder.

Solution might be easy to achieve by implementing, on my own opinion,
a Javascript code with a nested 'SetTimeOut' function recursively calling 
itself every 5 mins (for example) and re-direction to a php code performing
the POP3 mailbox checking.
(obviously the php code shall include ECHOes to the timing Javascript
code again...)

Alessandro Rosa

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Grammar for PHP

2004-11-28 Thread Ryan King
On Nov 28, 2004, at 7:28 AM, Dominic Fox wrote:
Hi,
I would like to parse some PHP files to extract some information about
them. Is there a formal grammar (EBNF or other) anywhere that I could
use as a reference?
I'd like to write the parser myself (in Haskell), so existing PHP
parsers (in PHP itself, for instance) aren't quite what I'm looking
for.
Have you tried poking around in cvs.php.net?
-ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Problem with PHP Curl support and Apache

2004-11-28 Thread Matthew Weier O'Phinney
* Raditha Dissanayake <[EMAIL PROTECTED]>:
> Luis Lebron wrote:
> >I have a server running RH 8, Apache 1.3.27, PHP 4.3.9. I tried to
> >recompile PHP with Curl support.
> 
> that's a very old version of red hat that is no longer supported you 
> might want to upgrade at least to RH 9 if not to fedora

That's a naive answer if I've ever heard one. In production
environments, you often don't have the luxury of upgrading the OS.
Additionally, you *can* still find updates to RH8 via yum, and I believe
progeny has continued support for RH8 as well (past Red Hat's end of
life dates).

> > Everything seemed to compile correctly. However, when I restarted apache
> > I got the following error:
> > 
> > "Cannot load /etc/httpd/modules/libssl.so into server:
> > /etc/httpd/modules/libssl.so: undefined symbol: dbm_firstkey"
> 
> could be a problem with your openssl installation.

I concur. Additionally, this is an issue with your *Apache*
installation, not with PHP itself; you may have forgotten to pass the
--with-ssl switch to the apache configure script, or passed it to the
wrong path. If you don't need SSL support, you should be able to turn it
off in your httpd.conf.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Overriding static members?

2004-11-28 Thread Matthew Weier O'Phinney
* Francisco M. Marzoa Alonso <[EMAIL PROTECTED]>:
> Can I override static members in someway under PHP5? Is the answer is 
> negative, Why not?

If they are marked public (or not marked at all as public, private, or
protected, in which case the default is public), then yes, you can
override them.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Weird sessions problem

2004-11-28 Thread steve
Greg Donald wrote:

>> define('THIS_PAGE',$_SERVER['PHP_SELF']);
> 
> Why would you need to do this?  I'd just use $_SERVER['PHP_SELF'] as is.

I make frequent use of this value, so putting it in a constant saves typing
and makes the page a little clearer.
 
>> function get_ref_page() {
>>   /* Retrieves the details of the last page which will have set
>>  the session vars referred to */
>>   $ref_page = array();
>>   if(isset($_SESSION['ref_page'])) {
>> $ref_page['name'] = $_SESSION['ref_page'];
>> if(isset($_SESSION['ref_pagequery'])) {
>>   $ref_page['query'] = $_SESSION['ref_pagequery'];
>> }
>>   }
>> return $ref_page;
>> }
>> 
>> Now back in the main page:
>> 
>> 53. $ref_page = get_ref_page(); // now reset session vars to current page
> 
> I wouldn't use the same variable names like this.  You have a local
> $ref_page, and a $_SESSION variable called 'ref_page'.  While if done
> correctly it will work, you only encourage errrors this way.
> 
>> 54. $_SESSION['ref_page'] = THIS_PAGE;
>> 55. $_SESSION['ref_pagequery'] = $_SERVER['QUERY_STRING'];
> 
> I don't follow the need to call a function just to figure out what
> $_SESSION variables are already there and available for use.  You seem
> to be making this more complex that it needs to be.  I would just use
> the variable where they exists already.

The values for the session vars are set by the previous page the user
visited. Each page sets these session vars, but first I transfer the values
to another array in case I need to use them on that page -- eg,

1. On the page 'community.php', $_SESSION['ref_page'] is set to
'/community.php'.
2. The user clicks a link to go to 'market.php'.
3. On arriving at 'market.php', $_SESSION['ref_page'] is still set to
'/community.php'. I transfer this value to the $ref_page array is case I
want to be able to easily refer back to the previous page. Then I reset the
session vars - ie, $_SESSION['ref_page'] becomes '/market.php'.

Where this is especially handy is that, if I go off to something like a
intermediate page - such as a login routine, or database saving, the
session vars retain the information about where the user has come from, and
therefore the user can be sent back there, because on those intermediate
pages I *don't* reset the session vars.

>> Now, on my local system (PHP 4.3.4) this all works fine. On the live
>> system (PHP 4.1 - with PHP run, I believe, as CGI module)
> 
> PHP can be built as a 'cgi binary' or as a web server 'module', I've
> never heard of a 'cgi module'.  :)

Well my hosting company says it's a CGI module, so I guess they probably
mean binary ;-)

>> I hit a problem. At line
>> 53, $ref_page is an array containing the values I expect. After line 54,
>> $ref_page is now a scalar containing the value of THIS_PAGE. It's almost
>> as though line 54 has been executed before line 53... Help!
> 
> Is the function returning what you think it is?  print_r() before the
> return.

I tried printing out the values before and after each of those lines. After
line 53, $ref_page is an array containing precisely the values I expect, so
the function is working. After line 54, the session var has been reset, as
expected, to match the current page - but $ref_page has also changed and is
now equal to $_SESSION['ref_page'], which is what I found very weird - ie,
resetting $_SESSION['ref_page'] simultaneously reset $ref_page.

I've found a workaround. Within the get_ref_page() function, I now unset the
session vars after transferring their values to $ref_page. This has
involved a little extra coding on those intermediate pages, because on
those pages I really needed the session vars to retain their values. So I'd
still like to know what's going wrong here...



-- 
@+
Steve

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Comment Speed

2004-11-28 Thread Raditha Dissanayake
Marek Kilimajer wrote:
Raditha Dissanayake wrote:
Bruno B B Magalhães wrote:
Does anyone has a solid benchmark about comments speed.. I mean, too 
many comments will decrease speed of the PHP scripts...

Surely there are more important things for you to worry about.

the meaning of life, for example
I wasn't thinking of such big worries and I was thinking more of PHP 
related worries :-))

--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Read PDF files with Php

2004-11-28 Thread Marek Kilimajer
Burhan Khalid wrote:
Jacob Friis wrote:
Do I need PDFlib in order to read PDF files?
Is there another way?

http://www.fpdf.org
http://www.fuckinggoogleit.com :)
Please be nice and learn to read ;)
OP asked how to *READ* pdf files. AFAIK there is no way with php. 
pdf2html may be of some help thought.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Weird sessions problem

2004-11-28 Thread Greg Donald
On Sun, 28 Nov 2004 13:14:54 +0100, steve <[EMAIL PROTECTED]> wrote:
> I have a routine that uses sessions vars to hold the details of the previous
> page, so I can bounce back to it if necessary. But I'm having some weird
> problems with it. In the page I have the following (line numbers included
> to get you an idea of where these things come):
> 
> 17. require_once(INC_PATH."i_std_cfg.phtml");
> 
> (this include file includes the following:)
> 
> define('THIS_PAGE',$_SERVER['PHP_SELF']);

Why would you need to do this?  I'd just use $_SERVER['PHP_SELF'] as is.

> function get_ref_page() {
>   /* Retrieves the details of the last page which will have set
>  the session vars referred to */
>   $ref_page = array();
>   if(isset($_SESSION['ref_page'])) {
> $ref_page['name'] = $_SESSION['ref_page'];
> if(isset($_SESSION['ref_pagequery'])) {
>   $ref_page['query'] = $_SESSION['ref_pagequery'];
> }
>   }
> return $ref_page;
> }
> 
> Now back in the main page:
> 
> 53. $ref_page = get_ref_page(); // now reset session vars to current page

I wouldn't use the same variable names like this.  You have a local
$ref_page, and a $_SESSION variable called 'ref_page'.  While if done
correctly it will work, you only encourage errrors this way.

> 54. $_SESSION['ref_page'] = THIS_PAGE;
> 55. $_SESSION['ref_pagequery'] = $_SERVER['QUERY_STRING'];

I don't follow the need to call a function just to figure out what
$_SESSION variables are already there and available for use.  You seem
to be making this more complex that it needs to be.  I would just use
the variable where they exists already.

> Now, on my local system (PHP 4.3.4) this all works fine. On the live system
> (PHP 4.1 - with PHP run, I believe, as CGI module)

PHP can be built as a 'cgi binary' or as a web server 'module', I've
never heard of a 'cgi module'.  :)

> I hit a problem. At line
> 53, $ref_page is an array containing the values I expect. After line 54,
> $ref_page is now a scalar containing the value of THIS_PAGE. It's almost as
> though line 54 has been executed before line 53... Help!

Is the function returning what you think it is?  print_r() before the return.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] not related but need pointers

2004-11-28 Thread Marek Kilimajer
Brent Clements wrote:
I was wondering, does anyone have a good source for web browser components that 
are compatible with php?
There are a heck of alot of activex components available that allow you to create some very nice web applications. Are there any similiar that a cross-browser compatible that have a really nice professional look like the thousands of activex components out there?
PHP is server side, ActiveX is client side. That is PHP runs on the 
server, ActiveX on the client, they are completely different 
technologies, same as ASP and ActiveX

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] identifying the country of the people who connect to web site / portal

2004-11-28 Thread Greg Donald
> On Sat, 27 Nov 2004 12:35:53 + "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]> wrote:
> > We would like to identify the country of the people who connect to our
> > website / portal using php. The idea is to provide them directly with the
> > homepage in their language.
> >
> > Is that possible? Has anybody ever doen anything like that using php?

You can use geoip:
http://sourceforge.net/projects/geoip/


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Grammar for PHP

2004-11-28 Thread Dominic Fox
Hi,

I would like to parse some PHP files to extract some information about
them. Is there a formal grammar (EBNF or other) anywhere that I could
use as a reference?

I'd like to write the parser myself (in Haskell), so existing PHP
parsers (in PHP itself, for instance) aren't quite what I'm looking
for.

thanks,
Dominic
-- 
// Dream in black and white -
// model cities, shooting up in the air

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Range: bytes=x-y

2004-11-28 Thread Marek Kilimajer
Octavian Rasnita wrote:
Hi all,
Does anyone know why some servers don't return a partial content when I use
the HTTP header:
Range: bytes=100-200
It should return the content of the page starting from byte 100 until the
byte 200, but it still returns the whole page.
Does this happen when the page is sent unbuffered?
Or what else could be?
And can I do something to force those servers to send just a part of the
page?
Web servers are not required to do that. And if the content is generated 
by cgi script, it is up to the script to send corrent range and 
appropiate headers

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Comment Speed

2004-11-28 Thread Marek Kilimajer
Raditha Dissanayake wrote:
Bruno B B Magalhães wrote:
Does anyone has a solid benchmark about comments speed.. I mean, too 
many comments will decrease speed of the PHP scripts...

I've tried without success using a class, and also a simple micro-time 
operation... Well, cause the file is evaluated before it is executed, 
I didn't had success.

Any idea?

Surely there are more important things for you to worry about.
the meaning of life, for example
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Help with GET variables which do not work after upgrading

2004-11-28 Thread Adrian Portsmouth
Hi Eamon,

It looks like you need to upgrade your code to use the superglobal arrays.
Change print $unitID; to print $_GET['unitID']; and see if that helps.

You can find more information regarding superglobals here:
http://uk.php.net/en/language.variables.predefined

HTH


Adrian Portsmouth
.htaccess Manager - SilkPHP
[e] [EMAIL PROTECTED]
[w] www.htaccessmanager.com


This email, its contents and attachments are confidential and may be covered
by legal privilege.  This email contains information intended only for the
person(s) and/or entity named above. The views and opinions expressed are
those of the sender and not necessarily those of SilkPHP or its affiliates.
Any other distribution, copying, review, use or disclosure is strictly
prohibited. If you are not the intended recipient, please delete this
message and any attachments without making a copy and advise the sender by
return email - thank you.

This mail and any attachments have been scanned for viruses prior to leaving
the SilkPHP network. SilkPHP will not be liable for direct, special,
indirect or consequential damages arising from alteration of the contents of
this message by a third party or as a result of any virus being passed on.

-Original Message-
From: Eamon Reyn [mailto:[EMAIL PROTECTED] 
Sent: 28 November 2004 10:37
To: [EMAIL PROTECTED]
Subject: [PHP] Help with GET variables which do not work after upgrading

Hey,

I was happily using GET command line variables in my project under php 4.3.4
but when I upgrade to 4.3.9 they no longer work I can make them work by
changing back to my prior version of php but would rather use the newer one
can anyone explain why this may happen.

here is some sample code and the results of it -

This line creates the link with the GET var in it -

print ''.$theArray[$i]['title'].'Unit Id = '. 
$id .''.$theArray[$i]['desc'].'
';

This is the resultant URL which appears when I click the link above

http://127.0.0.1/ieee1484/IEEE1484/UnitofLearning/showaUnit.php?unitID=1

and when I use the following code in the form

  print ("Unit ID = ");
  print $unitID;

I get the result displayed as - Unit ID =

Which would hopefully display Unit ID = 1 for the case above.

This could be a settings file change or something more major but I would
appreciate any help.

Apologies if this is not the right place to post this but I am getting a bit
desperate if this is the wrong place please tell me the more appropriate
one.

Eamon 

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Weird sessions problem

2004-11-28 Thread steve
I have a routine that uses sessions vars to hold the details of the previous
page, so I can bounce back to it if necessary. But I'm having some weird
problems with it. In the page I have the following (line numbers included
to get you an idea of where these things come):

17. require_once(INC_PATH."i_std_cfg.phtml");

(this include file includes the following:)

define('THIS_PAGE',$_SERVER['PHP_SELF']);
function get_ref_page() {
  /* Retrieves the details of the last page which will have set
 the session vars referred to */
  $ref_page = array();
  if(isset($_SESSION['ref_page'])) {
$ref_page['name'] = $_SESSION['ref_page'];
if(isset($_SESSION['ref_pagequery'])) {
  $ref_page['query'] = $_SESSION['ref_pagequery'];
}
  }
return $ref_page;
}

Now back in the main page:

53. $ref_page = get_ref_page(); // now reset session vars to current page
54. $_SESSION['ref_page'] = THIS_PAGE;
55. $_SESSION['ref_pagequery'] = $_SERVER['QUERY_STRING'];

Now, on my local system (PHP 4.3.4) this all works fine. On the live system
(PHP 4.1 - with PHP run, I believe, as CGI module) I hit a problem. At line
53, $ref_page is an array containing the values I expect. After line 54,
$ref_page is now a scalar containing the value of THIS_PAGE. It's almost as
though line 54 has been executed before line 53... Help!

-- 
@+
Steve

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Range: bytes=x-y

2004-11-28 Thread Octavian Rasnita
Hi all,

Does anyone know why some servers don't return a partial content when I use
the HTTP header:

Range: bytes=100-200

It should return the content of the page starting from byte 100 until the
byte 200, but it still returns the whole page.

Does this happen when the page is sent unbuffered?
Or what else could be?

And can I do something to force those servers to send just a part of the
page?

Thank you.

Teddy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help with GET variables which do not work after upgrading

2004-11-28 Thread Burhan Khalid
Eamon Reyn wrote:
Hey,
I was happily using GET command line variables in my project under php 4.3.4 
but when I upgrade to 4.3.9 they no longer work I can make them work by 
changing back to my prior version of php but would rather use the newer one 
can anyone explain why this may happen.
Please read the release notes for 4.3.9. It will tell you there why they 
are not working.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] identifying the country of the people who connect to web site / portal

2004-11-28 Thread Skippy
On Sat, 27 Nov 2004 12:35:53 + "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> We would like to identify the country of the people who connect to our
> website / portal using php. The idea is to provide them directly with the
> homepage in their language.
> 
> Is that possible? Has anybody ever doen anything like that using php?

Just because my IP address says I'm somewhere it doesn't mean you should
slap me with a certain language which I may or may not understand. People
travel. There are also countries who use more than one language.

Surfers can set their language preferences in their browser. You should
look at the Accept-Language and Accept-Charset headers that the browser
sends and decide based on them. That's the sensible criterium IMO.

-- 
Skippy - Romanian Web Developers - http://ROWD.ORG

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Help with GET variables which do not work after upgrading

2004-11-28 Thread Eamon Reyn
Hey,

I was happily using GET command line variables in my project under php 4.3.4 
but when I upgrade to 4.3.9 they no longer work I can make them work by 
changing back to my prior version of php but would rather use the newer one 
can anyone explain why this may happen.

here is some sample code and the results of it -

This line creates the link with the GET var in it -

print ''.$theArray[$i]['title'].'Unit Id = '. 
$id .''.$theArray[$i]['desc'].' 
';

This is the resultant URL which appears when I click the link above

http://127.0.0.1/ieee1484/IEEE1484/UnitofLearning/showaUnit.php?unitID=1

and when I use the following code in the form

  print ("Unit ID = ");
  print $unitID;

I get the result displayed as - Unit ID =

Which would hopefully display Unit ID = 1 for the case above.

This could be a settings file change or something more major but I would 
appreciate any help.

Apologies if this is not the right place to post this but I am getting a bit 
desperate if this is the wrong place please tell me the more appropriate 
one.

Eamon 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mysql query with exclude

2004-11-28 Thread Reinhart Viane
Little correction:

So something like:
select * from   chat c1,
chat_online c2
where
UNIX_TIMESTAMP(c2.activity)>=$limit_time and
c2.session_id = (c2.user2_sessionid if (c1.user1_sessionid =
$thisuser)) or (c2.user1_sessionid if(c1.user2_sessionid = $thisuser));

I dunno if this is good sql, but I don't think it is.


>>Well
>>That was indeed what I was searching for but. If I read it out loud, I
think with this query I only check if the current user is still onlien
and not his conversation partner.

>>In the chat table is store the session_id's of both the chatters of
the conversation. There is no way to tell if $thisuser is the
user1_sessionid record or user2_sessionid record. So I check them both. 
>>After that I have all results where (user1_sessionid record =
$thisuser or user2_sessionid record = $thisuser) I need to get the other
field. In the first case the users of which the time needs to be
>>>checked is user2_sessionid, in the second case user1_sessionid.

>>So something like:
>>select * from chat c1,
>>  chat_online c2
>>where
>>  UNIX_TIMESTAMP(c2.activity)>=$limit_time and
>>  c2.session_id = (c2.user1_sessionid if (c1.user1_sessionid =
>>$thisuser)) or (c2.user1_sessionid if(c1.user2_sessionid =
$thisuser));


>>Can I do something like this?


>>-Original Message-
>>From: Ligaya Turmelle [mailto:[EMAIL PROTECTED]
>>Sent: zondag 28 november 2004 2:25
>>To: [EMAIL PROTECTED]
>>Cc: [EMAIL PROTECTED]
>>Subject: Re: [PHP] mysql query with exclude


>>Sounds like you need a join.  Maybe something like:
>>
>>select * from chat c1,
>>  chat_online c2
>>where
>>  UNIX_TIMESTAMP(c2.activity)=$limit_time and
>>  c2.session_id = $thisuser and
>>  ((c1.user1_sessionid = $thisuser) or
>>  c1.user2_sessionid = $thisuser));
>>Respectfully,
>>Ligaya Turmelle



>>Reinhart Viane wrote:
> Hey all,
>  
> Hope you all have fun this saturday evening :)
> I'm sure i'm having fun except i'm kinda stuck...
>  
> Ok here goes...
>  
> I have 2 tables, one with the people online (chat_online): session_id
> activity
>  
>  
> And a second one where i keep the conversations between people(chat): 
> user1_sessionid user2_sessionid
> chat_conv
>  
> To see what chatter are still online during the last 2 minutes i do a 
> check like this on the chat_online table: $limit_time= time()-130;
> $sqlchatonline="select * from chat_online where
UNIX_TIMESTAMP(activity)
> 
>>=$limit_time";
> 
>  
> ok, on my page i also do a query to see what conversations are going 
> on with the user: $thisuser=session_id();
> $getchatlist="select * from chat where (user1_sessionid=$thisuser) or
> (user2_sessionid=$thisuser)";
>  
> This selects all the conversations which this user has been/or is 
> into. I list all the chatpartners of thisuser. Off course it is 
> possible that other chatters who had a conversation with this user are

> not online anymore. So i need to combine those two queries in a way...
>  
> this is what i think it should be:
> $getchatlist=select * from chat where (user1_sessionid=$thisuser) or 
> (user2_sessionid=$thisuser); 
> $resultchatlist=mysql_query($getchatlist);
> while ($row=mysql_fetch_array($resultchatlist)) {
> get the second chattersessionid in each conversation and check

> if this chatter was still online in the last two minutes.
> if he is not, exclude him from the array and do not show him 
> in the list (optional delete the record in the database) }
>  
> or maybe i can combine those two queries in one?
>  
> Can someone help me out on this?
>  
> Thx in advance,
> Reinhart
>  
>  
>  
>  
>  
>   _
> 
> Reinhart Viane
>   [EMAIL PROTECTED] 
> Domos || D-Studio 
> Graaf Van Egmontstraat 15/3 -- B 2800 Mechelen -- tel +32 15 44 89 01
--
> fax +32 15 43 25 26 
> 
> 
> STRICTLY PERSONAL AND CONFIDENTIAL
> This message may contain confidential and proprietary material for the
> sole use of the intended 
> recipient.  Any review or distribution by others is strictly
prohibited.
> If you are not the intended 
> recipient please contact the sender and delete all copies.
> 
>  
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mysql query with exclude

2004-11-28 Thread Reinhart Viane
Well
That was indeed what I was searching for but. If I read it out loud, I
think with this query I only check if the current user is still onlien
and not his conversation partner.

In the chat table is store the session_id's of both the chatters of the
conversation.
There is no way to tell if $thisuser is the user1_sessionid record or
user2_sessionid record. So I check them both. 
After that I have all results where (user1_sessionid record = $thisuser
or user2_sessionid record = $thisuser) I need to get the other field.
In the first case the users of which the time needs to be checked is
user2_sessionid, in the second case user1_sessionid.

So something like:
select * from   chat c1,
chat_online c2
where
UNIX_TIMESTAMP(c2.activity)>=$limit_time and
c2.session_id = (c2.user1_sessionid if (c1.user1_sessionid =
$thisuser)) or (c2.user1_sessionid if(c1.user2_sessionid = $thisuser));


Can I do something like this?


>>-Original Message-
>>From: Ligaya Turmelle [mailto:[EMAIL PROTECTED] 
>>Sent: zondag 28 november 2004 2:25
>>To: [EMAIL PROTECTED]
>>Cc: [EMAIL PROTECTED]
>>Subject: Re: [PHP] mysql query with exclude


>>Sounds like you need a join.  Maybe something like:
>>
>>select * from chat c1,
>>  chat_online c2
>>where
>>  UNIX_TIMESTAMP(c2.activity)=$limit_time and
>>  c2.session_id = $thisuser and
>>  ((c1.user1_sessionid = $thisuser) or
>>  c1.user2_sessionid = $thisuser));
>>Respectfully,
>>Ligaya Turmelle



>>Reinhart Viane wrote:
> Hey all,
>  
> Hope you all have fun this saturday evening :)
> I'm sure i'm having fun except i'm kinda stuck...
>  
> Ok here goes...
>  
> I have 2 tables, one with the people online (chat_online): session_id
> activity
>  
>  
> And a second one where i keep the conversations between people(chat): 
> user1_sessionid user2_sessionid
> chat_conv
>  
> To see what chatter are still online during the last 2 minutes i do a 
> check like this on the chat_online table: $limit_time= time()-130;
> $sqlchatonline="select * from chat_online where
UNIX_TIMESTAMP(activity)
> 
>>=$limit_time";
> 
>  
> ok, on my page i also do a query to see what conversations are going 
> on with the user: $thisuser=session_id();
> $getchatlist="select * from chat where (user1_sessionid=$thisuser) or
> (user2_sessionid=$thisuser)";
>  
> This selects all the conversations which this user has been/or is 
> into. I list all the chatpartners of thisuser. Off course it is 
> possible that other chatters who had a conversation with this user are

> not online anymore. So i need to combine those two queries in a way...
>  
> this is what i think it should be:
> $getchatlist=select * from chat where (user1_sessionid=$thisuser) or 
> (user2_sessionid=$thisuser); 
> $resultchatlist=mysql_query($getchatlist);
> while ($row=mysql_fetch_array($resultchatlist)) {
> get the second chattersessionid in each conversation and check

> if this chatter was still online in the last two minutes.
> if he is not, exclude him from the array and do not show him 
> in the list (optional delete the record in the database) }
>  
> or maybe i can combine those two queries in one?
>  
> Can someone help me out on this?
>  
> Thx in advance,
> Reinhart
>  
>  
>  
>  
>  
>   _
> 
> Reinhart Viane
>   [EMAIL PROTECTED] 
> Domos || D-Studio 
> Graaf Van Egmontstraat 15/3 -- B 2800 Mechelen -- tel +32 15 44 89 01
--
> fax +32 15 43 25 26 
> 
> 
> STRICTLY PERSONAL AND CONFIDENTIAL
> This message may contain confidential and proprietary material for the
> sole use of the intended 
> recipient.  Any review or distribution by others is strictly
prohibited.
> If you are not the intended 
> recipient please contact the sender and delete all copies.
> 
>  
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Read PDF files with Php

2004-11-28 Thread Burhan Khalid
Jacob Friis wrote:
Do I need PDFlib in order to read PDF files?
Is there another way?
http://www.fpdf.org
http://www.fuckinggoogleit.com :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Passing Parameters

2004-11-28 Thread Burhan Khalid
David Blackburn wrote:
I used to pass parameters to my scripts like this
shell>php myscript.php "dog=max&cat=jess"
Since I have upgraded to PHP5 I dont seem to have this functionality
any more, has anyone else noticed this ? or know of a way to get this
working again ?
You can pass parameters in the "normal" way, ie,
php myscript.php -dog=max -cat=jess and read them in with argv, or you 
can use the pear Console_Getargs and Console_Getopts classes to help you 
with command line parsing.

They way you are doing it now is really not the right way, and I'm 
suprised it worked, actually.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] not related but need pointers

2004-11-28 Thread Brent Clements
I was wondering, does anyone have a good source for web browser components that 
are compatible with php?

There are a heck of alot of activex components available that allow you to 
create some very nice web applications. Are there any similiar that a 
cross-browser compatible that have a really nice professional look like the 
thousands of activex components out there?
 
Thanks,
Brent