Re: [PHP] Regex æøå email validation?

2007-09-25 Thread Per Jessen
Søren Neigaard wrote:

> It works fine, but my friend strangely enough has users with special
> danish letters (æøåÆØÅ) in their email address, and that it does not
> accept. 

Hej Søren

I just realised - you can't have those characters in the email address. 
You may have them in the name part, but not in the address part.  If
you have them in the domain, you need to convert them to punycode
before you validate. 


/Per Jessen, Zürich

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



[PHP] Re: Data request

2007-09-25 Thread Colin Guthrie
Auto-Deppe, C. Haensel wrote:
> Haha... nice one Col! Just started up my work computer, and the first
> thing I read is your post. Really a good start into the day :o) Thanks.
> 
> Paul: Thanks for the flightgear link. As a FS2004 user I never even
> thought of flightgear, so thanks, I'll have a look at that :o)

I think you missed the Reply All button that this list likes so much

PS I got nostalgic and had to look up Henry's Cat:
http://www.henryscat.com/ awesome :D

Check out Henry's Cat TV and hit the Jingle episode if you want to hear
the bit I (mis)quoted originally! Oh to be a child again (and not just
settle for having the mental age of one) :p

Col

> - Original Message - From: "Colin Guthrie" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> To: 
> Sent: Monday, September 24, 2007 6:12 PM
> Subject: Re: Data request
> 
> 
>> Stut wrote:
>>> Have you tried Google? It knows a lot about most things and a little
>>> about the rest.
>>
>> Failing that you could try asking Henry's cat. You must know Henry's
>> cat? He knows everything about nothing and not to much about that. So if
>> you know someone who know what he knows then you must know Henry's
>> cat
>> 
>>
>> I'll get my coat
>>
>> Col 
> 


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



[PHP] Re: Data request

2007-09-25 Thread Christian Hänsel
"Colin Guthrie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]

Auto-Deppe, C. Haensel wrote:

Haha... nice one Col! Just started up my work computer, and the first
thing I read is your post. Really a good start into the day :o) Thanks.

Paul: Thanks for the flightgear link. As a FS2004 user I never even
thought of flightgear, so thanks, I'll have a look at that :o)


I think you missed the Reply All button that this list likes so much

PS I got nostalgic and had to look up Henry's Cat:
http://www.henryscat.com/ awesome :D

Check out Henry's Cat TV and hit the Jingle episode if you want to hear
the bit I (mis)quoted originally! Oh to be a child again (and not just
settle for having the mental age of one) :p

Col


Heck, I am turning 30 at the end of next month :o( Quit talking about age 
*big grin*







- Original Message - From: "Colin Guthrie" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: 
Sent: Monday, September 24, 2007 6:12 PM
Subject: Re: Data request



Stut wrote:

Have you tried Google? It knows a lot about most things and a little
about the rest.


Failing that you could try asking Henry's cat. You must know Henry's
cat? He knows everything about nothing and not to much about that. So if
you know someone who know what he knows then you must know Henry's
cat


I'll get my coat

Col






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



[PHP] Quota Display function sample

2007-09-25 Thread edwardspl

Dear All,

Mine is Linux FC6 and define the quota by using the build in as the 
following :


For sudoers :
apacheALL= NOPASSWD:/usr/bin/quota, /bin/grep

For /var/spool/mail
-rw--- 1 root root 7168 Sep 24 23:02 aquota.group
-rw--- 1 root root 8192 Sep 24 18:05 aquota.user

So, is there as sample for Quota Display ( FS Quota ) ?
I want to apply with a WebMail Client for a alarm message...

Many thanks !

Edward.

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



Re: [PHP] Re: Data request

2007-09-25 Thread Børge Holen
On Tuesday 25 September 2007 03:27:25 Christian Hänsel wrote:
> "Colin Guthrie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
>
> > Auto-Deppe, C. Haensel wrote:
> >> Haha... nice one Col! Just started up my work computer, and the first
> >> thing I read is your post. Really a good start into the day :o) Thanks.
> >>
> >> Paul: Thanks for the flightgear link. As a FS2004 user I never even
> >> thought of flightgear, so thanks, I'll have a look at that :o)
> >
> > I think you missed the Reply All button that this list likes so much
> >
> > PS I got nostalgic and had to look up Henry's Cat:
> > http://www.henryscat.com/ awesome :D
> >
> > Check out Henry's Cat TV and hit the Jingle episode if you want to hear
> > the bit I (mis)quoted originally! Oh to be a child again (and not just
> > settle for having the mental age of one) :p
> >
> > Col
>
> Heck, I am turning 30 at the end of next month :o( Quit talking about age
> *big grin*

This discussion is just plain weird. About this henrys cat thing... Thats 
OLD... really old, shit the scary part is that I remember it.
Cat probably knew nothin about php, since I never saw any reference to him in 
the archives. 
This shit is also likely to get some good google hits to,
search for "henrys cat php"... imagine that. WEIRD!

>
> >> - Original Message - From: "Colin Guthrie"
> >> <[EMAIL PROTECTED]> Newsgroups: php.general
> >> To: 
> >> Sent: Monday, September 24, 2007 6:12 PM
> >> Subject: Re: Data request
> >>
> >>> Stut wrote:
>  Have you tried Google? It knows a lot about most things and a little
>  about the rest.
> >>>
> >>> Failing that you could try asking Henry's cat. You must know Henry's
> >>> cat? He knows everything about nothing and not to much about that. So
> >>> if you know someone who know what he knows then you must know Henry's
> >>> cat
> >>> 
> >>>
> >>> I'll get my coat
> >>>
> >>> Col

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



[PHP] read post data as a buffer

2007-09-25 Thread David Blanco
Hi!

I think that is not possible to read post data as a buffer with php like
it´s in perl. If this is true, how do you deal with large file uploads
to know the status of the operation at any time?

Thanks

Greetings from Spain
-- 
David Blanco

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



[PHP] Re: article: 7 reasons I switched back to PHP after 2 years on Rails

2007-09-25 Thread tedd

At 7:47 PM +0100 9/24/07, Colin Guthrie wrote:

Robert Cummings wrote:

 On Mon, 2007-09-24 at 12:52 -0500, XIMvad wrote:

 hohoho .. maaanya :D

http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html



 DUPE!!!

 Posted yesterday! :)


This is why everyone accuses us PHPites of rewriting everything :p

Col



And your point?  :-)

If I ever develop the attitude of "it's good enough", someone one shoot me.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Re: article: 7 reasons I switched back to PHP after 2 years on Rails

2007-09-25 Thread Robert Cummings
On Tue, 2007-09-25 at 08:29 -0400, tedd wrote:
> At 7:47 PM +0100 9/24/07, Colin Guthrie wrote:
> >Robert Cummings wrote:
> >>  On Mon, 2007-09-24 at 12:52 -0500, XIMvad wrote:
> >>>  hohoho .. maaanya :D
> >>> 
> >>>http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html
> >>
> >>
> >>  DUPE!!!
> >>
> >>  Posted yesterday! :)
> >
> >This is why everyone accuses us PHPites of rewriting everything :p
> >
> >Col
> 
> 
> And your point?  :-)
> 
> If I ever develop the attitude of "it's good enough", someone one shoot me.

Why would we shoot you? You're good enough! >;)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Re: Data request

2007-09-25 Thread Robert Cummings
On Tue, 2007-09-25 at 10:44 -0600, Børge Holen wrote:
> On Tuesday 25 September 2007 03:27:25 Christian Hänsel wrote:
> > "Colin Guthrie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > news:[EMAIL PROTECTED]
> >
> > > Auto-Deppe, C. Haensel wrote:
> > >> Haha... nice one Col! Just started up my work computer, and the first
> > >> thing I read is your post. Really a good start into the day :o) Thanks.
> > >>
> > >> Paul: Thanks for the flightgear link. As a FS2004 user I never even
> > >> thought of flightgear, so thanks, I'll have a look at that :o)
> > >
> > > I think you missed the Reply All button that this list likes so much
> > >
> > > PS I got nostalgic and had to look up Henry's Cat:
> > > http://www.henryscat.com/ awesome :D
> > >
> > > Check out Henry's Cat TV and hit the Jingle episode if you want to hear
> > > the bit I (mis)quoted originally! Oh to be a child again (and not just
> > > settle for having the mental age of one) :p
> > >
> > > Col
> >
> > Heck, I am turning 30 at the end of next month :o( Quit talking about age
> > *big grin*
> 
> This discussion is just plain weird. About this henrys cat thing... Thats 
> OLD... really old, shit the scary part is that I remember it.
> Cat probably knew nothin about php, since I never saw any reference to him in 
> the archives. 
> This shit is also likely to get some good google hits to,
> search for "henrys cat php"... imagine that. WEIRD!

Oh sure, and now when I'm searching for "shit" I'll get all these
Henry's cat references *bleh*.

Yeah, yeah, I know, I'd never search for shit on the Internet anyways,
the prospect of the kind of results one would get is enough to make me
cringe.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



[PHP] php downlaod script

2007-09-25 Thread Hulf
My download script only gives me empty (0kb) xls files. They are being 
uploaded as blobs and seem ok. Can someone shed some light on why the 
downoad is not working.

Many Thanks,


R.


 

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



Re: [PHP] Re: Data request

2007-09-25 Thread Paul Scott

On Tue, 2007-09-25 at 09:17 -0400, Robert Cummings wrote:
> Oh sure, and now when I'm searching for "shit" I'll get all these
> Henry's cat references *bleh*.
> 
Well then why not tie in "coprophilia" as well?

ugh.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

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

Re: [PHP] read post data as a buffer

2007-09-25 Thread Jürgen Wind

You may be looking for this :
http://martinjansen.com/2007/04/upload-progress/  

David Blanco-3 wrote:
> 
> Hi!
> 
> I think that is not possible to read post data as a buffer with php like
> it´s in perl. If this is true, how do you deal with large file uploads
> to know the status of the operation at any time?
> 
> Thanks
> 
> Greetings from Spain
> -- 
> David Blanco
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/read-post-data-as-a-buffer-tf4514831.html#a12879787
Sent from the PHP - General mailing list archive at Nabble.com.

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



Re: [PHP] php downlaod script

2007-09-25 Thread Jason Pruim

Hi Hulf,

Just looking at it, I'm not sure why it's not working. But here is  
the script I use for exporting database files to excel:


$select = "SELECT * FROM ".$table." WHERE FName like '%".$search."%'  
or LName like '%".$search."%' or Add1 like '%".$search."%' or Add2  
like '%".$search."%' or City like '%".$search."%' or State like '%". 
$search."%' or Zip like '%".$search."%' or XCode like '%".$search."%'  
order by ".$sortOrder."";


$export = mysql_query($select);
$fields = mysql_num_fields($export);

for ($i = 0; $i < $fields; $i++) {
$header .= mysql_field_name($export, $i) . "\t";
}

while($row = mysql_fetch_row($export)) {
$line = '';
foreach($row as $value) {
if ((!isset($value)) or ($value == "")) {
$value = "\t";
}
else
{
$value = str_replace('"', '""', $value);
$value = '"' . $value . '"' . "\t";
}   
$line .= $value;
}
$data .= trim($line). "\n";
}
$data = str_replace("\r", "", $data);

if ($data =="") {
$data ="\n(0) Records Found!\n";
}
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=Export.xls");
header("Pragma: no-cache");
header("Expires: 0");


print "$header\n$data";


?>

On Sep 25, 2007, at 9:22 AM, Hulf wrote:


My download script only gives me empty (0kb) xls files. They are being
uploaded as blobs and seem ok. Can someone shed some light on why the
downoad is not working.

Many Thanks,


R.


$query = "SELECT id, file_name, size, type, content FROM results  
WHERE id =

'$id'";

$result = mysql_query($query) or die(mysql_error());
list($id, $file_name, $type, $size, $content) = mysql_fetch_array 
($result);


header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$file_name");
header("Content-Length: ".filesize($size));
header("Accept-Ranges: bytes");
header("Pragma: no-cache");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-transfer-encoding: binary");



Just out of my own curiosity, What does the Content-Length and Accept- 
Ranges do?




exit;
}

?>



Also, when I was trying to get mine working, I commented out all the  
header calls so it would print the results on the page so I didn't  
end up with 500 excel spreadsheets on my desktop.

--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]

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



Re: [PHP] php downlaod script

2007-09-25 Thread Stut

Hulf wrote:
My download script only gives me empty (0kb) xls files. They are being 
uploaded as blobs and seem ok. Can someone shed some light on why the 
downoad is not working.



header("Content-Length: ".filesize($size));


I'm thinking this should not be calling filesize.

-Stut

--
http://stut.net/

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



[PHP] Newbie: special characters in regex?

2007-09-25 Thread Zembower, Kevin
I'm trying to modify a string so that it can be used as a Distinguished
Name in an LDAP operation. Distinguished Names must have special
characters, such as (, ), / and \ escaped with a backslash. For
instance, 'Kevin (Kev) Zembower, III" becomes 'Kevin \(Kev\) Zembower\,
III'.

I tried to do this in this statement:
$entry['FirstName'] = preg_replace('/(\)|\(|\,|\/)/',`\\$1',
$entry['FirstName'];

But it gives me this error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING in
/var/www/centernet/htdocs/ldap_auth/conversion.php on line 89

Can anyone help me get this statement right? Also, this doesn't seem
very readable or easily maintained. I read about using an array() as the
pattern string, which might make the statement more readable. Can anyone
show me how this would be done, and suggest other ways to make this
statement more easily maintained?

Thanks for your advice and suggestions.

-Kevin

Kevin Zembower
Internet Services Group manager
Center for Communication Programs
Bloomberg School of Public Health
Johns Hopkins University
111 Market Place, Suite 310
Baltimore, Maryland  21202
410-659-6139 

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



Re: [PHP] php downlaod script

2007-09-25 Thread Jim Lucas

Hulf wrote:
My download script only gives me empty (0kb) xls files. They are being 
uploaded as blobs and seem ok. Can someone shed some light on why the 
downoad is not working.


Many Thanks,


R.


$query = "SELECT id, file_name, size, type, content FROM results WHERE id = 
'$id'";


$result = mysql_query($query) or die(mysql_error());
list($id, $file_name, $type, $size, $content) = mysql_fetch_array($result);

header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$file_name");
header("Content-Length: ".filesize($size));
header("Accept-Ranges: bytes");
header("Pragma: no-cache");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-transfer-encoding: binary");


exit;
}

?> 



Were are you actually outputting the $content???

is $size the actual size of the data?  if so, you don't need to run 
filesize($size)


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



[PHP] Re: Newbie: special characters in regex?

2007-09-25 Thread Al
Suggest using the hex or oct codes for the special characters.  It will save you 
much heart ache.  Here is a great utility http://www.dextronet.com/charprobe.php


Zembower, Kevin wrote:

I'm trying to modify a string so that it can be used as a Distinguished
Name in an LDAP operation. Distinguished Names must have special
characters, such as (, ), / and \ escaped with a backslash. For
instance, 'Kevin (Kev) Zembower, III" becomes 'Kevin \(Kev\) Zembower\,
III'.

I tried to do this in this statement:
$entry['FirstName'] = preg_replace('/(\)|\(|\,|\/)/',`\\$1',
$entry['FirstName'];

But it gives me this error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING in
/var/www/centernet/htdocs/ldap_auth/conversion.php on line 89

Can anyone help me get this statement right? Also, this doesn't seem
very readable or easily maintained. I read about using an array() as the
pattern string, which might make the statement more readable. Can anyone
show me how this would be done, and suggest other ways to make this
statement more easily maintained?

Thanks for your advice and suggestions.

-Kevin

Kevin Zembower
Internet Services Group manager
Center for Communication Programs
Bloomberg School of Public Health
Johns Hopkins University
111 Market Place, Suite 310
Baltimore, Maryland  21202
410-659-6139 


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



Re: [PHP] php downlaod script

2007-09-25 Thread brian

Hulf wrote:
My download script only gives me empty (0kb) xls files. They are being 
uploaded as blobs and seem ok. Can someone shed some light on why the 
downoad is not working.


Many Thanks,


R.


$query = "SELECT id, file_name, size, type, content FROM results WHERE id = 
'$id'";


$result = mysql_query($query) or die(mysql_error());
list($id, $file_name, $type, $size, $content) = mysql_fetch_array($result);

header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$file_name");
header("Content-Length: ".filesize($size));
header("Accept-Ranges: bytes");
header("Pragma: no-cache");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-transfer-encoding: binary");


exit;
}

?> 



You'll want to echo out $content before the exit call. And 
filesize($size) makes no sense here--this function expects the path to a 
*file* given to it.


brian

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



RE: [PHP] Newbie: special characters in regex?

2007-09-25 Thread Edward Kay

> 
> I'm trying to modify a string so that it can be used as a Distinguished
> Name in an LDAP operation. Distinguished Names must have special
> characters, such as (, ), / and \ escaped with a backslash. For
> instance, 'Kevin (Kev) Zembower, III" becomes 'Kevin \(Kev\) Zembower\,
> III'.
> 
> I tried to do this in this statement:
> $entry['FirstName'] = preg_replace('/(\)|\(|\,|\/)/',`\\$1',
> $entry['FirstName'];
> 
Two things I can see straight off that will give you a parse error:

1. You've used a back tick instead of a single quote before \\$1

2. There's no closing parenthesis to the preg_replace function.

Edward

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



Re: [PHP] Newbie: special characters in regex?

2007-09-25 Thread brian

Zembower, Kevin wrote:

I'm trying to modify a string so that it can be used as a Distinguished
Name in an LDAP operation. Distinguished Names must have special
characters, such as (, ), / and \ escaped with a backslash. For
instance, 'Kevin (Kev) Zembower, III" becomes 'Kevin \(Kev\) Zembower\,
III'.

I tried to do this in this statement:
$entry['FirstName'] = preg_replace('/(\)|\(|\,|\/)/',`\\$1',
$entry['FirstName'];

But it gives me this error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING in
/var/www/centernet/htdocs/ldap_auth/conversion.php on line 89

Can anyone help me get this statement right? Also, this doesn't seem
very readable or easily maintained. I read about using an array() as the
pattern string, which might make the statement more readable. Can anyone
show me how this would be done, and suggest other ways to make this
statement more easily maintained?




preg_replace('/([\(\),]+)/', '\\\$1', $str)

You don't need the pipes (OR) in the search pattern. By placing them in 
the square brackets they act as a set of characters to search for.


The comma also does not require escaping.

I suggest you create an escapeDN() or escapeLDAPStr() function so that 
you can alter the search pattern in one place if you need to.


Oh, and i left out the escaped forward slash you had in your search 
pattern. Are you really expecting someone to have a forward slash in 
their name? If so, change it to:


'/([\(\)\/,]+)/'

brian

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



Re: [PHP] Newbie: special characters in regex?

2007-09-25 Thread Jim Lucas

Zembower, Kevin wrote:

I'm trying to modify a string so that it can be used as a Distinguished
Name in an LDAP operation. Distinguished Names must have special
characters, such as (, ), / and \ escaped with a backslash. For
instance, 'Kevin (Kev) Zembower, III" becomes 'Kevin \(Kev\) Zembower\,
III'.

I tried to do this in this statement:
$entry['FirstName'] = preg_replace('/(\)|\(|\,|\/)/',`\\$1',
$entry['FirstName'];

But it gives me this error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING in
/var/www/centernet/htdocs/ldap_auth/conversion.php on line 89

Can anyone help me get this statement right? Also, this doesn't seem
very readable or easily maintained. I read about using an array() as the
pattern string, which might make the statement more readable. Can anyone
show me how this would be done, and suggest other ways to make this
statement more easily maintained?

Thanks for your advice and suggestions.

-Kevin

Kevin Zembower
Internet Services Group manager
Center for Communication Programs
Bloomberg School of Public Health
Johns Hopkins University
111 Market Place, Suite 310
Baltimore, Maryland  21202
410-659-6139 




For a simple string replacement, why not do something like this



--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



[PHP] php auction/bidding system

2007-09-25 Thread bruce
Hey...

I'm researching, trying to find a really good/stable bidding/auction system.
I've checked freshmeat/sourceforge, etc Anybody with experience with one
of these kinds of systems that you care to share.

Looking to potentially rip it apart for my needs.

Thanks

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



Re: [PHP] Re: Strategy for Secure File Storage

2007-09-25 Thread Andrew Ballard
Kevin Murphy wrote:
> > The problem is IE7. All browsers work with this code as is but IE  says
> > "Internet Explorer cannot download test.pdf from XXX"

The problem with IE was when you told it not to cache the document. If
you just want the browser to download the file rather than let the
Adobe plug-in handle it, as it looks like you intend with the
Content-disposition set to attachment, you have to send just the right
headers to make IE happy. (I think Brian's example should do it.)
Otherwise, IE knows it can handle the document internally with a
plug-in and will still try to open the file anyway. For some reason
when IE tries to handle files like PDF, it downloads the file, saves
it to cache, and then tells the Adobe plug-in to open the file from
the cache. Since you've told IE not to cache the file, IE honors that
request -- it builds the cache filename (and may even save the file
before promptly deleting it) and then sends that file name to the
Adobe plug-in which then tries to open a file that does not exist in
your computer's local cache.

On 9/24/07, brian <[EMAIL PROTECTED]> wrote:
> echo 'Your software provider sucks eggs. Get a better browser.';

LOL. I love that approach, too. Unfortunately, it's not very practical. :-\

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



Re: [PHP] Re: Data request

2007-09-25 Thread tedd

At 9:17 AM -0400 9/25/07, Robert Cummings wrote:

On Tue, 2007-09-25 at 10:44 -0600, Børge Holen wrote:

 On Tuesday 25 September 2007 03:27:25 Christian Hänsel wrote:

 > > "Colin Guthrie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag

 > > Heck, I am turning 30 at the end of next month :o( Quit talking about age
 > > *big grin*


30 ?!

I got underwear older than that.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Re: Data request

2007-09-25 Thread Steve Edberg

At 4:57 PM -0400 9/25/07, tedd <[EMAIL PROTECTED]> wrote:

At 9:17 AM -0400 9/25/07, Robert Cummings wrote:

On Tue, 2007-09-25 at 10:44 -0600, Børge Holen wrote:

 On Tuesday 25 September 2007 03:27:25 Christian Hänsel wrote:

 > > "Colin Guthrie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag

 > > Heck, I am turning 30 at the end of next month :o( Quit
talking about age
 > > *big grin*


30 ?!

I got underwear older than that.



...I've got some card decks from my first programming job (on a
computer that had *actual* core memory) that are almost that old
(totters off to get some Geritol and scream at the kids on my lawn)

steve

--
+--- my people are the people of the dessert, ---+
| Steve Edberghttp://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center[EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin (530)754-9127 |
+ said t e lawrence, picking up his fork +

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



Re: [PHP] Re: Data request

2007-09-25 Thread Robert Cummings
On Tue, 2007-09-25 at 16:57 -0400, tedd wrote:
> At 9:17 AM -0400 9/25/07, Robert Cummings wrote:
> >On Tue, 2007-09-25 at 10:44 -0600, Børge Holen wrote:
> >>  On Tuesday 25 September 2007 03:27:25 Christian Hänsel wrote:
> >  > > "Colin Guthrie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> >
> >  > > Heck, I am turning 30 at the end of next month :o( Quit talking about 
> > age
> >  > > *big grin*
> 
> 30 ?!
> 
> I got underwear older than that.

Ted, what's you're PayPal addie, I'm gonna send you some cash for new
underwear :B

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Re: Data request

2007-09-25 Thread Børge Holen
On Tuesday 25 September 2007 16:10:47 Robert Cummings wrote:
> On Tue, 2007-09-25 at 16:57 -0400, tedd wrote:
> > At 9:17 AM -0400 9/25/07, Robert Cummings wrote:
> > >On Tue, 2007-09-25 at 10:44 -0600, Børge Holen wrote:
> > >>  On Tuesday 25 September 2007 03:27:25 Christian Hänsel wrote:
> > >  > > "Colin Guthrie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > >  > >
> > >  > > Heck, I am turning 30 at the end of next month :o( Quit talking
> > >  > > about age *big grin*
> >
> > 30 ?!
> >
> > I got underwear older than that.
>
> Ted, what's you're PayPal addie, I'm gonna send you some cash for new
> underwear :B

just my thoughts to

>
> Cheers,
> Rob.
> --
> ...
> SwarmBuy.com - http://www.swarmbuy.com
>
> Leveraging the buying power of the masses!
> ...

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



[PHP] Re: Strategy for Secure File Storage

2007-09-25 Thread Colin Guthrie
Kevin Murphy wrote:
> $ext = explode(".",$file);
> 
> $extension = $mimetypes["$ext[1]"];

Other people have provided answers so I'll just make a quick comment on
this bit.

It's not ideal but if you only upload a subset of file types then I
guess it's OK.

Also if the file has more than a single "dot" in it (e.g. my.image.jpg)
which is perfectly valid, then $ext[1] will contain ("image") which
isn't right.

If possible use e.g.
http://www.php.net/manual/en/function.mime-content-type.php or Example
606 here http://www.php.net/manual/en/function.finfo-file.php but these
may not be available on your PHP install.

You should probably check more thoroughly:

e.g.

$mimetype = 'application/octet-stream'; // default
$ext = array_pop($dummy = explode('.', $file));
if (!empty($mimetypes[$ext]))
  $mimetype = $mimetypes[$ext];

or something similar (not tested above!)


Hope this helps ya.

Col

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



[PHP] SFTP connections via PHP

2007-09-25 Thread Cameron Just

Hi All,

Just wondering if anyone has had any success getting a connection
working with PHP via SFTP.

I am running
Win 2003 Server
PHP Version 5.1.6
Win32 OpenSSL v0.9.8e Light is installed
PECL module for SSH2 is installed

The following code
-
   // create connetion to remote server
   if (!$sftpConnection = ssh2_connect(DNCR_SERVERNAME, 22)) {
   echo 'ERROR: Server connection failed.' . "\n";
   exit;
   }

   // check fingerprint of remote server matches what we expect
   $dncrFingerprint = ssh2_fingerprint($sftpConnection,
SSH2_FINGERPRINT_MD5 | SSH2_FINGERPRINT_HEX);
   if ($dncrFingerprint != DNCR_FINGERPRINT && FALSE) {
   echo 'ERROR: Hostkey mismatch.' . "\n";
   exit;
   }

   // ensure that authentication methods allowed
   $sshAcceptedAuthenticationMethods =
ssh2_auth_none($sftpConnection,DNCR_USERNAME);
   echo "\n" . 'Accepted authentication methods:' . "\n";
   for ($i = 0; $i < count($sshAcceptedAuthenticationMethods); $i++)
echo $sshAcceptedAuthenticationMethods[$i] . "\n";
   echo "\n";

   $sshNegotiatedMethods = ssh2_methods_negotiated($sftpConnection);
   echo 'Encryption keys were negotiated using: {' .
$sshNegotiatedMethods['kex'] . '}' . "\n";
   echo 'Server identified using an {' .
$sshNegotiatedMethods['hostkey'] . '} with ';
   echo 'fingerprint: ' . ssh2_fingerprint($sftpConnection) . "\n";

   echo 'Client to Server packets will use methods:' . "\n";
   echo 'Crypt: {' . $sshNegotiatedMethods['client_to_server']['crypt']
. '}' . "\n";
   echo 'Comp: {' . $sshNegotiatedMethods['client_to_server']['comp'] .
'}' . "\n";
   echo 'MAC: {' . $sshNegotiatedMethods['client_to_server']['mac'] .
'}' . "\n";

   echo 'Server to Client packets will use methods:' . "\n";
   echo 'Crypt: {' . $sshNegotiatedMethods['server_to_client']['crypt']
. '}' . "\n";
   echo 'Comp: {' . $sshNegotiatedMethods['server_to_client']['comp'] .
'}' . "\n";
   echo 'MAC: {' . $sshNegotiatedMethods['server_to_client']['mac'] .
'}' . "\n";


   if (!ssh2_auth_password($sftpConnection, DNCR_USERNAME ,
DNCR_PASSWORD)) {
   echo 'ERROR: Cannot authenticate to remote server.' . "\n";
   exit;
   }
-

produces the following result
-

Accepted authentication methods:
publickey
keyboard-interactive

Encryption keys were negotiated using: {diffie-hellman-group14-sha1}
Server identified using an {ssh-dss} with fingerprint: 
F4EE0910B0C6BA932908320145F87790

Client to Server packets will use methods:
Crypt: {aes256-cbc}
Comp: {none}
MAC: {hmac-sha1}
Server to Client packets will use methods:
Crypt: {aes256-cbc}
Comp: {none}
MAC: {hmac-sha1}

*Warning*:  ssh2_auth_password() [function.ssh2-auth-password 
]: Authentication 
failed for myusername using password in 
*c:\Inetpub\wwwroot\VESD\phoenix\composer-stage1-wash-file-submission.php* 
on line *67*


ERROR: Cannot authenticate to remote server.

-

I can connect to this remote server via SFTP using Filezilla so there is
no firewall issues.

I also did a bit of reading on the accepted authentication method of
keyboard-interactive and it states that password should be allowed to be
sent
http://www.ssh.com/support/documentation/online/ssh/winhelp/32/overview.html

Any help would be greatly appreciated.

Thankyou

PS: I am sorry for the double post but noone has responded to this email 
on the windows list so I thought I would try my luck here...


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



Re: [PHP] SOAP in PHP on very restricted host?

2007-09-25 Thread mike
On 9/25/07, David Zentgraf <[EMAIL PROTECTED]> wrote:
> Hi,
>
> We need to work with a credit card checking company for an online
> store. The one we're looking at only offers an API implementation via
> PHP modules, or via SOAP protocol. Unfortunately our host is
> extremely restrictive right now and did not --enable-soap and even
> did a --without-pear, so we can't even use the PEAR::SOAP package. Is
> there another implementation of SOAP or another way to possibly get
> SOAP going in such a restrictive environment?

i've downloaded PEAR packages before and used them manually.

all PEAR is is PHP object code modules in a central place. nothing
special, really.

you just have to tweak some script paths and you can use
include/require on the files like normal.

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



Re: [PHP] SOAP in PHP on very restricted host?

2007-09-25 Thread David Christopher Zentgraf

On  26. Sep 2007, at 13:19, mike wrote:


i've downloaded PEAR packages before and used them manually.

all PEAR is is PHP object code modules in a central place. nothing
special, really.

you just have to tweak some script paths and you can use
include/require on the files like normal.


That's what I thought, but PEAR::SOAP seems to depend on the PEAR  
base package. ...which I could probably install manually as well, I  
know.


But I just found out about NuSOAP (http://dietrich.ganx4.com/ 
nusoap/), which seems to be what I'm looking for, a no-strings- 
attached SOAP implementation. I'm trying my luck with this one for  
now. :)


Cheers,
Dav

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



[PHP] SOAP in PHP on very restricted host?

2007-09-25 Thread David Zentgraf

Hi,

We need to work with a credit card checking company for an online  
store. The one we're looking at only offers an API implementation via  
PHP modules, or via SOAP protocol. Unfortunately our host is  
extremely restrictive right now and did not --enable-soap and even  
did a --without-pear, so we can't even use the PEAR::SOAP package. Is  
there another implementation of SOAP or another way to possibly get  
SOAP going in such a restrictive environment?


If not we'll have to switch either the host or the CC company...

Best Regards,
Dav

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



Re: [PHP] SOAP in PHP on very restricted host?

2007-09-25 Thread Nathan Nobbe
i just read the first message in this thread and NuSoap immediately came to
mind.
though it will solve your problem you may end up like me, hating to use
NuSoap
under duress.  i think it was really popular back in th php4 days when there
was
nothing solid that could be built right into php.  anyway in my experience
its a
relic and i try to stay away from it if i can.

-nathan

On 9/26/07, David Christopher Zentgraf <[EMAIL PROTECTED]> wrote:
>
> On  26. Sep 2007, at 13:19, mike wrote:
>
> > i've downloaded PEAR packages before and used them manually.
> >
> > all PEAR is is PHP object code modules in a central place. nothing
> > special, really.
> >
> > you just have to tweak some script paths and you can use
> > include/require on the files like normal.
>
> That's what I thought, but PEAR::SOAP seems to depend on the PEAR
> base package. ...which I could probably install manually as well, I
> know.
>
> But I just found out about NuSOAP (http://dietrich.ganx4.com/
> nusoap/), which seems to be what I'm looking for, a no-strings-
> attached SOAP implementation. I'm trying my luck with this one for
> now. :)
>
> Cheers,
> Dav
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>