[PHP] https question
Hi gang: I have a client who had his entire site moved to another host -- no big problem. However, the old site had a https directory, where I had secure scripts to do credit-card transactions, but the new site doesn't have a https directory -- in fact it doesn't even have a http directory at all. So, what options do I have to do secure transactions? I remember someone saying that this could be done via a .htaccess file, but I don't have the code, nor am I positive this is the answer. What do you recommend? Thanks, tedd ___ tedd sperling t...@sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] https question
On Sep 25, 2013, at 1:55 PM, Tedd Sperling t...@sperling.com wrote: Hi gang: I have a client who had his entire site moved to another host -- no big problem. However, the old site had a https directory, where I had secure scripts to do credit-card transactions, but the new site doesn't have a https directory -- in fact it doesn't even have a http directory at all. So, what options do I have to do secure transactions? I remember someone saying that this could be done via a .htaccess file, but I don't have the code, nor am I positive this is the answer. What do you recommend? Thanks, tedd Did you setup the server (Apache / nginx) configuration? The entire site should be served under https if you're doing CC processing Best, –Josh Joshua Kehn | @joshkehn http://joshuakehn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] https question
On Sep 25, 2013, at 1:58 PM, Joshua Kehn josh.k...@gmail.com wrote: On Sep 25, 2013, at 1:55 PM, Tedd Sperling t...@sperling.com wrote: Hi gang: I have a client who had his entire site moved to another host -- no big problem. However, the old site had a https directory, where I had secure scripts to do credit-card transactions, but the new site doesn't have a https directory -- in fact it doesn't even have a http directory at all. So, what options do I have to do secure transactions? I remember someone saying that this could be done via a .htaccess file, but I don't have the code, nor am I positive this is the answer. What do you recommend? Thanks, tedd Did you setup the server (Apache / nginx) configuration? The entire site should be served under https if you're doing CC processing Best, –Josh I understand that cc processing should be done via https. Normally, that means to me that I place my $ scripts in a https directory -- the problem is that I don't have one with this host. So, I am asking how does one do that with a https directory? Thanks, tedd ___ tedd sperling tedd.sperl...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] https question
On Sep 25, 2013, at 2:24 PM, Tedd Sperling tedd.sperl...@gmail.com wrote: I understand that cc processing should be done via https. Normally, that means to me that I place my $ scripts in a https directory -- the problem is that I don't have one with this host. So, I am asking how does one do that with a https directory? Thanks, tedd ___ tedd sperling tedd.sperl...@gmail.com I'm saying the site should be served entirely under HTTPS. There shouldn't be separate https/http directories. Apache (or whatever your web server is) has a certificate installed on it and that vhost is configured to only respond to https requests. Typically this also means running a separate vhost on http that redirects to the https variant. Where is this new host? It should be a dedicated box (vps or other) due to how the certificates need to be issued (dedicated ip address). Best, –Josh Joshua Kehn | @joshkehn http://joshuakehn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] https question
On Wed, Sep 25, 2013 at 1:55 PM, Tedd Sperling t...@sperling.com wrote: Hi gang: I have a client who had his entire site moved to another host -- no big problem. However, the old site had a https directory, where I had secure scripts to do credit-card transactions, but the new site doesn't have a https directory -- in fact it doesn't even have a http directory at all. So, what options do I have to do secure transactions? I remember someone saying that this could be done via a .htaccess file, but I don't have the code, nor am I positive this is the answer. What do you recommend? Sounds like it may have been moved from a Plesk server to a non-Plesk server (or something using a similar path setup). If it's still Apache-based, yes, an .htaccess mod_rewrite directive should suffice. And, while it's out-of-scope for this list, an example, for posterity: # .htaccess - placed in the web root RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [QSA,R,L] -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
54, Only when the surface of the desk is problematic. On 09/20/2013 12:58 PM, Larry Martell wrote: On Fri, Sep 20, 2013 at 10:51 AM, Tedd Sperling t...@sperling.com wrote: Hi gang: Do you use a Mousepad? My reason for asking is that I've used a Mousepad ever since mice first came out (back when they had one ball). Now that mice are optical (no balls), Mousepads are not really needed -- or so I'll told by the college -- you see, they don't provide Mousepads for their student's computers. As such, I wondered what's the percentage of programmers still using a Mousepad? Secondly, are Mousepads used primarily by older programmers (like me) while younger programmers don't use Mousepads, or what? So -- please respond with: Age: * Mousepad: Yes/No 54 Yes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Sat, 2013-09-21 at 11:07 +1000, Daniel wrote: 25 network admin and programmer and yes I use a mouse pad - my mouse hates me if I dont use it. -- Regards, Daniel Fenn 29 and don't use a mouse pad right now, although I did before I moved because the surface of my desk was too shiny. That's the only reason I ever use one now. Thanks, Ash http://www.ashleysheridan.co.uk
[PHP] Friday's Question
Hi gang: Do you use a Mousepad? My reason for asking is that I've used a Mousepad ever since mice first came out (back when they had one ball). Now that mice are optical (no balls), Mousepads are not really needed -- or so I'll told by the college -- you see, they don't provide Mousepads for their student's computers. As such, I wondered what's the percentage of programmers still using a Mousepad? Secondly, are Mousepads used primarily by older programmers (like me) while younger programmers don't use Mousepads, or what? So -- please respond with: Age: * Mousepad: Yes/No Thank you, tedd PS: * If you don't want to provide your actual age, then indicate your age by stating young, middle-age, old-age, ancient, or whatever term describes your age. Alternate -- I claim that you can tell a man's age by ten-times the number of personal products he routinely uses, for example: Years Old - Personal Products 10 Toothpaste 20 Toothpaste, Deodorant 30 Toothpaste, Deodorant, Aftershave 40 Toothpaste, Deodorant, Aftershave, Minoxidil 50 Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H 60 Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb 70 Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb, Fixodent So, you could indicate age by stating Bag Bomb like me. ___ tedd sperling t...@sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Friday's Question
-Original Message- From: larry.mart...@gmail.com [mailto:larry.mart...@gmail.com] On Behalf Of Larry Martell Sent: Friday, September 20, 2013 12:26 PM To: j...@cetaceasound.com Cc: Tedd Sperling; PHP General Subject: Re: [PHP] Friday's Question On Fri, Sep 20, 2013 at 11:20 AM, Jen Rasmussen j...@cetaceasound.com wrote: -Original Message- What in the heck is a Bag Bomb? It's a salve for cow udders. Not sure what a person would do with it. Ha! Interesting. Thanks :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 11:35 AM, Joshua Kehn josh.k...@gmail.com wrote: On Sep 20, 2013, at 1:26 PM, Larry Martell la...@software-horizons.com wrote: On Fri, Sep 20, 2013 at 11:24 AM, Joshua Kehn josh.k...@gmail.com wrote: Slightly snobbish solution: Don't use windows. Unfortunately required to VPN into most of my clients corporate networks. Windows is required to VPN in? I'm guessing they use some proprietary client then? --jk Yes, and/or they validate the host ID, and/or there's some soft key RSA thing involved. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Sep 20, 2013, at 1:04 PM, Daniel Brown danbr...@php.net wrote: I'm in my mid-thirties and - despite having an optical mouse - I do indeed still use a mousepad. A customized one that the wife did for me for Christmas one year: images of Futurama, the Cleveland Browns, Minnesota Vikings, and several aircraft, all surrounding a picture of her and our daughter. I've found that shiny surfaces - such as my desk - reflect too much of the laser, causing the mouse to be far less responsive. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ I'm in my 20's and rarely, if ever, use a dedicated mouse. I've transitioned to having all my workstations be laptops of one sort or another and they have built-in trackpads. Of course I also rarely use the mouse when there are so many keyboard shortcuts available. Best, –Josh Joshua Kehn | @joshkehn http://joshuakehn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
Tedd Sperling t...@sperling.com wrote on 09/20/2013 10:51:49 AM: Do you use a Mousepad? [-snip-] Age: Bag Bomb Mousepad: Yes Padding for my wrist and quieter moving the mouse around - no scraping. So yes, I'm even too old to be plugged into an iPud or an iPeed, whatever they are :) Kirk
RE: [PHP] Friday's Question
-Original Message- From: Tedd Sperling [mailto:t...@sperling.com] Sent: Friday, September 20, 2013 12:52 PM To: php-general@lists.php.net Subject: [PHP] Friday's Question Hi gang: Do you use a Mousepad? My reason for asking is that I've used a Mousepad ever since mice first came out (back when they had one ball). Now that mice are optical (no balls), Mousepads are not really needed -- or so I'll told by the college -- you see, they don't provide Mousepads for their student's computers. As such, I wondered what's the percentage of programmers still using a Mousepad? Secondly, are Mousepads used primarily by older programmers (like me) while younger programmers don't use Mousepads, or what? So -- please respond with: Age: * Mousepad: Yes/No Thank you, tedd PS: * If you don't want to provide your actual age, then indicate your age by stating young, middle-age, old-age, ancient, or whatever term describes your age. Alternate -- I claim that you can tell a man's age by ten-times the number of personal products he routinely uses, for example: Years Old - Personal Products 10Toothpaste 20Toothpaste, Deodorant 30Toothpaste, Deodorant, Aftershave 40Toothpaste, Deodorant, Aftershave, Minoxidil 50Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H 60Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb 70Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb, Fixodent So, you could indicate age by stating Bag Bomb like me. ___ tedd sperling t...@sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Age: 54 Mousepad: Yes Laser mice don't like reflective surfaces so much and if I don't carve out desk space for my mouse with a mousepad, I find that moving my mouse over multiple sheets of paper, paperclips, and whatnot is not very effective and somewhat frustrating. Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 6:51 PM, Tedd Sperling t...@sperling.com wrote: Hi gang: Do you use a Mousepad? My reason for asking is that I've used a Mousepad ever since mice first came out (back when they had one ball). Now that mice are optical (no balls), Mousepads are not really needed -- or so I'll told by the college -- you see, they don't provide Mousepads for their student's computers. As such, I wondered what's the percentage of programmers still using a Mousepad? Secondly, are Mousepads used primarily by older programmers (like me) while younger programmers don't use Mousepads, or what? So -- please respond with: Age: * Mousepad: Yes/No Age: 21 Mouse: No, so why would I need a mousepad?
RE: [PHP] Friday's Question
-Original Message- From: Tedd Sperling [mailto:t...@sperling.com] Sent: Friday, September 20, 2013 11:52 AM To: php-general@lists.php.net Subject: [PHP] Friday's Question Hi gang: Do you use a Mousepad? My reason for asking is that I've used a Mousepad ever since mice first came out (back when they had one ball). Now that mice are optical (no balls), Mousepads are not really needed -- or so I'll told by the college -- you see, they don't provide Mousepads for their student's computers. As such, I wondered what's the percentage of programmers still using a Mousepad? Secondly, are Mousepads used primarily by older programmers (like me) while younger programmers don't use Mousepads, or what? So -- please respond with: Age: * Mousepad: Yes/No Thank you, tedd PS: * If you don't want to provide your actual age, then indicate your age by stating young, middle-age, old-age, ancient, or whatever term describes your age. Alternate -- I claim that you can tell a man's age by ten-times the number of personal products he routinely uses, for example: Years Old - Personal Products 10 Toothpaste 20 Toothpaste, Deodorant 30 Toothpaste, Deodorant, Aftershave 40 Toothpaste, Deodorant, Aftershave, Minoxidil 50 Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H 60 Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb 70 Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb, Fixodent So, you could indicate age by stating Bag Bomb like me. ___ tedd sperling t...@sperling.com 41 Mouse (yes) - I already have issues with my hands from work (carpal tunnel) so I need all the cushion I can get, andoh yeah Fixodent LOL. What in the heck is a Bag Bomb? Jen -- 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] Friday's Question
On Fri, Sep 20, 2013 at 12:51 PM, Tedd Sperling t...@sperling.com wrote: Hi gang: Do you use a Mousepad? I'm in my mid-thirties and - despite having an optical mouse - I do indeed still use a mousepad. A customized one that the wife did for me for Christmas one year: images of Futurama, the Cleveland Browns, Minnesota Vikings, and several aircraft, all surrounding a picture of her and our daughter. I've found that shiny surfaces - such as my desk - reflect too much of the laser, causing the mouse to be far less responsive. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 10:51 AM, Tedd Sperling t...@sperling.com wrote: Hi gang: Do you use a Mousepad? My reason for asking is that I've used a Mousepad ever since mice first came out (back when they had one ball). Now that mice are optical (no balls), Mousepads are not really needed -- or so I'll told by the college -- you see, they don't provide Mousepads for their student's computers. As such, I wondered what's the percentage of programmers still using a Mousepad? Secondly, are Mousepads used primarily by older programmers (like me) while younger programmers don't use Mousepads, or what? So -- please respond with: Age: * Mousepad: Yes/No 54 Yes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
Haha, like your product usage chart Tedd, Age: 31 Mousepad: Webster New Dictionary of Synonyms, too lazy of having to go to Microcenter and buy one! Aziz On Fri, Sep 20, 2013 at 12:58 PM, Larry Martell la...@software-horizons.com wrote: On Fri, Sep 20, 2013 at 10:51 AM, Tedd Sperling t...@sperling.com wrote: Hi gang: Do you use a Mousepad? My reason for asking is that I've used a Mousepad ever since mice first came out (back when they had one ball). Now that mice are optical (no balls), Mousepads are not really needed -- or so I'll told by the college -- you see, they don't provide Mousepads for their student's computers. As such, I wondered what's the percentage of programmers still using a Mousepad? Secondly, are Mousepads used primarily by older programmers (like me) while younger programmers don't use Mousepads, or what? So -- please respond with: Age: * Mousepad: Yes/No 54 Yes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 11:16 AM, Joshua Kehn josh.k...@gmail.com wrote: On Sep 20, 2013, at 1:04 PM, Daniel Brown danbr...@php.net wrote: I'm in my mid-thirties and - despite having an optical mouse - I do indeed still use a mousepad. A customized one that the wife did for me for Christmas one year: images of Futurama, the Cleveland Browns, Minnesota Vikings, and several aircraft, all surrounding a picture of her and our daughter. I've found that shiny surfaces - such as my desk - reflect too much of the laser, causing the mouse to be far less responsive. I'm in my 20's and rarely, if ever, use a dedicated mouse. I've transitioned to having all my workstations be laptops of one sort or another and they have built-in trackpads. Of course I also rarely use the mouse when there are so many keyboard shortcuts available. When I'm on my MacBook (which is most of the time) I use the trackpad. But in the unfortunate times I have to be on a Windows box I always connect a mouse. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Sep 20, 2013, at 1:26 PM, Larry Martell la...@software-horizons.com wrote: On Fri, Sep 20, 2013 at 11:24 AM, Joshua Kehn josh.k...@gmail.com wrote: Slightly snobbish solution: Don't use windows. Unfortunately required to VPN into most of my clients corporate networks. Windows is required to VPN in? I'm guessing they use some proprietary client then? --jk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On 20 sep. 2013, at 18:51, Tedd Sperling t...@sperling.com wrote: Hi gang: Do you use a Mousepad? My reason for asking is that I've used a Mousepad ever since mice first came out (back when they had one ball). Now that mice are optical (no balls), Mousepads are not really needed -- or so I'll told by the college -- you see, they don't provide Mousepads for their student's computers. As such, I wondered what's the percentage of programmers still using a Mousepad? Secondly, are Mousepads used primarily by older programmers (like me) while younger programmers don't use Mousepads, or what? So -- please respond with: Age: * Mousepad: Yes/No Thank you, tedd PS: * If you don't want to provide your actual age, then indicate your age by stating young, middle-age, old-age, ancient, or whatever term describes your age. Alternate -- I claim that you can tell a man's age by ten-times the number of personal products he routinely uses, for example: Years Old - Personal Products 10Toothpaste 20Toothpaste, Deodorant 30Toothpaste, Deodorant, Aftershave 40Toothpaste, Deodorant, Aftershave, Minoxidil 50Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H 60Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb 70Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb, Fixodent So, you could indicate age by stating Bag Bomb like me. ___ tedd sperling t...@sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Age: Aftershave (but I've began using it only a year ago xD) Mousepad: No, but if I had to use a mouse, I prefer a mousepad I currently use only my MBP's trackpad, and it is so customizable I ended up buying a magic trackpad for my Mac at work as well. But, back in the days of Windows I was using a mousepad, mainly because it just looks better than having nothing at all. Greetings. Met vriendelijke groet, Camilo Sperberg W: http://unreal4u.com T: http://twitter.com/unreal4u -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 1:20 PM, Jen Rasmussen j...@cetaceasound.com wrote: LOL. What in the heck is a Bag Bomb? He's referring to Bag Balm. http://www.bagbalm.com/ -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 11:20 AM, Jen Rasmussen j...@cetaceasound.com wrote: -Original Message- What in the heck is a Bag Bomb? It's a salve for cow udders. Not sure what a person would do with it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 11:24 AM, Joshua Kehn josh.k...@gmail.com wrote: On Sep 20, 2013, at 1:23 PM, Larry Martell la...@software-horizons.com wrote: On Fri, Sep 20, 2013 at 11:16 AM, Joshua Kehn josh.k...@gmail.com wrote: I'm in my 20's and rarely, if ever, use a dedicated mouse. I've transitioned to having all my workstations be laptops of one sort or another and they have built-in trackpads. Of course I also rarely use the mouse when there are so many keyboard shortcuts available. When I'm on my MacBook (which is most of the time) I use the trackpad. But in the unfortunate times I have to be on a Windows box I always connect a mouse. Slightly snobbish solution: Don't use windows. Unfortunately required to VPN into most of my clients corporate networks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Fri, Sep 20, 2013 at 12:51:49PM -0400, Tedd Sperling wrote: Hi gang: Do you use a Mousepad? College Student (Electrical Engineer, go figure). Age: 20 Mousepad: yes I've used both optical and laser mice (they're a bit different, but similar tech) and I've found that I like having the pad because it sets the DPI of the mouse consistently. My favorite mousepad is this cheap as hell thin rubber and cloth one that I got from dealextreme.com many years ago. Go figure... --Sean -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Sep 20, 2013, at 1:23 PM, Larry Martell la...@software-horizons.com wrote: On Fri, Sep 20, 2013 at 11:16 AM, Joshua Kehn josh.k...@gmail.com wrote: I'm in my 20's and rarely, if ever, use a dedicated mouse. I've transitioned to having all my workstations be laptops of one sort or another and they have built-in trackpads. Of course I also rarely use the mouse when there are so many keyboard shortcuts available. When I'm on my MacBook (which is most of the time) I use the trackpad. But in the unfortunate times I have to be on a Windows box I always connect a mouse. Slightly snobbish solution: Don't use windows. --jk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On Sep 20, 2013, at 1:25 PM, Larry Martell la...@software-horizons.com wrote: On Fri, Sep 20, 2013 at 11:20 AM, Jen Rasmussen j...@cetaceasound.com wrote: -Original Message- What in the heck is a Bag Bomb? It's a salve for cow udders. Not sure what a person would do with it. Feet. Wait until you have callus as feet. tedd ___ tedd sperling t...@sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On 9/20/2013 1:24 PM, Joshua Kehn wrote: On Sep 20, 2013, at 1:23 PM, Larry Martell la...@software-horizons.com wrote: On Fri, Sep 20, 2013 at 11:16 AM, Joshua Kehn josh.k...@gmail.com wrote: I'm in my 20's and rarely, if ever, use a dedicated mouse. I've transitioned to having all my workstations be laptops of one sort or another and they have built-in trackpads. Of course I also rarely use the mouse when there are so many keyboard shortcuts available. When I'm on my MacBook (which is most of the time) I use the trackpad. But in the unfortunate times I have to be on a Windows box I always connect a mouse. Slightly snobbish solution: Don't use windows. I'm agnostic when it comes to operating systems. I use Windows, Linux and Mac. I always go for a mouse. If the surface is really shiny, you'll need something under the mouse. In the case of a shiny surface, I've even used a piece of paper under the mouse in a pinch. I tend to use a mousepad in those cases, though. I'm not using one at home, but I do use one at work. It's a matter of taste. --jk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
40, and no mouse pad atm. Seems that this table top is okay. This is an optical mouse without a ball underneath. However this mac-y-mouse DOES have a ball on top, for scrolling. Go figure. Mattias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
Thanks, Bastien On Sep 20, 2013, at 12:51 PM, Tedd Sperling t...@sperling.com wrote: Hi gang: Do you use a Mousepad? My reason for asking is that I've used a Mousepad ever since mice first came out (back when they had one ball). Now that mice are optical (no balls), Mousepads are not really needed -- or so I'll told by the college -- you see, they don't provide Mousepads for their student's computers. As such, I wondered what's the percentage of programmers still using a Mousepad? Secondly, are Mousepads used primarily by older programmers (like me) while younger programmers don't use Mousepads, or what? So -- please respond with: Age: * Mousepad: Yes/No Thank you, tedd PS: * If you don't want to provide your actual age, then indicate your age by stating young, middle-age, old-age, ancient, or whatever term describes your age. Alternate -- I claim that you can tell a man's age by ten-times the number of personal products he routinely uses, for example: Years Old- Personal Products 10Toothpaste 20Toothpaste, Deodorant 30Toothpaste, Deodorant, Aftershave 40Toothpaste, Deodorant, Aftershave, Minoxidil 50Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H 60Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb 70Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb, Fixodent So, you could indicate age by stating Bag Bomb like me. ___ tedd Every time I see something about mice, i always remember this article from IBM on how to care for your mouse. Best technical doc ever! http://www.snopes.com/humor/business/mouse.asp But in any case, 43 Use a mouse: yes mousepad occasionally depending on table surface -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
On 21/09/2013, at 4:51, Tedd Sperling t...@sperling.com wrote: Hi gang: Do you use a Mousepad? My reason for asking is that I've used a Mousepad ever since mice first came out (back when they had one ball). Now that mice are optical (no balls), Mousepads are not really needed -- or so I'll told by the college -- you see, they don't provide Mousepads for their student's computers. As such, I wondered what's the percentage of programmers still using a Mousepad? Secondly, are Mousepads used primarily by older programmers (like me) while younger programmers don't use Mousepads, or what? So -- please respond with: Age: * Mousepad: Yes/No Thank you, 22 and I entirely use trackpads (inbuilt or bluetooth Magic Trackpad). --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Friday's Question
25 network admin and programmer and yes I use a mouse pad - my mouse hates me if I dont use it. -- Regards, Daniel Fenn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] syntax question
Can someone tell me what this syntax is? I looked around but don't see any mention of it. while(condition) : (statement); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax question
Hello, is an alternative syntax. http://php.net/manual/en/control-structures.alternative-syntax.php Premek. On Wed, 10 Jul 2013 13:15:22 +0200, Jim Giner jim.gi...@albanyhandball.com wrote: Can someone tell me what this syntax is? I looked around but don't see any mention of it. while(condition) : (statement); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax question
Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] filesize question
On Tue, May 7, 2013 at 10:16 PM, Curtis Maurand cur...@maurand.com wrote: find -name *.js -exec removestring.php '{}' \; That's how I get the I put file name. I think that I need the if statement to look at the filesize and make sure that I can open them and they are at least the size of the string that I'm looking to cleanse. That's how you pass the name into the php script; how does $inputfile get set (via $argv somehow) once you're inside php? This line: $inputline = fread($inputfile, filesize($argv[1])); Somehow, you opened $inputfile (assuming via fopen) by passing it a file name, presumably off the command line. Show me(us) where that happens. Would that joomla.modules would use the ftp layer if it were turned on. Then I wouldn't have to be scanning files dor malicious iframes or if clamav coyld remove offending code without removing the entire file... I don't know anything about joomla. tamouse mailing lists tamouse.li...@gmail.com wrote: On Tue, May 7, 2013 at 8:16 AM, Curtis Maurand cur...@maurand.com wrote: Hello, I'm feeding a filename to a php script on the command line (command line program). I run the following against it: $inputline = fread($inputfile, filesize($argv[1])); I'm getting an error complaining that the second parameter can't be '0' The thing to look for, is how did you get $inputfile out of the command line, and why you'd expect the file name to be in $argv[1] at that point? Marco's suggestion isn't really going to work as $inputfile will be a file handle, and filesize() needs the name of the file. Maybe want to give us a wider look at what your code is doing? Generically, you can wrap this up as: function binread_file($filename) { $handle = fopen($filename,'rb'); if (FALSE === $handle) die(Unable to open $filename); $contents = fread($handle, filesize($filename)); if (FALSE === $contents) die(Unable to read $filename); return $contents; } -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] filesize question
Hello, I'm feeding a filename to a php script on the command line (command line program). I run the following against it: $inputline = fread($inputfile, filesize($argv[1])); I'm getting an error complaining that the second parameter can't be '0' any ideas? thanks, Curtis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] filesize question
Curtis Maurand cur...@maurand.com hat am 7. Mai 2013 um 15:16 geschrieben: Hello, I'm feeding a filename to a php script on the command line (command line program). I run the following against it: $inputline = fread($inputfile, filesize($argv[1])); mayve $inputline = fread($inputfile, filesize($inputfile)); I'm getting an error complaining that the second parameter can't be '0' any ideas? thanks, Curtis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Diploma Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: ma...@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.biz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] filesize question
On Tue, May 7, 2013 at 8:16 AM, Curtis Maurand cur...@maurand.com wrote: Hello, I'm feeding a filename to a php script on the command line (command line program). I run the following against it: $inputline = fread($inputfile, filesize($argv[1])); I'm getting an error complaining that the second parameter can't be '0' The thing to look for, is how did you get $inputfile out of the command line, and why you'd expect the file name to be in $argv[1] at that point? Marco's suggestion isn't really going to work as $inputfile will be a file handle, and filesize() needs the name of the file. Maybe want to give us a wider look at what your code is doing? Generically, you can wrap this up as: function binread_file($filename) { $handle = fopen($filename,'rb'); if (FALSE === $handle) die(Unable to open $filename); $contents = fread($handle, filesize($filename)); if (FALSE === $contents) die(Unable to read $filename); return $contents; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie Question - Parse XML with PHP...
I have an app that gets passed in xml and use this code to read that data in // We use php://input to get the raw $_POST results. $xml_post = file_get_contents('php://input'); Maybe it will help Bastien On Sat, Apr 20, 2013 at 7:48 AM, shiplu shiplu@gmail.com wrote: Question: how do you use $mylist when the xml is not as a file but is returned on a web page? I assume It returns as a string from page. Then use simplexml_load_string(). See http://php.net/manual/en/function.simplexml-load-string.php -- Shiplu.Mokadd.im ImgSign.com | A dynamic signature machine Innovation distinguishes between follower and leader -- Bastien Cat, the other other white meat
Re: [PHP] Newbie Question - Parse XML with PHP...
On Apr 22, 2013 7:00 AM, Bastien Koert phps...@gmail.com wrote: I have an app that gets passed in xml and use this code to read that data in // We use php://input to get the raw $_POST results. $xml_post = file_get_contents('php://input'); $xml_post is string. I think now you know what to do.
Re: [PHP] Newbie Question - Parse XML with PHP...
This will be brief as I'm on a tablet... On Apr 19, 2013 5:53 PM, dealTek deal...@gmail.com wrote: On Apr 19, 2013, at 3:32 PM, tamouse mailing lists tamouse.li...@gmail.com wrote: page1.php is sending out to credit card company - getting processed - then coming back to the *same page1.php* with the XML data listed below... Please expand what you mean by sending out and coming back - is this a REST or SOAP API call? In that case, the response body is likely to be the XML. - so I'm not going to some other page to get it - it is coming to me to the same page I am on.. so - after the XML result comes in - I need to assign the php to the XML somehow... How do you recognize the XML result com(ing) in ? Hi tamouse, with my untrained eye - it appears that this is what is 'sending out' $data = sendXMLviaCurl($xmlRequest,$gatewayURL); This is the sending and receiving -- the function uses curl to send your xml request and returns the response from that. and this might be what is 'responding back' on the same page $gwResponse = @new SimpleXMLElement((string)$data); $data contains the response, this is how you are processing it. Skipping the long and monolithic code, what I will suggest is that you break things up into modules, functions and procrdures, and write unit tests that will check each piece seperately. After you've verified that each step is working, then you can start to integrate the pieces, following the stricture of keeping code (logic), data, and presentation seperate. It is much easier to deal with debugging when your code is simple and does only one thing. Break out the part you are asking here about, the API call. Build up a viable test request that will get you a known response and make sure you are getting what you expect. My suspicion is that the response here isnot what you expect.
Re: [PHP] Newbie Question - Parse XML with PHP...
On Sat, Apr 20, 2013 at 12:51 AM, dealTek deal...@gmail.com wrote: On Apr 19, 2013, at 3:32 PM, tamouse mailing lists tamouse.li...@gmail.com wrote: page1.php is sending out to credit card company - getting processed - then coming back to the *same page1.php* with the XML data listed below... Please expand what you mean by sending out and coming back - is this a REST or SOAP API call? In that case, the response body is likely to be the XML. - so I'm not going to some other page to get it - it is coming to me to the same page I am on.. so - after the XML result comes in - I need to assign the php to the XML somehow... How do you recognize the XML result com(ing) in ? Hi tamouse, with my untrained eye - it appears that this is what is 'sending out' $data = sendXMLviaCurl($xmlRequest,$gatewayURL); and this might be what is 'responding back' on the same page $gwResponse = @new SimpleXMLElement((string)$data); you can see these lines towards the bottom at - // Process Step Three... Why did you prefix this with @? This way your hiding the real error that is probably the answer to why it is not working. - Matijn
Re: [PHP] Newbie Question - Parse XML with PHP...
Question: how do you use $mylist when the xml is not as a file but is returned on a web page? I assume It returns as a string from page. Then use simplexml_load_string(). See http://php.net/manual/en/function.simplexml-load-string.php -- Shiplu.Mokadd.im ImgSign.com | A dynamic signature machine Innovation distinguishes between follower and leader
[PHP] Newbie Question - Parse XML with PHP...
Hi all, newbie - just starting with trying to parse XML... $mylist = simplexml_load_file('thelist.xml'); then use a foreach to echo the data... ?php $mysongs = simplexml_load_file('songs.xml'); foreach ($mysongs as $songinfo) { $title=$songinfo-title; $artist=$songinfo-artist; $date=$songinfo['dateplayed']; echo $title.' --- '; echo $artist.' --- '; echo $date.' --- '; echo ' /br '; } ? that I get ... Question: how do you use $mylist when the xml is not as a file but is returned on a web page? an example of the real xml I am trying to work with is like this demo below Goal : when this response comes back - I would like to be able to get the data as php and then update the database example ?xml version=1.0 encoding=UTF-8? response result1/result result-textSUCCESS/result-text transaction-id1865264174/transaction-id result-code100/result-code authorization-code123456/authorization-code avs-resultN/avs-result cvv-resultN/cvv-result action-typesale/action-type amount12.00/amount ip-address::1/ip-address industryecommerce/industry processor-idccprocessora/processor-id currencyUSD/currency order-descriptionSmall Order/order-description merchant-defined-field-1Red/merchant-defined-field-1 merchant-defined-field-2Medium/merchant-defined-field-2 order-id1234/order-id tax-amount2.00/tax-amount shipping-amount0.00/shipping-amount billing first-nameJohn/first-name last-nameSmith/last-name address11234 Main St./address1 cityBeverly Hills/city stateCA/state postal90210/postal countryUS/country phone555-555-/phone emailt...@example.com/email companyAcme, Inc./company cc-number40**0002/cc-number cc-exp0118/cc-exp /billing shipping first-nameMary/first-name last-nameSmith/last-name address11234 Main St./address1 cityBeverly Hills/city stateCA/state postal90210/postal countryUS/country address2Unit #2/address2 /shipping product product-codeSKU-123456/product-code descriptiontest product description/description commodity-codeabc/commodity-code unit-of-measure1/unit-of-measure unit-cost5./unit-cost quantity1./quantity total-amount7.00/total-amount tax-amount2.00/tax-amount tax-rate1.00/tax-rate discount-amount2.00/discount-amount discount-rate1.00/discount-rate tax-typesales/tax-type alternate-tax-id12345/alternate-tax-id /product product product-codeSKU-123456/product-code descriptiontest 2 product description/description commodity-codeabc/commodity-code unit-of-measure2/unit-of-measure unit-cost2.5000/unit-cost quantity2./quantity total-amount7.00/total-amount tax-amount2.00/tax-amount tax-rate1.00/tax-rate discount-amount2.00/discount-amount discount-rate1.00/discount-rate tax-typesales/tax-type alternate-tax-id12345/alternate-tax-id /product /response -- Thanks, Dave - DealTek deal...@gmail.com [db-3]
Re: [PHP] Newbie Question - Parse XML with PHP...
A webpage is a file, that (usually) a browser downloads and parses. You'll do exactly the same :-) I don't know exactly, but you can try to pass the URL directly to simplexml_load_file(). If this doesn't work, download the content (for example with file_get_contents()) and pass it to simplexml_load_string(). There are obviously many other approaches, but you should now have an idea :-) Or you use a specialized library like Guzzle. Am 19.04.2013 22:17 schrieb dealTek deal...@gmail.com: Hi all, newbie - just starting with trying to parse XML... $mylist = simplexml_load_file('thelist.xml'); then use a foreach to echo the data... ?php $mysongs = simplexml_load_file('songs.xml'); foreach ($mysongs as $songinfo) { $title=$songinfo-title; $artist=$songinfo-artist; $date=$songinfo['dateplayed']; echo $title.' --- '; echo $artist.' --- '; echo $date.' --- '; echo ' /br '; } ? that I get ... Question: how do you use $mylist when the xml is not as a file but is returned on a web page? an example of the real xml I am trying to work with is like this demo below Goal : when this response comes back - I would like to be able to get the data as php and then update the database example ?xml version=1.0 encoding=UTF-8? response result1/result result-textSUCCESS/result-text transaction-id1865264174/transaction-id result-code100/result-code authorization-code123456/authorization-code avs-resultN/avs-result cvv-resultN/cvv-result action-typesale/action-type amount12.00/amount ip-address::1/ip-address industryecommerce/industry processor-idccprocessora/processor-id currencyUSD/currency order-descriptionSmall Order/order-description merchant-defined-field-1Red/merchant-defined-field-1 merchant-defined-field-2Medium/merchant-defined-field-2 order-id1234/order-id tax-amount2.00/tax-amount shipping-amount0.00/shipping-amount billing first-nameJohn/first-name last-nameSmith/last-name address11234 Main St./address1 cityBeverly Hills/city stateCA/state postal90210/postal countryUS/country phone555-555-/phone emailt...@example.com/email companyAcme, Inc./company cc-number40**0002/cc-number cc-exp0118/cc-exp /billing shipping first-nameMary/first-name last-nameSmith/last-name address11234 Main St./address1 cityBeverly Hills/city stateCA/state postal90210/postal countryUS/country address2Unit #2/address2 /shipping product product-codeSKU-123456/product-code descriptiontest product description/description commodity-codeabc/commodity-code unit-of-measure1/unit-of-measure unit-cost5./unit-cost quantity1./quantity total-amount7.00/total-amount tax-amount2.00/tax-amount tax-rate1.00/tax-rate discount-amount2.00/discount-amount discount-rate1.00/discount-rate tax-typesales/tax-type alternate-tax-id12345/alternate-tax-id /product product product-codeSKU-123456/product-code descriptiontest 2 product description/description commodity-codeabc/commodity-code unit-of-measure2/unit-of-measure unit-cost2.5000/unit-cost quantity2./quantity total-amount7.00/total-amount tax-amount2.00/tax-amount tax-rate1.00/tax-rate discount-amount2.00/discount-amount discount-rate1.00/discount-rate tax-typesales/tax-type alternate-tax-id12345/alternate-tax-id /product /response -- Thanks, Dave - DealTek deal...@gmail.com [db-3]
Re: [PHP] Newbie Question - Parse XML with PHP...
On Apr 19, 2013, at 1:33 PM, Sebastian Krebs krebs@gmail.com wrote: A webpage is a file, that (usually) a browser downloads and parses. You'll do exactly the same :-) I don't know exactly, but you can try to pass the URL directly to simplexml_load_file(). If this doesn't work, download the content (for example with file_get_contents()) and pass it to simplexml_load_string(). There are obviously many other approaches, but you should now have an idea :-) Thanks Sebastian for the help Actually what is happening in my case is: page1.php is sending out to credit card company - getting processed - then coming back to the *same page1.php* with the XML data listed below... - so I'm not going to some other page to get it - it is coming to me to the same page I am on.. so - after the XML result comes in - I need to assign the php to the XML somehow... I hope I am making myself clear Thanks in advance for the help Or you use a specialized library like Guzzle. Am 19.04.2013 22:17 schrieb dealTek deal...@gmail.com: Hi all, newbie - just starting with trying to parse XML... $mylist = simplexml_load_file('thelist.xml'); then use a foreach to echo the data... ?php $mysongs = simplexml_load_file('songs.xml'); foreach ($mysongs as $songinfo) { $title=$songinfo-title; $artist=$songinfo-artist; $date=$songinfo['dateplayed']; echo $title.' --- '; echo $artist.' --- '; echo $date.' --- '; echo ' /br '; } ? that I get ... Question: how do you use $mylist when the xml is not as a file but is returned on a web page? an example of the real xml I am trying to work with is like this demo below Goal : when this response comes back - I would like to be able to get the data as php and then update the database example ?xml version=1.0 encoding=UTF-8? response result1/result result-textSUCCESS/result-text transaction-id1865264174/transaction-id result-code100/result-code authorization-code123456/authorization-code avs-resultN/avs-result cvv-resultN/cvv-result action-typesale/action-type amount12.00/amount ip-address::1/ip-address industryecommerce/industry processor-idccprocessora/processor-id currencyUSD/currency order-descriptionSmall Order/order-description merchant-defined-field-1Red/merchant-defined-field-1 merchant-defined-field-2Medium/merchant-defined-field-2 order-id1234/order-id tax-amount2.00/tax-amount shipping-amount0.00/shipping-amount billing first-nameJohn/first-name last-nameSmith/last-name address11234 Main St./address1 cityBeverly Hills/city stateCA/state postal90210/postal countryUS/country phone555-555-/phone emailt...@example.com/email companyAcme, Inc./company cc-number40**0002/cc-number cc-exp0118/cc-exp /billing shipping first-nameMary/first-name last-nameSmith/last-name address11234 Main St./address1 cityBeverly Hills/city stateCA/state postal90210/postal countryUS/country address2Unit #2/address2 /shipping product product-codeSKU-123456/product-code descriptiontest product description/description commodity-codeabc/commodity-code unit-of-measure1/unit-of-measure unit-cost5./unit-cost quantity1./quantity total-amount7.00/total-amount tax-amount2.00/tax-amount tax-rate1.00/tax-rate discount-amount2.00/discount-amount discount-rate1.00/discount-rate tax-typesales/tax-type alternate-tax-id12345/alternate-tax-id /product product product-codeSKU-123456/product-code descriptiontest 2 product description/description commodity-codeabc/commodity-code unit-of-measure2/unit-of-measure unit-cost2.5000/unit-cost quantity2./quantity total-amount7.00/total-amount tax-amount2.00/tax-amount tax-rate1.00/tax-rate discount-amount2.00/discount-amount discount-rate1.00/discount-rate tax-typesales/tax-type alternate-tax-id12345/alternate-tax-id /product /response -- Thanks, Dave - DealTek deal...@gmail.com [db-3] -- Thanks, Dave - DealTek deal...@gmail.com [db-3]
Re: [PHP] Newbie Question - Parse XML with PHP...
On Fri, Apr 19, 2013 at 4:04 PM, dealTek deal...@gmail.com wrote: On Apr 19, 2013, at 1:33 PM, Sebastian Krebs krebs@gmail.com wrote: A webpage is a file, that (usually) a browser downloads and parses. You'll do exactly the same :-) I don't know exactly, but you can try to pass the URL directly to simplexml_load_file(). If this doesn't work, download the content (for example with file_get_contents()) and pass it to simplexml_load_string(). There are obviously many other approaches, but you should now have an idea :-) Thanks Sebastian for the help Actually what is happening in my case is: page1.php is sending out to credit card company - getting processed - then coming back to the *same page1.php* with the XML data listed below... Please expand what you mean by sending out and coming back - is this a REST or SOAP API call? In that case, the response body is likely to be the XML. - so I'm not going to some other page to get it - it is coming to me to the same page I am on.. so - after the XML result comes in - I need to assign the php to the XML somehow... How do you recognize the XML result com(ing) in ? I hope I am making myself clear Thanks in advance for the help Or you use a specialized library like Guzzle. Am 19.04.2013 22:17 schrieb dealTek deal...@gmail.com: Hi all, newbie - just starting with trying to parse XML... $mylist = simplexml_load_file('thelist.xml'); then use a foreach to echo the data... ?php $mysongs = simplexml_load_file('songs.xml'); foreach ($mysongs as $songinfo) { $title=$songinfo-title; $artist=$songinfo-artist; $date=$songinfo['dateplayed']; echo $title.' --- '; echo $artist.' --- '; echo $date.' --- '; echo ' /br '; } ? that I get ... Question: how do you use $mylist when the xml is not as a file but is returned on a web page? an example of the real xml I am trying to work with is like this demo below Goal : when this response comes back - I would like to be able to get the data as php and then update the database example ?xml version=1.0 encoding=UTF-8? response result1/result result-textSUCCESS/result-text transaction-id1865264174/transaction-id result-code100/result-code authorization-code123456/authorization-code avs-resultN/avs-result cvv-resultN/cvv-result action-typesale/action-type amount12.00/amount ip-address::1/ip-address industryecommerce/industry processor-idccprocessora/processor-id currencyUSD/currency order-descriptionSmall Order/order-description merchant-defined-field-1Red/merchant-defined-field-1 merchant-defined-field-2Medium/merchant-defined-field-2 order-id1234/order-id tax-amount2.00/tax-amount shipping-amount0.00/shipping-amount billing first-nameJohn/first-name last-nameSmith/last-name address11234 Main St./address1 cityBeverly Hills/city stateCA/state postal90210/postal countryUS/country phone555-555-/phone emailt...@example.com/email companyAcme, Inc./company cc-number40**0002/cc-number cc-exp0118/cc-exp /billing shipping first-nameMary/first-name last-nameSmith/last-name address11234 Main St./address1 cityBeverly Hills/city stateCA/state postal90210/postal countryUS/country address2Unit #2/address2 /shipping product product-codeSKU-123456/product-code descriptiontest product description/description commodity-codeabc/commodity-code unit-of-measure1/unit-of-measure unit-cost5./unit-cost quantity1./quantity total-amount7.00/total-amount tax-amount2.00/tax-amount tax-rate1.00/tax-rate discount-amount2.00/discount-amount discount-rate1.00/discount-rate tax-typesales/tax-type alternate-tax-id12345/alternate-tax-id /product product product-codeSKU-123456/product-code descriptiontest 2 product description/description commodity-codeabc/commodity-code unit-of-measure2/unit-of-measure unit-cost2.5000/unit-cost quantity2./quantity total-amount7.00/total-amount tax-amount2.00/tax-amount tax-rate1.00/tax-rate discount-amount2.00/discount-amount discount-rate1.00/discount-rate tax-typesales/tax-type alternate-tax-id12345/alternate-tax-id /product /response -- Thanks, Dave - DealTek deal...@gmail.com [db-3] -- Thanks, Dave - DealTek deal...@gmail.com [db-3] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie Question - Parse XML with PHP...
On Apr 19, 2013, at 3:32 PM, tamouse mailing lists tamouse.li...@gmail.com wrote: page1.php is sending out to credit card company - getting processed - then coming back to the *same page1.php* with the XML data listed below... Please expand what you mean by sending out and coming back - is this a REST or SOAP API call? In that case, the response body is likely to be the XML. - so I'm not going to some other page to get it - it is coming to me to the same page I am on.. so - after the XML result comes in - I need to assign the php to the XML somehow... How do you recognize the XML result com(ing) in ? Hi tamouse, with my untrained eye - it appears that this is what is 'sending out' $data = sendXMLviaCurl($xmlRequest,$gatewayURL); and this might be what is 'responding back' on the same page $gwResponse = @new SimpleXMLElement((string)$data); you can see these lines towards the bottom at - // Process Step Three... --- the page code is long - so i cut out some extra lines - but this is === all page code - with edits... ?php // API Setup Parameters $gatewayURL = 'https://secure.webxxx.com/api/test'; $APIKey = 'xxx'; // If there is no POST data or a token-id, print the initial shopping cart form to get ready for Step One. if (empty($_POST['DO_STEP_1']) empty($_GET['token-id'])) { print ' !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;'; print ' html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 / titleCollect non-sensitive Customer Info /title /head body ph2Step One: Collect non-sensitive payment information.br //h2/p h3 Customer Information/h3 h4 Billing Details/h4 form action= method=post table trtdCompany/tdtdinput type=text name=billing-address-company value=Acme, Inc./td/tr --- more trtdh4br / Shipping Details/h4 --more trtd colspan=2nbsp;/td trtd colspan=2 align=centerTotal Amount $12.00 /td/tr trtd colspan=2 align=centerinput type=submit value=Submit Step Oneinput type=hidden name =DO_STEP_1 value=true/td/tr /table /form /body /html '; }else if (!empty($_POST['DO_STEP_1'])) { // Initiate Step One: Now that we've collected the non-sensitive payment information, we can combine other order information and build the XML format. $xmlRequest = new DOMDocument('1.0','UTF-8'); $xmlRequest-formatOutput = true; $xmlSale = $xmlRequest-createElement('sale'); // Amount, authentication, and Redirect-URL are typically the bare mininum. appendXmlNode($xmlSale,'api-key',$APIKey); appendXmlNode($xmlSale,'redirect-url',$_SERVER['HTTP_REFERER']); appendXmlNode($xmlSale, 'amount', '12.00'); appendXmlNode($xmlSale, 'ip-address', $_SERVER[REMOTE_ADDR]); //appendXmlNode($xmlSale, 'processor-id' , 'processora'); appendXmlNode($xmlSale, 'currency', 'USD'); //appendXmlNode($xmlSale, 'dup-seconds' , '2'); // Some additonal fields may have been previously decided by user appendXmlNode($xmlSale, 'order-id', '1234'); appendXmlNode($xmlSale, 'order-description', 'Small Order'); appendXmlNode($xmlSale, 'merchant-defined-field-1' , 'Red'); appendXmlNode($xmlSale, 'merchant-defined-field-2', 'Medium'); appendXmlNode($xmlSale, 'tax-amount' , '2.00'); appendXmlNode($xmlSale, 'shipping-amount' , '0.00'); /*if(!empty($_POST['customer-vault-id'])) { appendXmlNode($xmlSale, 'customer-vault-id' , $_POST['customer-vault-id']); }else { $xmlAdd = $xmlRequest-createElement('add-customer'); appendXmlNode($xmlAdd, 'customer-vault-id' ,411); $xmlSale-appendChild($xmlAdd); }*/ // Set the Billing Shipping from what was collected on initial shopping cart form $xmlBillingAddress = $xmlRequest-createElement('billing'); appendXmlNode($xmlBillingAddress,'first-name', $_POST['billing-address-first-name']); //-more //billing-address-email appendXmlNode($xmlBillingAddress,'country', $_POST['billing-address-country']); appendXmlNode($xmlBillingAddress,'email', $_POST['billing-address-email']); //more $xmlSale-appendChild($xmlBillingAddress); $xmlShippingAddress = $xmlRequest-createElement('shipping'); appendXmlNode($xmlShippingAddress,'first-name', $_POST['shipping-address-first-name']); appendXmlNode($xmlShippingAddress,'last-name', $_POST['shipping-address-last-name']); // more appendXmlNode($xmlShippingAddress,'fax', $_POST['shipping-address-fax']); $xmlSale-appendChild($xmlShippingAddress);
[PHP] htaccess question
I know it's not a php question, but I can't readily find the answer elsewhere. I want to make this directive universal. Put htaccess file on any host in any folder. This works RewriteEngine On RewriteCond %{SERVER_PORT} !=443 RewriteRule ^(.*)$ https://www.foo.org/bar/$1 [R=301,L] #Here the foo.org and /bar must be specified I want what is in effect RewriteRule ^(.*)$ https://{host_name}/{directory}/$1 [R=301,L] I can easily do this with php regex capturing the (host and dir) and then rewriting the text string; but the Apache directives are not obvious. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] htaccess question
On Tue, Apr 9, 2013 at 2:07 PM, Al n...@ridersite.org wrote: I know it's not a php question, but I can't readily find the answer elsewhere. I want to make this directive universal. Put htaccess file on any host in any folder. This works RewriteEngine On RewriteCond %{SERVER_PORT} !=443 RewriteRule ^(.*)$ https://www.foo.org/bar/$1 [R=301,L] #Here the foo.org and /bar must be specified I want what is in effect RewriteRule ^(.*)$ https://{host_name}/{directory}/$1 [R=301,L] I can easily do this with php regex capturing the (host and dir) and then rewriting the text string; but the Apache directives are not obvious. You were on the right track: RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] target question
target as in the form attribute In my appl devl I utilize an extra window when my current form is asked to generate a pdf report. Works well since that way the user can generate one report into a new window, read it, close it, and still have the reports menu in front of him/her and generate a 2nd report. I'm experiencing a problem tho and I'm guessing it's associated with ie9 or FPDF. In my reports menu form, when I click on a button that will generate a pdf, I alter the form's target to create a new window. This used to work last fall, but since then I have a new laptop running ie9, not 8. The target changing js logic is working as far as I can see (alerts in my js) but the effect is not there. Instead of a new window, the pdf opens up in the same window where the menu was and so when the user does a back he ends up going up one too many levels and has to re-request the reports menu. Didn't have this much trouble originally setting this up as I'm having now trying to debug this. I'm using the FPDF extension/class to generate my pdfs - made no recent changes there. Also my concept works very well still in a simple html document that has only two buttons on it which I created today to test a theory. That is - maybe it's not just IE9, but FPDF. Anyone have any experience in this area? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] target question
Have you tried to set a Content-Disposition header in the PHP script that creates the PDF, asking the browser to attach the download? This way you don't even need a new window. Example from php.net/manual: // It will be called downloaded.pdf header('Content-Disposition: attachment; filename=downloaded.pdf'); On Mon, Mar 25, 2013 at 11:01 AM, Jim Giner jim.gi...@albanyhandball.comwrote: target as in the form attribute In my appl devl I utilize an extra window when my current form is asked to generate a pdf report. Works well since that way the user can generate one report into a new window, read it, close it, and still have the reports menu in front of him/her and generate a 2nd report. I'm experiencing a problem tho and I'm guessing it's associated with ie9 or FPDF. In my reports menu form, when I click on a button that will generate a pdf, I alter the form's target to create a new window. This used to work last fall, but since then I have a new laptop running ie9, not 8. The target changing js logic is working as far as I can see (alerts in my js) but the effect is not there. Instead of a new window, the pdf opens up in the same window where the menu was and so when the user does a back he ends up going up one too many levels and has to re-request the reports menu. Didn't have this much trouble originally setting this up as I'm having now trying to debug this. I'm using the FPDF extension/class to generate my pdfs - made no recent changes there. Also my concept works very well still in a simple html document that has only two buttons on it which I created today to test a theory. That is - maybe it's not just IE9, but FPDF. Anyone have any experience in this area? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] target question
On 3/25/2013 10:13 AM, Samuel Lopes Grigolato wrote: Have you tried to set a Content-Disposition header in the PHP script that creates the PDF, asking the browser to attach the download? This way you don't even need a new window. Example from php.net/manual: // It will be called downloaded.pdf header('Content-Disposition: attachment; filename=downloaded.pdf'); On Mon, Mar 25, 2013 at 11:01 AM, Jim Giner jim.gi...@albanyhandball.comwrote: target as in the form attribute In my appl devl I utilize an extra window when my current form is asked to generate a pdf report. Works well since that way the user can generate one report into a new window, read it, close it, and still have the reports menu in front of him/her and generate a 2nd report. I'm experiencing a problem tho and I'm guessing it's associated with ie9 or FPDF. In my reports menu form, when I click on a button that will generate a pdf, I alter the form's target to create a new window. This used to work last fall, but since then I have a new laptop running ie9, not 8. The target changing js logic is working as far as I can see (alerts in my js) but the effect is not there. Instead of a new window, the pdf opens up in the same window where the menu was and so when the user does a back he ends up going up one too many levels and has to re-request the reports menu. Didn't have this much trouble originally setting this up as I'm having now trying to debug this. I'm using the FPDF extension/class to generate my pdfs - made no recent changes there. Also my concept works very well still in a simple html document that has only two buttons on it which I created today to test a theory. That is - maybe it's not just IE9, but FPDF. Anyone have any experience in this area? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php And what happens to my original menu window? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] target question
On Mon, Mar 25, 2013 at 10:01:03AM -0400, Jim Giner wrote: target as in the form attribute In my appl devl I utilize an extra window when my current form is asked to generate a pdf report. Works well since that way the user can generate one report into a new window, read it, close it, and still have the reports menu in front of him/her and generate a 2nd report. I'm experiencing a problem tho and I'm guessing it's associated with ie9 or FPDF. In my reports menu form, when I click on a button that will generate a pdf, I alter the form's target to create a new window. This used to work last fall, but since then I have a new laptop running ie9, not 8. The target changing js logic is working as far as I can see (alerts in my js) but the effect is not there. Instead of a new window, the pdf opens up in the same window where the menu was and so when the user does a back he ends up going up one too many levels and has to re-request the reports menu. Didn't have this much trouble originally setting this up as I'm having now trying to debug this. I'm using the FPDF extension/class to generate my pdfs - made no recent changes there. Also my concept works very well still in a simple html document that has only two buttons on it which I created today to test a theory. That is - maybe it's not just IE9, but FPDF. Anyone have any experience in this area? This behavior of the browser actually conforms to the standard as far as I know. The target attribute is attached only to the a tag, according to w3schools.com. It may work when you use it with a form tag, it doesn't surprise me if IE doesn't honor it (of course, nothing IE does would surprise me). In any case, using it with the form tag appears to be non-standard usage, which may or may not be supported by individual browsers. I handle this situation differently. My generator code (also using FPDF) dumps the PDF in a PDF directory. Then I provide a link elsewhere with an Adobe Acrobat logo which, when clicked, opens the PDF in a separate window, using the aforementioned a href=example.com/pdfs/something.pdf target=_blankMy PDF/a paradigm. In any case, I doubt very much FPDF has anything to do with this. It just dumps its creation to wherever you tell it. The browser determines what helper application it will use to open it when it downloads the content. Whether to open a separate window/tab is determined by the HTML the browser is looking at when it makes the content request. Paul -- Paul M. Foster http://noferblatz.com http://quillandmouse.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] target question
-Original Message- From: Paul M Foster [mailto:pa...@quillandmouse.com] Sent: 25 March 2013 16:09 This behavior of the browser actually conforms to the standard as far as I know. The target attribute is attached only to the a tag, according to w3schools.com Actually, the W3C HTML 4.01 Recommendation says: target = frame-target [CI] This attribute specifies the name of a frame where a document is to be opened. By assigning a name to a frame via the name attribute, authors can refer to it as the target of links defined by other elements. The target attribute may be set for elements that create links (A, LINK), image maps (AREA), and forms (FORM). In the current HTML5 draft, target is explicitly a permitted attribute of the form tag -- although I believe it was originally marked as deprecated. None of this really addresses the OP's problem, however, about which I have very little clue. Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Portland PD507, City Campus, Leeds Metropolitan University, Portland Way, LEEDS, LS1 3HE, United Kingdom E: m.f...@leedsmet.ac.uk T: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] target question
On 25 Mar 2013, at 16:35, Ford, Mike m.f...@leedsmet.ac.uk wrote: -Original Message- From: Paul M Foster [mailto:pa...@quillandmouse.com] Sent: 25 March 2013 16:09 This behavior of the browser actually conforms to the standard as far as I know. The target attribute is attached only to the a tag, according to w3schools.com Actually, the W3C HTML 4.01 Recommendation says: target = frame-target [CI] This attribute specifies the name of a frame where a document is to be opened. By assigning a name to a frame via the name attribute, authors can refer to it as the target of links defined by other elements. The target attribute may be set for elements that create links (A, LINK), image maps (AREA), and forms (FORM). In the current HTML5 draft, target is explicitly a permitted attribute of the form tag -- although I believe it was originally marked as deprecated. Indeed. In fact w3schools.com is known to be a very unreliable source of information these days. My advice would be to avoid it at all costs! http://w3fools.com/ -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] target question
On Mon, Mar 25, 2013 at 04:37:50PM +, Stuart Dallas wrote: On 25 Mar 2013, at 16:35, Ford, Mike m.f...@leedsmet.ac.uk wrote: -Original Message- From: Paul M Foster [mailto:pa...@quillandmouse.com] Sent: 25 March 2013 16:09 This behavior of the browser actually conforms to the standard as far as I know. The target attribute is attached only to the a tag, according to w3schools.com Actually, the W3C HTML 4.01 Recommendation says: target = frame-target [CI] This attribute specifies the name of a frame where a document is to be opened. By assigning a name to a frame via the name attribute, authors can refer to it as the target of links defined by other elements. The target attribute may be set for elements that create links (A, LINK), image maps (AREA), and forms (FORM). In the current HTML5 draft, target is explicitly a permitted attribute of the form tag -- although I believe it was originally marked as deprecated. Indeed. In fact w3schools.com is known to be a very unreliable source of information these days. My advice would be to avoid it at all costs! http://w3fools.com/ Interesting. I wasn't aware of this. Thanks for the info. Paul -- Paul M. Foster http://noferblatz.com http://quillandmouse.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] target question
With the header Content-Disposition: attachment the browser will offer the response as a regular file download (with save/open options). Your original page (menu) will remain intact. Please note that this solution will not present the PDF directly to the user (as it would with a popup window), instead he will need to open the downloaded file in his computer. On Mon, Mar 25, 2013 at 12:23 PM, Jim Giner jim.gi...@albanyhandball.com wrote: On 3/25/2013 10:13 AM, Samuel Lopes Grigolato wrote: Have you tried to set a Content-Disposition header in the PHP script that creates the PDF, asking the browser to attach the download? This way you don't even need a new window. Example from php.net/manual: // It will be called downloaded.pdf header('Content-Disposition: attachment; filename=downloaded.pdf'); On Mon, Mar 25, 2013 at 11:01 AM, Jim Giner jim.gi...@albanyhandball.comwrote: target as in the form attribute In my appl devl I utilize an extra window when my current form is asked to generate a pdf report. Works well since that way the user can generate one report into a new window, read it, close it, and still have the reports menu in front of him/her and generate a 2nd report. I'm experiencing a problem tho and I'm guessing it's associated with ie9 or FPDF. In my reports menu form, when I click on a button that will generate a pdf, I alter the form's target to create a new window. This used to work last fall, but since then I have a new laptop running ie9, not 8. The target changing js logic is working as far as I can see (alerts in my js) but the effect is not there. Instead of a new window, the pdf opens up in the same window where the menu was and so when the user does a back he ends up going up one too many levels and has to re-request the reports menu. Didn't have this much trouble originally setting this up as I'm having now trying to debug this. I'm using the FPDF extension/class to generate my pdfs - made no recent changes there. Also my concept works very well still in a simple html document that has only two buttons on it which I created today to test a theory. That is - maybe it's not just IE9, but FPDF. Anyone have any experience in this area? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php And what happens to my original menu window? -- 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] target question
On 3/25/2013 1:12 PM, Samuel Lopes Grigolato wrote: With the header Content-Disposition: attachment the browser will offer the response as a regular file download (with save/open options). Your original page (menu) will remain intact. Please note that this solution will not present the PDF directly to the user (as it would with a popup window), instead he will need to open the downloaded file in his computer. On Mon, Mar 25, 2013 at 12:23 PM, Jim Giner jim.gi...@albanyhandball.com wrote: On 3/25/2013 10:13 AM, Samuel Lopes Grigolato wrote: Have you tried to set a Content-Disposition header in the PHP script that creates the PDF, asking the browser to attach the download? This way you don't even need a new window. Example from php.net/manual: // It will be called downloaded.pdf header('Content-Disposition: attachment; filename=downloaded.pdf'); On Mon, Mar 25, 2013 at 11:01 AM, Jim Giner jim.gi...@albanyhandball.comwrote: target as in the form attribute In my appl devl I utilize an extra window when my current form is asked to generate a pdf report. Works well since that way the user can generate one report into a new window, read it, close it, and still have the reports menu in front of him/her and generate a 2nd report. I'm experiencing a problem tho and I'm guessing it's associated with ie9 or FPDF. In my reports menu form, when I click on a button that will generate a pdf, I alter the form's target to create a new window. This used to work last fall, but since then I have a new laptop running ie9, not 8. The target changing js logic is working as far as I can see (alerts in my js) but the effect is not there. Instead of a new window, the pdf opens up in the same window where the menu was and so when the user does a back he ends up going up one too many levels and has to re-request the reports menu. Didn't have this much trouble originally setting this up as I'm having now trying to debug this. I'm using the FPDF extension/class to generate my pdfs - made no recent changes there. Also my concept works very well still in a simple html document that has only two buttons on it which I created today to test a theory. That is - maybe it's not just IE9, but FPDF. Anyone have any experience in this area? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php And what happens to my original menu window? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Thanks for the pointer - but not what I'm looking to do. Trying to make it effortless for the user so having to go and open a pdf would be another pia. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] target question
Jim Giner wrote: Thanks for the pointer - but not what I'm looking to do. Trying to make it effortless for the user so having to go and open a pdf would be another pia. Actually it IS worth pointing out that how the browser handles a pdf file is very much controlled by the browser itself? Opening in a browser page only works if there is a suitable plugin, so what *I* get is the option to save file or open in a third party app as I don't currently have any plugins loaded for pdf. We use pdf's for agendas and minutes, but I have yet to find a reliable way to display them as a pop-up or opening in a separate page even using 'target'. The compromise I came up with is to open them in a flash player as in http://northwaypc.org.uk/fisheye/image/1030 -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] target question
On Mon, Mar 25, 2013 at 7:11 PM, Lester Caine les...@lsces.co.uk wrote: Jim Giner wrote: Thanks for the pointer - but not what I'm looking to do. Trying to make it effortless for the user so having to go and open a pdf would be another pia. Actually it IS worth pointing out that how the browser handles a pdf file is very much controlled by the browser itself? Opening in a browser page only works if there is a suitable plugin, so what *I* get is the option to save file or open in a third party app as I don't currently have any plugins loaded for pdf. We use pdf's for agendas and minutes, but I have yet to find a reliable way to display them as a pop-up or opening in a separate page even using 'target'. The compromise I came up with is to open them in a flash player as in http://northwaypc.org.uk/**fisheye/image/1030http://northwaypc.org.uk/fisheye/image/1030 Please, don't advise flash to anyone. It's outdated, and is not gonna be supported for a long time anymore. iOS never supported, and Android does also not support since Jelly Bean I think. I checked your solution, and on my 1920x1080 screen, it shows the pdf quite small. I can zoom, but the bounding box does not get bigger, which means I have scroll the page from left to right to view it. In a native solution it would show the PDF as wide as my screen is, which makes it normally readable. I don't see what the problem is with showing a pdf in a pop up or new tab/window, it should work just as any other. Can u perhaps show us a simple code that does not work? (under 50 lines of code, if possible). Regards, Matijn
Re: [PHP] target question
I agree with Matjin in this one, Flash is not a good solution in this case, in fact, Flash is not a good solution in a lot of cases lately, but handling PDFs in the browser can be tricky sometimes. I remember that some time ago I had to build a system that prints a PDF after it is loaded from the server, without any user interaction, and there is no way to do that using only HTML/JS due to security restrictions of course. The solution I came up with was to create a java printer application that also open a local (tiny) http server, and the browser call this java application (ajax) sending the URL of the PDF, the java application downloads the document and prints it directly. The only downside is that the user need to open this printer application. Best regards. Att. Gabriel Ricci Website http://gabrielricci.github.com Follow @gabrielricci http://www.twitter.com/gabrielricci Facebook profile http://www.facebook.com/gabrielricci2, GitHub profilehttp://www.github.com/gabrielricci/ http://code.google.com/p/syslibjs/ On Mon, Mar 25, 2013 at 3:25 PM, Matijn Woudt tijn...@gmail.com wrote: On Mon, Mar 25, 2013 at 7:11 PM, Lester Caine les...@lsces.co.uk wrote: Jim Giner wrote: Thanks for the pointer - but not what I'm looking to do. Trying to make it effortless for the user so having to go and open a pdf would be another pia. Actually it IS worth pointing out that how the browser handles a pdf file is very much controlled by the browser itself? Opening in a browser page only works if there is a suitable plugin, so what *I* get is the option to save file or open in a third party app as I don't currently have any plugins loaded for pdf. We use pdf's for agendas and minutes, but I have yet to find a reliable way to display them as a pop-up or opening in a separate page even using 'target'. The compromise I came up with is to open them in a flash player as in http://northwaypc.org.uk/**fisheye/image/1030 http://northwaypc.org.uk/fisheye/image/1030 Please, don't advise flash to anyone. It's outdated, and is not gonna be supported for a long time anymore. iOS never supported, and Android does also not support since Jelly Bean I think. I checked your solution, and on my 1920x1080 screen, it shows the pdf quite small. I can zoom, but the bounding box does not get bigger, which means I have scroll the page from left to right to view it. In a native solution it would show the PDF as wide as my screen is, which makes it normally readable. I don't see what the problem is with showing a pdf in a pop up or new tab/window, it should work just as any other. Can u perhaps show us a simple code that does not work? (under 50 lines of code, if possible). Regards, Matijn
Re: [PHP] target question
Matijn Woudt wrote: I don't see what the problem is with showing a pdf in a pop up or new tab/window, it should work just as any other. Can u perhaps show us a simple code that does not work? (under 50 lines of code, if possible). There is no problem getting it to appear as a pop-up or in a new tab. The problem is that you have no idea exactly how the browser IS displaying it to a user. I quite agree that flash now needs replacing but 5 years ago it was a workable solution. Replacing that with another viewer would be nice nowadays,but there is nothing suitable? The point here was to allow the pdf to be wrapped with other links, and managing selection of things such as filtering terms for a report which is then output as a pdf makes sense. The report can also be printed if required, something which is not practical directly from an html page. -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
On Wed, Feb 27, 2013 at 9:14 PM, Curtis Maurand cur...@maurand.com wrote: Well that means the docs on the PEAR MDB2 website are incorrect and should be fixed. Thanks for the lesson. If there's an issue with the docs, you're right, they should definitely be fixed. We'd appreciate it very much if you could take a moment and submit it as a bug report at https://bugs.php.net/. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
2013/2/27 tamouse mailing lists tamouse.li...@gmail.com On Tue, Feb 26, 2013 at 4:41 PM, Jim Lucas li...@cmsws.com wrote: On 02/26/2013 01:27 PM, Curtis Maurand wrote: I have the following: $dsn = mysqli://$username:$password@$hostname2/$database; $options = array( 'debug' = 3, 'result_buffering' = false, ); $dbh = MDB2::factory($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2-getMessage()); } function tallyCart($_u_id,$dbh){ while($row = $result-fetchrow(MDB2_FETCHMODE_ASSOC)) { Talking in code. The above two lines tell me... $dbh != $result isset($result) === false $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } } I'm getting: Call to undefined method MDB2_Error::fetchrow() anyone have any ideas? Can I not pass a database handle to a function? Thanks, Curtis -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Well, *I* have a stupid question: is $lhv = expr the same as $lhv = expr ?? Yes :) Because an operator = doesn't exists, thus the lexer will split them into the tokens = , or = WHITESPACE respectively. The parser again ignores whitespaces. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- github.com/KingCrunch
Re: [PHP] Stupid question
On Wed, Feb 27, 2013 at 2:42 AM, Sebastian Krebs krebs@gmail.com wrote: 2013/2/27 tamouse mailing lists tamouse.li...@gmail.com Well, *I* have a stupid question: is $lhv = expr the same as $lhv = expr ?? Yes :) Because an operator = doesn't exists, thus the lexer will split them into the tokens = , or = WHITESPACE respectively. The parser again ignores whitespaces. Thanks; thought I was seeing something new, and/or going nuts -- apologies for the thread hijack -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
On 2/27/2013 6:32 PM, tamouse mailing lists wrote: On Wed, Feb 27, 2013 at 2:42 AM, Sebastian Krebs krebs@gmail.com wrote: 2013/2/27 tamouse mailing lists tamouse.li...@gmail.com Well, *I* have a stupid question: is $lhv = expr the same as $lhv = expr ?? Yes :) Because an operator = doesn't exists, thus the lexer will split them into the tokens = , or = WHITESPACE respectively. The parser again ignores whitespaces. Thanks; thought I was seeing something new, and/or going nuts -- apologies for the thread hijack Well that means the docs on the PEAR MDB2 website are incorrect and should be fixed. Thanks for the lesson. --Curtis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stupid question
I have the following: $dsn = mysqli://$username:$password@$hostname2/$database; $options = array( 'debug' = 3, 'result_buffering' = false, ); $dbh = MDB2::factory($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2-getMessage()); } function tallyCart($_u_id,$dbh){ while($row = $result-fetchrow(MDB2_FETCHMODE_ASSOC)) { $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } } I'm getting: Call to undefined method MDB2_Error::fetchrow() anyone have any ideas? Can I not pass a database handle to a function? Thanks, Curtis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
On Tue, Feb 26, 2013 at 4:27 PM, Curtis Maurand cur...@maurand.com wrote: I have the following: $dsn = mysqli://$username:$password@$hostname2/$database; $options = array( 'debug' = 3, 'result_buffering' = false, ); $dbh = MDB2::factory($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2-getMessage()); } function tallyCart($_u_id,$dbh){ while($row = $result-fetchrow(MDB2_FETCHMODE_ASSOC)) { $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } } I'm getting: Call to undefined method MDB2_Error::fetchrow() anyone have any ideas? Can I not pass a database handle to a function? Thanks, Curtis Hate to answer a question with a question, but: 1.) Do you have the PEAR package MDB2 installed? 2.) Where is $result defined? I don't see it in your code snippet here. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
Daniel Brown danbr...@php.net wrote: On Tue, Feb 26, 2013 at 4:27 PM, Curtis Maurand cur...@maurand.com wrote: I have the following: $dsn = mysqli://$username:$password@$hostname2/$database; $options = array( 'debug' = 3, 'result_buffering' = false, ); $dbh = MDB2::factory($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2-getMessage()); } function tallyCart($_u_id,$dbh){ while($row = $result-fetchrow(MDB2_FETCHMODE_ASSOC)) { $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } } I'm getting: Call to undefined method MDB2_Error::fetchrow() anyone have any ideas? Can I not pass a database handle to a function? Thanks, Curtis Hate to answer a question with a question, but: 1.) Do you have the PEAR package MDB2 installed? 2.) Where is $result defined? I don't see it in your code snippet here. Also, there is no such thing as a stupid question, only a stupid answer... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
On 2/26/2013 4:33 PM, Daniel Brown wrote: On Tue, Feb 26, 2013 at 4:27 PM, Curtis Maurand cur...@maurand.com wrote: I have the following: $dsn = mysqli://$username:$password@$hostname2/$database; $options = array( 'debug' = 3, 'result_buffering' = false, ); $dbh = MDB2::factory($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2-getMessage()); } function tallyCart($_u_id,$dbh){ while($row = $result-fetchrow(MDB2_FETCHMODE_ASSOC)) { $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } } I'm getting: Call to undefined method MDB2_Error::fetchrow() anyone have any ideas? Can I not pass a database handle to a function? Thanks, Curtis Hate to answer a question with a question, but: 1.) Do you have the PEAR package MDB2 installed? 2.) Where is $result defined? I don't see it in your code snippet here. Sorry, $myquery = SELECT * from tbl_Cart where u_ID='$_u_id'; echo $myquery; $result = $dbh-query($myquery); I then tried setting the buffering to true and did a if($result-numrows() 0) and wrapped it around the entire fetchrow loop and I still get the same thing. I just took a look and the libraries are installed if not a bit outdated, but they are there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
Hi, I'm getting: Call to undefined method MDB2_Error::fetchrow() Have your checked if $dbh-query() throws an error? It seems $result is a different type than expected. HTH Kind regards/met vriendelijke groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2013/2/26 Curtis Maurand cur...@maurand.com On 2/26/2013 4:33 PM, Daniel Brown wrote: On Tue, Feb 26, 2013 at 4:27 PM, Curtis Maurand cur...@maurand.com wrote: I have the following: $dsn = mysqli://$username:$password@**$hostname2/$database; $options = array( 'debug' = 3, 'result_buffering' = false, ); $dbh = MDB2::factory($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2-getMessage()); } function tallyCart($_u_id,$dbh){ while($row = $result-fetchrow(MDB2_**FETCHMODE_ASSOC)) { $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_**ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } } I'm getting: Call to undefined method MDB2_Error::fetchrow() anyone have any ideas? Can I not pass a database handle to a function? Thanks, Curtis Hate to answer a question with a question, but: 1.) Do you have the PEAR package MDB2 installed? 2.) Where is $result defined? I don't see it in your code snippet here. Sorry, $myquery = SELECT * from tbl_Cart where u_ID='$_u_id'; echo $myquery; $result = $dbh-query($myquery); I then tried setting the buffering to true and did a if($result-numrows() 0) and wrapped it around the entire fetchrow loop and I still get the same thing. I just took a look and the libraries are installed if not a bit outdated, but they are there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
On 02/26/2013 01:27 PM, Curtis Maurand wrote: I have the following: $dsn = mysqli://$username:$password@$hostname2/$database; $options = array( 'debug' = 3, 'result_buffering' = false, ); $dbh = MDB2::factory($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2-getMessage()); } function tallyCart($_u_id,$dbh){ while($row = $result-fetchrow(MDB2_FETCHMODE_ASSOC)) { Talking in code. The above two lines tell me... $dbh != $result isset($result) === false $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } } I'm getting: Call to undefined method MDB2_Error::fetchrow() anyone have any ideas? Can I not pass a database handle to a function? Thanks, Curtis -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
On Tue, Feb 26, 2013 at 4:41 PM, Jim Lucas li...@cmsws.com wrote: On 02/26/2013 01:27 PM, Curtis Maurand wrote: I have the following: $dsn = mysqli://$username:$password@$hostname2/$database; $options = array( 'debug' = 3, 'result_buffering' = false, ); $dbh = MDB2::factory($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2-getMessage()); } function tallyCart($_u_id,$dbh){ while($row = $result-fetchrow(MDB2_FETCHMODE_ASSOC)) { Talking in code. The above two lines tell me... $dbh != $result isset($result) === false $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } } I'm getting: Call to undefined method MDB2_Error::fetchrow() anyone have any ideas? Can I not pass a database handle to a function? Thanks, Curtis -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Well, *I* have a stupid question: is $lhv = expr the same as $lhv = expr ?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_replace question
I have several poisoned .js files on a server. I can use find to recursively find them and then use preg_replace to replace the string. However the string is filled with single quotes, semi-colons and a lot of other special characters. Will preg_relace(escapeshellarg($String),$replacement) work or do I need to go through the entire string and escape what needs to be escaped? --C -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace question
On 13/12/2012, at 10:08 AM, Curtis Maurand cur...@maurand.com wrote: On 12/12/2012 3:47 PM, Maciek Sokolewicz wrote: On 12-12-2012 21:10, Curtis Maurand wrote: On 12/12/2012 12:00 PM, Maciek Sokolewicz wrote: On 12-12-2012 17:11, Curtis Maurand wrote: First of all, why do you want to use preg_replace when you're not actually using regular expressions??? Use str_replace or stri_replace instead. Aside from that, escapeshellarg() escapes strings for use in shell execution. Perl Regexps are not shell commands. It's like using mysqli_real_escape_string() to escape arguments for URLs. That doesn't compute, just like your way doesn't either. If you DO wish to escape arguments for a regular expression, use preg_quote instead, that's what it's there for. But first, reconsider using preg_replace, since I honestly don't think you need it at all if the way you've posted (preg_replace(escapeshellarg($string),$replacement)) is the way you want to use it. Thanks for your response. I'm open to to using str_replace. no issue there. my main question was how to properly get a string of javascript into a string that could then be processed. I'm not sure I can just put that in quotes and have it work.There are colons, ,, semicolons, and doublequotes. Do I just need to rifle through the string and escape the reserved characters or is there a function for that? --C Why do you want to escape them? There are no reserved characters in the case of str_replace. You don't have to put anything in quotes. For example: $string = 'This is a string with various supposedly reserved ``\\ _- characters' echo str_replace('supposedly', 'imaginary', $string) would return: This is a string with imaginary reserved ``\\- characters So... why do you want to escape these characters? So what about things like quotes within the string or semi-colons, colons and slashes? Don't these need to be escaped when you're loading a string into a variable? ;document.write('iframe width=50 height=50 style=width:100px;height:100px;position:absolute;left:-100px;top:0; src=http://nrwhuejbd.freewww.com/34e2b2349bdf29216e455cbc7b6491aa.cgi??8;/iframe'); I need to enclose this entire string and replace it with Thanks The only thing you have to worry about is quotes characters. Assuming you're running 5.3+, just use now docs (http://php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc). $String = 'STRING' ;document.write('iframe width=50 height=50 style=width:100px;height:100px;position:absolute;left:-100px;top:0; src=http://nrwhuejbd.freewww.com/34e2b2349bdf29216e455cbc7b6491aa.cgi??8;/iframe'); STRING; --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PDO question
-Original Message- From: Jim Lucas [mailto:li...@cmsws.com] Sent: Wednesday, November 28, 2012 9:23 PM To: ad...@buskirkgraphics.com Cc: php-general@lists.php.net Subject: Re: [PHP] PDO question On 11/28/2012 12:58 PM, ad...@buskirkgraphics.com wrote: Guys, I am not quiet sure what is happening but every time i try to connect to a remote host it refers back to localhost. $pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password'); ERROR: Access denied for user 'user'@'localhost' (using password: YES) in /var/www/html/text.php Any clue as to WHY it keeps referring back to localhost when i clearly set the host parameter to another server. I checked the /etc/hosts records to see if there was a referral for that domain back to it's self there is NOT. There is a warning on the following page that talks about a possible issue with connections. Might give it a look. http://www.php.net/manual/en/ref.pdo-mysql.connection.php -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ Thank you issue resolved for some reason it was passing the credentials with the fully qualified domain name and NOT the IP and the permission failed to match. Not sure why it is suddenly passing the fully qualified domain name now but as long and this works I really don’t care thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDO question
Guys, I am not quiet sure what is happening but every time i try to connect to a remote host it refers back to localhost. $pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password'); ERROR: Access denied for user 'user'@'localhost' (using password: YES) in /var/www/html/text.php Any clue as to WHY it keeps referring back to localhost when i clearly set the host parameter to another server. I checked the /etc/hosts records to see if there was a referral for that domain back to it's self there is NOT.
Re: [PHP] PDO question
On 11/28/2012 12:58 PM, ad...@buskirkgraphics.com wrote: Guys, I am not quiet sure what is happening but every time i try to connect to a remote host it refers back to localhost. $pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password'); ERROR: Access denied for user 'user'@'localhost' (using password: YES) in /var/www/html/text.php Any clue as to WHY it keeps referring back to localhost when i clearly set the host parameter to another server. I checked the /etc/hosts records to see if there was a referral for that domain back to it's self there is NOT. There is a warning on the following page that talks about a possible issue with connections. Might give it a look. http://www.php.net/manual/en/ref.pdo-mysql.connection.php -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDO question
On Wed, Nov 28, 2012 at 9:22 PM, Jim Lucas li...@cmsws.com wrote: On 11/28/2012 12:58 PM, ad...@buskirkgraphics.com wrote: Guys, I am not quiet sure what is happening but every time i try to connect to a remote host it refers back to localhost. $pdo = new PDO('mysql:host=171.16.23.44;**dbname=test', 'user','password'); ERROR: Access denied for user 'user'@'localhost' (using password: YES) in /var/www/html/text.php Any clue as to WHY it keeps referring back to localhost when i clearly set the host parameter to another server. I checked the /etc/hosts records to see if there was a referral for that domain back to it's self there is NOT. There is a warning on the following page that talks about a possible issue with connections. Might give it a look. http://www.php.net/manual/en/**ref.pdo-mysql.connection.phphttp://www.php.net/manual/en/ref.pdo-mysql.connection.php -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php specify a user from your IP ( not the server IP: 171.16.23.44 ) and try again.. If u dont have static IP, set host parameter for user: % means any host. and connect.
[PHP] get question
Hello All, Trying to figure out why when I include the page that contains this code, I'm not able to get the $calling_page populated with any values. Any help appreciated... ? # Dynamic Content based in page $calling_page = $_GET['page']; # Home Page -- if(!($calling_page)) { $title = Title 1 - $calling_page; $body = body /; } elseif ($calling_page == index) { $title = Title 2 - $calling_page; $body = body /; # Non Specified Page -- } else { $title = Title 3 - $calling_page; $body = body /; } echo title.$title./title; ? -- Thanks! Joey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A Question of SESSION
Hi Daniel and gang: Considering I'm never afraid to show my ignorance, please review the following example. Because of the way I normally use sessions and considering this way works for me, I thought I knew what sessions were about -- but my faith is eroding. Cases in point 1. The following is the way I normally use sessions (with COOKIES turned ON): http://www.webbytedd.com/b/sessions It works. 2. Considering that people may have their COOKIES turned OFF, I tried this: http://www.webbytedd.com/b/sessions1/ It works when COOKIES are turned ON, but the SID does not appear in the URL -- I find that odd. However, if COOKIES are turned OFF, then SID does appear in the URL, but the process of passing session variables doesn't work -- I find that confusing. What's the point of passing the SID if it isn't going to be used? 3. Looking for an explanation, I came across Daniel's post to the PHP manual, which follows: http://www.webbytedd.com/b/sessions3 Now I am totally bonkers. What am I not getting? Cheers, tedd t...@sperling.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A Question of SESSION
On Thu, Jun 7, 2012 at 5:15 PM, Tedd Sperling t...@sperling.com wrote: Hi Daniel and gang: Considering I'm never afraid to show my ignorance, please review the following example. Because of the way I normally use sessions and considering this way works for me, I thought I knew what sessions were about -- but my faith is eroding. Cases in point 1. The following is the way I normally use sessions (with COOKIES turned ON): http://www.webbytedd.com/b/sessions It works. 2. Considering that people may have their COOKIES turned OFF, I tried this: http://www.webbytedd.com/b/sessions1/ It works when COOKIES are turned ON, but the SID does not appear in the URL -- I find that odd. However, if COOKIES are turned OFF, then SID does appear in the URL, but the process of passing session variables doesn't work -- I find that confusing. What's the point of passing the SID if it isn't going to be used? 3. Looking for an explanation, I came across Daniel's post to the PHP manual, which follows: http://www.webbytedd.com/b/sessions3 Now I am totally bonkers. What am I not getting? Cheers, tedd Hi Tedd, I assume you're running PHP 5.3 or later, then session.use_only_cookies in php.ini is default set to 1, which means it doesn't accept PHPSESSID. Change that to 0, and it will probably work. - Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sort question..
Hello again. I have a photo album that show all images in a specified directory. but I like to sort them by filename as one possibillity and random sort the photos as another feature. I don't know how to do this.. Here is my soruce-code: !DOCTYPE html html lang=no head meta charset=utf-8 titleBildegalleri/title link rel=stylesheet href=standard.css media=screen /head body h1Bildegalleri/h1 pa href=bildegalleri.htmlLast opp nye bilder/a |nbsp; a href=vis_bildegalleri.php?sorter_filnavnSorter på filnavn/a |nbsp; a href=vis_bildegalleri.php?tilfeldig_sorteringTilfeldig sortering/a/p ul ?php // Skann katalogen og hent fram bildene $bilde = new DirectoryIterator('bilder/'); while($bilde-valid()){ if(!$bilde-isDot()){ if($_GET['sorter_filnavn']){ echo 'liimg src=bilder/'.sort($bilde-getFilename()).' alt='.sort($bilde-getFilename()).' height=200/li'; } elseif($_GET['tilfeldig_sortering']) { echo 'liimg src=bilder/'.rand($bilde-getFilename()).' alt='.rand($bilde-getFilename()).' height=200/li'; } else { echo 'liimg src=bilder/'.$bilde-getFilename().' alt='.$bilde-getFilename().' height=200/li'; } } $bilde-next(); } unset($bilde); ? /ul /body /html I will be lucky if somebode have time to help me out here.. I am sure it is some functions in php that can do the trick, but haven't found anything yet. Thanks for your time. Karl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sort question..
On Wed, Apr 25, 2012 at 3:16 PM, Karl-Arne Gjersøyen karlar...@gmail.com wrote: Hello again. I have a photo album that show all images in a specified directory. but I like to sort them by filename as one possibillity and random sort the photos as another feature. I don't know how to do this.. Here is my soruce-code: !DOCTYPE html html lang=no head meta charset=utf-8 titleBildegalleri/title link rel=stylesheet href=standard.css media=screen /head body h1Bildegalleri/h1 pa href=bildegalleri.htmlLast opp nye bilder/a |nbsp; a href=vis_bildegalleri.php?sorter_filnavnSorter på filnavn/a |nbsp; a href=vis_bildegalleri.php?tilfeldig_sorteringTilfeldig sortering/a/p ul ?php // Skann katalogen og hent fram bildene $bilde = new DirectoryIterator('bilder/'); while($bilde-valid()){ if(!$bilde-isDot()){ if($_GET['sorter_filnavn']){ echo 'liimg src=bilder/'.sort($bilde-getFilename()).' alt='.sort($bilde-getFilename()).' height=200/li'; } elseif($_GET['tilfeldig_sortering']) { echo 'liimg src=bilder/'.rand($bilde-getFilename()).' alt='.rand($bilde-getFilename()).' height=200/li'; } else { echo 'liimg src=bilder/'.$bilde-getFilename().' alt='.$bilde-getFilename().' height=200/li'; } } $bilde-next(); } unset($bilde); ? /ul /body /html I will be lucky if somebode have time to help me out here.. I am sure it is some functions in php that can do the trick, but haven't found anything yet. Thanks for your time. Karl Put all the files in an array, then sort with one of the sort functions[1]. - Matijn [1] http://www.php.net/manual/en/array.sorting.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variable Question
I am trying to assign variables from an array into variables. This is following a database query. Right now they are in an array: $row[‘word_1’] $row[‘word_2’] $row[‘word_3’] ... $row[‘word_25’] I am trying to use this while look to assign them to variables: $word_1 $word_2 $word_3 ... $word_25 This is the WHILE loop: $i = 1; while ( $i = 25 ) { ${'word_'.$i} = stripslashes( eval (echo $row['word_$i']) ); ++$i; } What is confusing me is I don’t know how to represent the array variable. The specific error message I am receiving is: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING Can anyone see what I have done wrong and help me correct it? Thank you. Ron Ron Piggott www.TheVerseOfTheDay.info
Re: [PHP] Variable Question
On 19 Apr 2012, at 15:46, Ron Piggott wrote: I am trying to assign variables from an array into variables. This is following a database query. Right now they are in an array: $row[‘word_1’] $row[‘word_2’] $row[‘word_3’] ... $row[‘word_25’] Why those indices? Why isn't it just a numerically indexed array? I am trying to use this while look to assign them to variables: $word_1 $word_2 $word_3 ... $word_25 The first question that comes to mind is why the heck you would want to do such a thing? ${'word_'.$i} = stripslashes( eval (echo $row['word_$i']) ); Eww, nasty. Why the eval? Why not just stripslashes($row['word_'.$i])? Variable variables have their uses, but this seems to be one of those cases where you're trying to get the square peg through the triangular hole. Take a step back and give us some more context. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable Question
I am trying to use this while look to assign them to variables: $word_1 $word_2 $word_3 ... $word_25 This should work for you: http://us3.php.net/manual/en/function.extract.php thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable Question
On 04/19/2012 09:55 AM, Christoph Boget wrote: I am trying to use this while look to assign them to variables: $word_1 $word_2 $word_3 ... $word_25 This should work for you: http://us3.php.net/manual/en/function.extract.php thnx, Christoph Yes and you can use array_map('stripslashes', $row) prior. However I would just use the $row array as most people do instead of extracting. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mssql_bind question
Folks, Having a difficult time using mssql_bind with characters greater than 8000...the database field is set to ntext, and I've also tried varchar(max), both seem to produce the same results: If I use: mssql_bind($stmt, '@mgrnotes',$mgrnotes,SQLVARCHAR,false,false,8000); I get the error: Warning: mssql_bind() [function.mssql-bind]: Unable to set parameter in D:\Inetpub\wwwroot\folder\mypage.php on line 105 I discovered changing SQLVARCHAR to SQLTXT, and dropping the length of 8000 helps: mssql_bind($stmt, '@mgrnotes',$mgrnotes,SQLTEXT,false,false); I get no error, but the field is truncated to 8000 characters regardless. What is the correct way to use mssql_bind with strings of greater than 8000 characters? Thanks! Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mssql_bind question
On Mon, Apr 9, 2012 at 1:42 PM, David Stoltz dsto...@shh.org wrote: Folks, Having a difficult time using mssql_bind with characters greater than 8000...the database field is set to ntext, and I've also tried varchar(max), both seem to produce the same results: If I use: mssql_bind($stmt, '@mgrnotes',$mgrnotes,SQLVARCHAR,false,false,8000); I get the error: Warning: mssql_bind() [function.mssql-bind]: Unable to set parameter in D:\Inetpub\wwwroot\folder\mypage.php on line 105 I discovered changing SQLVARCHAR to SQLTXT, and dropping the length of 8000 helps: mssql_bind($stmt, '@mgrnotes',$mgrnotes,SQLTEXT,false,false); I get no error, but the field is truncated to 8000 characters regardless. What is the correct way to use mssql_bind with strings of greater than 8000 characters? Thanks! Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php this is a limit in SQL itself not the drivers http://msdn.microsoft.com/en-us/library/aa258848(v=SQL.80).aspx Using EXECUTE with a Character String Use the string concatenation operator (+) to create large strings for dynamic execution. Each string expression can be a mixture of Unicode and non-Unicode data types. Although each [N] '*tsql_string*' or *@string_variable* must be less than 8,000 bytes, the concatenation is performed logically in the SQL Server parser and never materializes in memory. For example, this statement never produces the expected 16,000 concatenated character string: EXEC('name_of_8000_char_string' + 'another_name_of_8000_char_string') Statement(s) inside the EXECUTE statement are not compiled until the EXECUTE statement is executed. Changes in database context last only until the end of the EXECUTE statement. For example, after the EXEC in this example, the database context is *master*: USE master EXEC (USE pubs) SELECT * FROM authors
[PHP] syntax question
I have been struggling with this issue for an hour and honestly I am not sure why. I consider myself to be pretty savvy with MySQL but I am running into an syntax error that is just flat out eluding me. $query = SELECT `table2`.`name` from `table1` ,`table2` WHERE `table2`.`user_id`=`table1`.`seller_id` AND IF(`table2`.`name`='juice','No Juice for YOU', `table2`.`name`=`table2`.`name`) LIMIT 1; This query works!! But If I try to add a GROUP BY to the query, complete failure. $query = SELECT `table2`.`name` FROM `table1` ,`table2` WHERE `table2`.`user_id`=`table1`.`seller_id` AND IF(`table2`.`name`='juice','No Juice for YOU', `table2`.`name`=`table2`.`name`) GROUP BY `table1`.`ID` LIMIT 1; The main goal here is to get only 1 return but MySQL is returning the same row 2 times. Before I beat my head in anymore I will toss this out to you guys and beat myself up later for not drinking enough coffee or something .
Re: [PHP] syntax question
Generally... Wouldn't grouping by an id (which is normally unique) have no real benefit... Except some strange behaviour? Just to clarify: Why aren't you sticking to the LIMIT 1? 2012/2/7 ad...@buskirkgraphics.com I have been struggling with this issue for an hour and honestly I am not sure why. I consider myself to be pretty savvy with MySQL but I am running into an syntax error that is just flat out eluding me. $query = SELECT `table2`.`name` from `table1` ,`table2` WHERE `table2`.`user_id`=`table1`.`seller_id` AND IF(`table2`.`name`='juice','No Juice for YOU', `table2`.`name`=`table2`.`name`) LIMIT 1; This query works!! But If I try to add a GROUP BY to the query, complete failure. $query = SELECT `table2`.`name` FROM `table1` ,`table2` WHERE `table2`.`user_id`=`table1`.`seller_id` AND IF(`table2`.`name`='juice','No Juice for YOU', `table2`.`name`=`table2`.`name`) GROUP BY `table1`.`ID` LIMIT 1; The main goal here is to get only 1 return but MySQL is returning the same row 2 times. Before I beat my head in anymore I will toss this out to you guys and beat myself up later for not drinking enough coffee or something .
RE: [PHP] syntax question
-Original Message- From: Louis Huppenbauer [mailto:louis.huppenba...@gmail.com] Sent: Tuesday, February 07, 2012 9:24 AM To: ad...@buskirkgraphics.com Cc: php-general@lists.php.net Subject: Re: [PHP] syntax question Generally... Wouldn't grouping by an id (which is normally unique) have no real benefit... Except some strange behaviour? Just to clarify: Why aren't you sticking to the LIMIT 1? 2012/2/7 ad...@buskirkgraphics.com I have been struggling with this issue for an hour and honestly I am not sure why. I consider myself to be pretty savvy with MySQL but I am running into an syntax error that is just flat out eluding me. $query = SELECT `table2`.`name` from `table1` ,`table2` WHERE `table2`.`user_id`=`table1`.`seller_id` AND IF(`table2`.`name`='juice','No Juice for YOU', `table2`.`name`=`table2`.`name`) LIMIT 1; This query works!! But If I try to add a GROUP BY to the query, complete failure. $query = SELECT `table2`.`name` FROM `table1` ,`table2` WHERE `table2`.`user_id`=`table1`.`seller_id` AND IF(`table2`.`name`='juice','No Juice for YOU', `table2`.`name`=`table2`.`name`) GROUP BY `table1`.`ID` LIMIT 1; The main goal here is to get only 1 return but MySQL is returning the same row 2 times. Before I beat my head in anymore I will toss this out to you guys and beat myself up later for not drinking enough coffee or something . There is no real reason to have a LIMIT It was just yet another attempt to limit the results during the testing. After reading my post back I see an error in the IF statement but not the resolution to the issue. The IF should read IF(`table2`.`name`='juice',`table2`.`name`=`table1`.`code`, `table2`.`name`=`table1`.`ref`) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax question
ad...@buskirkgraphics.com hat am 7. Februar 2012 um 15:11 geschrieben: I have been struggling with this issue for an hour and honestly I am not sure why. I consider myself to be pretty savvy with MySQL but I am running into an syntax error that is just flat out eluding me. $query = SELECT `table2`.`name` from `table1` ,`table2` WHERE `table2`.`user_id`=`table1`.`seller_id` AND IF(`table2`.`name`='juice','No Juice for YOU', `table2`.`name`=`table2`.`name`) LIMIT 1; This query works!! But If I try to add a GROUP BY to the query, complete failure. $query = SELECT `table2`.`name` FROM `table1` ,`table2` WHERE `table2`.`user_id`=`table1`.`seller_id` AND IF(`table2`.`name`='juice','No Juice for YOU', `table2`.`name`=`table2`.`name`) GROUP BY `table1`.`ID` LIMIT 1; This is a nice query but I am not sure if I understand what you want to do? Maybe we could start with your error message and a table structure :-) That would be handy. You wanna get all users that have at least on sell? But only once? Maybe something like that? SELECT table2.name FROM table2, (SELECT seller_id FROM table1 GROUP BY seller_id) as table1 WHERE table2.user_id = table1.seller_id AND IF(table2.name = 'juice','No Juice for YOU', table2.name = table2.name) ; Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Diploma Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: ma...@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.biz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] syntax question
-Original Message- From: ma...@behnke.biz [mailto:ma...@behnke.biz] Sent: Tuesday, February 07, 2012 10:47 AM To: php-general@lists.php.net; ad...@buskirkgraphics.com Subject: Re: [PHP] syntax question ad...@buskirkgraphics.com hat am 7. Februar 2012 um 15:11 geschrieben: I have been struggling with this issue for an hour and honestly I am not sure why. I consider myself to be pretty savvy with MySQL but I am running into an syntax error that is just flat out eluding me. $query = SELECT `table2`.`name` from `table1` ,`table2` WHERE `table2`.`user_id`=`table1`.`seller_id` AND IF(`table2`.`name`='juice','No Juice for YOU', `table2`.`name`=`table2`.`name`) LIMIT 1; This query works!! But If I try to add a GROUP BY to the query, complete failure. $query = SELECT `table2`.`name` FROM `table1` ,`table2` WHERE `table2`.`user_id`=`table1`.`seller_id` AND IF(`table2`.`name`='juice','No Juice for YOU', `table2`.`name`=`table2`.`name`) GROUP BY `table1`.`ID` LIMIT 1; This is a nice query but I am not sure if I understand what you want to do? Maybe we could start with your error message and a table structure :-) That would be handy. You wanna get all users that have at least on sell? But only once? Maybe something like that? SELECT table2.name FROM table2, (SELECT seller_id FROM table1 GROUP BY seller_id) as table1 WHERE table2.user_id = table1.seller_id AND IF(table2.name = 'juice','No Juice for YOU', table2.name = table2.name) ; Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Diploma Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: ma...@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.biz Marco, Thank you but the whole issue stemed from the 2nd table in the FROM. I just did an inner join using the If statement and it resolved the whole issue. Maybe it was just a coffee thing because 2 cups later I seen it very clearly :) Thanks so much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Typecasting question
I am familiar with typecasting. Booleans, ints, strings, etc. However while using an extension, more specifically the OpenSSL extension I have come across a problem I am not entirely familiar with. I have an array that looks like... array('config' = 'config/openssl.cnf', 'encrypt_key'= true, 'private_key_type' = 'OPENSSL_KEYTYPE_RSA', 'digest_algorithm' = 'sha256', 'private_key_bits' = 512, 'x509_extensions'= 'usr_cert', 'encrypt_key_cipher' = 'OPENSSL_CIPHER_3DES'); And according to the current OpenSSL documentation regarding the configuration constants (http://www.php.net/manual/en/openssl.ciphers.php) the array needs to have the 'private_key_type' and 'encrypt_key_cipher' elements as an INT value vs the string they are currently. Like so. array('private_key_type' = OPENSSL_KEYTYPE_RSA, 'encrypt_key_cipher' = OPENSSL_CIPHER_3DES); I have tried to perform typecasting these two elements as an int but because they are specific to the extension I am not certain how I should go about doing this. According to the source for php (the openssl.c) file is an internal attribute that I cannot find an integer value for to set it manually vs. using the pre-defined constant values mentioned in the docs. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Typecasting question
Am 03.02.12 17:11, schrieb jas: I am familiar with typecasting. Booleans, ints, strings, etc. However while using an extension, more specifically the OpenSSL extension I have come across a problem I am not entirely familiar with. I have an array that looks like... array('config' = 'config/openssl.cnf', 'encrypt_key'= true, 'private_key_type' = 'OPENSSL_KEYTYPE_RSA', remove the quotes around the constant, it must be 'private_key_type' = OPENSSL_KEYTYPE_RSA, 'digest_algorithm' = 'sha256', 'private_key_bits' = 512, 'x509_extensions'= 'usr_cert', 'encrypt_key_cipher' = 'OPENSSL_CIPHER_3DES'); same here -- Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Diploma Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: ma...@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.biz signature.asc Description: OpenPGP digital signature
Re: [PHP] Re: Question regarding passwords/security
Store everything in the database in an encrypted form. Stuart Dallas wrote: On 22 Dec 2011, at 19:34, Paul M Foster wrote: I have concerns that the items in a session buffer can be copied and used to spoof legitimate logins. This is harder to do when the info is held in a database. Storing stuff in a database is no more secure, it simply requires one single extra step... finding the DB credentials in the source code. Given that the only way a user could read session data (assuming you're using the default session handler, i.e. file-based) is if they have access to those files. If they do have access to those files they almost certainly also have access to your source code (since the web user must be able to read both), especially if you're using a shared host. If you're using a dedicated server then you should address the reason you're worried about people having access to session files first. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php