php-general Digest 16 Aug 2005 14:53:36 -0000 Issue 3628

2005-08-16 Thread php-general-digest-help

php-general Digest 16 Aug 2005 14:53:36 - Issue 3628

Topics (messages 220669 through 220696):

Re: Problem using Metabase
220669 by: Pablo Gosse
220671 by: Pablo Gosse
220676 by: Manuel Lemos

Re: Problem when encoding non-english into UTF-8
220670 by: Jasper Bryant-Greene
220685 by: John Nichel

Re: one more mysql question
220672 by: Esteamedpw.aol.com

Re: Be careful! Look at what this spammer did.
220673 by: Esteamedpw.aol.com

Re: 'God' has spoken... :-)
220674 by: George Pitcher
220677 by: Jochem Maas

Re: php output to string
220675 by: Jesús Fernández

Re: Javascript Src and HTTP_REFERER
220678 by: Dotan Cohen
220679 by: Jasper Bryant-Greene

Windows, DLLs and php.ini
220680 by: Chris Boget

Advice sought on PHP site maintenance
220681 by: George Pitcher
220688 by: John Nichel
220690 by: George Pitcher
220694 by: Mark Rees
220696 by: George Pitcher

Upgrading PHP 4.2.3 to PHP 4.3.2
220682 by: T.N.Prasad
220684 by: Jim Moseby
220686 by: John Nichel
220687 by: Torgny Bjers
220689 by: Tim Burgan
220692 by: Burhan Khalid

I fixed the logic :-) --- Recursive Array on outputing correctly
220683 by: Gregory Machin

php 5.04 register_globals aint acting right.
220691 by: Daniel Baughman
220693 by: Jochem Maas

How to suppress HTTP headers?
220695 by: Thomas Capote

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
php-general@lists.php.net


--
---BeginMessage---
[snip]
 Here's my code:
 
 require(classes/metabase/metabase_database.php);
 require(classes/metabase/metabase_interface.php);
 
 $error=MetabaseSetupDatabaseObject(array(Type=odbc-msaccess,
 IncludePath=classes/metabase), $db);
 
 if($error!=) {
   echo Database setup error: $error\n;
   exit;
 }
 
 $db-SetDatabase(etrakADB);

I tried that code here with PHP 4.3.11 and it works perfectly.

Which version of PHP are you using?

Are you using any PHP cache extension like APC or another?

Metabase loads the class files by the right order but it is possible 
that a buggy caching extension may be causing that problem.

You may also try loading the classes as workaround right after the 
includes you make in your script:

require('classes/metabase/metabase_odbc.php');
require('classes/metabase/metabase_odbc_msaccess.php');
require('classes/metabase/manager_odbc.php');
require('classes/metabase/manager_odbc_msaccess.php');
[/snip]

Thanks, Manuel.  I tried what you suggested but it didn't work.  The server 
this project is housed on is an IIS server running PHP 4.4.0.

I installed the metabase package on a linux server, and was able to connect to 
a postgres database with no troubles at all.

It must be something in our PHP configuration that's causing the problem, but 
I'm pretty sure we have a cache extension installed.  This PHP install was done 
rather quickly, unless there's a cache extension installed by default (which 
there is not as far as I understand, but I could be wrong ...) we likely didn't 
install one.

Thanks,

Pablo
---End Message---
---BeginMessage---
[snip]
It must be something in our PHP configuration that's causing the
problem, but I'm pretty sure we have a cache extension installed.  This
PHP install was done rather quickly, unless there's a cache extension
installed by default (which there is not as far as I understand, but I
could be wrong ...) we likely didn't install one.
[/snip]

Sorry, I meant to say that we likely DO NOT have a cache extension
installed.

Can anyone think of any other reason why the order in which the class
files are loaded would be changed on one server to the next?

Cheers and TIA,

Pablo
---End Message---
---BeginMessage---

Hello,

on 08/16/2005 12:01 AM Pablo Gosse said the following:

Thanks, Manuel.  I tried what you suggested but it didn't work.  The
server this project is housed on is an IIS server running PHP 4.4.0.

I installed the metabase package on a linux server, and was able to
connect to a postgres database with no troubles at all.

It must be something in our PHP configuration that's causing the
problem, but I'm pretty sure we have a cache extension installed.
This PHP install was done rather quickly, unless there's a cache
extension installed by default (which there is not as far as I
understand, but I could be wrong ...) we likely didn't install one.


I suspect that the problem is with file permissions. I recall that since 
Metabase uses include to load class files, the script will not exit when 
 it fails to include a PHP class file. Assuming that is the case, make 
sure that all Metabase class files are readable by your Web server user.



--

Regards,

RE: [PHP] 'God' has spoken... :-)

2005-08-16 Thread George Pitcher
 Not only that, but as time goes by, community support (this list for
 instance) for 4 will likely diminish as others move on to later releases.
 Not only will the die-hard PHP4 users find it harder to get
 answers to their
 questions, but their answers to others will become less relevant to
 newer-version users.

I can speak form experience here, not PHP as this is such a wonderful
community, but Lasso. I used Lasso v3 from 2001-2005, hooking a FileMaker
solution to the web for a relatively small but complex UK-wide university
service and didn't need to upgrade to v5 when that rolled out (it wasn't
broke etc etc).

As I developed the PHP/MySQL solution that has now replaced it, I still
needed to maintain and improve the existing Lasso site. I found that I was
one of the only v3 users on the list and started getting nil responses to
pleas for help.

If you have the time, it's worth going with the flow, if not, then consider
jumping at say - every two years (at most) to keep up to date.

Just my 2p (no cents in England)

George in Oxford

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



Re: [PHP] php output to string

2005-08-16 Thread Jesús Fernández
thanks everyone, the problem was the url i needed to use. now the problem is 
solved :)

-- 
El único error real es aquel en el que no hemos aprendido nada.


[PHP] Re: Problem using Metabase

2005-08-16 Thread Manuel Lemos

Hello,

on 08/16/2005 12:01 AM Pablo Gosse said the following:

Thanks, Manuel.  I tried what you suggested but it didn't work.  The
server this project is housed on is an IIS server running PHP 4.4.0.

I installed the metabase package on a linux server, and was able to
connect to a postgres database with no troubles at all.

It must be something in our PHP configuration that's causing the
problem, but I'm pretty sure we have a cache extension installed.
This PHP install was done rather quickly, unless there's a cache
extension installed by default (which there is not as far as I
understand, but I could be wrong ...) we likely didn't install one.


I suspect that the problem is with file permissions. I recall that since 
Metabase uses include to load class files, the script will not exit when 
 it fails to include a PHP class file. Assuming that is the case, make 
sure that all Metabase class files are readable by your Web server user.



--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



Re: [PHP] 'God' has spoken... :-)

2005-08-16 Thread Jochem Maas

l0t3k wrote:
not only encoding support, but internationalized date/time/number formatting 
support (including spellout), collation, breakiteration and transliteration. 
in many respects we'll be on par with Java I18N support. To see what will be 
available, see


http://icu.sourceforge.net/userguide/


thanks for the link l0t3k. :-)



and look at the topics on the left


l0t3k

Jochem Maas [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]


the biggest gain in php6 will be transparent unicode support - that is 
awesome,
a really big plus - I'm crap at encoding et al and would really love it 
if
php could handle all those funny characters without me having to think 
about it
too much (and without having to using mb_string or iconv) - I run a couple 
of multi-lingual
sites - right now I just pray every night that nobody asks me to implement 
japanese,

or something, there ;-)






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



Re: [PHP] Javascript Src and HTTP_REFERER

2005-08-16 Thread Dotan Cohen
On 8/6/05, Cabbar Duzayak [EMAIL PROTECTED] wrote:
 Hi,
 
 I have a web page (say page1) which refers to a php within javascript tag as:
 
 script type=text/javascript
 src=http://mysite.com/javascript_dump.php;/script
 
 As you can see, this calls a php file which dumps javascript. The
 problem here is, within this php I couldn't get which page it is
 called from.
 
 Basically, if it comes from affiliate site 1, I will show some
 content, and if it comes from affiliate site 2, I will show some other
 content.
 
 And, the thing is, within this javascript_dump.php, HTTP_REFERER shows
 nothing, because it gives you the referer of the html page (page1)
 that contains this script tag (which might be something irrelevant,
 i.e. google), and remote_addr gives you the IP address of the user.
 
 I know that I can add a simple query parameter to specify the source
 web page such as: javascript_dump.php?siteid=xyz, but this can be
 faked very easily, and anyone can introduce themselves as any
 affiliate.
 
 Is there a way of getting (within the php) the site this php was
 called from in a reasonably secure way? Any ideas/suggestions?
 
 Thanks..
 

Duzayak,
Did you get this working the way you intented? If so, please share
with us what you did. Thanks.

Dotan
http://lyricslist.com/lyrics/artist_albums/348/mighty_mighty_bosstones.php
Mighty Mighty Bosstones Song Lyrics

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



Re: [PHP] Javascript Src and HTTP_REFERER

2005-08-16 Thread Jasper Bryant-Greene

Dotan Cohen wrote:

And, the thing is, within this javascript_dump.php, HTTP_REFERER shows
nothing, because it gives you the referer of the html page (page1)
that contains this script tag (which might be something irrelevant,
i.e. google), and remote_addr gives you the IP address of the user.

I know that I can add a simple query parameter to specify the source
web page such as: javascript_dump.php?siteid=xyz, but this can be
faked very easily, and anyone can introduce themselves as any
affiliate.

Is there a way of getting (within the php) the site this php was
called from in a reasonably secure way? Any ideas/suggestions?

Thanks..


Duzayak,
Did you get this working the way you intented? If so, please share
with us what you did. Thanks.


There's no reasonably secure way of doing this. I see three possible 
solutions.


1. Put a query parameter in, like you said you didn't want to. This is 
about as easy to fake as HTTP_REFERER, which could hardly be called 
secure anyway. HTTP_REFERER is set less and less often anyway, as people 
block it with security software.


2. Define a global variable in JavaScript before including the remote 
script, a la AdSense.


3. If the times on the servers can be expected to be synchronised, or 
you have some other unique but changing value that both servers know 
about, get an MD5/SHA1 hash of that value with the affiliate ID appended 
on the end, and compare it at the other end.


Jasper

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



[PHP] Windows, DLLs and php.ini

2005-08-16 Thread Chris Boget
I've looked at the documentation but was able to find this.  If anyone
can point
me to the right page, it would be much appreciated.  In any case, where
do you
define where PHP looks for the appropriate DLLs?  For example, if a DLL
(say,
ntwdblib.dll) is in both the \PHP\dll directory and the
\windows\system32
directory, which does PHP pull in?  And where do you specify which
directory
is used?
 
Additionally, where can you find detailed information about what the
mssql
configuration options actually do?  IE, mssql.textlimit,
mssql.max_persistent,
mssql.timeout, et. al.
 
thnx,
Chris


[PHP] Advice sought on PHP site maintenance

2005-08-16 Thread George Pitcher
Hi,

I manage several sites for my company. Some are running our own service to
about 80 customers and others are running a service for some (5 and growing)
of our customers. Its the latter one that I need advice on.

I have an application where each customer has a website on our service. The
functionality and layout are almost identical throughout these sites and I
am striving to move any differences into configuration files. However, when
I make a change, I then need to make that change on each site.

I would like, if possible to maintain a single set of web pages and have
that work for all sites. I currently use PEAR::DB and Smarty templating. The
current url syntax is www.mysite.com/client/ and I would like to keep them
thinking that they each have their own unique site.

Can anyone suggest a structure for this?

MTIA

George in Oxford

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



[PHP] Upgrading PHP 4.2.3 to PHP 4.3.2

2005-08-16 Thread T.N.Prasad
HI All,
 
Our company servers are being upgraded from 4.2.3 to 4.3.2.
 
Is there any special care that I should take (as far as my scripts are
concerned)?
 
Plz help me. I'm new to PHP.
 
 
Thanks
TNP
Professional Services
ZUSTEK INDIA 

 


[PHP] I fixed the logic :-) --- Recursive Array on outputing correctly

2005-08-16 Thread Gregory Machin
Here it is..
i found the problem.. 1) all the menu objects-arrChildren have an array ,
if there are on submenus.. then the array is empty .. the function was
trying to recurse through empty arrays. 2) the recursive call needed to
pass  the arrChildren to recurse correctly
display_menu($value-arrChildren);

now just to get the html output and css to live together :-)...

Thanks All form the support, all bets greg..


?php
$link = mysql_connect(127.0.0.1, root, );
if (!$link) {
   die('Could not connect: ' . mysql_error());
}

// make  the current db
$db_selected = mysql_select_db('NEW_CMS', $link);
if (!$db_selected) {
   die ( can't connect to database :  . mysql_error());
}
class MenuItem
{
var $intID = 0;
var $names = '';
var $arrChildren = array( );
//
// Constructor
function MenuItem ( $intID, $text )
{
$this-intID = $intID;
$this-names = $text;
$this-addChildren( );
}
function addChildren ( )
{
$strSQL = select id, name from newCMS_section where Parent = .
$this-intID .;

$rseResult = mysql_query($strSQL);


  while ( $arrRecord = mysql_fetch_array( $rseResult, MYSQL_BOTH ) )
  {
$this-arrChildren[] = new MenuItem( trim(  $arrRecord[0] ),
trim($arrRecord[1]) );
  }
}

}

$Menu = new MenuItem(0,'');

$txt = $Menu-arrChildren;



function display_menu($array) {
$link ='';
$namez ='';

foreach ($array as $key = $value) {
if(empty($value-arrChildren)){ //arrChildren =Array
// problem was with the above if statment.
$namez = $value-names;
$link = $value-names;
echo lia href='{$link}'{$namez}/a/li\n;

  } else {
$namez = $value-names;

echo ullia{$namez}/aul;

display_menu($value-arrChildren);

echo '/ul/li/ul';

} // end of else
} // end of foreach loop
} // end of function
//echo ul;
echo ul id='nav' ;
display_menu($txt);

?



-- 
Many Thanks
Gregory Machin (flamer)
072 524 8096
www.linuxpro.co.za
[EMAIL PROTECTED]

Agent for iberry.info hosting solutions



--

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



RE: [PHP] Upgrading PHP 4.2.3 to PHP 4.3.2

2005-08-16 Thread Jim Moseby
 -Original Message-
 From: T.N.Prasad [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, August 16, 2005 9:00 AM
 To: php-general@lists.php.net
 Subject: [PHP] Upgrading PHP 4.2.3 to PHP 4.3.2
 Importance: High
 
 
 HI All,
  
 Our company servers are being upgraded from 4.2.3 to 4.3.2.
  
 Is there any special care that I should take (as far as my scripts are
 concerned)?
  
 Plz help me. I'm new to PHP.

Greetings,

You are the only one who knows how your scripts are written, so you will
have to answer that question for yourself.  I don't know of any specific
problems between those versions, but you can see ALL the things that have
changed between them here:
http://www.php.net/ChangeLog-4.php

Cheers!

JM

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



Re: [PHP] Problem when encoding non-english into UTF-8

2005-08-16 Thread John Nichel

Wong HoWang wrote:

Dear all,

When I try to encode non-english char. such as big5 to UTF-8 with 
utf8_encode(), it always generate a wrong result, which is not readable. 
What can I do?


Please help! 



http://us2.php.net/iconv

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Upgrading PHP 4.2.3 to PHP 4.3.2

2005-08-16 Thread John Nichel

T.N.Prasad wrote:

HI All,
 
Our company servers are being upgraded from 4.2.3 to 4.3.2.
 
Is there any special care that I should take (as far as my scripts are

concerned)?
 
Plz help me. I'm new to PHP.


In theory, no.  However, theory can get you into trouble.  Check the 
change log, and if possible, install 4.3.2 on a non-production box to 
test your scripts there.


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Upgrading PHP 4.2.3 to PHP 4.3.2

2005-08-16 Thread Torgny Bjers
T.N.Prasad wrote:

HI All,
 
Our company servers are being upgraded from 4.2.3 to 4.3.2.
 
Is there any special care that I should take (as far as my scripts are
concerned)?
 
Plz help me. I'm new to PHP.


Hello,

You don't have to worry at all.

Nothing have changed between those versions that break compatibility
with older scripts. If you were to downgrade from 4.3.2 to 4.2.3
instead, that would pose problems if you for instance were using
internal functions such as file_get_contents() which appeared in 4.3.0. :)

Regards,
Torgny

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



Re: [PHP] Advice sought on PHP site maintenance

2005-08-16 Thread John Nichel

George Pitcher wrote:

Hi,

I manage several sites for my company. Some are running our own service to
about 80 customers and others are running a service for some (5 and growing)
of our customers. Its the latter one that I need advice on.

I have an application where each customer has a website on our service. The
functionality and layout are almost identical throughout these sites and I
am striving to move any differences into configuration files. However, when
I make a change, I then need to make that change on each site.

I would like, if possible to maintain a single set of web pages and have
that work for all sites. I currently use PEAR::DB and Smarty templating. The
current url syntax is www.mysite.com/client/ and I would like to keep them
thinking that they each have their own unique site.

Can anyone suggest a structure for this?


If I'm reading you right, you're looking to keep a group of 
scripts/classes in one place that all sites can draw from.  If this is 
the case, you could always set a global include directory (make it read 
only for the users of your service), and configure that path in Apache's 
httpd.conf or an .htaccess.  I do this on our box (all the sites are 
ours, but when I have to update Smarty/PEAR/custom scripts, I like to 
just do it in one place).


VirtualHostDirectory
-VirtualHost1
-docs
-VirtualHost2
-docs
-VirtualHost3
-docs
-VirtualHost4
-docs
-GlobalInclude
-PEAR
-Smarty
-Custom

So on, and so forth.



--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Upgrading PHP 4.2.3 to PHP 4.3.2

2005-08-16 Thread Tim Burgan

Can I extend this..

On a live server I have PHP 4.1. If I upgrade to PHP 5, is something 
likely to stop working?


I've been putting off upgrading for months because of the unknown of 
something going wrong.


Thanks

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



RE: [PHP] Advice sought on PHP site maintenance

2005-08-16 Thread George Pitcher
John,

Thanks for the input. I just knew I hadn't covered everything. My server is
currently set up as NT4/IIS. I suppose I could look to switching to Apache
though.

Cheers

George

 -Original Message-
 From: John Nichel [mailto:[EMAIL PROTECTED]
 Sent: 16 August 2005 2:25 pm
 To: php-general@lists.php.net
 Subject: Re: [PHP] Advice sought on PHP site maintenance


 George Pitcher wrote:
  Hi,
 
  I manage several sites for my company. Some are running our own
 service to
  about 80 customers and others are running a service for some (5
 and growing)
  of our customers. Its the latter one that I need advice on.
 
  I have an application where each customer has a website on our
 service. The
  functionality and layout are almost identical throughout these
 sites and I
  am striving to move any differences into configuration files.
 However, when
  I make a change, I then need to make that change on each site.
 
  I would like, if possible to maintain a single set of web pages and have
  that work for all sites. I currently use PEAR::DB and Smarty
 templating. The
  current url syntax is www.mysite.com/client/ and I would like
 to keep them
  thinking that they each have their own unique site.
 
  Can anyone suggest a structure for this?

 If I'm reading you right, you're looking to keep a group of
 scripts/classes in one place that all sites can draw from.  If this is
 the case, you could always set a global include directory (make it read
 only for the users of your service), and configure that path in Apache's
 httpd.conf or an .htaccess.  I do this on our box (all the sites are
 ours, but when I have to update Smarty/PEAR/custom scripts, I like to
 just do it in one place).

 VirtualHostDirectory
   -VirtualHost1
   -docs
   -VirtualHost2
   -docs
   -VirtualHost3
   -docs
   -VirtualHost4
   -docs
   -GlobalInclude
   -PEAR
   -Smarty
   -Custom

 So on, and so forth.



 --
 John C. Nichel
 ÜberGeek
 KegWorks.com
 716.856.9675
 [EMAIL PROTECTED]

 --
 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] php 5.04 register_globals aint acting right.

2005-08-16 Thread Daniel Baughman



 
 
 
 
 
 
 
 
 I have register globals enabled, or set to “On”.  Isn’t this suppose to
take all of the $_POST variables and $_GET variables and make initialize
them by name?

i.e. $_POST[‘runquery’] will be accessible via simply $runquery

??

 
Dan Baughman
IT Technician
Professional Bull Riders, Inc.
719-471-3008 x 3161

CONFIDENTIAL, FOR DESIGNATED RECIPIENTS ONLY:  The preceding e-mail message
(including any attachments) contains information that may be confidential,
privileged, or non-public information. It is intended to be conveyed only to
the designated recipient(s) named above. If you are not an intended
recipient, please notify the sender by replying to this message and then
delete all copies of it from your computer system. Any use, dissemination,
distribution, or reproduction of this message by unintended recipients is
not authorized and may be unlawful.  DISCLAIMER OF ELECTRONIC TRANSACTION: 
This communication does not reflect an intention by the sender to conduct a
transaction or make any agreement by electronic means.  Nothing contained
herein shall constitute an electronic signature or a contract under any law,
rule or regulation applicable to electronic transactions.



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



Re: [PHP] Upgrading PHP 4.2.3 to PHP 4.3.2

2005-08-16 Thread Burhan Khalid

Tim Burgan wrote:

Can I extend this..

On a live server I have PHP 4.1. If I upgrade to PHP 5, is something 
likely to stop working?


99% yes. Especially if you really mean 4.1.0 -- that's quite old.

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



Re: [PHP] php 5.04 register_globals aint acting right.

2005-08-16 Thread Jochem Maas

Daniel Baughman wrote:



 
 
 
 
 
 
 
 
 I have register globals enabled, or set to “On”.  Isn’t this suppose to

take all of the $_POST variables and $_GET variables and make initialize
them by name?


register_globals should do that. but not register globals,
regardless is a shitty setting. don't use it. besides its depreciated
just use $_POST['whatever']



i.e. $_POST[‘runquery’] will be accessible via simply $runquery


looks like you are stuffing SQL into a GET/POST param - sure you want to do 
that?





??

 
Dan Baughman

IT Technician
Professional Bull Riders, Inc.
719-471-3008 x 3161

CONFIDENTIAL, FOR DESIGNATED RECIPIENTS ONLY:  The preceding e-mail message
(including any attachments) contains information that may be confidential,
privileged, or non-public information. It is intended to be conveyed only to
the designated recipient(s) named above. If you are not an intended
recipient, please notify the sender by replying to this message and then
delete all copies of it from your computer system. Any use, dissemination,
distribution, or reproduction of this message by unintended recipients is
not authorized and may be unlawful.  DISCLAIMER OF ELECTRONIC TRANSACTION: 
This communication does not reflect an intention by the sender to conduct a

transaction or make any agreement by electronic means.  Nothing contained
herein shall constitute an electronic signature or a contract under any law,
rule or regulation applicable to electronic transactions.





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



Re: [PHP] Advice sought on PHP site maintenance

2005-08-16 Thread Mark Rees
George Pitcher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 John,

 Thanks for the input. I just knew I hadn't covered everything. My server
is
 currently set up as NT4/IIS. I suppose I could look to switching to Apache
 though.

Far be it from me to discrouage you from switching to Apache. However, on
IIS, you can store the include files and classes you wish to use across
several sites in a single location. You can then make this accessible to all
sites by adding the location in as a virtual directory. This basically
allows you to refer to it as if it were a directory within your webroot (if
I remember right, it's been a while).

There's a brief guide here:
http://www.mvps.org/marksxp/WindowsXP/IIS/iis3.php

Giood luck

Mark


 Cheers

 George

  -Original Message-
  From: John Nichel [mailto:[EMAIL PROTECTED]
  Sent: 16 August 2005 2:25 pm
  To: php-general@lists.php.net
  Subject: Re: [PHP] Advice sought on PHP site maintenance
 
 
  George Pitcher wrote:
   Hi,
  
   I manage several sites for my company. Some are running our own
  service to
   about 80 customers and others are running a service for some (5
  and growing)
   of our customers. Its the latter one that I need advice on.
  
   I have an application where each customer has a website on our
  service. The
   functionality and layout are almost identical throughout these
  sites and I
   am striving to move any differences into configuration files.
  However, when
   I make a change, I then need to make that change on each site.
  
   I would like, if possible to maintain a single set of web pages and
have
   that work for all sites. I currently use PEAR::DB and Smarty
  templating. The
   current url syntax is www.mysite.com/client/ and I would like
  to keep them
   thinking that they each have their own unique site.
  
   Can anyone suggest a structure for this?
 
  If I'm reading you right, you're looking to keep a group of
  scripts/classes in one place that all sites can draw from.  If this is
  the case, you could always set a global include directory (make it read
  only for the users of your service), and configure that path in Apache's
  httpd.conf or an .htaccess.  I do this on our box (all the sites are
  ours, but when I have to update Smarty/PEAR/custom scripts, I like to
  just do it in one place).
 
  VirtualHostDirectory
  -VirtualHost1
  -docs
  -VirtualHost2
  -docs
  -VirtualHost3
  -docs
  -VirtualHost4
  -docs
  -GlobalInclude
  -PEAR
  -Smarty
  -Custom
 
  So on, and so forth.

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



[PHP] How to suppress HTTP headers?

2005-08-16 Thread Thomas Capote
I am coding a PHP page to deal with a badly implemented automated status
update script on a remote server (that I do not control) which fails if my
response to it's POST request has HTTP headers. Go figure. So the question
is How do I NOT send HTTP headers in my response? or How can my script
suppress headers completely? Whatever the solution, it should affect only
this page/script.

In chapter 43, the PHP Manual states: Though the CGI SAPI provides a way to
suppress HTTP headers, there's no equivalent switch to enable them in the
CLI SAPI. How would one suppress HTTP headers, as noted above, in the CGI
SAPI for a particular page on my site?
 
Somebody, please help.
--TC.

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



RE: [PHP] Advice sought on PHP site maintenance

2005-08-16 Thread George Pitcher
Mark,

Thanks, I'll follow that up as well. I don't have to do this straight away.

Cheers

George

 -Original Message-
 From: Mark Rees [mailto:[EMAIL PROTECTED]
 Sent: 16 August 2005 3:33 pm
 To: php-general@lists.php.net
 Subject: Re: [PHP] Advice sought on PHP site maintenance


 George Pitcher [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  John,
 
  Thanks for the input. I just knew I hadn't covered everything. My server
 is
  currently set up as NT4/IIS. I suppose I could look to
 switching to Apache
  though.

 Far be it from me to discrouage you from switching to Apache. However, on
 IIS, you can store the include files and classes you wish to use across
 several sites in a single location. You can then make this
 accessible to all
 sites by adding the location in as a virtual directory. This basically
 allows you to refer to it as if it were a directory within your
 webroot (if
 I remember right, it's been a while).

 There's a brief guide here:
 http://www.mvps.org/marksxp/WindowsXP/IIS/iis3.php

 Giood luck

 Mark

 
  Cheers
 
  George
 
   -Original Message-
   From: John Nichel [mailto:[EMAIL PROTECTED]
   Sent: 16 August 2005 2:25 pm
   To: php-general@lists.php.net
   Subject: Re: [PHP] Advice sought on PHP site maintenance
  
  
   George Pitcher wrote:
Hi,
   
I manage several sites for my company. Some are running our own
   service to
about 80 customers and others are running a service for some (5
   and growing)
of our customers. Its the latter one that I need advice on.
   
I have an application where each customer has a website on our
   service. The
functionality and layout are almost identical throughout these
   sites and I
am striving to move any differences into configuration files.
   However, when
I make a change, I then need to make that change on each site.
   
I would like, if possible to maintain a single set of web pages and
 have
that work for all sites. I currently use PEAR::DB and Smarty
   templating. The
current url syntax is www.mysite.com/client/ and I would like
   to keep them
thinking that they each have their own unique site.
   
Can anyone suggest a structure for this?
  
   If I'm reading you right, you're looking to keep a group of
   scripts/classes in one place that all sites can draw from.  If this is
   the case, you could always set a global include directory
 (make it read
   only for the users of your service), and configure that path
 in Apache's
   httpd.conf or an .htaccess.  I do this on our box (all the sites are
   ours, but when I have to update Smarty/PEAR/custom scripts, I like to
   just do it in one place).
  
   VirtualHostDirectory
   -VirtualHost1
   -docs
   -VirtualHost2
   -docs
   -VirtualHost3
   -docs
   -VirtualHost4
   -docs
   -GlobalInclude
   -PEAR
   -Smarty
   -Custom
  
   So on, and so forth.

 --
 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] How to suppress HTTP headers?

2005-08-16 Thread tg-php
So their page POSTs to a PHP page that you've created?  I'm not seeing where 
headers come into play there, they're on output, not input.  Maybe I just 
stayed up too late last night, but I'm having trouble wrapping my brain around 
the problem.

One thing I did notice was you mentioned switches for CGI vs CLI SAPI.  I 
expect that there wouldn't be a switch for CLI because no headers are needed 
when using PHP command line, therefore nothing to turn off.  Again, maybe I'm 
misunderstanding the situation but thought I'd throw that thought in the ring.

Maybe you can describe the interaction between the system you can't control and 
your PHP scripts better.  Walk us through it step by step.

-TG

= = = Original message = = =

I am coding a PHP page to deal with a badly implemented automated status
update script on a remote server (that I do not control) which fails if my
response to it's POST request has HTTP headers. Go figure. So the question
is How do I NOT send HTTP headers in my response? or How can my script
suppress headers completely? Whatever the solution, it should affect only
this page/script.

In chapter 43, the PHP Manual states: Though the CGI SAPI provides a way to
suppress HTTP headers, there's no equivalent switch to enable them in the
CLI SAPI. How would one suppress HTTP headers, as noted above, in the CGI
SAPI for a particular page on my site?
 
Somebody, please help.
--TC.


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



[PHP] Problem with php.ini

2005-08-16 Thread Tim Boring
I'm having a problem with php-cli and php_mod reading my php.ini file.
I've compiled php from source, during which process I set
--with-config-file=/etc.  Once the compile completed, I then copied
php.ini-recommened to /etc/php.ini.

After restarting Apache, I run phpinfo() and Configuration File Path
is showing only /etc, which means it's not find /etc/php.ini.  So then
I tried the cli and ran phpinfo() from it and same thing.  If I run it
as php -c /etc/php.ini, it can find/read it.  

For what it's worth, this is happening on a Gentoo system, but this
shouldn't make too much of a difference since I've compiled PHP from
source (v5.0.4), the same source I've used on a couple of other
(non-Gentoo) machines.

Just in case, here's the configure command I used:
'./configure' '--with-apxs2=/usr/sbin/apxs2' '--disable-cgi'
'--with-config-file-path=/etc' '--with-openssl' '--with-zlib'
'-enable-bcmath' '--with-bz2' '--enable-calendar' '--enable-dba'
'--with-db4' '--with-inifile' '--with-flatfile' '--enable-dio'
'--enable-ftp' '--enable-gmp' '--with-unixODBC' '--with-pgsql'
'--with-readline' '--enable-soap' '--enable-sockets' '--enable-wddx'
'--with-xsl' '--with-pear'

Any ideas?

Thanks,
Tim

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



[PHP] counting nested array

2005-08-16 Thread Ing . Josué Aranda
Hi to everyone..

now i have a little problem counting an nested array. Im using it to
fill a Java TreeView... it looks like this:

[1] = Array
(
[1] = Array
(
[1] = Array
(
[1] = LECHE PREMIUM 1 LT
[2] = LECHE PREMIUM 1/2 GL
[3] = LECHE PREMIUM 1 GL
)

[2] = Array
(
[1] = LECHE LIGHT 1 LT
[2] = LECHE LIGHT 1/2 GL
[3] = LECHE FRESCA 1 GL LIGHT
)

[3] = Array
(
[1] = LECHE SEMI 1 LT FRESCA
[2] = LECHE DESLACTOSADA 21 DIAS 1 LT
[3] = LECHE SILUETTE 21 DIAS 1 LT
[4] = LECHE DESARROLLO 21 DIAS 1 LT
[5] = LECHE ENTERA 21 DIAS 1 LT
[6] = LECHE LIGHT 21 DIAS 1 LT
)

[5] = Array
(
[1] = LECHE FRESCA 1 GL SEMIDESCREMADA BELL
[2] = LECHE FRESCA 1/2 GL SEMIDESCREMADA BELL
)

[6] = Array
(
[1] = LECHE FRESCA 1 GL LIGHT BELL
[2] = LECHE FRESCA 1/2 GL LIGHT BELL
[3] = LECHE FRESCA 1 LT LIGHT BELL
)

[7] = Array
(
[1] = LECHE FRESCA 1 GL ENTERA BELL
[2] = LECHE FRESCA 1/2 GL ENTERA BELL
[3] = LECHE FRESCA 1LT ENTERA BELL
)

)


The number of the branches is not always the same.. (it depends on the
query).. when i use count($array, COUNT_RECURSIVE) for nested arrays..
it give to me the total including the nodes in the branches ( in this
case 28).. now here is the question, how i can get only the last nodes
in this case ... exist a easy way to do it?. or its necessary to make
a funcion with a bunch of foreach?.. any suggestions are welcome =o) 
thanks!
-- 


JOSUE ARANDA

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



RE: [PHP] How to suppress HTTP headers?

2005-08-16 Thread Thomas Capote
I knew my description was a bit mangled; I was trying to keep it short.
Sorry. Take two:

A remote server is sending event records to my server using HTTP POST
requests to http://my.server.com/storeit.php, let's say. The remote server
expects acknowledgement by way of a response to its request. My script
(storeit.php) must respond like it would any other page request over HTTP;
it simply uses echo/print to produce a response.

This would work fine EXCEPT that the remote server is *badly* written. Its
flaw? The HTTP headers included in my response trip it up. For some reason,
it expects just the *contents* of the response, without headers.

Here's a mock up of the current situation:

  ---Received from remote server
  HTTP/1.0 storeit.php POST
  Content-Type: text/xml
  Content-Length: 35
  Host: 11.11.11.11

  DATA
KEYvalue/KEY
  /DATA

  --- Reply sent to remote server 
  HTTP/1.0 200 OK
  Content-Type: text/xml
  Content-Length: 34
  Host: 22.22.22.22

  ACK
ERROR0/ERROR
  /ACK


What the reply needs to look like is:

  --- Reply sent to remote server 
  ACK
ERROR0/ERROR
  /ACK


No headers.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 16, 2005 11:00 AM
To: php-general@lists.php.net
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] How to suppress HTTP headers?

So their page POSTs to a PHP page that you've created?  I'm not seeing where
headers come into play there, they're on output, not input.  Maybe I just
stayed up too late last night, but I'm having trouble wrapping my brain
around the problem.

One thing I did notice was you mentioned switches for CGI vs CLI SAPI.  I
expect that there wouldn't be a switch for CLI because no headers are needed
when using PHP command line, therefore nothing to turn off.  Again, maybe
I'm misunderstanding the situation but thought I'd throw that thought in the
ring.

Maybe you can describe the interaction between the system you can't control
and your PHP scripts better.  Walk us through it step by step.

-TG

= = = Original message = = =

I am coding a PHP page to deal with a badly implemented automated status
update script on a remote server (that I do not control) which fails if my
response to it's POST request has HTTP headers. Go figure. So the question
is How do I NOT send HTTP headers in my response? or How can my script
suppress headers completely? Whatever the solution, it should affect only
this page/script.

In chapter 43, the PHP Manual states: Though the CGI SAPI provides a way to
suppress HTTP headers, there's no equivalent switch to enable them in the
CLI SAPI. How would one suppress HTTP headers, as noted above, in the CGI
SAPI for a particular page on my site?
 
Somebody, please help.
--TC.


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] counting nested array

2005-08-16 Thread Torgny Bjers
Ing. Josué Aranda wrote:

Hi to everyone..

now i have a little problem counting an nested array. Im using it to
fill a Java TreeView... it looks like this:

[snip]

The number of the branches is not always the same.. (it depends on the
query).. when i use count($array, COUNT_RECURSIVE) for nested arrays..
it give to me the total including the nodes in the branches ( in this
case 28).. now here is the question, how i can get only the last nodes
in this case ... exist a easy way to do it?. or its necessary to make
a funcion with a bunch of foreach?.. any suggestions are welcome =o) 
thanks!


Well, if you do a count of the root, you ought to get the amount of
numbers in there, and, with that number of the last item, access that
array, do a count() on that, get the last item, and so forth and so on,
you could write a small recursive function here to call itself with each
new child, getting the last item, down into the structure until X level.

Not sure if there's a PHP native function for doing this, though.
Perhaps someone else knows. If nothing else, try this way.

Regards,
Torgny

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



Re: [PHP] Advice sought on PHP site maintenance

2005-08-16 Thread John Nichel

George Pitcher wrote:

John,

Thanks for the input. I just knew I hadn't covered everything. My server is
currently set up as NT4/IIS. I suppose I could look to switching to Apache
though.

Cheers

George

snip

I really don't know the Windows world, but there _may_ be a way to set 
up include paths globally/locally.  Sorry I can't be of more help.


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Problem with php.ini

2005-08-16 Thread John Nichel

Tim Boring wrote:

I'm having a problem with php-cli and php_mod reading my php.ini file.
I've compiled php from source, during which process I set
--with-config-file=/etc.  Once the compile completed, I then copied
php.ini-recommened to /etc/php.ini.

After restarting Apache, I run phpinfo() and Configuration File Path
is showing only /etc, which means it's not find /etc/php.ini.  So then
I tried the cli and ran phpinfo() from it and same thing.  If I run it
as php -c /etc/php.ini, it can find/read it.  


For what it's worth, this is happening on a Gentoo system, but this
shouldn't make too much of a difference since I've compiled PHP from
source (v5.0.4), the same source I've used on a couple of other
(non-Gentoo) machines.

Just in case, here's the configure command I used:
'./configure' '--with-apxs2=/usr/sbin/apxs2' '--disable-cgi'
'--with-config-file-path=/etc' '--with-openssl' '--with-zlib'
'-enable-bcmath' '--with-bz2' '--enable-calendar' '--enable-dba'
'--with-db4' '--with-inifile' '--with-flatfile' '--enable-dio'
'--enable-ftp' '--enable-gmp' '--with-unixODBC' '--with-pgsql'
'--with-readline' '--enable-soap' '--enable-sockets' '--enable-wddx'
'--with-xsl' '--with-pear'

Any ideas?


Permissions?

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] counting nested array

2005-08-16 Thread Robin Vickery
On 8/16/05, Ing. Josué Aranda [EMAIL PROTECTED] wrote:

 The number of the branches is not always the same.. (it depends on the
 query).. when i use count($array, COUNT_RECURSIVE) for nested arrays..
 it give to me the total including the nodes in the branches ( in this
 case 28).. now here is the question, how i can get only the last nodes
 in this case ... exist a easy way to do it?. or its necessary to make
 a funcion with a bunch of foreach?.. any suggestions are welcome =o)
 thanks!

If I understand you correctly, you only want the leaves of your tree -
in your example, that would be 20?

I don't think there's a convenient builtin function that'll do it, but
it's not hard to write your own:

?php

function leaf_count($item) {
  $count = 0;

  if (!is_array($item)) { return 1; }

  foreach ($item as $element) {
$count += leaf_count($element);
  }

  return $count;
}

print leaf_count($array);

?

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



RE: [PHP] php 5.04 register_globals aint acting right.

2005-08-16 Thread Daniel Baughman

Its simply a Boolean to indicate whether or not a query should be ran and
displayed, and further more its for a small intranet.

Register_globals is the directive I meant to say. But your right about
globals.  Some applications haven't made that change yet... So unless I want
to rewrite them (which is time consuming if you didn't originally write the
thing) I need to enable it.

I have the directive in my php.ini, which is defaulted to the %systemdir% in
windows...  But it certainly isn't registering them... I can easily write an
include and stick in to mimic the behaviour.. but was wondering if anyone
else ran into these issues.

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 16, 2005 7:27 AM
To: Daniel Baughman
Cc: php-general@lists.php.net
Subject: Re: [PHP] php 5.04 register_globals aint acting right.


Daniel Baughman wrote:
 
 
  
  
  
  
  
  
  
  
  I have register globals enabled, or set to On.  Isn't this suppose to
 take all of the $_POST variables and $_GET variables and make initialize
 them by name?

register_globals should do that. but not register globals,
regardless is a shitty setting. don't use it. besides its depreciated
just use $_POST['whatever']

 
 i.e. $_POST['runquery'] will be accessible via simply $runquery

looks like you are stuffing SQL into a GET/POST param - sure you want to do
that?



 
 ??
 
  
 Dan Baughman
 IT Technician
 Professional Bull Riders, Inc.
 719-471-3008 x 3161
 
 CONFIDENTIAL, FOR DESIGNATED RECIPIENTS ONLY:  The preceding e-mail
message
 (including any attachments) contains information that may be confidential,
 privileged, or non-public information. It is intended to be conveyed only
to
 the designated recipient(s) named above. If you are not an intended
 recipient, please notify the sender by replying to this message and then
 delete all copies of it from your computer system. Any use, dissemination,
 distribution, or reproduction of this message by unintended recipients is
 not authorized and may be unlawful.  DISCLAIMER OF ELECTRONIC TRANSACTION:

 This communication does not reflect an intention by the sender to conduct
a
 transaction or make any agreement by electronic means.  Nothing contained
 herein shall constitute an electronic signature or a contract under any
law,
 rule or regulation applicable to electronic transactions.
 
 
 

-- 
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] Problem with php.ini

2005-08-16 Thread Torgny Bjers
Tim Boring wrote:

I'm having a problem with php-cli and php_mod reading my php.ini file.
I've compiled php from source, during which process I set
--with-config-file=/etc.  Once the compile completed, I then copied
php.ini-recommened to /etc/php.ini.

After restarting Apache, I run phpinfo() and Configuration File Path
is showing only /etc, which means it's not find /etc/php.ini.  So then
I tried the cli and ran phpinfo() from it and same thing.  If I run it
as php -c /etc/php.ini, it can find/read it.  

For what it's worth, this is happening on a Gentoo system, but this
shouldn't make too much of a difference since I've compiled PHP from
source (v5.0.4), the same source I've used on a couple of other
(non-Gentoo) machines.

Just in case, here's the configure command I used:
'./configure' '--with-apxs2=/usr/sbin/apxs2' '--disable-cgi'
'--with-config-file-path=/etc' '--with-openssl' '--with-zlib'
'-enable-bcmath' '--with-bz2' '--enable-calendar' '--enable-dba'
'--with-db4' '--with-inifile' '--with-flatfile' '--enable-dio'
'--enable-ftp' '--enable-gmp' '--with-unixODBC' '--with-pgsql'
'--with-readline' '--enable-soap' '--enable-sockets' '--enable-wddx'
'--with-xsl' '--with-pear'

Any ideas?
  


I think that --with-config-file-path is an absolute path to the php.ini
file, and not just a directory name, although, it ought to default to
php.ini, but perhaps when setting that directive it assumes that you are
specifying a custom configuration file, for instance /etc/php5_alt.ini
or /etc/my_php.ini instead of just php.ini. So, I think you should use
the --sysconfdir directive instead if you just want to specify where PHP
has its ini file.

Regards,
Torgny

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



Re: [PHP] [SOLVED]Problem with php.ini

2005-08-16 Thread Tim Boring
On Tue, 2005-08-16 at 17:59 +0200, Torgny Bjers wrote:
 Tim Boring wrote:
 
 I'm having a problem with php-cli and php_mod reading my php.ini file.
 I've compiled php from source, during which process I set
 --with-config-file=/etc.  Once the compile completed, I then copied
 php.ini-recommened to /etc/php.ini.
 
 After restarting Apache, I run phpinfo() and Configuration File Path
 is showing only /etc, which means it's not find /etc/php.ini.  So then
 I tried the cli and ran phpinfo() from it and same thing.  If I run it
 as php -c /etc/php.ini, it can find/read it.  
 
 For what it's worth, this is happening on a Gentoo system, but this
 shouldn't make too much of a difference since I've compiled PHP from
 source (v5.0.4), the same source I've used on a couple of other
 (non-Gentoo) machines.
 
 Just in case, here's the configure command I used:
 './configure' '--with-apxs2=/usr/sbin/apxs2' '--disable-cgi'
 '--with-config-file-path=/etc' '--with-openssl' '--with-zlib'
 '-enable-bcmath' '--with-bz2' '--enable-calendar' '--enable-dba'
 '--with-db4' '--with-inifile' '--with-flatfile' '--enable-dio'
 '--enable-ftp' '--enable-gmp' '--with-unixODBC' '--with-pgsql'
 '--with-readline' '--enable-soap' '--enable-sockets' '--enable-wddx'
 '--with-xsl' '--with-pear'
 
 Any ideas?
   
 
 
 I think that --with-config-file-path is an absolute path to the php.ini
 file, and not just a directory name, although, it ought to default to
 php.ini, but perhaps when setting that directive it assumes that you are
 specifying a custom configuration file, for instance /etc/php5_alt.ini
 or /etc/my_php.ini instead of just php.ini. So, I think you should use
 the --sysconfdir directive instead if you just want to specify where PHP
 has its ini file.
 
 Regards,
 Torgny
 

Okay, I resolved it by running make clean in the source directory and
then re-running configure/make/make install.  I think what happened was
the first time I compiled it I didn't use the --with-config-file-path
option, then went back and re-compiled with setting
--with-config-file-path=/etc but without running make clean first.  

Thanks,
Tim

-- 
Tim Boring
IT Manager
Automotive Distributors Warehouse
2981 Morse Road
Columbus, OH 43231
Toll Free: 800-421-5556, x3007
Direct: 614-532-4240
E-mail: [EMAIL PROTECTED]

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



RE: [PHP] How to suppress HTTP headers?

2005-08-16 Thread tg-php
BTW: I made a mistake last time. Apparently with CLI there are headers.  You 
can use php -q to suppress headers when using PHP via CLI.  Odd.  Not sure I 
had to do that when I wrote a few CLI scripts before.  Oh well, something to 
play with another day (don't have time to check it right now).

So another thing I may be wrong on.. but a thought..  If you use the header() 
command, does it prevent the web server from generating it's own headers?

That is, if you send out htmlbodySomething/body/html does the web 
server automatically generate the headers but if you use header() it uses what 
PHP generates rather than it's own?

If so.. can you just do:
header();

With nothing in it to suppress headers?

Or can you do something like:

header(xmlstuff/xml);

?

Just thinking out loud since nobody else has responded yet :)

-TG

= = = Original message = = =

I knew my description was a bit mangled; I was trying to keep it short.
Sorry. Take two:

A remote server is sending event records to my server using HTTP POST
requests to http://my.server.com/storeit.php, let's say. The remote server
expects acknowledgement by way of a response to its request. My script
(storeit.php) must respond like it would any other page request over HTTP;
it simply uses echo/print to produce a response.

This would work fine EXCEPT that the remote server is *badly* written. Its
flaw? The HTTP headers included in my response trip it up. For some reason,
it expects just the *contents* of the response, without headers.

Here's a mock up of the current situation:

  ---Received from remote server
  HTTP/1.0 storeit.php POST
  Content-Type: text/xml
  Content-Length: 35
  Host: 11.11.11.11

  DATA
KEYvalue/KEY
  /DATA

  --- Reply sent to remote server 
  HTTP/1.0 200 OK
  Content-Type: text/xml
  Content-Length: 34
  Host: 22.22.22.22

  ACK
ERROR0/ERROR
  /ACK


What the reply needs to look like is:

  --- Reply sent to remote server 
  ACK
ERROR0/ERROR
  /ACK


No headers.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 16, 2005 11:00 AM
To: php-general@lists.php.net
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] How to suppress HTTP headers?

So their page POSTs to a PHP page that you've created?  I'm not seeing where
headers come into play there, they're on output, not input.  Maybe I just
stayed up too late last night, but I'm having trouble wrapping my brain
around the problem.

One thing I did notice was you mentioned switches for CGI vs CLI SAPI.  I
expect that there wouldn't be a switch for CLI because no headers are needed
when using PHP command line, therefore nothing to turn off.  Again, maybe
I'm misunderstanding the situation but thought I'd throw that thought in the
ring.

Maybe you can describe the interaction between the system you can't control
and your PHP scripts better.  Walk us through it step by step.

-TG

= = = Original message = = =

I am coding a PHP page to deal with a badly implemented automated status
update script on a remote server (that I do not control) which fails if my
response to it's POST request has HTTP headers. Go figure. So the question
is How do I NOT send HTTP headers in my response? or How can my script
suppress headers completely? Whatever the solution, it should affect only
this page/script.

In chapter 43, the PHP Manual states: Though the CGI SAPI provides a way to
suppress HTTP headers, there's no equivalent switch to enable them in the
CLI SAPI. How would one suppress HTTP headers, as noted above, in the CGI
SAPI for a particular page on my site?
 
Somebody, please help.
--TC.


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



[PHP] edit $variable online?

2005-08-16 Thread Jesús Alain Rodríguez Santos
Hi, I have in a php page one ($variable = 85), I woud like to change the
value from this variable online, without any data base, for example ussing
a form where I can put the new value and it change the value of the
$variable.


-- 
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.


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



Re: [PHP] How to suppress HTTP headers?

2005-08-16 Thread Kristen G. Thorson

Or use sockets...

http://us3.php.net/manual/en/function.fsockopen.php

Just don't send any HTTP headers.


kgt


[EMAIL PROTECTED] wrote:


BTW: I made a mistake last time. Apparently with CLI there are headers.  You can use 
php -q to suppress headers when using PHP via CLI.  Odd.  Not sure I had to 
do that when I wrote a few CLI scripts before.  Oh well, something to play with another 
day (don't have time to check it right now).

So another thing I may be wrong on.. but a thought..  If you use the header() 
command, does it prevent the web server from generating it's own headers?

That is, if you send out htmlbodySomething/body/html does the web 
server automatically generate the headers but if you use header() it uses what PHP generates rather than it's 
own?

If so.. can you just do:
header();

With nothing in it to suppress headers?

Or can you do something like:

header(xmlstuff/xml);

?

Just thinking out loud since nobody else has responded yet :)

-TG

= = = Original message = = =

I knew my description was a bit mangled; I was trying to keep it short.
Sorry. Take two:

A remote server is sending event records to my server using HTTP POST
requests to http://my.server.com/storeit.php, let's say. The remote server
expects acknowledgement by way of a response to its request. My script
(storeit.php) must respond like it would any other page request over HTTP;
it simply uses echo/print to produce a response.

This would work fine EXCEPT that the remote server is *badly* written. Its
flaw? The HTTP headers included in my response trip it up. For some reason,
it expects just the *contents* of the response, without headers.

Here's a mock up of the current situation:

 ---Received from remote server
 HTTP/1.0 storeit.php POST
 Content-Type: text/xml
 Content-Length: 35
 Host: 11.11.11.11

 DATA
   KEYvalue/KEY
 /DATA

 --- Reply sent to remote server 
 HTTP/1.0 200 OK

 Content-Type: text/xml
 Content-Length: 34
 Host: 22.22.22.22

 ACK
   ERROR0/ERROR
 /ACK


What the reply needs to look like is:

 --- Reply sent to remote server 
 ACK

   ERROR0/ERROR
 /ACK


No headers.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 16, 2005 11:00 AM

To: php-general@lists.php.net
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] How to suppress HTTP headers?

So their page POSTs to a PHP page that you've created?  I'm not seeing where
headers come into play there, they're on output, not input.  Maybe I just
stayed up too late last night, but I'm having trouble wrapping my brain
around the problem.

One thing I did notice was you mentioned switches for CGI vs CLI SAPI.  I
expect that there wouldn't be a switch for CLI because no headers are needed
when using PHP command line, therefore nothing to turn off.  Again, maybe
I'm misunderstanding the situation but thought I'd throw that thought in the
ring.

Maybe you can describe the interaction between the system you can't control
and your PHP scripts better.  Walk us through it step by step.

-TG

= = = Original message = = =

I am coding a PHP page to deal with a badly implemented automated status
update script on a remote server (that I do not control) which fails if my
response to it's POST request has HTTP headers. Go figure. So the question
is How do I NOT send HTTP headers in my response? or How can my script
suppress headers completely? Whatever the solution, it should affect only
this page/script.

In chapter 43, the PHP Manual states: Though the CGI SAPI provides a way to
suppress HTTP headers, there's no equivalent switch to enable them in the
CLI SAPI. How would one suppress HTTP headers, as noted above, in the CGI
SAPI for a particular page on my site?

Somebody, please help.
--TC.


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

 



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



Re: [PHP] Upgrading PHP 4.2.3 to PHP 4.3.2

2005-08-16 Thread Evert | Rooftop

Burhan Khalid wrote:


Tim Burgan wrote:


Can I extend this..

On a live server I have PHP 4.1. If I upgrade to PHP 5, is something 
likely to stop working?



99% yes. Especially if you really mean 4.1.0 -- that's quite old.


I'd say 90% no :)

Evert

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



Re: [PHP] Upgrading PHP 4.2.3 to PHP 4.3.2

2005-08-16 Thread Evert | Rooftop

T.N.Prasad wrote:


HI All,

Our company servers are being upgraded from 4.2.3 to 4.3.2.

Is there any special care that I should take (as far as my scripts are
concerned)?

Plz help me. I'm new to PHP.


Thanks
TNP
Professional Services
ZUSTEK INDIA 




 


Just wondering,

Why arent you upgrading to PHP 4.4 or PHP 5.0.4? Right now you are 
upgrading from a very old version to an old verion.


Evert

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



Re: [PHP] How to suppress HTTP headers?

2005-08-16 Thread tg-php
hah.. I should have mentioned this as well, but my brain is absorbed in...  
sockets... and xml..  and sending headers manually via fputs..   nothing 
relative to this discussion at all..  hah..

?php

$_XML_DATA = xmlGoesHere/xmlGoesHere\r\n;

$_FULL_XML_REQUEST  = ?xml version=\1.0\ encoding=\UTF-8\?\r\n;
$_FULL_XML_REQUEST .= !DOCTYPE REQUEST_GROUP SYSTEM \SomeXMLdtd.dtd\\r\n;
$_FULL_XML_REQUEST .= $_XML_DATA;
  
$_XML_REQUEST_HEADER  = POST /path/to/script.php HTTP/1.1\r\n;
$_XML_REQUEST_HEADER .= Host: my.server.com\r\n;
$_XML_REQUEST_HEADER .= Content-type: application/x-www-form-urlencoded\r\n;
$_XML_REQUEST_HEADER .= Content-length:  . strlen($_FULL_XML_REQUEST) . 
\r\n;
$_XML_REQUEST_HEADER .= Connection: close\r\n\r\n;

$fp = fsockopen(my.server.com, 80, $_FSOCK_ERR_NUMBER, $_FSOCK_ERR_MESSAGE, 
100);
  ~
if(!$fp){
  exit(Failed to open socket...);
}

if (fputs($fp, $_XML_REQUEST_HEADER . $_FULL_XML_REQUEST) === FALSE) {
  exit(Failed to send request...);
}

while(!feof($fp)){
  ~  
  // @ error suppression used on fgets() due to bug in PHP that reports the 
following waring:
  // Warning: fgets(): SSL: fatal protocol error in 
/var/www/secure/dev2/panda/DevTools/LandsafeTest/index.php on line 
  // No good solution found online, most people adjust their error reporting to 
ignore warnings (sloppy!)
  $tmp = @fgets($fp, 4096);
  
  $_XML_RESPONSE .= $tmp;
}
echo pre\n;
echo $_XML_RESPONSE;
  
fclose($fp);
?


= = = Original message = = =

Or use sockets...

http://us3.php.net/manual/en/function.fsockopen.php

Just don't send any HTTP headers.


kgt


[EMAIL PROTECTED] wrote:

BTW: I made a mistake last time. Apparently with CLI there are headers.  You 
can use php -q to suppress headers when using PHP via CLI.  Odd.  Not sure I 
had to do that when I wrote a few CLI scripts before.  Oh well, something to 
play with another day (don't have time to check it right now).

So another thing I may be wrong on.. but a thought..  If you use the header() 
command, does it prevent the web server from generating it's own headers?

That is, if you send out htmlbodySomething/body/html does the web 
server automatically generate the headers but if you use header() it uses what 
PHP generates rather than it's own?

If so.. can you just do:
header();

With nothing in it to suppress headers?

Or can you do something like:

header(xmlstuff/xml);

?

Just thinking out loud since nobody else has responded yet :)

-TG

= = = Original message = = =

I knew my description was a bit mangled; I was trying to keep it short.
Sorry. Take two:

A remote server is sending event records to my server using HTTP POST
requests to http://my.server.com/storeit.php, let's say. The remote server
expects acknowledgement by way of a response to its request. My script
(storeit.php) must respond like it would any other page request over HTTP;
it simply uses echo/print to produce a response.

This would work fine EXCEPT that the remote server is *badly* written. Its
flaw? The HTTP headers included in my response trip it up. For some reason,
it expects just the *contents* of the response, without headers.

Here's a mock up of the current situation:

  ---Received from remote server
  HTTP/1.0 storeit.php POST
  Content-Type: text/xml
  Content-Length: 35
  Host: 11.11.11.11

  DATA
KEYvalue/KEY
  /DATA

  --- Reply sent to remote server 
  HTTP/1.0 200 OK
  Content-Type: text/xml
  Content-Length: 34
  Host: 22.22.22.22

  ACK
ERROR0/ERROR
  /ACK


What the reply needs to look like is:

  --- Reply sent to remote server 
  ACK
ERROR0/ERROR
  /ACK


No headers.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 16, 2005 11:00 AM
To: php-general@lists.php.net
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] How to suppress HTTP headers?

So their page POSTs to a PHP page that you've created?  I'm not seeing where
headers come into play there, they're on output, not input.  Maybe I just
stayed up too late last night, but I'm having trouble wrapping my brain
around the problem.

One thing I did notice was you mentioned switches for CGI vs CLI SAPI.  I
expect that there wouldn't be a switch for CLI because no headers are needed
when using PHP command line, therefore nothing to turn off.  Again, maybe
I'm misunderstanding the situation but thought I'd throw that thought in the
ring.

Maybe you can describe the interaction between the system you can't control
and your PHP scripts better.  Walk us through it step by step.

-TG

= = = Original message = = =

I am coding a PHP page to deal with a badly implemented automated status
update script on a remote server (that I do not control) which fails if my
response to it's POST request has HTTP headers. Go figure. So the question
is How do I NOT send HTTP headers in my response? or How can my script
suppress headers completely? Whatever the solution, it should affect only
this page/script.

In chapter 43, the PHP Manual states: Though the 

[PHP] Form Processor?

2005-08-16 Thread aaronjw
Hey all,

Does anyone have any recomendations for a GOOD PHP Form Processor software?

Kind of in a bind and don't want to reinvent the wheel if I don't have to.

Sorry for thr O/T.

TIA!

A

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



Re: [PHP] Form Processor?

2005-08-16 Thread Chris Shiflett

[EMAIL PROTECTED] wrote:

Does anyone have any recomendations for a GOOD PHP Form Processor software?

Kind of in a bind and don't want to reinvent the wheel if I don't have to.

Sorry for thr O/T.


This doesn't seem off-topic to me. You might want to look at HTML_Quickform:

http://pear.php.net/package/HTML_QuickForm

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

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



[PHP] Re: Form Processor?

2005-08-16 Thread Matthew Weier O'Phinney
* [EMAIL PROTECTED] [EMAIL PROTECTED]:
 Does anyone have any recomendations for a GOOD PHP Form Processor software?

 Kind of in a bind and don't want to reinvent the wheel if I don't have to.

 Sorry for thr O/T.

Not OT at all. Many people like PEAR's HTML_QuickForm. I didn't like it
much -- I didn't like the way it interacted with template systems.

shamelessSelfPromotion
I've been doing work on Paul Jones' Solar project, particularly in the
Solar_Filter, Solar_Valid, and Solar_Form packages, which offer some
nice, generic, and extensible ways to validate and filter forms.
Documentation is still pending, but much of the usage is documented in
the class files themselves.

http://solarphp.com/
/shamelessSelfPromotion

patForms also looks good, and is a stable, robust product --
http://www.php-tools.net/site.php?file=/patForms/overview.xml

-- 
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

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



[PHP] Re: Form Processor?

2005-08-16 Thread Aaron Greenspan

Hi,

Another shameless plug...

Lampshade makes form processing really easy. You define a $form array in 
your PHP file, you lay out the form in your form file, and go. It 
error-checks and submits for you. Non-commercial use is free, and 
there's an example application in the starter kit so you can see how it 
works.


http://www.thinkcomputer.com/software/lampshade

Or more specifically for forms...

http://www.thinkcomputer.com/software/lampshade/documentation.html?function=form

Aaron

Aaron Greenspan
President  CEO
Think Computer Corporation

http://www.thinkcomputer.com

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



[PHP] formatting problems:

2005-08-16 Thread Ryan A
 Hi,

My database has a table called movies which has data like this:

flick_name ,flick_cover, part_url

flick_name is the name of the movie, the movie is cut into several pieces
for faster downloads
part_url is the full path to each of the pieces

eg:
home movie 1 ,a.gif, http://movieserver.com/scene1_1.wmv
home movie 1 ,a.gif, http://movieserver.com/scene1_2.wmv
home movie 1 ,a.gif, http://movieserver.com/scene1_3.wmv
home movie 1 ,a.gif, http://movieserver.com/scene2_1.wmv
home movie 1 ,a.gif, http://movieserver.com/scene2_2.wmv
home movie 1 ,a.gif, http://movieserver.com/scene2_3.wmv
etc

I am trying to get it into this format:
http://www.ezee.se/format.jpg

The main problem I am having is that I cannot seem to get the part files to
properly repeat inside the
table
one idea I came up with is to have a nested table for the part filesbut
even that is not working...I am getting
all screwed up tables...

Below is the exact code I have screwed around with, its a bit different coz
i tried to simplify my problem when
writing to the list...dont know if it helps but have a look at my code if
you need to...

Thanks in advance,
Ryan



?php
$hostt=localhost;
$userr=;
$passs=;
$db=movies;

$connected=mysql_connect($hostt, $userr, $passs) or die ('I cannot
connect to the database because: ' . mysql_error());
mysql_select_db ($db);

$q=mysql_query(select * from csv_28814);
$num_rows = mysql_num_rows($q);


$flick_name2=;
$once=0;

for($i=0; $i  $num_rows; $i++)
 {
 $row = mysql_fetch_row($q);
 $flick_name  = $row[0];
 $part_url  = $row[1];
 $part_size  = $row[2];
 $time_length = $row[3];
 $part_format = $row[4];

if($flick_name != $flick_name2)
{
echo table width='80%' bgcolor=gray border='0' cellspacing='0'
cellpadding='0'
  tr
td colspan='2'strongfont size='+1'Title/font/strong/td
td width='40%'nbsp;/td
  /tr
  tr
td width='22%' align='center' valign='middle'cover pic /td
td colspan='2' nowraptable width='100%'  border='0' cellspacing='0'
cellpadding='0'
  tr
td width='81%'strongScenes/strong/td
td width='10%'strongLength/strong/td
td width='9%'strongFormat/strong/td
  /tr
  tr
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
  /tr
/table/td
  /tr
/tablebr\n\n\n\n\n\n\n\n\n;
  }
 $flick_name2 = $flick_name;
 }



?

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



Re: [PHP] formatting problems:

2005-08-16 Thread Scott Noyes
It's not clear to me how strict you want to be regarding the
formatting.  Are you trying to keep scenes together on each line, or
just dump everything and let it wrap where it needs to?  Perhaps you
could handcode a sample and post a link.  I'd also guess that you
could make good use of CSS, specifically the float: left and
clear=all attributes.


 My database has a table called movies which has data like this:
 
 flick_name ,flick_cover, part_url
 
 flick_name is the name of the movie, the movie is cut into several pieces
 for faster downloads
 part_url is the full path to each of the pieces
 
 eg:
 home movie 1 ,a.gif, http://movieserver.com/scene1_1.wmv
 home movie 1 ,a.gif, http://movieserver.com/scene1_2.wmv
 home movie 1 ,a.gif, http://movieserver.com/scene1_3.wmv
 home movie 1 ,a.gif, http://movieserver.com/scene2_1.wmv
 home movie 1 ,a.gif, http://movieserver.com/scene2_2.wmv
 home movie 1 ,a.gif, http://movieserver.com/scene2_3.wmv
 etc
 
 I am trying to get it into this format:
 http://www.ezee.se/format.jpg

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



[PHP] PHP 5 limits readfile to 1.9 MB?

2005-08-16 Thread Jordan Miller

Hello all,

I am new to this list and I have searched the archives to no avail. I  
am having a peculiar problem when upgrading to PHP 5: My downloads  
are now limited to the first 1.9 MB of the file in question, with the  
download either terminating at 1.9 MB or seemingly continuously stuck  
in a downloading process at 1.9 MB. The code in the PHP script has  
not changed and all parameters that I could find that are relevant to  
this problem are given below:


the minimal code needed for download:
// $file_to_read is the complete path of the file to download
header(Content-Type: application/pdf);
header( Content-Disposition: inline; filename=\$filename\);
$len = filesize($file_to_read);
header(Content-Length: $len);
@readfile($file_to_read);

php.ini file for both php version 4 and 5 contain the following  
settings that may be relevant:


allow_url_fopen = On
max_execution_time = 300 ; Maximum execution time of each script,  
in seconds
max_input_time = 300; Maximum amount of time each script may  
spend parsing request data
memory_limit = 8M  ; Maximum amount of memory a script may  
consume (8MB)

post_max_size = 200M
upload_max_filesize = 200M


Some additional details:
All files less than 1.9 MB download fine
It is not a corrupted file, because all files larger than 1.9 MB fail  
after 1.9 MB

The connection is not timing out (download of 1.9 MB takes only ~15 sec)
Mac OS X 10.3.9 with Marc Liyanage's PHP 5.0.4
Fails for both Safari and Firefox
Fails regardless of inline or attachment
Fails regardless of pdf or ppt content-type
This PHP code ALWAYS works for Marc Liyanage's PHP 4.3.4 with the  
same settings, above



What am I doing wrong??? Any other parameter in php.ini I should have  
set? Any suggestions are much appreciated.


thanks,
Jordan

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



[PHP] access multiple databases

2005-08-16 Thread Bing Du

Hi,

I need to access both MySQL and SQL server 2000 in a PHP script on RHEL 
3.  In phpinfo(), I noticed 'supported databases' shows 'MySQL ODBC 
PostgreSQL Microsoft SQL Server FrontBase Oracle 8 (oci8)'.   And 
'Configure Command' has '--with-unixODBC=shared' included.  Do I need to 
 install anything else, like iodbc?


Would anybody give me some guidance how I should start from here?

Thanks,

Bing

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



[PHP] Anyone on the list using Moodle?

2005-08-16 Thread wayne
Hi,
Before I post some of the install script for
Moodle I thought that I would ask how
$CFG gets instantiated in the install.php script.
Thanks.

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



Re: [PHP] Anyone on the list using Moodle?

2005-08-16 Thread Esteamedpw
have you tried their forums at moodle.org ?
 
- Clint


Re: [PHP] formatting problems:

2005-08-16 Thread Ryan A

On 8/16/2005 9:59:30 PM, Scott Noyes ([EMAIL PROTECTED]) wrote:
 It's not clear to me how strict you want to be regarding the
 formatting.  Are you trying to keep scenes together on each line, or
 just dump everything and let it wrap where it needs to?  Perhaps you
 could handcode a sample and post a link.  I'd
 also guess that you
 could make good use of CSS, specifically the float: left and
 clear=all attributes.



Hey,
Thanks for replying.

basically I want this part to keep looping:

  tr
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
  /tr

(Below I am attaching the whole code again so you can see)

To see the format I am after click here:
www.ezee.se/format.htm

Thanks,
Ryan














?php
$hostt=localhost;
$userr=;
$passs=;
$db=movies;

$connected=mysql_connect($hostt, $userr, $passs) or die ('I cannot
connect to the database because: ' . mysql_error());
mysql_select_db ($db);

$q=mysql_query(select * from csv_28814);
$num_rows = mysql_num_rows($q);


$flick_name2=;
$once=0;

for($i=0; $i  $num_rows; $i++)
 {
 $row = mysql_fetch_row($q);
 $flick_name  = $row[0];
 $part_url  = $row[1];
 $part_size  = $row[2];
 $time_length = $row[3];
 $part_format = $row[4];

if($flick_name != $flick_name2)
{
echo table width='80%' bgcolor=gray border='0' cellspacing='0'
cellpadding='0'
  tr
td colspan='2'strongfont size='+1'Title/font/strong/td
td width='40%'nbsp;/td
  /tr
  tr
td width='22%' align='center' valign='middle'cover pic /td
td colspan='2' nowraptable width='100%'  border='0' cellspacing='0'
cellpadding='0'
  tr
td width='81%'strongScenes/strong/td
td width='10%'strongLength/strong/td
td width='9%'strongFormat/strong/td
  /tr
  tr
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
  /tr
/table/td
  /tr
/tablebr\n\n\n\n\n\n\n\n\n;
  }
 $flick_name2 = $flick_name;
 }



?

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



[PHP] Initiating cronjobs from PHP?

2005-08-16 Thread Cabbar Duzayak
Hi all,

I have a requirement for initiating tasks from my site that requires
long processing times, i.e. uploading/downloading some files to remote
nodes. And, to avoid timeouts and hence to be able to provide instant
responses to the user (user does not need to get the result right
away), I was thinking about handling this with cronjobs, i.e. when I
get this request, I will insert an entry into the crontab with exact
time information (which is like 2 minutes from current time) and
return the response to the user right away, and the task will be
invoked right away (again 2 minutes from that time) by the cron
daemon...

Do you think this is a viable approach? Can you guys recommend a
better way of handling this?

Thanks,

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



Re: [PHP] Initiating cronjobs from PHP?

2005-08-16 Thread Jasper Bryant-Greene

Cabbar Duzayak wrote:

Hi all,

I have a requirement for initiating tasks from my site that requires
long processing times, i.e. uploading/downloading some files to remote
nodes. And, to avoid timeouts and hence to be able to provide instant
responses to the user (user does not need to get the result right
away), I was thinking about handling this with cronjobs, i.e. when I
get this request, I will insert an entry into the crontab with exact
time information (which is like 2 minutes from current time) and
return the response to the user right away, and the task will be
invoked right away (again 2 minutes from that time) by the cron
daemon...

Do you think this is a viable approach? Can you guys recommend a
better way of handling this?


If it was me, I'd put the tasks that need running into a database table, 
and have a single cronjob that is always run every 5 minutes (or 
whatever is appropriate for your application) and which executes all 
jobs in the table and removes them when complete.


That way you don't need to dynamically alter your crontab.

Jasper

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



[PHP] RE: Problem using Metabase

2005-08-16 Thread Pablo Gosse
[snip]
I suspect that the problem is with file permissions. I recall that since

Metabase uses include to load class files, the script will not exit when

it fails to include a PHP class file. Assuming that is the case, make 
sure that all Metabase class files are readable by your Web server user.
[/snip]

The permissions seem fine.  However, I've discovered something else.

I was able to use Metabase without any trouble on a linux server to
access a Postgres database.  I then removed the call to
MetabaseSetDatabase and changed the drive to odbc-msaccess, and the
errors returned.  Changed it back to pgsql or mysql and the errors go
away.

I just now tried this on the IIS box and got the same results.  If I
specify postgres I get an error telling me that postgres is not enabled
in that php implementation, and if I specify mysql it works fine.  If I
change it back to odbc-msaccess, the errors are there.

So, the error message I get is only triggered when I specify Access as
the database.

Does this provide any further insight?

Cheers and TIA,

Pablo

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



Re: [PHP] counting nested array

2005-08-16 Thread Ing . Josué Aranda
OK this the little function i made to solve this..
[CODE]

function countNested($array){
foreach($array as $value){
if(is_array($value))
$total=$this-countNested($value)+$total;
}else{
$total=$total+1;
}
}
return $total;
}

[/CODE]

any optimizations are welcome



On 8/16/05, Robin Vickery [EMAIL PROTECTED] wrote:
 On 8/16/05, Ing. Josué Aranda [EMAIL PROTECTED] wrote:
 
  The number of the branches is not always the same.. (it depends on the
  query).. when i use count($array, COUNT_RECURSIVE) for nested arrays..
  it give to me the total including the nodes in the branches ( in this
  case 28).. now here is the question, how i can get only the last nodes
  in this case ... exist a easy way to do it?. or its necessary to make
  a funcion with a bunch of foreach?.. any suggestions are welcome =o)
  thanks!
 
 If I understand you correctly, you only want the leaves of your tree -
 in your example, that would be 20?
 
 I don't think there's a convenient builtin function that'll do it, but
 it's not hard to write your own:
 
 ?php
 
 function leaf_count($item) {
   $count = 0;
 
   if (!is_array($item)) { return 1; }
 
   foreach ($item as $element) {
 $count += leaf_count($element);
   }
 
   return $count;
 }
 
 print leaf_count($array);
 
 ?
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 


JOSUE ARANDA

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