Re: [PHP] phone number allocation manager
Jim Lucas wrote: I work for a telephone internet company. Currently we have a tool that allows us to track the allocation of IP's to customers. What I am looking for is a tool that will allow me to track the allocation of phone numbers to our customers. [snip] Unfortunately the phone number world does not have the same rule set. Actually, it has no rules. Has anybody built, heard of, or used a tool like this? Hi Jim - it sounds like a plain database to me, but surely you've got one of those already. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MS purchase Yahoo
I understood it was April 1st in Australia. How that relates to a PHP general list is beyond me though. A funny joke about PHP would have been more acceptable. Otherwise, I consider this spam. Using this mailing list to push a Digg article's popularity is pathetic. I wouldn't have said anything if it was a direct link, just deleted it and moved on... but trying to boost it on Digg... get lost. On 3/31/08, Shelley [EMAIL PROTECTED] wrote: You're the first fooled. I really pity what you said. :-( It's 10:04 am, April 1st, China. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phone number allocation manager
On Mar 31, 2008, at 8:21 PM, Jim Lucas wrote: I work for a telephone internet company. Currently we have a tool that allows us to track the allocation of IP's to customers. What I am looking for is a tool that will allow me to track the allocation of phone numbers to our customers. Building the tool for IP allocation management was pretty easy since the IP world works off a set of rules that govern the allocation of IP's. Unfortunately the phone number world does not have the same rule set. Actually, it has no rules. Has anybody built, heard of, or used a tool like this? Any suggestions would be great. Thanks much! Hi Jim, Are you looking for away to see where each phone number is set such a using GPS coordinates to pinpoint the building the phone is registered to? Or, are you looking for away to be able to pull up ABC Company and see all the phone numbers listed to them? If it's the latter, I'd recommend setting up a database with a few tables, depending on the size of your company, possibly a table for customer names and an ID, then a table with phone numbers and a Matching ID field. Then you can either search, or browse through the customer directory, and choose the company you are looking for and then pull up the current phone numbers. But my guess is that may not be exactly what you are looking for since you can program circles around me I figure I must have missed something :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Issue
Your doing the same thing i did look at date(d) When its the 31 like yesteday of course it can not find the 31 of months that do not have them. Thats why it errored. String worked up till monday which explained alot. I just did not look at what i was doing. changed the code to $zomonth = date(F, mktime(0,0,0, date(m)-1, 1, date('Y'))); works perfect thanks to dan who pointed out the lack of sleep in me :) I generally use 1 hour after midnight with mktime() to avoid the edge cases of daylight savings etc... mktime(1, 0, 0, date('m') - 1, date('d'), date('Y')); You also have to consider that you *COULD* call this right on the cusp of midnight, and the call to date('d') could happen one day, and the call to mktime( ) the next day as the clock ticked over... At 1 am, the day doesn't change over... Larry's probably right that you should use DateTime, but it's too new-fangled for an old fart like me to have got around to messing with it yet... On Mon, March 31, 2008 3:15 pm, [EMAIL PROTECTED] wrote: I tried that a big no go. Seems if I do a +1 i get 2 months from now and a -1 gives me the current month. $month = date(F, mktime(0,0,0, date('m'), date('d'), date('Y'))); $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y))); $nmonth = date(F, mktime(0,0,0, date(m)+1, date(d), date(Y))); $month echo's MARCH should be Feb $zomonth echo's MARCH should be March $nmonth echo's MAY this should be April You will notice i used all options apostrophes double quotes and no quotes exactly the same output. You need apostrophes (or quotes) around your args to date() in the parameters... date('m') As it stands now, PHP assumes you mean the constant m (http://php.net/define) and that's not defined, so they are all 0. So you are passing in 0 to ALL the args. You also should use E_ALL for your error_reporting so you would SEE the error messages telling you about this. On Mon, March 31, 2008 2:07 pm, [EMAIL PROTECTED] wrote: Not understanding why this is happening. $month = date(F, mktime(0,0,0, date(m), date(d), date(Y))); $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y))); echoing out the exact same month March March Checked server timezone/date/time all is good. Am I half asleep at the wheel on this one and just not seeing my mistake here? Richard L. Buskirk Hardware Failure: $4,000. Network Outage: $15,000. Always blaming the programmers for everything: Priceless. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phone number allocation manager
At 5:21 PM -0700 3/31/08, Jim Lucas wrote: I work for a telephone internet company. Currently we have a tool that allows us to track the allocation of IP's to customers. What I am looking for is a tool that will allow me to track the allocation of phone numbers to our customers. Building the tool for IP allocation management was pretty easy since the IP world works off a set of rules that govern the allocation of IP's. Unfortunately the phone number world does not have the same rule set. Actually, it has no rules. Has anybody built, heard of, or used a tool like this? Any suggestions would be great. Thanks much! -- Jim Lucas Jim: I've never found a phone number dB, but unfortunately, I know they exist. I came across a zip code database that was very cool in that the center of each zip code's geographic area was given in lat/longs. From there, it could provide all the zip codes within a certain distance of any entered zip code. I also came across a IP database that was tied to a general geographic region and that tested very well, but did have an occasional error (per user replies). Phone numbers WERE tied to a geographical area because of hard-wire (per my olden days with GTE). But today's cell phones break that boundary. Furthermore, because of the land-rush to sell cell phones as quickly as possible, cell phone developers don't stick to any standards with regard to the Internet, thereby causing all sorts of problems with Internet communications. Your job is going to be difficult, I think. 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] Reporting mail as spam
On Mon, March 31, 2008 11:01 am, Sándor Tamás (HostWare Kft.) wrote: I wrote a little registration routine, which will send a confirmation letter to the user with a random number in the message body (my site is on a host, so I can't write in the subject, and ask the user to reply), which can be clicked then, and my site will finish the registration. My big problem is, that this host inserts an X header to the mail which identifies my PHP script as the X-PHP. As I recognize, this header adds a huge number to the spam score. Is there any possibility, to reduce the other scores? By the way, what counts most in a spam? I doubt that the X-PHP mailer header is going to hurt your score that much... If it's not actually spam, it will probably get through... Using PLAIN TEXT email will reduce your spam score FAR more than losing the X-PHP header. You could also probably put your emails into some kind of database somewhere that can be accessed by some OTHER program to send emails out, and search for something that gives you more control over the email composition. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phone number allocation manager
I work with and design VIOP IVR Applications, and have probably found or made everything you’re looking for. I can tell who provides database's for free or at a cost the cheapest and if you’re doing ANI cross population I have that as well. WARNING some of the database are around 250 million records and if you are not database savvy id rethink importing 250 million records into your database. Also beware of No call List phone information, if you publish a Do not call phone number your asking for a serious backlash. I say this from experience. Richard L. Buskirk At 5:21 PM -0700 3/31/08, Jim Lucas wrote: I work for a telephone internet company. Currently we have a tool that allows us to track the allocation of IP's to customers. What I am looking for is a tool that will allow me to track the allocation of phone numbers to our customers. Building the tool for IP allocation management was pretty easy since the IP world works off a set of rules that govern the allocation of IP's. Unfortunately the phone number world does not have the same rule set. Actually, it has no rules. Has anybody built, heard of, or used a tool like this? Any suggestions would be great. Thanks much! -- Jim Lucas Jim: I've never found a phone number dB, but unfortunately, I know they exist. I came across a zip code database that was very cool in that the center of each zip code's geographic area was given in lat/longs. From there, it could provide all the zip codes within a certain distance of any entered zip code. I also came across a IP database that was tied to a general geographic region and that tested very well, but did have an occasional error (per user replies). Phone numbers WERE tied to a geographical area because of hard-wire (per my olden days with GTE). But today's cell phones break that boundary. Furthermore, because of the land-rush to sell cell phones as quickly as possible, cell phone developers don't stick to any standards with regard to the Internet, thereby causing all sorts of problems with Internet communications. Your job is going to be difficult, I think. 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phone number allocation manager
At 6:53 AM -0700 4/1/08, Jim Lucas wrote: Think the opposite from what you just described. What I want to be able to do is have a pool of numbers from which I can assign a range or individual numbers to a given customer. But this tool is not to track the customers, but rather allow me to keep track of which numbers are still available from the predefined number range. While also taking into account tracking vanity numbers, and numbers that have previously been assigned and need to be held for at least 90 days. For now, this is the minimum of what I need. I will need to be able to modify the source code to tie into our current billing system and be able to reference a customers account. That sounds trivial -- just flag those taken and those on hold. From the remaining, pick, give out, and flag. In addition, do a periodic check of the dB and un-flag those number that come-off hold. Knowing that you're more cerebral than that, what am I missing? 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] April Fools Easter Egg
Don't forget to check your phpinfo() page for the annual easter egg. -- Ray Hauge www.primateapplications.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] auto generated PDF
On Sun, March 30, 2008 4:27 am, Alain Roger wrote: i want to implement on my web portal electronic invoicing system. basically data will be stored into PostgreSQL DB. I would like to know if someone already have experiences with such feature or where could i find some tutorials or help about this topic. Google for PHP PostgreSQL shopping cart and find a few hundred off-the-shelf packages you could use instead of re-inventing the wheel. Some have HORRIBLE security histories, so do your research. Concretly, user will buy some products/services online and i would like to send him a PDF invoice via email. is there a PDF module under PEAR or directly under PHP ? In addition to the other options given so far: http://php.net/pdf is an option, and it's not that tough to build up the PDF the way you want. Some more sample code: http://uncommonground.com/events.phps I find that thinking in inches and using *72 a lot works well for me. E.g., $page_top = 10.0 * 72; //10 inches PDFs are always 72 dpi. Flame wars about the meaninglessness of dpi can please be sent to your own /dev/null. Thanks. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phone number allocation manager
On Tue, Apr 1, 2008 at 9:53 AM, Jim Lucas [EMAIL PROTECTED] wrote: Think the opposite from what you just described. What I want to be able to do is have a pool of numbers from which I can assign a range or individual numbers to a given customer. But this tool is not to track the customers, but rather allow me to keep track of which numbers are still available from the predefined number range. While also taking into account tracking vanity numbers, and numbers that have previously been assigned and need to be held for at least 90 days. For now, this is the minimum of what I need. I will need to be able to modify the source code to tie into our current billing system and be able to reference a customers account. I'm not sure how things are now that number portability is available. A couple of my previous employers were cellular phone companies. It was my understanding that we had to purchase blocks of numbers within a prefix. Thus, for any given prefix (NXX) we had the entire range of 10,000 number (-). There may be numbers within the range that were reserved for special purposes. These were loaded as individual rows in a database that could be searched and assigned as needed. Thus, we knew what numbers we owned and also knew, from our subscriber records which numbers were in service. At that point, it would be a matter of database joins. However, I haven't worked in the industry for almost 8 years now (and my job was not very technical at the time), so I'm not sure what wrinkles things like number portability have thrown in or how it is handled. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phone number allocation manager
tedd wrote: At 5:21 PM -0700 3/31/08, Jim Lucas wrote: I work for a telephone internet company. Currently we have a tool that allows us to track the allocation of IP's to customers. What I am looking for is a tool that will allow me to track the allocation of phone numbers to our customers. Building the tool for IP allocation management was pretty easy since the IP world works off a set of rules that govern the allocation of IP's. Unfortunately the phone number world does not have the same rule set. Actually, it has no rules. Has anybody built, heard of, or used a tool like this? Any suggestions would be great. Thanks much! -- Jim Lucas Jim: I've never found a phone number dB, but unfortunately, I know they exist. I came across a zip code database that was very cool in that the center of each zip code's geographic area was given in lat/longs. From there, it could provide all the zip codes within a certain distance of any entered zip code. I also came across a IP database that was tied to a general geographic region and that tested very well, but did have an occasional error (per user replies). Phone numbers WERE tied to a geographical area because of hard-wire (per my olden days with GTE). But today's cell phones break that boundary. Furthermore, because of the land-rush to sell cell phones as quickly as possible, cell phone developers don't stick to any standards with regard to the Internet, thereby causing all sorts of problems with Internet communications. Your job is going to be difficult, I think. Yes, but for a different reason. I'm not looking for a geo positioning tool. refer to other email responding to Jason Cheers, tedd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5 file_get_contents() problems
On Sun, March 30, 2008 5:03 pm, php wrote: Thanks Greg...I am aware of the allow_url_fopen/allow_url_include relationship. Your suggestion to look into curl was implemented and there still seems to be something else afoot. I created a simple set of curl functions which just printed a remote url to the browser window. This tested well on an alternate test site which has PHP 5 running. However back on the hosting client I'm having problems with, curl throws the following error message: CURLE_COULDNT_RESOLVE_HOST (6) Couldn't resolve host. The given remote host was not resolved. A second test script, uses the popular PayPal Instant Payment Notification scheme which opens up a socket connection with the paypal server. Even this method of remote communition was defeated. So I'm lead to believe there is some other PHP configuration (or server configuration) which is stopping PHP from connecting with remove services. Can you SSH into the box and ping other domain names? If that box has messed up DNS, there is NO WAY php can fix it... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] restricting filesystem access
On Mon, March 31, 2008 3:21 am, Hamar Gábor wrote: I am a new php user and I have a question, for which I couldn't find any answer. I'd like to restrict php code to access the filesystem. I'd like to have only one directory where the php code can write, create or read files, and an other directory hierarchy where the php codes present. I need this to avoid php code to rewrite other php code in case of bug and/or an attack. I already tried the open_basedir directive, but it couldn't work because in this case the executed php have to be in the accessable directory hierarchy. PHP runs as the Apache user. chown/chmod the source files to not be writable by that user. Problem solved. No real PHP trick here. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phone number allocation manager
Jim Lucas wrote: Think the opposite from what you just described. What I want to be able to do is have a pool of numbers from which I can assign a range or individual numbers to a given customer. But this tool is not to track the customers, but rather allow me to keep track of which numbers are still available from the predefined number range. While also taking into account tracking vanity numbers, and numbers that have previously been assigned and need to be held for at least 90 days. It still sounds like a plain database to me. The telephone-number is the primary key, everything else attributes of the number. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] extract escaped quoted strings
Extract them from what? Without more context, we can't really help... So far a GREEDY pcre with quote on each end fits all the inputs. And *WHY* do you have so many backslashes? Whatever is causing that (MagicQuotes, cough, cough) is your REAL problem. Fix the problem, not the symptom. On Sat, March 29, 2008 6:16 pm, Adam Jacob Muller wrote: Hi, Have a potentially interesting question here, wondering if anyone has done this one before and could shed some light for me. I have a bit of PHP code that needs to extract some quoted strings, so, very simply: hello perfectly fine and works great but, it should also be able to extract hel\lo bit more complex now Ideally, it would also handle hel\\lo properly it should also handle hel\\\lo Any ideason how to do this? attempts to write a PCRE to do this are so- far unsuccessful, i'm sure I could badger some PHP code into doing it perhaps, but i'd love some elegant PCRE solution that thus-far evades me :( Any ideas are appreciated. -Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Issue
I generally use 1 hour after midnight with mktime() to avoid the edge cases of daylight savings etc... mktime(1, 0, 0, date('m') - 1, date('d'), date('Y')); You also have to consider that you *COULD* call this right on the cusp of midnight, and the call to date('d') could happen one day, and the call to mktime( ) the next day as the clock ticked over... At 1 am, the day doesn't change over... Larry's probably right that you should use DateTime, but it's too new-fangled for an old fart like me to have got around to messing with it yet... On Mon, March 31, 2008 3:15 pm, [EMAIL PROTECTED] wrote: I tried that a big no go. Seems if I do a +1 i get 2 months from now and a -1 gives me the current month. $month = date(F, mktime(0,0,0, date('m'), date('d'), date('Y'))); $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y))); $nmonth = date(F, mktime(0,0,0, date(m)+1, date(d), date(Y))); $month echo's MARCH should be Feb $zomonth echo's MARCH should be March $nmonth echo's MAY this should be April You will notice i used all options apostrophes double quotes and no quotes exactly the same output. You need apostrophes (or quotes) around your args to date() in the parameters... date('m') As it stands now, PHP assumes you mean the constant m (http://php.net/define) and that's not defined, so they are all 0. So you are passing in 0 to ALL the args. You also should use E_ALL for your error_reporting so you would SEE the error messages telling you about this. On Mon, March 31, 2008 2:07 pm, [EMAIL PROTECTED] wrote: Not understanding why this is happening. $month = date(F, mktime(0,0,0, date(m), date(d), date(Y))); $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y))); echoing out the exact same month March March Checked server timezone/date/time all is good. Am I half asleep at the wheel on this one and just not seeing my mistake here? Richard L. Buskirk Hardware Failure: $4,000. Network Outage: $15,000. Always blaming the programmers for everything: Priceless. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phone number allocation manager
Jason Pruim wrote: On Mar 31, 2008, at 8:21 PM, Jim Lucas wrote: I work for a telephone internet company. Currently we have a tool that allows us to track the allocation of IP's to customers. What I am looking for is a tool that will allow me to track the allocation of phone numbers to our customers. Building the tool for IP allocation management was pretty easy since the IP world works off a set of rules that govern the allocation of IP's. Unfortunately the phone number world does not have the same rule set. Actually, it has no rules. Has anybody built, heard of, or used a tool like this? Any suggestions would be great. Thanks much! Hi Jim, Are you looking for away to see where each phone number is set such a using GPS coordinates to pinpoint the building the phone is registered to? Or, are you looking for away to be able to pull up ABC Company and see all the phone numbers listed to them? If it's the latter, I'd recommend setting up a database with a few tables, depending on the size of your company, possibly a table for customer names and an ID, then a table with phone numbers and a Matching ID field. Then you can either search, or browse through the customer directory, and choose the company you are looking for and then pull up the current phone numbers. But my guess is that may not be exactly what you are looking for since you can program circles around me I figure I must have missed something :) Think the opposite from what you just described. What I want to be able to do is have a pool of numbers from which I can assign a range or individual numbers to a given customer. But this tool is not to track the customers, but rather allow me to keep track of which numbers are still available from the predefined number range. While also taking into account tracking vanity numbers, and numbers that have previously been assigned and need to be held for at least 90 days. For now, this is the minimum of what I need. I will need to be able to modify the source code to tie into our current billing system and be able to reference a customers account. -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LDAP in php
On Sun, March 30, 2008 8:15 pm, [EMAIL PROTECTED] wrote: As LDAP can have SQL back-end (I saw an example with PostgreSQL) - is it a very wild idea to implement (a simple) LDAP server in php? We have all the address data already in PostgreSQL and a php application managing all of it. I am thinking of simple uses, such as providing LDAP address books to Thunderbird/Squirrelmail users. For instance, is it too wild to think of Apache/php listening on the LDAP port (or so), get the request, parse it, get the data from PostgreSQL and send it back to the LDAP client? You probably wouldn't run it through Apache, but you probably COULD run an LDAP server of sorts using http://php.net/sockets Main problem is one of performance. The reason most people choose LDAP in the first place is to get blazing fast performance, because they NEED it. PHP is probably not going to give you blazing fast performance compared to an off-the-shelf LDAP server in C. You may be able to leverage from the code in http://php.net/ldap to move most of the heavy lifting into an extension, or perhaps you could expand that extension to do so, and then you just have a simple PHP wrapper to handle the sockets part. That would help some, and possibly even come close to C performance, since the socket open/close/traffic/bandwidth is probably the limiting factor there, rather than a single PHP byte-code interpreted function call... This is all just my expectations. Feel free to surprise me with actual test results. :-) ymmv -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] new lines in textareas?
On Sat, March 29, 2008 11:26 pm, Mary Anderson wrote: I have a php script which produces text which is to be displayed in a textarea. I have the wrap for the text area set to 'hard'. I need Do NOT set the wrap to hard It will only cause you grief in the long run. It's going to insert newlines where they shouldn't be, and then your data is corrupt. to have newlines inserted in the text. \n and br don't work. They just get quoted literally in the text. I suspect I need to use htmlspecialchars , but don't know what special character to feed it. If they are being quoted literally, then something is not right... \n in particular should flow through just fine. br would be quoted literally if you ran it through htmlspecialchar or htmlentities. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Issue
If you want the DAY before, you can use the -1 for the day, and get what you want. mktime() will wrap the month as needed. But, yeah, if you try to hit a MONTH before by putting in a month before AND the day, it will slingshot back and forth to get what you don't want. If you want the MONTH before, I *suspect* you can use date('m') for the argument, and do NOT provide a day, and it may do what you want. But for sure, if you use ONE (1) for the day, and then -1 for the month it will do what you want, since every month has a ONE (1) day. Anything 1 from 28 will work fine, actually, but using 1 is probably clearest: $today = mktime(); $tomorrow = mktime(1, 0, 0, date('m'), date('d') + 1); $next_month = mktime(1, 0, 0, date('m') + 1, 1); $last_month = mktime(1, 0, 0, date('m') - 1, 1); I've been using these for a web calendar since nineteen-ninety-mumble, and they've worked fine, through leap years. You can view the source to the PDF version here: http://uncommonground.com/events.phps The HTML version has the exact same stuff at the top. http://uncommonground.com/events.htm Feel free to page through as many months/years past/present and future to see that it works. Since it's a 32-bit machine, it does conk out in March 2038. I'm fairly confident our web-server will be a 64-bit machine before we book any (real) events for 2038... You can ignore my test events in January 2038 :-) On Mon, March 31, 2008 3:24 pm, [EMAIL PROTECTED] wrote: Thank you again Dan. Thought never crossed my mind the day being the 31st. That fixed it. Richard L. Buskirk On Mon, Mar 31, 2008 at 4:15 PM, [EMAIL PROTECTED] wrote: I tried that a big no go. Seems if I do a +1 i get 2 months from now and a -1 gives me the current month. $month = date(F, mktime(0,0,0, date('m'), date('d'), date('Y'))); $zomonth = date(F, mktime(0,0,0, date(m)-1, date(d), date(Y))); $nmonth = date(F, mktime(0,0,0, date(m)+1, date(d), date(Y))); $month echo's MARCH should be Feb $zomonth echo's MARCH should be March $nmonth echo's MAY this should be April That's because you're using today's date('d');, which is 31. February doesn't have 31 days, nor does April, so mktime() forces them to the following month to correct the error. -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] new lines in textareas?
On Sun, March 30, 2008 7:20 am, jeffry s wrote: my client ask me about this problem 2 weeks ago. he want the text to automatically go to new line after user type until the end of the line. The only possible solutions so far is using wrap='hard' or wrap='soft' eg: textarea cols=10 rows=10 wrap=hard but wrap only work on IE Netscape browser. Not working in firefox. i guess i want to use javascript to do the text formatting. trigger the javascript event every time the user using the onchange event (i never try).. i is quite complicated i dont have much time working on it. so i decided to tell him, it cannot be done :) If wrap=soft isn't working in Firefox, then your fancy-dancy CSS is messing things up somehow, or you've managed to do something else really weird... Firefox wraps just fine for me, in all the textarea inputs I've ever used. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] April Fools Easter Egg
You got me. Wobbly PHP logo on mine (PHP-5.2.5 debian) That's all I see for PHP-5.2.1. Should there be something more? thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] April Fools Easter Egg
On Apr 1, 2008, at 10:38 AM, Christoph Boget wrote: You got me. Wobbly PHP logo on mine (PHP-5.2.5 debian) That's all I see for PHP-5.2.1. Should there be something more? Same here on 5.2.0 Although... Did the Zend logo always look like that? It looks a little Jaggy to me... Along the same lines as the PHP logo... thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] April Fools Easter Egg
tedd wrote: At 9:23 AM -0500 4/1/08, Ray Hauge wrote: Don't forget to check your phpinfo() page for the annual easter egg. -- Ray Hauge www.primateapplications.com You got me. Cheers, tedd Here's the image that I see on PHP 5.1.0. My 5.2.5 site has a distorted image instead of the dog. 5.1.0: http://www.primateapplications.com/info.php.gif 5.2.5: http://www.primateapplications.com/info.php -- Ray Hauge www.primateapplications.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] April Fools Easter Egg
Studied that thing for last 15 minutes before realizing you got me. Richard L. Buskirk Don't forget to check your phpinfo() page for the annual easter egg. -- Ray Hauge www.primateapplications.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] April Fools Easter Egg
At 4:33 PM +0200 4/1/08, Paul Scott wrote: On Tue, 2008-04-01 at 10:28 -0400, tedd wrote: You got me. Wobbly PHP logo on mine (PHP-5.2.5 debian) --Paul Ahhh, now I see it. The one I was checking was 4 something. 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] April Fools Easter Egg
At 9:23 AM -0500 4/1/08, Ray Hauge wrote: Don't forget to check your phpinfo() page for the annual easter egg. -- Ray Hauge www.primateapplications.com You got me. 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] phone number allocation manager
Jim Lucas wrote: I work for a telephone internet company. Currently we have a tool that allows us to track the allocation of IP's to customers. What I am looking for is a tool that will allow me to track the allocation of phone numbers to our customers. Building the tool for IP allocation management was pretty easy since the IP world works off a set of rules that govern the allocation of IP's. Unfortunately the phone number world does not have the same rule set. Actually, it has no rules. Has anybody built, heard of, or used a tool like this? Any suggestions would be great. Thanks much! I understand that the storage and restriction and other status issues are very easy. The storage isn't what I am worried about. Think about IP addressing. Mathematically you have block sizes that have predefined starting points. You can't start a block on an odd number, you can't start a /25 on x.x.x.32. Certain rules apply to the assignment of a block. I will describe the tool that we use for IP allocation and tracking. on the initial page, you are presented with all the ranges of IPs that we are currently tracking. Some are /19, some /24, some /16, etc... better yet, I will provide screen shots! here is a link to the main page. http://www.cmsws.com/examples/php/phonenumbermanager/index.jpg From this page you can view the current assignments in each available range, search for a given string, ip address, etc.. or even find all given /xx available in each range. If I click 'find block' I get this. http://www.cmsws.com/examples/php/phonenumbermanager/new_assignment.jpg This allows me to assign a given block to a customer/account. Now on this page, I can assign other details to each number. http://www.cmsws.com/examples/php/phonenumbermanager/number_details.jpg on the previous page, we would track things like line assignment, service assignment, and other various things. So, to sum it up, what I am wondering, has anybody used a tool that had this type of search feature. Being able to calculate available number locations based on a given block size, and typical starting point? Adding special attention to blocks that start at a xxx-xxx-xxx0 base point. When I went to Sprint to get my cell phone, I saw they had a tool that randomly pulled 10 numbers or so that were currently available. But this was for individual numbers. I can build that just fine. But calculating the available blocks is another story. Sorry for being so long winded. I have actually typed less code then I just typed in this email and almost have it. (i think)... :) Any ideas? -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] April Fools Easter Egg
On Tue, 2008-04-01 at 10:28 -0400, tedd wrote: You got me. Wobbly PHP logo on mine (PHP-5.2.5 debian) --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] April Fools Easter Egg
Same here... It is shaky.. on version 5.2.0.. On Tue, Apr 1, 2008 at 8:12 PM, Jason Pruim [EMAIL PROTECTED] wrote: On Apr 1, 2008, at 10:38 AM, Christoph Boget wrote: You got me. Wobbly PHP logo on mine (PHP-5.2.5 debian) That's all I see for PHP-5.2.1. Should there be something more? Same here on 5.2.0 Although... Did the Zend logo always look like that? It looks a little Jaggy to me... Along the same lines as the PHP logo... thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- http://www.kingzones.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Severe Security Issue
Hey, folks, ignore the coincidence of the date when reading this email. During the Scranton PHP Group's meeting last night, the topic was security - go through all of the PHP engine's source code and identify and find patches for possible security issues. In the process, we detected a huge security vulnerability that affects all versions since at least 4.1.0. PHP apparently has a built-in bytecode-parsing component in the engine itself, and while we couldn't find any documentation for it at all, we were able to exploit the vulnerability in a variety of ways. And the things we were able to do weren't pretty: escalated privileges, subsequently leading to filesystem dd, password changes, and even remote installations. Not nice stuff at all. This works regardless of whether or not open_basedir, safe_mode, remote_url_fopen, remote_url_include, et cetera, are turned on or off. It's also not *NIX-dependent. And because of Windows' inherent security issues itself, we didn't even have to play around with the trivial privilege escalation routines; send one injected request as a GET or POST to PHP (on Apache and IIS alike, and probably other HTTP servers). Unfortunately, the web servers didn't filter the request, and PHP parses the information internally. Script sanity seems to mean nil, since we were even able to do it with a blank test.php file. It looks like anything that calls up the PHP engine will process the query string. There is, however, an easy fix, which is a good thing for Windows users, since most probably don't know how to compile even basic code. Edit your php.ini file and add the following line: remote_bytecode_include = Off And then restart Apache/IIS/etc. to have the changes take effect. The part of the engine source responsible for bytecode inclusion does recognize that flag, thank God, so even as serious as the issue is, at least there's an extremely simple fix. Once we did that and tried again, the exploits weren't at all successful. So there's some good news there. For those interested, no, I'm not going to send exploit examples to the list. Those of you who are serious know that it would be extremely irresponsible to do so, especially considering the very open nature. So for any of you lurkers or wannabe-skript kiddies who contact me even off-list, your messages will be summarily ignored. Those of you on shared web hosts will want to alert your hosting providers immediately as well. We've been sending emails to server admins, but as you can guess, it's impossible for us to reach all of them. So without trying to sound like a chain letter, please pass this on ASAP. -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] restricting filesystem access
On Tue, Apr 1, 2008 at 10:04 AM, Richard Lynch [EMAIL PROTECTED] wrote: PHP runs as the Apache user. chown/chmod the source files to not be writable by that user. Problem solved. Let's not ignore phpSuExec or suhosin, which are fast-becoming standard. If I'm not mistaken, they're even the defaults for cPanel/Plesk and others now, too. -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] April Fools Easter Egg
On Tue, April 1, 2008 9:38 am, Christoph Boget wrote: You got me. Wobbly PHP logo on mine (PHP-5.2.5 debian) That's all I see for PHP-5.2.1. Should there be something more? Probably not, but check the source. :-) I like the bunny of version 4 better, personally... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Severe Security Issue
Off-list. Hey, don't shoot me down just yet, Mr. Dallas. Gotta' make the n00bs sweat it out just a bit, y'know. ;-P On Tue, Apr 1, 2008 at 11:14 AM, Stut [EMAIL PROTECTED] wrote: Daniel Brown wrote: Hey, folks, ignore the coincidence of the date when reading this email. snipped the crap I'm thinking you're full of it... http://lxr.php.net/search?string=remote_bytecode_include Since it doesn't appear in the PHP source code I'm guessing it won't have any effect. Nice try. -Stut -- http://stut.net/ -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Severe Security Issue
Damn you, Reply-All -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Severe Security Issue
Daniel Brown wrote: Hey, folks, ignore the coincidence of the date when reading this email. snipped the crap I'm thinking you're full of it... http://lxr.php.net/search?string=remote_bytecode_include Since it doesn't appear in the PHP source code I'm guessing it won't have any effect. Nice try. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Severe Security Issue
On Tue, Apr 1, 2008 at 11:14 AM, Stut [EMAIL PROTECTED] wrote: Daniel Brown wrote: Hey, folks, ignore the coincidence of the date when reading this email. snipped the crap I'm thinking you're full of it... http://lxr.php.net/search?string=remote_bytecode_include Since it doesn't appear in the PHP source code I'm guessing it won't have any effect. Nice try. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php It's April 1st regardless if he said to ignore it or not. :(
Re: [PHP] Severe Security Issue
On Tue, Apr 1, 2008 at 11:35 AM, Eric Butera [EMAIL PROTECTED] wrote: It's April 1st regardless if he said to ignore it or not. :( Eric, That was actually the line I expected very few to refute, but it's exactly why I worded it that way. ;-P -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Severe Security Issue
Daniel Brown wrote: Off-list. Hey, don't shoot me down just yet, Mr. Dallas. Gotta' make the n00bs sweat it out just a bit, y'know. ;-P Sorry mate, bit too quick on the trigger there. And less of the real name on the interweb please, I'm undercover! -Stut -- http://stut.net/ On Tue, Apr 1, 2008 at 11:14 AM, Stut [EMAIL PROTECTED] wrote: Daniel Brown wrote: Hey, folks, ignore the coincidence of the date when reading this email. snipped the crap I'm thinking you're full of it... http://lxr.php.net/search?string=remote_bytecode_include Since it doesn't appear in the PHP source code I'm guessing it won't have any effect. Nice try. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] April Fools Easter Egg
On Tue, April 1, 2008 9:39 am, tedd wrote: At 4:33 PM +0200 4/1/08, Paul Scott wrote: On Tue, 2008-04-01 at 10:28 -0400, tedd wrote: You got me. Wobbly PHP logo on mine (PHP-5.2.5 debian) --Paul Ahhh, now I see it. The one I was checking was 4 something. And apparently, I can't tell a dog from a bunny... :-) Where's a 5th grader when you need one? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Severe Security Issue
On Tue, Apr 1, 2008 at 11:37 AM, Daniel Brown [EMAIL PROTECTED] wrote: On Tue, Apr 1, 2008 at 11:35 AM, Eric Butera [EMAIL PROTECTED] wrote: It's April 1st regardless if he said to ignore it or not. :( Eric, That was actually the line I expected very few to refute, but it's exactly why I worded it that way. ;-P -- /Daniel P. Brown Forensic Services, Senior Unix Engineer 1+ (570-) 362-0283 There was a test I took once in school that started out saying Before doing anything please read every single question before beginning. I failed that test because I started writing out answers before I read it all. The real test was the last line that said if you got here please turn in your test without writing anything. So I've tried really hard not to fall for it again, no matter what form it presents itself in. :)
[PHP] Re: Severe Security Issue
Robert Cummings wrote: On Tue, 2008-04-01 at 17:00 +0100, Colin Guthrie wrote: Stut wrote: Daniel Brown wrote: Off-list. Hey, don't shoot me down just yet, Mr. Dallas. Gotta' make the And less of the real name on the interweb please, I'm undercover! Hey don't worry, half way through next week, Bobby will come out the shower and it'll turn out all the posts to the mailing list have been a dream. The funny part about that is they pulled that whole dream stuff from the DVD collection. Wait, so the dream stuff *was a dream* Recursion detected. Exiting :p Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Severe Security Issue
Stut wrote: Daniel Brown wrote: Off-list. Hey, don't shoot me down just yet, Mr. Dallas. Gotta' make the And less of the real name on the interweb please, I'm undercover! Hey don't worry, half way through next week, Bobby will come out the shower and it'll turn out all the posts to the mailing list have been a dream. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Severe Security Issue
On Tue, 2008-04-01 at 17:00 +0100, Colin Guthrie wrote: Stut wrote: Daniel Brown wrote: Off-list. Hey, don't shoot me down just yet, Mr. Dallas. Gotta' make the And less of the real name on the interweb please, I'm undercover! Hey don't worry, half way through next week, Bobby will come out the shower and it'll turn out all the posts to the mailing list have been a dream. The funny part about that is they pulled that whole dream stuff from the DVD collection. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Severe Security Issue
On Tue, 2008-04-01 at 17:16 +0100, Colin Guthrie wrote: Robert Cummings wrote: On Tue, 2008-04-01 at 17:00 +0100, Colin Guthrie wrote: Stut wrote: Daniel Brown wrote: Off-list. Hey, don't shoot me down just yet, Mr. Dallas. Gotta' make the And less of the real name on the interweb please, I'm undercover! Hey don't worry, half way through next week, Bobby will come out the shower and it'll turn out all the posts to the mailing list have been a dream. The funny part about that is they pulled that whole dream stuff from the DVD collection. Wait, so the dream stuff *was a dream* Recursion detected. Exiting :p Wikipedia has a write up on why it was removed... apparently they got a lot of backlash from the viewers... two of the script writers got fired over the issue. http://en.wikipedia.org/wiki/Dallas_(TV_series) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] April Fools Easter Egg
Wobbly PHP logo on mine (PHP-5.2.5 debian) That's all I see for PHP-5.2.1. Should there be something more? Probably not, but check the source. :-) I checked the source. I didn't notice anything unusual... thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP MySQL Insert Syntax
/*I'm trying to insert values from an array into MySQL DB but the insert begins at the last record in the table and not at first record in the table. I have added the cellSuffixes column after I already populated 30 records in other columns*/ Code: foreach($list as $key=$value) { $query = INSERT INTO carriers (cellSuffixes) VALUES('$value'); mysql_query($query,$connex) or die(Query failed: . mysql_error($connex)); } echo done; mysql_close($connex); //I don't know what the sytax s/b to get the data to be inserted in the first row of the column. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP MySQL Insert Syntax
Insert is for a new row Alter or Update is for an exsisting row /*I'm trying to insert values from an array into MySQL DB but the insert begins at the last record in the table and not at first record in the table. I have added the cellSuffixes column after I already populated 30 records in other columns*/ Code: foreach($list as $key=$value) { $query = INSERT INTO carriers (cellSuffixes) VALUES('$value'); mysql_query($query,$connex) or die(Query failed: . mysql_error($connex)); } echo done; mysql_close($connex); //I don't know what the sytax s/b to get the data to be inserted in the first row of the column. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP MySQL Insert Syntax
Thanks :-) [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Insert is for a new row Alter or Update is for an exsisting row /*I'm trying to insert values from an array into MySQL DB but the insert begins at the last record in the table and not at first record in the table. I have added the cellSuffixes column after I already populated 30 records in other columns*/ Code: foreach($list as $key=$value) { $query = INSERT INTO carriers (cellSuffixes) VALUES('$value'); mysql_query($query,$connex) or die(Query failed: . mysql_error($connex)); } echo done; mysql_close($connex); //I don't know what the sytax s/b to get the data to be inserted in the first row of the column. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] April Fools Easter Egg
Ray Hauge írta: tedd wrote: At 9:23 AM -0500 4/1/08, Ray Hauge wrote: Don't forget to check your phpinfo() page for the annual easter egg. -- Ray Hauge www.primateapplications.com You got me. Cheers, tedd Here's the image that I see on PHP 5.1.0. My 5.2.5 site has a distorted image instead of the dog. 5.1.0: http://www.primateapplications.com/info.php.gif 5.2.5: http://www.primateapplications.com/info.php same here, distorted image on 5.2.5 and dog on 5.1.2 :) greets, Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] autoload with namespace
I haven't been keeping an eye on this list so if this has come up before please point me in the right direction. :) Playing around with dev PHP 5.3 and namespaces, I'm finding it hard to write an autoload function. Since autoload will be triggered on any namespace call, the request could be for a namespace function or constant. Ex: FOO::BAR::me() ## A namespace function or class static function? FOO::BAR::ME ## A namespace constant or class constant? Since there isn't really a way for PHP to know what it is looking for, what would be a good method to write the autoload? Assuming the file structure: - Namespaces are in separate directories NS1::NS2::Class1 == NS1/NS2/class.Calss1.php - Namespace files and class files are prefixed with ns.*.php and class.*.php (respectively) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to possibly cache something and the theory of better performance / better speed
On Wed, 2008-04-02 at 00:26 -0400, Joey wrote: Hi All, [-- SNIPPITY SNIP SNIP --] Assuming only 25-30 images am I splitting hairs here? Does this make sense? Of course if I have 200 pictures, then this is the way to go but would this really make a difference? Randomizing the file referred to in the HTML img / tag is probably faster than requesting a script that returns random image binary content. For one, you avoid browser cache issues. Two, the browser will cache the requested image so if it happens to be the random one in another page request then it won't be re-downloaded. Now using the first solution of generating a random src value for an image tag, caching the list of image options will probably have very little effect since you will either: a) have to request the cache from a database b) request the cache from the filesystem c) install and configure memcache and retrieve the cache from memory Generally speaking, for 25 to 30 images, you're operating system will do a good job of keeping the list in it's own cache and returning that list very promptly when you perform opendir() and subsequent readdir() requests. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to possibly cache something and the theory of better performance / better speed
I used to use a script to grab a random image from a folder of images by scanning the folder, returning the list of images, getting one of them randomly and displaying it. Isn't that what the code is doing? Maybe I'm missing something but you've only mentioned one method. What's the second method to compare against? OK now, getting greedy I want to take it to another level. Instead of having to read the folder for images every time, why not read the image names into a file so that we can maintain therbey caching the list. This is based on 25-30 images in the folder you might even have more. Since in this case we're not going to add images too often, then we can upload the images delete the cache list and a new one will be generated hopefully saving time for all future executions. Assuming only 25-30 images am I splitting hairs here? Yes. I don't think you'll notice any difference with this number, though a quick script would tell you for certain. $orig_image = 'logo.jpg'; $cache_folder = '/path/to/folder'; for ($i = 0; $i 500; $i++) { copy($cache_folder.'/'.$orig_image, $cache_folder . '/' . $i . '.jpg'); } Of course if I have 200 pictures, then this is the way to go but would this really make a difference? Once you get a lot of images (500? 1000? more?) it will but if you only expect 30 there's not much point. Using a cache file you'll need extra checks (make sure nobody slips in a symlink to /etc/passwd or a url or something) - but you should be doing those checks anyway. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php