Re: [PHP] grabbing variable from bottom to top
On Aug 3, 2003, Micah Montoy claimed that: |Anyone know of a way to use a variable that isn't defined until further down |the script at the top. I have a counter and once everything runs through |the script, the count is complete, I need to display this at the top above |the displayed results. I thought about and tried a function but I still run |into the same problem. | |thanks You could use some dHTML. At the top of the page, you would print something like p ID=CountingIDCalculating count./p Then, after the computing, SCRIPT LANGUAGE=JavaScript document.all(MyID1).innerText = 'Total Count: $count.'; /SCRIPT This code is probably very browser dependant, so YMMV. Jeff -- Registered Linux user #304026. lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this message should conform to RFC 1855. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FTP accounts
Hi everybody! can any body suggest me the good resources/snippet for creating and managing FTP accounts. My configuration includes: Redhat : 7.0 Php - 4.0.6 Apache web server Any help would be highly appreciated. Thanks in advance Binay
[PHP] Addin a column of numbers not using MySQL
How do I add a column of numbers generated through a MySQL query without using the SQL SUM() function? I have tried looking through the different documentation. I am probably missing something. Thanks, Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Addin a column of numbers not using MySQL
Do you mean something like: ? $i = 0; $sql = SELECT a,b,c FROM foo; $res = mysql_query($sql); while($myrow = mysql_fetch_array($res)) { $i++; echo $i.br /; echo $myrow['a'] .br /; echo $myrow['b'] .br /; echo $myrow['c'] .br /; } ? Justin On Monday, August 4, 2003, at 05:34 PM, Ben C. wrote: How do I add a column of numbers generated through a MySQL query without using the SQL SUM() function? I have tried looking through the different documentation. I am probably missing something. Thanks, Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- [This E-mail scanned for viruses] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to Ask Questions THe Smart Way...
Here is something some of you on this list may find funny, others may find this useful. This is not spam, this is actually a good manual you should all read: http://catb.org/~esr/faqs/smart-questions.html Good Reading. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Addin a column of numbers not using MySQL
Yes. From there I want to add all the 'a' values together using PHP. -Original Message- From: Justin French [mailto:[EMAIL PROTECTED] Sent: Monday, August 04, 2003 12:40 AM To: Ben C. Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Addin a column of numbers not using MySQL Do you mean something like: ? $i = 0; $sql = SELECT a,b,c FROM foo; $res = mysql_query($sql); while($myrow = mysql_fetch_array($res)) { $i++; echo $i.br /; echo $myrow['a'] .br /; echo $myrow['b'] .br /; echo $myrow['c'] .br /; } ? Justin On Monday, August 4, 2003, at 05:34 PM, Ben C. wrote: How do I add a column of numbers generated through a MySQL query without using the SQL SUM() function? I have tried looking through the different documentation. I am probably missing something. Thanks, Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- [This E-mail scanned for viruses] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Qmail + PHP
Hello, anyone here who created new user for Qmail with PHP? Haseeb IncrediMail - Email has finally evolved - Click Here
Re: [PHP] FTP accounts
On Monday 04 August 2003 03:29, Binay Agarwal wrote: can any body suggest me the good resources/snippet for creating and managing FTP accounts. My configuration includes: Redhat : 7.0 Php - 4.0.6 Apache web server How you create an FTP account all depends on what ftpserver you're running. Some may use the system accounts, others may have its own list of accounts, others still may use a dbms to store the account info. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Time is an illusion, lunchtime doubly so. -- The Hitchhiker's Guide to the Galaxy */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Qmail + PHP
On Tuesday 05 August 2003 04:07, Haseeb wrote: anyone here who created new user for Qmail with PHP? Yes. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Adapt. Enjoy. Survive. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Addin a column of numbers not using MySQL
On Monday 04 August 2003 15:59, Ben C. wrote: Yes. From there I want to add all the 'a' values together using PHP. So do it then. $total = $total + $myrow['a'] // or something as you go through the loop // is just one of the ways to do this -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* A beautiful woman is a picture which drives all beholders nobly mad. -- Emerson */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Relevant PHP market research
Hi, I've searched the net for various information on PHP usage in the enterprise. I've searched Forrester (http://www.forrester.com/search/1,6260,,00.html?squery=php), Gartner (http://www.gartner.com) and Google(http://www.google.com/search?q=market+research+php) with little results. I know some popularity report exists here (http://php.weblogs.com/popularity) and I also know that Zend has made this survey (http://www.zend.com/zend/php_survey_results.php) but they are both missing some essential figures on money, enterprise acceptance and so on. We would also think creating a survey of our own - but we know that only a company like Zend would be able to attract many other respondets from more various areas than we do. I would appreciate any figures on the web development market - because this is the market for most of us - and knowing the market could only be a good thing. I think we should consider this key figures: 1. How many PHP websites are developed per year in your company 1.1 What kind of applications bring the best profit (CMS/Intranet/ERP/CRM/Dynamic Website) 2. Turn-over per year from PHP websites/company 3. Turn-over per year from PHP websites/employee 4. Where is your company heading in terms of market strategy - offer low cost solutions, offer professional web development solutions, etc. 5. ASP/Java competition estimates (how many sites/application do they do, how much is the market share for them?) 6. Some real market information for total web development/country would also help to determine the PHP market share for all those information 7. Are PHP programmers spending money on software development tools or prebuilt libraries? 8. Why do companies reject PHP solutions and how what should we do to improve their feelings on this? We are also open on any suggestions on this research's goal - as probably there are other that know better how to do a market research. Would this kind of survey work? Are there any political problems that could prevent people filling it? We have a survey software and we would be glad to create a public survey with those information that could help all PHP developers convince their clients/bosses/partners that PHP is a viable enterprise choice. I hope that you are also willing to change the conception on PHP as the Personal/low end scripting language. I'm looking forward to your comments, Alexandru -- Alexandru COSTIN Chief Operating Officer http://www.interakt.ro/ +4021 312 5312 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Qmail + PHP
i want your help. but as this is OT can we talk some where else. MSN may be? Haseeb ---Original Message--- From: [EMAIL PROTECTED] Date: Monday, August 04, 2003 01:22:22 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Qmail + PHP On Tuesday 05 August 2003 04:07, Haseeb wrote: anyone here who created new user for Qmail with PHP? Yes. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Adapt. Enjoy. Survive. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php IncrediMail - Email has finally evolved - Click Here
Re: [PHP] Qmail + PHP
On Tuesday 05 August 2003 05:36, Haseeb wrote: i want your help. but as this is OT can we talk some where else. MSN may be? 1) how you add users depends on how you have installed and configured qmail 2) google for php qmail 3) check out omailadmin -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* If we can ever make red tape nutritional, we can feed the world. -- R. Schaeberle, Management Accounting */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Qmail + PHP
i have searched already. can u give me sometime?? Haseeb ---Original Message--- From: [EMAIL PROTECTED] Date: Monday, August 04, 2003 02:54:38 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Qmail + PHP On Tuesday 05 August 2003 05:36, Haseeb wrote: i want your help. but as this is OT can we talk some where else. MSN may be? 1) how you add users depends on how you have installed and configured qmail 2) google for php qmail 3) check out omailadmin -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* If we can ever make red tape nutritional, we can feed the world. -- R. Schaeberle, "Management Accounting" */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php IncrediMail - Email has finally evolved - Click Here
[PHP] Making i18n work on all Unix webservers ?
With the following code to translate messages in french, we need to put the mo files in a directory like ./local/xxx/LC_MESSAGE/messages.{mo,po} putenv(LANGUAGE=french); setlocale(LC_ALL, 'fr_BE'); bindtextdomain(messages, ./local); textdomain(messages); echo 'br' . _(Yes); On one linux webserver, xxx must be 'fr' (and LANGUAGE set). On another linux webserver, xxx must be 'french' (no var to set). How can I guess which xxx to use, for my code to work on any webserver ? Other solution than using 3 or more directories like 'fr', 'french', 'fr_BE', and copying it? In fact, I'd like to make it work on windows servers too... And how can I guess which env var to set (or not) and in which order (LC_ALL, LANG, LANGUAGE, ...) ? Is there a way to do it for the code to work nearly everywhere ? I'll use a class to hide that complexity. Can someone help ? The PHP documentation is far from beeing clear and precise enough in that particular field. --- Christophe Chisogne Developper, Publicityweb sprl http://www.publicityweb.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Globals
-Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED] Sent: 01 August 2003 20:18 I'm curious if someone could explain to me why this is occuring: function blah() { //global $GLOBALS; echo 'Globals: pre'; print_r( $GLOBALS ); echo '/pre'; } As it is shown above, with the 'global $GLOBALS' line commented out, the print_r() works and shows all the currently defined variables and their corresponding values. However, if I declare $GLOBALS as global, nothing gets printed out. Why? Well, I'm kinda guessing here, but it probably goes something like this: global $GLOBALS; is the equivalent of doing $GLOBALS = $GLOBALS['GLOBALS']; but this causes $GLOBALS to be a local variable within the function, so the sequence PHP executes probably goes like this: (1) set up $GLOBALS as a local variable of the function, masking out the true (super)global $GLOBALS. (2) look up the 'GLOBALS' element of this new local $GLOBALS -- this is NULL as no value has yet been assigned to the local $GLOBALS! (3) create a reference to the NULL obtained from this lookup, and assign that to the local $GLOBALS. So what you've ended up in the $GLOBALS which is local to the function is a reference to NULL, hence the behaviour you're seeing. Like I say, this is all guesswork -- albeit slightly educated guesswork, based on my scant and very ancient (over 20 years ago!) experience of writing bits for a couple of interpreted languages. Maybe a PHP internal person might come along and tell me how close I got...!! ;) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Pushing array onto array
-Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: 02 August 2003 23:07 * Thus wrote Andrew Brampton ([EMAIL PROTECTED]): Well I just coded up a very small example, and it pushing 1 array into the other... Check out: http://81.102.229.151/push.php and http://81.102.229.151/push.phps It works exactly how it should... However really the array isn't a 2 dimensional one, since PHP doesn't have them, its rather a array of arrays which is roughly the same thing (and something not to worry about)... A 2 demensional array is an array of arrays. No, it isn't. A true 2-dimensional array is completely orthogonal -- anything you can do row-wise you can automatically also do column-wise, without having to write any special functionality. An array of arrays, by its very nature, doesn't have columns as such, so if you want to work with, e.g. $arr[*][1] you have to have special functions to do so. There are other differences, but in a nutshell that's essentially it. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Pushing array onto array
-Original Message- From: Hank TT [mailto:[EMAIL PROTECTED] Sent: 03 August 2003 06:03 Well, I might have been more specific about their example, since not everyone has the book. An excerpt below (so I don't need to retype all the names of characters and foul creatures from the Lord of the Rings): --- $arr1 = array('G', 'R', 'Sr'); $arr2 = array('N', 'Su', 'O'); $arr3 = array_push($arr1, $arr2); print $arr3[3][1]; //prints Su --- Weird usage Well, it wouldn't be weird if it were correct, but it's not, it's wrong! Having executed this, the result should be: $arr3 == 4 $arr1 == array('G', 'R', 'Sr', array('N', 'Su', 'O')) so $arr3[3][1] doesn't even exist, since $arr3 is a simple scalar integer -- but on the other hand, $arr1[3][1] is indeed 'Su'. So it appears there's a typo -- theirs or yours? Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Web tools for FTP accounts management
Hi everybody! can any body suggest me the good resources/snippet for creating and managing FTP accounts through web interface using PHP. My configuration includes: Redhat : 7.0 wu-ftpd (FTP Server) Php - 4.0.6 Apache web server Any help would be highly appreciated. Thanks in advance Binay
Re: [PHP] Qmail + PHP
On Tuesday 05 August 2003 06:00, Haseeb wrote: 1) how you add users depends on how you have installed and configured qmail i have searched already. can u give me sometime?? 1) OK, *how* have you installed and configured qmail? 2) How do you add users right now? If you can't answer those two questions then no-one can help you. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Don't change the reason, just change the excuses! -- Joe Cointment */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Making i18n work on all Unix webservers ?
Hi, Monday, August 4, 2003, 8:25:18 PM, you wrote: CC With the following code to translate messages in french, CC we need to put the mo files in a directory like CC ./local/xxx/LC_MESSAGE/messages.{mo,po} CC putenv(LANGUAGE=french); CC setlocale(LC_ALL, 'fr_BE'); CC bindtextdomain(messages, ./local); CC textdomain(messages); CC echo 'br' . _(Yes); CC On one linux webserver, xxx must be 'fr' (and LANGUAGE set). CC On another linux webserver, xxx must be 'french' (no var to set). CC How can I guess which xxx to use, for my code to work on CC any webserver ? Other solution than using 3 or more directories CC like 'fr', 'french', 'fr_BE', and copying it? CC In fact, I'd like to make it work on windows servers too... CC And how can I guess which env var to set (or not) and in CC which order (LC_ALL, LANG, LANGUAGE, ...) ? Is there a way CC to do it for the code to work nearly everywhere ? CC I'll use a class to hide that complexity. CC Can someone help ? The PHP documentation is far from beeing CC clear and precise enough in that particular field. CC --- CC Christophe Chisogne CC Developper, Publicityweb sprl CC http://www.publicityweb.com Try using $dir_name = setlocale(LC_MESSAGES); After setup and that should return the string that gettext will use to locate its files. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Invalid Characters, XML...
On Sun, 3 Aug 2003 21:51:53 -0400 (EDT), you wrote: Im using PHP to write to XML files, but I am having some problems. A lot of users are cutting and pasting content from text editors like word, which uses odd quotation marks, dashes, etc. which PHP writes to the XML file, and then the XML parser does not under stand. Is there a stripslashes() or htmlspecialchars() equivalent that will convert this kind of stuff to the correct ascii text? This should get you started. It behaves as does htmlentities(). For those high-ASCII characters out of Word/IE... decide what regular ASCII character you want to map them to, (eg slanted-quote-open and -close to regular quote), and add them to the $trans array before performing the array_walk(). function xmlentities ($string, $quote_style = ENT_COMPAT) { static $trans; if (!is_array ($trans)) { $trans = get_html_translation_table (HTML_ENTITIES, $quote_style); array_walk ($trans, create_function ('$a, $b', '$a = # . ord ($b) . ;;')); } return (strtr ($string, $trans)); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Relevant PHP market research
[snip] I would appreciate any figures on the web development market - because this is the market for most of us - and knowing the market could only be a good thing. I think we should consider this key figures: [/snip] {IMHO} I understand why your focus would be on the web development market, but I also think that another segment of the market (intranet web app development) is a significant market segment. There are many companies out there who are using PHP to develop in-house apps (they are not web-dev firms) and it would be these stats that would help to raise the perception bar for PHP advocates. Then there are the folks who are developing apps for use in the corporate environment (such as phpMyAdmin). I have spoken with others who use PHP extensively to power their in-house applications for many business critical functions as we do. I think that it would be prudent to include this segment in any research about the viability of PHP in the corporate environment. (/IMHO) HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Making i18n work on all Unix webservers ?
Tom Rogers wrote: CC ./local/xxx/LC_MESSAGE/messages.{mo,po} CC setlocale(LC_ALL, 'fr_BE'); CC bindtextdomain(messages, ./local); CC textdomain(messages); CC How can I guess which xxx to use, for my code to work on CC any webserver ? Try using $dir_name = setlocale(LC_MESSAGES); After setup and that should return the string that gettext will use to locate its files. Thanks. But it looks like it's more complicated. setlocale(LC_MESSAGES,'0') returns fr_BE, but it seems PHP looks in ./local/fr, not in ./local/fr_BE when searching the catalog files, at least on one webserver. (using PHP 4.1.2, the other PHP 4.2.3). I guess there is some kind of search path to locate the catalog files, with some preference order. Too bad the i18n PHP thing isn't more predictable :-/ Of course, I restarted the webserver (apache reload) between tests, to avoid problems with the gettext cache. I think I'll simply copy ./locale/french to fr, fr_BE, fr_FR And something similar for dutch and german. But I thought there was some better and cleaner way to do it, in a more manageable way. -- Christophe Chisogne http://www.publicityweb.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Relevant PHP market research
Hi, [snip] I would appreciate any figures on the web development market - because this is the market for most of us - and knowing the market could only be a good thing. I think we should consider this key figures: [/snip] {IMHO} I understand why your focus would be on the web development market, but I also think that another segment of the market (intranet web app development) is a significant market segment. I welcome your suggestion. There are many companies out there who are using PHP to develop in-house apps (they are not web-dev firms) and it would be these stats that would help to raise the perception bar for PHP advocates. Then there are the folks who are developing apps for use in the corporate environment (such as phpMyAdmin). This is indeed a very powerful market - as most of the companies that we've directly questioned (companies that do either J2EE or Microsoft or embedded C) admitted they do PHP especially for Intranet - helpdesk or bugtracker applications, etc. I have spoken with others who use PHP extensively to power their in-house applications for many business critical functions as we do. I think that it would be prudent to include this segment in any research about the viability of PHP in the corporate environment. (/IMHO) We will surely include this in the research. The reason I've started this thread would be to identify what should be look for in our research - as probably we will not have an already made research at our disposal as our market is pretty new/small/weird for people that do research for money. So I am still looking forward for responses/ideas and after this I will probably create the survey and submit it for review to the interested people, following to make it public Alexandru -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Qmail + PHP
i have not installed qmail myself my linux admin compiled it. as for how i am managing new user registrations right now . using plesk control panel Haseeb ---Original Message--- From: [EMAIL PROTECTED] Date: Monday, August 04, 2003 04:12:01 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Qmail + PHP On Tuesday 05 August 2003 06:00, Haseeb wrote: 1) how you add users depends on how you have installed and configured qmail i have searched already. can u give me sometime?? 1) OK, *how* have you installed and configured qmail? 2) How do you add users right now? If you can't answer those two questions then no-one can help you. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Don't change the reason, just change the excuses! -- Joe Cointment */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php IncrediMail - Email has finally evolved - Click Here
[PHP] site error
Site www.Lancoalition.com On my site im receiving the following error: Warning: Unknown(): open_basedir restriction in effect. File(/home/lancoali/public_html/nuke/html/index.php) is not within the allowed path(s): (/home/*:/usr/lib/php:/usr/local/lib/php:/tmp:/usr/X11R6/bin) in Unknown on line 0 Warning: Unknown(/home/lancoali/public_html/nuke/html/index.php): failed to open stream: Operation not permitted in Unknown on line 0 Warning: (null)(): Failed opening '/home/lancoali/public_html/nuke/html/index.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0 Can anyone explain why im getting this error, i made no changed before i got this error. -- Nick [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Invalid Characters, XML...
Here's what I have been using. $trans= array(' = #39;, ' = #39;, = #62;, = #60;, = #38;,- = #45;, ° = #176;, ± = #177;, - = #150;, = #147;, = #148;,... = #8230;,' = #8216;,² =#178;,· = #183; ); $value=strtr($value,$trans); Luis -Original Message- From: David Otton [mailto:[EMAIL PROTECTED] Sent: Monday, August 04, 2003 7:18 AM To: Russell P Jones Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Invalid Characters, XML... On Sun, 3 Aug 2003 21:51:53 -0400 (EDT), you wrote: Im using PHP to write to XML files, but I am having some problems. A lot of users are cutting and pasting content from text editors like word, which uses odd quotation marks, dashes, etc. which PHP writes to the XML file, and then the XML parser does not under stand. Is there a stripslashes() or htmlspecialchars() equivalent that will convert this kind of stuff to the correct ascii text? This should get you started. It behaves as does htmlentities(). For those high-ASCII characters out of Word/IE... decide what regular ASCII character you want to map them to, (eg slanted-quote-open and -close to regular quote), and add them to the $trans array before performing the array_walk(). function xmlentities ($string, $quote_style = ENT_COMPAT) { static $trans; if (!is_array ($trans)) { $trans = get_html_translation_table (HTML_ENTITIES, $quote_style); array_walk ($trans, create_function ('$a, $b', '$a = # . ord ($b) . ;;')); } return (strtr ($string, $trans)); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 4 Aug 2003 13:32:14 -0000 Issue 2216
php-general Digest 4 Aug 2003 13:32:14 - Issue 2216 Topics (messages 158101 through 158147): Re: mail funciton 158101 by: Igor Konforti PHP / Oracle support (8/9) under Redhat 9 158102 by: Robert Mena 158107 by: Justin French Re: Forking PHP Processes on Unix (PHP4) 158103 by: Jason Sheets Re: logging of mail() function? 158104 by: Jason Sheets microtime alternative 158105 by: Micah Montoy 158110 by: Micah Montoy Invalid Characters, XML... 158106 by: Russell P Jones 158141 by: David Otton 158147 by: Luis Lebron mysql_real_escape_string 158108 by: Anthony Ritter 158109 by: Jason Sheets grabbing variable from bottom to top 158111 by: Micah Montoy 158112 by: Jason Sheets 158113 by: Justin French 158120 by: Jeff Harris cli file open problem 158114 by: Gareth Thomas splitting content into pages 158115 by: daniel.electroteque.org Clarification. UTF-8 Enccoding . 158116 by: Russell P Jones 158117 by: Hank TT 158118 by: Justin French 158119 by: Tom Rogers FTP accounts 158121 by: Binay Agarwal 158127 by: Jason Wong Addin a column of numbers not using MySQL 158122 by: Ben C. 158123 by: Justin French 158125 by: Ben C. 158129 by: Jason Wong How to Ask Questions THe Smart Way... 158124 by: Ralph Guzman Qmail + PHP 158126 by: Haseeb 158128 by: Jason Wong 158131 by: Haseeb 158132 by: Jason Wong 158133 by: Haseeb 158139 by: Jason Wong 158145 by: Haseeb Relevant PHP market research 158130 by: Alexandru COSTIN 158142 by: Jay Blanchard 158144 by: Alexandru COSTIN Making i18n work on all Unix webservers ? 158134 by: Christophe Chisogne 158140 by: Tom Rogers 158143 by: Christophe Chisogne Re: Globals 158135 by: Ford, Mike [LSS] Re: Pushing array onto array 158136 by: Ford, Mike [LSS] 158137 by: Ford, Mike [LSS] Web tools for FTP accounts management 158138 by: Binay Agarwal site error 158146 by: Nick 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: [EMAIL PROTECTED] -- ---BeginMessage--- I'm sorry,i was just checking if outgoing server is working :P -- Igor Konforti ---End Message--- ---BeginMessage--- Hi, I am planning to migrate my current web server from redhat 7.x to 9 and I am currently evaluating what may go wrong or need special attention before I actually replace it. After searching the archives and other lists I still have a couple of questions : a) apache It seems that apache + php does not work well under heavy load so I should stick with 1.3.X right ? Any ideas where I can find a rpm package for redhat 9 ? b) oracle support For the current setup I've downloaded and installed the oracle 8i (8.1.5) in a separate machine, tar.gz the lib directory in order to compile and run php with oracle 8i. Is this the best approach for Redhat 9 or should I try to install oracle 9 which hopefully may have a devel-only option ? Note that php needs to access external oracle 8 servers which I do not mantain. Regards. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com ---End Message--- ---BeginMessage--- On Monday, August 4, 2003, at 11:33 AM, Robert Mena wrote: a) apache It seems that apache + php does not work well under heavy load so I should stick with 1.3.X right ? Any ideas where I can find a rpm package for redhat 9 ? I can't help with the Oracle question, but yes, stick with apache 1.3.x for the moment... It would also pay to look at what version of PHP you're currently running (eg 4.1) and see what major changes you're likely to experience when upgrading to the latest stable version. If your existing version is pre 4.1, the register globals will be an issue, for example. Sorry, I have no idea what version of PHP was on RH 7 Justin ---End Message--- ---BeginMessage--- PHP can fork on Unix, just not from a web environment. So you need to execute the command from the command line or maybe an exec. Take a look at: http://www.php.net/manual/en/ref.pcntl.php Jason Damien G wrote: Hi Readers, Heres what i'm trying to achieve: A script, that uses multiple fsockopen()'s and simltaniously get feedback from each socket from fget()s. Now, since using a single fget() needs to be in a loop then it's not possible to have more than one loop going at the same time. I was thinking of using a break command, then getting feedback from the other loops, and breaking each of them
Re: [PHP] PHP / Oracle support (8/9) under Redhat 9
From: Robert Mena [EMAIL PROTECTED] a) apache It seems that apache + php does not work well under heavy load so I should stick with 1.3.X right ? Any ideas where I can find a rpm package for redhat 9 ? Yes, stick with apache-1.3.x Latest 1.3.x version RPM from Red Hat for RH 7.3 is apache-1.3.27-2.i386.rpm I'm using the latest RH 7.1 apache RPM in a RH 9 and runs ok, which is apache-1.3.27-1.7.1 Latest PHP version for RH 7.1 is php-4.1.2-7.1.6 For RH 9 it's php-4.2.2-17, I guess there should be no problem in running that version with the apache-1.3.x from RH 7.x Regards, Juan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] attach
Hi, Can you tell me how to attach files when using the php mail function? Thanks, Diaan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] attach
Check the phpclasses site, it has some very good examples also do a search on google.. you can find it at http://google.com :-D Cheers, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com - Original Message - From: Diana Castillo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 04, 2003 3:59 PM Subject: [PHP] attach Hi, Can you tell me how to attach files when using the php mail function? Thanks, Diaan -- 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] Re: attach
http://pear.php.net/package-info.php?package=Mail_Mime Regards, Greg -- phpDocumentor http://www.phpdoc.org Diana Castillo wrote: Hi, Can you tell me how to attach files when using the php mail function? Thanks, Diaan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_real_escape_string
The following function is from Larry Ullman's PHP and mySQL on page 217 - script 6.8 - in which there is a connection to a mySQL database using PHP. My question is that I'm not sure of the global variable $dbc. Hello Anthony, The mysql_real_escape_string() requires a connection to the database. The connection identifier is defined in another script so it's brought in using the global statement. Hope that helps, Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A better solution?
Hi, I have a table called the_slave where i am entering differient types of data and 5 specific types, to get a count of each of the types i used: $tt = SELECT ptype, count(*) FROM the_slave WHERE ptype IN ('1', '2', '3','4','5') and user='.$user.' and no='.$no.' GROUP BY ptype; then to dump them into variables that I could use anywhere in the page, i used: if($res = mysql_query($tt)) { $x = 1; while($row = mysql_fetch_row($res)) { $var[$x++] = $row[1]; } } In this way I could use it like: Hello and welcome, you have: $var[1] of type 1 etc now i am facing a new problem, I need to do the same as above but from 5 differient tables (tabl1,tabl2,tabl3,tabl4 and tabl5) I can of course run 5 select/count queries but is there a way to run just one and get the same effect? I will need to dump it into an arrar and use it the way i used $var[] Any ideas? Thanks, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Making i18n work on all Unix webservers ?
Hi, Monday, August 4, 2003, 11:04:19 PM, you wrote: CC Thanks. But it looks like it's more complicated. CC setlocale(LC_MESSAGES,'0') CC returns fr_BE, but it seems PHP looks in ./local/fr, CC not in ./local/fr_BE when searching the catalog files, CC at least on one webserver. (using PHP 4.1.2, the other PHP 4.2.3). CC I guess there is some kind of search path to locate the catalog files, CC with some preference order. Too bad the i18n PHP thing isn't CC more predictable :-/ CC Of course, I restarted the webserver (apache reload) between tests, CC to avoid problems with the gettext cache. CC I think I'll simply copy ./locale/french to fr, fr_BE, fr_FR CC And something similar for dutch and german. But I thought there CC was some better and cleaner way to do it, in a more manageable way. PHP does not set the paths for gettext it just calls the gettext library function. According to the gettext web site docs gettext will use setlocale() to find the right directory. What happens if you drop the setenv() and just setlocale(LC_MESSAGES,'fr_FR') (It works for me without the setenv setting) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A better solution?
Ryan A wrote: Hi, I have a table called the_slave where i am entering differient types of data and 5 specific types, to get a count of each of the types i used: $tt = SELECT ptype, count(*) FROM the_slave WHERE ptype IN ('1', '2', '3','4','5') and user='.$user.' and no='.$no.' GROUP BY ptype; then to dump them into variables that I could use anywhere in the page, i used: if($res = mysql_query($tt)) { $x = 1; while($row = mysql_fetch_row($res)) I would not be so sure the rows are in the right order here, use { $var[$row[0]] = $row[1]; } instead of { $var[$x++] = $row[1]; } } In this way I could use it like: Hello and welcome, you have: $var[1] of type 1 etc now i am facing a new problem, I need to do the same as above but from 5 differient tables (tabl1,tabl2,tabl3,tabl4 and tabl5) I can of course run 5 select/count queries but is there a way to run just one and get the same effect? I will need to dump it into an arrar and use it the way i used $var[] Any ideas? Thanks, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: attach
Hello, On 08/04/2003 10:59 AM, Diana Castillo wrote: Can you tell me how to attach files when using the php mail function? You may want to try this class that lets you compose messages with as many attachments as you want, including in HTML messages. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A better solution?
* Thus wrote Ryan A ([EMAIL PROTECTED]): Hi, I have a table called the_slave where i am entering differient types of data and 5 specific types, to get a count of each of the types i used: $tt = SELECT ptype, count(*) FROM the_slave WHERE ptype IN ('1', '2', '3','4','5') and user='.$user.' and no='.$no.' GROUP BY ptype; then to dump them into variables that I could use anywhere in the page, i used: if($res = mysql_query($tt)) { $x = 1; while($row = mysql_fetch_row($res)) { $var[$x++] = $row[1]; } } In this way I could use it like: Hello and welcome, you have: $var[1] of type 1 etc $var[1] isn't guaranteed to be of ptype '1' I would suggest to use $var[$row[0]] = $row[1]; now i am facing a new problem, I need to do the same as above but from 5 differient tables (tabl1,tabl2,tabl3,tabl4 and tabl5) I can of course run 5 select/count queries but is there a way to run just one and get the same effect? I will need to dump it into an arrar and use it the way i used $var[] Any ideas? You can use the union statement to achieve this select ptype, count(*), 'the_slave' from the_slave where ... union select ptype, count(*), 'table1' from table1 where ... ... http://www.mysql.com/doc/en/UNION.html Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Functions in Safe Mode
My code: echo number_format(filesize(news/final_1.txt)); The Warning: Warning: filesize() [ http://www.php.net/function.filesize function.filesize]: SAFE MODE Restriction in effect. The script whose uid is 17704 is not allowed to access news/final_1.txt owned by uid 65534 in /home/***/public_html/news.php on line 10 0 The Question: Is there a way to get the file size of files if safe mode is on? I need to do an IF/ELSE statement so that if the file size is less than a certain size, then it does not display the text contained in that file. Am I going about this the wrong way? Jay Fitzgerald, Design Director - Certified Professional Webmaster (CPW-A) - Certified Professional Web Designer (CPWDS-A) - Certified Professional Web Developer (CPWDV-A) - Certified E-Commerce Manager (CECM-A) - Certified Web Consultant for Small Business (CWCSB-A) Bayou Internet - http://www.bayou.com http://www.bayou.com/ Toll Free: 888.30.BAYOU (22968) Vox: 318.338.2034 / Fax: 318.338.2506 E-Mail: [EMAIL PROTECTED] ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf
Re: [PHP] mysql_real_escape_string
Larry E . Ullman [EMAIL PROTECTED] wrote in message: The mysql_real_escape_string() requires a connection to the database. The connection identifier is defined in another script so it's brought in using the global statement. Hope that helps, Larry . Thank you Larry. Now I see the variable $dbc as the connection to the database in other file which uses require_once(). Best... TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM mail merge problem!
Hi, I have a MySQL database which contains customer data. I have written a PHP script to create a CSV file and then import the data into Microsoft excel using COM, which has been saved into C:\TEMP\test.xls. I am now trying to start a mail merge in word with the following code:- com_load_typelib('Word.Application'); $word = new COM(word.application) or die(Unable to instantiate Word); $word-Visible = 1; $word-Documents-Add(); $word-ActiveDocument-MailMerge-MainDocumentType = wdFormLetters; $word-ActiveDocument-MailMerge-OpenDataSource _(c:\\temp\\test.xls); I only want to setup the mail merge up to the point where the user can start selecting fields. The problem is that after word opens it prompts me to select a table. According to the Microsoft documentation this is because the SQLStatement parameter has not been specified in the call to OpenDataSource. I have created a empty variant data type as follows:- $empty = new VARIANT(); and used it in the new call where OpenDataSource (c:\\temp\\test.xls,$empty,$empty,$empty,$empty,$empty,$empty,$empty,$empt y,$empty,$empty,$empty,SELECT * FROM test$,$empty,$empty,$empty); When I run the script I get the following error: Warning: (null)(): Invoke() failed: Type mismatch. Argument: 17 in c:\program files\apache group\apache\htdocs\test6.php on line 93 I didn't think I had specified 17 arguments. I have checked want data types OpenDataSource is expecting and according to OLE/COM view it is expecting a BSTR followed by 15 optional variants. I apologise if this seems like a stupid question but I've only been programming in php for a couple of months. Any advice would be appreciated. Thanks Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM mail merge problem!
Hi, I have a MySQL database which contains customer data. I have written a PHP script to create a CSV file and then import the data into Microsoft excel using COM, which has been saved into C:\TEMP\test.xls. I am now trying to start a mail merge in word with the following code:- com_load_typelib('Word.Application'); $word = new COM(word.application) or die(Unable to instantiate Word); $word-Visible = 1; $word-Documents-Add(); $word-ActiveDocument-MailMerge-MainDocumentType = wdFormLetters; $word-ActiveDocument-MailMerge-OpenDataSource _(c:\\temp\\test.xls); I only want to setup the mail merge up to the point where the user can start selecting fields. The problem is that after word opens it prompts me to select a table. According to the Microsoft documentation this is because the SQLStatement parameter has not been specified in the call to OpenDataSource. I have created a empty variant data type as follows:- $empty = new VARIANT(); and used it in the new call where OpenDataSource (c:\\temp\\test.xls,$empty,$empty,$empty,$empty,$empty,$empty,$empty,$empt y,$empty,$empty,$empty,SELECT * FROM test$,$empty,$empty,$empty); When I run the script I get the following error: Warning: (null)(): Invoke() failed: Type mismatch. Argument: 17 in c:\program files\apache group\apache\htdocs\test6.php on line 93 I didn't think I had specified 17 arguments. I have checked want data types OpenDataSource is expecting and according to OLE/COM view it is expecting a BSTR followed by 15 optional variants. I apologise if this seems like a stupid question but I've only been programming in php for a couple of months. Any advice would be appreciated. Thanks Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Tracking Users via Cookies?
--- Jason Bourque [EMAIL PROTECTED] wrote: I have a client that would like to track their visitors if they go to other competitors websites after visiting their own. Is this possible? Technically, yes, but realistically, no. No matter what solution you come up with, it will require a relationship with the remote site where you wish to track users. Since these other sites are maintained by competitors, this sounds unlikely. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Tracking Users via Cookies? IDEA
What if you could read a browser's history file... There has to be a way to do this with something like javascript... Just an idea... Joe -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Sunday, August 03, 2003 9:03 PM To: Jason Bourque Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Tracking Users via Cookies? Hey, As far as i know you cant do that, you can see from where they have come (ie. where they have visited before coming to you) but not after they leave your site unless they return. /* I want to give my client an informed answer on what is possible, then let them know the implications of privacy invasion. */ Yeah right, we belive you. :-D Cheers, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com - Original Message - From: Jason Bourque [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 04, 2003 1:58 AM Subject: [PHP] Tracking Users via Cookies? Hello, I hope someone can answer this. I have a client that would like to track their visitors if they go to other competitors websites after visiting their own. Is this possible? I think it is possible to track where they go in the site visited. . . I know that tracking isn't a good idea but I want to give my client an informed answer on what is possible, then let them know the implications of privacy invasion. Thanks for any responses. Jason Bourque -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP / Oracle support (8/9) under Redhat 9
At 06:33 PM 8/3/2003, Robert Mena wrote: a) apache It seems that apache + php does not work well under heavy load so I should stick with 1.3.X right ? i don't know about that. i'm running an extremely high traffic website with apache + php + linux and it's a total champ. we've got 6 compaq dl380's (dual xeon 2.8ghz, 4G ram) behind a load balancer and so far there hasn't been a single apache/php failure that wasn't caused by me doing something stupid (like writing an infinite loop in php). we're using apache 2.0.47 (prefork model), php 4.3.1, redhat 7.3, mysql 4.0.12. -jsd- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Not sure of the best way to handle a problem
Actually it does have to do with php.One of my main questions was also about whether it was best to use the script from the command-line or from the web server itself. The network question had to do with php as well. Whether it would be best to use samba or another source. VNC is a poor idea. After all that would suggest changing each one by hand because vnc would require that I would have to run the interpreter on the server. Which I did say I really couldn't install there due to the number of processes running there. Same thing with the telenet and ssh servers. The FTP idea might work, but windows already has the smb protocol enabled. So it does seem like the best way to go. However, I really rather not install other software on to this box due to again the number of processes it is running. Also after looking at the manual more which methods are best to search for the files. Is fnmatch better or glob. I'm not sure I understand what the difference is they both look like they do the same thing. Thanks again, David On Mon, 2003-08-04 at 01:11, Jeff Harris wrote: On Aug 3, 2003, David Smith claimed that: |Hi: |I have a slight problem that I'm not sure where to begin. I have |multiple files on another server other then my linux box that needs to |be renamed. These files are used under a particular software package and |I am trying to switch them to another software package which would |require them to be renamed. Now here is the catch. I really can't |install apache, php, or perl on the system (windows) or it will bog down |the software (which automates a radio station). What I need is to find |out if any of you have ever accessed a remote system (perhaps from the |command-line interface) and changed file names. I need to be able to |remove numbers a pluses. The numbers can be replaced with essentially |nothing. The pluses need to be replaced with spaces. Any ideas. I'm a |little new to PHP so I'm not sure if the best method would be to use the |command-line option or if I should find another solution altogether. |(I'm just more familar with php then perl and hate vb.) |David | This really has nothing to do with PHP. It sounds like you need to have, on your Windows system, either VNCServer or Timbuktu, an ftp server, or a telnet or ssh server. If you install an ftp server on your windows box, you might be able to use PHP on your webserver to open an ftp connection, read the directory list, then use one of the regex commands to create your new file name, then change the name on the server using ftp. David Smith Programmable Solutions [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] Addin a column of numbers not using MySQL
I tried the code you provided below but it returned 0. Is there another way I can do it? From: Jason Wong [EMAIL PROTECTED] Date: 2003/08/04 Mon AM 04:25:13 EDT To: [EMAIL PROTECTED] Subject: Re: [PHP] Addin a column of numbers not using MySQL On Monday 04 August 2003 15:59, Ben C. wrote: Yes. From there I want to add all the 'a' values together using PHP. So do it then. $total = $total + $myrow['a'] // or something as you go through the loop // is just one of the ways to do this -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* A beautiful woman is a picture which drives all beholders nobly mad. -- Emerson */ -- 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: Re: [PHP] Addin a column of numbers not using MySQL
I tried doing as you said and it returned 0. Is there another way to add up the column? From: Jason Wong [EMAIL PROTECTED] Date: 2003/08/04 Mon AM 04:25:13 EDT To: [EMAIL PROTECTED] Subject: Re: [PHP] Addin a column of numbers not using MySQL On Monday 04 August 2003 15:59, Ben C. wrote: Yes. From there I want to add all the 'a' values together using PHP. So do it then. $total = $total + $myrow['a'] // or something as you go through the loop // is just one of the ways to do this -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* A beautiful woman is a picture which drives all beholders nobly mad. -- Emerson */ -- 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] mod_php 4.3.2 (w/ apache 2.0.40 using apache filters) - problems loading extensions
(cross posted from php.install in hopes of increasing my chances of finding help) I've been trying to get php working on our RH8 box using a source rpm. PHP compiles fine however, when reloading apache with the new mod_php, mod_php fails to load any extensions. Yet php-cli and php-cgi load all extensions just fine. Following are the errors that I get as well as my configure line: PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/imap.so' - /usr/lib/php4/imap.so: undefined symbol: executor_globals in Unknown on line 0 PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/ldap.so' - /usr/lib/php4/ldap.so: undefined symbol: OnUpdateInt in Unknown on line 0 PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol: OnUpdateInt in Unknown on line 0 PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/odbc.so' - /usr/lib/php4/odbc.so: undefined symbol: OnUpdateInt in Unknown on line 0 PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/pgsql.so' - /usr/lib/php4/pgsql.so: undefined symbol: OnUpdateBool in Unknown on line 0 and my configure line: './configure' '--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--target=i386-redhat-linux' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-pcre=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-apxs2filter=/usr/sbin/apxs' Any and all help is -greatly- appreciated. :) cheers, -- Carl P. Corliss System Administrator / Developer www.xaraya.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Tracking Users via Cookies? IDEA
Quoting Joe Harman [EMAIL PROTECTED]: What if you could read a browser's history file... There has to be a way to do this with something like javascript... Just an idea... Joe That would be a major privacy loophole if it were allowed.. -- Adam Alkins http://www.rasadam.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Addin a column of numbers not using MySQL
On Tuesday 05 August 2003 01:21, Ben C. wrote: I tried the code you provided below but it returned 0. Is there another way I can do it? Please post your code. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Trust me. I know what I'm doing. -- Sledge Hammer */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: FDF problem with IE - any experts out there?!?
Karsten Dambekalns wrote: Hi! Sorry for the 'longish' post... I am working on a script that generates FDF data and sends it to the browser for display in a PDF file. ... But it works only in Mozilla, MSIE starts Acrobat Reader which then pops up an alert window saying (translated from german) 'An error occured while opening this file. The file does not exist.' ... Nothing worked so far, and I'm getting somewhat upset slowly but steadily. So please help! Answering myself, for the sake of completeness: I found some info about this on the net, and it seems there just is no solution. I decided to show an additional paragraph telling the user to save the file and open it with a double click then (as this works!) for users surfing with MSIE. Does anybody know another free way to manipulate *existing* PDF documents, that might help solve this issue in a different way? Yes. The *REAL* problem you are having is this: Microsuck, in its infinite wisdom, has decided that REGARDLESS of the Content-type: header you are sending, in accordance with the HTTP spec, the URL doesn't end in .pdf so it must *NOT* be a PDF file. Similarly, if you use a query string (eg .../fakepdf.php?id=42) Microsuck IE (in some variants) will also assume that it must not REALLY be a PDF, because who would make a dynamic PDF? Never mind that's the whole POINT of FDF. This is Microsuck. We don't do that. Both behaviours are, of course, in direct and flagrant disregard for HTTP specifications, but it's Microsuck, so what did you really expect? What ya gotta do is *FORCE* your URL to end in .pdf so you can fool the IE browser into believing that the URL really really *IS* a static PDF file. The simplest way to do that is to take your existing script, which probably ends in .php or .htm, and rip off the .php or .htm part. Then, put something like this in your .htaccess file: Files yourexistingscript ForceType application/x-httpd-php /Files That will force Apache to treat the file 'yourexistingscript' as a PHP file, even though it has no .php on the end. Then, when you use a URL (including one on the submit buttons inside your FDF files) you use something like this: http://example.com/yourexistingscript/phony.pdf IE, in its infinite wisdom, will see the 'phony.pdf' and say Oh, that's a PDF file, I know what to do with that Apache, knowing that no such file (phony.pdf) exists will fire up the script 'yourexistingscript' and, because of the .htacess setting, will pass it to PHP for processing. Meanwhile, your script will still use the correct HTTP headers to keep real browsers happy, and IE will be mind-numbingly stupid, as usual, but you've fooled it into getting 'phony.pdf' as far as Microsuck can tell. It's dumb enough to rely on the URL for content-type, so it's not real hard to fool it. You can, of course, replace 'phony.pdf' with whatever you want for a download name, and you can also access that part of the URL using various 'path_info' variables -- see phpinfo() and php.ini (register_globals et al) to determine/affect precisely which variables actually hold 'phony.pdf' for you. In addition, if you need to pass in variables, you can use, say: http://example.com/yourexistingscript/id/42/phony.pdf and do the exact same thing -- You'll need to tear apart /id/42/ from the 'pathinfo' to GET your variables, since they are not being passed in the usual GET/POST way, but that is relatively easy. Apache is going to mostly ignore (except for stuffing into 'pathinfo' the crap after 'yourexistingscript' -- Non-IE browsers will be using the Content-type: headers in accordance with the spec, and IE will be blindly reading the URL as if it were TRUTH. You could go whole-hog and get really complicated using mod_rewrite if you were feeling particularly masochistic. :-) Tip: rewrite_log is your buddy when trying to learn mod_rewrite, no matter how much it might slow your server down. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
[snip] I tried doing as you said and it returned 0. Is there another way to add up the column? [/snip] $sql = SELECT foo FROM table WHERE you have conditions ; if(!($result = mysql_query($sql, $connection))){ print(MySQL reports: . mysql_error() . \n); exit(); } while($row = mysql_fetch_object($result)){ $total = $total + $row-foo; //each time through add the new amount to the last amount } echo$total\n; HTH! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] Addin a column of numbers not using MySQL
CODE Begin- $sql_2 = SELECT SUM(paidamount) as paid FROM $tb_name WHERE id = \$id\ ; $result_2 = @mysql_query($sql_2,$connection) or die(mysql_error()); while ($row = mysql_fetch_array($result_2)) { $paid = $row['paid']; } CODE End- What I want to do from here is add up all the 'paid' figures. From: Jason Wong [EMAIL PROTECTED] Date: 2003/08/04 Mon PM 01:55:40 EDT To: [EMAIL PROTECTED] Subject: Re: [PHP] Addin a column of numbers not using MySQL On Tuesday 05 August 2003 01:21, Ben C. wrote: I tried the code you provided below but it returned 0. Is there another way I can do it? Please post your code. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Trust me. I know what I'm doing. -- Sledge Hammer */ -- 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: Re: [PHP] Addin a column of numbers not using MySQL
[snip] while ($row = mysql_fetch_array($result_2)) { $paid = $row['paid']; } CODE End- What I want to do from here is add up all the 'paid' figures. [/snip] while ($row = mysql_fetch_array($result_2)) { $paid = $row['paid']; $total = $total + $paid; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
[snip] $sql_2 = SELECT SUM(paidamount) as paid FROM $tb_name WHERE id = \$id\ ; [/snip] Ben I would also check the query with echo$sql_2 \n; You may be surprised that what you get back is not what you intended. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] compiling php --with imap
Hi there, I want to upgrade to a newer php version (from 4.2.2 to 4.3.2) In order to do that I picked my old configure command to reproduce it. The old php version was build with imap. Now I have found, that the directory where the file is supposed to be has been removed (I guess I have cleaned up my hard disc a while ago:-() However, the configure command had following line: '--with-imap=/home/sw/horde/imap-2002.RC2' ' now the configure always checks for imap and does not find this file. It has been removed. Can anybody remind me how to get this file again? I am lost, after trying for 2 hours I gave up. Can anybody help me in this case? Thanx in advance, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Purging old files from directories
I need to write a script that will scan/read a given directory's contents and delete files older than a certain date. Ideally, this will be a script that runs via cron once a week and deletes all files it finds in the directory older than 2 weeks from the current date. I do currently have scripts running via cron and that's no problem. I'm not sure where to begin with the other components Don't bother with PHP for tasks like these - just use the standard unix find program. The following one-liner should work: find /path/to/your/dir -mtime +14 -type f -print0 | xargs -0 rm -f man find, man xargs for more info. -mike. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
[snip] It still returns '0'. I think we are missing something. Any other ideas? Anyone else have any ideas? [/snip] echo the SELECT statement to make sure that $id is worth something -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
[snip] CODE Begin- $sql_2 = SELECT SUM(paidamount) as paid FROM $tb_name WHERE id = \$id\ ; $result_2 = @mysql_query($sql_2,$connection) or die(mysql_error()); while ($row = mysql_fetch_array($result_2)) { $paid = $row['paid']; } CODE End- [/snip] FOUND IT! CODE Begin- $sql_2 = SELECT paidamount FROM $tb_name WHERE id = \$id\ ; $result_2 = @mysql_query($sql_2,$connection) or die(mysql_error()); while ($row = mysql_fetch_array($result_2)) { $paid = $row['paidamount']; $total = $total + $paid; } CODE End- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
[snip] I tried the code again and still returns a '0'. It looks like the while() is only looping one record at a time. It does looks like it is add all the records. Do you or anyone have any other suggestions? [/snip] D'oh! *slaps forehead*! It IS getting only one record! Dang! SELECT SUM(foo) will only return the sum of the column foo...one record! Repost your query and I can help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
[snip] When I echo the select state the id is the first of many ids that need to be added together. It is still not summing the total value of the records. [/snip] Are you looping through the id's somehow? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
[snip] Let me try and explain a little better and easier. What I am trying to do is take a list of values and add them to get. I am getting the values from a database query. Assuming that I had the following: val_1 100.00 val_2 150.00 val_3 200.00 val_4 250.00 val_5 100.00 What I want to do now is add up the values 1-5 and get 800.00. Does this help clarify? [/snip] Good, we're on the right path. Please try the code I sent previously -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
[snip] Unsure. How would I do that? [/snip] Ben I think that we have a communications failure. Let's start over...you wish to total a database column using php, correct? Everything that you have been shown so far will do that. Is it possible that there are no query results? If not, then we are doing the query wrong. Try it with single quotes; $sql_2 = SELECT paidamount FROM $tb_name WHERE id = ' . $id . ' ; Please do a verbose check on the query to see if it is working properly if(!($result_2 = mysql_query($sql_2, $connection))){ print(MySQL reports: . mysql_error() . \n); exit(); } Let's use objects instead of arrays (humor me for a moment) while($row = mysql_fetch_object($result_2)){ $paid = $row-paidamount; echo $paid \n; $total = $total + paid; } echo $total \n; Please copy and paste the results into your reply -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
When I echo the select state the id is the first of many ids that need to be added together. It is still not summing the total value of the records. From: Jay Blanchard [EMAIL PROTECTED] Date: 2003/08/04 Mon PM 04:09:36 EDT To: Ben C. [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: Re: [PHP] Addin a column of numbers not using MySQL [snip] It still returns '0'. I think we are missing something. Any other ideas? Anyone else have any ideas? [/snip] echo the SELECT statement to make sure that $id is worth something -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
I tried the code again and still returns a '0'. It looks like the while() is only looping one record at a time. It does looks like it is add all the records. Do you or anyone have any other suggestions? From: Jay Blanchard [EMAIL PROTECTED] Date: 2003/08/04 Mon PM 02:16:22 EDT To: Ben C. [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: Re: [PHP] Addin a column of numbers not using MySQL [snip] while ($row = mysql_fetch_array($result_2)) { $paid = $row['paid']; } CODE End- What I want to do from here is add up all the 'paid' figures. [/snip] while ($row = mysql_fetch_array($result_2)) { $paid = $row['paid']; $total = $total + $paid; } -- 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: Re: [PHP] Addin a column of numbers not using MySQL
Unsure. How would I do that? From: Jay Blanchard [EMAIL PROTECTED] Date: 2003/08/04 Mon PM 04:36:15 EDT To: Ben C. [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: Re: [PHP] Addin a column of numbers not using MySQL [snip] When I echo the select state the id is the first of many ids that need to be added together. It is still not summing the total value of the records. [/snip] Are you looping through the id's somehow? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
When I echo the select state the id is the first of many ids that need to be added together. It is still not summing the total value of the records. From: Jay Blanchard [EMAIL PROTECTED] Date: 2003/08/04 Mon PM 04:09:36 EDT To: Ben C. [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: Re: [PHP] Addin a column of numbers not using MySQL [snip] It still returns '0'. I think we are missing something. Any other ideas? Anyone else have any ideas? [/snip] echo the SELECT statement to make sure that $id is worth something -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
When I echo the select state the id is the first of many ids that need to be added together. It is still not summing the total value of the records. From: Jay Blanchard [EMAIL PROTECTED] Date: 2003/08/04 Mon PM 04:09:36 EDT To: Ben C. [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: Re: [PHP] Addin a column of numbers not using MySQL [snip] It still returns '0'. I think we are missing something. Any other ideas? Anyone else have any ideas? [/snip] echo the SELECT statement to make sure that $id is worth something -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Invalid Characters, XML...
I had a similar problem recently, but was not able to work with it in PHP tho. The array for that mapped characters to their entity turned out to be HUGE and it took forever to evaluate long XML files. I ended up killing several birds with one stone by wrapping the html-tidy utility (tidy.sourceforge.net) in php. It validates xml, converts all characters 127 into their respective entity, pretties up the XML output, cleans up Word 2000 specific content and deals with a variety of input/output encodings. It did all these a lot faster that any of the scripts I had written and saved me from writing others. -Original Message- From: Russell P Jones [mailto:[EMAIL PROTECTED] Sent: Sunday, August 03, 2003 6:52 PM To: [EMAIL PROTECTED] Subject: [PHP] Invalid Characters, XML... Im using PHP to write to XML files, but I am having some problems. A lot of users are cutting and pasting content from text editors like word, which uses odd quotation marks, dashes, etc. which PHP writes to the XML file, and then the XML parser does not under stand. Is there a stripslashes() or htmlspecialchars() equivalent that will convert this kind of stuff to the correct ascii text? Russ -- 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] PHP / Oracle support (8/9) under Redhat 9
From: Robert Mena [EMAIL PROTECTED] But I'd need to compile php with oracle support. Do you have any experience with this setup ? RH9 + PHP with oracle support ? nope, have only used it with MySQL... the problem is that the php RPM does not have Oracle support compiled in? if it's that, then download the SRPM and compile it again with Oracle support :) regards, Juan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular Expression
Been working on this one for a while but can't get it working properly. I need a regular expression to match if address is 1. PO Box 2. P.O. Box 3. P.O.Box I'm using /i to make this case insensitive. I got it working with 1 2, but it's still not matching 3. Any suggestions? if(preg_match( /p[\.]o\.* +box/i, trim($_POST['address'])){ echo Address is P.O. BOX; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] compiling php --with imap
* Thus wrote Merlin ([EMAIL PROTECTED]): Hi there, I want to upgrade to a newer php version (from 4.2.2 to 4.3.2) In order to do that I picked my old configure command to reproduce it. The old php version was build with imap. Now I have found, that the directory where the file is supposed to be has been removed (I guess I have cleaned up my hard disc a while ago:-() However, the configure command had following line: '--with-imap=/home/sw/horde/imap-2002.RC2' ' now the configure always checks for imap and does not find this file. It has been removed. you can remove the config.cache file and then reconfigure it with the proper options. Can anybody remind me how to get this file again? I am lost, after trying for 2 hours I gave up. Can anybody help me in this case? there is info on that in the imap section in the online documentation. http://us4.php.net/imap btw, there is a php-install mailing list. You might get better support with a question like this. HTH, Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] compiling php --with imap
On Tuesday 05 August 2003 02:26, Merlin wrote: I want to upgrade to a newer php version (from 4.2.2 to 4.3.2) In order to do that I picked my old configure command to reproduce it. The old php version was build with imap. Now I have found, that the directory where the file is supposed to be has been removed (I guess I have cleaned up my hard disc a while ago:-() However, the configure command had following line: '--with-imap=/home/sw/horde/imap-2002.RC2' ' now the configure always checks for imap and does not find this file. It has been removed. Can anybody remind me how to get this file again? I am lost, after trying for 2 hours I gave up. Can anybody help me in this case? To get it from source http://www.washington.edu/imap/ But your best bet is probably to just install it form whatever distro you're using. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Year, n.: A period of three hundred and sixty-five disappointments. -- Ambrose Bierce, The Devil's Dictionary */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Functions in Safe Mode?
My code: echo number_format(filesize(news/final_1.txt)); The Warning: Warning: filesize() [ http://www.php.net/function.filesize function.filesize]: SAFE MODE Restriction in effect. The script whose uid is 17704 is not allowed to access news/final_1.txt owned by uid 65534 in /home/***/public_html/news.php on line 10 0 The Question: Is there a way to get the file size of files if safe mode is on? I need to do an IF/ELSE statement so that if the file size is less than a certain size, then it does not display the text contained in that file. Am I going about this the wrong way? -- Jay Fitzgerald, Design Director - CPW-A, CPWDS-A, CPWDV-A, CECM-A, CWCSB-A Bayou Internet - http://www.bayou.com Toll Free: 888.30.BAYOU (22968) Vox: 318.338.2034 / Fax: 318.338.2506 E-Mail: [EMAIL PROTECTED] ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Regular Expression
Been working on this one for a while but can't get it working properly. I need a regular expression to match if address is 1. PO Box 2. P.O. Box 3. P.O.Box I got it working with 1 2, but it's still not matching 3. Any suggestions? if(preg_match( /p[\.]o\.* +box/i, trim($_POST['address'])){ echo Address is P.O. BOX; } You are using a + as the modifier on the space between p.o. and box. + means 1 or more. Option 3 does not have a space. Try using * which is 0 or more, or ? which is 0 or 1. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular Expression
At 02:45 PM 8/4/2003, Ralph Guzman wrote: Been working on this one for a while but can't get it working properly. I need a regular expression to match if address is 1. PO Box 2. P.O. Box 3. P.O.Box I'm using /i to make this case insensitive. I got it working with 1 2, but it's still not matching 3. Any suggestions? if(preg_match( /p[\.]o\.* +box/i, trim($_POST['address'])){ echo Address is P.O. BOX; } /p\.?o\.?\s*box/i p followed by optional period (\.?) o followed by optional period zero or more whitespace (\s*) box mine has the added advantage of matching po.box and po. box -jsd- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP / Oracle support (8/9) under Redhat 9
Hi Juan, But I'd need to compile php with oracle support. Do you have any experience with this setup ? RH9 + PHP with oracle support ? Regards. --- Juan Nin [EMAIL PROTECTED] wrote: From: Robert Mena [EMAIL PROTECTED] a) apache It seems that apache + php does not work well under heavy load so I should stick with 1.3.X right ? Any ideas where I can find a rpm package for redhat 9 ? Yes, stick with apache-1.3.x Latest 1.3.x version RPM from Red Hat for RH 7.3 is apache-1.3.27-2.i386.rpm I'm using the latest RH 7.1 apache RPM in a RH 9 and runs ok, which is apache-1.3.27-1.7.1 Latest PHP version for RH 7.1 is php-4.1.2-7.1.6 For RH 9 it's php-4.2.2-17, I guess there should be no problem in running that version with the apache-1.3.x from RH 7.x Regards, Juan __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP / Oracle support (8/9) under Redhat 9
Thanks for the reply. I already use 4.3.1 in my current server. I always compile my version of php since the ones that come with the distro are always too old and usually does not contain support for need features such as mcrpyt or oracle. - rt --- Justin French [EMAIL PROTECTED] wrote: I can't help with the Oracle question, but yes, stick with apache 1.3.x for the moment... It would also pay to look at what version of PHP you're currently running (eg 4.1) and see what major changes you're likely to experience when upgrading to the latest stable version. If your existing version is pre 4.1, the register globals will be an issue, for example. Sorry, I have no idea what version of PHP was on RH 7 __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using exec to run a shell script
Hello. I'm attempting to run the exec function to run a shell script that will restart a service on my Red Hat server. The script says it has failed shutting down and restarting the service everytime I run it from a browser. Any suggestions on why it might be failing? I can send more details if needed. Thanks, Rod mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using exec to run a shell script
Hello, This is a reply to an e-mail that you wrote on Mon, 4 Aug 2003 at 23:14, lines prefixed by '' were originally written by you. Hello. I'm attempting to run the exec function to run a shell script that will restart a service on my Red Hat server. The script says it has failed shutting down and restarting the service everytime I run it from a browser. Any suggestions on why it might be failing? I can send more details if needed. I expect it is because the shell script is running with the permissions as of webserver and your webserver does not have permission to restart the service. HTH David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Free PHP error handling script: www.phpmachine.com/error-handler Professional Web Development by David Nicholson - www.djnicholson.com QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] easier than switch
okay, so i know there's an easy way to do this, and i've seen it done, sure of it. so please forgive the stupidity of my question, i don't even know where to begin to look in the archives either... i have several forms on one page, they all submit a different variable, i then want to set one variable depending on that... okay, now i'm confusing myself, lets try explain it with some code... ? if(isset($_POST)) { $type = $_POST['news'] || $_POST['dreams'] || $_POST['storys'] || $_POST['words'] || $_POST['chat']; } ? obviously this doesn't work. but i wanna set $type depending on which $_POST variable was sent. only one of these will ever be sent. rather than doing a big ass switch statement, is there no way i can get this into one line? i hope this isn't too confusing...
Re: [PHP] easier than switch
skate wrote: okay, so i know there's an easy way to do this, and i've seen it done, sure of it. so please forgive the stupidity of my question, i don't even know where to begin to look in the archives either... i have several forms on one page, they all submit a different variable, i then want to set one variable depending on that... okay, now i'm confusing myself, lets try explain it with some code... ? if(isset($_POST)) { $type = $_POST['news'] || $_POST['dreams'] || $_POST['storys'] || $_POST['words'] || $_POST['chat']; } ? obviously this doesn't work. but i wanna set $type depending on which $_POST variable was sent. only one of these will ever be sent. rather than doing a big ass switch statement, is there no way i can get this into one line? i hope this isn't too confusing... If you're really sure only one will be sent: $type = $_POST['news'] . $_POST['dreams'] . $_POST['storys'] . $_POST['words'] . $_POST['chat']; will achieve what you're looking for. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] easier than switch
--- skate [EMAIL PROTECTED] wrote: i have several forms on one page, they all submit a different variable The best solution would be to change this behavior, or at least add a consistent form variable that you plan to receive. ? if(isset($_POST)) { $type = $_POST['news'] || $_POST['dreams'] || $_POST['storys'] || $_POST['words'] || $_POST['chat']; } ? obviously this doesn't work. but i wanna set $type depending on which $_POST variable was sent. What you need to do is name your variable 'type', so that $_POST['type'] is either 'news', 'dreams', 'stories', 'words', or 'chat'. Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: easier than switch
On Mon, Aug 04, 2003 at 11:19:42PM +0100, skate wrote: i have several forms on one page, they all submit a different variable, i then want to set one variable depending on that... okay, now i'm confusing myself, lets try explain it with some code... if(isset($_POST)) { $type = $_POST['news'] || $_POST['dreams'] || $_POST['storys'] || $_POST['words'] || $_POST['chat']; } You have a single page, containing multiple forms, all of which share the same action? What about putting a hidden variable into each form to provide an authoritative reference to which form was posted? Then, if processing unique to each form can be done with: if ($_POST['func']==thisone) { // fooblah } else if ($_POST['func']==thatone) { // barblah } else if ($_POST['func']==another) { // otherblah } else { die(Form hacking detected); } And you can do things with the content of $_POST['func'], like this: $typelist=array( 'thisone' = This is one, 'thatone' = That is one too, 'another' = Another one here, ); $type=$typelist[$_POST['func']]; Is that long the lines of what you're looking for? -- Paul Chvostek [EMAIL PROTECTED] it.canadahttp://www.it.ca/ Free PHP web hosting!http://www.it.ca/web/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Values from forms
Small brain cramp here. I have the following form and having problems retrieving the values from it. FORM ACTION=teams-write.php action=post name=inputs input type=hidden name=count value=? echo $number; ? // $number gets inputted from another form (this works) ? for($i = 1; $i $number + 1; $i++) { ? input type=text name=team? echo $i; ? SIZE=10 ? } ? This is teams-write.php: The problem I am having is getting the values inputted in the above form in the for loop below. If I just echo $team1, $team2, etc. they are there, I just can't figure out how to get the values inputted into my database. In the loop below, what would I put in the second values section to get the values of $team1, $team2, etc. for($i=1; $i $count + 1; $i++) { mysql_query(insert into manager (idn, name) values ('$i','???')); } TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: FDF problem with IE - any experts out there?!?
--- Richard Lynch [EMAIL PROTECTED] wrote: The *REAL* problem you are having is this: This was one of the best and most thorough explanations I have seen of this problem. :-) To add one more suggestion, there is another method that can trick IE into behaving properly, though this method is a bit less reliable. http://example.org/myscript.php?foo.pdf As Richard pointed out, the issue is that IE does not properly implement HTTP and uses file extensions rather than the Content-Type header to determine the content type. It is very annoying and has caused problems for Web developers for years. Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Values from forms
--- Beauford.2005 [EMAIL PROTECTED] wrote: FORM ACTION=teams-write.php action=post name=inputs You misspelled method. :-) Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Functions in Safe Mode?
The problem is the owner of the script must be the owner of the file that you are accessing. If you fix your file ownership for your news directory or change your php script to be the same owner as the news directoryo you will be able to access the files. Look at the chown command,. you will need to execute it on the command line. Jason Jay Fitzgerald wrote: My code: echo number_format(filesize(news/final_1.txt)); The Warning: Warning: filesize() [ http://www.php.net/function.filesize function.filesize]: SAFE MODE Restriction in effect. The script whose uid is 17704 is not allowed to access news/final_1.txt owned by uid 65534 in /home/***/public_html/news.php on line 10 0 The Question: Is there a way to get the file size of files if safe mode is on? I need to do an IF/ELSE statement so that if the file size is less than a certain size, then it does not display the text contained in that file. Am I going about this the wrong way? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Values from forms
Hello, This is a reply to an e-mail that you wrote on Tue, 5 Aug 2003 at 00:05, lines prefixed by '' were originally written by you. $team2, etc. they are there, I just can't figure out how to get the values inputted into my database. In the loop below, what would I put the second values section to get the values of $team1, $team2, etc. for($i=1; $i $count + 1; $i++) { mysql_query(insert into manager (idn, name) values ('$i','???')); TIA ${'team'.$i} will work but it would lead to tider code if you got your data into the script using an array... input name='test[0]'... input name='test[1]'... input name='test[2]'... etc... All the best, David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Free PHP error handling script: www.phpmachine.com/error-handler Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular expression question
So I want to grab the attributes out of an HTML element. The following works, except in the case that the attribute's value includes the character : if (preg_match_all(/tag([^]*)/i, $subject, $matches)) print_r($matches); A $subject of tag attr=\value\ gives: Array ( [0] = Array ( [0] = ) [1] = Array ( [0] = attr=value ) ) A $subject of tag attr=\\ gives: Array ( [0] = Array ( [0] = Thanks for any help, -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 Prototyping
Are there any plans to implement prototyping in PHP5? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
Jay, It still returns '0'. I think we are missing something. Any other ideas? Anyone else have any ideas? Ben From: Jay Blanchard [EMAIL PROTECTED] Date: 2003/08/04 Mon PM 03:10:15 EDT To: Ben C. [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: Re: [PHP] Addin a column of numbers not using MySQL [snip] CODE Begin- $sql_2 = SELECT SUM(paidamount) as paid FROM $tb_name WHERE id = \$id\ ; $result_2 = @mysql_query($sql_2,$connection) or die(mysql_error()); while ($row = mysql_fetch_array($result_2)) { $paid = $row['paid']; } CODE End- [/snip] FOUND IT! CODE Begin- $sql_2 = SELECT paidamount FROM $tb_name WHERE id = \$id\ ; $result_2 = @mysql_query($sql_2,$connection) or die(mysql_error()); while ($row = mysql_fetch_array($result_2)) { $paid = $row['paidamount']; $total = $total + $paid; } CODE End- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
Let me try and explain a little better and easier. What I am trying to do is take a list of values and add them to get. I am getting the values from a database query. Assuming that I had the following: val_1 100.00 val_2 150.00 val_3 200.00 val_4 250.00 val_5 100.00 What I want to do now is add up the values 1-5 and get 800.00. Does this help clarify? From: Jay Blanchard [EMAIL PROTECTED] Date: 2003/08/04 Mon PM 04:57:17 EDT To: Ben C. [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: Re: [PHP] Addin a column of numbers not using MySQL [snip] Unsure. How would I do that? [/snip] Ben I think that we have a communications failure. Let's start over...you wish to total a database column using php, correct? Everything that you have been shown so far will do that. Is it possible that there are no query results? If not, then we are doing the query wrong. Try it with single quotes; $sql_2 = SELECT paidamount FROM $tb_name WHERE id = ' . $id . ' ; Please do a verbose check on the query to see if it is working properly if(!($result_2 = mysql_query($sql_2, $connection))){ print(MySQL reports: . mysql_error() . \n); exit(); } Let's use objects instead of arrays (humor me for a moment) while($row = mysql_fetch_object($result_2)){ $paid = $row-paidamount; echo $paid \n; $total = $total + paid; } echo $total \n; Please copy and paste the results into your reply -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re: [PHP] Addin a column of numbers not using MySQL
Jay, No results are returned. It is blank. From: Jay Blanchard [EMAIL PROTECTED] Date: 2003/08/04 Mon PM 04:57:17 EDT To: Ben C. [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: Re: [PHP] Addin a column of numbers not using MySQL [snip] Unsure. How would I do that? [/snip] Ben I think that we have a communications failure. Let's start over...you wish to total a database column using php, correct? Everything that you have been shown so far will do that. Is it possible that there are no query results? If not, then we are doing the query wrong. Try it with single quotes; $sql_2 = SELECT paidamount FROM $tb_name WHERE id = ' . $id . ' ; Please do a verbose check on the query to see if it is working properly if(!($result_2 = mysql_query($sql_2, $connection))){ print(MySQL reports: . mysql_error() . \n); exit(); } Let's use objects instead of arrays (humor me for a moment) while($row = mysql_fetch_object($result_2)){ $paid = $row-paidamount; echo $paid \n; $total = $total + paid; } echo $total \n; Please copy and paste the results into your reply -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Values from forms
--- Beauford.2005 [EMAIL PROTECTED] wrote: FORM ACTION=teams-write.php action=post name=inputs You misspelled method. :-) Hope that helps. Chris It seems like this exact same problem has been addressed before. http://marc.theaimsgroup.com/?l=php-generalm=105900603231518w=2 http://marc.theaimsgroup.com/?l=php-generalm=105906453817129w=2 Having the action attribute in there twice will mess stuff up. You might want to check all of your forms since this seems to be a re-occurring problem, it'll probably save you some time and frustration. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Values from forms
David, Thanks for the info. The first suggestion doesn't work, and the second may work - but the problem is I need the array to start at '1' - and arrays in general start at 0. Any ideas? TIA -Original Message- From: David Nicholson [mailto:[EMAIL PROTECTED] Sent: August 4, 2003 7:11 PM To: Beauford.2005 Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Values from forms Hello, This is a reply to an e-mail that you wrote on Tue, 5 Aug 2003 at 00:05, lines prefixed by '' were originally written by you. $team2, etc. they are there, I just can't figure out how to get the values inputted into my database. In the loop below, what would I put the second values section to get the values of $team1, $team2, etc. for($i=1; $i $count + 1; $i++) { mysql_query(insert into manager (idn, name) values ('$i','???')); TIA ${'team'.$i} will work but it would lead to tider code if you got your data into the script using an array... input name='test[0]'... input name='test[1]'... input name='test[2]'... etc... All the best, David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Free PHP error handling script: www.phpmachine.com/error-handler Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ -- 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] Re: PHP5 Prototyping
http://www.php.net/zend-engine-2.php Regards, Greg -- phpDocumentor http://www.phpdoc.org Andrew Johnstone wrote: Are there any plans to implement prototyping in PHP5? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Values from forms
Hello, This is a reply to an e-mail that you wrote on Tue, 5 Aug 2003 at 00:39, lines prefixed by '' were originally written by you. Thanks for the info. The first suggestion doesn't work, What error did you get? and the second may work - but the problem is I need the array to start at '1' - and arrays in general start at 0. Arrays can have whatever you want as the keys, if you want them to start at one, start them at one! HTH David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Free PHP error handling script: www.phpmachine.com/error-handler/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php