[PHP] getting rid of NOTICE
I have this short script (below) that does checking whether a userid has an associated jpegPhoto in an LDAP database. The script is working fine but gave a 'Notice' msg bcos I made error_reporting to report all errors. Notice: Undefined index: jpegphoto in test.php on line 34 Question: How do I make the Notice go away without changing error reporting to error_reporting (E_ALL ~E_NOTICE) ? Please advise. -- roger ? require_once config.inc; error_reporting (E_ALL); $ds = @connectBindServer(LDAP_RDN, LDAP_PASS); if ($ds) { $what2return = array(givenName,sn,jpegPhoto); $searchFilter = ([EMAIL PROTECTED]); $sr= ldap_search($ds, LDAP_BASEDN, $searchFilter,$what2return); $resultEntries = ldap_get_entries($ds, $sr); closeConn($ds); if ($resultEntries[count] == 0) { print user not found; exit; } else { $gn= $resultEntries[0][givenname]; $sn= $resultEntries[0][sn]; $photo = $resultEntries[0][jpegphoto]; if ($photo['count'] == 1) print photo available; else print photo not available; } } ? --- Sign Up for free Email at http://ureg.home.net.my/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting rid of NOTICE
--- Roger Thomas [EMAIL PROTECTED] wrote: I have this short script (below) that does checking whether a userid has an associated jpegPhoto in an LDAP database. The script is working fine but gave a 'Notice' msg bcos I made error_reporting to report all errors. Notice: Undefined index: jpegphoto in test.php on line 34 Question: How do I make the Notice go away without changing error reporting to error_reporting (E_ALL ~E_NOTICE) ? Please advise. -- roger ? require_once config.inc; error_reporting (E_ALL); $ds = @connectBindServer(LDAP_RDN, LDAP_PASS); if ($ds) { $what2return = array(givenName,sn,jpegPhoto); You have define jpegPhoto Note Caps P. $searchFilter = ([EMAIL PROTECTED]); $sr= ldap_search($ds, LDAP_BASEDN, $searchFilter,$what2return); $resultEntries = ldap_get_entries($ds, $sr); closeConn($ds); if ($resultEntries[count] == 0) { print user not found; exit; } else { $gn= $resultEntries[0][givenname]; $sn= $resultEntries[0][sn]; $photo = $resultEntries[0][jpegphoto]; here p is small in jpegphoto. Got it ... zareef ahmed if ($photo['count'] == 1) print photo available; else print photo not available; } } ? --- Sign Up for free Email at http://ureg.home.net.my/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Zareef Ahmed :: A PHP Developer in Delhi ( India ). Homepage :: http://www.zasaifi.com/zareef_ahmed.php ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP with IMAP support
Not sure if this is the right place to post this, but I am trying to get PHP installed with IMAP support. It says that I need to install using the --with-imap=/dir but how do I do that with Gentoo? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] AutoLogin
On Thursday 07 October 2004 07:57, Sagar C Nannapaneni wrote: BlankHi all, I have a website which has a login form with username and password. How can i login into that website providing the username and pwd from the php script. I know that this can be done...but wonder how. The website uses a JSP files with jsp session and also before logging in..it asks for ssl authentication. Use cURL ;-) Ur help will b a great help to me... Regards, /sagar -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) - Orbitel - the New Generation Telecom! See www.orbitel.bg. pgpsIqAkuSv7B.pgp Description: signature
Re: [PHP] Is it possible??
On Thursday 07 October 2004 08:26, Sagar C Nannapaneni wrote: BlankThis may sound strange..but is there a way out??? I need to know where the client moves from my page. Even using frames...like my page will b in the top frame of the page and the user can browse his stuff in the lower frame..so can v find from the top page whats the user is browsing??? If you control both pages - i.e. you have access to the applications - you may use javascript to send signals from the second frame to the first. But have in mind that if the domain of both applications is not equal you'll have to set it via javascript explicitly. I rreally wonder...i badly need the solution :( /sagar -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) - Orbitel - the New Generation Telecom! See www.orbitel.bg. pgpkABOFn8CdR.pgp Description: signature
Re: [PHP] Newsgroups Space
On Wednesday 06 October 2004 22:53, Joe Crawford wrote: i know this isn't completely related to php but i am creating a web based news reader in php, how much disk space do you think i need to run my own local news server? depends on the number of external news sources you'll import ;-) -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) - Orbitel - the New Generation Telecom! See www.orbitel.bg. pgpJRgvIxfI19.pgp Description: signature
Re: [PHP] pdf_open_pdi_page
Matt M. schrieb: *Fatal error*: PDFlib error: [2016] PDF_open_pdi: PDF import (PDI) not supported in this configuration in *d:\worksheet-server\wss\html\pdf\test2.php* on line *7* I could be wrong but I think you need a special license for this functionality. Do you have a source for your assumption ? Hendrik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [PHP5] How to knwo object class name in a function called statically ?
Hello - I have this code : abstract class foo { private __construct() {} public static getInstance() { static $instance = null; if (is_null($instance) == false) return $instance; else { $class = __CLASS__; return new $class(); } } } class extendedFoo extends foo { ... } $instance = extendedFoo::getInstance(); echo (get_class($instance)); My problem is that get_class($instance) return foo instead of extendedFoo !!! How to knwo the calling object type in a function called statically ? Reflection ? Other solution ??? Bug I can resolve my probleme with a extendedFoo::getInstance() function, and adding a parameter $class to foo::getInstance(), but i don't want duplicated code in all foo subclass... Fred - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting rid of NOTICE
I dont know how to explain this but when you work with an ldap attribute, they are case sensitive. jpegPhoto was what the schema was written with. However when you retrieve that into PHP, you accessed them with all lower case. So accessing userPassword attribute in ldap will become userpassword in PHP. Just to satisfy your curiosity, I have changed that to your advise with running the script produces identical result. -- roger Quoting zareef ahmed [EMAIL PROTECTED]: --- Roger Thomas [EMAIL PROTECTED] wrote: I have this short script (below) that does checking whether a userid has an associated jpegPhoto in an LDAP database. The script is working fine but gave a 'Notice' msg bcos I made error_reporting to report all errors. Notice: Undefined index: jpegphoto in test.php on line 34 Question: How do I make the Notice go away without changing error reporting to error_reporting (E_ALL ~E_NOTICE) ? Please advise. -- roger ? require_once config.inc; error_reporting (E_ALL); $ds = @connectBindServer(LDAP_RDN, LDAP_PASS); if ($ds) { $what2return = array(givenName,sn,jpegPhoto); You have define jpegPhoto Note Caps P. $searchFilter = ([EMAIL PROTECTED]); $sr= ldap_search($ds, LDAP_BASEDN, $searchFilter,$what2return); $resultEntries = ldap_get_entries($ds, $sr); closeConn($ds); if ($resultEntries[count] == 0) { print user not found; exit; } else { $gn= $resultEntries[0][givenname]; $sn= $resultEntries[0][sn]; $photo = $resultEntries[0][jpegphoto]; here p is small in jpegphoto. Got it ... zareef ahmed if ($photo['count'] == 1) print photo available; else print photo not available; } } ? --- Sign Up for free Email at http://ureg.home.net.my/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Zareef Ahmed :: A PHP Developer in Delhi ( India ). Homepage :: http://www.zasaifi.com/zareef_ahmed.php ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Sign Up for free Email at http://ureg.home.net.my/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and Lotus Notes
Hi List, I googled a bit but didnt get much. Are there tools other than the ones on the PHP website (which are EXPERIMENTAL) that can be used to access the Lotus notes framework, such as databases / tables / data from PHP. Any tips out there for integration issues. Our company is looking at bringing in Lotus but keep our existing PHP applications. Can PHP access the Lotus DB for authentication? Thanks for any tips / help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SOMETIMES, my SID gets embedded in the URL ???
he problem is that SOMETIMES, my SID gets embedded in the URL, although at the begining of every page I have this code: ini_set(session.use_only_cookies, 1); session_set_cookie_params(60*60); session_start(); session_register(blabla); if (!$_SESSION[logged_in]) session_destroy(); etc, etc; So there are days/times when the SID isn't embedded in the URL (and in the links of the page), and days/times when it is, regardless of what value $_SESSION[logged_in] has. I tested the value returned by ini_set and it's always different from false. What gives ??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to implement mass emailing?
Hi, you can create a mailscript to run seperartly in the background, so when a administrator wishes to send a mass mail, it writes the content to a database and then executes a stand alone mailing script eg: exec(' php phpmailscript.php logflile.txt '); use the to run the script in the background. This script can then pull info from a db (user and content) and mail individually and log that the user was sent a email. This will also save you the hassel of worring about administrators closing the browser and having to resend the mail again and if there are thousands of emails you can then schedual email's to be sent at specific times, in the evening for example. HTH Jarratt On Wed, 6 Oct 2004 22:58:59 -0700 (PDT), zareef ahmed [EMAIL PROTECTED] wrote: --- Tumurbaatar S. [EMAIL PROTECTED] wrote: The scenario is: 1. Site administrator logs into his admin page and writes some message on a form. 2. After clicking submit the web script should broadcast this message to several hundred subscribers. If you want to send the message as email mail() is the only option. And I'm wonder how to implement this on PHP. Sending an email to each subscribers can take a much time and PHP will stop after max_execution_time. you can set max time by set_time_limit(), for disable time limit just use set_time_limit(0). BTW register_shutdown_function() can be helpfull in handling performance related doubts. zareef ahmed Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Zareef Ahmed :: A PHP Developer in Delhi ( India ). Homepage :: http://www.zasaifi.com/zareef_ahmed.php ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.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
Re: [PHP] SOMETIMES, my SID gets embedded in the URL ???
PHPDiscuss - PHP Newsgroups and mailing lists wrote: he problem is that SOMETIMES, my SID gets embedded in the URL, although at the begining of every page I have this code: ini_set(session.use_only_cookies, 1); The above sets sessionuse_only_cookies to 1. I did not miss a dot, session and use_only_cookies are interpreted as constants. You need quotes: ini_set('session.use_only_cookies', 1); session_set_cookie_params(60*60); session_start(); session_register(blabla); if (!$_SESSION[logged_in]) session_destroy(); etc, etc; So there are days/times when the SID isn't embedded in the URL (and in the links of the page), and days/times when it is, regardless of what value $_SESSION[logged_in] has. I tested the value returned by ini_set and it's always different from false. What gives ??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting rid of NOTICE
Roger Thomas wrote: I dont know how to explain this but when you work with an ldap attribute, they are case sensitive. jpegPhoto was what the schema was written with. However when you retrieve that into PHP, you accessed them with all lower case. So accessing userPassword attribute in ldap will become userpassword in PHP. Just to satisfy your curiosity, I have changed that to your advise with running the script produces identical result. You can either: 1. prepend @ in front of the variable, which supresses notices and warnings 2. use isset() or array_key_exists() to check for the existance of the key. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SOMETIMES, my SID gets embedded in the URL ???
Wow, thank you, it was so obvious! Marek Kilimajer wrote: PHPDiscuss - PHP Newsgroups and mailing lists wrote: he problem is that SOMETIMES, my SID gets embedded in the URL, although at the begining of every page I have this code: ini_set(session.use_only_cookies, 1); The above sets sessionuse_only_cookies to 1. I did not miss a dot, session and use_only_cookies are interpreted as constants. You need quotes: ini_set('session.use_only_cookies', 1); session_set_cookie_params(60*60); session_start(); session_register(blabla); if (!$_SESSION[logged_in]) session_destroy(); etc, etc; So there are days/times when the SID isn't embedded in the URL (and in the links of the page), and days/times when it is, regardless of what value $_SESSION[logged_in] has. I tested the value returned by ini_set and it's always different from false. What gives ??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting rid of NOTICE
Marek Kilimajer wrote: Roger Thomas wrote: I dont know how to explain this but when you work with an ldap attribute, they are case sensitive. jpegPhoto was what the schema was written with. However when you retrieve that into PHP, you accessed them with all lower case. So accessing userPassword attribute in ldap will become userpassword in PHP. Just to satisfy your curiosity, I have changed that to your advise with running the script produces identical result. You can either: 1. prepend @ in front of the variable, which supresses notices and warnings that's a very ugly use... If you're sure it'll throw a notice, then initialize the variable. If you're unsure about aby of your variables, and don't want to appear as if you were a clean coder, you can set error_reporting(E_ALL~E_NOTICE), which'll show E_ALL AND NOT E_NOTICE :) 2. use isset() or array_key_exists() to check for the existance of the key. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP5] How to knwo object class name in a function called statically
Frédéric hardy wrote: Hello - I have this code : abstract class foo { private __construct() {} public static getInstance() { static $instance = null; if (is_null($instance) == false) return $instance; else { $class = __CLASS__; return new $class(); } } } class extendedFoo extends foo { ... } $instance = extendedFoo::getInstance(); echo (get_class($instance)); My problem is that get_class($instance) return foo instead of extendedFoo !!! How to knwo the calling object type in a function called statically ? Reflection ? Other solution ??? Bug I can resolve my probleme with a extendedFoo::getInstance() function, and adding a parameter $class to foo::getInstance(), but i don't want duplicated code in all foo subclass... Fred - this is a completely expected result. What you're doing is: statically calling function a() which is defined in a PARENT class. Inside this parent class, the function calls __CLASS__, which is a magic constant, holding the name of the class it's in AT THAT MOMENT, and the class it IS in is the parent class!. There is no easy way to do what you ask for. If you were using non-static objects/functions, then you could use get_class($this), which would work just fine. However, when using it statically, $this does not exist... so... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP5] How to knwo object class name in a function called statically
M. Sokolewicz wrote: Frédéric hardy wrote: Hello - I have this code : abstract class foo { private __construct() {} public static getInstance() { static $instance = null; if (is_null($instance) == false) return $instance; else { $class = __CLASS__; return new $class(); } } } class extendedFoo extends foo { ... } $instance = extendedFoo::getInstance(); echo (get_class($instance)); My problem is that get_class($instance) return foo instead of extendedFoo !!! How to knwo the calling object type in a function called statically ? Reflection ? Other solution ??? Bug I can resolve my probleme with a extendedFoo::getInstance() function, and adding a parameter $class to foo::getInstance(), but i don't want duplicated code in all foo subclass... Fred - this is a completely expected result. What you're doing is: statically calling function a() which is defined in a PARENT class. Inside this parent class, the function calls __CLASS__, which is a magic constant, holding the name of the class it's in AT THAT MOMENT, and the class it IS in is the parent class!. There is no easy way to do what you ask for. If you were using non-static objects/functions, then you could use get_class($this), which would work just fine. However, when using it statically, $this does not exist... so... debug_backtrace()? Not really inteded for this purpose :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP5] How to knwo object class name in a function
Marek Kilimajer wrote: M. Sokolewicz wrote: Frédéric hardy wrote: Hello - I have this code : abstract class foo { private __construct() {} public static getInstance() { static $instance = null; if (is_null($instance) == false) return $instance; else { $class = __CLASS__; return new $class(); } } } class extendedFoo extends foo { ... } $instance = extendedFoo::getInstance(); echo (get_class($instance)); My problem is that get_class($instance) return foo instead of extendedFoo !!! How to knwo the calling object type in a function called statically ? Reflection ? Other solution ??? Bug I can resolve my probleme with a extendedFoo::getInstance() function, and adding a parameter $class to foo::getInstance(), but i don't want duplicated code in all foo subclass... Fred - this is a completely expected result. What you're doing is: statically calling function a() which is defined in a PARENT class. Inside this parent class, the function calls __CLASS__, which is a magic constant, holding the name of the class it's in AT THAT MOMENT, and the class it IS in is the parent class!. There is no easy way to do what you ask for. If you were using non-static objects/functions, then you could use get_class($this), which would work just fine. However, when using it statically, $this does not exist... so... debug_backtrace()? Not really inteded for this purpose :) that's a possibility... surely not the Reflection API though =/ it only works on static objects AFAIK (or new instances) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular Expression - highlighting
Hi Michael, Thanks very much for the assistance, I'll have to investigate further! Kind Regards, Aidan Lister Michael Sims [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Aidan Lister wrote: Hello list, I'm pretty terrible with regular expressions, I was wondering if someone would be able to help me with this http://paste.phpfi.com/31964 The problem is detailed in the above link. Basically I need to match the contents of any HTML tag, except a link. I'm pretty sure a lookbehind set is needed in the center (%s) bit. Any suggestions would be appreciated, but it's not quite as simple as it sounds - if possible please make sure you run the above script and see if it PASSED. So basically, you want to put a link around foo, only if it doesn't already have one, right? The problem with look-behind assertions is that they have to be fixed-width. If you're certain of what kind of data you're going to be dealing with then this may be sufficient. For example, I came up with a regex that will PASS your script but I doubt seriously that it'll be very useful to you as it would be easy to break it by coming up with various test cases. For your single test case, however, this works: /(?!a href=foo)(?!a href=)(foo)/ The problem is that HTML tags can be split across lines...they have have any variable amount of whitespace within the tag...they can have other attributes (class, id, onClick), etc. Since look behind assertions have to be fixed width it'd be impossible (IMHO) to come up with a single regex that would match all cases, unless the input data was uniform. For example, stuff like a href = foo ID=id1 class=redlink onClick=javascript:someFunction();foo/a and its infinite variants could not be trapped for with a single regex since you cannot have an infinite number of fixed width look-behind assertions. If quantifying modifiers such as '*', '+', and '?' were allowed in look-behind assertions it would be possible, but they aren't (see man perlre). If your data is coming from unknown sources you'll probably have to use a full fledged HTML parser to pull out text that isn't already part of an a tag. I know there are several of these available for perl and I'm sure there are for PHP too but I'm unaware of them. Sorry if this isn't terribly helpful. Maybe I'm overlooking something and someone else will point out a simple way to accomplish what you're trying to do... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Set up cron using PHP
Hello: We need to set up a cron to send an automated email at regular intervals. For this I need to execute a PHP file which retrieves the required information to be mailed. On my virtual server PHP is loaded as a module. Could you please let me know how can I execute a PHP file from the shell prompt. I have tried with the following commands: % virtual /usr/local/etc/httpd/htdocs/onlineeml.php It gives the below error: /usr/local/etc/httpd/htdocs/onlineeml.php: cannot open ?php: no such file I am not able to execute any general php related commands (Eg: php -v, man p ect)from the Shell prompt. I am getting the error message as php: Command not found.. I think this is because PHP is loaded as a module an not as a CGI version. In this context, could you please provide some details in executing a PHP script from the Shell prompt when the PHP is loaded as a module. Regards Sheni R Meledath Assistant Manager - Web Development * Cyber Gear LLC P.O. Box 53735 Dubai, United Arab Emirates Tel: (971 4) 331-2627, Fax: (971 4) 331-8812 Email: [EMAIL PROTECTED], http://www.cyber-gear.com VISIT OUR ASSOCIATE SITES: http://www.Click2Advertising.com http://www.DubaiCityGuide.com http://www.MiddleEastDirectory.com http://www.MiddleEastEvents.com http://www.MiddleEastPostBox.com http://www.PressReleaseNetwork.com * This message has been checked for all known viruses by McAfee. No liability is accepted by virtue of checking this message and you are recommended to have in place your own anti-virus detection procedures.
Re: [PHP] Set up cron using PHP
On Thursday 07 October 2004 13:17, Sheni R. Meledath wrote: Hello: We need to set up a cron to send an automated email at regular intervals. For this I need to execute a PHP file which retrieves the required information to be mailed. On my virtual server PHP is loaded as a module. Could you please let me know how can I execute a PHP file from the shell prompt. I have tried with the following commands: % virtual /usr/local/etc/httpd/htdocs/onlineeml.php It gives the below error: /usr/local/etc/httpd/htdocs/onlineeml.php: cannot open ?php: no such file just insert: #!/usr/bin/php -q in the first line of the script and make it executable (chmod u+x ). I am not able to execute any general php related commands (Eg: php -v, man p ect)from the Shell prompt. I am getting the error message as php: Command not found.. I think this is because PHP is loaded as a module an not as a CGI version. In this context, could you please provide some details in executing a PHP script from the Shell prompt when the PHP is loaded as a module. Regards Sheni R Meledath Assistant Manager - Web Development * Cyber Gear LLC P.O. Box 53735 Dubai, United Arab Emirates Tel: (971 4) 331-2627, Fax: (971 4) 331-8812 Email: [EMAIL PROTECTED], http://www.cyber-gear.com VISIT OUR ASSOCIATE SITES: http://www.Click2Advertising.com http://www.DubaiCityGuide.com http://www.MiddleEastDirectory.com http://www.MiddleEastEvents.com http://www.MiddleEastPostBox.com http://www.PressReleaseNetwork.com * This message has been checked for all known viruses by McAfee. No liability is accepted by virtue of checking this message and you are recommended to have in place your own anti-virus detection procedures. -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) - Orbitel - the New Generation Telecom! See www.orbitel.bg. pgpWoqTMFOpY5.pgp Description: signature
Re: [PHP] getting rid of NOTICE
On Thu, 7 Oct 2004 14:04:00 +0800, Roger Thomas [EMAIL PROTECTED] wrote: I have this short script (below) that does checking whether a userid has an associated jpegPhoto in an LDAP database. The script is working fine but gave a 'Notice' msg bcos I made error_reporting to report all errors. Notice: Undefined index: jpegphoto in test.php on line 34 Question: How do I make the Notice go away without changing error reporting to error_reporting (E_ALL ~E_NOTICE) ? [...] $photo = $resultEntries[0][jpegphoto]; It's complaining because you're trying to read from an array index that hasn't been set, Assuming this isn't a typo or something, if you want to avoid the notice you normally have two options: 1. initialise all the indexes that you plan to use. 2. check whether the index has been set before you try to read from it. In this case, you're pretty much stuck with the second option as you're getting the array from an external source. So do something like this: $photo = isset($resultEntries[0][jpegphoto]) ? $resultEntries[0][jpegphoto] : array('count' = 0); -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to implement mass emailing?
Well, you do have a number of options. First, as someone suggested, you can write a CLI script that doesn't depend on a web browser being connected to run. That's probably the best solution overall, because you have the most control over what happens. You can even trigger it indirectly through a call to a web page. If you want to run the script through the web, you can set_time_limit(0) to prevent your script from timing out and register_shutdown_function() to ensure that your script continues running even if the user terminates the connection from the browser. Because of this, though, you will also need a mechanism that makes it possible for the script to determine whether there is another instance of the script running, so that you can prevent an overanxious usre from refreshing your script multiple times because he can't tell that it's still sending out mail and hit your mailing list more than once. Finally, you will need a fast mailing mechanism. mail() is not your only option--you can interface directly with any mailer through SMTP or pipes, for example--but in my experience, you don't need to go any further to make things work properly. What you really need, is a fast MTA that is capable of queueing your messages and deliverying them efficiently, like qmail. If you want an easier way of composing e-mail programmatically, you may want to take a look at PHPMailer (http://phpmailer.sourceforge.net/), which can simplify things significantly and can also interface directly with a fast MTA like qmail. We use a combination of these techniques to send out tens of thousands of notifications once every month, and never had a problem with it. HTH, Marco Tabini -- php|architect The PHP Magazine for PHP Professionals http://www.phparch.com Tumurbaatar S. wrote: The scenario is: 1. Site administrator logs into his admin page and writes some message on a form. 2. After clicking submit the web script should broadcast this message to several hundred subscribers. And I'm wonder how to implement this on PHP. Sending an email to each subscribers can take a much time and PHP will stop after max_execution_time. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Set up cron using PHP
Petar Nedyalkov wrote: On Thursday 07 October 2004 13:17, Sheni R. Meledath wrote: Hello: We need to set up a cron to send an automated email at regular intervals. For this I need to execute a PHP file which retrieves the required information to be mailed. On my virtual server PHP is loaded as a module. Could you please let me know how can I execute a PHP file from the shell prompt. I have tried with the following commands: % virtual /usr/local/etc/httpd/htdocs/onlineeml.php It gives the below error: /usr/local/etc/httpd/htdocs/onlineeml.php: cannot open ?php: no such file just insert: #!/usr/bin/php -q in the first line of the script and make it executable (chmod u+x ). I am not able to execute any general php related commands (Eg: php -v, man p ect)from the Shell prompt. I am getting the error message as php: Command not found.. I think this is because PHP is loaded as a module an not as a CGI version. In this context, could you please provide some details in executing a PHP script from the Shell prompt when the PHP is loaded as a module. Regards Sheni R Meledath Assistant Manager - Web Development * Cyber Gear LLC P.O. Box 53735 Dubai, United Arab Emirates Tel: (971 4) 331-2627, Fax: (971 4) 331-8812 Email: [EMAIL PROTECTED], http://www.cyber-gear.com VISIT OUR ASSOCIATE SITES: http://www.Click2Advertising.com http://www.DubaiCityGuide.com http://www.MiddleEastDirectory.com http://www.MiddleEastEvents.com http://www.MiddleEastPostBox.com http://www.PressReleaseNetwork.com * This message has been checked for all known viruses by McAfee. No liability is accepted by virtue of checking this message and you are recommended to have in place your own anti-virus detection procedures. actually, that path you gave depends on the system (OS), the way it's installed and a whole bunch of other stuff. I agree it is the default, and most common, location though. A different way of executing such scripts is by adding a cronjob like * * * * * * /usr/bin/php -q /path/to/script This does exactly the same as what Petar said, except that the script is passed to the interpreter, and thus the user that the crondaemon runs the script as only needs read (and doesn't need execute) permission to the script. However; To find out the path to the interpreter, since you're saying you can't just call 'php -v' or any such commands, we'll need to investigate further. One way of doing this is a bit ugly, but it works. Instead of calling PHP directly, we'll call the server and request the php script (if you want, you can add tons of security shit in the call). We'll be doing this using wget (on Linux systems). Imagine you'd like to run the following script: ?php // (let's presume it's located in www.example.net/scripts/bin/mail.php) if($_GET['user'] == 'a' $_GET['pass'] == 'b') { mail('[EMAIL PROTECTED]', 'sub','body'); } else { header('Status: 404 Not Found'); exit; } ? You can call this as follows: * * * * * * wget http://www.example.net/scripts/bin/mail.php?user=apass=b ; rm -f ./mail.php The first part will call the server via an http connection to run the script and show its output. It then downloads it to the directory run from, and saves it. That is what wget does. The second part, after the semicolon, the 'rm -f ./mail.php' will make sure to get rid of the file after it's been run. I hope this small example, will help you ;) - Tul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pdf_open_pdi_page
Do you have a source for your assumption ? to use pdi you need PDFlib Personalization Server (PPS) http://www.pdflib.com/products/pdflib/pps.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Set up cron using PHP
On Thursday 07 October 2004 15:32, M. Sokolewicz wrote: Petar Nedyalkov wrote: On Thursday 07 October 2004 13:17, Sheni R. Meledath wrote: Hello: We need to set up a cron to send an automated email at regular intervals. For this I need to execute a PHP file which retrieves the required information to be mailed. On my virtual server PHP is loaded as a module. Could you please let me know how can I execute a PHP file from the shell prompt. I have tried with the following commands: % virtual /usr/local/etc/httpd/htdocs/onlineeml.php It gives the below error: /usr/local/etc/httpd/htdocs/onlineeml.php: cannot open ?php: no such file just insert: #!/usr/bin/php -q in the first line of the script and make it executable (chmod u+x ). I am not able to execute any general php related commands (Eg: php -v, man p ect)from the Shell prompt. I am getting the error message as php: Command not found.. I think this is because PHP is loaded as a module an not as a CGI version. In this context, could you please provide some details in executing a PHP script from the Shell prompt when the PHP is loaded as a module. Regards Sheni R Meledath Assistant Manager - Web Development * Cyber Gear LLC P.O. Box 53735 Dubai, United Arab Emirates Tel: (971 4) 331-2627, Fax: (971 4) 331-8812 Email: [EMAIL PROTECTED], http://www.cyber-gear.com VISIT OUR ASSOCIATE SITES: http://www.Click2Advertising.com http://www.DubaiCityGuide.com http://www.MiddleEastDirectory.com http://www.MiddleEastEvents.com http://www.MiddleEastPostBox.com http://www.PressReleaseNetwork.com * This message has been checked for all known viruses by McAfee. No liability is accepted by virtue of checking this message and you are recommended to have in place your own anti-virus detection procedures. actually, that path you gave depends on the system (OS), the way it's installed and a whole bunch of other stuff. I agree it is the default, and most common, location though. Yes, of course ;-) A different way of executing such scripts is by adding a cronjob like * * * * * * /usr/bin/php -q /path/to/script This does exactly the same as what Petar said, except that the script is passed to the interpreter, and thus the user that the crondaemon runs the script as only needs read (and doesn't need execute) permission to the script. Your way is better for cronjob use, mine is better if the user needs to deploy the script not only as a cronjob. However; To find out the path to the interpreter, since you're saying you can't just call 'php -v' or any such commands, we'll need to investigate further. One way of doing this is a bit ugly, but it works. Instead of calling PHP directly, we'll call the server and request the php script (if you want, you can add tons of security shit in the call). We'll be doing this using wget (on Linux systems). This workaround is fine, but I think using lynx or any similar browser can save the rm -f part. Imagine you'd like to run the following script: ?php // (let's presume it's located in www.example.net/scripts/bin/mail.php) if($_GET['user'] == 'a' $_GET['pass'] == 'b') { mail('[EMAIL PROTECTED]', 'sub','body'); } else { header('Status: 404 Not Found'); exit; } ? You can call this as follows: * * * * * * wget http://www.example.net/scripts/bin/mail.php?user=apass=b ; rm -f ./mail.php The first part will call the server via an http connection to run the script and show its output. It then downloads it to the directory run from, and saves it. That is what wget does. The second part, after the semicolon, the 'rm -f ./mail.php' will make sure to get rid of the file after it's been run. I hope this small example, will help you ;) - Tul -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) - Orbitel - the New Generation Telecom! See www.orbitel.bg. pgpDKmdSJSKAu.pgp Description: signature
[PHP] Muti-Dimensional Array Help Please
hello all, I have some text files in a directory that contain newline delimited IP addresses. Here is what i would like to do with them, and what i have achieved so far: I read the files into a multi-dimensional array like: (pseudo code) array(IP_blocks) = ( File_number[1] = array('ip1', 'ip2', 'ip3') File_number[2] = array('ip1', 'ip2', 'ip3') File_number[3] = array('ip1', 'ip2', 'ip3') ) the ip files have variable numbers of ips, some have 5 ips, some 40 etc.. What i want to do is to run a loop through the whole thing doing a task on each IP address. Easy so far right? - Well, where im stuck is that i want to operate on them like this: do_stuff(File_number[1][ip1]) do_stuff(File_number[2][ip1]) do_stuff(File_number[3][ip1]) do_stuff(File_number[1][ip2]) do_stuff(File_number[2][ip2]) do_stuff(File_number[3][ip2]) I cant even get that far LoL! but then there is the problem of what happens when there is no IP left in an array? (its a short file of ips..)? - I need to start that particular array back at the beggining but continue the cycle (it doesnt matter that an ip is worked on more than once..) Here is the *actual* code I have so far: ##CODE ?php /* * Open the proxies dir and read all of the * ips contained within each file into a mutidimensional * array ($machines) */ $dir = dir('proxies'); while(FALSE !== ($file = $dir-read())) { if($file != '.' $file != '..') { $machines[$file] = file($dir-path . '/' .$file); } } $dir-close(); foreach($machines as $machineId = $ips) { // do stuff here } ###END CODE Im not really expecting anyone to be able to do my work for me but some *guidance* regardig how to tackle this problem would be magnificent... Thankyou.. -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Set up cron using PHP
Petar Nedyalkov wrote: [snip] Your way is better for cronjob use, mine is better if the user needs to deploy the script not only as a cronjob. [/snip] I agree ;) [snip] This workaround is fine, but I think using lynx or any similar browser can save the rm -f part. [/snip]yes... but wouldn't you be stuck with a running shell-instance after this? never really tried... so I wouldn't know :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Muti-Dimensional Array Help Please
Nick Wilson wrote: hello all, I have some text files in a directory that contain newline delimited IP addresses. Here is what i would like to do with them, and what i have achieved so far: I read the files into a multi-dimensional array like: (pseudo code) array(IP_blocks) = ( File_number[1] = array('ip1', 'ip2', 'ip3') File_number[2] = array('ip1', 'ip2', 'ip3') File_number[3] = array('ip1', 'ip2', 'ip3') ) the ip files have variable numbers of ips, some have 5 ips, some 40 etc.. What i want to do is to run a loop through the whole thing doing a task on each IP address. Easy so far right? - Well, where im stuck is that i want to operate on them like this: do_stuff(File_number[1][ip1]) do_stuff(File_number[2][ip1]) do_stuff(File_number[3][ip1]) do_stuff(File_number[1][ip2]) do_stuff(File_number[2][ip2]) do_stuff(File_number[3][ip2]) I cant even get that far LoL! but then there is the problem of what happens when there is no IP left in an array? (its a short file of ips..)? - I need to start that particular array back at the beggining but continue the cycle (it doesnt matter that an ip is worked on more than once..) Here is the *actual* code I have so far: ##CODE ?php /* * Open the proxies dir and read all of the * ips contained within each file into a mutidimensional * array ($machines) */ $dir = dir('proxies'); while(FALSE !== ($file = $dir-read())) { if($file != '.' $file != '..') { $machines[$file] = file($dir-path . '/' .$file); } } $dir-close(); foreach($machines as $machineId = $ips) { // do stuff here } ###END CODE Im not really expecting anyone to be able to do my work for me but some *guidance* regardig how to tackle this problem would be magnificent... Thankyou.. if it doesn't matter in what order they are all processed, then you could so it like this: ?php foreach($machines as $machineId = $ips) { foreach($ips as $ip) { do_stuff($ip); } } ? However, if it does matter, then I suggest a different way. This would order them by their 2nd index, not the first (meaning by $machines[1][1], $machines[2][1], etc); ?php $max = 0; foreach($machines as $machineId = $ips) { $max = ($max = count($ips) ? $max : count($ips)); } for($i=0;$i$max;$i++) { foreach($machines as $machineId = $ips) { if(isset($ips[$i])) { do_stuff($ips[$i]); } else { continue; } } } ? but that's just my point of view ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to implement mass emailing?
Thank you, all! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Muti-Dimensional Array Help Please
-Original Message- From: Nick Wilson [mailto:[EMAIL PROTECTED] Sent: Thursday, October 07, 2004 6:40 AM To: php-general Subject: [PHP] Muti-Dimensional Array Help Please hello all, I have some text files in a directory that contain newline delimited IP addresses. Here is what i would like to do with them, and what i have achieved so far: I read the files into a multi-dimensional array like: (pseudo code) array(IP_blocks) = ( File_number[1] = array('ip1', 'ip2', 'ip3') File_number[2] = array('ip1', 'ip2', 'ip3') File_number[3] = array('ip1', 'ip2', 'ip3') ) the ip files have variable numbers of ips, some have 5 ips, some 40 etc.. What i want to do is to run a loop through the whole thing doing a task on each IP address. Easy so far right? - Well, where im stuck is that i want to operate on them like this: do_stuff(File_number[1][ip1]) do_stuff(File_number[2][ip1]) do_stuff(File_number[3][ip1]) do_stuff(File_number[1][ip2]) do_stuff(File_number[2][ip2]) do_stuff(File_number[3][ip2]) I cant even get that far LoL! but then there is the problem of what happens when there is no IP left in an array? (its a short file of ips..)? - I need to start that particular array back at the beggining but continue the cycle (it doesnt matter that an ip is worked on more than once..) Here is the *actual* code I have so far: ##CODE ?php /* * Open the proxies dir and read all of the * ips contained within each file into a mutidimensional * array ($machines) */ $dir = dir('proxies'); while(FALSE !== ($file = $dir-read())) { if($file != '.' $file != '..') { $machines[$file] = file($dir-path . '/' .$file); } } $dir-close(); foreach($machines as $machineId = $ips) { // do stuff here } ###END CODE Im not really expecting anyone to be able to do my work for me but some *guidance* regardig how to tackle this problem would be magnificent... It looks like you're hading in the right direction. You've grabbed an array of each file. Then cycle through that array and read data from each file. The fread function will allow you to pull data from each file line by line, so you can store each line in an array. Using your idea of pseudo-code: $data = array(); $i = 1; foreach ( file ) { $n = 1; fp = fopen while ($line = fread() ){ $data[$i][$n] = $line; } } foreach ($data as $key = $line ) { foreach ($line as $line_number = $ip) { // do stuff } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Muti-Dimensional Array Help Please
* and then M. Sokolewicz declared However, if it does matter, then I suggest a different way. This would Yes, it does matter, a *lot* ;-) I have to hit each machine in order, choosing an IP from that machine and using it do 'do_stuff()' order them by their 2nd index, not the first (meaning by $machines[1][1], $machines[2][1], etc); ?php $max = 0; foreach($machines as $machineId = $ips) { $max = ($max = count($ips) ? $max : count($ips)); } for($i=0;$i$max;$i++) { foreach($machines as $machineId = $ips) { if(isset($ips[$i])) { do_stuff($ips[$i]); } else { continue; } } } ? Would that work with what i said above? im afraid i've never got the hang of the ? operator and dont really understand your code, sorry... thanks very much.. -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Set up cron using PHP
On Thursday 07 October 2004 16:27, M. Sokolewicz wrote: Petar Nedyalkov wrote: [snip] Your way is better for cronjob use, mine is better if the user needs to deploy the script not only as a cronjob. [/snip] I agree ;) [snip] This workaround is fine, but I think using lynx or any similar browser can save the rm -f part. [/snip]yes... but wouldn't you be stuck with a running shell-instance after this? never really tried... so I wouldn't know :) Try lynx -source http://bu.orbitel.bg for instance. Then you can catch the output and analyze it - if the php sends an text exit status, that's fine. -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) - Orbitel - the New Generation Telecom! See www.orbitel.bg. pgpiCuAZqKAPQ.pgp Description: signature
[PHP] Page cannot be displayed after form submission
Hi all. I have a form that calls the same page whenever it is submitted. It does some error-checking to make sure that all the appropriate fields were filled in by the user. So, if there's an error, it stays on the same page and lets the user know what they need to fill in. However, I get `Page cannot be displayed` error if the page calls itself and has to reload some data but only in IE for Windows. If I hit the `Refresh` button, the page shows up and all the appropriate fields are filled in or not filled in with the specified error message. It does not give the `Page cannot be displayed` error in other browsers: Mozilla and Firefox for Windoze, Safari and IE for Mac. Despite the fact that IE for Windoze is immensely inferior, is there a reason/get-around for this happening? I can actually fix it to where it doesn't do it, but it's a hack. I have the form actually call a different page - but then that page just has an automatic redirect back to the original page. And all the information shows up correctly without the `Page cannot be displayed.` Thanks for staying in tuned this far. Anyone have any thoughts on why this is happening? Thanks in advance. ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Muti-Dimensional Array Help Please
Nick Wilson wrote: * and then M. Sokolewicz declared However, if it does matter, then I suggest a different way. This would Yes, it does matter, a *lot* ;-) I have to hit each machine in order, choosing an IP from that machine and using it do 'do_stuff()' order them by their 2nd index, not the first (meaning by $machines[1][1], $machines[2][1], etc); ?php $max = 0; foreach($machines as $machineId = $ips) { $max = ($max = count($ips) ? $max : count($ips)); } for($i=0;$i$max;$i++) { foreach($machines as $machineId = $ips) { if(isset($ips[$i])) { do_stuff($ips[$i]); } else { continue; } } } ? Would that work with what i said above? im afraid i've never got the hang of the ? operator and dont really understand your code, sorry... thanks very much.. $max = ($max = count($ips) ? $max : count($ips)); just means the following: if($max = count($ips) { $max = $max; } else { $max = count($ips); } :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Set up cron using PHP
/* sender: M. Sokolewicz date: Thu, Oct 07, 2004 at 02:32:17PM +0200 */ ... You can call this as follows: * * * * * * wget http://www.example.net/scripts/bin/mail.php?user=apass=b ; rm -f ./mail.php The first part will call the server via an http connection to run the script and show its output. It then downloads it to the directory run from, and saves it. That is what wget does. The second part, after the semicolon, the 'rm -f ./mail.php' will make sure to get rid of the file after it's been run. Very nice solution :) Just one observation: you can use the -O parameter of wget, and get rid of rm * * * * * * wget http://www.example.net/scripts/bin/mail.php?user=apass=b -O /dev/null Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Muti-Dimensional Array Help Please
* and then Ed Lazor declared It looks like you're hading in the right direction. You've grabbed an array of each file. Then cycle through that array and read data from each file. The fread function will allow you to pull data from each file line by line, so you can store each line in an array. Using your idea of pseudo-code: $data = array(); $i = 1; foreach ( file ) { $n = 1; fp = fopen while ($line = fread() ){ $data[$i][$n] = $line; } } foreach ($data as $key = $line ) { foreach ($line as $line_number = $ip) { // do stuff } } hehe, not sure i get it but im playing with it ;-) i need to see code in action for my head to understand it. I did have one rather good though though (i think): If i can create an array with all of the ips in order like this 123.123.123.1 // 1st IP from machine 1 123.123.123.2 // 1st IP from machine 2 123.123.123.3 // 1st IP from machine 3 123.123.123.4 // 2nd IP from machine 1 123.123.123.5 // 2nd IP from machine 2 123.123.123.4 // 2nd IP from machine 3 etc... then i would have *exactly* what the application needs. Does that make the problem any easier? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Muti-Dimensional Array Help Please
$max = ($max = count($ips) ? $max : count($ips)); if ($max = count($ips)) { $max = $max; } else { $max = count($ips); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] anonymous from address using mail()
Hi all, I'm using mail([EMAIL PROTECTED],$subject,$message,$mail_from); But i get an email with a from address as anonymous@myserver.com I want to show the from address to be like From : Sagar plzz help me out /sagar
[PHP] FW: PHP posting confirmation for denis.gerasimov@vekos.ru
Hello all, Sorry, that is wrong mailing list, but... :-) Can anybody hint me what is this anti-spam filter (see forwarded email below)? We all are to tired of spam, so that could be a very good solution. Is it vilter-spamd (see headers) or I am wrong? Thank you. Best regards, Denis Gerasimov Outsourcing Services Manager, VEKOS, Ltd. www.vekos.ru -Original Message- From: PHP Automoderator [mailto:[EMAIL PROTECTED] Sent: Thursday, October 07, 2004 12:24 PM To: [EMAIL PROTECTED] Subject: PHP posting confirmation for [EMAIL PROTECTED] This is an automatic reply to an email you sent to a PHP project mailing address protected by our 'self-moderation' system. To reduce the amount of spam received at these addresses, we require you to confirm that you're a real person before your email will be allowed through. All you have to do in order to have your original message sent is send an email to [EMAIL PROTECTED] with the following text (square brackets and all): [confirm: d4a6e9c33aa9023bea60b2f773879f74 [EMAIL PROTECTED] which you should be able to do simply by replying to this email. (Don't worry, any leading text added for quoting will simply be ignored.) After we have received your confirmation, [EMAIL PROTECTED] will be added to the list of pre-approved mail addresses for all of the PHP project mail addresses, your original message will be delivered, and future emails from that address will be delivered without delay automatically. You will not receive any confirmation of your confirmation -- your original message (and any other messages you have sent since then) will simply be sent to its original destination (possibly after a short delay). Sorry for the hassle, but the volume of unsolicited commercial email sent to these addresses has made this step necessary. --- Your original email is below. Return-Path: [EMAIL PROTECTED] Received: from ([195.161.208.130:2394]) by osu1.php.net (ecelerity 1.2.1) with SMTP id 3A/06-29438-76DF4614; Thu, 07 Oct 2004 01:25:12 -0700 Received: from setteh-mtc.relinfo.ru (setteh-mtc.relinfo.ru [195.161.211.134]) by aqua.relinfo.ru (8.12.11/8.12.11) with ESMTP id i978MmEH090641; Thu, 7 Oct 2004 12:22:48 +0400 (MSD) (envelope-from [EMAIL PROTECTED]) Received: from win2kprows03 ([195.161.219.41]) by setteh-mtc.relinfo.ru (8.12.8/8.12.8) with ESMTP id i978MWCE010717; Thu, 7 Oct 2004 12:22:34 +0400 Message-Id: [EMAIL PROTECTED] From: Denis Gerasimov [EMAIL PROTECTED] To: PEAR General ML [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Auth package bugs Date: Thu, 7 Oct 2004 12:22:18 +0400 Organization: VEKOS, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: AcSl/hWvZyzWzef1QLerJqydvBKvoQGRLu2g X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Spam-Checker: smtp-vilter X-SMTP-Vilter-Version: 1.1.4 X-SMTP-Vilter-Backend: vilter-spamd X-Spam-Score: -0.7 X-Spam-Threshold: 5.0 X-Spam-Probability: -0.1 Received-SPF: unknown (osu1.php.net: domain vekos.ru does not designate 195.161.208.130 as permitted sender) Delivered-To: [EMAIL PROTECTED] Hello all, I didn't see any reaction on my previous message so let me try again. I noticed some problems with PEAR Auth package. Here they are: 1. (See my email below). I still don't see any reaction. But that is obviously a bug. 2. I found a very troublesome problem with installation of Auth package on old PHP (4.3.3). (Newer PHP versions haven't this problem.) PEAR installer fails because of the file named .tmpusers (it has zero length - is this file really needed?). When I unzip the archive, add some characters to this file, delete appropriate md5 attribute in package XML and zip all this back - installation goes fine. What is working wrong: old PHP, PEAR installer, or that is a problem of Auth package? Best regards, Denis Gerasimov Outsourcing Services Manager, VEKOS, Ltd. www.vekos.ru -Original Message- From: Denis Gerasimov [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 29, 2004 12:27 PM To: PEAR General ML ([EMAIL PROTECTED]) Subject: Auth package bug or documentation issue? Hello all, I got a very strange behavior of getAuthData() method of Auth class. I tried to follow the example given here: http://pear.php.net/manual/en/package.authentication.auth-http.auth- http.example2.php but any kind of calls like $objAuth-getAuthData() or $objAuth-getAuthData('id') etc. returned no result (null value or empty array). Then I dug a little in the sources and found that there is an error in the example code, the line 'dbFields'=*,// enabling fetch for other db columns have to be 'db_fields' = '*' // enabling
Re: [PHP] Page cannot be displayed after form submission
Philip Thompson wrote: Hi all. I have a form that calls the same page whenever it is submitted. It does some error-checking to make sure that all the appropriate fields were filled in by the user. So, if there's an error, it stays on the same page and lets the user know what they need to fill in. However, I get `Page cannot be displayed` error if the page calls itself and has to reload some data but only in IE for Windows. If I hit the `Refresh` button, the page shows up and all the appropriate fields are filled in or not filled in with the specified error message. It does not give the `Page cannot be displayed` error in other browsers: Mozilla and Firefox for Windoze, Safari and IE for Mac. Despite the fact that IE for Windoze is immensely inferior, is there a reason/get-around for this happening? I can actually fix it to where it doesn't do it, but it's a hack. I have the form actually call a different page - but then that page just has an automatic redirect back to the original page. And all the information shows up correctly without the `Page cannot be displayed.` Thanks for staying in tuned this far. Anyone have any thoughts on why this is happening? https? sessions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pdf_open_pdi_page
Matt M. schrieb: Do you have a source for your assumption ? to use pdi you need PDFlib Personalization Server (PPS) http://www.pdflib.com/products/pdflib/pps.html I was on that page. There's nothing which comes close to your assumption. with best regards Hendrik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session_save_path
My virtual host eliminated the common session tmp folder which forces me to set up one in my area. I'm trying to come up with the best, considering: Custom php.ini; resisting because having to make certain it is always in sync with host's changes. Tried adding to htaccess: php_value session.save_path /www/u/username/htdoc/session Hoping it would override php.ini. Got a server error 500. Tried adding to a common functions file used by several pages: session_save_path /www/u/user/htdoc/session; and session_save_path $_SERVER['DOCUMENT_ROOT'] . /SESSION; Doesn't work, uses the path in php.ini; I'm guessing that session_save_path has to be declared on page using session stuff. That's a pain, if so. Haven't tried ini_set yet; is it a solution? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Referencing a constant class variable
A work around I've used in the past has been to use a keyed array such as: $MyEnums = array( is = This, at = That, er = Other ); Only problem is that the above doesn't address my need (which I included in a subsequent post and probably should have included in my initial post). In order to use the above, I'd have to add it to the global scope and I'm not too keen on that. I tried using define(), but that doesn't seem to like defining arrays as constants. It would just have been very nice if PHP4 could have allowed access to a class' member variable w/o the need for instantiating the class. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mcrypt install question
PHP is installed from rpm's. Is it possible to install mcrypt / libmcrypt from rpm and enable it in PHP without having to recompile? Thanks, Ed
Re: [PHP] session_save_path
Al wrote: Tried adding to htaccess: php_value session.save_path /www/u/username/htdoc/session Hoping it would override php.ini. Got a server error 500. Try putting quotes around the path and this should work, providing your ISP allows .htaccess files. I'm guessing that session_save_path has to be declared on page using session stuff. You can use session_save_path() to do this, but you'll need it in every script. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The 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] mcrypt install question
On Thu, 7 Oct 2004 08:37:19 -0700, Ed Lazor [EMAIL PROTECTED] wrote: PHP is installed from rpm's. Is it possible to install mcrypt / libmcrypt from rpm and enable it in PHP without having to recompile? I was able to gain this functionality with Suse 9.1. I don't know about other distros however. rpm -qa|grep mcrypt libmcrypt-2.5.7-121 php4-mcrypt-4.3.4-26 -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: displaying blob images from a mssql db
Most often, when people are storing an binary file in a db, they are storing the absolute path to the file on the file system instead. So it should be as simple as extracting the file path from the database, using the copy() function to copy that file from the original file path to a location somewhere under the public_html/www/inetpub directory so it's accessible to the web server (make sure the directory, such as images, has the proper write permissions so that the script can write a file into that directory) and then generate the img tag pointing to the new file location. -Original Message- From: blackwater dev [mailto:[EMAIL PROTECTED] Sent: Wed 10/6/2004 8:49 AM To: [EMAIL PROTECTED] Cc: Subject:displaying blob images from a mssql db Ok, I know images shouldn't be saved in the db but this isn't my db so I can't change that. Does anyone know of a good tutorial to show me how to grab these blog jpg's and display them in a browser? Thanks!
Re: [PHP] anonymous from address using mail()
On Thu, 7 Oct 2004 20:29:25 +0530, sagar [EMAIL PROTECTED] wrote: I'm using mail([EMAIL PROTECTED],$subject,$message,$mail_from); But i get an email with a from address as anonymous@myserver.com I want to show the from address to be like From : Sagar plzz help me out What is $mail_from defined as? It should be a From: header with the required \r\n at the end. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FW: PHP posting confirmation for denis.gerasimov@vekos.ru
On Thu, 7 Oct 2004 19:18:21 +0400, Denis Gerasimov [EMAIL PROTECTED] wrote: Can anybody hint me what is this anti-spam filter (see forwarded email below)? We all are to tired of spam, so that could be a very good solution. Is it vilter-spamd (see headers) or I am wrong? I never heard of vilter, but would recommend spamassassin. When ran as a daemon, it can be a very efficient spam filter, can be trained, and all that. http://spamassassin.apache.org/ -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] anonymous from address using mail()
$mail_from = From: Sagar; -Original Message- Hi all, I'm using mail([EMAIL PROTECTED],$subject,$message,$mail_from); But i get an email with a from address as anonymous@myserver.com I want to show the from address to be like From : Sagar plzz help me out /sagar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] session_save_path
Can you do an .htaccess solution? If so, you could probably just set session save path with PHP_VALUE in the .htaccess file -Original Message- From: Al [mailto:[EMAIL PROTECTED] Sent: Thursday, October 07, 2004 8:25 AM To: [EMAIL PROTECTED] Subject: [PHP] session_save_path My virtual host eliminated the common session tmp folder which forces me to set up one in my area. I'm trying to come up with the best, considering: Custom php.ini; resisting because having to make certain it is always in sync with host's changes. Tried adding to htaccess: php_value session.save_path /www/u/username/htdoc/session Hoping it would override php.ini. Got a server error 500. Tried adding to a common functions file used by several pages: session_save_path /www/u/user/htdoc/session; and session_save_path $_SERVER['DOCUMENT_ROOT'] . /SESSION; Doesn't work, uses the path in php.ini; I'm guessing that session_save_path has to be declared on page using session stuff. That's a pain, if so. Haven't tried ini_set yet; is it a solution? Thanks -- 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] pdf_open_pdi_page
I was on that page. There's nothing which comes close to your assumption. sorry, wrong link you dont need PDFlib+PDI. Is that the license that you have? here is an assumption. I assumed you would read the pdflib manual, did you see? Note All functions described in this section require PDFlib+PDI. The PDF import library (PDI) is not contained in PDFlib or PDFlib Lite. Although PDI is integrated in all precompiled editions of PDFlib, a license key for PDI (or PPS, which includes PDI) is required. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mcrypt install question
Did you install it and PHP automatically recognized things or did you have to enable something in php.ini and restart? I checked the php.ini file on the server and there's nothing mycrypt or crypt. -Original Message- On Thu, 7 Oct 2004 08:37:19 -0700, Ed Lazor [EMAIL PROTECTED] wrote: PHP is installed from rpm's. Is it possible to install mcrypt / libmcrypt from rpm and enable it in PHP without having to recompile? I was able to gain this functionality with Suse 9.1. I don't know about other distros however. rpm -qa|grep mcrypt libmcrypt-2.5.7-121 php4-mcrypt-4.3.4-26 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session_save_path
John Holmes wrote: Al wrote: Tried adding to htaccess: php_value session.save_path /www/u/username/htdoc/session Hoping it would override php.ini. Got a server error 500. Try putting quotes around the path and this should work, providing your ISP allows .htaccess files. I'm guessing that session_save_path has to be declared on page using session stuff. You can use session_save_path() to do this, but you'll need it in every script. My declaration is simply appended to the end of a htaccess that has been running for a year. Here it is exactly: php_value session.save_path /www/r/restonx/htdocs/sessions2 Also, tried it without the quotes. Also, echoed session.save_path() to make certain my path syntax was identical to the one in php.ini that works. Thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mcrypt install question
On Thu, 7 Oct 2004 09:10:22 -0700, Ed Lazor [EMAIL PROTECTED] wrote: Did you install it and PHP automatically recognized things or did you have to enable something in php.ini and restart? I checked the php.ini file on the server and there's nothing mycrypt or crypt. It appears to 'just work' as I have nothing in my php.ini about it either. My phpinfo() configuration block says --with-mcrypt however. I'm guessing if I hadn't added the php4-mcrypt rpm it would have just not loaded it. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with Array Sorting Please
Hi, If you scroll up the list you'll see another thread of mine, this is related. The reason for a new thread is that i've made a lot of progress but the old was getting really confusing.. Here's the scoop: I have an array like this: 123 = 1 // each value may have few or many duplicate values 321 = 1 543 = 2 432 = 2 // like here, more 2's than 1's see? 566 = 2 568 = 2 999 = 3 878 = 3 444 = 3 Now, the keys are not the issue. What i would really like, is for that array, to end up like this: 123 = 1 543 = 2 999 = 3 321 = 1 432 = 2 878 = 3 123 = 1 566 = 2 and so on... The important point here is that it does not matter if a key is repeated in the resultant array, in fact, that's *good* as long as it starts from the beggining again when there are no more values = (for example) '1' With me? If it helps to understand, each key is an IP address, each value a Machine number - my job is to never hit the same machine 2x in a row or the same IP 2x in a row, but to cycle through all the IP's on each Machine like the example resultant array. Phew... that was tough to explain, hope it's not a brain twister to understand ;-) Many, many thanks.. -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pdf_open_pdi_page
sorry, wrong link you dont need PDFlib+PDI. Is that the license that you have? I mean you do need -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session_save_path
Ed Lazor wrote: Can you do an .htaccess solution? If so, you could probably just set session save path with PHP_VALUE in the .htaccess file Note, from my original message: Tried adding to htaccess: php_value session.save_path /www/u/username/htdoc/session Hoping it would override php.ini. Got a server error 500. -Original Message- From: Al [mailto:[EMAIL PROTECTED] Sent: Thursday, October 07, 2004 8:25 AM To: [EMAIL PROTECTED] Subject: [PHP] session_save_path My virtual host eliminated the common session tmp folder which forces me to set up one in my area. I'm trying to come up with the best, considering: Custom php.ini; resisting because having to make certain it is always in sync with host's changes. Tried adding to htaccess: php_value session.save_path /www/u/username/htdoc/session Hoping it would override php.ini. Got a server error 500. Tried adding to a common functions file used by several pages: session_save_path /www/u/user/htdoc/session; and session_save_path $_SERVER['DOCUMENT_ROOT'] . /SESSION; Doesn't work, uses the path in php.ini; I'm guessing that session_save_path has to be declared on page using session stuff. That's a pain, if so. Haven't tried ini_set yet; is it a solution? Thanks -- 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] session_save_path
John Holmes wrote: Al wrote: Tried adding to htaccess: php_value session.save_path /www/u/username/htdoc/session Hoping it would override php.ini. Got a server error 500. Try putting quotes around the path and this should work, providing your ISP allows .htaccess files. I'm guessing that session_save_path has to be declared on page using session stuff. You can use session_save_path() to do this, but you'll need it in every script. Meant for this to reply to you: My declaration is simply appended to the end of a htaccess that has been running for a year. Here it is exactly: php_value session.save_path /www/r/restonx/htdocs/sessions2 Also, tried it without the quotes. Also, echoed session.save_path() to make certain my path syntax was identical to the one in php.ini that works. Thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] performance: large includes vs small includes with lots of reads
I'm trying to tweak my server a bit and wonder if it is better to have a large include file, say 20-40 kb with 15 user-defined functions, of which maybe 3 or 4 are used on any given page, or to have each function in it's own file and include (disk access/read) them only as needed. Is it faster/more efficient to read one large file or several smaller ones? It's a RS Linux server with a gig of memory. I'm also looking at PHP Accelerator and such. Do those store only in memory what the script needs, or does it include all that you require or include in, as well? Thanks, Hans -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular expression
How can I grap number written in specifec place in html I try this : preg_match_all(/ TR TD bgColor=#e4e4e4 PBtest:\/B\/P\/TD TD P(*[0-9])\/P\/TD\/TR TR/,$html,$match); its not work How can I do that -- Alawi Albaity Jeddah - KSA Mobile : +966506660442 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] performance: large includes vs small includes with lots of reads
On Thu, 7 Oct 2004 11:41:10 -0500 (CDT), Hans H. Anderson [EMAIL PROTECTED] wrote: I'm trying to tweak my server a bit and wonder if it is better to have a large include file, say 20-40 kb with 15 user-defined functions, of which maybe 3 or 4 are used on any given page, or to have each function in it's own file and include (disk access/read) them only as needed. Is it faster/more efficient to read one large file or several smaller ones? It's a RS Linux server with a gig of memory. I'm also looking at PHP Accelerator and such. Do those store only in memory what the script needs, or does it include all that you require or include in, as well? With sufficient ram, the OS will likely cache a lot of the file reads anyway, so with files that small it shouldn't make a whole lot of difference. But like I always say, the best way to know is to try it both ways and benchmark it. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Interrupting instantiation
In PHP4, is there any way to interrupt instantiation of an object? For example, by returning NULL as the return value of the class constructor so that the variable you are assinging the object to is, instead, null? Here's what I'm trying to do: class MyClass { function MyClass() { return NULL; } } $myVar = new MyClass(); echo 'IsObject? [' . is_object( $myVar ) . ']br'; I would expect $myVar to be a NULL value. Or at least, not an object of MyClass. But it is an object of MyClass. So is there any way to interrupt the instantiation? So that, if there is an error during the execution of the constructor, an object isn't returned? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Send files before the php script executes
Hi, Anybody knows if is posible in Linux with PHP to do upload of several files sending the data before that php script executes. Now in my server you do the upload (with html,form, multipart ...) and first all the files are upload and them the php script is executed. The idea is the next: In the server in my php script I want to proccess each file separated because if the conexion is lost the user don't have to send all the files again , only have to send the files that haven't been uploaded and proccessed. It seems hard. Thanks in advance. ;-) Ruben Alutiz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to implement mass emailing?
Hello, On 10/07/2004 02:45 AM, Tumurbaatar S. wrote: The scenario is: 1. Site administrator logs into his admin page and writes some message on a form. 2. After clicking submit the web script should broadcast this message to several hundred subscribers. And I'm wonder how to implement this on PHP. Sending an email to each subscribers can take a much time and PHP will stop after max_execution_time. Any ideas? You need to call set_time_limit(0); to let the script run for as long as needed. As for minimizing the delivery time of messages to many recipients, you may want to try this class that provides several means to optimize bulk mailing campaigns. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expression
Alawi, You should get some sort of nothing to repeat error. Try moving the * to a + and putting it after the [0-9]. I'm not sure that the * is picking up anything, because it's not preceded by anything. It could be that your $html doesn't match quite right, too (tabs and newlines differ from $html to the regular expression). So I tried this with success: $html =EOB TRTD bgColor=#e4e4e4PBtest:/B/P/TD TDP98938/P/TD/TRTR EOB; preg_match_all(/TRTD bgColor=#e4e4e4PBtest:\/B\/P\/TD TDP([0-9]*)\/P\/TD\/TRTR/,$html,$match); print_r($match); Hans On Thu, 7 Oct 2004, Alawi Albaity wrote: How can I grap number written in specifec place in html I try this : preg_match_all(/ TR TD bgColor=#e4e4e4 PBtest:\/B\/P\/TD TD P(*[0-9])\/P\/TD\/TR TR/,$html,$match); its not work How can I do that -- Alawi Albaity Jeddah - KSA Mobile : +966506660442 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to implement mass emailing?
Hello, On 10/07/2004 09:24 AM, Marco Tabini wrote: Finally, you will need a fast mailing mechanism. mail() is not your only option--you can interface directly with any mailer through SMTP or pipes, for example--but in my experience, you don't need to go any further to make things work properly. What you really need, is a fast This is a common misconception. It seems that most people confuse queueing with deliverying. Queuing via SMTP is a much slower method than queuing messages directly to the local mailer. The TCP communication overhead is much higher than sending data via pipes or just dropping messages in the local mailer queue. When you run a bulk mail campaign it does not matter how fast the local MTA can send messages to the remote recipients because often the messages are just dropped in the local queue a delivered later. What matters is how long does it take to inject a message in the local queue so your bulk mail script can run faster. Some people think that queueing via Sendmail is slower than via SMTP because their Sendmail installation is configured to attempt to deliver the messages immediately and that can take too long. The solution is not using SMTP. The solution is to configure sendmail to just queue the messages so its queue manager can deliver them later and your PHP bulk mail script can run much faster. Nowadays even queueing with Windows 2000 or later using IIS or Exchange mail servers is even faster than doing it with sendmail/qmail/etc.. because it allows drop mail messages in a special folder for later pickup and your PHP script can run much faster the bulk mail campaigns because all it is needed is to write queued messages files, so no pipes needed to be opened. All these mail queueing optimization tricks and a few other have been implemented in this class that can be used to take advantage of this knowledge on how to queue bulk mail messages the fastest way possible depending on your preferred delivery method: mail, sendmail/exim/postfix, qmail, SMTP, windows pickup, etc... http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session_save_path
For all you're talking about, It looks like your hosting provider is running PHPsuExec. So, PHP is now running as CGI and .htaccess does not work anymore to setup PHP values or flags (Will fire a 500 internal server error). Instead, you have to use a custom php.ini fle. (just write in this custom php.ini the values you need to change). I don't know where you should place the custom php.ini file, but sure your hosting provider will tell you where -or try with phpinfo()-. Also, keep in mind that PHP does not run anymore as nobody nor apache. Normally in shared hosting will use your own hosting account. Hope this helps a bit, Jordi. On Thu, 07 Oct 2004 11:25:25 -0400, Al [EMAIL PROTECTED] wrote: My virtual host eliminated the common session tmp folder which forces me to set up one in my area. I'm trying to come up with the best, considering: Custom php.ini; resisting because having to make certain it is always in sync with host's changes. Tried adding to htaccess: php_value session.save_path /www/u/username/htdoc/session Hoping it would override php.ini. Got a server error 500. Tried adding to a common functions file used by several pages: session_save_path /www/u/user/htdoc/session; and session_save_path $_SERVER['DOCUMENT_ROOT'] . /SESSION; Doesn't work, uses the path in php.ini; I'm guessing that session_save_path has to be declared on page using session stuff. That's a pain, if so. Haven't tried ini_set yet; is it a solution? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with a while loop
I am having a problem with a while loop if I put in a number with 0's in front of it it converts the number two the first whole number. such as 1 would be 1 02200 would be 2200. Then it starts the count down starting with that number. How can I make it not remove the 0's in front of the number these are needed to search a certain database . The following script would look like this when run 1 2 3 4 I needed it to look like this 1 2 3 ?php $startnumber=1; $stopnumber=02200; $i = $startnumber; echo $i; while ($i = $stopnumber): echo br ; echo $i; ++$i; endwhile; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] code not working...help?
Hi guys im pretty new at this and cant seem to get this going I want the code to query the database for the number of messages posted within the last month this is the code i have but its not working... I might even have it all wrong, can someone point me in the right direction? $lastmonth = date(YmdHis, mktime(date(H), date(i), date(s), date(m)-1, date(d), date(Y))); $countResult = db_query(SELECT count(*) AS msgCount FROM messages WHERE uid = '. $userID .' AND fid = '. $fid .' AND post_date = '. $lastmonth .'); $countRow = db_fetch_array($countResult); im then using $countRow as my variable but it keeps returning a value of zero. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Interrupting instantiation
Chris Boget wrote: In PHP4, is there any way to interrupt instantiation of an object? class Test { function Test() { $this = NULL; // Object destroyed by php gc } } $hello = new Test; // $hello = NULL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $HTTP_POST_VARS
Dears,I need to my program is waitting while $HTTP_POST_VARS change Please guide me.. = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Send files before the php script executes
On 7 Oct 2004 09:17:26 -0700, Ruben Duarte [EMAIL PROTECTED] wrote: Anybody knows if is posible in Linux with PHP to do upload of several files sending the data before that php script executes. Now in my server you do the upload (with html,form, multipart ...) and first all the files are upload and them the php script is executed. The idea is the next: In the server in my php script I want to proccess each file separated because if the conexion is lost the user don't have to send all the files again , only have to send the files that haven't been uploaded and proccessed. You just have to make the file field names arrays: form enctype=multipart/form-data action=_URL_ method=post input type=file name=uploaded_files[] input type=file name=uploaded_files[] input type=file name=uploaded_files[] input type=submit name=submit value=Submit /form Then all the regular image processing code you find here: http://www.php.net/manual/en/features.file-upload.php will still apply, just to the array of files, instead of to a single file. You will find print_r($_POST) very helpful when you can't figure something out with form submissions. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with a while loop
The following script would look like this when run 1 2 3 4 I needed it to look like this 1 2 3 You're going to want to use printf or sprintf to format the numbers. example: printf( %05d, $i ); this would print out your number, then left fill it will the zeros you want. -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How to implement mass emailing?
On Thu, 07 Oct 2004 14:03:34 -0300, Manuel Lemos [EMAIL PROTECTED] wrote: You need to call set_time_limit(0); to let the script run for as long as needed. I found ignore_user_abort() to be very helpful with mail scripts as well, especially if someone else will doing the mailing, or a shell environment is not available. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expression
On Thu, 7 Oct 2004 12:12:10 -0500 (CDT), Hans H. Anderson [EMAIL PROTECTED] wrote: It could be that your $html doesn't match quite right, too (tabs and newlines differ from $html to the regular expression). So I tried this with success: The 's' modifier will assist with matching across newlines: http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] general research question (maybe a little OT, sorry)
Hi List, My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. Can anyone point me to resources about versioning and inherent strengths and reliability of PHP? Thanks. -dg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with Array Sorting Please
I have an array like this: 123 = 1 // each value may have few or many duplicate values 321 = 1 543 = 2 432 = 2 // like here, more 2's than 1's see? 566 = 2 568 = 2 999 = 3 878 = 3 444 = 3 Now, the keys are not the issue. What i would really like, is for that array, to end up like this: 123 = 1 543 = 2 999 = 3 321 = 1 432 = 2 878 = 3 123 = 1 566 = 2 and so on... I didn't see your other thread, but, would sort() help you? www.php.net/sort -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question (maybe a little OT, sorry)
Hi List, My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. Can anyone point me to resources about versioning and inherent strengths and reliability of PHP? Thanks. -dg A quick Google search for your PHB: http://news.com.com/2100-1023-963937.html?tag=lh The following sites have been known to use PHP: www.sourceforge.net (30 millions pv/month) www.audiogalaxy.com (Napster follow-up, dozens of millions per/month) http://livebid.amazon.com (a part of Amazon.com, bet has a good traffic) http://mp3.lycos.com (One of the largest MP3 search engines in the world by Lycos. Their traffic but must be measured in several dozens of millions pv/mon) http://xoom.com (a huge online multi-service site. the #1 competitor to GeoCities) www.capitalone.com (well known credit card company) www.ecrush.com (14 million hits a month on avg) www.bangable.com (4 million page views a month. All PHP/mySQL) www.amdmb.com (uses MySQL and PHP for everything. 5 million pages/mon) www.insight.com (is a publicly traded fortune 1000 company. The site is 90% PHP) www.ig.com.br (the 3rd largest Brazilian portal) www.goeureka.com.au/super.php (AltaVista in Australia) www.kinderstart.com (Major children's portal. PHP and mySQL and some Perl.) www.marketplayer.com (provides the real-time stock market simulations for sites like etrade.com and smartmoney.com that have these games) www.dc.com (Deloitte Consulting) www.dialpad.com (user registration and member backend is PHP driven) www.thewb.com (uses PHP for the interactive areas such as message boards, polls, etc.) also: www.nbci.com www.sprint.ca www.ElectronicArts.com www.f2s.com www.indy500.com www.planetsourceocde.com www.easydns.com www.admworld.com www.communityconnect.com www.viant.com www.chek.com www.yahoo.com Yes, Google uses PHP at least in few pages. http://toolbar.google.com/whatsnew.php3 http://toolbar.google.com/failed.php And guess what! The guy who wrote PHP, Rasmus Lerdorf, works at Yahoo! http://lerdorf.com/resume/ An article about the PHP scalability myth: http://www.onjava.com/pub/a/onjava/2003/10/15/php_scalability.html Anything else? :) -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question (maybe a little OT, sorry)
Hi List, My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. Can anyone point me to resources about versioning and inherent strengths and reliability of PHP? Thanks. -dg A quick Google search for your PHB: snip I guess I should have been more clear. I didn't list resources for what you were asking but mearly showing that major websites/companies do rely on using PHP. Does your PHB consider the list I provided hobbyists? -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question (maybe a little OT, sorry)
On Thu, 7 Oct 2004 11:44:32 -0700, lists [EMAIL PROTECTED] wrote: My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. Well, I can't dispute a person's opinion as far the hobby thing goes, since that's how I started with PHP. But now, years later, I look back and there sure are a lot of us using it, hobby or not: http://www.php.net/usage.php I will add that I've been feeding my family with my PHP skills for several years now. Can anyone point me to resources about versioning and inherent strengths and reliability of PHP? PHP strives to remain backwards compatible except in the most extreme cases, and only has compatibility breakages across major revisions. I know this from experience but I'm sure there are some docs to prove it as well. One of PHP's inherent strengths is it's super-low (easy) learning curve. You can be writing complex scripts in as little as a few days, possibly less if you're already a programmer in some other language like Java or Perl or C++. Another strength is the PHP manual. In my opinion no one scripting language on the planet has an online manual as good as PHP has. I can't begin tell you how many times I've copied and pasted code straight out of the manual to get the job done fast and efficiently. And last but not least, look where you are. You asked for help and you are getting help, fast and with no $'s required. Enjoy. :) Microsoft is very yucky in my opinion. I'll save that soap box for another day. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question (maybe a little OT, sorry)
My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. :) real sites use iis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Problem with a while loop
Hello djoseph, Thursday, October 7, 2004, 11:34:22 AM, you wrote: The following script would look like this when run 1 2 3 4 I needed it to look like this 1 2 3 dtrc You're going to want to use printf or sprintf to format the numbers. dtrc example: printf( %05d, $i ); dtrc this would print out your number, then left fill it will the zeros you want. dtrc -Dan Joseph This is the actual script I need it to work in. I still am not sure how I would use printf or sprintf I don't want to pad the numbers I need the loop to leave the number alone. The startnumber and stopnumber will always change. some times they will start with a whole number and sometimes they will start with just one 0. As you can see with this range of number it starts with 1 it needs to add 1 to that number to make it 2 when it gets into the 100 it needs to look like this 00100. $startnumber=1; $stopnumber=02200; while ($i = $stopnumber): echo $i; echo div align='center'strong$i/strong/div; echo br; flush(); // get a web page into an array and print it out $fcontents = file (http://sos.state.nv.us/corp_nme.asp?corpnum=X$year; . $i . 0); while (list ($line_num, $line) = each ($fcontents)) { if ($line_num==40){ $f=strip_tags($line); echo $f; ..other code ++$i; endwhile; -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question (maybe a little OT, sorry)
lists wrote: Hi List, My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. Can anyone point me to resources about versioning and inherent strengths and reliability of PHP? Thanks. -dg http://www.oracle.com/technology/pub/articles/hull_asp.html http://php.weblogs.com/php_vs_asp http://marty.anstey.ca/programming/php_asp.html As far as 'hobbyists'...well, that's a lack of an educated opinion (or someone who is either a MS sheep, or locked in via MS licenses). My 'hobby' pays me quite well. Tell your boss to pay attention to some of the 'hobbyists' using php the next time he's surfing the web. Or maybe pay attention to .NET items such as this (out of the hundreds of items like this)... http://news.netcraft.com/archives/2004/10/07/aspnet_security_flaw_can_bypass_password.html -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question (maybe a little OT, sorry)
Matthew Sims wrote: snip The following sites have been known to use PHP: snip www.insight.com (is a publicly traded fortune 1000 company. The site is 90% PHP) snip Insight now uses CF. It was a political change, not one agreed on by the techies. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question (maybe a little OT, sorry)
lists wrote: Hi List, My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. Can anyone point me to resources about versioning and inherent strengths and reliability of PHP? Thanks. -dg http://www.oracle.com/technology/pub/articles/hull_asp.html http://php.weblogs.com/php_vs_asp http://marty.anstey.ca/programming/php_asp.html As far as 'hobbyists'...well, that's a lack of an educated opinion (or someone who is either a MS sheep, or locked in via MS licenses). My 'hobby' pays me quite well. Tell your boss to pay attention to some of the 'hobbyists' using php the next time he's surfing the web. Or maybe pay attention to .NET items such as this (out of the hundreds of items like this)... http://news.netcraft.com/archives/2004/10/07/aspnet_security_flaw_can_bypass_password.html -- John C. Nichel Netcraft is a great resource tool. If you boss is so in love with Windows, why not PHP on Windows? http://news.netcraft.com/archives/2003/08/30/php_growing_surprisingly_strongly_on_windows.html -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question (maybe a little OT, sorry)
Oh please. Not even as a joke. On 7 Oct 2004, at 21:07, Matt M. wrote: My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. :) real sites use iis -- 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] general research question (maybe a little OT, sorry)
On Thu, 07 Oct 2004 15:16:51 -0400, John Nichel [EMAIL PROTECTED] wrote: Insight now uses CF. It was a political change, not one agreed on by the techies. I don't know much about CF at all. Was it because of the shopping cart capabilities of CF? I read somewhere that was a top reason to use it and am curious to hear it from an actual developer. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question (maybe a little OT, sorry)
Matthew Sims wrote: snip The following sites have been known to use PHP: snip www.insight.com (is a publicly traded fortune 1000 company. The site is 90% PHP) snip Insight now uses CF. It was a political change, not one agreed on by the techies. -- John C. Nichel The list is probably a little out-of-date. Most likely, some sites have switched while at the same time new sites have been added. But you can't help miss the heavy hitters in the list: Yahoo Google Electronic Arts -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question (maybe a little OT, sorry)
-- Original message from Matthew Sims : -- www.thewb.com (uses PHP for the interactive areas such as message boards, polls, etc.) Up until September 2003 I was the developer for PHP applications for this site. To the best of my knowledge the message board is the only thing using PHP. Prior to the AOL/Time Warner merger the majority of interective content on the site was driven by PHP. But after the merger all developement started migrating to Vignette, I would estimate this was around 2001 or 2002. Occassionally if they needed quick turn around time a poll or sweepstakes would be done in PHP. The same holds true for kidswb.com. My knowledge is a little over a year old, but when I left my former position there was very little WB development being done in PHP. I went from spending 30+ hours a week doing it to well under 5. This was slightly off topic, but I would not use this site as an example of something that has a lot of php driven content. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] general research question (maybe a little OT, sorry)
Once heard someone say the same about wiki sites. 8-) Warren Vail -Original Message- From: lists [mailto:[EMAIL PROTECTED] Sent: Thursday, October 07, 2004 11:45 AM To: [EMAIL PROTECTED] Subject: [PHP] general research question (maybe a little OT, sorry) Hi List, My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. Can anyone point me to resources about versioning and inherent strengths and reliability of PHP? Thanks. -dg -- 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] general research question (maybe a little OT, sorry)
Greg Donald wrote: On Thu, 07 Oct 2004 15:16:51 -0400, John Nichel [EMAIL PROTECTED] wrote: Insight now uses CF. It was a political change, not one agreed on by the techies. I don't know much about CF at all. Was it because of the shopping cart capabilities of CF? I read somewhere that was a top reason to use it and am curious to hear it from an actual developer. I've never used it myself, and left Insight before the transformation was complete. We had built our own shopping cart system at Insight in PHP, and all was great with that. There was a VP there, in charge of the web marketing department who was in love with CF because he could point and click stuff (Steff from UF ;) I still talk to a few people that still work there, and according to them, a 'power struggle' in the different web departments left this marketing VP in charge of the whole ball of wax...now three years of work is gone (it wasn't just the php to go, custom C and Java API's, MySQL and Oracle, etc.) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PEAR] $HTTP_POST_VARS
On Thu, 7 Oct 2004 11:19:23 -0700 (PDT), Pahlevanzadeh Mohsen [EMAIL PROTECTED] wrote: Dears,I need to my program is waitting while $HTTP_POST_VARS change Please guide me.. Sorry, that question doesn't make any sense. The POST vars only change during a script run if your script changes them. Also, you should be using the $_POST superglobal unstead of $HTTP_POST_VARS. Please try to rephrase your question. -- paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question (maybe a little OT, sorry)
Hi List, My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. Can anyone point me to resources about versioning and inherent strengths and reliability of PHP? Thanks. -dg How much does a Sharepoint license cost? How much does PHP cost? How much does Sharepoint support cost? How much does PHP support cost? Most of the time, the reason why managers like to go to Microsoft is that in the event of something going wrong, they have someone to complain to (aka Microsoft). Not many managers think a mailing list is a professional medium to get answers or results. Even though we rarely *coughcough* have to say RTFM around here, we do so because the answers are available to the lazy if they would just take a moment to READ. Managers don't want to read, they want someone to hold their hand. -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question(thanks!)
Thanks for all the great replies. I will have fun preparing this particular report. -dg On Oct 7, 2004, at 1:00 PM, Matthew Sims wrote: Hi List, My boss recently called PHP good for hobbyists but REAL sites have to be done with Microsoft technologies. He wants to use Sharepoint for a wiki type site because of versioning. Can anyone point me to resources about versioning and inherent strengths and reliability of PHP? Thanks. -dg How much does a Sharepoint license cost? How much does PHP cost? How much does Sharepoint support cost? How much does PHP support cost? Most of the time, the reason why managers like to go to Microsoft is that in the event of something going wrong, they have someone to complain to (aka Microsoft). Not many managers think a mailing list is a professional medium to get answers or results. Even though we rarely *coughcough* have to say RTFM around here, we do so because the answers are available to the lazy if they would just take a moment to READ. Managers don't want to read, they want someone to hold their hand. -- --Matthew Sims --http://killermookie.org -- 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: [PEAR] $HTTP_POST_VARS
On Thu, 2004-10-07 at 15:50, Justin Patrin wrote: Sorry, that question doesn't make any sense. The POST vars only change during a script run if your script changes them. Also, you should be using the $_POST superglobal unstead of $HTTP_POST_VARS. Please try to rephrase your question. Just a comment.. you should only be using $_POST where your scripts don't need to be backwards compatible with previous versions of PHP in which $_POST is not supported. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with a while loop
Richard Kurth wrote: I am having a problem with a while loop if I put in a number with 0's in front of it it converts the number two the first whole number. such as 1 would be 1 02200 would be 2200. Then it starts the count down starting with that number. How can I make it not remove the 0's in front of the number these are needed to search a certain database . The following script would look like this when run 1 2 3 4 I needed it to look like this 1 2 3 ?php $startnumber=1; $stopnumber=02200; $i = $startnumber; echo $i; while ($i = $stopnumber): echo br ; echo $i; ++$i; endwhile; ? Here's the problem. You set the number originally as a string. However, as soon as you tell PHP to add the number, it becomes an integer. It must. You can't add strings. If you need to use the number as a string inside the loop, you will have to convert it back to a string. You can do this with sprintf, as in: $str_num = sprintf(%05.0f,$i); You can use var_dump($varname) to see what kind of data is stored in $varname. Janet -- Janet Valade -- janet.valade.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] general research question(thanks!)
Thanks for all the great replies. I will have fun preparing this particular report. -dg It can be difficult to show support for Open Source software when up against proprietary software when proprietary has the backing of money to offer assistance. With Open Source, when something goes wrong, YOU get the blame. With proprietary, the software company gets the blame. The company I work for is branched off into several data centers. Luckily, the data center I work at is very open minded with open source software and I take advantage of it greatly. It's served my center in many ways. Yet, the company as a whole is still very Microsoft-centric, even going as far to say that the only IM client you're allowed to use is Microsoft's with their main intranet website requiring IE only. Yet we're having budget cuts for 2005. It kinda makes me sick to think what money could be saved if we switched some of strategies to free software. The knowledge base and know-how is there with us techs, it's just the upper management that's out of the loop. Anyways, ending my slightly OT rant and going back to PHP, my only guess as to how to speak with your boss is to show the similarities between Sharepoint and PHP rather than showing what Sharepoint can't do. That would put your boss on the defensive and make him/her resent you. Then after you show the similarities, show the costs/savings of Sharepoint/PHP. Does that make sense? -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php