Re: [PHP] php output to string
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
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... :-)
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
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: > > src="http://mysite.com/javascript_dump.php";> > > 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
Re: [PHP] Javascript Src and HTTP_REFERER
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
[PHP] Windows, DLLs and php.ini
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
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
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
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.. 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 "{$namez}\n"; } else { $namez = $value->names; echo "{$namez}"; display_menu($value->arrChildren); echo ''; } // end of else } // end of foreach loop } // end of function //echo ""; echo ""; 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
> -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
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
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
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
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). -> -> -> -> -> -> -> -> -> -> -> -> 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
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
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). > > > -> > -> > -> > -> > -> > -> > -> > -> > -> > -> > -> > -> > > 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.
I have register globals enabled, or set to On. Isnt 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
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.
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
""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). > > > > > > -> > > -> > > -> > > -> > > -> > > -> > > -> > > -> > > -> > > -> > > -> > > -> > > > > 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?
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
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). > > > > > > > > > -> > > > -> > > > -> > > > -> > > > -> > > > -> > > > -> > > > -> > > > -> > > > -> > > > -> > > > -> > > > > > > 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?
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
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
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?
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 value <--- Reply sent to remote server HTTP/1.0 200 OK Content-Type: text/xml Content-Length: 34 Host: 22.22.22.22 0 What the reply needs to look like is: <--- Reply sent to remote server 0 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
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
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 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
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
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 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.
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
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
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?
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 "Somethingstuff"); ? 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 value <--- Reply sent to remote server HTTP/1.0 200 OK Content-Type: text/xml Content-Length: 34 Host: 22.22.22.22 0 What the reply needs to look like is: <--- Reply sent to remote server 0 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?
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?
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 "Somethingstuff"); ? 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 value <--- Reply sent to remote server HTTP/1.0 200 OK Content-Type: text/xml Content-Length: 34 Host: 22.22.22.22 0 What the reply needs to look like is: <--- Reply sent to remote server 0 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
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
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?
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.. \r\n"; $_FULL_XML_REQUEST = "\r\n"; $_FULL_XML_REQUEST .= "\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 "\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 "Somethingserver 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("stuff"); > >? > >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 > > >value > > > <--- Reply sent to remote server > HTTP/1.0 200 OK > Content-Type: text/xml > Content-Length: 34 > Host: 22.22.22.22 > > >0 > > > >What the reply needs to look like is: > > <--- Reply sent to remote server > >0 > > > >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 equ
[PHP] Form Processor?
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?
[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?
* [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. 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/ 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?
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:
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 Title cover pic Scenes Length Format \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:
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?
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
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?
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?
have you tried their forums at moodle.org ? - Clint
Re: [PHP] formatting problems:
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: (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 Title cover pic Scenes Length Format \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?
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?
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
[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
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: > > > 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
RE: [PHP] Upgrading PHP 4.2.3 to PHP 4.3.2
Hi Torgny & All, Thanks for all the responses & suggestions. Thanks TNP Professional Services ZUSTEK INDIA -Original Message- From: Torgny Bjers [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 16, 2005 6:51 PM To: T.N.Prasad Cc: php-general@lists.php.net Subject: Re: [PHP] Upgrading PHP 4.2.3 to PHP 4.3.2 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php