php-general Digest 13 Sep 2006 14:42:51 -0000 Issue 4345

2006-09-13 Thread php-general-digest-help

php-general Digest 13 Sep 2006 14:42:51 - Issue 4345

Topics (messages 241692 through 241711):

Re: Open file on a Mounted Share on Mac OS X
241692 by: Chris
241708 by: Rahul S. Johari

Re: Filter MS Word Garbage
241693 by: Paul Scott
241694 by: Michael B Allen

Affiliate system
241695 by: Peter Lauri
241697 by: Robert Cummings
241698 by: J R
241699 by: Andrei
241700 by: Peter Lauri

Re: FUNCTION TO CHECK IMAGE
241696 by: BBC

PHP and mySQL dates
241701 by: Dave Goodchild
241702 by: Peter Lauri
241703 by: Dave Goodchild
241704 by: Peter Lauri
241705 by: Dave Goodchild

USB Question Not PHP Related, so if you don't want to read this you don't have 
to
241706 by: Jay Blanchard
241707 by: benifactor
241709 by: tg-php.gryffyndevelopment.com
241711 by: tg-php.gryffyndevelopment.com

Re: DOM - parse HTML document [solved]
241710 by: tedd

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

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


--
---BeginMessage---

Rahul S. Johari wrote:

That was a good idea. I tried that... It was showing nothing for
/Volumes/foresight ... But it did show the contents of /Volumes... And
interestingly, 'foresight' was also listed there, but it's filetype was
blank... Others had like dir or link or file But foresight's
filetype had nothing in it!!


That'll be the problem. PHP doesn't see it as a valid type.

How is it mounted, through samba, through something else?

--
Postgresql  php tutorials
http://www.designmagick.com/
---End Message---
---BeginMessage---

Samba. It's an SMB share.


On 9/13/06 12:39 AM, Chris [EMAIL PROTECTED] wrote:

 Rahul S. Johari wrote:
 That was a good idea. I tried that... It was showing nothing for
 /Volumes/foresight ... But it did show the contents of /Volumes... And
 interestingly, 'foresight' was also listed there, but it's filetype was
 blank... Others had like dir or link or file But foresight's
 filetype had nothing in it!!
 
 That'll be the problem. PHP doesn't see it as a valid type.
 
 How is it mounted, through samba, through something else?

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com
---End Message---
---BeginMessage---

On Tue, 2006-09-12 at 15:02 -0700, Kevin Murphy wrote:
 Is there some way I can filter/convert this information before it  
 gets to the mysql database?

Best way to do this is to send it through catdoc. Not sure if the Word
upload is HTML(ish) or a Word doc, but if the latter, then catdoc is
your best bet.

http://www.45.free.net/~vitus/software/catdoc/

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 
---End Message---
---BeginMessage---
On Tue, 12 Sep 2006 15:02:08 -0700
Kevin Murphy [EMAIL PROTECTED] wrote:

 I have a web form where trusted people will be inputing information  
 that they usually copy/paste out of MS Word. While the people are  
 trusted... MS Word isn't. I keep getting garbage characters in there,  
 usually associated with Smart Quotes. If I take the content out of  
 the DB, throw it into BBEdit and use the convert to ASCII command  
 that solves the problem.

Iterate of each character (byte) and use chr(b) to get the numeric
value. If that value is less than 128 the character is ASCII. Otherwise
it is not. Based on that, it would be very easy to write a function to
strip all non-ASCII characters.

However, you might consider giving people back exactly what they
submitted. Meaning when storing the fragment use mysql_escape_string()
or equivalent and then when the HTML field use htmlentities() to escape
any special HTML character. That might preserve formatting information
embedded in the clipboard fragment (if that's something you want).

Mike

-- 
Michael B Allen
PHP Active Directory SSO
http://www.ioplex.com/
---End Message---
---BeginMessage---
Hi guys,

I am reviewing an affiliate system that I created a while ago. I am using a
very simple method to do this, but I am curious if there is any better
system (better I mean less missed affiliate purchases).

1. User click on affiliate link http://thedomain.com/?a=1234
2. The if $_GET['a'] is set, we check if that is an valid affiliate, and
then set a cookie for that
3. At purchase, we check if that cookie still is there, if so, we register
it as a affiliate purchase and that info is stored in the purchase database

What should I do if they do not allow cookies? I could amend a=1234 onto
every url that they pass, but that would not be a 

Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-13 Thread BBC

BBC wrote:

What types of images are these? JPG, PNG, GIF?
Its jpg. Look... I don't know exactly what your point, 
I'm just asking you about the function to resolve the 
size of image like the

codes below:
if (file_exists($img_path)){
list($width,$height) = getimagesizes($img_path);
}else{
$width = $ height = $max_size;
}
So is there any other option to replace file_exists();?



Well, if I do remember correctly, then you are uploading 
a file. If
that's the case, then rather than using file_exists() 
you should be
using is_uploaded_file. Once you've verified that 
is_uploaded_file()
returns true, then use move_uploaded_file() to move the 
file to
someplace on your filesystem. If that returns true, then 
you should not
have to check file_exists again and just be able to use 
get getimagesize().


So, a good function for this would probably be:

function getUploadedImageSize($image, $to_path) {
global $max_size;

$width = $height = $max_size;

if (is_uploaded_file($image)) {
if (move_uploaded_file($image, $to_path)) {
list($width,$height) = getimagesize($to_path);
}
}

return array($width, $height);
}

list($width, $height) = getUploadedImageSize($tmp, 
'/the/final/path');


BTW, I don't know if you did a copy and paste from your 
code or if you
just typed it in really quickly, but you do have a few 
syntactical
errors in the code above. First, the image sizing 
function is
getimagesize - singular, not plural. Second, in your 
assignment
statement, you have a space where there should not be 
one:


$width = $ height = $max_size;
 ^

Just wanted to make sure you knew about that in case it 
was copied and

pasted.


thank you for your input, it really helps.

Semarakkan kemerdekaan RI ke 61 th dengan ikut bermain netkuis 17-an di 
http://netkuis.telkom.net/17an/

Kumpulkan poin sebanyak-banyaknya. Dan siap-siap tunggu rejeki dari sponsor 
kami.

 


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



Re: [PHP] Affiliate system

2006-09-13 Thread Robert Cummings
On Wed, 2006-09-13 at 12:58 +0700, Peter Lauri wrote:
 Hi guys,
 
 I am reviewing an affiliate system that I created a while ago. I am using a
 very simple method to do this, but I am curious if there is any better
 system (better I mean less missed affiliate purchases).
 
 1. User click on affiliate link http://thedomain.com/?a=1234
 2. The if $_GET['a'] is set, we check if that is an valid affiliate, and
 then set a cookie for that
 3. At purchase, we check if that cookie still is there, if so, we register
 it as a affiliate purchase and that info is stored in the purchase database
 
 What should I do if they do not allow cookies? I could amend a=1234 onto
 every url that they pass, but that would not be a beautiful solution.
 
 Maybe I can also create a SESSION that stores the affiliate information so
 that it at least get registered if the purchase is completed within the
 session?

Sessions and temporary cookies solve the same issue (even if sessions
are using trans sid). If a user has cookies disabled then you can rely
on the trans sid feature which already performs the propagation of the
session via URLs as you have suggested. Failing that, you don't really
have any alternatives :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Affiliate system

2006-09-13 Thread J R

use session. or you can store it in a database but that will take speed. :)

using session is much better rather than using cookies for lots of reason
(just google) specially if you are concered with security.

just my 2cents.

hth,
john

p.s.

if the client cookies is disabled set to true the session.use_trans_id.

On 9/13/06, Robert Cummings [EMAIL PROTECTED] wrote:


On Wed, 2006-09-13 at 12:58 +0700, Peter Lauri wrote:
 Hi guys,

 I am reviewing an affiliate system that I created a while ago. I am
using a
 very simple method to do this, but I am curious if there is any better
 system (better I mean less missed affiliate purchases).

 1. User click on affiliate link http://thedomain.com/?a=1234
 2. The if $_GET['a'] is set, we check if that is an valid affiliate, and
 then set a cookie for that
 3. At purchase, we check if that cookie still is there, if so, we
register
 it as a affiliate purchase and that info is stored in the purchase
database

 What should I do if they do not allow cookies? I could amend a=1234 onto
 every url that they pass, but that would not be a beautiful solution.

 Maybe I can also create a SESSION that stores the affiliate information
so
 that it at least get registered if the purchase is completed within the
 session?

Sessions and temporary cookies solve the same issue (even if sessions
are using trans sid). If a user has cookies disabled then you can rely
on the trans sid feature which already performs the propagation of the
session via URLs as you have suggested. Failing that, you don't really
have any alternatives :)

Cheers,
Rob.
--
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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





--
GMail Rocks!!!


Re: [PHP] Affiliate system

2006-09-13 Thread Andrei

I ran into same issue with a site... I solved this problem by saving
information in 2 places (in cookies and in database). So when saving
data once I saved in the cookie then into database. When I wanted to
read the information I first check if cookie exist and if it doesn't I
read from database.

Andy

Peter Lauri wrote:
 Hi guys,
 
 I am reviewing an affiliate system that I created a while ago. I am using a
 very simple method to do this, but I am curious if there is any better
 system (better I mean less missed affiliate purchases).
 
 1. User click on affiliate link http://thedomain.com/?a=1234
 2. The if $_GET['a'] is set, we check if that is an valid affiliate, and
 then set a cookie for that
 3. At purchase, we check if that cookie still is there, if so, we register
 it as a affiliate purchase and that info is stored in the purchase database
 
 What should I do if they do not allow cookies? I could amend a=1234 onto
 every url that they pass, but that would not be a beautiful solution.
 
 Maybe I can also create a SESSION that stores the affiliate information so
 that it at least get registered if the purchase is completed within the
 session?
 
 What do you think is the best way?
 
 Best regards, 
 Peter Lauri
 
 www.lauri.se - personal web site
 www.dwsasia.com - company web site
 

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



RE: [PHP] Affiliate system

2006-09-13 Thread Peter Lauri
That is probably what I will do. Thanks for your comment.

-Original Message-
From: Andrei [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 13, 2006 2:43 PM
To: [php] PHP General List
Subject: Re: [PHP] Affiliate system


I ran into same issue with a site... I solved this problem by saving
information in 2 places (in cookies and in database). So when saving
data once I saved in the cookie then into database. When I wanted to
read the information I first check if cookie exist and if it doesn't I
read from database.

Andy

Peter Lauri wrote:
 Hi guys,
 
 I am reviewing an affiliate system that I created a while ago. I am using
a
 very simple method to do this, but I am curious if there is any better
 system (better I mean less missed affiliate purchases).
 
 1. User click on affiliate link http://thedomain.com/?a=1234
 2. The if $_GET['a'] is set, we check if that is an valid affiliate, and
 then set a cookie for that
 3. At purchase, we check if that cookie still is there, if so, we register
 it as a affiliate purchase and that info is stored in the purchase
database
 
 What should I do if they do not allow cookies? I could amend a=1234 onto
 every url that they pass, but that would not be a beautiful solution.
 
 Maybe I can also create a SESSION that stores the affiliate information so
 that it at least get registered if the purchase is completed within the
 session?
 
 What do you think is the best way?
 
 Best regards, 
 Peter Lauri
 
 www.lauri.se - personal web site
 www.dwsasia.com - company web site
 

-- 
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



[PHP] PHP and mySQL dates

2006-09-13 Thread Dave Goodchild

Hi all. I am building an online events registry and have mapped out all the
dates between Oct 1 2006 and Dec 31 2030, stored in the database as
timestamps incremented by 86400 to give daily slots. I have output the
values using the php date function and all is well. Users can enter either
one-off or regular events, and I am using a mapping table to tie events to
dates as they comprise a many-to-many relationship.

I am struggling with some date conversions, however. When a user enters a
single event for example, the data is entered into the events table, the
inserted id captured, and then the system will look for the relevant record
in the dates table, and eventually enter the event id and date id into the
mapping table for later joins during the search process.

To do this, I call:

$date_string =
mktime(0,0,0,$_SESSION['month],$_SESSION['day'],$_SESSION['year'])

to assemble a timestamp from the supplied user data, and now I need to look
for the matching date in the dates table. My problem is in converting
between UNIX and mySQL timestamp values. My first attempt to match used this
(query extract):

SELECT id FROM dates WHERE FROM_UNIXTIME($date_string) = date

then

SELECT id FROM dates WHERE UNIX_TIMESTAMP(date) = $date_string

neither is working. Am I making some fundamental error here or missing
something? Any help appreciated!

--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk


RE: [PHP] PHP and mySQL dates

2006-09-13 Thread Peter Lauri
[snip]
Hi all. I am building an online events registry and have mapped out all the
dates between Oct 1 2006 and Dec 31 2030, stored in the database as
timestamps incremented by 86400 to give daily slots. 
[/snip]

I do not really understand the purpose of mapping all dates between Oct 1
2006 and Dec 31 2030 and store them into a database as a timestamp. First of
all, a date is a date, not a timestamp. A timestamp is date and time
together.

Why don't you just save the events with the date as DATE format and then
compare them with CURDATE() or similar. Or just with $_SESSION[year]-
$_SESSION[month]- $_SESSION[day]

Just some thoughts.

/Peter

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



Re: [PHP] PHP and mySQL dates

2006-09-13 Thread Dave Goodchild

Thanks. I have been so up close and personal with this that I can't see the
wood for the trees. Of course, so obvious. Thank you - you have made me very
happy.







--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk


RE: [PHP] PHP and mySQL dates

2006-09-13 Thread Peter Lauri
No problem, now I will go and make my girlfriend happy :)

-Original Message-
From: Dave Goodchild [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 13, 2006 6:27 PM
To: Peter Lauri
Cc: PHP General
Subject: Re: [PHP] PHP and mySQL dates

Thanks. I have been so up close and personal with this that I can't see the
wood for the trees. Of course, so obvious. Thank you - you have made me very
happy.





-- 
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk

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



Re: [PHP] PHP and mySQL dates

2006-09-13 Thread Dave Goodchild

Good luck with that.






--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk





--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk


[PHP] USB Question Not PHP Related, so if you don't want to read this you don't have to

2006-09-13 Thread Jay Blanchard
I generally would not do this, but I have an urgent need and this group
has seen everything; I need two USB ports on a system to have the same
channel. I continue to STFW but have not come upon something like this
yet. The application is for softphones in a call center environment, the
headsets to be used are USB headsets...having two USB ports on the same
channel would allow supervisors to plug-in and listen to a call with a
call center rep. Anyone heard of anything like this? I appreciate any
clues and nuggets.

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



Re: [PHP] USB Question Not PHP Related, so if you don't want to read this you don't have to

2006-09-13 Thread benifactor
you should try to search for a headset with a splitter. i dont know if this
would work for your needs, but it would allow multiple connectons and
require only one port.

- Original Message - 
From: Jay Blanchard [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Wednesday, September 13, 2006 4:59 AM
Subject: [PHP] USB Question Not PHP Related, so if you don't want to read
this you don't have to


I generally would not do this, but I have an urgent need and this group
has seen everything; I need two USB ports on a system to have the same
channel. I continue to STFW but have not come upon something like this
yet. The application is for softphones in a call center environment, the
headsets to be used are USB headsets...having two USB ports on the same
channel would allow supervisors to plug-in and listen to a call with a
call center rep. Anyone heard of anything like this? I appreciate any
clues and nuggets.

-- 
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] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Rahul S. Johari

Samba. It's an SMB share.


On 9/13/06 12:39 AM, Chris [EMAIL PROTECTED] wrote:

 Rahul S. Johari wrote:
 That was a good idea. I tried that... It was showing nothing for
 /Volumes/foresight ... But it did show the contents of /Volumes... And
 interestingly, 'foresight' was also listed there, but it's filetype was
 blank... Others had like dir or link or file But foresight's
 filetype had nothing in it!!
 
 That'll be the problem. PHP doesn't see it as a valid type.
 
 How is it mounted, through samba, through something else?

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] USB Question Not PHP Related, so if you don't want to read this you don't have to

2006-09-13 Thread tg-php
We have a similar (and still non-PHP related) issue at work where we want to do 
the call may be monitored for quality assurance thing on the new phone system 
we just got.  Our old phone system was analog and provided for this feature.  
The new system is a Cisco IP Phone deal which is really really 
cool/nice/wicked/whatever, but doesn't allow us to do the call intercept 
in-house.

There IS something you can get for our system that taps directly into the 
server and allows call monitoring that way though.

I don't know what system you have, but if it's a 'soft phone' then I'm guessing 
there's a server involved and your system may have some allowances for call 
interception at the server level.  I guess in that case, your supervisor types 
would plug their soft phones into their own USB ports and run software that'd 
allow them to select which phone to monitor and get the data directly from the 
server.

I don't know if USB allows 'splitting' in a fashion that would be useful to 
what you're trying to do.  There may be too much two-way communication and 
you'd have two USB soft phones competing for Mom's attention at the same time.  
Not saying it's impossible, just don't know how that'd work.

If you post more info on what system you have (if you can) maybe someone knows 
some specifics for that particular system.

-TG

= = = Original message = = =

I generally would not do this, but I have an urgent need and this group
has seen everything; I need two USB ports on a system to have the same
channel. I continue to STFW but have not come upon something like this
yet. The application is for softphones in a call center environment, the
headsets to be used are USB headsets...having two USB ports on the same
channel would allow supervisors to plug-in and listen to a call with a
call center rep. Anyone heard of anything like this? I appreciate any
clues and nuggets.

___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] DOM - parse HTML document [solved]

2006-09-13 Thread tedd

At 12:07 AM +0200 9/13/06, Leonidas Safran wrote:

Hello all,

I have found a way...

$doc = new DomDocument();
$doc-loadHTMLFile($source[url]);

$elements = $doc-getElementsByTagName(tr);

$i = 0;

while( $elements-item($i) ){
if( $elements-item($i)-hasAttributes()  
preg_match(/td[0|1]/,$elements-item($i)-getAttribute(id))  0 
){

  echo $elements-item($i)-nodeValue . br /;
  }
  $i++;
}

Works like i want...


Regards,

LS



Interesting -- it doesn't work for me. I keep getting --

Parse error: parse error, unexpected T_OBJECT_OPERATOR

-- in your if statement. But, I don't see the problem.

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] USB Question Not PHP Related, so if you don't want to read this you don't have to

2006-09-13 Thread tg-php
Sorry, misread the splitter comment earlier.  A splitter pre-USB off of the 
headset or phone-unit somewhere may work too.

-TG


= = = Original message = = =

We have a similar (and still non-PHP related) issue at work where we want to do 
the call may be monitored for quality assurance thing on the new phone system 
we just got.  Our old phone system was analog and provided for this feature.  
The new system is a Cisco IP Phone deal which is really really 
cool/nice/wicked/whatever, but doesn't allow us to do the call intercept 
in-house.

There IS something you can get for our system that taps directly into the 
server and allows call monitoring that way though.

I don't know what system you have, but if it's a 'soft phone' then I'm guessing 
there's a server involved and your system may have some allowances for call 
interception at the server level.  I guess in that case, your supervisor types 
would plug their soft phones into their own USB ports and run software that'd 
allow them to select which phone to monitor and get the data directly from the 
server.

I don't know if USB allows 'splitting' in a fashion that would be useful to 
what you're trying to do.  There may be too much two-way communication and 
you'd have two USB soft phones competing for Mom's attention at the same time.  
Not saying it's impossible, just don't know how that'd work.

If you post more info on what system you have (if you can) maybe someone knows 
some specifics for that particular system.

-TG

= = = Original message = = =

I generally would not do this, but I have an urgent need and this group
has seen everything; I need two USB ports on a system to have the same
channel. I continue to STFW but have not come upon something like this
yet. The application is for softphones in a call center environment, the
headsets to be used are USB headsets...having two USB ports on the same
channel would allow supervisors to plug-in and listen to a call with a
call center rep. Anyone heard of anything like this? I appreciate any
clues and nuggets.

___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread John Nichel

Rahul S. Johari wrote:

Samba. It's an SMB share.


On 9/13/06 12:39 AM, Chris [EMAIL PROTECTED] wrote:


Rahul S. Johari wrote:

That was a good idea. I tried that... It was showing nothing for
/Volumes/foresight ... But it did show the contents of /Volumes... And
interestingly, 'foresight' was also listed there, but it's filetype was
blank... Others had like dir or link or file But foresight's
filetype had nothing in it!!

That'll be the problem. PHP doesn't see it as a valid type.

How is it mounted, through samba, through something else?




So it doesn't look like this...


[EMAIL PROTECTED] staging]# ls -al
total 16
drwxr-xr-x  3 root root 4096 Sep 13 10:44 .
drwxr-xr-x  3 root root 4096 Sep 13 10:44 ..
drwxr-xr-x  1 root root 4096 Sep 13 10:46 webserver


webserver is a smb mount on my (Linux) machine.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



[PHP] Re: USB Question Not PHP Related, so if you don't want to read this you don't have to

2006-09-13 Thread Colin Guthrie
Jay Blanchard wrote:
 I generally would not do this, but I have an urgent need and this group
 has seen everything; I need two USB ports on a system to have the same
 channel. I continue to STFW but have not come upon something like this
 yet. The application is for softphones in a call center environment, the
 headsets to be used are USB headsets...having two USB ports on the same
 channel would allow supervisors to plug-in and listen to a call with a
 call center rep. Anyone heard of anything like this? I appreciate any
 clues and nuggets.
 

You'd be better hooking into a SIP/VoIP system with e.g. Asterisk at the
backend and you can then configure it to spy on the channels/record the
channel contents etc.

This would then work regardless of the hardware used (USB Headsets, SIP
Softphones etc.).

Hope that helps.

Col.

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



[PHP] Re: PHP and mySQL dates

2006-09-13 Thread Colin Guthrie

 SELECT id FROM dates WHERE FROM_UNIXTIME($date_string) = date
 
 then
 
 SELECT id FROM dates WHERE UNIX_TIMESTAMP(date) = $date_string
 
 neither is working. Am I making some fundamental error here or missing
 something? Any help appreciated!

I know yui've alreayd solved this, but for what it's worth, the first
form of statement is preferred to the second.

In the second you are applying a MYSQL function to a field which will
have to be repeated many times, in the first, you are applying a MYSQL
function to a constant which only has to be computed once.

Even now you have the solution, it may be worth considering the order of
your check and if possible use the MYSQL function ont he constant not
the field to get the additional performance gain.

Col.

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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread John Nichel

Rahul S. Johari wrote:

Nope.
It looks like this...


drwxr-xr-x  3 root root 4096 Sep 13 10:44 .
drwxr-xr-x  3 root root 4096 Sep 13 10:46 ..
drwx--  1 rjohari  admin  16384 13 Sep 10:38 foresight

Foresight being the mounted share.



Does your webserver run as the user 'rjohari'?

*permission light bulb*

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Rahul S. Johari

I'm beginning to see it's a permissions issue... Although I don't know how
to approach it, as like I said, I have every permission you can think of set
to this mac os x user.

 Does your webserver run as the user 'rjohari'?

When you say webserver, are you talking about my Apache Web Server, or the
mounted share called foresight ?



On 9/13/06 11:30 AM, John Nichel [EMAIL PROTECTED] wrote:

 Rahul S. Johari wrote:
 Nope.
 It looks like this...
 
 
 drwxr-xr-x  3 root root 4096 Sep 13 10:44 .
 drwxr-xr-x  3 root root 4096 Sep 13 10:46 ..
 drwx--  1 rjohari  admin  16384 13 Sep 10:38 foresight
 
 Foresight being the mounted share.
 
 
 Does your webserver run as the user 'rjohari'?
 
 *permission light bulb*

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Ray Hauge
On Wednesday 13 September 2006 10:30, John Nichel wrote:
 Rahul S. Johari wrote:
  Nope.
  It looks like this...
 
 
  drwxr-xr-x  3 root root 4096 Sep 13 10:44 .
  drwxr-xr-x  3 root root 4096 Sep 13 10:46 ..
  drwx--  1 rjohari  admin  16384 13 Sep 10:38 foresight
 
  Foresight being the mounted share.

 Does your webserver run as the user 'rjohari'?

 *permission light bulb*

 --
 John C. Nichel IV
 Programmer/System Admin (ÜberGeek)
 Dot Com Holdings of Buffalo
 716.856.9675
 [EMAIL PROTECTED]

nice catch.

My suggestion would be to change the group to the group the webserver runs as 
(nobody, www, etc.) and allow read and write access to the group level as 
well.  That should solve your problem.

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread John Nichel

Rahul S. Johari wrote:

How can I set the drwxr-xr-x permissions on my mounted share? I've set
everything I possibly could in the windows 2003 server to give the mac os x
user full control!



man mount

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread John Nichel

Rahul S. Johari wrote:

I'm beginning to see it's a permissions issue... Although I don't know how
to approach it, as like I said, I have every permission you can think of set
to this mac os x user.


Does your webserver run as the user 'rjohari'?


When you say webserver, are you talking about my Apache Web Server, or the
mounted share called foresight ?



Apache runs as a pre-specified user (usually nobody) and group, and 
adheres to the permission level of that user/group.  Look in your 
httpd.conf for what these values are.  You *could* change how Apache 
runs, but I would leave that as is, and give Apache access to only the 
areas it needs access to (ie permissions on dirs and files).


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



[PHP] How to skip browser's Warning?

2006-09-13 Thread afan
Hi,
Could somebody explain to me what to do to skip this message I'm getting
after I search for some products on my page, got the list of products,
selected a detailed view of the product and click on the Back button of
the browser to see again list of found products (result page):
The Page you are trying to view contains POSTDATA that has expired from
cache. If you resend the data, any action the form carried out such as a
search or online purchase) will be repeated. To resend the data, click OK.
Otherwise, click Cancel.

Thanks for any help.

-afan

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



Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread John Nichel

[EMAIL PROTECTED] wrote:

Hi,
Could somebody explain to me what to do to skip this message I'm getting
after I search for some products on my page, got the list of products,
selected a detailed view of the product and click on the Back button of
the browser to see again list of found products (result page):
The Page you are trying to view contains POSTDATA that has expired from
cache. If you resend the data, any action the form carried out such as a
search or online purchase) will be repeated. To resend the data, click OK.
Otherwise, click Cancel.



Don't click the back button.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread Joe Wollard
Easiest way: change your search form's method to GET instead of POST  
- I'm sure you're not passing enough parameters to the search results  
page to actually need to use POST.



On Sep 13, 2006, at 11:44 AM, [EMAIL PROTECTED] wrote:


Hi,
Could somebody explain to me what to do to skip this message I'm  
getting

after I search for some products on my page, got the list of products,
selected a detailed view of the product and click on the Back  
button of

the browser to see again list of found products (result page):
The Page you are trying to view contains POSTDATA that has expired  
from
cache. If you resend the data, any action the form carried out such  
as a
search or online purchase) will be repeated. To resend the data,  
click OK.

Otherwise, click Cancel.

Thanks for any help.

-afan

--
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] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Rahul S. Johari

Been reading and reading... Can't get much out of it.
Everytime I try the mount command, I get can't get net id


On 9/13/06 11:39 AM, John Nichel [EMAIL PROTECTED] wrote:

 Rahul S. Johari wrote:
 How can I set the drwxr-xr-x permissions on my mounted share? I've set
 everything I possibly could in the windows 2003 server to give the mac os x
 user full control!
 
 
 man mount

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Ray Hauge
On Wednesday 13 September 2006 10:58, Rahul S. Johari wrote:
 Been reading and reading... Can't get much out of it.
 Everytime I try the mount command, I get can't get net id

 On 9/13/06 11:39 AM, John Nichel [EMAIL PROTECTED] wrote:
  Rahul S. Johari wrote:
  How can I set the drwxr-xr-x permissions on my mounted share? I've set
  everything I possibly could in the windows 2003 server to give the mac
  os x user full control!
 
  man mount

 Rahul S. Johari
 Supervisor, Internet  Administration
 Informed Marketing Services Inc.
 500 Federal Street, Suite 201
 Troy NY 12180

 Tel: (518) 687-6700 x154
 Fax: (518) 687-6799
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com

You could just try using chmod to change the permissions of the folder.  It 
might not stick after a reboot, but it'll get you working in the mean time.

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

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



Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread Eric Butera

On 9/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


Hi,
Could somebody explain to me what to do to skip this message I'm getting
after I search for some products on my page, got the list of products,
selected a detailed view of the product and click on the Back button of
the browser to see again list of found products (result page):
The Page you are trying to view contains POSTDATA that has expired from
cache. If you resend the data, any action the form carried out such as a
search or online purchase) will be repeated. To resend the data, click OK.
Otherwise, click Cancel.

Thanks for any help.

-afan

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

If you add a header redirect [header('Location:');] after your script

processes the POST data you can avoid this.


Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Rahul S. Johari

I tried the chmod command in the Terminal Window, but I'm not really getting
the exact command that I need to change the permissions.


On 9/13/06 12:08 PM, Ray Hauge [EMAIL PROTECTED] wrote:

 On Wednesday 13 September 2006 10:58, Rahul S. Johari wrote:
 Been reading and reading... Can't get much out of it.
 Everytime I try the mount command, I get can't get net id
 
 On 9/13/06 11:39 AM, John Nichel [EMAIL PROTECTED] wrote:
 Rahul S. Johari wrote:
 How can I set the drwxr-xr-x permissions on my mounted share? I've set
 everything I possibly could in the windows 2003 server to give the mac
 os x user full control!
 
 man mount
 
 Rahul S. Johari
 Supervisor, Internet  Administration
 Informed Marketing Services Inc.
 500 Federal Street, Suite 201
 Troy NY 12180
 
 Tel: (518) 687-6700 x154
 Fax: (518) 687-6799
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com
 
 You could just try using chmod to change the permissions of the folder.  It
 might not stick after a reboot, but it'll get you working in the mean time.

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread afan
:D :D :D

How to get back then?


 [EMAIL PROTECTED] wrote:
 Hi,
 Could somebody explain to me what to do to skip this message I'm getting
 after I search for some products on my page, got the list of products,
 selected a detailed view of the product and click on the Back button of
 the browser to see again list of found products (result page):
 The Page you are trying to view contains POSTDATA that has expired from
 cache. If you resend the data, any action the form carried out such as a
 search or online purchase) will be repeated. To resend the data, click
 OK.
 Otherwise, click Cancel.


 Don't click the back button.

 --
 John C. Nichel IV
 Programmer/System Admin (ÜberGeek)
 Dot Com Holdings of Buffalo
 716.856.9675
 [EMAIL PROTECTED]

 --
 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] How to skip browser's Warning?

2006-09-13 Thread afan
Sonce nothing secretly - I can' do that.
I'll try right now.


 Easiest way: change your search form's method to GET instead of POST
 - I'm sure you're not passing enough parameters to the search results
 page to actually need to use POST.


 On Sep 13, 2006, at 11:44 AM, [EMAIL PROTECTED] wrote:

 Hi,
 Could somebody explain to me what to do to skip this message I'm
 getting
 after I search for some products on my page, got the list of products,
 selected a detailed view of the product and click on the Back
 button of
 the browser to see again list of found products (result page):
 The Page you are trying to view contains POSTDATA that has expired
 from
 cache. If you resend the data, any action the form carried out such
 as a
 search or online purchase) will be repeated. To resend the data,
 click OK.
 Otherwise, click Cancel.

 Thanks for any help.

 -afan

 --
 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




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



Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread afan
sorry, but didn't get this one. could you please elaborate it a little bi
to me?

thanks.



 On 9/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hi,
 Could somebody explain to me what to do to skip this message I'm getting
 after I search for some products on my page, got the list of products,
 selected a detailed view of the product and click on the Back button of
 the browser to see again list of found products (result page):
 The Page you are trying to view contains POSTDATA that has expired from
 cache. If you resend the data, any action the form carried out such as a
 search or online purchase) will be repeated. To resend the data, click
 OK.
 Otherwise, click Cancel.

 Thanks for any help.

 -afan

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

 If you add a header redirect [header('Location:');] after your script
 processes the POST data you can avoid this.


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



[PHP] Problems with date()

2006-09-13 Thread Arno Kuhl
I hope someone can help with this.

I'm trying to find the week number of the last week of the year.
I have the following code snippet:

$lastday = strtotime(31 December .$year);
$lastdate = date(Y-m-d, $lastday);  // for testing
$lastweek = date(W, $lastday);

I put the $lastdate line in because I was convinced that $lastday must be
wrong, but it's correct!

When $year is 2000 I get an expected $lastweek of 52.
When $year is 2001, 2002, or 2003 the $lastweek is 01!
When $year is 2004 $lastweek is 53.
When $year is 2005 $lastweek is 52.

I haven't checked further than 2005.

Why do I get the weird lastweek values for 2001, 2002, and 2003?
I'm using PHP 4.3.4 on Win2000.

Arno

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



Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread tg-php
Create your own back button that re-posts the same data back to the search 
page?

Or have a new search (that takes you back without filling in the old search 
data) as well as a revise search or something that takes you back without 
while retaining the original search data.

Or do like someone said and put your search variables in a GET variable instead 
(if it's secure enough and if you don't have 500 search variables).

Or store the search data in a $_SESSION or $_COOKIE or in the database 
associated with the user's SESSIONID.

Lots of ways.

-TG

= = = Original message = = =

:D :D :D

How to get back then?


 [EMAIL PROTECTED] wrote:
 Hi,
 Could somebody explain to me what to do to skip this message I'm getting
 after I search for some products on my page, got the list of products,
 selected a detailed view of the product and click on the Back button of
 the browser to see again list of found products (result page):
 The Page you are trying to view contains POSTDATA that has expired from
 cache. If you resend the data, any action the form carried out such as a
 search or online purchase) will be repeated. To resend the data, click
 OK.
 Otherwise, click Cancel.


 Don't click the back button.

 --
 John C. Nichel IV
 Programmer/System Admin (~berGeek)
 Dot Com Holdings of Buffalo
 716.856.9675
 [EMAIL PROTECTED]

 --
 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


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread tg-php
Create your own back button that re-posts the same data back to the search 
page?

Or have a new search (that takes you back without filling in the old search 
data) as well as a revise search or something that takes you back without 
while retaining the original search data.

Or do like someone said and put your search variables in a GET variable instead 
(if it's secure enough and if you don't have 500 search variables).

Or store the search data in a $_SESSION or $_COOKIE or in the database 
associated with the user's SESSIONID.

Lots of ways.

-TG

= = = Original message = = =

:D :D :D

How to get back then?


 [EMAIL PROTECTED] wrote:
 Hi,
 Could somebody explain to me what to do to skip this message I'm getting
 after I search for some products on my page, got the list of products,
 selected a detailed view of the product and click on the Back button of
 the browser to see again list of found products (result page):
 The Page you are trying to view contains POSTDATA that has expired from
 cache. If you resend the data, any action the form carried out such as a
 search or online purchase) will be repeated. To resend the data, click
 OK.
 Otherwise, click Cancel.


 Don't click the back button.

 --
 John C. Nichel IV
 Programmer/System Admin (~berGeek)
 Dot Com Holdings of Buffalo
 716.856.9675
 [EMAIL PROTECTED]

 --
 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


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



[PHP] array_flip duplicate keys as arrays

2006-09-13 Thread Richard Lynch
I figured somebody else must have needed this, so there'd have to be a
PHP function for it...

But I'm not finding it when I rtfm...

Given an array like this:

$t9 = array('F' = 'FIND', 'D' = 'FIND', 'E' ='FIND', 'H' = 'HELP',
'I' = 'HELP');

I'm looking for a built-in function that returns this:
array('FIND' = array('F', 'D', 'E'), 'HELP'=array('H', 'I'))

Or maybe I'm the only goofball that needs this?

Obviously I can write it with a loop.

But is there some quick built-in function I'm missing?

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Question on explode and join.

2006-09-13 Thread Beauford
Hi,

I have a form which I want to check for inappropriate words before it is
posted. I have used explode to put the string into an array using a space as
the delimiter and then I check it against another array that contains the
inappropriate words.
I then replace the inappropriate words with *'s and join the array back into
a string.

This works perfectly except for one thing.

If the word in the string has a any kind of punctuation after it (period,
comma) it won't be matched.

So if  moron is an inappropriate word then you are a moron works, but you
are a moron. won't.

Any ideas?

Thanks

This is my code.

function badwords($string) {

$language = array(contains the inappropriate words);

$words = explode( ,$string); 
$count = count(explode( , $string)); 

for($i = 0; $i  $count; $i++) {
if(in_array(strtolower($words[$i]), $language)) {
$words[$i] = *;
}
}

$newcomments = join( ,$words);

return $newcomments;
}


Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread Eric Butera

On 9/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


sorry, but didn't get this one. could you please elaborate it a little bi
to me?

thanks.



 On 9/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hi,
 Could somebody explain to me what to do to skip this message I'm
getting
 after I search for some products on my page, got the list of products,
 selected a detailed view of the product and click on the Back button of
 the browser to see again list of found products (result page):
 The Page you are trying to view contains POSTDATA that has expired
from
 cache. If you resend the data, any action the form carried out such as
a
 search or online purchase) will be repeated. To resend the data, click
 OK.
 Otherwise, click Cancel.

 Thanks for any help.

 -afan

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

 If you add a header redirect [header('Location:');] after your script
 processes the POST data you can avoid this.


Sure..


Say you have form.php.  This page will post to process.php. (Just an
example.  Having form.php post to itself is fine too and how I always do my
forms since on error I redisplay them with filled values)

Inside process.php you might have something like

?php
if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
   //do processing here
   if ( success ) {
   header('Location: http://example.com/thanks.php');
   } else {
   header('Location: http://example.com/form.php');
   } // if
} // if

session_write_close(); // if you're using sessions
exit();
?

Now when your form posts to process, your script will either go back to the
form.php on error, or thanks.php on success.  Because process.php issues a
redirect, this tells the browser to ignore process.php in the history it
saves.  If a user clicks the back button it will go to form.php because
process.php returned a 403 header and was ignored for lack of a better
word.

Hope that helps!


Re: [PHP] Question on explode and join.

2006-09-13 Thread Dave Goodchild

Hi. I have just added a profanity filter to a current project which runs
like so (all form values are passed into the session after checking for
required fields etc). $swearbox is an array containing profanities so I
won't include it here!

$_SESSION['profane'] = false;

   foreach ($_POST as $value) {
   foreach ($swearbox as $profanity) {
   if (preg_match(/$profanity/i, $value)) {
   $errors = true;
   $_SESSION['profane'] = true;
   mail(TECHEMAIL, 'profane content attack attempt on DJST', From:
{$_SERVER['REMOTE_ADDRESS']} Time:  . date('d F Y G:i:s', time()-TIMEDIFF),
'[EMAIL PROTECTED]');
   }
   }
   }

...if $errors is true at the end of processing I send the user back to the
form. In this instance if there are rude words $_SESSION['profane'] is set
and we warn the user.







--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk


Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread Eric Butera

On 9/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


Wouldn't this actually bring me back to empty form?


 On 9/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 sorry, but didn't get this one. could you please elaborate it a little
 bi
 to me?

 thanks.



  On 9/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
  Hi,
  Could somebody explain to me what to do to skip this message I'm
 getting
  after I search for some products on my page, got the list of
 products,
  selected a detailed view of the product and click on the Back button
 of
  the browser to see again list of found products (result page):
  The Page you are trying to view contains POSTDATA that has expired
 from
  cache. If you resend the data, any action the form carried out such
 as
 a
  search or online purchase) will be repeated. To resend the data,
 click
  OK.
  Otherwise, click Cancel.
 
  Thanks for any help.
 
  -afan
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
  If you add a header redirect [header('Location:');] after your
script
  processes the POST data you can avoid this.
 

 Sure..

 Say you have form.php.  This page will post to process.php. (Just an
 example.  Having form.php post to itself is fine too and how I always do
 my
 forms since on error I redisplay them with filled values)

 Inside process.php you might have something like

 ?php
 if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
 //do processing here
 if ( success ) {
 header('Location: http://example.com/thanks.php');
 } else {
 header('Location: http://example.com/form.php');
 } // if
 } // if

 session_write_close(); // if you're using sessions
 exit();
 ?

 Now when your form posts to process, your script will either go back to
 the
 form.php on error, or thanks.php on success.  Because process.php issues
a
 redirect, this tells the browser to ignore process.php in the history it
 saves.  If a user clicks the back button it will go to form.php because
 process.php returned a 403 header and was ignored for lack of a better
 word.

 Hope that helps!




Yes, but I was leaving up to you to fill in the blanks for your
implementation.  An easy way to handle this is to stick the sanitized post
values into the session and go wherever you need to.


Re: [PHP] Question on explode and join.

2006-09-13 Thread Eric Butera

On 9/13/06, Beauford [EMAIL PROTECTED] wrote:


Hi,

I have a form which I want to check for inappropriate words before it is
posted. I have used explode to put the string into an array using a space
as
the delimiter and then I check it against another array that contains the
inappropriate words.
I then replace the inappropriate words with *'s and join the array back
into
a string.

This works perfectly except for one thing.

If the word in the string has a any kind of punctuation after it (period,
comma) it won't be matched.

So if  moron is an inappropriate word then you are a moron works, but
you
are a moron. won't.

Any ideas?

Thanks

This is my code.

function badwords($string) {

$language = array(contains the inappropriate words);

$words = explode( ,$string);
$count = count(explode( , $string));

for($i = 0; $i  $count; $i++) {
if(in_array(strtolower($words[$i]), $language)) {
$words[$i] = *;
}
}

$newcomments = join( ,$words);

return $newcomments;
}




Perhaps you could try an approach like this:
?php
$dirty = array(
   'ipsum',
   'eloquentiam',
   'Vero'
);

$string = Lorem ipsum ius no etiam veniam, usu alii novum ne, sed cu
molestiae eloquentiam. Vero invenire philosophia est ne, quo nemore timeam
an.;

$clean = str_replace($dirty, '*', $string);

echo brstring: . $string;
echo brclean: . $clean;

GENERATES:

string: Lorem ipsum ius no etiam veniam, usu alii novum ne, sed cu molestiae
eloquentiam. Vero invenire philosophia est ne, quo nemore timeam an.
clean: Lorem * ius no etiam veniam, usu alii novum ne, sed cu molestiae *. *
invenire philosophia est ne, quo nemore timeam an.


Re: [PHP] Question on explode and join.

2006-09-13 Thread Christopher Watson

Definitely look into preg_match or even preg_replace, instead of
tokenizing the string and rubbing it up against an array of your own.
Iterate on your array of bad words, and then use Regular Expressions
to selectively hunt and squash.  You MAY be able to do it in one regex
operation by building a search pattern that covers everything.  Don't
know how much the PCRE functions can swallow at once, but it's worth a
try.

Christopher Watson
Principal Architect
The International Variable Star Index (VSX)
http://vsx.aavso.org


On 9/13/06, Beauford [EMAIL PROTECTED] wrote:

Hi,

I have a form which I want to check for inappropriate words before it is
posted. I have used explode to put the string into an array using a space as
the delimiter and then I check it against another array that contains the
inappropriate words.
I then replace the inappropriate words with *'s and join the array back into
a string.

This works perfectly except for one thing.

If the word in the string has a any kind of punctuation after it (period,
comma) it won't be matched.

So if  moron is an inappropriate word then you are a moron works, but you
are a moron. won't.

Any ideas?

Thanks

This is my code.

function badwords($string) {

   $language = array(contains the inappropriate words);

   $words = explode( ,$string);
   $count = count(explode( , $string));

   for($i = 0; $i  $count; $i++) {
   if(in_array(strtolower($words[$i]), $language)) {
   $words[$i] = *;
   }
   }

   $newcomments = join( ,$words);

   return $newcomments;
}




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



RE: [PHP] Question on explode and join.

2006-09-13 Thread Beauford
There ya go. Works and is shorter than what I did. Thanks.
 
One other question. if I have bunny and bunnyhole in the badword array. if
someone types in bunnyhole, I end up getting *hole in the clean string. If I
change the order of the words in the array would that solve the problem?
 
Thanks

  _  

From: Eric Butera [mailto:[EMAIL PROTECTED] 
Sent: September 13, 2006 1:07 PM
To: Beauford
Cc: php
Subject: Re: [PHP] Question on explode and join.


On 9/13/06, Beauford [EMAIL PROTECTED] wrote: 

Hi,

I have a form which I want to check for inappropriate words before it is
posted. I have used explode to put the string into an array using a space as
the delimiter and then I check it against another array that contains the 
inappropriate words.
I then replace the inappropriate words with *'s and join the array back into
a string.

This works perfectly except for one thing.

If the word in the string has a any kind of punctuation after it (period, 
comma) it won't be matched.

So if  moron is an inappropriate word then you are a moron works, but you
are a moron. won't.

Any ideas?

Thanks

This is my code.

function badwords($string) {

$language = array(contains the inappropriate words);

$words = explode( ,$string);
$count = count(explode( , $string));

for($i = 0; $i  $count; $i++) { 
if(in_array(strtolower($words[$i]), $language)) {
$words[$i] = *;
}
}

$newcomments = join( ,$words);

return $newcomments;
}



Perhaps you could try an approach like this:
?php
$dirty = array(
'ipsum',
'eloquentiam',
'Vero'
);

$string = Lorem ipsum ius no etiam veniam, usu alii novum ne, sed cu
molestiae eloquentiam. Vero invenire philosophia est ne, quo nemore timeam
an.; 

$clean = str_replace($dirty, '*', $string);

echo brstring: . $string;
echo brclean: . $clean; 


GENERATES:

string: Lorem ipsum ius no etiam veniam, usu alii novum ne, sed cu molestiae
eloquentiam. Vero invenire philosophia est ne, quo nemore timeam an.
clean: Lorem * ius no etiam veniam, usu alii novum ne, sed cu molestiae *. *
invenire philosophia est ne, quo nemore timeam an.




Re: [PHP] Question on explode and join.

2006-09-13 Thread Jon Anderson

Beauford wrote:

I have a form which I want to check for inappropriate words before it is
posted. I have used explode to put the string into an array using a space 
as

the delimiter and then I check it against another array that contains the
inappropriate words.
I then replace the inappropriate words with *'s and join the array back 
into

a string.

This works perfectly except for one thing.

If the word in the string has a any kind of punctuation after it (period,
comma) it won't be matched.

So if  moron is an inappropriate word then you are a moron works, but 
you

are a moron. won't.

Any ideas?


$filtered = 
str_ireplace(array('naughty','words'),array('*','*'),$_POST['input_string']);


jon 


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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Rahul S. Johari

I think that is the solution to my problem. The only problem is, nothing is
allowing me to change these permissions or owner/group. Nor the 'Get Info'
window in Mac, nor the Terminal Window. How do I change it?


On 9/13/06 11:45 AM, Ray Hauge [EMAIL PROTECTED] wrote:

 On Wednesday 13 September 2006 10:30, John Nichel wrote:
 Rahul S. Johari wrote:
 Nope.
 It looks like this...
 
 
 drwxr-xr-x  3 root root 4096 Sep 13 10:44 .
 drwxr-xr-x  3 root root 4096 Sep 13 10:46 ..
 drwx--  1 rjohari  admin  16384 13 Sep 10:38 foresight
 
 Foresight being the mounted share.
 
 Does your webserver run as the user 'rjohari'?
 
 *permission light bulb*
 
 --
 John C. Nichel IV
 Programmer/System Admin (ÜberGeek)
 Dot Com Holdings of Buffalo
 716.856.9675
 [EMAIL PROTECTED]
 
 nice catch.
 
 My suggestion would be to change the group to the group the webserver runs as
 (nobody, www, etc.) and allow read and write access to the group level as
 well.  That should solve your problem.

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread afan
Wouldn't this actually bring me back to empty form?


 On 9/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 sorry, but didn't get this one. could you please elaborate it a little
 bi
 to me?

 thanks.



  On 9/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
  Hi,
  Could somebody explain to me what to do to skip this message I'm
 getting
  after I search for some products on my page, got the list of
 products,
  selected a detailed view of the product and click on the Back button
 of
  the browser to see again list of found products (result page):
  The Page you are trying to view contains POSTDATA that has expired
 from
  cache. If you resend the data, any action the form carried out such
 as
 a
  search or online purchase) will be repeated. To resend the data,
 click
  OK.
  Otherwise, click Cancel.
 
  Thanks for any help.
 
  -afan
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
  If you add a header redirect [header('Location:');] after your script
  processes the POST data you can avoid this.
 

 Sure..

 Say you have form.php.  This page will post to process.php. (Just an
 example.  Having form.php post to itself is fine too and how I always do
 my
 forms since on error I redisplay them with filled values)

 Inside process.php you might have something like

 ?php
 if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
 //do processing here
 if ( success ) {
 header('Location: http://example.com/thanks.php');
 } else {
 header('Location: http://example.com/form.php');
 } // if
 } // if

 session_write_close(); // if you're using sessions
 exit();
 ?

 Now when your form posts to process, your script will either go back to
 the
 form.php on error, or thanks.php on success.  Because process.php issues a
 redirect, this tells the browser to ignore process.php in the history it
 saves.  If a user clicks the back button it will go to form.php because
 process.php returned a 403 header and was ignored for lack of a better
 word.

 Hope that helps!


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



[PHP] Re: undefined function bindtextdomain()

2006-09-13 Thread Rick Olson
It sounds like gettext isn't actually loading.  Get the output of 
phpinfo(), and search for the 'gettext' extension to make sure it's 
there.  If not, you either didn't ./configure correctly, or you aren't 
telling the php.ini file to load the gettext extension.


hth

Rick

Zbigniew Szalbot wrote:

Hello,

I am trying to setup vexim (admin panel for handling domains in exim) and
I am getting an error that I thought I would ask you to help me
troubleshoot if possible.

Namely, when I start apache and try to open vexim panel, apache shows no
errors (just a blank page) but in the error log I read this:

PHP Fatal error:  Call
 to undefined function bindtextdomain() in
/usr/local/www/data-dist/domainpanel/
vexim2/vexim/config/i18n.php on line 6

I googled the problem and found out that I need gettext compiled as php
module, so I reinstalled php and made sure gettext is included.
Unfortunately, it has not helped. I have:

apache-2.0.59
php5-5.1.6
and (among many other php extenstions/modules) gettext-0.14.5_2.

It might be that it is a vexim issue, but if you have seen such a problem
before, I would appreciate your comment/advice.

Thank you very much indeed!

Warm regards,

--
Zbigniew Szalbot


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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Ray Hauge
chmod 770 foresight

does that do anything?  If not, try it as the root/admin account.
-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

On Wednesday 13 September 2006 12:57, Rahul S. Johari wrote:
 I think that is the solution to my problem. The only problem is, nothing is
 allowing me to change these permissions or owner/group. Nor the 'Get Info'
 window in Mac, nor the Terminal Window. How do I change it?

 On 9/13/06 11:45 AM, Ray Hauge [EMAIL PROTECTED] wrote:
  On Wednesday 13 September 2006 10:30, John Nichel wrote:
  Rahul S. Johari wrote:
  Nope.
  It looks like this...
 
 
  drwxr-xr-x  3 root root 4096 Sep 13 10:44 .
  drwxr-xr-x  3 root root 4096 Sep 13 10:46 ..
  drwx--  1 rjohari  admin  16384 13 Sep 10:38 foresight
 
  Foresight being the mounted share.
 
  Does your webserver run as the user 'rjohari'?
 
  *permission light bulb*
 
  --
  John C. Nichel IV
  Programmer/System Admin (ÜberGeek)
  Dot Com Holdings of Buffalo
  716.856.9675
  [EMAIL PROTECTED]
 
  nice catch.
 
  My suggestion would be to change the group to the group the webserver
  runs as (nobody, www, etc.) and allow read and write access to the group
  level as well.  That should solve your problem.

 Rahul S. Johari
 Supervisor, Internet  Administration
 Informed Marketing Services Inc.
 500 Federal Street, Suite 201
 Troy NY 12180

 Tel: (518) 687-6700 x154
 Fax: (518) 687-6799
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com

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



Re: [PHP] Question on explode and join.

2006-09-13 Thread Ducarom

I made some changes to the script from Butera. Now it only replaces complete
words.

$dirty = array(
  'ipsum',
  'eloquentiam',
  'Vero'
);

foreach ($dirty as $key = $word) {
   $dirty[$key] = '/\b'. $word . '\b/';
}

$string = Lorem ipsum ius no etiam veniam, usu alii novum ne, sed cu
molestiae eloquentiam. Vero invenire philosophia est ne, quo nemore timeam
an.;

$clean = preg_replace($dirty, '*', $string);

echo brstring: . $string;
echo brclean: . $clean;

On 9/13/06, Beauford [EMAIL PROTECTED] wrote:


There ya go. Works and is shorter than what I did. Thanks.

One other question. if I have bunny and bunnyhole in the badword array. if
someone types in bunnyhole, I end up getting *hole in the clean string. If
I
change the order of the words in the array would that solve the problem?

Thanks



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Rahul S. Johari

Did..
Sudo chmod 770 foresight

Specified the root account password. Returned back to prompt without errors,
but did absolutely nothing. Permissions remain unchanged.


On 9/13/06 2:20 PM, Ray Hauge [EMAIL PROTECTED] wrote:

 chmod 770 foresight
 
 does that do anything?  If not, try it as the root/admin account.

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread John Nichel

Rahul S. Johari wrote:

Did..
Sudo chmod 770 foresight

Specified the root account password. Returned back to prompt without errors,
but did absolutely nothing. Permissions remain unchanged.



I don't know about Mac, but in Linux you cannot change the permissions 
of a mount point while the volume is mounted.  You can umount the 
volume, set ownership/permissions on the mount point, then remount the 
share.  Also, you can set the uid and gid in the options of the mount 
command (as well as rw mode).


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Problems with date()

2006-09-13 Thread Frank Arensmeier
And what exactly did you expect? Have you checked a calendar? The  
31st of december 2001, 2002 and 2003 are Monday, Tuesday and  
Wednesday respectively. In other words. those days are more or less  
in the middle of the week 01. So, I would say that your results are  
absolutely right.


/frank
13 sep 2006 kl. 18.38 skrev Arno Kuhl:


I hope someone can help with this.

I'm trying to find the week number of the last week of the year.
I have the following code snippet:

$lastday = strtotime(31 December .$year);
$lastdate = date(Y-m-d, $lastday);  // for testing
$lastweek = date(W, $lastday);

I put the $lastdate line in because I was convinced that $lastday  
must be

wrong, but it's correct!

When $year is 2000 I get an expected $lastweek of 52.
When $year is 2001, 2002, or 2003 the $lastweek is 01!
When $year is 2004 $lastweek is 53.
When $year is 2005 $lastweek is 52.

I haven't checked further than 2005.

Why do I get the weird lastweek values for 2001, 2002, and 2003?
I'm using PHP 4.3.4 on Win2000.

Arno

--
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] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread John Nichel

Rahul S. Johari wrote:

Ok you may be on to something here. Everytime I was trying to chmod the
permissions etcetera, the share was mounted, and that probably was the
problem. 


What is a mount point? How do I set ownership/permission of a mount point?



This is going way beyond the scope of this mailing list.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Frank Arensmeier

Hi there.

Look at the man page for mount_smbfs - especially the -M option  
which ia able to set permissions on the mounted SMB volume. If that  
doesn't help, when you said you tried to make a shortcut to the file  
- did you do this in the Finder? Try it with a symbolic link in stead  
(man ln). e.g. ln -s source file target file and place the symbolic  
link into a folder that PHP/Apache have access to.


Whit a symbolic link (which is not exactly the same as a shortcut  
created in the Finder), your link will act exactly as the target it  
is pointing at so to say.


Good luck.

/frank
13 sep 2006 kl. 20.53 skrev John Nichel:


Rahul S. Johari wrote:
Ok you may be on to something here. Everytime I was trying to  
chmod the
permissions etcetera, the share was mounted, and that probably was  
the
problem. What is a mount point? How do I set ownership/permission  
of a mount point?


This is going way beyond the scope of this mailing list.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
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] Problems with date()

2006-09-13 Thread Ducarom

Hi,

Try it with 28 December instead of 31 December.


From http://en.wikipedia.org/wiki/ISO_week_date


The last week of the ISO year is the week before week 01; in accordance with
the symmetry of the definition, equivalent definitions are:

  - the week with the year's last Thursday in it
  - the week with December 28 in it
  - the last week with the majority (four or more) of its days in the
  ending year
  - the week starting with the Monday in the period 22 - 28 December
  - the week with the Thursday in the period 25 - 31 December
  - the week ending with the Sunday in the period 28 December - 3
  January
  - If 31 December is on a Monday, Tuesday, or Wednesday, it is in week
  01, otherwise in week 52 or 53.

Best Regards,
Ducarom

On 9/13/06, Arno Kuhl [EMAIL PROTECTED] wrote:


I hope someone can help with this.

I'm trying to find the week number of the last week of the year.
I have the following code snippet:

$lastday = strtotime(31 December .$year);
$lastdate = date(Y-m-d, $lastday);  // for testing
$lastweek = date(W, $lastday);

I put the $lastdate line in because I was convinced that $lastday must be
wrong, but it's correct!

When $year is 2000 I get an expected $lastweek of 52.
When $year is 2001, 2002, or 2003 the $lastweek is 01!
When $year is 2004 $lastweek is 53.
When $year is 2005 $lastweek is 52.

I haven't checked further than 2005.

Why do I get the weird lastweek values for 2001, 2002, and 2003?
I'm using PHP 4.3.4 on Win2000.

Arno

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




Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Frank Arensmeier

Sorry for the typos btw...

It's late.

/frank

13 sep 2006 kl. 21.20 skrev Frank Arensmeier:


Hi there.

Look at the man page for mount_smbfs - especially the -M option  
which ia able to set permissions on the mounted SMB volume. If that  
doesn't help, when you said you tried to make a shortcut to the  
file - did you do this in the Finder? Try it with a symbolic link  
in stead (man ln). e.g. ln -s source file target file and place the  
symbolic link into a folder that PHP/Apache have access to.


Whit a symbolic link (which is not exactly the same as a shortcut  
created in the Finder), your link will act exactly as the target it  
is pointing at so to say.


Good luck.

/frank
13 sep 2006 kl. 20.53 skrev John Nichel:


Rahul S. Johari wrote:
Ok you may be on to something here. Everytime I was trying to  
chmod the
permissions etcetera, the share was mounted, and that probably  
was the
problem. What is a mount point? How do I set ownership/permission  
of a mount point?


This is going way beyond the scope of this mailing list.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
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




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



[PHP] session_start() and fopen

2006-09-13 Thread Fabri
Hello, would you please help me on this issue that is making me crazy?

 

 

I start a session with session_start() and I need to write a file, the file
is written twice! If I remove session_start the code works obviously fine.

I used  the date as name of file so I can see the problem, otherwise the
file is overwritten.

 

session_start();

$nome = date(Ymd-His);

$path = $nome . .xml;

$fh = fopen($path, 'w');

if ($fh) {

fwrite($fh, 'ciao');

fclose($fh);

echo $path;

} 

 

does someone have an answer?



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Rahul S. Johari

Ok you may be on to something here. Everytime I was trying to chmod the
permissions etcetera, the share was mounted, and that probably was the
problem. 

What is a mount point? How do I set ownership/permission of a mount point?


On 9/13/06 2:42 PM, John Nichel [EMAIL PROTECTED] wrote:

 I don't know about Mac, but in Linux you cannot change the permissions
 of a mount point while the volume is mounted.  You can umount the
 volume, set ownership/permissions on the mount point, then remount the
 share.  Also, you can set the uid and gid in the options of the mount
 command (as well as rw mode).

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] session_start() and fopen

2006-09-13 Thread Curt Zirzow

On 9/13/06, Fabri [EMAIL PROTECTED] wrote:

Hello, would you please help me on this issue that is making me crazy?


I'll try



I start a session with session_start() and I need to write a file, the file
is written twice! If I remove session_start the code works obviously fine.


This has never happened to me, ever.



I used  the date as name of file so I can see the problem, otherwise the
file is overwritten.


What exactly are you trying to do?





session_start();
$nome = date(Ymd-His);
$path = $nome . .xml;

$fh = fopen($path, 'w');
if ($fh) {
fwrite($fh, 'ciao');
fclose($fh);
echo $path;
}


for full reporting you might want to do something when the condition
of if($fh) is false



does someone have an answer?


I'm not sure what else to tell you.


Curt.

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



Re: [PHP] DOM - parse HTML document [solved]

2006-09-13 Thread Leonidas Safran
Hello Tedd,

 Interesting -- it doesn't work for me. I keep getting --

 Parse error: parse error, unexpected T_OBJECT_OPERATOR

 -- in your if statement. But, I don't see the problem.

Maybe it has something to do with your php version. I have php 5.04 installed 
(Fedora Core 4 rpm package).

Hope that helps!


Regards,

LS
-- 
Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Curt Zirzow

On 9/13/06, Rahul S. Johari [EMAIL PROTECTED] wrote:


Ok you may be on to something here. Everytime I was trying to chmod the
permissions etcetera, the share was mounted, and that probably was the
problem.

What is a mount point? How do I set ownership/permission of a mount point?


With OSX i would doubt you need to be fiddling with permissions via a
terminal, if you are you most likely are doing something wrong.

Perhaps your mounting your drive incorrectly, that is something i cant
tell you since no info abou t that was provided;  perhaps seek avdise
from serveral of the osx mailling lists to see what is going wrong and
how to fix it, we know now that the problem of your issue is because
when you do mount the share your permissions are 0700, and explains
why you can't open the file.

Also, if you insist on testing things on the terminal the best way
would be something like:
 cd /path/to/dir/
 sudo -u user of apache ls

If that works then:
 sudo -u user apache less file in directory

that would have explained your 0700 on your mount point.


Curt.

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



Re: [PHP] Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Rahul S. Johari

I see that. I'm looking this up online.
To bring things back to the scope of the mailing list... Is there anyone
here who's successfully had PHP read a file sitting on a mounted share on
Mac OS X?


On 9/13/06 2:53 PM, John Nichel [EMAIL PROTECTED] wrote:

 Rahul S. Johari wrote:
 Ok you may be on to something here. Everytime I was trying to chmod the
 permissions etcetera, the share was mounted, and that probably was the
 problem. 
 
 What is a mount point? How do I set ownership/permission of a mount point?
 
 
 This is going way beyond the scope of this mailing list.

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] *SOLVED* Open file on a Mounted Share on Mac OS X

2006-09-13 Thread Rahul S. Johari

Finally!
Solution: I needed to create what is called a mount point or share point
in my home directory. Basically I created a folder in my home directoy, and
then used this following command in the Terminal to mount the server share
on the mount point of my choosing:

mount -t smbfs //[EMAIL PROTECTED]/ShareName SharePoint

Where SharePoint is a folder I created in my Home Directory on Mac.

When I directed PHP to read the file from this share point, it read it
without any problems. I was not using a share point and in theory, allowing
mac to mount the server share to it's own choice of location (which is
inside the hidden folder called Volumes) instead of a location of my
choice.

Much thanks to all of you!

Rahul S. Johari
Supervisor, Internet  Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] session_start() and fopen

2006-09-13 Thread Christopher Weldon
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Fabri wrote:
 Hello, would you please help me on this issue that is making me crazy?
 
  
 
  
 
 I start a session with session_start() and I need to write a file, the file
 is written twice! If I remove session_start the code works obviously fine.
 
 I used  the date as name of file so I can see the problem, otherwise the
 file is overwritten.
 
  
 
 session_start();
 
 $nome = date(Ymd-His);
 
 $path = $nome . .xml;
 
 $fh = fopen($path, 'w');
 
 if ($fh) {
 
 fwrite($fh, 'ciao');
 
 fclose($fh);
 
 echo $path;
 
 } 
 
  
 
 does someone have an answer?
 
 

Yes, I believe you need to elaborate more on your objectives for the
code and what exactly you mean by the file being written twice. From the
code snippet above, it seems as though you are just going to overwrite a
file and destroy it's contents, not write to it twice.

This isn't being called from any sort of loop, is it?

- --
Christopher Weldon, ZCE
President  CEO
Cerberus Interactive, Inc.
[EMAIL PROTECTED]
979.739.5874
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFCGnIZxvk7JEXkbERAj4OAKCVUc3lLkx7JcbwYavK/Qc/DYKtEQCfbU9w
EevaaQyHxc87B7qFwZxS0E4=
=BbS2
-END PGP SIGNATURE-

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



Re: [PHP] array_flip duplicate keys as arrays

2006-09-13 Thread tedd

At 11:39 AM -0500 9/13/06, Richard Lynch wrote:

I figured somebody else must have needed this, so there'd have to be a
PHP function for it...

But I'm not finding it when I rtfm...

Given an array like this:

$t9 = array('F' = 'FIND', 'D' = 'FIND', 'E' ='FIND', 'H' = 'HELP',
'I' = 'HELP');

I'm looking for a built-in function that returns this:
array('FIND' = array('F', 'D', 'E'), 'HELP'=array('H', 'I'))

Or maybe I'm the only goofball that needs this?

Obviously I can write it with a loop.

But is there some quick built-in function I'm missing?



Richard:

Perhaps a combination of array functions such as:

array_flip()

array_unique()

hth's

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] DOM - parse HTML document [solved]

2006-09-13 Thread tedd

At 10:02 PM +0200 9/13/06, Leonidas Safran wrote:

Hello Tedd,


 Interesting -- it doesn't work for me. I keep getting --



 Parse error: parse error, unexpected T_OBJECT_OPERATOR



 -- in your if statement. But, I don't see the problem.


Maybe it has something to do with your php version. I have php 5.04 
installed (Fedora Core 4 rpm package).


Hope that helps!


Regards,

LS



Yep, that was it -- I'm working with 4.

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] Question on explode and join.

2006-09-13 Thread Beauford
 
The problem with scripts like these is there is so many variables to deal
with. First, this doesn't deal with uppercase. So a word like bAdWoRd would
not get detected, or a word beginning a sentence. Also, a word within a word
like wordbadwordword would not be detected, and I'm sure there are more I
haven't discovered yet. I haven't had much time to play around with it since
earlier today, so I haven't experimented with it, but ideas are welcome.

Thanks

-Original Message-
From: Ducarom [mailto:[EMAIL PROTECTED] 
Sent: September 13, 2006 2:26 PM
To: Beauford
Cc: php
Subject: Re: [PHP] Question on explode and join.

I made some changes to the script from Butera. Now it only replaces complete
words.

$dirty = array(
   'ipsum',
   'eloquentiam',
   'Vero'
);

foreach ($dirty as $key = $word) {
$dirty[$key] = '/\b'. $word . '\b/'; }

$string = Lorem ipsum ius no etiam veniam, usu alii novum ne, sed cu
molestiae eloquentiam. Vero invenire philosophia est ne, quo nemore timeam
an.;

$clean = preg_replace($dirty, '*', $string);

echo brstring: . $string;
echo brclean: . $clean;

On 9/13/06, Beauford [EMAIL PROTECTED] wrote:

 There ya go. Works and is shorter than what I did. Thanks.

 One other question. if I have bunny and bunnyhole in the badword 
 array. if someone types in bunnyhole, I end up getting *hole in the 
 clean string. If I change the order of the words in the array would 
 that solve the problem?

 Thanks


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



Re: [PHP] Question on explode and join.

2006-09-13 Thread Ducarom

You can make it case insensitive by replacing:

$dirty[$key] = '/\b'. $word . '\b/'
with
$dirty[$key] = '/\b'. $word . '\b/i'

On 9/13/06, Beauford [EMAIL PROTECTED] wrote:



The problem with scripts like these is there is so many variables to deal
with. First, this doesn't deal with uppercase. So a word like bAdWoRd
would
not get detected, or a word beginning a sentence. Also, a word within a
word
like wordbadwordword would not be detected, and I'm sure there are more I
haven't discovered yet. I haven't had much time to play around with it
since
earlier today, so I haven't experimented with it, but ideas are welcome.

Thanks

-Original Message-
From: Ducarom [mailto:[EMAIL PROTECTED]
Sent: September 13, 2006 2:26 PM
To: Beauford
Cc: php
Subject: Re: [PHP] Question on explode and join.

I made some changes to the script from Butera. Now it only replaces
complete
words.

$dirty = array(
   'ipsum',
   'eloquentiam',
   'Vero'
);

foreach ($dirty as $key = $word) {
$dirty[$key] = '/\b'. $word . '\b/'; }

$string = Lorem ipsum ius no etiam veniam, usu alii novum ne, sed cu
molestiae eloquentiam. Vero invenire philosophia est ne, quo nemore timeam
an.;

$clean = preg_replace($dirty, '*', $string);

echo brstring: . $string;
echo brclean: . $clean;

On 9/13/06, Beauford [EMAIL PROTECTED] wrote:

 There ya go. Works and is shorter than what I did. Thanks.

 One other question. if I have bunny and bunnyhole in the badword
 array. if someone types in bunnyhole, I end up getting *hole in the
 clean string. If I change the order of the words in the array would
 that solve the problem?

 Thanks


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




[PHP] security include from remote server

2006-09-13 Thread Miguel Vaz


Hi,

Heres a simple problem:

	I am doing a php+mysql website at my office, hosted locally but open 
to the web, but i wouldnt like to host my files on our office server. 
I could host them somewhere else but our mysql database cant be 
accessed from the outside, only from our server.
	I thought about having a simple php local file that would include my 
files that are hosted someplace else, and therefor be able to access 
my local database, would that be possible? My first thought would 
probably be no, but i cant really do any tests right now, thats why i 
am asking you guys.
	If my solution is not viable, is there any other way of hosting my 
files someplace else, but still access the local database?


	(also thought of using zend guard to protect my code, but that would 
imply an install on our office server, which is out of the question)


Thanks.


Pag

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



[PHP] DOM Question. No pun intended.

2006-09-13 Thread Michael Williams

Hi All,

I'm having HTML DOM troubles.  Is there any way to output the *EXACT*  
code
contained in a node (child nodes and all)?  For instance, I perform a  
$doc-loadHTML($file) and all

is well.  I then search through the document for specific NODEs with
getElementsByTagName().  However, when I go to output the data from  
that node
(say a specific DIV) I simply get the text without formatting and the  
like.
Basically, I want the retrieved NODE to echo exactly what is  
contained.  If the

div looks like the following:

div id=name
table
stuff
/table
/div

. . .I want it to give me exactly that when I do a NODE-textContent or
NODE-nodeValue.  I don't want just the text, I want all tags  
contained, etc.

It would be nice to have DOMNode-saveHTML() similar to the
DOMDocument-saveHTML().

FYI, I'm using the technique to screen scrape portions of other  
pages from my
site and compile items for a quick fix.  Fortunately all my DIVs have  
IDs and I
can loop through and find them by that attribute's value. I just  
can't output

their EXACT data once I have them.  :-\

Thanks!