Re: [PHP] SERVER_PORT always at 80 ?
Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port 80 Regards, Julien.P 2008/4/11 Thiago Pojda <[EMAIL PROTECTED]>: > {Top posting} > > What shows your phpinfo() on both ports? > > Is it really running your 5.3 in :81? > > > Regards, > Thiago > > -Mensagem original- > De: Julien Pauli [mailto:[EMAIL PROTECTED] > Enviada em: sexta-feira, 11 de abril de 2008 09:28 > Para: PHP General list > Assunto: [PHP] SERVER_PORT always at 80 ? > > Hi all, I'm running Windows XP, and here is a piece of my > apache (2.2.8) conf : > > --- httpd.conf --- > ... ... ... > Listen 81 > Listen 80 > Listen 8080 > LoadModule php5_module "e:/php/php5apache2_2.dll" > LoadModule fastcgi_module modules/mod_fastcgi.dll AddType > application/x-httpd-php .php ... ... ... > > --- vhosts.conf > > NameVirtualHost 127.0.0.1:81 > > >ServerName myserver >DocumentRoot e:/www >ScriptAlias /php/ "e:/php53/" >Action php5-fastcgi "/php/php-cgi.exe" >AddHandler php5-fastcgi .php > > > That's a configuration to be able to run both PHP 5.2 (as > apache module), and PHP 5.3 (throught fast-cgi) on the same > apache2 instance. > There are no apache rewrite rules in my stuff. > > All works right, the only problem is that in both cases, > $_SERVER["SERVER_PORT"] returns 80, even when I'm connected > throught port 81. > > Is it a fastcgi / Apache bug or does it come from PHP or even me :-) ? > > > Cheers > Julien.P > > >
Re: [PHP] SERVER_PORT always at 80 ?
I would think PHP is just passing through what it receives from Apache. I assume it's just passing through environment variables it gets from the server. Can you disable all the other ports and only have :81 running to ensure there is no confusion? On 4/14/08, Julien Pauli <[EMAIL PROTECTED]> wrote: > Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port 80 > > Regards, Julien.P -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Developing existing java portal in php
Hi, I know that php is an interpreter, like shell. It won't produce any object or executable file. Now the portal has to be developed such that the php source shouldn't be visible in the product. Means the product should be able to produced in binary format. Is it possible to embed php code in any other programming language such as C? Or there any other tool which can store/embed the php script in binary format? Has anybody has implemented this kind of stuff? Is it possible? Please let me know at the earliest.. Thanks for your guidance, Sangamesh On Sat, Mar 29, 2008 at 12:10 PM, Sangamesh B <[EMAIL PROTECTED]> wrote: > Thanks for the reply. > > Can it be done by just using php + html or perl + html. > > Also, May I know a beginners document to start working on html, php and > perl. > > Thanks, > Sangamesh > > > > On Fri, Mar 28, 2008 at 1:50 AM, ganu <[EMAIL PROTECTED]> wrote: > > > > > > > On Thu, Mar 27, 2008 at 7:52 AM, Sangamesh B <[EMAIL PROTECTED]> > > wrote: > > > > > Hi all, > > > > > > Here is one web portal product which is already developed using java > > > tools. > > > I don't know java, php or perl. But I can learn php quickly compared > > > to > > > java. > > > > > > Learning PHP,Perl is very easy as compare to Java. > > > > > > > > > > > My question is: Is it possible to develop such web portal using php & > > > html? > > > > > > Yea, is possible. > > > > > > > > > > > Let me explain how the java portal/product works: > > > > > > The user logs in to the portal with his user name and password thru > > > web > > > browser by using a public ip or for example say xyz-portal.com > > > > > > The user name and password are the user names of the Linux OS. So > > > username > > > authentication is required. > > > > > > In the next page, the user accesses the preinstalled applications ( > > > these > > > are C or Fortran apps) and submits the job. > > > While submitting the job, he is allowed to give the command line > > > options and > > > input file. The input files are present in his home directory. These > > > files > > > should be listed in combo box. > > > > > > It doesn't mean that, all installed apps in linux must be listed in > > > the > > > portal. There should be a mechanism to add a particular application to > > > the > > > portal ( part of administrator's work). And all apps which are to be > > > displayed in portal are in a different dir, say /usr/local/bin. > > > > > > This portal is totally based on the server. i.e. The user accesses the > > > portal and submits his application job from client system to run the > > > job in > > > the server. The client system uses only web browser. So other software > > > can > > > not be used to do this. > > > > > > Regarding php, I know that linux commands can be bypassed thru php. > > > > > > So can any one tell me whether this can be done using php with the > > > above > > > mentioned conditions/facilities? > > > > > > > > > Thanks & Regards, > > > Sangamesh > > > > > > I think you can do all front end things in PHP and html and you can do > > all system calls with Perl. > > Perl will be fast and easy for all linux things. > > > > you can refer this for calling Perl from PHP page - > > http://devzone.zend.com/node/view/id/1712 > > > > > > --- > > >
Re: [PHP] Quarters -- ERRORS --
tedd wrote: Hi gang: Sorry for the lame app, but the program worked for Safari (Mac and Win). However, I did get it to work for FF and a couple of other browsers (Mac and Win), see again: http://webbytedd.com/quarters But the critter is dead in the water for all versions of IE -- if -- I don't figure out a way around the following single statement. document.getElementById(id).checked = true; Granted it's javascript, but all that line does is to set a checkbox variable (id) to 'on'. Surely, $M code can do that, right? After reading a bunch, it seems that M$ has a better way to do things (big surprise there, huh?) and thus does not use the document.getElementById(id) thing that everyone else in the world uses. Instead, they use something "better" and it's not documented well as is typical. Unfortunately, I have not been able to find a M$ work-a-round. So, what I need is: if (document.getElementById) { document.getElementById(id).checked = true; } else { < inset solution here. >> } All the code has to do is to set a simple checkbox to 'on' in IE. Anyone have any ideas? Cheers, tedd PS: I'm going to post this on a js list as well. PPS: You have to wonder how much more technically advanced we would be if we weren't always held back by the "what's in it for me" shortsightedness of M$. What you talkin' bout? Document.getElementById() works fine in IE5 and later. There must be some other error. You could check that document.getElementById(id) is actually returning something - if it fails it returns null. Maybe you have given your checkbox a name and not an id, although that should fail with FF (and Safari) too... It's fine on IE7 - anything older than IE7 is too broken to be usable, really. :) -- Peter Ford phone: 01580 89 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: File Upload Security
Al wrote: Thanks guys. I had written a newer version restricted to images which checks MIME and image width and height. I have one application which needs a text file. I think I'll have my users hide a password in it and scan the whole file for other signs of scripts, etc. Al wrote: One of my sites has been hacked and I'm trying to find the hole. The hack code creates dirs with "nobody" ownership, so it's obvious stuff is not via ftp [ownership would be foo] Site is virtual host, Linux/Apache I'm concerned about a file uploader my users use to upload photos. Can anyone see a hole in this scrip? Can my code upload an executable masquerading as an image file? You probably need a deeper inspection than checking the extension - that's Microsoft thinking... You can't trust what the client is telling you - even the MIME type sent by the browser is no guarantee. Since you're on Linux, why not look at using the 'file' shell command to get a more detailed inspection of the upload. I made a basic function like this a few years ago - probably needs a bit of tweaking: $mimecmd = "/usr/bin/file -b -m ".escapeshellargs($magicFile)." ".escapeshellargs($file)." 2> /dev/null"; $ret = exec($mimecmd); if (!$ret) { $ret = "unknown"; } return $ret; } ?> The global $magicFile is the tricky bit - you need to find a nice Unix magic numbers file that returns mime types (they're easier to parse than regular magic number responses). Probably something like /usr/share/misc/magic.mime, but that depends on the system. -- Peter Ford phone: 01580 89 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quarters -- ERRORS --
What you talkin' bout? Document.getElementById() works fine in IE5 and later. There must be some other error. The error was that I was passing the id as an array and not as a string. What's interesting is that only IE's would not accept that mistake. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: File Upload Security
I don't pay any attention to MIME sent by the client. I check the MIME returned from getimagesize() and I'm not too certain of it. i need to do further research. I do check the images have width and height and I extract the embedded text stuff. I'm going to look into your suggestion. Thanks. Peter Ford wrote: Al wrote: Thanks guys. I had written a newer version restricted to images which checks MIME and image width and height. I have one application which needs a text file. I think I'll have my users hide a password in it and scan the whole file for and other signs of scripts, etc. Al wrote: One of my sites has been hacked and I'm trying to find the hole. The hack code creates dirs with "nobody" ownership, so it's obvious stuff is not via ftp [ownership would be foo] Site is virtual host, Linux/Apache I'm concerned about a file uploader my users use to upload photos. Can anyone see a hole in this scrip? Can my code upload an executable masquerading as an image file? You probably need a deeper inspection than checking the extension - that's Microsoft thinking... You can't trust what the client is telling you - even the MIME type sent by the browser is no guarantee. Since you're on Linux, why not look at using the 'file' shell command to get a more detailed inspection of the upload. I made a basic function like this a few years ago - probably needs a bit of tweaking: $mimecmd = "/usr/bin/file -b -m ".escapeshellargs($magicFile)." ".escapeshellargs($file)." 2> /dev/null"; $ret = exec($mimecmd); if (!$ret) { $ret = "unknown"; } return $ret; } ?> The global $magicFile is the tricky bit - you need to find a nice Unix magic numbers file that returns mime types (they're easier to parse than regular magic number responses). Probably something like /usr/share/misc/magic.mime, but that depends on the system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Writing MySQL Update Query with NULL value
At 1:42 PM +1000 4/14/08, Chris wrote: Your query should end up looking like: $query = "UPDATE phones set last_name='${last_name}', first_name='${first_name}' ..., suffix=${suffix}"; Why not this: $query = "UPDATE phones set last_name='$last_name', first_name='$first_name' ..., suffix=$suffix"; Why the "{}"? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SESSION problem [NOW SOLVED]
On Fri, Apr 11, 2008 at 5:34 PM, tedd <[EMAIL PROTECTED]> wrote: > At 11:33 AM -0400 4/11/08, Daniel Brown wrote: > > > On Fri, Apr 11, 2008 at 10:29 AM, Ford, Mike <[EMAIL PROTECTED]> > wrote: > > > > > > > > Sounds like a register_globals=On issue > > > > > > >It does to me, as well. I know, Tedd, that on the php1.net site > > that you mentioned to me off-list, I'm about 99% positive that it's > > the reason. Shared hosts generally keep register_globals on and leave > > it up to the individual customer to turn it off. On that particular > > server, though, since it's mostly developers, I may just send out an > > email to get feedback and turn it off at the main, and then allow > > ya'all to override it on your individual sites. > > > >The thing that makes me wonder (and I haven't checked myself to > > verify) is why two sites, on the same server, having the same > > > > Hey! > > I found it and you were right. > > On my webbytedd.com site, I had a htaccess file that read: > > AddDefaultCharset utf-8 > > php_value register_globals 0 > php_value magic_quotes_gpc 0 > php_value magic_quotes_sybase 0 > php_value magic_quotes_runtime 0 > > And I didn't have that htaccess file on my sperling.com site. However, what > fooled me was in both scripts I had: > > ini_set( 'register_globals', '0' ); > > So, I thought that was the same, but apparently it's not. Maybe because my > server had safe_mode ON it won't allow it -- I don't know. Another question > for another time. > > Thanks a bunch guys! > > Cheers, > > tedd > > PS: I did try the session_write_close and several other suggestions, but > none worked. The register_globals value is something that cannot be set at runtime. If you pass it to ini_set(), it will appear to work -- you won't get an error and successive calls to phpinfo() will show the new value; however, by the time PHP gets far enough down the chain to execute your ini_set() command, PHP has already determined whether it should register global variables. The manual indicates that this wasn't always the case, but (not knowing the internals then or now) I don't understand how. (The table on that page says it was PHP_INI_ALL for versions up to 4.2.3.) http://us.php.net/manual/en/ini.core.php#ini.register-globals Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Writing MySQL Update Query with NULL value
On Sun, Apr 13, 2008 at 10:24 PM, Bill Guion <[EMAIL PROTECTED]> wrote: > > However, when I echo out this query, I get: > UPDATE 'phones' SET 'last_name' = Doe, 'first_name' = John, 'suffix' = , > 'phone' = 123-456-7890 WHERE 'phone_index' = 323; Bill, You're missing quotes around your data, and using quotes on field names. Instead, try structuring your query so that it will output like this, with quotes around data, and backticks around table and field names.: UPDATE `phones` SET `last_name` = 'Doe', `first_name` = 'John', `suffix` = '', `phone` = '123-456-7890' WHERE `phone_index` = '323' NOTES: * See the missing semicolon at the end? It's because you shouldn't use the semicolon in PHP's mysql_*() functions. [http://php.net/mysql_query] * You may also want to force a LIMIT 1 to the end of that query. I'm sure `phone_index` is a unique AUTO_INCREMENT, but I still prefer to tack it on just to ensure that MySQL knows we're only messing with one thing. It's also an added layer of security in case (God forbid) anything goes wrong. -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quarters
On Fri, Apr 11, 2008 at 11:08 PM, Casey <[EMAIL PROTECTED]> wrote: > On Fri, Apr 11, 2008 at 6:49 AM, tedd <[EMAIL PROTECTED]> wrote: > > > > Hi gang: > > > > Check out my new game: > > > > http://webbytedd.com/quarters/ > > > > What do you think? > > > > Cheers, > > > > tedd > > > > PS: I originally wrote the game for the Mac over eight years ago. > > -- > > --- > > http://sperling.com http://ancientstones.com http://earthstones.com > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > I won. Finally figured out the secret, without $5 >_> > > -- > -Casey Really? I was starting to think that the secret was the coins that kept magically reappearing. I gave up. (That was in IE, bearing through the JavaScript error alert boxes.) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SERVER_PORT always at 80 ?
Ok I did that, but it's the same. HTTP_HOST says myhost:81 , but SERVER_PORT still says 80 Cheers Julien.P 2008/4/14 mike <[EMAIL PROTECTED]>: > I would think PHP is just passing through what it receives from > Apache. I assume it's just passing through environment variables it > gets from the server. > > Can you disable all the other ports and only have :81 running to > ensure there is no confusion? > > On 4/14/08, Julien Pauli <[EMAIL PROTECTED]> wrote: > > Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port 80 > > > > Regards, Julien.P >
[PHP] where to put a function
Probably been answered a thousand times; if so, just tell me where to look. I have a function that includes a specific sql query that is used on only one page on the site. Should that function be coded (1) in the page itself, (2) in a separate file that only that page includes, or (3) in a master file that contains all the functions used on the site and is included on every page? I've been doing #1 (not actually a function in this case) but #3 is appealing, especially since I would implement it as OOP and the page itself would be really just a template. What is the cost of parsing a bunch of functions that are not used on a given page load? -- "If some peoples pretend that history or geography gives them the right to subjugate other races, nations, or peoples, there can be no peace." -- Ludwig von Mises Rick Pasotto[EMAIL PROTECTED]http://www.niof.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] where to put a function
On Mon, Apr 14, 2008 at 9:34 AM, Rick Pasotto <[EMAIL PROTECTED]> wrote: > Probably been answered a thousand times; if so, just tell me where to > look. > > I have a function that includes a specific sql query that is used on > only one page on the site. Should that function be coded (1) in the page > itself, (2) in a separate file that only that page includes, or (3) in a > master file that contains all the functions used on the site and is > included on every page? each have their merits and detriments. 1. down-and-dirty, if you put it here, you may have to move i later 2. more organized, somewhat future conscience, because now it can already be used by other code simply by including the file 3. hmmm. well, i would only put it in a file w/ other functions related to it. if you have a small app it could make sense to just toss a bunch of seemingly random functions together in one file, but after a while that could get pretty messy. What is the cost of parsing a > bunch of functions that are not used on a given page load? > not much, but less if you have an opcode cache. i would be more worried about code organization than performance on this one. -nathan
Re: [PHP] Need a simple one time search utility
On Sat, Apr 12, 2008 at 3:13 PM, Al <[EMAIL PROTECTED]> wrote: > I need a simple utility that simulates GREP to find a certain string in any > php files on my website. > > Site is on a shared host w/o shell access so I can't run GREP. > > I can write a PHP scrip to do it; but, this is a one time thing and I was > hoping to find something to save me the effort. Al, For yourself and others searching for the same type of thing in the future, I threw this script together. There's always room for improvement, but it's a fully-functional trunk with which to start. All native PHP functions, no external exec() access required. Full source linked from the bottom of the page. http://pilotpig.net/code-library/recursive-grep.php -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] where to put a function
On Mon, Apr 14, 2008 at 11:34 AM, Rick Pasotto <[EMAIL PROTECTED]> wrote: > Probably been answered a thousand times; if so, just tell me where to > look. The archives are always your best friend when searching for specific data. The two best are: http://www.marc.info/ http://www.gmane.org/ > I have a function that includes a specific sql query that is used on > only one page on the site. Should that function be coded (1) in the page > itself, (2) in a separate file that only that page includes, or (3) in a > master file that contains all the functions used on the site and is > included on every page? If you only want to include it on one page, and then especially if there are no includes in that page as of yet, then keep it in the same file. It'll be completely portable and self-reliant, which will keep execution time (and resource usage) to the minimum possible amount. If you plan on extending the site in the future and think you'll reuse the function, place it in an include file site-wide. > I've been doing #1 (not actually a function in this case) but #3 is > appealing, especially since I would implement it as OOP and the page > itself would be really just a template. What is the cost of parsing a > bunch of functions that are not used on a given page load? There's not a great deal of overhead with including unused functions aside from general syntax and parse checking via the runtime. For example, even though a function isn't called, if there's a missing ) on a non-commented line, it'll fail fatally. Unless you have thousands of lines of functions, the benefit will probably outweigh the cost in most situations. -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] standard format for Web portal administration side
On Sat, Apr 12, 2008 at 1:19 PM, Alain Roger <[EMAIL PROTECTED]> wrote: > Hi, > > I've seen several web portal and their dedicated administration side. > some of those administration (portal) are according to w3c standard (1024 px > large), but most of them use the full screen width. > > therefore i would like to know if there is a standard size (width / height) > for web portal administration side ? > what do you do usually ? http://www.google.com/search?q=web+design+mailing+list It's not a PHP question, so you're not likely to get as good of a response as you will on a web-design-specific mailing list. -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] where to put a function
On Mon, Apr 14, 2008 at 11:34 AM, Rick Pasotto <[EMAIL PROTECTED]> wrote: > I have a function that includes a specific sql query that is used on > only one page on the site. Should that function be coded (1) in the page > itself, (2) in a separate file that only that page includes, or (3) in a > master file that contains all the functions used on the site and is > included on every page? Every time you include/require a file there is stat & compile stages that do add up over the execution of a script. It will do this on every single page request unless you have an opcode cache installed. Now with that said, it is better to organize your site than to build for optimum performance. Most sites will never reach the traffic necessary required to deal with tweaking every aspect for performance. You'll end up making it harder to maintain and see the flow of the site which costs you time. This is all subjective and there are many factors in it. But usually programmer time is more important than script execution time. Don't completely ignore it though that is just as bad. :) I organize all of my data access objects/functions very meticulously. In OOP sites I will create value objects & gateway classes for each table and their only job is to work on said data. For procedural sites I will create a file that contains functions that relate to a given table's data. In your case I would create a single include file somewhere such as /app_name//functions.php that would work against the table in question. The function prototype would be app_name__fetch_all(); or something along those lines that would return a data set of some sort. This way if you need to re-use it, extend it, find it, or get rid of it there's no guessing where it is. You can one off this case, but what about when you make other pages? What if they do have lots of functions that need to be organized? Then you've broken the consistency between where your functions are. Some might be in include files, others might be elsewhere. Sometimes it seems like overkill, but having a clear methodology for organization in the beginning is better than when you've got 30 files that play differently. Plus when you're really consistent like this you can easily view the real guts of your application and see how it works over time much easier without searching templates. Separation of code & design is a key for success! Just my two cents. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] standard format for Web portal administration side
I've seen several web portal and their dedicated administration side. some of those administration (portal) are according to w3c standard (1024 px large), but most of them use the full screen width. therefore i would like to know if there is a standard size (width / height) for web portal administration side ? what do you do usually ? http://www.google.com/search?q=web+design+mailing+list It's not a PHP question, so you're not likely to get as good of a response as you will on a web-design-specific mailing list. 1024(x768) is a W3C standard? News to me. Why limit yourself to only part of the browser window? Why not use it all? You can make websites that degrade when there's less screen real estate. Yes it takes marginally longer to build than a simple fixed width site, but that's life. And once it's built, continual coding doesn't really take any more time. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include problems
On Sat, Apr 12, 2008 at 11:06 PM, Bojan Tesanovic <[EMAIL PROTECTED]> wrote: > > On Apr 12, 2008, at 8:28 AM, GoWtHaM NaRiSiPaLli wrote: > > > > if(file_exists("../common/config.ini")) { > > $configData = parse_ini_file("../common/config.ini"); > > } else { > > > > > Try changing above code so it reads > > > if(file_exists("common/config.ini")) { > $configData = parse_ini_file("common/config.ini"); > } else { In your primary file, you could also consider adding: And then, all includes from within that file would be included as such: Finally, on a different note, it may not be in your best interest to keep a .ini extension on a configuration file, since this is generally readable on the web. -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a simple one time search utility
On Mon, Apr 14, 2008 at 12:15 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Sat, Apr 12, 2008 at 3:13 PM, Al <[EMAIL PROTECTED]> wrote: > > I need a simple utility that simulates GREP to find a certain string in > any > > php files on my website. > > > > Site is on a shared host w/o shell access so I can't run GREP. > > > > I can write a PHP scrip to do it; but, this is a one time thing and I > was > > hoping to find something to save me the effort. > >Al, > >For yourself and others searching for the same type of thing in > the future, I threw this script together. There's always room for > improvement, but it's a fully-functional trunk with which to start. > All native PHP functions, no external exec() access required. Full > source linked from the bottom of the page. > >http://pilotpig.net/code-library/recursive-grep.php ~Philip
Re: [PHP] Need a simple one time search utility
On Mon, Apr 14, 2008 at 2:48 PM, Philip Thompson <[EMAIL PROTECTED]> wrote: > >$stringSoMyStatsWillIncrease = " > I know it's only a demo, but there is a small error. You have this string > spit out: > > Sorry, for this demo, only the word `pilopig` is allowed as a search string. > > However, in the if() statement, you test for 'pilotpig'. Small misspelling. > =D > "; > ?> I disabled some of the code tracking until I can stop you fools from flooding the stats! ;-P Thanks for the heads-up on the typo, Phil. Is typing the name of one of your own companies incorrectly as bad as misspelling the name of your own child? God, I hope so -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SERVER_PORT always at 80 ?
you should try Perl or another language. See if you can isolate it to Apache. . Or, you could try to track it down inside of the PHP source and see if for some reason it is hardcoded or incorrectly set. (However, I still think it's from Apache) On 4/14/08, Julien Pauli <[EMAIL PROTECTED]> wrote: > Ok I did that, but it's the same. > HTTP_HOST says myhost:81 , but SERVER_PORT still says 80 > > Cheers > Julien.P > > 2008/4/14 mike <[EMAIL PROTECTED]>: > > > I would think PHP is just passing through what it receives from > > Apache. I assume it's just passing through environment variables it > > gets from the server. > > > > Can you disable all the other ports and only have :81 running to > > ensure there is no confusion? > > > > > > > > > > On 4/14/08, Julien Pauli <[EMAIL PROTECTED]> wrote: > > > Yes it runs on 5.3 on 81 and 5.2 on 80, both phpinfo() show port 80 > > > > > > Regards, Julien.P > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a simple one time search utility
Daniel Brown <[EMAIL PROTECTED]> wrote: > On Mon, Apr 14, 2008 at 2:48 PM, Philip Thompson <[EMAIL PROTECTED]> wrote: > > > > > $stringSoMyStatsWillIncrease = " > > I know it's only a demo, but there is a small error. You have this string > > spit out: > > > > Sorry, for this demo, only the word `pilopig` is allowed as a search > > string. > > > > However, in the if() statement, you test for 'pilotpig'. Small misspelling. > > =D > > "; > > ?> > > I disabled some of the code tracking until I can stop you fools > from flooding the stats! ;-P > > Thanks for the heads-up on the typo, Phil. Is typing the name of > one of your own companies incorrectly as bad as misspelling the name > of your own child? God, I hope so Dang Dan! Between you and Tedd having basic coding/spelling issues, I sure hope it's because you were at the Van Halen Concert!! ;) Tsk, tsk. And to think, your search even came back with the right term, you must have it aliased or something... ;) Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a simple one time search utility
On Mon, Apr 14, 2008 at 12:54 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Mon, Apr 14, 2008 at 2:48 PM, Philip Thompson <[EMAIL PROTECTED]> > wrote: > > > > > $stringSoMyStatsWillIncrease = " > > I know it's only a demo, but there is a small error. You have this > string > > spit out: > > > > Sorry, for this demo, only the word `pilopig` is allowed as a search > string. > > > > However, in the if() statement, you test for 'pilotpig'. Small > misspelling. > > =D > > "; > > ?> > > I disabled some of the code tracking until I can stop you fools > from flooding the stats! ;-P > damn; not after i posted that nice fat class :O Thanks for the heads-up on the typo, Phil. Is typing the name of > one of your own companies incorrectly as bad as misspelling the name > of your own child? God, I hope so let me ask my kids... whoops still single ;) -nathan
Re: [PHP] Need a simple one time search utility
On Mon, Apr 14, 2008 at 3:07 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > > >I disabled some of the code tracking until I can stop you fools > > from flooding the stats! ;-P > > > > damn; not after i posted that nice fat class :O I just double-checked, and your code count was included. I put in a temporary algorithm, and - in the spirit of Google - I'm not going to disclose what it is, so as not to allow people to exploit it. So there! -(8^B) > >Thanks for the heads-up on the typo, Phil. Is typing the name of > > one of your own companies incorrectly as bad as misspelling the name > > of your own child? God, I hope so > > let me ask my kids... whoops still single ;) Keep it that way as long as possible. In going through the calendar a few moments ago, I realized that I have two months and two weeks left of my [relatively] happy life. After that, take note of the tone of all of my emails. I'll bet dollars to doughnuts that they're noticeably different. Oh, and it'll also be interesting to see how I rank in the PostTrack that following week, while I'm on my honeymoon. I probably won't be any higher than fifth place. ;-P -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a simple one time search utility
On Mon, Apr 14, 2008 at 3:07 PM, Wolf <[EMAIL PROTECTED]> wrote: > > Dang Dan! > > Between you and Tedd having basic coding/spelling issues, I sure hope it's > because you were at the Van Halen Concert!! ;) > > Tsk, tsk. > > And to think, your search even came back with the right term, you must have > it aliased or something... ;) What Philip mentioned was in response to a if()/die() block I put into the online demo to force a stop on people checking for passwords, et cetera, in case I missed anything in the code. It was typed up in haste to provide a simple, workable solution for the OP. As a result, it was typed in /too much/ haste and as a result, made me look like a moron --- even moreso than normal! However, it also led me to add in a case-insensitive search option. -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a simple one time search utility
On Mon, Apr 14, 2008 at 1:11 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: >As a result, it was typed in /too much/ haste and as a result, > made me look like a moron --- even moreso than normal! However, it > also led me to add in a case-insensitive search option. grep -rin is my favorite :) and --color is the shit too! i wanted to add some more options to mine, but i was trying to prove a point sort-of and get something out the door as quickly as possible, based on OPs complaint (not being rude here, just sayin' is all). i think it took me 20-30 minutes. mainly because i was goofing up the regex syntax like a newb at first, then just juggling around some array functions and turning it into a class. im planning to spruce it up and add stdin support. -nathan
Re: [PHP] Need a simple one time search utility
On Mon, Apr 14, 2008 at 3:31 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > > grep -rin > > is my favorite :) and --color is the shit too! i wanted to add some more > options to mine, but i was trying to prove a point sort-of and get something > out the door as quickly as possible, based on OPs complaint (not being rude > here, just sayin' is all). i think it took me 20-30 minutes. mainly > because i was goofing up the regex syntax like a newb at first, then just > juggling around some array functions and turning it into a class. > > im planning to spruce it up and add stdin support. foreach($argv as $k => $v) is your friend! Then, all you have to do is remember to str_pad('l',3,'-',STR_PAD_BOTH) and strstr(strtolower('I'),'.'). -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a simple one time search utility
At 3:16 PM -0400 4/14/08, Daniel Brown wrote: ... while I'm on my honeymoon. I probably won't be any higher than fifth place. ;-P On my honeymoon, I couldn't help but place first. ;-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a simple one time search utility
At 3:07 PM -0400 4/14/08, Wolf wrote: Between you and Tedd having basic coding/spelling issues, I sure hope it's because you were at the Van Halen Concert!! ;) Tsk, tsk. Just you wait until the next time you post. Tsk, tsk indeed. ;-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quarters
Really? I was starting to think that the secret was the coins that kept magically reappearing. I gave up. (That was in IE, bearing through the JavaScript error alert boxes.) Andrew Andrew: Try it again: http://webbytedd.com/quarters/ The js errors have been fixed. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quarters
On Mon, Apr 14, 2008 at 6:34 PM, tedd <[EMAIL PROTECTED]> wrote: > > Really? I was starting to think that the secret was the coins that > > kept magically reappearing. I gave up. (That was in IE, bearing > > through the JavaScript error alert boxes.) > > > > Andrew > > > > Andrew: > > Try it again: > > http://webbytedd.com/quarters/ > > The js errors have been fixed. > > Cheers, > > tedd Yeah, it seemed to be fixed the last time I tried it. Nice job. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What is the practical use of "abstract" and "interface"?
I've had at least three job interviews in the past two weeks, and each one has asked me this rather "text book academic" question regarding the difference between "abstract" vs. "interface". I've been coding for nearly 20 years, and at least 10 of those have been in PHP and another 3 in J++. I have NEVER used either of these concepts/keywords? Am I missing some exciting tool/feature? All the reading I've done tonight just reinforces my thoughts that these are, for the most part useless. Unless you're building some HUGE project that has an API and there are teams of people that are going to extend your framework, then what good are they? This DB wrapper is the closest to an answer I've come across. http://www.developer.com/lang/php/article.php/3604111 But that still doesn't explain the difference between abstract and interface, it only illustrates the possible need for a 'template' so others know which methods they must implement. In my mind, it just seems like overhead, as if you were going to write another DB wrapper using this one, then wouldn't you just look at their code (example) and implement those same methods anyways? I mean, you'd have to look at the abstract/interface to find out the required methods, so why not skip that and just look at the actual class instead? Here are two more pages that still don't seem to answer why there are both and when you'd use one over the other? http://www.hiteshagrawal.com/php/oops-in-php5/oops-in-php5-tutorial-abstract-class http://www.hiteshagrawal.com/php/oops-in-php5/oops-in-php5-using-interface And then this completely absurd over the top use of them for a HelloWorld example, which seems to use them just for the sake of using them... http://marc.info/?l=php-general&m=115950654928311&w=2 Lastly was this page: http://www.phpro.org/tutorials/Object-Oriented-Programming-with-PHP.html Which seems to only really provide a "hack" (printerFax) to circumvent the lack of multiple inheritance. Can someone clear this up for me? Daevid. http://daevid.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is the practical use of "abstract" and "interface"?
Daevid Vincent wrote: > I've had at least three job interviews in the past two weeks, and each one > has asked me this rather "text book academic" question regarding the > difference between "abstract" vs. "interface". I've been coding for nearly 20 > years, and at least 10 of those have been in PHP and another 3 in J++. I have > NEVER used either of these concepts/keywords? Am I missing some exciting > tool/feature? > > All the reading I've done tonight just reinforces my thoughts that these are, > for the most part useless. Unless you're building some HUGE project that has > an API and there are teams of people that are going to extend your framework, > then what good are they? > > This DB wrapper is the closest to an answer I've come across. > > http://www.developer.com/lang/php/article.php/3604111 > > But that still doesn't explain the difference between abstract and interface, > it only illustrates the possible need for a 'template' so others know which > methods they must implement. In my mind, it just seems like overhead, as if > you were going to write another DB wrapper using this one, then wouldn't you > just look at their code (example) and implement those same methods anyways? I > mean, you'd have to look at the abstract/interface to find out the required > methods, so why not skip that and just look at the actual class instead? > > Here are two more pages that still don't seem to answer why there are both > and when you'd use one over the other? > > http://www.hiteshagrawal.com/php/oops-in-php5/oops-in-php5-tutorial-abstract-class > http://www.hiteshagrawal.com/php/oops-in-php5/oops-in-php5-using-interface > > And then this completely absurd over the top use of them for a HelloWorld > example, which seems to use them just for the sake of using them... > > http://marc.info/?l=php-general&m=115950654928311&w=2 > > Lastly was this page: > > http://www.phpro.org/tutorials/Object-Oriented-Programming-with-PHP.html > > Which seems to only really provide a "hack" (printerFax) to circumvent the > lack of multiple inheritance. > > > Can someone clear this up for me? Look at this url: http://www.codeproject.com/KB/cs/abstractsvsinterfaces.aspx Iñigo > Daevid. > http://daevid.com > > -- Iñigo Medina García Librería Díaz de Santos Madrid (Spain) [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php