Re: [PHP] $_GET verses $_POST

2009-04-13 Thread Ashley Sheridan
On Mon, 2009-04-13 at 15:47 -0700, Michael A. Peters wrote: > Daevid Vincent wrote: > > Just to clarify. Obfuscation is NOT a substitute for security. While I don't > > disagree with the "when's" here of GET vs POST, this statement is a bit > > misleading... > > > > Any cracker worth his salt can

Re: [PHP] Logging out of a SSL / https:// site using PHP? (or JS?), Client Side Cache

2009-04-13 Thread Michael A. Peters
scubak1w1 wrote: Hello, I have a series of web sites which use https:// authentication (using AD integration to 'check the credentials' as it were) - all seems to be working well.. I have been Googling et al. for a way to log the user off the site "fully"... I can do a series of thing

Re: [PHP] https and Credit Cards

2009-04-13 Thread Paul M Foster
On Mon, Apr 13, 2009 at 10:19:34PM -0500, Skip Evans wrote: > Hey all, > > I've always put any forms that collect credit card information > behind a secure connection, https, figuring that sending that > information from the client browser to the server should be > secure, but I'm having convincin

Re: [PHP] try - catch is not so clear to me...

2009-04-13 Thread Lamp Lists
From: Marc Steinert To: Lamp Lists Cc: php-general@lists.php.net Sent: Monday, April 13, 2009 11:27:08 AM Subject: Re: [PHP] try - catch is not so clear to me... Basically try-catch gives you the ability to handle errors outside a class or method scope, by th

[PHP] https and Credit Cards

2009-04-13 Thread Skip Evans
Hey all, I've always put any forms that collect credit card information behind a secure connection, https, figuring that sending that information from the client browser to the server should be secure, but I'm having convincing a client that it is necessary. He instead insists that only the

[PHP] Logging out of a SSL / https:// site using PHP? (or JS?), Client Side Cache

2009-04-13 Thread scubak1w1
Hello, I have a series of web sites which use https:// authentication (using AD integration to 'check the credentials' as it were) - all seems to be working well.. I have been Googling et al. for a way to log the user off the site "fully"... I can do a series of things on the server side

Re: [PHP] extract varying data from array with different formatting

2009-04-13 Thread Jim Lucas
PJ wrote: Jim Lucas wrote: PJ wrote: foreach does a nice job if you want the results identical each time. What can you use to change the formatting of the results dependent on the number of results. Here's an example: foreach ( $authors[$bookID] AS $authorID => $authorData ) { #

RE: [PHP] linux console on the PHP

2009-04-13 Thread dhorton
I am sorry if I don't understand quite what you are after. Answer A: If you want a console connection to a server (e.g. engsan01 as below), then you could use a TELNET URL which is still supported in various browsers. This doesn't require PHP, but could be embedded in the HTML part. engsan01:23

Re: [PHP] $_GET verses $_POST

2009-04-13 Thread Tom Worster
On 4/13/09 6:47 PM, "Michael A. Peters" wrote: > For me the biggest advantage of post is the URLs aren't ugly. > For cases where get with a variable in the URL is useful (IE > product=BluePhone) - I prefer to handle that via mod_rewrite. > > The requests get handled by generic.php and generic.ph

Re: [PHP] $_GET verses $_POST

2009-04-13 Thread Tom Worster
On 4/12/09 10:23 AM, "Ron Piggott" wrote: > How do I know when to use $_GET verses $_POST? i use GET when i want the user to be able to email the link to someone, mention it on a blog or bookmark it and it will always yield the same page. i use POST if submitting the form causes any change in t

[PHP] linux console on the PHP

2009-04-13 Thread Alejandro Esteban Galvez
Hi people. If you known any method for grant access to one user to the console of linux, using the php, can you tell me that please? I going to try explain me! I need one interface PHP, and the interface must show me one linux console and take me the control of this console. Excuse me, for my e

Re: [PHP] $_GET verses $_POST

2009-04-13 Thread Michael A. Peters
Daevid Vincent wrote: Just to clarify. Obfuscation is NOT a substitute for security. While I don't disagree with the "when's" here of GET vs POST, this statement is a bit misleading... Any cracker worth his salt can easily install any number of Firefox extensions or unix command line tools and

RE: [PHP] $_GET verses $_POST

2009-04-13 Thread Daevid Vincent
Just to clarify. Obfuscation is NOT a substitute for security. While I don't disagree with the "when's" here of GET vs POST, this statement is a bit misleading... Any cracker worth his salt can easily install any number of Firefox extensions or unix command line tools and not only view the POST d

Re: [PHP] multi-dimensional arrays

2009-04-13 Thread Michael A. Peters
Nitsan Bin-Nun wrote: $string = "xxx xx x xx xxx xxx xx x xx xxx"; $t = explode("\n", $string); foreach ($t as $k => $v) $t[$k] = explode(" ", $v); var_dump($t); After assigning the string do $string = preg_replace('/\s+/',' ',$string); Then you should be able to

[PHP] use bundled pcre in php 5.2.9 w/ apache 2.2?

2009-04-13 Thread Tom Worster
upgrading to 5.2.9 on freebsd using the ports, the question was asked: Use BUNDLED_PCRE (Select if you use apache 2.0.x) - Y/N? i use apache 2.2.x so i'd guess the answer would be no. but i'm not sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.n

Re: [PHP] multi-dimensional arrays

2009-04-13 Thread Nitsan Bin-Nun
Just wondering, there is callback version of preg_match_all() ? if so you could have done it in one line I think.. On Mon, Apr 13, 2009 at 9:52 PM, Andres Gonzalez wrote: > I was having the same problem. The second way was what I was looking for. > > Thank you so much for your help--I did not kno

Re: [PHP] multi-dimensional arrays

2009-04-13 Thread Andres Gonzalez
I was having the same problem. The second way was what I was looking for. Thank you so much for your help--I did not know about preg_match_all(). very coolthanks again. -Andres Shawn McKenzie wrote: Shawn McKenzie wrote: Well in your approach you get a bunch of empty elements where t

Re: [PHP] multi-dimensional arrays

2009-04-13 Thread Shawn McKenzie
Shawn McKenzie wrote: > Well in your approach you get a bunch of empty elements where the spaces > are. Here are two ways but I'm sure one preg_match_all() without the > explodes and loop could do it (some guru will show us): > > //one way > $text = 'xxx xx x xx xxx > xx x x

[PHP] Re: multi-dimensional arrays

2009-04-13 Thread Jo�o C�ndido de Souza Neto
I think the best way would be: $arrays = explode(PHP_EOL, $field); foreach ($arrays as &$array) { $array = explode(" ", $array); } Not tested, but should work. "Andres Gonzalez" escreveu na mensagem news:49e38a9e.3090...@packetstorm.com... > Hi, > > I am learning PHP and have a simple que

Re: [PHP] multi-dimensional arrays

2009-04-13 Thread Shawn McKenzie
Nitsan Bin-Nun wrote: > $string = "xxx xx x xx xxx > xxx xx x xx xxx"; > $t = explode("\n", $string); > foreach ($t as $k => $v) $t[$k] = explode(" ", $v); > var_dump($t); > > On Mon, Apr 13, 2009 at 8:55 PM, Andres Gonzalez > wrote: > >> Hi, >> >> I am learning PHP

[PHP] multi-dimensional arrays

2009-04-13 Thread Andres Gonzalez
Hi, I am learning PHP and have a simple question. I have a input string in this form: xxx xx x xx xxx xx x x xxx xx xx . . . xx xxx xx xx xx each line has 6 words of various lengths, all separated by white space. the input string can have any

Re: [PHP] multi-dimensional arrays

2009-04-13 Thread Nitsan Bin-Nun
$string = "xxx xx x xx xxx xxx xx x xx xxx"; $t = explode("\n", $string); foreach ($t as $k => $v) $t[$k] = explode(" ", $v); var_dump($t); On Mon, Apr 13, 2009 at 8:55 PM, Andres Gonzalez wrote: > Hi, > > I am learning PHP and have a simple question. > I have a inpu

RE: [PHP] try - catch is not so clear to me...

2009-04-13 Thread Bob McConnell
From: Marc Steinert > Basically try-catch gives you the ability to handle errors > outside a class or method scope, by the > calling instance. > This comes in handy, if you are programming in an object > orientated way and thus enables you to > seperate error handling from the rest of your funct

Re: [PHP] what to use instead of foreach

2009-04-13 Thread Nitsan Bin-Nun
var_dump(implode("", $array) . ""); On Mon, Apr 13, 2009 at 7:07 PM, PJ wrote: > Hi Leon & thanks. > It sure is complicated. Jim Lucas example did the trick very nicely (in > my other post - > "extract varying data from array with different formatting" but here I > am learning about other ways &

Re: [PHP] what to use instead of foreach

2009-04-13 Thread PJ
Hi Leon & thanks. It sure is complicated. Jim Lucas example did the trick very nicely (in my other post - "extract varying data from array with different formatting" but here I am learning about other ways & means. Redoing the arrays means redoing the queries :-( but I'll have a go at it if I'm to

RE: [PHP] what to use instead of foreach

2009-04-13 Thread Leon du Plessis
Hi PJ, You may want to remove the "," before the ...That was a slight oversight on my partsorry.'bout that...I will leave you to do the fixing, but I am sure you get the general idea. Best wishes..Leon -Original Message- From: Leon du Plessis [mailto:l...@dsgnit.com] Sent: 13 April

RE: [PHP] what to use instead of foreach

2009-04-13 Thread Leon du Plessis
Hi PJ, Ok, If I understand correctly you can attempt to alter your code as per following example (I am breaking it down a little for readability): a) If you only wish to output the authors, see also Mark Kelly's example, You can simply output as many authors you have associated (you will need an

Re: [PHP] try - catch is not so clear to me...

2009-04-13 Thread Marc Steinert
Basically try-catch gives you the ability to handle errors outside a class or method scope, by the calling instance. This comes in handy, if you are programming in an object orientated way and thus enables you to seperate error handling from the rest of your functionality. Means, your methods do

[PHP] problems with gnupg extension.

2009-04-13 Thread Ray
Hello all, I'm trying to use the gnupg extension and I think everything is properly installed. I'm just using test data. I'm encrypting and then immediately decrypting. But the decryption is failing with a unhelpful error message. error message : Warning: gnupg::decrypt() [gnupg.decrypt]: de

Re: [PHP] try - catch is not so clear to me...

2009-04-13 Thread Lamp Lists
> > From: Lamp Lists > To: php-general@lists.php.net > Sent: Monday, April 13, 2009 9:29:16 AM > Subject: [PHP] try - catch is not so clear to me... > > hi to all! > > actually, the statement in the Subject line is not 100% correct. I understand > the purpose

Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument

2009-04-13 Thread Raymond Irving
Hi Michael, Your script works fine. The only problem I'm having is that it does not support html entities. The following code will cause the page to crash: © I think that's because you're using loadXML and not loadHTML. Has anyone from the dev team contacted the libxml guys about the utf-8

Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument

2009-04-13 Thread Raymond Irving
Hi Michael, You migth want to check out the Raxan PDI (Programmable Document Interface) framework. It works like a charm iwth html snippets: example: $page['body']->appned('שלום'); // this will append the to the html body Here's the link: http://raxanpdi.com For online examples checkout: h

Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument

2009-04-13 Thread Michael Shadle
On Mon, Apr 13, 2009 at 2:19 AM, Michael A. Peters wrote: > The problem is that validating xhtml does not necessarily render properly in > some browsers *cough*IE*cough* I've never had problems and my work is primarily around IE6 / our corporate standards. Hell, even without a script type it sti

Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument

2009-04-13 Thread Michael Shadle
I will say though this negates the reason I chose to use domdocument to begin with. I am feeding it snippets of HTML that usually do not validate and I am not sure I want to run it through tidy first to convert from HTML to XHTML to run the domdocument and then convert it back... I am essen

Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument

2009-04-13 Thread Michael Shadle
Well this is an interesting turn of events :) We should now run over to the libxml folks and see if there is anything that can be done. There *are* encoding options when you setup the domdocument so it seems like the options are there but not working properly for one reason or another.

Re: [PHP] try - catch is not so clear to me...

2009-04-13 Thread Lamp Lists
From: Kyle Smith To: Lamp Lists Cc: php-general@lists.php.net Sent: Monday, April 13, 2009 9:52:36 AM Subject: Re: [PHP] try - catch is not so clear to me... Lamp Lists wrote: hi to all! actually, the statement in the Subject line is not 100% correct. I unders

Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument

2009-04-13 Thread Raymond Irving
Michael, You are absolutely right! It's loadHTML() that's causing the problems. Best regards, __ Raymond Irving --- On Mon, 4/13/09, Michael A. Peters wrote: > From: Michael A. Peters > Subject: Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument > To: "Michael Shadle" > Cc

[PHP] Re: Suggestion on .htaccess

2009-04-13 Thread Jonesy
On Mon, 13 Apr 2009 02:13:35 +0600, 9el wrote: > This is a .htaccess for a MU blog > the index file is kept at : public_html/ > And main blog is kept at: public_html/blog > > It is causing severe cache issue. SuperCache plugin is not working. > The blog is running out of memory most of times and

Re: [PHP] try - catch is not so clear to me...

2009-04-13 Thread Kyle Smith
Lamp Lists wrote: hi to all! actually, the statement in the Subject line is not 100% correct. I understand the purpose and how it works (at least I think I understand :-)) but to me it's so complicated way? let's take a look in example from php.net(http://us3.php.net/try) getMessage(), "\n"

Re: [PHP] what to use instead of foreach

2009-04-13 Thread PJ
Hi Leon, Thanks for the suggestion; I'm quite new to all this, so it's a bit complicated for my peanut brain. I have already tried with several count and for schemes. None work because foreach ignores any counters once in the loop. Also, this foreach is nested within another foreach; don't know if

[PHP] try - catch is not so clear to me...

2009-04-13 Thread Lamp Lists
hi to all! actually, the statement in the Subject line is not 100% correct. I understand the purpose and how it works (at least I think I understand :-)) but to me it's so complicated way? let's take a look in example from php.net(http://us3.php.net/try) getMessage(), "\n"; } // Continue exe

Re: [PHP] what to use instead of foreach

2009-04-13 Thread PJ
Mark Kelly wrote: > Hi. > > On Sunday 12 April 2009, PJ wrote: > >> foreach does not allow for different formatting for output... >> > > [snip] > > >> But how do you get result1, result2 & result3 // with at end ? >> > > $lastIndex = count($a) - 1; // Adjust for zero-indexing. > $o

Re: [PHP] pear mdb2 and null

2009-04-13 Thread Bastien Koert
[snip] >> I need it to error when an attempt to create a record without setting that >> field is attempted, but setting the field to an empty string is fine. >> >> Attempting to insert data without defining that field indicates there is >> not sufficient information to create a record. Setting that

Re: [PHP] what to use instead of foreach

2009-04-13 Thread Mark Kelly
Hi. On Sunday 12 April 2009, PJ wrote: > foreach does not allow for different formatting for output... [snip] > But how do you get result1, result2 & result3 // with at end ? $lastIndex = count($a) - 1; // Adjust for zero-indexing. $outputString = ''; foreach ($a as $index => $value) { if

Re: [PHP] Nagios Monitoring

2009-04-13 Thread Yannick Mortier
2009/4/13 Waynn Lue : > Hey guys, > > I'm looking to write a nagios plugin that essentially monitors whether or > not a database query returns a value > 0 at any given point.  I was hoping > to write this in PHP, but I haven't found too many examples of Nagios > plugins in PHP ( > http://www.barryo

Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument

2009-04-13 Thread Michael A. Peters
Michael A. Peters wrote: I wonder if the real utf8 problem people experience is really with loadHTML() and not with saveHTML() ?? Go to http://www.clfsrpm.net/xss/dom_script_test.php The page was meant to test something else but enter some UTF-8 into the textarea (well formed xhtml) -

Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument

2009-04-13 Thread Michael A. Peters
Michael A. Peters wrote: function makeHTML($document) { $buffer = $document->saveHTML(); $output = html_entity_decode($buffer,ENT_QUOTES,"UTF-8"); return $output; } I'll try it and see what it does. Huh - not tried above yet - but with $test = $myxhtml->createElement('p','שלום'

Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument

2009-04-13 Thread Michael A. Peters
Michael Shadle wrote: On Sun, Apr 12, 2009 at 8:07 AM, Raymond Irving wrote: $html = preg_replace('/<\!\[CDATA\[(.*)\]\]><\/script>/s','//',$html); question - the output of this would be right? is the cdata truly necessary? I typically use XHTML 1.0 transit

[PHP] Nagios Monitoring

2009-04-13 Thread Waynn Lue
Hey guys, I'm looking to write a nagios plugin that essentially monitors whether or not a database query returns a value > 0 at any given point. I was hoping to write this in PHP, but I haven't found too many examples of Nagios plugins in PHP ( http://www.barryodonovan.com/index.php/2007/11/02/as

Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument

2009-04-13 Thread Michael Shadle
On Sun, Apr 12, 2009 at 8:07 AM, Raymond Irving wrote: >    $html = > preg_replace('/<\!\[CDATA\[(.*)\]\]><\/script>/s','//',$html); question - the output of this would be right? is the cdata truly necessary? I typically use XHTML 1.0 transitional and I don't have