Re: [PHP] https question
On Wed, Sep 25, 2013 at 1:55 PM, Tedd Sperling t...@sperling.com wrote: Hi gang: I have a client who had his entire site moved to another host -- no big problem. However, the old site had a https directory, where I had secure scripts to do credit-card transactions, but the new site doesn't have a https directory -- in fact it doesn't even have a http directory at all. So, what options do I have to do secure transactions? I remember someone saying that this could be done via a .htaccess file, but I don't have the code, nor am I positive this is the answer. What do you recommend? Sounds like it may have been moved from a Plesk server to a non-Plesk server (or something using a similar path setup). If it's still Apache-based, yes, an .htaccess mod_rewrite directive should suffice. And, while it's out-of-scope for this list, an example, for posterity: # .htaccess - placed in the web root RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [QSA,R,L] -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 12:51 PM, Tedd Sperling t...@sperling.com wrote: Hi gang: Do you use a Mousepad? I'm in my mid-thirties and - despite having an optical mouse - I do indeed still use a mousepad. A customized one that the wife did for me for Christmas one year: images of Futurama, the Cleveland Browns, Minnesota Vikings, and several aircraft, all surrounding a picture of her and our daughter. I've found that shiny surfaces - such as my desk - reflect too much of the laser, causing the mouse to be far less responsive. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 1:20 PM, Jen Rasmussen j...@cetaceasound.com wrote: LOL. What in the heck is a Bag Bomb? He's referring to Bag Balm. http://www.bagbalm.com/ -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resolving a PHP Notice Error
On Tue, Sep 17, 2013 at 3:38 PM, Ron Piggott ron.pigg...@actsministries.org wrote: I am wanting to establish a default sort by preference when the user hasn’t specified one. I setup to test this with: ?php if ( !is_set( $sort_by_preference ) ) { Did you create a function is_set(), or did you mean to use the construct isset()? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Off the wall - sub-domain question
On Wed, Aug 21, 2013 at 5:16 PM, Jim Giner jim.gi...@albanyhandball.com wrote: I have a main domain (of course) and a sub domain. I'm really trying to steer my personal stuff away from the main one and have focused all of my php development to the sub-domain. Lately I noticed that google catalogs my sub-domain site stuff under the main domain name and the links that come up lead to that domain name with the path that takes the user to the sub-domain's home folder and beyond. Is there something that php (apache??) can do to control either google's robots or the user's view (url) so that it appears as a page of my sub-domain? I'm really new at this stuff and know nothing. I'm lucky that google is even finding my site! You'd probably want to do some 301 redirects with mod_rewrite to force the domain over to the subdomain if under that directory. In so doing, Google (and other search engines) will drop the /subdomain folder, and index only the destination. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Permissions
On Tue, Aug 27, 2013 at 3:07 AM, David Robley robl...@zoho.com wrote: I beg to differ here. If the x bit isn't set on a directory, that will prevent scanning of the directory; in this case apache will be prevented from scanning the directory and will return a 403. Well, that's partially correct. If a directory is owned by someone other than the current user (for example, root) and is 0776, you can list the directory content from outside of the directory to get a basic file listing. What you won't get by doing that, however, is anything other than the file name and type, because the kernel is forbidden from executing mtime, ctime, and owner/group queries on the files. In addition, you won't be able to enter the directory (cd). That said, if Ethan is running his Apache server as the user 'ethan' (which isn't mentioned) then it would be fine regardless. As for the 's' notation, that's either a bitmask of 0400 or 0200, which are for setuid and setgid, respectively. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to send post-variables in a Location header
On Mon, Aug 26, 2013 at 3:48 PM, Ajay Garg ajaygargn...@gmail.com wrote: Hi all. I have a scenario, wherein I need to do something like this :: ### $original_url = /autologin.php; $username = ajay; $password = garg; header('Location: ' . $original_url); ### As can be seen, I wish to redirect to the URL autologin.php. Additionally, I wish to pass two POST key-value pairs :: user=ajay and password=garg (I understand that passing GET key-value pairs is trivial). Is it even possible? If yes, I will be grateful if someone could let me know how to redirect to a URL, passing the POST key-value pairs as necessary. No. Sending a 'Location:' header issues an HTTP 301 by default, which means the browser will follow it using a GET request. If you can't pass the information from one location to another using sessions or (less ideally) cookies, you might consider doing a cURL POST request in the background and passing the session ID back to the browser, and having it handle it appropriately (read: session hijack). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] exec and system do not work
On Sun, Aug 25, 2013 at 11:41 PM, Ethan Rosenberg erosenb...@hygeiabiomedical.com wrote: Dear List - I'm lost on this one - This works - $out = system(ls -l ,$retvals); printf(%s, $out); This does - echo exec(ls -l); This does not - if( !file_exists(/var/www/orders.txt)); { $out = system(touch /var/www/orders.txt, $ret); $out2 = system(chmod 766 /var/www/orders.txt, $ret); echo 'file2br /'; echo file_exists(/var/www/orders.txt); } ?php echo `whoami`; ? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP vs JAVA
On Tue, Aug 20, 2013 at 10:00 AM, Tedd Sperling t...@sperling.com wrote: Hi guys: A teacher at my college made the statement that JAVA for Web Development is more popular than PHP. Where can I go to prove this right or wrong -- and/or -- what references do any of you have to support your answer? (sounds like a teacher, huh?) Here are my two references: http://w3techs.com/technologies/details/pl-php/all/all http://w3techs.com/technologies/history_overview/programming_language/ms/y But I do not know how accurate they are. What say you? While I couldn't find anything comparable - from the same source and window of time - for Java trends on the web, there was an article released by Netcraft in January of this year that shows PHPs continued growth[1]. It may, at the least, provide a basis for comparison should you or your adversary be so inclined to dig deeper. ^1: http://news.netcraft.com/archives/2013/01/31/php-just-grows-grows.html -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to upstream code changes to php community
On Tue, Aug 13, 2013 at 12:38 AM, Shahina Rabbani shahinarabbani.sh...@gmail.com wrote: Hi, I have done some modifications to the php source code and i tested it with php bench and I observed some improvement. I wanted to upstream these code changes to PHP community. I searched the wed but i didnt find proper guide to upstream the code to php. Please help me by providing the information how to upstream my code changes to php source code community. Start by subscribing to intern...@lists.php.net and introducing yourself on that list, which is intended for the discussion of the ongoing development of the runtime and related things. You may also want to hop on EFNet and join #php.pecl, which - like internals@ - is specifically for discussion of furthering the core development (not for any time of support). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Finally....
# ezmlm-list ~ezmlm/php-general | grep skynet supp...@skynet.be # ezmlm-unsub ~ezmlm/php-general supp...@skynet.be # ezmlm-list ~ezmlm/php-general | grep skynet # No more of those Your e-mail concerning our products and services autoreplies from the Belgacom Webteam. Sorry it took me this long to realize it and get around to it. Happy Friday. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /tmp/directory
On Mon, Jul 22, 2013 at 10:10 PM, Tedd Sperling t...@sperling.com wrote: On Jul 22, 2013, at 4:10 PM, Matijn Woudt tijn...@gmail.com wrote: On Mon, Jul 22, 2013 at 5:20 PM, Tedd Sperling t...@sperling.com wrote: Hi gang: I should know this, but I don't. Where is the /tmp/ directory? You see, I have a client where his host has apparently changed the /tmp/ directory permissions such that old php/mysql scripts cannot write to the /tmp/ directory anymore -- they did at one time. So, how do I fix it? Cheers, tedd Switch host? /tmp is required by the FHS and POSIX standards (writable for any user), any host changing that should have no customers. - Matijn Good point -- we will add that reason to the many other reasons why we are changing host. Keep in mind, the installed software worked for nearly a decade and now the host has changed something that caused this error, but the current host doesn't seem to know what happened. If it's /tmp, it's /tmp. The leading slash indicates that it's in the filesystem root. However, if it's just tmp, then it could - and probably is - under the client's home directory. Unless they're chrooted; then it could be displayed as /tmp, but would actually be virtualized by the OS, where /tmp isn't really /tmp, but could be /var/virtfs/user/tmp. Confusing? Sure. Off-topic for the list? Sort of, but that's easy enough to change. Since you can't use get_sys_temp_dir() on 4.3.10, you should instead see if $_ENV contains an array key for TMP, TMPDIR, or TEMP. Or, if you'd rather, you can use getenv('TMP') and the like. It doesn't mean that you'll get any useful information back (or anything at all, necessarily), but it's another thing to try when using such an antiquated version (I believe it was released at the end of 2004). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I am completely lost and need an advice (beginner)
On Thu, Jul 18, 2013 at 3:08 PM, php colos phpco...@gmail.com wrote: Hello world! I'm trying to learn PHP ( first programming language that I learn) and I feel kinda lost. I've read PHP programming 3rd edition( O'reilly), 'getting good with PHP' by Andrew Burgees and some tutorials on the internet but can't code something more complex than 'hello world'. I do understand functions/values/operators/control structures, etc but as I said, I feel that I can't use the language. Am I reading the wrong books for a beginner? Any advices? *Apologies if this email might seem confusing. :) Perhaps I'm biased, but I think other folks will agree --- the official documentation is your best source of learning second only to your own experiences with the language. Check through the user notes as well, as they often provide very valuable insight and other developers' personal experiences. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pass parameter from client to server
On Thu, Jul 18, 2013 at 6:04 PM, iccsi inu...@gmail.com wrote: I have a select control on the form and need to pass value user select to my query parameter. I just realized that user entry value is client side and query parameter is server side. Are there any way to read client parameter to pass to server? You information and help is great appreciated, Not from PHP unless you pass it via GET or POST, or as a cookie. You may want to look into JavaScript, jQuery, and AJAX for your specific needs, but that all gets beyond the scope of this list. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Premature end of script
On Wed, Jul 17, 2013 at 11:22 AM, R B rbp...@gmail.com wrote: Hello, 5 years ago, y developed a php system and was working fine. But 20 days ago, when y try to access to some pages (not all the pages), in the log appears this message and the page is not displayed: == /usr/local/apache/logs/error_log == [Wed Jul 3 02:36:58 2013] [error] [client 10.30.6.161] Premature end of script headers: /home/capitale/public_html/miembros/myscript.php Can you help me please with this error? It's the vaguest of all errors and the bane of the existence of any developer who comes across it (at least it's rarer in PHP than it was in Perl years ago). Essentially, it would require a lot more information that what's been provided for us to help you debug. What things have changed in the last month? Have you upgraded PHP? Made any changes to the code or any of the dependencies? Is the server out of available disk space? Is something causing it to run out of memory? What happens when you run the same script from the CLI? What do you see when you enable all errors and error reporting? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error checking ON
On Wed, Jul 17, 2013 at 11:49 AM, Tedd Sperling t...@sperling.com wrote: Hi gang: Considering: On Jul 17, 2013, at 11:41 AM, Jim Giner jim.gi...@albanyhandball.com wrote: Since you state that you haven't made any changes to the system (in general), I'm going to guess that you modified an 'included' file and it has an error in it, such as an unmatched curly brace. As Dan said, turn on all error checking and reporting and see what message you get. This is what I do for error checking: ini_set('error_reporting', E_ALL | E_STRICT); ini_set('display_errors', 'On'); ini_set('log_errors', 'On'); ini_set('error_log', 'error_log'); Is this: 1. Sufficient? 2. An overkill? 3. OK? 4. OR, better served with this (and provide an example). That's standard practice. Sometimes, though, it isn't enough, and we find ourselves using Derick's Xdebug, mod_top, or performing an strace on either the execution or attached to a process. For nearly all cases, though, that's sufficient without being overkill (except for production cases). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Kickstarter Project on Massive Log data Aggregation and Processing with Open Source Software
On Jul 15, 2013 11:29 PM, Israel Ekpo israele...@gmail.com wrote: Hi Everyone, [snip!] No. Good luck with your endeavor, but please do not broadcast it to this list.
Re: [PHP] A Strange Problem
On Thu, Jun 20, 2013 at 2:14 PM, Tedd Sperling tedd.sperl...@gmail.com wrote: Bastien: You were right on - by changing the directory to what I needed, everything works. My follow-up question is Why? I have *never* had to specifically tell any script to chdir() -- why with that one? Sounds like either a chroot or virtual environment (such as, execution of the script in a separate directory) issue. Check the output of this: ?php if (phpversion() = 5.3) { echo __DIR__.PHP_EOL; } else { echo getcwd().PHP_EOL; } ? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hoping nobody notices it isn't Friday.
On Tue, Jun 18, 2013 at 1:36 PM, Richard Quadling rquadl...@gmail.com wrote: Hi. We've all been told that 'free software' is to be thought of as 'free speech', not 'free beer'. Well, I hope to muddy the waters with this link. https://www.facebook.com/TheFreeBeerApp I'd say that I'd make an exception, but since it appears to only be available for you Redcoats, I'll remind you that today is Tuesday, and admonish you for making the week feel that much longer for all of us. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL Rewriting
Studying archaeology now, Tam? ;-P On Sat, Jun 1, 2013 at 8:22 PM, Tamara Temple tamouse.li...@gmail.com wrote: Silvio Siefke li...@silvio-siefke.de wrote: On Wed, 22 Jun 2011 17:50:49 -0400 Daniel P. Brown wrote: Has someone a Link with Tutorials or other Information? Not entirely sure what you're asking here, or how you (or the nginx folks) expect it to relate to PHP. Do you mean that you want to use PHP to have theme2.php act as if it was called as theme.php?id=2 ? I have me write a blog, but my blog has link like blogdetail.html?id=1 or =2 through 16 at moment. And for google and other Search Engines not good the links, better where i can rewrite to a fix link, and when someone use the link, php write to correct url. Common SEO mythology is that you need pretty human-understandable links. (In point of fact, the search engines care not in the least.) However, human-understandable URLs are a benefit to users when they want to understand what they're linking to or clicking on. A human-understandable link is more like: http://www.example.com/blog/2013-05-a-day-in-the-life-of-my-dog not: http://www.example.com/blog/2 as that really does not provide any more information than: http://www.example.com/blog.php?id=2 Otherwise, Daniel's solution below should do the trick. Sorry my english not perfect on earth. If so, it's not redirect or rewrite, and it's extremely hacky, but this is the only real way PHP could achieve the desired result: ?php // dynamictheme.php if (preg_match('/.*([0-9]+)\.php/Ui',$_SERVER['PHP_SELF'],$match)) { $_GET['id'] = $match[1]; include dirname(__FILE__).'/theme.php'; } ? Then just symlink dynamictheme.php to your various themes like so: ln -s dynamictheme.php theme2.php ln -s dynamictheme.php theme301.php ln -s dynamictheme.php theme18447.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sorry for the blast from the past
On Sat, Jun 1, 2013 at 9:02 PM, Tamara Temple tamouse.li...@gmail.com wrote: Sorry for replying to a message from 2011 -- for some reason I had a whole bunch of PHP messages suddenly show up in my inbox from the past. I generally don't check the year of an unread message in my inbox, as I try to keep inbox-zero. Anyway, carry on! Gah. Didn't see this before, so I didn't know you already noticed the date before I started ribbing you earlier. Backfired on me like a '69 Pinto. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Webpage Persistence Load balancing
On Wed, May 29, 2013 at 8:03 AM, Al n...@ridersite.org wrote: I'm having a webpage Persistence problem, it is intermittent. I suspect it is caused by load-balancing. Specifically: Users are connected to a webpage form to complete. Generally, everything is OK if they take a minute or even more to complete the form. However, sometimes they report to me, and I've seen it myself, the connection has been dropped by the server in a short time. They enter the data and Submit it to the server, and the page just reloads and their data is lost. I have the PHP ignore_user_abort(true); etc. Is there anything I can do to fix this or is it a server issue that you must fix? Well, either way, it would be up to you to fix it. We wouldn't have anything to do with the server (well, unless you were hosted with my company, but the PHP project itself isn't any way related to the corporate stuff). Of course, it could just be the ambiguity of the term you in the sentence throwing me off here. That said, is this a standard HTML page displayed in a normal, modern-era browser, or is there a different frontend, such as Flash, a mobile client, an API, or something of the sort? And is the page being timed-out with JavaScript, or simply timing out with the sessions? Lastly, if you suspect that it is the load-balancing, and the balancer isn't capable of persistence itself (such as if you're using round-robin), and sessions themselves are breaking, it's probably because you're relying on file-based sessions, which do not (by default) synchronize between servers. Instead, you'll need to centralize your sessions in a database, memcached, or similar option. For some hints on session management and how you can manage it across server clusters, check out the session_set_save_handler() function[1]. ^1: http://php.net/session_set_save_handler -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Source code of original PHP release.
On Thu, May 23, 2013 at 2:16 AM, chris ch...@cribznetwork.com wrote: I'm currently writing a paper on the evolution of PHP and web development/security as a whole. One of the things I want to incorporate is snippets of source code to show how things have grown and advanced since the 90's If anyone could help me out I would be much appreciated. All my attempts of trying to find it have turned up nothing :( Everything you want (and more) regarding that is in the Museum: http://museum.php.net/ -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random
On Thu, May 23, 2013 at 4:51 PM, Last Hacker Always onpoint lasthack...@gmail.com wrote: Hey I need code for random number 1-30 for my site. You need to know that you've been removed from the list (but you'd still have to be subscribed to be able to read this). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undef func
On Fri, May 10, 2013 at 6:15 AM, georg georg.chamb...@telia.com wrote: Hello ! im increasingly frustrated on my effort to get PHP/ODBC going with Apache on Linux (did it on MS XP, that was trixy but this is worse, nothing seem to be correct; utilities missing, erroneous file-directory references, crapy stringency in description...) well: undefined function odbc_connect() is what I currently find in my Apache Error_log So evidently I have sucessfully gotten at least PHP to get working, but to connect to ODBC (this then would indicate that dynamical loading of libararies is not successful, but what...) man tnx for clues georg Did you uncomment the line in php.ini to load the ODBC DLLs? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undef func
On Fri, May 10, 2013 at 3:18 PM, tamouse mailing lists tamouse.li...@gmail.com wrote: Aren't DLLs a Windows thing? Yeah, I misread the bit about MS XP and thought he was using XP for this install. I just realized the remainder of the discussion between us was off-list, so - for posterity - my response, when finding out it is indeed a Linux box, is: pecl install pdo_odbc. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FW:
If you're going to send hack attempts, at least adjust your clock so that it doesn't look like it took almost a month for your SPAM to get here. We're not the Pony Express. (And, no, PHP doesn't stand for Produced by Horses Ponies.) On Thu, Apr 11, 2013 at 11:43 AM, Paul Novitski p...@juniperwebcraft.com wrote: http://www.shinwa-kensetsu.sakura.ne.jp/bth7rz.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]
On Wed, May 8, 2013 at 1:14 PM, Tedd Sperling tedd.sperl...@gmail.com wrote: PS: PHP + Produced by Horses Ponies. ? You got too much time on your hands Daniel. Sometimes I wish that were the case. Honestly, I think it's having a three-and-a-half-year-old daughter that's rubbing off on me. She's presently obsessed with princesses (fictional, of course --- no interest in Maria Antonia or even Kate Middleton yet). So you're just lucky I didn't acronymize it as the Pretty House of Princesses or something. And yes, I just made up the word acronymize. It may be Wednesday, but it feels more like a Friday. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]
On Wed, May 8, 2013 at 1:26 PM, David OBrien dgobr...@gmail.com wrote: That would be reverse acronymization :) You're absolutely correct. Deacronymize? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP]
On Wed, May 8, 2013 at 3:13 PM, Steven Staples sstap...@mnsi.net wrote: Why does this feel like a new function/feature for PHP now? Function acronymize($acronym) { // do stuff here now... :S } ?php function acronymize($text) { preg_match_all('/[A-Z]/s',ucwords(strtolower($text)),$matches); return implode('',$matches[0]); } ? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] htaccess question
On Tue, Apr 9, 2013 at 2:07 PM, Al n...@ridersite.org wrote: I know it's not a php question, but I can't readily find the answer elsewhere. I want to make this directive universal. Put htaccess file on any host in any folder. This works RewriteEngine On RewriteCond %{SERVER_PORT} !=443 RewriteRule ^(.*)$ https://www.foo.org/bar/$1 [R=301,L] #Here the foo.org and /bar must be specified I want what is in effect RewriteRule ^(.*)$ https://{host_name}/{directory}/$1 [R=301,L] I can easily do this with php regex capturing the (host and dir) and then rewriting the text string; but the Apache directives are not obvious. You were on the right track: RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Commands which call exec() or shell_exec() ??
On Tue, Apr 9, 2013 at 3:11 PM, Ken Kixmoeller phph...@comcast.net wrote: Hi -- - Strange problem. One of my applications was just moved to a new server. The new server has php configured to blacklist some functions (using disable_functions=). One of the banned functions is exec(). The error log is reporting shell_exec() has been disabled for security reasons --- but exec() or shell_exec() are not in my code *anywhere*. The program and line number being reported makes absolutely no sense. Are there other php commands that really call exec() or shell_exec() ??? Any clues how this could happen? Fixes (other than un-blacklisting the command, of course)? Many thanks, Ken If you're positive you aren't executing any command line code (backticks, passthru(), et cetera), then check to see if arbitrary code is somehow being attempted via your scripts. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] application level variable file
On Fri, Mar 22, 2013 at 10:22 AM, inu...@gmail.com wrote: I am very new to the PHP application and would like to create a new project. I would like to have a file to save my application level variable and functions. I would like to know does PHP have any default file name and file path for this file like Web.config file for ASP.Net and Application.cfm for ColdFusion? Your help and information is great appreciated, No. For more info: http://php.net/manual -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Surge 2013 CFP open
The below is a good example of why to trim your signature before sending an email to a public mailing list. Ignoring for a moment the irrelevance of the conference, a one-line email should not have a nineteen-line signature --- particularly when the notice is null and void when sent willingly to a public forum. On Mon, Mar 18, 2013 at 2:30 PM, Katherine Jeschke krjesc...@omniti.com wrote: The Surge 2013 CFP is open. For details or to submit a paper, please visit http://surge.omniti.com/2013 -- Katherine Jeschke Director of Marketing and Creative Services OmniTI Computer Consulting, Inc. 11830 West Market Place, Suite F Fulton, MD 20759 O: 240-646-0770, 222 F: 301-497-2001 C: 443/643-6140 omniti.com Surge 2013 http://surge.omniti.com/2013 The information contained in this electronic message and any attached documents is privileged, confidential, and protected from disclosure. If you are not the intended recipient, note that any review, disclosure, copying, distribution, or use of the contents of this electronic message or any attached documents is prohibited. If you have received this communication in error, please destroy it and notify us immediately by telephone (1-443-325-1360) or by electronic mail (i...@omniti.com). Thank you. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Introduction ... !
On Fri, Mar 1, 2013 at 10:57 AM, Nick Whiting prg...@gmail.com wrote: Hello PHP'ers! Just thought I would introduce myself to the mailing list since I've worked with PHP for almost 10 years now and yet haven't really been community active ... I've developed quite a few open-source projects over the years that I hope someone here will find as useful as I have ... they are all hosted on Github @prggmr. XPSPL - Signal Processor in PHP docpx - PHP Documentation Generator for Sphinx Again Hello Everyone! Welcome to the list, Nick. Looking forward to having you involved in the discussions we have go on here. The list isn't nearly as active as it was about five years ago, but that's likely to change. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Introduction ... !
On Fri, Mar 1, 2013 at 12:54 PM, Jim Giner jim.gi...@albanyhandball.com wrote: What gives you such optimism? I recently saw a list of languages in use and PHP has dropped quite a bit over the last 5 or more years. Being a relative newbie myself, I'm happy that PHP exists and is so readily available to us hobbyists, etc. Certainly am in favor of your optimism, but curious (hey it's Friday!) about your prediction. Just knowing how the patterns go. It's always the same, and it will likely be the same again. No guarantees, but all it takes is a bit of fostering of the community to return it to a decently-vibrant forum. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
On Wed, Feb 27, 2013 at 9:14 PM, Curtis Maurand cur...@maurand.com wrote: Well that means the docs on the PEAR MDB2 website are incorrect and should be fixed. Thanks for the lesson. If there's an issue with the docs, you're right, they should definitely be fixed. We'd appreciate it very much if you could take a moment and submit it as a bug report at https://bugs.php.net/. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
On Tue, Feb 26, 2013 at 4:27 PM, Curtis Maurand cur...@maurand.com wrote: I have the following: $dsn = mysqli://$username:$password@$hostname2/$database; $options = array( 'debug' = 3, 'result_buffering' = false, ); $dbh = MDB2::factory($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2-getMessage()); } function tallyCart($_u_id,$dbh){ while($row = $result-fetchrow(MDB2_FETCHMODE_ASSOC)) { $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } } I'm getting: Call to undefined method MDB2_Error::fetchrow() anyone have any ideas? Can I not pass a database handle to a function? Thanks, Curtis Hate to answer a question with a question, but: 1.) Do you have the PEAR package MDB2 installed? 2.) Where is $result defined? I don't see it in your code snippet here. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Very Large File Splatter
On Fri, Feb 22, 2013 at 4:04 PM, Brian Smither bhsmit...@gmail.com wrote: PHP 5.4.4-TS-VC9 on Windows XP SP3 NTFS non-system drive with 18GB free. I dare not try to replicate this. As such, I cannot firmly place the blame on PHP. I have peppered a PHP application with a call to a function which appends-only to a logfile the parameters passed to it. Each pass of the application creates many MB of content. It is conceivable that I ran out of hard drive space. When that which what I was working on seemed to be acting very weird, I rebooted the computer only to see thousands of lines scroll by from Windows repairing the file system. I discovered logfile contents in many dozens of files. The timestamp and filesize of the damaged files were not changed. Only the contents replaced with slices of the logfile. Again, I'm not going to try to 'intentionally' replicate this, so I ask: Has PHP's interface with the NTFS file sub-system ever been reported to splatter a file across the contents of a drive? Not to my knowledge. It actually sounds to me like a code issue. Are you using file_put_contents() with the parameters in reverse order, by chance? If you can show the write portion of the code in your iteration, as well as a sample of the naming convention, it may offer more clues. In any case, either disk space or inode exhaustion is likely the reason things borked-up for you. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stripped \n
On Wed, Feb 20, 2013 at 1:32 PM, Matijn Woudt tijn...@gmail.com wrote: An input with type=text is used for single lines, so yes, newlines get stripped. Either use a textarea with style=display: none, or store the data in a session instead. Or at least input type=hidden/. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP fails to install on Ubuntu 12.10. What's going on?
On Thu, Feb 14, 2013 at 2:20 PM, Chris Bergstresser ch...@subtlety.com wrote: Hi all -- I've got a cloud server on Rackspace. If I bring up a fresh Ubuntu 12.10 machine image, and type apt-get install php5 it seems to install fine. But if I then type php -version I get PHP Parse error: syntax error, unexpected end of file in Command line code on line 1. What went wrong? How can I fix it? Not only is that extremely vague, but it's possibly more of an issue with Ubuntu's repo than PHP itself. Nonetheless, try this and reply to the list with the output of each: php -v php -r 'echo phpversion().PHP_EOL;' php -nv Also, while it does work with PHP, note that, with a few exceptions such as `find`, *NIX CLI short options (single dash) generally expect a single character, while long options (double-dashes) take longer strings. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP fails to install on Ubuntu 12.10. What's going on?
Remember to hit reply-all, Andy, so it goes to the list as well as the previous author. On Thu, Feb 14, 2013 at 2:49 PM, Andy McKenzie amckenz...@gmail.com wrote: On Thu, Feb 14, 2013 at 2:29 PM, Daniel Brown danbr...@php.net wrote: On Thu, Feb 14, 2013 at 2:20 PM, Chris Bergstresser ch...@subtlety.com wrote: Hi all -- I've got a cloud server on Rackspace. If I bring up a fresh Ubuntu 12.10 machine image, and type apt-get install php5 it seems to install fine. But if I then type php -version I get PHP Parse error: syntax error, unexpected end of file in Command line code on line 1. What went wrong? How can I fix it? I'm pretty sure the php5 package in ubuntu doesn't include the cli client. Try adding apt-get install php5-cli (or whatever they're calling the package these days) and see if the version command works then. Also, you may need a second hyphen before the word version. Yes, it would be php5-cli, but since he's getting the response from PHP (parse error) and not the environment saying the command isn't found, it shows he's got the CLI installed. Ubuntu is actually really helpful with a lot of that, too, since - if it can't find the command - it'll suggest packages from APT to install which match the command given. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP fails to install on Ubuntu 12.10. What's going on?
On Thu, Feb 14, 2013 at 4:56 PM, Andy McKenzie amckenz...@gmail.com wrote: Can I just mention, as so many others have, how much I hate the fact that this list is configured to not reply to the list by default? I know. Actually, the only reason it's like this is because a lot of people will take the conversations off-list on their own, so we don't force the list as the reply-to address. After ~13 years, though, it's difficult to justify the change. No problem on the forward, though. Thanks for contributing to the community. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] webDAV/CalDAV client class experience ?
On Tue, Feb 12, 2013 at 3:40 PM, B. Aerts ba_ae...@yahoo.com wrote: Hello, I'm working on this one for more than a year (personal project) - but I'm turning pretty desperate here. I'm trying to connect to 2 Calendars through the CalDAV protocol. The calendars are hosted by 2 webmail providers. If I try to sync through a dedicated calendar, like iCal or Thunderbird Lightning add-on, this works fine. However, once I try to do it through native PHP, I fail miserably - even if I mimick HTTP requests as recorded by Charles (HTTP debugging proxy). Up until now, I used the inc_caldav-client-v2.php, which worked for a while and then stopped all of a sudden. The PUT requests failed, and then any HTTP request got caught in what appears to be a socket timeout. My question: is anyone using some webDAV/CalDAV class that actually works ? If not, any tutorial on the subject is also deeply appreciated ( all I can rely on is the IETF spec rfc4791, which is far from accesible reading material) I haven't tried them myself, but there are PEAR packages for client-server implementations for WebDAV: http://pear.php.net/search.php?q=webdavin=packagesx=0y=0 They're not actively maintained by anyone right now (feel free to apply to change that if you'd like the responsibility), but the most recent server version was released just this past October (the client version is about a year older). At the very least, it may be enough to get you started. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DEV] new FTP function
On Fri, Jan 18, 2013 at 10:33 AM, KISE wowk...@gmail.com wrote: Paul Dragoonis, Actually it wont work i did tried it before, if the dir end with / it will list the directories inside the path you gave it and if it doesn't have any directories it will return false since there is no directories to return. you have to take out the last / and then remove the directory in question and list the files in the parent directory and check if the dir exists otherwise it will return false, i spent 3hrs yesterday thinking why its returning false even though the directory exists. The discussion is now getting more into the general coding realm than internals, so let's move it over there in case anyone wants to mention something like: function ftp_dir_exists($conn, $currentDir) { $currentDir = (substr($currentDir,-1,1) == '/') ? substr($currentDir,0,-1) : $currentDir; $list = ftp_nlist($conn, '-dF '. $currentDir); return in_array($currentDir, $list); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Some date() oddities
On Tue, Jan 8, 2013 at 3:43 PM, Arno Kuhl a...@dotcontent.net wrote: I've bumped into an odd result with the date() function that I can't make sense of. Starting with a unix timestamp for 31 December 2012 13:12:12 (which is 1356952332) I calculate a week number: $ux_date = 1356952332; $weeknumber = date(W, $ux_date); // returns 01 instead of 52 Because, technically, 31 December was the second date of the *fifty-third* week of 2012. However, because the majority of the week falls in 2013, it's rounded-in with that. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: form validation
On Thu, Dec 20, 2012 at 10:34 AM, Jim Giner jim.gi...@albanyhandball.com wrote: If you are using mysql for a db, then you should already be using mysql_real_escape_string in place of addslashes. Actually, you should start moving toward MySQLi, as mysql_*() is deprecated. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQLi
On Thu, Dec 20, 2012 at 12:18 PM, Stephen stephe...@rogers.com wrote: I read about the subject in another thread. Where does PDO fit? That is what I have used for sometime. Am I good? Right as rain. PDO is a preferred abstraction layer in PHP and isn't going anywhere anytime soon. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session ?
On Sat, Dec 8, 2012 at 10:52 AM, Jim Giner jim.gi...@albanyhandball.com wrote: Didn't work. Let me explain my domain names. My main domain is albanyhandball.com. I have two subs called x.albanyhandball.com and y.albanyhandball.com. Attached to each of these is what my isp calls an add-on domain name. These two names are not similar at all. As in addon1.net and myothersub.com, but each is tied to one of the sub-domain names. Looking at a phpinfo dump, the true sub-domain names (*.albanyhandball.com) show up only in the SERVER_ADMIN setting, while my add-on domain names show up in the SERVER_NAME settings. That won't work and should not work. You could technically do it, but you'd be deliberately creating an XSS for your sites. If it worked that way on its own, it would either be (a) a horrible browser or (b) 1995. It'll work for the subdomains, but not addon or parked domains. I've read about passing the session id to a script and using that to opene up the existing session file. Is this something I could do in this case? Or am I SOL? You can pass the session ID and reactivate the session that way, sure. Not pretty, and it does lead to security considerations, but it would work. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session ?
On Fri, Dec 7, 2012 at 2:33 PM, Jim Giner jim.gi...@albanyhandball.com wrote: Something new for me - working with scripts on two of my sub-domains. I want to call script 2 in my B domain from script 1 in my A domain. It appears that the session vars established in script 1 do not show up in script 2. Is that because the domain name is different? Is this where one must grab the session id and use it in another script in order to retain the original session and its vars? If this is so, can someone elaborate on the capture of the session id process? Are both domains on the same physical (or virtual) server? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session ?
On Fri, Dec 7, 2012 at 2:38 PM, Jim Giner jim.gi...@albanyhandball.com wrote: On 12/7/2012 2:36 PM, Daniel Brown wrote: On Fri, Dec 7, 2012 at 2:33 PM, Jim Giner jim.gi...@albanyhandball.com wrote: Something new for me - working with scripts on two of my sub-domains. I want to call script 2 in my B domain from script 1 in my A domain. It appears that the session vars established in script 1 do not show up in script 2. Is that because the domain name is different? Is this where one must grab the session id and use it in another script in order to retain the original session and its vars? If this is so, can someone elaborate on the capture of the session id process? Are both domains on the same physical (or virtual) server? Yes - they are sub-domains of my main one. ?php ini_set('session.cookie_domain','.example.com'); ? The preceding dot before the SLD allow the session cookie to be accessible on *.example.com. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session ?
On Fri, Dec 7, 2012 at 2:54 PM, Jim Giner jim.gi...@albanyhandball.com wrote: What if my sub-domain names are not in the form of 'a.domain.com' and 'b.domain.com'. A subdomain is a subdomain. Unless you've discovered a new magical form of subdomain that is not, you should be fine. And if you have, in fact, made that discovery, you're probably the reason the Mayans predicted a very short winter this year. Thanks for screwing us, Jim. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session ?
On Fri, Dec 7, 2012 at 3:04 PM, Jim Giner jim.gi...@albanyhandball.com wrote: OK - now that I've messed us all up, help me to understand your proposed solution. I added the ini-set line to my first script. Then I called my second one and still had the same problem with a missing session var. Is there a corresponding line I need in the 'called' script? And does it matter where this line is place within the script? From your response to Sebastian, I'm not sure it will work. They need to be subdomains of the same domain; different domains won't work. However, proceeding with the presumption that the subdomains are under the same SLD (e.g. - apple.example.com and orange.example.com), this should work: ?php // apple.example.com ini_set('session.cookie_domain','.example.com'); session_start(); $_SESSION['foo'] = 'bar'; session_write_close(); ? Then ?php // orange.example.com ini_set('session.cookie_domain','.example.com'); session_start(); echo isset($_SESSION['foo']) ? $_SESSION['foo'] : 'Session failed to transfer.'; ? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session ?
On Fri, Dec 7, 2012 at 3:20 PM, Sebastian Krebs krebs@gmail.com wrote: Would be better to put 'session.cookie_domain' into the php.ini. In both cases: Clear cookies (at least for your site) completely and set session.auto_start to 0. If it's configured on the server for overrides, sure, a local one. Otherwise, the system php.ini will break all other domains on the server. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP site search broken?
On Tue, Dec 4, 2012 at 3:56 PM, Paul M Foster pa...@quillandmouse.com wrote: Is it just me, or is the search feature on php.net broken? When I enter a full search term (known good function name) and then hit the arrow, it brings me back to the generic search page. If I enter a partial search term and then click on one of the suggested completions, it usually (not always) does the same thing. Etc. It's probably a legitimate issue. I made some changes last week to the DNS and fundamental server functionality to speed things up. We're now using a service named myracloud[1] to help with traffic and server load for the primary web box (the main php.net / www.php.net system), as well as static.php.net, which handles graphics and other media. Unfortunately, as with any major changes, there are a few hiccups here and there for some users. Primarily, these are in the form of HTTP 301's; when the server issues a redirect order, sometimes the data isn't being sent along with it. We're working to resolve the issues; I just made one moderately-sized commit to hopefully repair a lot of the issues, and will be making at least one more shortly. If you or anyone else reading this continue to experience issues, please submit them as bugs at https://bugs.php.net/ and zip me a quick email to bring it to my attention. ^1: https://myracloud.com/en/?_locale=en -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
On Tue, Dec 4, 2012 at 8:10 AM, Farzan Dalaee farzan.dal...@gmail.com wrote: hi guys i want to open an email content ( subject ,body , attachment ) with php i use imap_php but its wont connect to host what should i do? thanx Start by finding out why it won't connect. Check the logs on the server if you can, that's always the best place to look first. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to read emails with php
On Tue, Dec 4, 2012 at 1:44 PM, Farzan Dalaee farzan.dal...@gmail.com wrote: Same error I think its need something else for opening service like ssl setting or somthing like that Or this host im using block imap or pop3 access Per list rules, please don't top-post. Some things to consider: 1.) Incorrect domain name. Be sure the domain is spelled correctly and is registered. 2.) System not configured to serve IMAP. 3.) Firewall blocking access to port 143. 4.) Host down. Try pinging the domain. If you get a response back, try either using Telnet to connect to the domain on port 143 or using an email client with the same access details and credentials you're trying to use in your code. At this point, it's evident that it's not a PHP problem, so you'll need to research the rest on your own. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to get a PHP bug fixed?
On Sat, Nov 17, 2012 at 1:51 AM, Enumag enu...@gmail.com wrote: Hi, there is a bug I'd like to be fixed and even a patch is available. But there is still no reaction at all after 2 years. What else can I do to get the bug fixed? https://bugs.php.net/bug.php?id=45351 - patch available from 2010-06-13 https://bugs.php.net/bug.php?id=48724 - patch available from 2012-04-13 The PHP General mailing list is only for discussing the use of the language and developing in PHP, not really for the development of the language itself. Instead, you should try to discuss these things on the PHP Internals list at intern...@lists.php.net. You may also want to speak with some of the developers via IRC on EFnet #php.pecl to discuss if there is any interest in patching the bugs you've mentioned. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date manipulation
On Thu, Oct 25, 2012 at 3:06 PM, Ron Piggott ron.pigg...@actsministries.org wrote: Is it possible for PHP to accept the following as a date: 04:11:22 Aug 21, 2011 PDT so I may output it as: gmdate(‘Y-m-d H:i:s’) - I want the time zone included Sure. ?php $ds = strtotime('04:11:22 Aug 21, 2011 PDT'); echo gmdate('Y-m-d H:i:s',$ds); ? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] select function
On Thu, Oct 25, 2012 at 5:35 PM, Jeff Burcher j...@allredmetal.com wrote: Hi, I can't remember if this is the PHP list for RPG programmers or not, so apologize if this is the wrong one. This is just a general PHP mailing list. Guessing you need the other one. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cron job problem
On Tue, Oct 23, 2012 at 4:48 PM, Jim Giner jim.gi...@albanyhandball.com wrote: I have a php script that has been triggered by my hoster's cron process(?) to run once a day since last March. It's been running fine - and I've made no changes to it. Suddenly in the last couple of days it is running twice it seems. The whole process sends an email at its conclusion and the receipient tells me today that she's getting two emails only a minute apart. Any ideas on why this might happen? I haven't contact my host company yet - thought I'd ask around first. Though not really a PHP question, there are several reasons this could happen, including a race condition that is being encountered due to a slowdown of the host system or changes to the system's environment. Are the emails she's receiving identical? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cron job problem
On Tue, Oct 23, 2012 at 4:59 PM, Jim Giner jim.gi...@albanyhandball.com wrote: Yes - same msg same time If it wouldn't be a problem, can you provide the script here (or on a site like Pastebin), as well as the crontab time entry for this? While checking the crontab, make sure a duplicate entry for this wasn't somehow added. In the event that you'd like to keep this information from the archives and general mailing list (and depending on the security implications based upon what's divulged, I'd recommend it), I invite you to send it to me privately, off-list, and I'll take a look at it later tonight or tomorrow morning. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help using PHP 5.3.3 mail() with Apache James
On Tue, Oct 23, 2012 at 5:00 PM, Steven Pogue spo...@us.ibm.com wrote: Has anyone been successful at using the above on a RHEL 6.2 environment? I am able to use Postfix using the php.ini SENDMAIL_PATH but when I bring down PostFix, start Apache James and switch the sendmail_path value to point to the Apache James 2.3.2 provided wrapper (/opt/james-2.3.2/bin/sendmail.py) the return code on mail() indicates it failed and no record of the wrapper being invoked. Calling the wrapper directly from the command-line works as expected so the problem is somewhere between PHP and the sendmail_path invocation. What is the output of the following code? ?php echo 'pre'.PHP_EOL; echo trim(`ls -al /opt/james-2.3.2/bin/sendmail.py`).PHP_EOL; echo '/pre'.PHP_EOL; ? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cron job problem
On Tue, Oct 23, 2012 at 5:34 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: Crontab is the daemon which runs cron jobs, and some distros have set up special files called cron.daily (or daily.cron I don't recall), cron.hourly, etc to make it easier to schedule jobs. Quick clarification and correction here: The cron *daemon* is crond, while the *script* that is batch-processed by cron is called the crontab. When it is executed, it is referred to as a cron job. That said, Ash is right about the rest. Different OS flavors (BSD, Linux, UNIX, SunOS/Solaris, HP-UX, et cetera) often use different path and file standards. Linux, in general, uses a command `crontab` which opens the local user's environment-configured editor to modify the user's crontab in the spool. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Missing email
On Sat, Oct 20, 2012 at 5:00 AM, Karl DeSaulniers k...@designdrumm.com wrote: @Moderator Any reason why my emails do not post or at least dont post for hours later? There is no moderator on this list. I'm probably about as close as it comes. Can you explain more about the problems you're experiencing so that I can look into it further? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wrong time being displayed by PHP!
On Wed, Oct 17, 2012 at 2:28 PM, Richard S. Crawford rscrawf...@mossroot.com wrote: You can see the current output of the above code here: http://projectbench.extensiondlc.net I've confirmed that the server is set to PDT. The value of date.timezone in php.ini is America/Los_Angeles, which should be (currently) -8 hours from UTC, but it looks like the PDT offset is only set to -4. Does that even make sense? Yes, `date` at the command line is showing it, and sure, the timezone is showing as PDT on both ends, but it's also using -0400 for the timezone. In any case, this is something your administrator needs to handle, and isn't something with PHP or your code, from the looks of it. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wrong time being displayed by PHP!
On Tue, Oct 16, 2012 at 4:19 PM, Richard S. Crawford rscrawf...@mossroot.com wrote: Thanks for the suggestion. Unfortunately the problem seems to be that PHP thinks the America/Los_Angeles timezone is the same as EDT. I'm not sure how to approach this issue. Per list rules, just a gentle reminder: please don't top-post. With regard to debugging your issue, it's extremely unlikely that it's PHP's fault, since no one else has the same issue. However, it does indeed sound as though there's a configuration mismatch or a bad setting of the system clock (as suggested earlier by myself and others). What's the output when you run the code below? ?php if (php_sapi_name() == 'cli') { define('NL',PHP_EOL); } else { define('NL','br/'.PHP_EOL); } echo date_default_timezone_get().NL; echo date('r').NL; echo gmdate('r').NL; echo time().' ('.date('Z').')'.NL; echo trim(`date`).NL; ? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wrong time being displayed by PHP!
On Oct 16, 2012 5:24 PM, Richard S. Crawford rscrawf...@mossroot.com wrote: Sorry about that. I was getting very frustrated with the issue, and I forgot. I'll be sure to keep it in mind. No worries. With regard to debugging your issue, it's extremely unlikely that it's PHP's fault, since no one else has the same issue. However, it does indeed sound as though there's a configuration mismatch or a bad setting of the system clock (as suggested earlier by myself and others). What's the output when you run the code below? ?php if (php_sapi_name() == 'cli') { define('NL',PHP_EOL); } else { define('NL','br/'.PHP_EOL); } echo date_default_timezone_get().NL; echo date('r').NL; echo gmdate('r').NL; echo time().' ('.date('Z').')'.NL; echo trim(`date`).NL; ? This is the output: America/Los_Angeles Tue, 16 Oct 2012 17:22:09 -0400 Tue, 16 Oct 2012 21:22:09 + 1350422529 (-14400) Tue Oct 16 17:22:09 EDT 2012 Is this a shared server, Rich? As shown, the admin configured the timezone of the machine to be EDT and set the clock right, but php.ini must be set to PDT. You can easily override this with a local php.ini file, an .htaccess directive, or by placing date_default_timezone_set() near the top of the code.
Re: [PHP] Beneficial site spamming framework
On Sat, Oct 13, 2012 at 5:10 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: It was only your replies coming through so often, so I doubt its my end. Also, the newsgroup is the same thing as the mailing list I believe, in this instance. Hmm I only got each reply once as well, so I'm not entirely convinced it's an issue with Maciek's setup. Ash, you don't happen to have any misfiring forwarders or multiple addresses subscribed, do you? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP The Right Way (website)
On Sun, Oct 14, 2012 at 11:48 AM, Jim Giner jim.gi...@albanyhandball.com wrote: Sounds like a good idea, but as for me - if I was a newbie I'd have a problem with their very first instructions. It says right off the start to type in the following: php -5 localhost:8000 That should be a capital S, not a five. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Reaching the PHP mailing list owners
What is it you're trying to achieve with the below, Helmut? On Fri, Oct 12, 2012 at 1:53 PM, Helmut Tessarek tessa...@evermeet.cx wrote: Well, this is useful. First I get a a message that the owner of the list is available at internals-ow...@lists.php.net and then I get another automated reply. On 12.10.12 13:48 , PHP Lists Owner wrote: This is an automated response to your message to internals-ow...@lists.php.net If you are trying to post to one of the PHP mailing lists, the correct address looks something like php-general@lists.php.net. If you are having problems unsubscribing, follow the directions located online at http://php.net/unsub Thanks! --- Your original email is below. Hello, Can you please explain to me how this can happen? My mail server only rejects mails which do not pass the clamav milter and I haven't seen any virus alerts in the mail log which would refer to the messages you have mentioned. Cheers, Helmut On 12.10.12 6:44 , internals-h...@lists.php.net wrote: Hi! This is the ezmlm program. I'm managing the intern...@lists.php.net mailing list. I'm working for my owner, who can be reached at internals-ow...@lists.php.net. Messages to you from the internals mailing list seem to have been bouncing. I've attached a copy of the first bounce message I received. If this message bounces too, I will send you a probe. If the probe bounces, I will remove your address from the internals mailing list, without further notice. I've kept a list of which messages from the internals mailing list have bounced from your address. Copies of these messages may be in the archive. To retrieve a set of messages 123-145 (a maximum of 100 per request), send an empty message to: internals-get.123_...@lists.php.net To receive a subject and author list for the last 100 or so messages, send an empty message to: internals-in...@lists.php.net Here are the message numbers: 63243 63245 63244 63246 --- Enclosed is a copy of the bounce message I received. Return-Path: Received: (qmail 81005 invoked from network); 30 Sep 2012 14:49:47 - Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Sep 2012 14:49:47 - Return-Path: Received: from [127.0.0.1] ([local]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with INTERNAL id 70/00-15389-30C58605 for ; Sun, 30 Sep 2012 10:49:39 -0400 From: Mail Delivery System mailer-dae...@pb1.pair.com To: internals-return-63243-tessarek=evermeet...@lists.php.net Subject: Mail Delivery Failure Message-Id: 6E/e1-13052-744d6...@pb1.pair.com Date: Sun, 30 Sep 2012 10:49:39 -0400 This message was created automatically by the mail system (ecelerity). A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: tessa...@evermeet.cx (while not connected): 554 5.4.7 [internal] exceeded max time without delivery -- This is a copy of the headers of the original message. -- Return-Path: internals-return-63243-tessarek=evermeet...@lists.php.net X-Host-Fingerprint: 76.75.200.58 pb1.pair.com Received: from [76.75.200.58] ([76.75.200.58:4337] helo=lists.php.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/E1-13052-744D6605 for tessa...@evermeet.cx; Sat, 29 Sep 2012 06:58:15 -0400 Received: (qmail 1431 invoked by uid 1010); 29 Sep 2012 10:57:45 - Mailing-List: contact internals-h...@lists.php.net; run by ezmlm Precedence: bulk list-help: mailto:internals-h...@lists.php.net list-unsubscribe: mailto:internals-unsubscr...@lists.php.net list-post: mailto:intern...@lists.php.net List-Id: internals.lists.php.net Delivered-To: mailing list intern...@lists.php.net Received: (qmail 1417 invoked from network); 29 Sep 2012 10:57:45 - Authentication-Results: pb1.pair.com smtp.mail=tyr...@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyr...@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.42 as permitted sender) X-PHP-List-Original-Sender: tyr...@gmail.com X-Host-Fingerprint: 209.85.160.42 mail-pb0-f42.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=prZm0cGKMFMCkD/fbiF1tCeiDSlTMznmUQpVEygTdy0=; b=TOSHdETdaKP7G5Ou1eBP7tZVyMRgBjAmfZTyGJWi4L3mNrHEVponyIOiJFE9Vl9Qpq k9Th+dyyG39Yqh6QinwAz0CEa2NptoMgeKofnF5MxHxXlq0aykkArjJSBUaHFZxFpaVg 3Pw8mm8Aw3a1FbsZTsbiEIRFPVcUiEJEWPzbATHgw0iS8WFXLH4qkcLYC2tUeGM13koQ rY926iqJEfnSsmegqWWs4GLYLiNOJQouvkyYDh+ZLUmHBTqSsubDdLXIB0TltnBJitvy B/4Jqbm6LmTXwWFqJEfx7HRMkFn90V71fxGYgvAC5VjWeyHLIOOgG7Vz2Nb1vlQ7DA3j GvEQ== MIME-Version: 1.0 In-Reply-To:
Re: [PHP] Re: Reaching the PHP mailing list owners
On Fri, Oct 12, 2012 at 2:19 PM, Helmut Tessarek tessa...@evermeet.cx wrote: Hello Daniel, I wanted to get an answer to my question (which you would have seen, if you actually had read the mail). I briefly glanced, and no more, because anyone with any idea of Internet etiquette knows not to forward an entire bunch of junk to a public and wholly-unrelated mailing list. Had you considered the appropriate options, such as reading about how to contact us, you'd have gotten a response. Note that the tone of your reply here has already changed the tenor of this entire discussion now. I got a mail that messages bounced from my mail server. So I sent a reply to the list owner to get an explanation how this is possible, since my mail server only rejects mails which are flagged by the clamav milter (and this did not happen). But then, instead of an answer, I got an automated response, which basically means only one thing: I don't give a damn about your problems and buzz off. Mailing list owners are supposed to be real people, not bots. And, for the most part, we are (save for a few sentient androids). However, go to news.php.net and look at those bounce messages. Note it's all consecutive, within a relatively small window of time. Then, using your own suggestion about reading the email, look at the bounce response: the messages were undeliverable up to a time threshold, when the server gave up. Sounds like there was an issue connecting to your SMTP system during that window. If you have the appropriate access, you might want to review your mail logs during this window. I'm sorry, I was really irritated by this automated respone. It is not very professional sending people to go in circles. Well, as the adage goes, you'll catch more flies with honey than with vinegar. And considering this is the very first message I've ever seen from you, it sounds like either (a) you didn't follow the proper protocol, or (b) there's something in the process we need to review. If you think the issue lies on our end, you can submit a bug at https://bugs.php.net/ and detail the steps to reproduce the issue. If it is indeed something we need to correct, believe me, we will. We don't deliberately attempt to mislead or frustrate people, despite how it might have seemed. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Friday - Return of Brain Teasers
About five-and-a-half years ago, we had a brainteasers thread going on[1]. Last year it was briefly resurrected[2], and both times got some good content and dialogue going. So I'd like to reprise the thread in 2012, as well. Those of you connected to me on Facebook (parasane) or Twitter (@oidk) might already have seen it, but a simple one to get things rolling: ?php require ++$cowbell; ? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Responding to an XML data post
On Thu, Sep 27, 2012 at 1:48 PM, Bastien Koert phps...@gmail.com wrote: Hi All, I am stuck in something where a 3rd party app pushes an XML post to my site. They need me to respond to that push with a synchronous XML post back confirming that the data was received / had issues etc. Those XMLs are defined, but I am not sure how to push that XML back. A simple echo $xml; is not making back to their system. Not sure how I can post back to their site If it's an actual postback, they should've given you an API endpoint for you to do a cURL post back to their side. If not, and they're just expecting an XML response, it could be that your XML is improperly formatted. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Round help needed
On Thu, Sep 27, 2012 at 11:05 PM, Chris Payne oxygene...@gmail.com wrote: Hi everyone, I'm having one of those nights where nothing is working, please help What I have is this: $rounded_number = round($test, -3); Here's the problem i'm having, I need it to increment to the nearest 1000 but it seems to only work if the number is over 500. For example: 123666 WILL round to 124000 BUT if I put 123085 (As an example) it doesn't round it, it just stays at 123085 - I know it's probably something totally ridiculously simple but i'm having a mental block tonight. Any help would really be appreciated. Sounds like one of those should be obvious, but isn't issues. This gives the desired result: ?php echo round(123085,-3); ? So I wonder if it's your variable (perhaps even type-casting) or some other portion of your code. Can you elaborate and share some of your bytes with the class, Mr. Payne? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as Application Server
On Wed, Sep 26, 2012 at 5:58 AM, Maciej Liżewski maciej.lizew...@gmail.com wrote: Why there is no possibility to run PHP in application server way among other SAPI modules and other possibilities to run PHP? PHP would encounter great performance boost and became more enterprise :) Just look at Ruby which is slow as hell compared even with PHP. By application server I mean scenario when there is statefull application on server side not only by session mechanizms but all classes definitions maintained in memory (no need to load class definition on every request), static class members (and their changes) persistent, background threads, etc. This way any op-code cachers won't be necessary... sounds great, huh? others have it already, so why doesn't PHP? are there any cons? problems too hard to solve (one can be memory leaks, thread safe coding, etc)? I mean it - I am realy curious why there is no such possibility and is there any hope we could get it? While there are no real plans to incorporate a full-fledged application server at this time, PHP 5.4 does have an embedded server[1] for development and such. It's certainly not advisable to use it for production, but the fact is, it's there. With regard to an actual production-worthy application server, you might be interested in HipHop[2], which was developed by some of the engineers over at Facebook. ^1: http://php.net/manual/en/features.commandline.webserver.php ^2: https://developers.facebook.com/blog/post/2010/02/02/hiphop-for-php--move-fast/ -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Vulnerability Announced in phpMyAdmin
Afternoon, folks; Just a three-list cross-post to bring it to everyone's attention at once, in case you weren't already aware. It was announced today that a compromised SourceForge mirror was distributing a malicious file with the phpMyAdmin package that allows an attacker to arbitrarily execute code on a server hosting the exploitable package. Obligatory (not intentionally self-serving) social media link here: https://twitter.com/oidk/status/250688002005811200 I don't especially know how this might affect other projects that are hosting on the same mirror, but I hope at least some of the more popular projects will take a moment to verify the integrity of their packages on the affected mirror ('cdnetworks-kr-1' mirror in Korea, for those interested). Those of you who have phpMyAdmin installed should check immediately to see if your installation is vulnerable to the exploit, particularly if it's auto-updated or has been installed or updated recently. We now return you to your regularly-scheduled Tuesday (unless you're east of the EEST time zone, in which case, Happy Hump Day). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How to limit source IP in PHP
On Tue, Sep 18, 2012 at 9:15 AM, Ian php_l...@fishnet.co.uk wrote: Hi Curtis, I am suffering from sleep deprivation due to a new family addition and I fail to see how your code will prevent a malicious user from binding to an IP that I do not want him to. It appears to be an example of how to bind to an IP, not how to prevent it. Could you please explain? Congrats on the new little one, Ian, and if you don't already know, you're in for a long ride of sleepless nights. Get used to it. That aside, please start a new thread if you'd like to discuss that in greater detail, as it will go off-topic from and out of scope of the originally-posted question. Others subscribed to the thread may not want to be bothered with the discussion, while others who are ignoring the thread (thinking it's a long, drawn-out, beating-a-dead-horse discussion) may never see a valuable discussion take place. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] bucle while for to msqyl
On Sep 16, 2012 4:33 PM, El Ale... alexissauc...@gmail.com wrote: hi! im new in this forum, i not speak very good english, apologise im spanish. I have a problem, need one infinit bucle to mysql only true if false break this, for example: Que paso, Alex? La lista de PHP en espanol es aqui: http://php.net/mailinglists Lo siento para me espanol. prueba.php: ? include(conexion.php); do { echo $numero; sleep(1); if ($numero == 1) reset; continue; break; } while (true); ? 3 connect to mysql conexion.php: ? $conexion = mysql_connect(localhost, alexis, 123456); mysql_select_db(probando, $conexion); $queEmp = SELECT n FROM numero WHERE n LIKE 1; $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error()); $totEmp = mysql_num_rows($resEmp); if ($totEmp 0) { while ($rowEmp = mysql_fetch_assoc($resEmp)) { $numero = $rowEmp['n']; } echo $numero; } mysql_close($conexion); ? What I do is to run the loop as long as the value $ number is equal to 1 in mysql I have a single field called n with the value 1 and runs, now the problem is the next, I run the loop with the value 1 in mysql and it runs fine but when I go to mysql and change the value to 2 (which would be an incorrect and should leave) the loop ignores him and continues running, I was reading a lot about the loops but I can not make it work in this way could you please give me a hand with this? or if I'm wrong What else I can do an infinite command if it fulfills a function and if they do not?. Best regards
Re: [PHP] How to limit source IP in PHP
On Wed, Sep 12, 2012 at 10:18 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: Is PHP able to 'force' binding IP? I hoped there was an external directive I did not see, but probably this is a PHP lack. Not at all. Essentially, PHP is an interface to underlying software, OS commands, and APIs. You'd have to configure the system to bind requests, as PHP does not presently have that capability (and, to my knowledge, there's no plan to change that). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to limit source IP in PHP
On Wed, Sep 12, 2012 at 11:38 AM, Tonix (Antonio Nati) to...@interazioni.it wrote: So, the answer is no, PHP is not able to do that. There is an (heavy) BASEDIR directive for disk, but nothing equivalent (and simpler) for IP. That's correct. However, that doesn't mean you can't put in a feature request at https://bugs.php.net/ to see if it can be included in a future release. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The end of mysql
On Fri, Sep 7, 2012 at 9:58 PM, Jim Giner jim.gi...@albanyhandball.com wrote: So with the announced end of the mysql functions (and switching to a different extension), one would think that my isp/hoster would be a bit more interested in my dilemma. I tried today to create my first mysqli-based test script and found that I didn't have that extension. A series of emails with my tech support told me that the shared server farm does not get mysqli - only their business servers. Since I dont' have a need for and want to pay more for a 'business server', I'm told I'm s... outta luck. Any idea on the approximate date when mysql truly goes away - ie, when is the proposed (next) update that will completely refuse to recognize it? Might be ammunition for me. There is no date yet, but I can say that just today the first serious discussion regarding the first release of the PHP 5.5 branch occurred, with a (very) preliminary target date of February or March of 2013. It's far more likely to see such a major BC change in at least a new minor branch. As for that happening in either the 5.4 or 5.3 series, I wouldn't consider that a serious possibility by any means. As for your hosting provider, it baffles me why they wouldn't support MySQLi, but a quick evaluation shows they still use old versions of Apache and OpenSSL, and are still using unpatched versions of PHP 5.2 in production. That said, they might keep their non-business support to a bare minimum to help control cost, though it does sacrifice some security and functionality. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] a little trickery
On Sat, Sep 8, 2012 at 10:49 AM, Stuart Dallas stu...@3ft9.com wrote: Is there just one image in the folder that starts with the 9 digit number? In that case it's dead simple (untested code): ?php function completeImageFilename($prefix) { $matches = glob('images/property_pics/'.$prefix.'*'); return $matches[0]; } echo 'img src='.completeImageFilename($row['MSL_No']).' /'; ? Stuart is, as usual, right on. Rather than do the filesystem handlers and loops, you should definitely consider glob(). Not only is it quicker, cleaner, and easier to use, but it's far less resource-intensive than your current implementation. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The end of mysql
On Sat, Sep 8, 2012 at 11:40 AM, Paul M Foster pa...@quillandmouse.com wrote: Please excuse my ignorance. I feel like I just stepped into the middle of a conversation. What's this about announced end of the mysql functions? Who exactly announced what, and is there a link to whatever announcement somewhere? Right now, it's an extended soft deprecation. It's been discussed since 2010. You can find a direct link from June here: https://bugs.php.net/bug.php?id=62213 -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax error breaking in and out of php into html code
On Sat, Aug 25, 2012 at 6:54 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: I've just inherited some (pretty awful code) that I have to make some edits to, and came across a bit of a problem. A lot of the code breaks in and out of PHP and into HTML code: ?php while(condition) { ? lisome html here/li ?php } ? But when I check this my PHP parser is saying that this is a syntax error (checked in the browser and CLI). I know this is code from a working site, so it must be a setting within my PHP configuration. Now, I'm intending to re-write this anyway, as the logic is all over the place (SQL queries within the HTML, no separation of code and content, dozens of warnings all over the place) but I was wondering what setting causes this. It's mostly a curiosity thing really, as this thing is going to be re-written faster than an school project the eve before hand-in. If it's not a violation of your arrangement with the owner of the code, Ash, you can send it to me directly, off-list, and I'll take a look at it. I'm curious to see what might be causing the syntax errors between PHP deployments as well. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] echo into variable or the like
On Tue, Aug 21, 2012 at 12:01 AM, s@optusnet.com.au wrote: Hi, this is my first post so forgive me if I missed a rule and do something wrong. I have this code, echo $_SERVER['PHP_SELF'].?; foreach ($_GET as $urlvar=$urlval) echo $urlvar.=.$urlval.; It works by it’s self. I want to insert the output in a table. Is there a way to ‘echo’ into a variable(i.e. make the output of this echo the value of a variable) or am I on the wrong track all together? This question actually belongs on the PHP General mailing list. As for echoing into a variable, the only way that's really possible is with output buffering (ob_start(), ob_get_contents(), ob_end_clean(), et al). However, you don't need (and shouldn't want) to do this here. Instead, as your snippet really won't do much of anything useful, you should (entirely) rewrite your code to look something like this, for an HTML table: ?php echo $_SERVER['PHP_SELF'].'?'.PHP_EOL; echo 'table'.PHP_EOL; foreach ($_GET as $key = $value) { echo ' tr'.PHP_EOL; echo ' td'.$key.'/td'.PHP_EOL; echo ' td'.$value.'/td'.PHP_EOL; echo ' /tr'.PHP_EOL; } echo '/table'; ? However, since it looks almost as if you're trying to build a query string based upon the supplied GET variables, you may want to try looking into http_build_query(). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cost of redirect and site domain switch? Good Practice / Bad Practice / Terrible Practice
On Aug 18, 2012 4:49 PM, Paul M Foster pa...@quillandmouse.com wrote: I can comment on part of this based on what I was recently told by an SEO company. Let's assume you've got a bunch of SEO goodness (recognition, Google search placement, etc.) going for you on site1.com. If you a permanent redirect (301) to site2.com, all that SEO goodness will transfer straight across to the new site. You may take this with whatever grain of salt you like, considering it comes from an SEO company and I consider SEO companies almost uniformly liars and ripoff artists who generally have no earthly idea what they're talking about. In this case, what they're saying makes sense to me, and I suspect it's true. That doesn't sound right to me. If so, I'd presume a lot of folks would be doing that as a service. I have several PR6-8 domains myself, and could see how someone (not me) might say, since I'm really not using these domains anyway, I'll 301 to a paying customer for them to include their ranking. If for no other reason than I haven't heard of folks doing this (read: SPAM), I'd guess it's not true. Still, other folks are far more knowledgeable than Yours Truly when it comes to SEO. Just for good measure, I've CC'd one (Thiago Pojda) to see if he'd be interested in chiming in on the matter.
Re: [PHP] Need to have form protection techniques
On Fri, Aug 17, 2012 at 12:05 AM, Ansry User 01 yrsna.res...@gmail.com wrote: I need to know the forms validity techniques for Php. This will probably take a while to absorb, so you may need to revisit this page several times: http://oidk.net/php/know-the-forms-validity-techniques-for.php -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cost of redirect and site domain switch? Good Practice / Bad Practice / Terrible Practice
On Fri, Aug 17, 2012 at 3:35 PM, Tristan sunnrun...@gmail.com wrote: So, I need to change from somedomain.com to somenewdomain.com I was thinking of doing this 1) create an alias to the site somenewdomain.com to point to current server 2) run permanent 301 redirect from somedomain.com to somenewdomain.com I was thinking this was a clean safe way to do it so we dont have to run a global find replace. Concerns might be but, I don't know for sure? 1) SEO 2) processing / time / cost for the 301 redirect on any old somedomain.comrequests What do you guys think? Well, first, you get a 0.2-point deduction for not asking anything about PHP, but since it's Friday and the folks here are about the most creative and intelligent bunch of minds on any mailing list (call be biased, I don't care), you still qualify for a medal. Congratulations. If it were me, and this is an Apache box, I would * Add a ServerAlias somenewdomain.com directive to the somedomain.com VirtualHost entry * Add a mod_rewrite rule to your .htaccess file in the web root of somedomain.com: RewriteEngine On RewriteCond %{HTTP_HOST} somedomain\.com$ RewriteRule ^(.*)$ http://somenewdomain.com/$1 [QSA,L,R=301] Remember to modify your rewrite stuff to be compatible with the present SSL status of the request, and do whatever you need to do with regard to any subdomains or whatever. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cost of redirect and site domain switch? Good Practice / Bad Practice / Terrible Practice
On Fri, Aug 17, 2012 at 4:30 PM, Tristan sunnrun...@gmail.com wrote: My colleague is saying but I still think we should change all the references to someolddomain.com to some newdomain, especially in the code base, database etc... I don't want to introduce more problems if a find/replace doesn't go right. Is there any valid reason for doing the quoted above or any argument against doing that. If you have the luxury of time and resources, your colleague is absolutely correct. In fact, now might be the ideal time to convert all hard-coded values to a variable or definition that need only be changed once should this recur. Either way, the find/replace should definitely be done. Should anything happen to the original domain - expiration, transfer, or even a temporary DNS routing issue - you're screwed. You can't 301 from something that isn't there in the first place (though, for good measure, you can 301 *to* anything you'd like). From Linux, it's simple to write a 'for' loop to find, cat, and sed everything in the *.php, *.inc, *.html, etc. files, and database options are even easier. That said, of course, make sure you've got everything backed up just before you change the stuff, should things go awry --- and without a current backup, you can bet your ass they will. Murphy's Law. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] about unlink
On Tue, Aug 14, 2012 at 4:22 AM, Tolga kacmazto...@gmail.com wrote: hi, i have a very annoying problem with unlink() i use win7 and wamp server (apache 2.2.22 php 5.4.3) when i try to use unlink: SCREAM: Error suppression ignored for Warning: unlink(aaa/bbb.ccc): Permission denied in C:\wamp\www\ddd\index.php on line /34/ What are the specific ownership and permission mode properties on that exact file and directory? neither the folder, nor the files are read-only. i give every user on win, all the permissions on folders files. i look on google for same error, but nothing useful. some says 'you need to give PHP delete permission' but didnt say how. i run wamp with Run as Administrator. by the way, php can write, create (copy(),file_put_contents(),move_uploaded_file(),mkdir()) files or folders. there is no problem with it and there is no problem with deleting (rmdir) folders too. but there is problem when it comes to the deleting files. Hopefully that's just for development, and you're making much more serious security considerations for anything production-worthy or even simply network-facing. i really need some suggestions about how to solve this, its really annoying and i dont want to throw my pc to the wall or punch it on the screen. Yeah, neither option would resolve the issue anymore. The monitor-punch-fix feature was removed in PHP 3.0.4. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP APC 3.1.11
On Tue, Aug 14, 2012 at 7:14 AM, Vedran Rodic vro...@gmail.com wrote: Hi, PHP APC 3.1.11 is marked beta, however it seems to contain important bugfixes. Is it safe to deploy on production (we're currently using 3.1.9)? Or it is better to wait for 'stable' release. When is next 'stable' expected? This question is better directed to the PECL development mailing list (CC'd). You can - and should - subscribe to that list by sending a blank email to pecl-dev-subscr...@lists.php.net if you want to follow along with the discussion and ensure that you receive all messages in the thread. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-WEBMASTER] php error
On Mon, Aug 13, 2012 at 2:32 PM, tomas lagro tomas.la...@hotmail.com wrote: Hello, my name is tomas, i'm having a problem and i've checked a lot of times the script and it is not that, because in my local xampp server it works correctly, the issue is that i have a form on my webpage and when you submitt it, the post values are not being requested, so the query array has no values and has no result because of this. Is this a php.ini mistake? what can it be because its driving me crazy. Thanks for ypur time This email belongs on the PHP General mailing list (CC'd), Tomas, and you should subscribe to that list at php-general-subscr...@lists.php.net to follow the discussion and get help with your questions. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Too many open files
On Fri, Aug 10, 2012 at 10:22 AM, Robert Cummings rob...@interjinn.com wrote: On 12-08-09 08:01 PM, Al wrote: I can't find a way to see what files could be open or what the limit is. Site is on a shared server, cPanel. ^ THIS is probably your problem. Too many open files indicates that either the user OR the OS has reached its limit of allowed open file handles. Open files are those used by the OS and every user on the shared server. The setting can be changed but you'll need an administrator to increase the number of allowed open files. I suspect it's at the OS level if indeed you only have 100 files open (though you likely have more due to files opened for you by the OS or whatnot. Rob is exactly right. This is managed via the kernel and ulimit, to prevent excessive resource usage. Often it's a temporary problem, but if it consistently occurs, your host may either be improperly configured or, more likely, overselling resources. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP session variables
On Wed, Aug 8, 2012 at 11:24 AM, Ansry User 01 yrsna.res...@gmail.com wrote: I am setting the _SESSION variables in one of my file, but whenever I leave the php page session variables are not accessible. Not sure what I need to do additionally other then defining _SESSION[]. Any pointer. If you're not telling PHP (in php.ini) to auto-start the session, then you'll need session_start() before accessing $_SESSION. If you're certain the session is being properly instantiated in the code, make sure that the user as which the web server (Apache, et al) is running has permission and available disk space to access the session storage media (file system such as /tmp, database table, et cetera). -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Coding Web search engine in PHP
On Mon, Aug 6, 2012 at 1:15 PM, shiplu shiplu@gmail.com wrote: Where *do* come up with those names :) Sorry I couldn't understand the meaning of your sentence. May be this is due to cultural difference. Anyway, Solr is a search engine. Nutch is a crawler. Both can be integrated. Then one can send query to solr server from php using api. See http://wiki.apache.org/solr/SolPHP She was just giggling about the silly-sounding names for high-quality products. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Coding Web search engine in PHP
On Mon, Aug 6, 2012 at 1:42 PM, shiplu shiplu@gmail.com wrote: Thanks Daniel for clearing. I am pretty bad in English. :( Don't sell yourself short. Your English seems fine to me --- better than many native-speakers. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get_browser error
On Fri, Aug 3, 2012 at 9:42 AM, admin ad...@buskirkgraphics.com wrote: Anyone using Get_browser() notice that IE 9 is reporting as IE 7? I am aware of compatibility mode in IE 9 but that should not change the version information sent will it? My guess is that it would, in fact, because it would send its user-agent string as the previous version. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating drop-down menus
On Fri, Jul 20, 2012 at 10:21 AM, tamouse mailing lists tamouse.li...@gmail.com wrote: On Jul 20, 2012 9:20 AM, tamouse mailing lists tamouse.li...@gmail.com wrote: On Jul 19, 2012 8:31 PM, Tedd Sperling t...@sperling.com wrote: On Jul 19, 2012, at 1:50 PM, Daniel Brown danbr...@php.net wrote: As an aside on the subject of jQuery, our very own Jay Blanchard has written a comprehensive book on the topic entitled Applied jQuery: Develop and Design: http://links.parasane.net/92xb Just bought it -- thanks. I'll add it to my other three jQuery books Always support the people on this list. I have to ask, is it available in a non-DRMed shook format? Ok, so shook is what ebook autocorrects to Not sure. Jay, can you address Tamara's question? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] difference PEAR PECL
On Thu, Jul 19, 2012 at 12:18 PM, Mihamina Rakotomandimby miham...@rktmb.org wrote: Hi all, Wondering about the difference between PECL and PEAR, I found: http://board.phpbuilder.com/showthread.php?10339238-Pecl-vs-Pear Is it a suitable answer? It's close. PECL (sometimes pronounced pickle) stands for PHP Extension Community Library, which is - as the name suggests - a library of PHP extensions. Things like APC, memcache, amqp, and sqlite are examples of popular PECL extensions. PECL is a repository of compiled binaries. By contrast, PEAR - the PHP Extension and Application Repository - is actually not a library of extensions in the common definition, despite what the name suggests. Instead, it's a collection of unrelated reusable components, written in PHP, to be used for application development. PEAR is technically considered a framework, but is more commonly used as individual classes, as opposed to a full framework deployment in the traditional sense, such as Yii, Zend, CodeIgniter, 2x4, et al. Popular PEAR packages include Mail, PHP_Codesniffer, Date_Holidays, and various API service components such as those used with Amazon Web Services (AWS). PEAR components are supposed to follow the PEAR Coding Standard as well. If unsure which library to check for a given component, consider the following: PEAR components are always First_Letter_Capitalized, while PECL extensions are generally not. If so, several Linux ditribution have: * php-pecl-xxx (PECL) * php-pear-vvv (PEAR) * php-yyy (???) packages (rpm and deb). What about the last kind? php-pecl-xxx, php5-pecl, et cetera, are the PECL support libraries and may also refer to PECL extensions. php-pear-vvv, php5-pear, et cetera, are the PEAR support libraries and may also refer to PEAR components. php-yyy, php5-yyy, et cetera, are individual packages. For example, php_mysql or php5-cli. If possible, however, when installing PECL or PEAR packages, use the pecl or pear command line tool, respectively. For example: pecl install pdo_sqlite -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php