php-general Digest 27 Jun 2012 14:42:49 -0000 Issue 7866

2012-06-27 Thread php-general-digest-help

php-general Digest 27 Jun 2012 14:42:49 - Issue 7866

Topics (messages 318295 through 318309):

Re: What's happened to our newsgroup?
318295 by: Govinda
318296 by: Steven Staples
318297 by: TR Shaw
318298 by: Larry Martell
318299 by: Marc Guay
318300 by: Ashley Sheridan
318301 by: Jen Rasmussen
318302 by: Jason Pruim
318303 by: Matijn Woudt
318304 by: Daniel Brown
318305 by: Simon J Welsh
318306 by: Stefan Wixfort
318307 by: tamouse mailing lists
318308 by: Matijn Woudt
318309 by: Tedd Sperling

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---

 No postings for days.

everyone RTFM? 
:-)

---End Message---
---BeginMessage---

 -Original Message-
 From: Govinda [mailto:govinda.webdnat...@gmail.com]
 Sent: June 26, 2012 3:25 PM
 To: PHP-General List
 Subject: Re: [PHP] What's happened to our newsgroup?
 
 
  No postings for days.
 
 everyone RTFM?
 :-)
 
 

Maybe they joined the British mailing list?


Steven Staples

---End Message---
---BeginMessage---

On Jun 26, 2012, at 3:28 PM, Steven Staples wrote:

 
 -Original Message-
 From: Govinda [mailto:govinda.webdnat...@gmail.com]
 Sent: June 26, 2012 3:25 PM
 To: PHP-General List
 Subject: Re: [PHP] What's happened to our newsgroup?
 
 
 No postings for days.
 
 everyone RTFM?
 :-)
 
 
 
 Maybe they joined the British mailing list?
 

Maybe its just the summer.

Tom

---End Message---
---BeginMessage---
On Tue, Jun 26, 2012 at 1:30 PM, TR Shaw ts...@oitc.com wrote:

 On Jun 26, 2012, at 3:28 PM, Steven Staples wrote:


 -Original Message-
 From: Govinda [mailto:govinda.webdnat...@gmail.com]
 Sent: June 26, 2012 3:25 PM
 To: PHP-General List
 Subject: Re: [PHP] What's happened to our newsgroup?


 No postings for days.

 everyone RTFM?
 :-)



 Maybe they joined the British mailing list?


 Maybe its just the summer.

Maybe they're working in Django now (like I am).
---End Message---
---BeginMessage---
Everyone switched to PCP?
---End Message---
---BeginMessage---
On Tue, 2012-06-26 at 15:42 -0400, Marc Guay wrote:

 Everyone switched to PCP?
 


I wonder if the thing that happened to your newsgroup has also happened
to this mailing list? :p

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk


---End Message---
---BeginMessage---
LOL

-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
Sent: Tuesday, June 26, 2012 3:13 PM
To: Marc Guay
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] What's happened to our newsgroup?

On Tue, 2012-06-26 at 15:42 -0400, Marc Guay wrote:

 Everyone switched to PCP?
 


I wonder if the thing that happened to your newsgroup has also happened to this 
mailing list? :p

--
Thanks,
Ash
http://www.ashleysheridan.co.uk



---End Message---
---BeginMessage---

On Jun 26, 2012, at 4:15 PM, Jen Rasmussen j...@cetaceasound.com wrote:

 LOL
 
 -Original Message-
 From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
 Sent: Tuesday, June 26, 2012 3:13 PM
 To: Marc Guay
 Cc: php-gene...@lists.php.net
 Subject: Re: [PHP] What's happened to our newsgroup?
 
 On Tue, 2012-06-26 at 15:42 -0400, Marc Guay wrote:
 
 Everyone switched to PCP?
 
 
 
 I wonder if the thing that happened to your newsgroup has also happened to 
 this mailing list? :p

We can't talk like this! It's not even Friday yet!!! ;)

---End Message---
---BeginMessage---
On Tue, Jun 26, 2012 at 11:39 PM, Jason Pruim
li...@pruimphotography.com wrote:

 On Jun 26, 2012, at 4:15 PM, Jen Rasmussen j...@cetaceasound.com wrote:

 LOL

 -Original Message-
 From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
 Sent: Tuesday, June 26, 2012 3:13 PM
 To: Marc Guay
 Cc: php-gene...@lists.php.net
 Subject: Re: [PHP] What's happened to our newsgroup?

 On Tue, 2012-06-26 at 15:42 -0400, Marc Guay wrote:

 Everyone switched to PCP?



 I wonder if the thing that happened to your newsgroup has also happened to 
 this mailing list? :p

 We can't talk like this! It's not even Friday yet!!! ;)



Isn't everyday friday in summer? ;)
---End Message---
---BeginMessage---
On Tue, Jun 26, 2012 at 5:42 PM, Matijn Woudt tijn...@gmail.com wrote:

 Isn't everyday friday in summer? ;)

If it is, then it could be argued that every day is a Monday in
winter --- and right now, those poor folks in the southern hemisphere
(I'm looking at you, Thiago Pojda) are in a season of endless Mondays.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/
---End Message---
---BeginMessage---

On 27/06/2012, at 9:45 AM, Daniel Brown wrote:

 On Tue, Jun 26, 2012 at 5:42 PM, Matijn Woudt 

Re: [PHP] What's happened to our newsgroup?

2012-06-27 Thread Tedd Sperling
On Jun 26, 2012, at 3:21 PM, Al n...@ridersite.org wrote:

 No postings for days.
 

Maybe everyone learned it -- no new questions.

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



[PHP] slicing and dicing strings

2012-06-27 Thread Kirk Bailey

ok, it slices and dices, but how?
in python, to print all but the last char in string FOO, we say
print FOO[:-1]
But this seems to bark like a basset hound in php. Whyfore?

Now tihs tyro is seeking sage words to help me understand this.
RTFM is not sage words; if you don't want to help me please don't 
waste the bandwidth.


Would anyone care to help me understand this without dedicating 4 
precious and in over demand/under supply hours to RTFM?


--
end

Very Truly yours,
 - Kirk Bailey,
   Largo Florida

   kniht
  +-+
  | BOX |
  +-+
   think


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] slicing and dicing strings

2012-06-27 Thread admin
Read

http://php.net/manual/en/function.substr.php


-Original Message-
From: Kirk Bailey [mailto:kbai...@howlermonkey.net] 
Sent: Wednesday, June 27, 2012 6:15 PM
To: php-general@lists.php.net
Subject: [PHP] slicing and dicing strings

ok, it slices and dices, but how?
in python, to print all but the last char in string FOO, we say print
FOO[:-1] But this seems to bark like a basset hound in php. Whyfore?

Now tihs tyro is seeking sage words to help me understand this.
RTFM is not sage words; if you don't want to help me please don't waste the
bandwidth.

Would anyone care to help me understand this without dedicating 4 precious
and in over demand/under supply hours to RTFM?

--
end

Very Truly yours,
  - Kirk Bailey,
Largo Florida

kniht
   +-+
   | BOX |
   +-+
think


--
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] Re: php form action breaks script

2012-06-27 Thread Matijn Woudt
On Thu, Jun 28, 2012 at 2:17 AM, Tim Dunphy bluethu...@gmail.com wrote:
 Hey guys,

 It's been a little while since I've toyed with this, and I hope you
 don't mind my coming back to you for some more advice. But I've
 enjoyed some limited success with David R's advice regarding adding
 some strong quoting to the mix. Here is what I last tried -

Please bottom post on this (and probably any) mailing list.


  form method=post action=' . $_SERVER['[PHP_SELF'] .'

This must be some typo, it should read
form method=post action=' . $_SERVER['PHP_SELF'] .'




  $from = 'bluethu...@jokefire.com';
  $subject = $_POST['subject'];
  $text = $_POST['elvismail'];
  $output_form = false;


Try using
$subject = isset($_POST['subject']) ? $_POST['subject'] : ;
$subject = isset($_POST['elvismail']) ? $_POST['elvismail'] : ;

Cheers,

Matijn

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php form action breaks script

2012-06-27 Thread tamouse mailing lists
On Wed, Jun 27, 2012 at 7:17 PM, Tim Dunphy bluethu...@gmail.com wrote:
 Hey guys,

 It's been a little while since I've toyed with this, and I hope you
 don't mind my coming back to you for some more advice. But I've
 enjoyed some limited success with David R's advice regarding adding
 some strong quoting to the mix. Here is what I last tried -

  form method=post action=' . $_SERVER['[PHP_SELF'] .'

Just a wee typo here: You've quoted '[PHP_SELF' -- the extra bracket
at the beginning what's wrong there. Should just be 'PHP_SELF'.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php form action breaks script

2012-06-27 Thread tamouse mailing lists
On Wed, Jun 27, 2012 at 7:17 PM, Tim Dunphy bluethu...@gmail.com wrote:


One more little thing:

These notices:

 Notice: Undefined index: subject in
 /Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php
 on line 23 Notice: Undefined index: elvismail in
 /Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php

show up because you are processing form fields in $_POST when there
might not be any yet.

These lines:

  $from = 'bluethu...@jokefire.com';
  $subject = $_POST['subject'];
  $text = $_POST['elvismail'];
  $output_form = false;


Should appear *after* this line:

  if (isset($_POST['Submit'])) {


You should also check the $_POST entries for 'subject' and 'elvismail'
to make sure they are set to avoid the notices, even if you do move
them after the submit check. You never know!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] slicing and dicing strings

2012-06-27 Thread tamouse mailing lists
On Wed, Jun 27, 2012 at 5:15 PM, Kirk Bailey kbai...@howlermonkey.net wrote:
 ok, it slices and dices, but how?
 in python, to print all but the last char in string FOO, we say
 print FOO[:-1]
 But this seems to bark like a basset hound in php. Whyfore?

As said, PHP is not Python. Pretty much *nothing* else is Python.

That said, the trope still has legs in PHP:

From http://us2.php.net/manual/en/function.substr.php :

   If start is negative, the returned string will start at the
   start'th character from the end of string.

 Now tihs tyro is seeking sage words to help me understand this.
 RTFM is not sage words; if you don't want to help me please don't waste the
 bandwidth.

RTFM with no hint of where to look is a problem. But the dictum of
Read here in the manual will surely be the best thing. You will then
know where to look for future questions.

 Would anyone care to help me understand this without dedicating 4 precious
 and in over demand/under supply hours to RTFM?

You may not have 4 precious and overdemanded/undersupplied hours, but
at some point everyone who can answer this has had to slog through the
manual; we haven't just been lounging in our opulence pouring over the
documentation out of some need to aleviate our boredom. Nor is anyone
on this list to spend their time providing answers which *are* readily
available with just a bit of google-fu.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] slicing and dicing strings

2012-06-27 Thread Jim Giner
Stuart Dallas stu...@3ft9.com wrote in message 
news:d889b8e1-2eab-4f36-83cb-8a52b5ec6...@3ft9.com...
WARNING: May contain traces of sarcasm.
If it would really take you 4 hours to find this out via the manual or 
Google then I think it would be 4 hours well spent: 3 hours 55 minutes 
learning how to use the manual / Google effectively, and 5 minutes to then 
get the answer you seek.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


hear hear!  Or is it here here!? 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php form action breaks script

2012-06-27 Thread Jim Giner


Tim Dunphy bluethu...@gmail.com wrote in message 
news:caozy0em5duhby-qv+y1u-e+c5yd7g5utauhomoyu3z7jma-...@mail.gmail.com...

Notice: Undefined index: subject in
/Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php
on line 23 Notice: Undefined index: elvismail in
/Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php
on line 24 Notice: Undefined index: [PHP_SELF in
/Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php
on line 62

[Wed Jun 27 20:13:42 2012] [error] [client 127.0.0.1] PHP Notice:
Undefined index: [PHP_SELF in
/Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php
on line 62, referer: http://localhost/elvis/


You're missing an input (POST) for the field named 'subject'.  Something 
change in your html?  As in you no longer have a 'subject' input field? 
Same for the other field named.  As for the missing PHP_SELF - did you start 
a session?  I could be way off on this.  The errors are even giving you the 
line number so it shouldn't be hard to find!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Can I do this in a single match/replace?

2012-06-27 Thread Paul Halliday
I have lines that look like (I added intentional line breaks):

alert tcp $HOME_NET 1 - $EXTERNAL_NET any (msg:ET EXPLOIT NDMP
Notify Connect - Possible Backup Exec Remote Agent Recon;
flow:established,from_server; content:|00 00 05 02|; offset:16;
depth:20; content: |00 00 00 03|; offset: 28;
depth: 32; 
reference:url,www.ndmp.org/download/sdk_v4/draft-skardal-ndmp4-04.txt;
reference:url,doc.emergingthreats.net/bin/view/Main/2002068;
classtype:attempted-recon; sid:2002068; rev:8;)

So within this there are reference urls that I would like to turn into
links so that when they are rendered they can be clicked on.

Using preg_match and this pattern I can get the refs:

$pattern = '\reference:url,([^;]+;)\';

which gives me:

$matches[0] = www.ndmp.org/download/sdk_v4/draft-skardal-ndmp4-04.txt
$matches[1] = doc.emergingthreats.net/bin/view/Main/2002068

now what I would like to do is replace inline adding a href=http://;
. $matches[n] .  . $matches[n] . /a

Can this be done or do I need to say loop through matches (there can
be none or many) and do a str_replace.

Thoughts? Other ideas?

Thanks.

-- 
Paul Halliday
http://www.pintumbler.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Can I do this in a single match/replace?

2012-06-27 Thread Chris Testroet

On 6/27/2012 6:26 PM, Paul Halliday wrote:

I have lines that look like (I added intentional line breaks):

alert tcp $HOME_NET 1 - $EXTERNAL_NET any (msg:ET EXPLOIT NDMP
Notify Connect - Possible Backup Exec Remote Agent Recon;
flow:established,from_server; content:|00 00 05 02|; offset:16;
depth:20; content: |00 00 00 03|; offset: 28;
depth: 32; 
reference:url,www.ndmp.org/download/sdk_v4/draft-skardal-ndmp4-04.txt;
reference:url,doc.emergingthreats.net/bin/view/Main/2002068;
classtype:attempted-recon; sid:2002068; rev:8;)

So within this there are reference urls that I would like to turn into
links so that when they are rendered they can be clicked on.

Using preg_match and this pattern I can get the refs:

$pattern = '\reference:url,([^;]+;)\';

which gives me:

$matches[0] = www.ndmp.org/download/sdk_v4/draft-skardal-ndmp4-04.txt
$matches[1] = doc.emergingthreats.net/bin/view/Main/2002068

now what I would like to do is replace inline adding a href=http://;
. $matches[n] .  . $matches[n] . /a

Can this be done or do I need to say loop through matches (there can
be none or many) and do a str_replace.

Thoughts? Other ideas?

Thanks.



Look into preg_replace, with the e modifier. It allows you to run php 
code for every replace.


Chris


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php