[PHP] Variables not available

2005-09-12 Thread Dotan Cohen
I am running php 5.0.4 at home on my Fedora Core 4 box. Post and get
variables are not available in my scripts. For instance, in
file.php?foo=bar the variable $foo is empty. Same thing for variables
passed in forms (get or post), which is how I came across this.

What could cause this? How could I repair it? Thanks.

Dotan Cohen
http://lyricslist.com/lyrics/artist_albums/458/spice_girls.php
Spice Girls Song Lyrics

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



Re: [PHP] Variables not available

2005-09-12 Thread Burhan Khalid

Dotan Cohen wrote:

I am running php 5.0.4 at home on my Fedora Core 4 box. Post and get
variables are not available in my scripts. For instance, in
file.php?foo=bar the variable $foo is empty. Same thing for variables
passed in forms (get or post), which is how I came across this.

What could cause this? How could I repair it? Thanks.


This is not a 'problem'.

See http://www.php.net/manual/en/security.globals.php

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



[PHP] Round with ONE-decimal... always...

2005-09-12 Thread Gustav Wiberg

Hi there!

I want to adjust the round() -function a little...

If I put round(6,0) there will be an output of 6
If I put round(6,32) there will be an output of 6,3

I want it to have 6,0 instead of just 6... I guess there is an easy solution 
to this? Suggestions?


/G
http://www.varupiraten.se/

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



Re: [PHP] Round with ONE-decimal... always...

2005-09-12 Thread Gustav Wiberg

Thanx!

/G

- Original Message - 
From: "George Pitcher" <[EMAIL PROTECTED]>

To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Sent: Monday, September 12, 2005 10:55 AM
Subject: RE: [PHP] Round with ONE-decimal... always...



Look at sprint_f() in the manual.

George


-Original Message-
From: Gustav Wiberg [mailto:[EMAIL PROTECTED]
Sent: 12 September 2005 9:52 am
To: PHP General
Subject: [PHP] Round with ONE-decimal... always...


Hi there!

I want to adjust the round() -function a little...

If I put round(6,0) there will be an output of 6
If I put round(6,32) there will be an output of 6,3

I want it to have 6,0 instead of just 6... I guess there is an
easy solution
to this? Suggestions?

/G
http://www.varupiraten.se/

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





--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 2005-09-10




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



Re: [PHP] QUERY TOKENIZER WAS Re: [new version] Re: [a proactive....

2005-09-12 Thread Jochem Maas

Jay Blanchard wrote:

[snip]
This is another rather hackish attempt at using the tokeniser.

Which isn't perfect by a long shot, but I'm away home now so it'll have
to do.

I'd be interested to know what it makes of your queries.
[/snip]

This little slice of code is really well done, and I think that when it


ditto - nice code Robin.

I have been on holiday for 2 weeks without a computer - shock,horror (what
kind of holiday is that anyway ;-) and have been out of the running

I will make an attempt shortly to integrate robins tokenizing code into
the 'tool' I hackd up on the basis of Jays code given that I'm a firebirder
and you (two) Are mysqler (at least as far as this little exercise is concerned)
I think it's well worth the effort to make it possible to 'switch' DB
extensions... (or maybe make it grab stuff from any extension...)

if I've missed some comms on this thread/topic could you repost me (without the
[PHP] in the subject - cos it's a little tough to weed thru the 2500 unread
php mails in my inbox :-P

rgds,
Jochem


is combined with the code from the original so that the file names for
each query can be identified and the other items can be specified from
the command line as Jochem had done this will be one really popular
little application. I made one change Robin and have one suggestion

I changed line 4 from 
//looks at all $dir/*.php files.

$dir = '/path/to/php/files';

//looks at all $dir/*.php files.
$dir = $_SERVER['PWD']; 

Which means that you will not have to modifiy the line each time you
place it in a different directory. Other than that, using glob in this
function;

function getPhpFileList($dir)
{
  if (!is_dir($dir)) $dir = '.';
  return glob($dir . '/*.php');
}

Will not work in older versions of PHP. Some folks still have these
older versions running (for various reasons) and may need this changed.

What's possibly next for this little application? Perhaps a method to
determine which type of database is being used based on connection


we are of like minds regarding this :-)


information or what have you. Learning by hacking, isn't it cool?


si senor ;-)





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



[PHP] Re: PHP page counter

2005-09-12 Thread Michelle Konzack
Hello Vedanta,

Thanks for the Link, I have registered and downloaded.
I will test it.

Thanks again
Michelle


Am 2005-09-12 10:33:52, schrieb Vedanta Barooah:
> there is one here : http://www.phpclasses.org/browse/package/2212.html
> see if it suffices your need,
> thanks,
> vedanta
> 
- END OF REPLYED MESSAGE -


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Variables not available

2005-09-12 Thread Dotan Cohen
On 9/12/05, Burhan Khalid <[EMAIL PROTECTED]> wrote:
> Dotan Cohen wrote:
> > I am running php 5.0.4 at home on my Fedora Core 4 box. Post and get
> > variables are not available in my scripts. For instance, in
> > file.php?foo=bar the variable $foo is empty. Same thing for variables
> > passed in forms (get or post), which is how I came across this.
> >
> > What could cause this? How could I repair it? Thanks.
> 
> This is not a 'problem'.
> 
> See http://www.php.net/manual/en/security.globals.php
> 

Thanks. I should have known that, I guess.

Dotan
http://lyricslist.com/lyrics/artist_albums/127/cooper_alice.php
Cooper, Alice Song Lyrics

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



[PHP] help me to draw a listview in my website

2005-09-12 Thread Nahalingam N. Kanakavel
hi all,

If any scripts available to draw a list view.
Plz help me, by giving some links or scripts avilable with you.

thanks in advance.

-- 
with regds,
Nahalingam.


[PHP] Re: Round with ONE-decimal... always...

2005-09-12 Thread Mark Rees
>
> I want to adjust the round() -function a little...
>
> If I put round(6,0) there will be an output of 6
> If I put round(6,32) there will be an output of 6,3
>
> I want it to have 6,0 instead of just 6... I guess there is an easy
solution
> to this? Suggestions?

Have a look at this.

http://uk2.php.net/manual/en/function.number-format.php






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



Re: [PHP] help me to draw a listview in my website

2005-09-12 Thread Burhan Khalid

Nahalingam N. Kanakavel wrote:

hi all,

If any scripts available to draw a list view.
Plz help me, by giving some links or scripts avilable with you.


What is a list view?

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



Re: [PHP] help me to draw a listview in my website

2005-09-12 Thread Gustav Wiberg

Hi there!

What do you mean with listview? Of what?

/G
http://www.varupiraten.se/

- Original Message - 
From: "Nahalingam N. Kanakavel" <[EMAIL PROTECTED]>

To: "PHP" 
Sent: Monday, September 12, 2005 11:05 AM
Subject: [PHP] help me to draw a listview in my website


hi all,

If any scripts available to draw a list view.
Plz help me, by giving some links or scripts avilable with you.

thanks in advance.

--
with regds,
Nahalingam.






No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 2005-09-10

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



Re: [PHP] Re: Round with ONE-decimal... always...

2005-09-12 Thread Gustav Wiberg


- Original Message - 
From: "Mark Rees" <[EMAIL PROTECTED]>

To: 
Sent: Monday, September 12, 2005 11:12 AM
Subject: [PHP] Re: Round with ONE-decimal... always...



>

I want to adjust the round() -function a little...

If I put round(6,0) there will be an output of 6
If I put round(6,32) there will be an output of 6,3

I want it to have 6,0 instead of just 6... I guess there is an easy

solution

to this? Suggestions?


Have a look at this.

http://uk2.php.net/manual/en/function.number-format.php






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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 2005-09-10



Thanx!

/G
http://www.varupiraten.se/

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



Re: [PHP] help me to draw a listview in my website

2005-09-12 Thread Nahalingam N. Kanakavel
hi,

I want to display several fields of values as a row, with header such as

-- |
Name age mail-id | Header part, by clicking over this I want to sort the
--- | rows 
below this.
. 
here rows of values. 
.
-

On 9/12/05, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
> 
> Hi there!
> 
> What do you mean with listview? Of what?
> 
> /G
> http://www.varupiraten.se/
> 
> - Original Message -
> From: "Nahalingam N. Kanakavel" <[EMAIL PROTECTED]>
> To: "PHP" 
> Sent: Monday, September 12, 2005 11:05 AM
> Subject: [PHP] help me to draw a listview in my website
> 
> 
> hi all,
> 
> If any scripts available to draw a list view.
> Plz help me, by giving some links or scripts avilable with you.
> 
> thanks in advance.
> 
> --
> with regds,
> Nahalingam.
> 
> 
> 
> 
> 
> 
> 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 2005-09-10
> 
> 


-- 
with regds,
Nahalingam.


Re: [PHP] help me to draw a listview in my website

2005-09-12 Thread Jesper Gran

Maybe this could be something? I haven't tried it though.

http://www.activewidgets.com/grid/

/Jesper

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



[PHP] log4php

2005-09-12 Thread bruce
hi...

has anyone used log4php in your php code? any success/horror stories? i'm
considering using it as i want/need a way of tracking different msg/error
levels within the code i'm starting to create. i'm looking for some method
of being able to determine/state the level of msgs i want to capture for the
various functions/modules within the app. i'd really like to be able to set
this up from an 'admin' function within the app. i'd also like the ability
to capture this information to either a log file, or db tbl..

thanks

-bruce
[EMAIL PROTECTED]

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



[PHP] setting 'expiry date'

2005-09-12 Thread Ross
I have a php/mysql database with articles. What I need is a php sctipt that 
will compare the current day with the 'expiry date' entered by the user and 
if the there is a difference then drop it from the database..

I retrieve the date (called time and format it like this...

$query= "SELECT DATE_FORMAT(time, '%d.%m.%Y') AS time, article, id FROM news 
ORDER BY id DESC";


The expiry date is entered through a javascript widget and is in the format 
dd/mm/.


thanks,


Ross 

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



RE: [PHP] setting 'expiry date'

2005-09-12 Thread Jay Blanchard
[snip]
I have a php/mysql database with articles. What I need is a php sctipt that 
will compare the current day with the 'expiry date' entered by the user and 
if the there is a difference then drop it from the database..

I retrieve the date (called time and format it like this...

$query= "SELECT DATE_FORMAT(time, '%d.%m.%Y') AS time, article, id FROM news

ORDER BY id DESC";

The expiry date is entered through a javascript widget and is in the format 
dd/mm/.
[/snip]

If you want to delete articles whose expiration date is not equal to today's
date;

$sql = "DELETE FROM news WHERE time < NOW() ";

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



[PHP] PHP - LDAPS query

2005-09-12 Thread Vedanta Barooah
Hello All,

I think documentation is very sparse on PHP LDAPS (LDAP over SSL). I
am in a situation where I need to auth against the LDAP server over
SSL. I have the server's certificate database in the form of a
cert7.db  file containing the appropriate CA certificates and a
key3.db file. How do I make use of these from PHP?

Any clues/links to documentation will be of great help...

Thanks,
Vedanta

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



RE: [PHP] setting 'expiry date'

2005-09-12 Thread Murray @ PlanetThoughtful
> I have a php/mysql database with articles. What I need is a php sctipt
> that
> will compare the current day with the 'expiry date' entered by the user
> and
> if the there is a difference then drop it from the database..
> 
> I retrieve the date (called time and format it like this...
> 
> $query= "SELECT DATE_FORMAT(time, '%d.%m.%Y') AS time, article, id FROM
> news
> ORDER BY id DESC";
> 
> 
> The expiry date is entered through a javascript widget and is in the
> format
> dd/mm/.

Hi Ross,

Is there a real reason for deleting the articles? Why not only display
articles where the current date/time is less than the expiration date/time?

Once the current date/time is greater than the expiration date/time, stop
displaying the article.

Same effect as far as your users are concerned, and you're not faced with
the frustration of, 'I need a copy of that article from 12 months ago!'

Much warmth,

Murray
---
"Lost in thought..."
http://www.planetthoughtful.org

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



[PHP] set_time_limit behavior

2005-09-12 Thread michael

Hi,

I am trying to figure out why a script that is set to time out after 30
seconds will run indefinitely.  For example,

set_time_limit(30);
echo ini_get('max_execution_time'), "";
echo date("H:i:s"), "";
for ($i = 0; $i < 100; $i++)
{
  sleep(10);
  echo date("H:i:s"),"";
  flush();
}
echo "Done!";

result:

30

13:54:09



14:10:50

Done!


As you can see, this script ran for over 14 minutes.  I have read that
max_execution_time is bound to CPU time, and I am not sure how this
translates into being able to effectively use this parameter.

Comments / insight extremely appreciated.

Michael

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



RE: [PHP] set_time_limit behavior

2005-09-12 Thread Jay Blanchard
[snip]
I am trying to figure out why a script that is set to time out after 30
seconds will run indefinitely.  For example,

As you can see, this script ran for over 14 minutes.  I have read that
max_execution_time is bound to CPU time, and I am not sure how this
translates into being able to effectively use this parameter.

Comments / insight extremely appreciated.
[/snip]

Are you running PHP in safe mode? If so set_time_limit() has no effect.

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



Re: [PHP] Variables not available

2005-09-12 Thread Ryan A

On 9/12/2005 9:00:46 AM, Dotan Cohen ([EMAIL PROTECTED]) wrote:
> I am running php 5.0.4 at home on my Fedora Core 4 box. Post and get
> variables are not available in my scripts. For instance, in
> file.php?foo=bar the variable $foo is empty. Same thing for variables
> passed in forms (get or post), which is how I came across this.
> 
> What could cause this? How could I repair it? Thanks.


Have you checked your register_globals?

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



Re: [PHP] mixing $_POST and $_GET vars

2005-09-12 Thread Brent Baisley
If you are going to be accepting data, and you don't care or are not  
sure if it's going to be a GET or a POST, then use $_REQUEST, which  
contains both $_GET and $_POST data.




On Sep 9, 2005, at 7:46 PM, bruce wrote:


hi..

quick question.. a basic link blah allows  
you to
process the vars in foo.php using $_GET, easy/basic enough.  
however, if i
have a form from cat.php that does a 'post' of the form information/ 
input to
the foo.php, i'm then going to have to either change the form to do  
a 'get'
or else i'm going to have to do both a $_GET, and a $_POST within  
foo.php to

access the vars from the pages that are interfacing with foo.php.

is there an easier/cleaner/better approach??

or do i really need/wind up doing something like

if ($_GET['foo'])...

if ($_POST['apple'])...

and just have a mix of both methods within the code...

thanks

-bruce
[EMAIL PROTECTED]

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





--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

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



[PHP] Best way to mass mail

2005-09-12 Thread Ryan A
Hi,
My client has a dating site and now he wants to mail all his members,
he does not want to use any of the already installed mailing lists but wants
us to make one
for him, he's on a dedicated server.

Presently he does not have too many members, just a few thousand (around 3k
i guess),
I remember reading sometime back on the list that using the mail() may not
be the best
option...not sure if thats still true.

The thing that bothers me the most is if the program times out..., how do I
start again from
the ones that have not been sent?

eg:
(10 members)
mail gets sent to first 4 members then times out
we re-click on the send button and it starts again from one...again times
out
(this happens 5 times)

that means members 1-4 will get the same email 5 times

Doing this the hard way would be to connect to the db after each successful
mail and "mark"
each member with todays date or something...but I would like to avoid so
many calls to the
DB if possible...esp if the site grows.

Ideas/suggestions?

Thanks in advance,
Ryan

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



[PHP] mysql_connect

2005-09-12 Thread blackwater dev
Hello,

I have a strange bug I can't figure out.  I am trying to use a third
party library and it is throwing errors:

Fatal error: Call to undefined function: mysql_pconnect()

This doesn't make sense to me as I have other code on that box that
uses mysql_pconnect() with no problem.  Why would some code be able to
use it while other code can't?


Thank!

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



Re: [PHP] Variables not available

2005-09-12 Thread Dotan Cohen
On 9/12/05, Ryan A <[EMAIL PROTECTED]> wrote:
> 
> On 9/12/2005 9:00:46 AM, Dotan Cohen ([EMAIL PROTECTED]) wrote:
> > I am running php 5.0.4 at home on my Fedora Core 4 box. Post and get
> > variables are not available in my scripts. For instance, in
> > file.php?foo=bar the variable $foo is empty. Same thing for variables
> > passed in forms (get or post), which is how I came across this.
> >
> > What could cause this? How could I repair it? Thanks.
> 
> 
> Have you checked your register_globals?
> 

The 'problem' was in fact register globals. I did a little research
and decided to leave it off. So I'm accessing the variables like
$_POST['foo']. Thanks.

Dotan
http://lyricslist.com/lyrics/artist_albums/332/mccartney_paul.php
McCartney, Paul Song Lyrics

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



Re: [PHP] Round with ONE-decimal... always...

2005-09-12 Thread Jordan Miller

besides sprintf, number_format will also do it:

number_format(6, 1, ',', '');// Outputs '6,0'

Jordan



On Sep 12, 2005, at 3:52 AM, Gustav Wiberg wrote:



Hi there!

I want to adjust the round() -function a little...

If I put round(6,0) there will be an output of 6
If I put round(6,32) there will be an output of 6,3

I want it to have 6,0 instead of just 6... I guess there is an easy  
solution to this? Suggestions?


/G
http://www.varupiraten.se/

--
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] SOAP and php

2005-09-12 Thread Leon Vismer
Hi 

What would be the best option for PHP and SOAP support.

Many thanks
--
Leon

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



[PHP] Re: Best way to mass mail

2005-09-12 Thread Mark Rees
""Ryan A"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> My client has a dating site and now he wants to mail all his members,
> he does not want to use any of the already installed mailing lists but
wants
> us to make one
> for him, he's on a dedicated server.
>
> Presently he does not have too many members, just a few thousand (around
3k
> i guess),
> I remember reading sometime back on the list that using the mail() may not
> be the best
> option...not sure if thats still true.
>
> The thing that bothers me the most is if the program times out..., how do
I
> start again from
> the ones that have not been sent?

phplist handles this well

www.phplist.com

Even if you decide not to use it, the code will probably help you out

>
> eg:
> (10 members)
> mail gets sent to first 4 members then times out
> we re-click on the send button and it starts again from one...again times
> out
> (this happens 5 times)
>
> that means members 1-4 will get the same email 5 times
>
> Doing this the hard way would be to connect to the db after each
successful
> mail and "mark"
> each member with todays date or something...but I would like to avoid so
> many calls to the
> DB if possible...esp if the site grows.
>
> Ideas/suggestions?
>
> Thanks in advance,
> Ryan

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



[PHP] Re: Best way to mass mail

2005-09-12 Thread Matthew Weier O'Phinney
* "Ryan A" <[EMAIL PROTECTED]>:
> My client has a dating site and now he wants to mail all his members,
> he does not want to use any of the already installed mailing lists but
> wants us to make one for him, he's on a dedicated server.
>
> Presently he does not have too many members, just a few thousand
> (around 3k i guess), I remember reading sometime back on the list that
> using the mail() may not be the best option...not sure if thats still
> true.
>
> The thing that bothers me the most is if the program times out..., how
> do I start again from the ones that have not been sent?
>
> eg:
> (10 members)
> mail gets sent to first 4 members then times out
> we re-click on the send button and it starts again from one...again
> times out (this happens 5 times)
>
> that means members 1-4 will get the same email 5 times
>
> Doing this the hard way would be to connect to the db after each
> successful mail and "mark" each member with todays date or
> something...but I would like to avoid so many calls to the DB if
> possible...esp if the site grows.
>
> Ideas/suggestions?

Build a queueing system, and use cron to actually process and mail the
list.

Longer explanation:

I run a mass-mailer for a non-profit, and the way our works is to store
all mail information in a database. We then have a cronjob that runs
each minute and checks to see if any mailings need to be sent (basically,
the absense of a 'sent' flag), and then processes the mailing.

Mails are then queued to an MTA -- in our case, Postfix. This allows us
to handle bounces (another script is triggered when email bounces back
to the reply-to address). 

So, on your web-based front-end, when you click 'Send', it actually
simply places the information in a database queue, and the cronjob does
the actual sending.

-- 
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

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



[PHP] Re: Best way to mass mail

2005-09-12 Thread Manuel Lemos

Hello,

on 09/12/2005 10:50 AM Ryan A said the following:

The thing that bothers me the most is if the program times out..., how do I
start again from
the ones that have not been sent?


Use set_time_limit(0); and your script will never timeout. Anyway, long 
standing scripts should be run off your Web server, maybe started from 
by cron.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



Re: [PHP] Best way to mass mail

2005-09-12 Thread Miles Thompson

At 10:50 AM 9/12/2005, Ryan A wrote:

Hi,
My client has a dating site and now he wants to mail all his members,
he does not want to use any of the already installed mailing lists but wants
us to make one
for him, he's on a dedicated server.

Presently he does not have too many members, just a few thousand (around 3k
i guess),
I remember reading sometime back on the list that using the mail() may not
be the best
option...not sure if thats still true.

The thing that bothers me the most is if the program times out..., how do I
start again from
the ones that have not been sent?

eg:
(10 members)
mail gets sent to first 4 members then times out
we re-click on the send button and it starts again from one...again times
out
(this happens 5 times)

that means members 1-4 will get the same email 5 times

Doing this the hard way would be to connect to the db after each successful
mail and "mark"
each member with todays date or something...but I would like to avoid so
many calls to the
DB if possible...esp if the site grows.

Ideas/suggestions?

Thanks in advance,
Ryan



We send to 1,000 subscribers each night, here's the guts of the code. 
There's one call to fetch the names and email addresses from the database.


while( $row = mysql_fetch_array( $result ) )
{
$first_name = $row[ first_name ];
$last_name  = $row[ last_name ];
$email  = $row[ email ];

/* recipient */
$recipient = $email;

/* send it */
$lMailedOK = mail($recipient, $subject, 
$message, $headers);

if ($lMailedOK != 0 )
{
$lMailedOK = "OK";
}else{
$lMailedOK="FAILED";
}
echo $recipient . " - " . $lMailedOK ."";
// give ourselves more time
set_time_limit( 20 );
} //$row = mysql_fetch_array( $result )

$message is built higher up in the process - I keep resetting the time out 
- set_time_limit(20).

After each message is sent, $lMailedOK and the names are echoed to the browser.

When the process completes, we know who it went to and if the call to 
mail() succeeded.


Hope this is helpful - Miles Thompson 


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



Re: [PHP] Best way to mass mail

2005-09-12 Thread Miles Thompson

At 10:50 AM 9/12/2005, Ryan A wrote:

Hi,
My client has a dating site and now he wants to mail all his members,
he does not want to use any of the already installed mailing lists but wants
us to make one
for him, he's on a dedicated server.

Presently he does not have too many members, just a few thousand (around 3k
i guess),
I remember reading sometime back on the list that using the mail() may not
be the best
option...not sure if thats still true.

The thing that bothers me the most is if the program times out..., how do I
start again from
the ones that have not been sent?

eg:
(10 members)
mail gets sent to first 4 members then times out
we re-click on the send button and it starts again from one...again times
out
(this happens 5 times)

that means members 1-4 will get the same email 5 times

Doing this the hard way would be to connect to the db after each successful
mail and "mark"
each member with todays date or something...but I would like to avoid so
many calls to the
DB if possible...esp if the site grows.

Ideas/suggestions?

Thanks in advance,
Ryan

Addition to my prev msg ...


We don't have access to cron processes on our ISP's server, so the nightly 
mailing goes out as a scheduled job from a Windows XP box.


We have maybe three glitches per year:
1. user forgets and shuts  the box down,
2. forgets and turns off the script, or
3. the power fails and machine is not set up to automatically 
reboot and feed itself her password.


This is all "livable-with".

Cheers - Miles 


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



[PHP] Handling file uploads for download

2005-09-12 Thread Charles Kline

Hi all,

I have an application where I need to allow the admin of a site to  
upload PDF files for download by their clients.


I am uploading files to a directory ABOVE the web root, but I have no  
clue what the best way to have a link on the site to allow for  
downloading those files by visitors twould be.


Any suggestions?

Thanks,
Charles

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



Re: [PHP] set_time_limit behavior

2005-09-12 Thread michael

HI Jay,

Thanks for the reply.  No, we are not in safe mode.  That was one of the 
first things I looked at.  It's quite a confusing issue.  I certainly 
have had PHP time out on me before, and have juggled max_execution_time 
to solve this.  But with it just running indefinitely regardless of INI 
values or run time setting...  well its a little disturbing!


Thanks,

Michael

Jay Blanchard wrote:


[snip]
I am trying to figure out why a script that is set to time out after 30
seconds will run indefinitely.  For example,

As you can see, this script ran for over 14 minutes.  I have read that
max_execution_time is bound to CPU time, and I am not sure how this
translates into being able to effectively use this parameter.

Comments / insight extremely appreciated.
[/snip]

Are you running PHP in safe mode? If so set_time_limit() has no effect.

 



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



RE: [PHP] set_time_limit behavior

2005-09-12 Thread Jim Moseby
] set_time_limit behavior
> 
> 
> HI Jay,
> 
> Thanks for the reply.  No, we are not in safe mode.  That was 
> one of the 
> first things I looked at.  It's quite a confusing issue.  I certainly 
> have had PHP time out on me before, and have juggled 
> max_execution_time 
> to solve this.  But with it just running indefinitely 
> regardless of INI 
> values or run time setting...  well its a little disturbing!
> 
> Thanks,
> 
> Michael
> 
> Jay Blanchard wrote:
> 
> >[snip]
> >I am trying to figure out why a script that is set to time 
> out after 30
> >seconds will run indefinitely.  For example,
> >
> >As you can see, this script ran for over 14 minutes.  I have 
> read that
> >max_execution_time is bound to CPU time, and I am not sure how this
> >translates into being able to effectively use this parameter.
> >
> >Comments / insight extremely appreciated.
> >[/snip]
> >
> >Are you running PHP in safe mode? If so set_time_limit() has 
> no effect.
> >

>From the online manual:

The set_time_limit() function and the configuration directive
max_execution_time only affect the execution time of the script itself. Any
time spent on activity that happens outside the execution of the script such
as system calls using system(), the sleep() function, database queries, etc.
is not included when determining the maximum time that the script has been
running.

JM

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



Re: [PHP] set_time_limit behavior

2005-09-12 Thread michael

Hi Jim,

I certainly did overlook the ramifications of the sleep function.  I 
modified my script so that sleep is not called:


set_time_limit(1);
echo ini_get('max_execution_time'), "";
echo date("H:i:s"), "";
while (true)
{
  echo date("H:i:s"),"";
  flush();
}


This did time out!  But, oddly it timed out only after 10 seconds.  Any 
ideas of why the discrepancy?


Thanks,

Michael



Jim Moseby wrote:


] set_time_limit behavior
 


HI Jay,

Thanks for the reply.  No, we are not in safe mode.  That was 
one of the 
first things I looked at.  It's quite a confusing issue.  I certainly 
have had PHP time out on me before, and have juggled 
max_execution_time 
to solve this.  But with it just running indefinitely 
regardless of INI 
values or run time setting...  well its a little disturbing!


Thanks,

Michael

Jay Blanchard wrote:

   


[snip]
I am trying to figure out why a script that is set to time 
 


out after 30
   


seconds will run indefinitely.  For example,

As you can see, this script ran for over 14 minutes.  I have 
 


read that
   


max_execution_time is bound to CPU time, and I am not sure how this
translates into being able to effectively use this parameter.

Comments / insight extremely appreciated.
[/snip]

Are you running PHP in safe mode? If so set_time_limit() has 
 


no effect.
   



From the online manual:

The set_time_limit() function and the configuration directive
max_execution_time only affect the execution time of the script itself. Any
time spent on activity that happens outside the execution of the script such
as system calls using system(), the sleep() function, database queries, etc.
is not included when determining the maximum time that the script has been
running.

JM

 



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



[PHP] confirmation email script/code

2005-09-12 Thread bruce
hi..

has anybody come across a really good 'open source' chunk of code for
sending/recieving confirmation emails from an app... i'd like to allow the
user to register, and send them an email that they then have to hit the link
to complete the process..

thanks

-bruce
[EMAIL PROTECTED]

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



RE: [PHP] confirmation email script/code

2005-09-12 Thread Jim Moseby
> has anybody come across a really good 'open source' chunk of code for
> sending/recieving confirmation emails from an app... i'd like 
> to allow the
> user to register, and send them an email that they then have 
> to hit the link
> to complete the process..

It is strightforward to write this yourself.  In my simple example, I
generate a 32 byte random ID when the user registers and save it along with
his data in the DB. Then, I send him an email with a link like this:

www.example.com/register.php?id=7H7dh869ha320J6GhAs89L0lJ00j09df?action=conf
irm

When he clicks the link, I flip a flag in his DB record that he has
confirmed.

I have cron periodically go and clean up unconfirmed records that have timed
out.

JM

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



[PHP] hidden database issue????

2005-09-12 Thread bruce
hi...

i have a situation with a server that i have. i have mysql installed with
php..

the mysql is V4.1.12. i'm trying to see/view a database from the command
line and i can't see it when i login to mysql as root. i also can't see it
when i try to login to mysql as the given user.

from the php app, i see that the app makes a valid connection using:
 host= 192.168.1.foo
 dbname  = cat
 user= dog
 passwd  = dog

i've tracked the code, it's making the connection, and interfacing with the
database/tables...

however, when i try to access the db as either root/dog, i can't see the
database 'cat'
  mysql -udog -pdog -h192.168.1.foo
  mysql -uroot -p

neither one of these approaches sems to work, ie, i can't see the 'cat'
database in the mysql list of tables...

any idea what's going on...

when i get into mysql as root, i can see/manipulate all the other databases.

thanks for any pointers/thoughts/etc...

searching google hasn't led to any solid solutions..

thanks

-bruce
[EMAIL PROTECTED]

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



RE: [PHP] confirmation email script/code

2005-09-12 Thread bruce
jim...

pretty much what i had thought about... question.. how does one correctly!!!
set up a cron process...

i assume that i can write a quick perl/php app that iterates through the
'emailconfirmTBL' looking at the date, and the confirm status. if the
cleanup app sees any records that are over a certain age, and haven't been
confirmed, it can simply delete the record. but shouldn't the cleanup also
do a rollback/delete of the user registration records as well...

this kind of approach would lend itself to being monitored by an admin who
could then look to see where in the process a given user is/was...

any good/quick guides you can point me to!

thanks

-bruce


-Original Message-
From: Jim Moseby [mailto:[EMAIL PROTECTED]
Sent: Monday, September 12, 2005 8:56 AM
To: '[EMAIL PROTECTED]'; php-general@lists.php.net
Subject: RE: [PHP] confirmation email script/code


> has anybody come across a really good 'open source' chunk of code for
> sending/recieving confirmation emails from an app... i'd like
> to allow the
> user to register, and send them an email that they then have
> to hit the link
> to complete the process..

It is strightforward to write this yourself.  In my simple example, I
generate a 32 byte random ID when the user registers and save it along with
his data in the DB. Then, I send him an email with a link like this:

www.example.com/register.php?id=7H7dh869ha320J6GhAs89L0lJ00j09df?action=conf
irm

When he clicks the link, I flip a flag in his DB record that he has
confirmed.

I have cron periodically go and clean up unconfirmed records that have timed
out.

JM

--
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] Best way to mass mail

2005-09-12 Thread Nuno Pereira

Miles Thompson wrote:

At 10:50 AM 9/12/2005, Ryan A wrote:


Hi,
My client has a dating site and now he wants to mail all his members,
he does not want to use any of the already installed mailing lists but 
wants

us to make one
for him, he's on a dedicated server.

Presently he does not have too many members, just a few thousand 
(around 3k

i guess),
I remember reading sometime back on the list that using the mail() may 
not

be the best
option...not sure if thats still true.

The thing that bothers me the most is if the program times out..., how 
do I

start again from
the ones that have not been sent?

eg:
(10 members)
mail gets sent to first 4 members then times out
we re-click on the send button and it starts again from one...again times
out
(this happens 5 times)

that means members 1-4 will get the same email 5 times

Doing this the hard way would be to connect to the db after each 
successful

mail and "mark"
each member with todays date or something...but I would like to avoid so
many calls to the
DB if possible...esp if the site grows.

Ideas/suggestions?

Thanks in advance,
Ryan

Addition to my prev msg ...



We don't have access to cron processes on our ISP's server, so the 
nightly mailing goes out as a scheduled job from a Windows XP box.


You can have your own cron processes. See man crontab. Try "crontab -e" 
with your user, in a shell login. But the admin can forbid users install 
their jobs in a crontab.



We have maybe three glitches per year:
1. user forgets and shuts  the box down,
2. forgets and turns off the script, or
3. the power fails and machine is not set up to automatically 
reboot and feed itself her password.


This is all "livable-with".

Cheers - Miles


--
Nuno Pereira

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



[PHP] Re: confirmation email script/code

2005-09-12 Thread Manuel Lemos

Hello,

on 09/12/2005 12:44 PM bruce said the following:

has anybody come across a really good 'open source' chunk of code for
sending/recieving confirmation emails from an app... i'd like to allow the
user to register, and send them an email that they then have to hit the link
to complete the process..


You may want to take a look at this class that does all that you want:

http://www.phpclasses.org/access_user


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



[PHP] Re: hidden database issue????

2005-09-12 Thread Michael Stassen

bruce wrote:

hi...

i have a situation with a server that i have. i have mysql installed with
php..

the mysql is V4.1.12. i'm trying to see/view a database from the command
line and i can't see it when i login to mysql as root. i also can't see it
when i try to login to mysql as the given user.


How are trying to see it?  That is, what command are you using?


from the php app, i see that the app makes a valid connection using:
 host= 192.168.1.foo
 dbname  = cat
 user= dog
 passwd  = dog

i've tracked the code, it's making the connection, and interfacing with the
database/tables...

however, when i try to access the db as either root/dog, i can't see the
database 'cat'
  mysql -udog -pdog -h192.168.1.foo
  mysql -uroot -p


Have you verified that mysql believes you are root or dog?


neither one of these approaches sems to work, ie, i can't see the 'cat'
database in the mysql list of tables...

any idea what's going on...

when i get into mysql as root, i can see/manipulate all the other databases.

thanks for any pointers/thoughts/etc...

searching google hasn't led to any solid solutions..

thanks

-bruce
[EMAIL PROTECTED]


Perhaps I am just misreading your statement "i can't see the 'cat' database 
in the mysql list of tables...", but you seem to be confusing database and 
table.  If cat is a db, then it is not a table in the mysql db.  If you are 
logged into mysql as a user who has access to cat, you will see it in the 
output of


  SHOW DATABASES;

You can set cat as the default db by issuing

  USE cat;

After that, you can see the tables in cat by entering

  SHOW TABLES;

If that's not the issue, you can confirm that you are logged in as the 
correct user with


  SELECT CURRENT_USER();

and you can check on said user's permissions with (using [EMAIL PROTECTED] as 
the user):


  SHOW GRANTS FOR [EMAIL PROTECTED];

If I'm on the wrong track, just send any additional info needed to clarify 
your problem.


Michael

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



Re: [PHP] Re: Best way to mass mail

2005-09-12 Thread Ryan A
Hey,
Thanks Mark, Matthew, Manuel and Miles.

(Yep, even i thought it was quite funny how only ppl with their firstnames
that start with M replied :-D ,
sounds almost like I will be quoting the bible next!)

You guys have given me some very good starting points, will look into it.

Feel free to chip in anything else that may come to mind.

Cheers,
Ryan

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



RE: [PHP] Re: Best way to mass mail

2005-09-12 Thread Chris W. Parker
Matthew Weier O'Phinney 
on Monday, September 12, 2005 6:55 AM said:

> Mails are then queued to an MTA -- in our case, Postfix.

This is the part I don't know how to do. Can you explain/show some code?


Thanks,
Chris.

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



Re: [PHP] Best way to mass mail

2005-09-12 Thread Dragan Stanojevic - Nevidljivi

Ryan A wrote:

> My client has a dating site and now he wants to mail all his members,
> he does not want to use any of the already installed mailing lists 
but wants

> us to make one


> The thing that bothers me the most is if the program times out..., 
how do I

> start again from
> the ones that have not been sent?


> Ideas/suggestions?


You may even try to look at: http://pear.php.net/package/Mail_Queue

bye,
N::


smime.p7s
Description: S/MIME Cryptographic Signature


RE: [PHP] confirmation email script/code

2005-09-12 Thread Jim Moseby
> 
> -Original Message-
> From: Jim Moseby [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 12, 2005 8:56 AM
> To: '[EMAIL PROTECTED]'; php-general@lists.php.net
> Subject: RE: [PHP] confirmation email script/code
> 
> 
> > has anybody come across a really good 'open source' chunk 
> of code for
> > sending/recieving confirmation emails from an app... i'd like
> > to allow the
> > user to register, and send them an email that they then have
> > to hit the link
> > to complete the process..
> 
> It is strightforward to write this yourself.  In my simple example, I
> generate a 32 byte random ID when the user registers and save 
> it along with
> his data in the DB. Then, I send him an email with a link like this:
> 
> www.example.com/register.php?id=7H7dh869ha320J6GhAs89L0lJ00j09
> df?action=conf
> irm
>
>When he clicks the link, I flip a flag in his DB record that he has
>confirmed.
>
>I have cron periodically go and clean up unconfirmed records that have
timed
>out.
>
>JM
> 
> jim...
> 
> pretty much what i had thought about... question.. how does 
> one correctly!!!
> set up a cron process...
> 
> i assume that i can write a quick perl/php app that iterates 
> through the
> 'emailconfirmTBL' looking at the date, and the confirm status. if the
> cleanup app sees any records that are over a certain age, and 
> haven't been
> confirmed, it can simply delete the record. but shouldn't the 
> cleanup also
> do a rollback/delete of the user registration records as well...
> 
> this kind of approach would lend itself to being monitored by 
> an admin who
> could then look to see where in the process a given user is/was...
> 
> any good/quick guides you can point me to!
> 

Yeah, whatever you need to do to keep your DB happy.  What I did was write a
php script that shuffles through the database and deletes any registration
records from the `users` table that weren't confirmed within 7 days of
sign-up.  Then set up a cron job (see "man crontab") that runs it once per
day.  It emails me a report about what it did when it's done.

JM

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



Re: [PHP] Re: Best way to mass mail

2005-09-12 Thread Manuel Lemos

Hello,

on 09/12/2005 02:56 PM Chris W. Parker said the following:

Matthew Weier O'Phinney 
on Monday, September 12, 2005 6:55 AM said:


Mails are then queued to an MTA -- in our case, Postfix.


This is the part I don't know how to do. Can you explain/show some code?


Just use the mail function and it will get queued in Postfix.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



[PHP] DOM XML compatible PHP4 & PHP5

2005-09-12 Thread Florent Monnier
Hi,

Is there a way to make dom xml applications compatible PHP4 and PHP5?

Thanks

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



Re: [PHP] Best way to mass mail

2005-09-12 Thread Ryan A
Hey,


> You may even try to look at: http://pear.php.net/package/Mail_Queue


Thanks, Will do!

Cheers,
Ryan

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



[PHP] Opinion Request - No PHP content - Versioning Systems

2005-09-12 Thread John Nichel

Hey, I'm about to implement a versioning system here, and was going to
go with CVS, but being that I haven't used it in almost two years I was
wondering what y'all think?  Opinions on the best, user-friendly (Mac
Geeks will be using it), etc?  Thanks.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



[PHP] incrementing in a for loop

2005-09-12 Thread Peppy
I've searched online and am unable to find how to increment by more than one in 
a for loop.

for ($i = 1; $i <= 6; $i++) {

Is it possible to increment $i by 5?

Thanks.


Re: [PHP] incrementing in a for loop

2005-09-12 Thread Philip Hallstrom
I've searched online and am unable to find how to increment by more than 
one in a for loop.


for ($i = 1; $i <= 6; $i++) {

Is it possible to increment $i by 5?


Sure.

for ($i = 1; $i <= 6; $i+=5) {

-philip

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



Re: [PHP] incrementing in a for loop

2005-09-12 Thread Stephen Johnson


On 9/12/05 12:39 PM, "Peppy" <[EMAIL PROTECTED]> wrote:

> for ($i = 1; $i <= 6; $i++) {
>Is it possible to increment $i by 5?

for ($i = 1; $i <= 6; $i+5) {


-- 
Stephen Johnson
The Lone Coder

http://www.ouradoptionblog.com
*Join us on our adoption journey*

[EMAIL PROTECTED]
http://www.thelonecoder.com

*Continuing the struggle against bad code*
--

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



RE: [PHP] Opinion Request - No PHP content - Versioning Systems

2005-09-12 Thread Murray @ PlanetThoughtful
 
> Hey, I'm about to implement a versioning system here, and was going to
> go with CVS, but being that I haven't used it in almost two years I was
> wondering what y'all think?  Opinions on the best, user-friendly (Mac
> Geeks will be using it), etc?  Thanks.
> 

Hi John,

I only have experience with CVS and Subversion, but of the two, I *much*
prefer Subversion. Could be a purely subjective thing, but it's worth
looking into all the same.

http://subversion.tigris.org/

Much warmth,

Murray
---
"Lost in thought..."
http://www.planetthoughtful.org

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



Re: [PHP] incrementing in a for loop

2005-09-12 Thread D A GERM

this worked for me:

[CODE]
   for ($myLoop = 0; $myLoop < 100; $myLoop= $myLoop + 5)
   {
   print "my loop: $myLoop";
   }
[/CODE]

Peppy wrote:


I've searched online and am unable to find how to increment by more than one in 
a for loop.

for ($i = 1; $i <= 6; $i++) {

Is it possible to increment $i by 5?

Thanks.

 



--
D. Aaron Germ
Scarborough Library, Shepherd University
(304) 876-5423

"Well then what am I supposed to do with all my creative ideas- take a bath and wash 
myself with them? 'Cause that is what soap is for" (Peter, Family Guy)

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



Re: [PHP] Opinion Request - No PHP content - Versioning Systems

2005-09-12 Thread Miles Thompson

At 04:43 PM 9/12/2005, John Nichel wrote:

Hey, I'm about to implement a versioning system here, and was going to
go with CVS, but being that I haven't used it in almost two years I was
wondering what y'all think?  Opinions on the best, user-friendly (Mac
Geeks will be using it), etc?  Thanks.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]



John,

I'm using Subversion with Tortoise (this is for Windows), in a one man 
operation, and mostly for Visual Basic work. Merges can get a little hairy 
because I have some hideously complexforms, but it does allow me to keep a 
trunk line to support users and do my development in a branch.


No experience with a Subversion add-in for the Mac.

Heck, ya gotta like it just for its name.

Miles

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



Re: [PHP] Re: Best way to mass mail

2005-09-12 Thread Matthew Weier O'Phinney
* Manuel Lemos <[EMAIL PROTECTED]> :
> Hello,
>
> on 09/12/2005 02:56 PM Chris W. Parker said the following:
> > Matthew Weier O'Phinney 
> > on Monday, September 12, 2005 6:55 AM said:
> > 
> > > Mails are then queued to an MTA -- in our case, Postfix.
> > 
> > This is the part I don't know how to do. Can you explain/show some code?
>
> Just use the mail function and it will get queued in Postfix.

Or mail via SMTP to running postfix/sendmail/whatever.

-- 
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

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



Re: [PHP] Re: Best way to mass mail

2005-09-12 Thread Manuel Lemos

Hello,

on 09/12/2005 05:18 PM Matthew Weier O'Phinney said the following:

Mails are then queued to an MTA -- in our case, Postfix.

This is the part I don't know how to do. Can you explain/show some code?

Just use the mail function and it will get queued in Postfix.


Or mail via SMTP to running postfix/sendmail/whatever.


If he is running postfix on the same machine that postfix is running, it 
 does not make much sense to send the message via SMTP because it is a 
much slower way to do the same thing.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



RE: [PHP] Re: Best way to mass mail

2005-09-12 Thread Chris W. Parker
Manuel Lemos 
on Monday, September 12, 2005 1:36 PM said:

> If he is running postfix on the same machine that postfix is running,
>   it does not make much sense to send the message via SMTP because it
> is a much slower way to do the same thing.

I'm not. I was hoping to glean a method for Postfix that I could apply
to sendmail.


Chris.

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



Re: [PHP] Re: Best way to mass mail

2005-09-12 Thread Manuel Lemos

Hello,

on 09/12/2005 06:30 PM Chris W. Parker said the following:

Manuel Lemos 
on Monday, September 12, 2005 1:36 PM said:


If he is running postfix on the same machine that postfix is running,
  it does not make much sense to send the message via SMTP because it
is a much slower way to do the same thing.


I'm not. I was hoping to glean a method for Postfix that I could apply
to sendmail.


Postfix is compatible with sendmail. It provides a wrapper program also 
named sendmail to act as a replacement. This is standard in Unix/Linux 
machines. Usually you only have on MTA program installed that can either 
be sendmail, postfix, qmail, exim, etc.. If you use the mail() function, 
it uses whatever is installed in your machine because by default it 
calls the sendmail program.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



Re: [PHP] incrementing in a for loop

2005-09-12 Thread M. Sokolewicz

Stephen Johnson wrote:


On 9/12/05 12:39 PM, "Peppy" <[EMAIL PROTECTED]> wrote:



for ($i = 1; $i <= 6; $i++) {
Is it possible to increment $i by 5?



for ($i = 1; $i <= 6; $i+5) {



that won't work; have you tried it?
Because $i++ assigns the result of $i+1 to $i, while yours does not 
assign anything to $i. This means you'll run an eternal loop ;)

to do what you showed, you'll need to change $i+5 to $i=$i+5 or $i += 5

- tul

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



Re: [PHP] incrementing in a for loop

2005-09-12 Thread Stephen Johnson
You are correct -- forgive the typo (I forgot the = ).

That is what I get trying to reply to email while eating a burrito and
talking on the phone. LOL
 
http://www.ouradoptionblog.com
Join our journey of adoption

http://www.thelonecoder.com
[EMAIL PROTECTED]

continuing the struggle against bad code

*/ 
?>


> From: "M. Sokolewicz" <[EMAIL PROTECTED]>
> Date: Mon, 12 Sep 2005 23:48:05 +0200
> To: Stephen Johnson <[EMAIL PROTECTED]>
> Cc: Peppy <[EMAIL PROTECTED]>, 
> Subject: Re: [PHP] incrementing in a for loop
> 
> 
>> 
>> 
> that won't work; have you tried it?
> Because $i++ assigns the result of $i+1 to $i, while yours does not
> assign anything to $i. This means you'll run an eternal loop ;)
> to do what you showed, you'll need to change $i+5 to $i=$i+5 or $i += 5

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



RE: [PHP] Re: Best way to mass mail

2005-09-12 Thread Chris W. Parker
Manuel Lemos 
on Monday, September 12, 2005 2:41 PM said:

> If you use
> the mail() function, it uses whatever is installed in your machine
> because by default it calls the sendmail program.

I am aware of that but the problem I'm having is inconsistent mailings.
For example, an email is supposed to be sent to me everytime someone
creates a new account on our website but I only get about 1 out of 5 of
these emails and I have no idea why. I was trying to take PHP out of the
loop with regards to sending email so that I could rule out PHP as being
the problem.



Chris.

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



RE: [PHP] incrementing in a for loop

2005-09-12 Thread Chris W. Parker
D A GERM 
on Monday, September 12, 2005 1:01 PM said:

> [CODE]
> for ($myLoop = 0; $myLoop < 100; $myLoop= $myLoop + 5)
> {
> print "my loop: $myLoop";
> }
> [/CODE]

Where's the code?


Oh there it is!

:)

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



Re: [PHP] Re: Best way to mass mail

2005-09-12 Thread Manuel Lemos

Hello,

on 09/12/2005 06:48 PM Chris W. Parker said the following:

If you use
the mail() function, it uses whatever is installed in your machine
because by default it calls the sendmail program.


I am aware of that but the problem I'm having is inconsistent mailings.
For example, an email is supposed to be sent to me everytime someone
creates a new account on our website but I only get about 1 out of 5 of
these emails and I have no idea why. I was trying to take PHP out of the
loop with regards to sending email so that I could rule out PHP as being
the problem.


If you use PHP mail() function it just calls the sendmail wrapper. If 
you loose messages, you should check the logs of the installed MTA. Your 
problem seems to be misconfiguration like you are not setting a valid 
return path address or your machine does not have a reverse record for 
its IP in the DNS.


For certain kinds of problems, I usually recommend this class that comes 
with a wrapper function named smtp_mail(). It works like the mail() 
function but injects the message via the SMTP server. However, I am not 
sure if it will work any better if your problems are one of those that I 
suggested above. In any case, you can try it:


http://www.phpclasses.org/mimemessage

You also would need this:

http://www.phpclasses.org/smtpclass


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



RE: [PHP] Re: Best way to mass mail

2005-09-12 Thread Chris W. Parker
Manuel Lemos 
on Monday, September 12, 2005 3:15 PM said:

> If you use PHP mail() function it just calls the sendmail wrapper. If
> you loose messages, you should check the logs of the installed MTA.
> Your problem seems to be misconfiguration like you are not setting a
> valid return path address or your machine does not have a reverse
> record for its IP in the DNS.

Thanks for the suggestion(s). I will look into it.


Chris.

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



[PHP] mktime

2005-09-12 Thread Dan Brow
A little confused with mktime, I'm trying to get how many days are in a
year.

$year = "2006";
$epoch = mktime(0, 0, 0, 1, 0, $year); // I have to have 1 for month or
I get which day it is now. Which sucks.
$date = date("z Y", $epoch); 
print($date); // here is the problem, I get 365 days, but the year is
2005, not 2006, same goes for any year I put in.

What am I doing wrong?

Thanks,
Dan.

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



[PHP] Re: mktime

2005-09-12 Thread Brian P. O'Donnell

"Dan Brow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> A little confused with mktime, I'm trying to get how many days are in a
> year.
>
> $year = "2006";
> $epoch = mktime(0, 0, 0, 1, 0, $year); // I have to have 1 for month or
> I get which day it is now. Which sucks.
> $date = date("z Y", $epoch);
> print($date); // here is the problem, I get 365 days, but the year is
> 2005, not 2006, same goes for any year I put in.
>
> What am I doing wrong?

January 0th is December 31st last year

Brian

>
> Thanks,
> Dan.

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



Re: [PHP] mktime

2005-09-12 Thread Jasper Bryant-Greene

Dan Brow wrote:

A little confused with mktime, I'm trying to get how many days are in a
year.


How about doing it differently. I'd tackle this problem like this:



--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



[PHP] Problem with PEAR:SOAP

2005-09-12 Thread -k.
I just installed the SOAP Pear package (version 0.9.1) when i try and:
require_once('SOAP/Client.php');

i get the following errors:
Warning: main(HTTP/Request.php): failed to open stream: No such file or 
directory in
/usr/local/lib/php/SOAP/WSDL.php on line 27

Fatal error: main(): Failed opening required 'HTTP/Request.php'
(include_path='.:/usr/local/lib/php') in /usr/local/lib/php/SOAP/WSDL.php on 
line 27

Line 27 in WSDL.php is, as you might guess, 
require_once 'HTTP/Request.php';

I looked in /usr/local/lib/php/ and there is no HTTP directory (much less a 
Request.php). I have
the HTTP PEAR package installed (Version 1.3.6 ). My question is should 
installing the HTTP
package put these files in /usr/local/lib/php ? If not what are these files? 
And where do i get
them? Am i missing a dependency or something? Did i install HTTP incorrectly?



-k.



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: [PHP] Problem with PEAR:SOAP

2005-09-12 Thread Jasper Bryant-Greene

-k. wrote:

Fatal error: main(): Failed opening required 'HTTP/Request.php'
(include_path='.:/usr/local/lib/php') in /usr/local/lib/php/SOAP/WSDL.php on 
line 27

Line 27 in WSDL.php is, as you might guess, 
require_once 'HTTP/Request.php';


I looked in /usr/local/lib/php/ and there is no HTTP directory (much less a 
Request.php). I have
the HTTP PEAR package installed (Version 1.3.6 ). My question is should 
installing the HTTP
package put these files in /usr/local/lib/php ? If not what are these files? 
And where do i get
them? Am i missing a dependency or something? Did i install HTTP incorrectly?


Install the HTTP_Request package.

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



Re: [PHP] mktime

2005-09-12 Thread Brian P. O'Donnell

"Jasper Bryant-Greene" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dan Brow wrote:
> > A little confused with mktime, I'm trying to get how many days are in a
> > year.
>
> How about doing it differently. I'd tackle this problem like this:
>
>  $year = '2005';
> $time = strtotime("1 January $year");
> $isLeapYear = date('L', $time);
>
> if($isLeapYear == '1') {
> $days = 366;
> } else {
> $days = 365;
> }
> ?>

I'd shorten it up even more:



Brian

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



[PHP] COM and MS word.

2005-09-12 Thread Dave Lists

Hi all,
I'm using com to acces MS word and building tables:
$word->Documents-Add();  \\ Gives me a new doc
$word->Selection->InsertAfter("poo, foo, you"); \\ gives me one row
$word->Selection->ConvertToTable(","); \\ converts the table to a row.

What I can't work out is how to change the width on the first column. 
I've tried various ways to use SetWidth but failed. Any got any 
experince or examples of how to use word from PHP to generate tables and 
layout documents?


Dave.

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



[PHP] can't connect to mysql

2005-09-12 Thread blackwater dev
I finally got php5 compiled with mysql but now I can't connect using
mysql_connect without getting the error of:

Warning: mysql_connect() [function.mysql-connect]: Can't connect to
local MySQL server through socket '/tmp/mysql.sock' (2) in...

I can ssh into the box and log in to mysql so I think it's running. 
Plus if I try to run mysqld, I get this error:

ning] Asked for 196608 thread stack, but got 126976
050912 19:57:04 [ERROR] Can't start server: Bind on TCP/IP port:
Address already in use
050912 19:57:04 [ERROR] Do you already have another mysqld server
running on port: 3306 ?
050912 19:57:04 [ERROR] Aborting

050912 19:57:04 [Note] mysqld: Shutdown complete

What could be wrong??

Thanks!

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



[PHP] turning off echoing of chars

2005-09-12 Thread matt VanDeWalle

hello,
I am wanting to turn of screen echo for a login function or changing a 
password or similar things.  I got the function to almost work, however it 
turns off the screen echo but it asks for the password, won't give you a 
chance to fill it in, and skips right on to the next prompt(and has the 
"non-echoing" for that stuff.  incase this isn't clear which i assume alot 
of things which I guess i shouldnt ok, what i am doing:

*/ code snippit here */
socket_write($sock, "enter a username");
$name = socket_read($sock, 1024, PHP_NORMAL_READ);
/* all good to this point */
socket_write($sock, "enter a password");
socket_write($sock, sprintf("%c%c%c",255,251,1));
$pwd = socket_read($sock, 1024, PHP_NORMAL_READ);
/* will skip right on by to the next prompt and fill in $pwd with some of 
those non-alphanumeric chars */


and the next prompt is where the no-screen-echo finally works like it 
should

I must be doing something incorrectly but, what?
thanks
matt

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



[PHP] Problem with POST reply

2005-09-12 Thread Dean Maunder
Hi,
I am using PHP to post a request to a server which returns an XML
document.
We have no problems with the same service if we use a get request.
Here is the result:
 
HTTP/1.1 200 OK
Date: Tue, 13 Sep 2005 02:01:53 GMT
Server: Apache
Set-Cookie: MDIN=2005091280922301026;domain=.blah.com;path=/;expires=Fri
31-Dec-2010 23:59:59 GMT
Set-Cookie: mapsize=small;domain=.blah.com;path=/;expires=Fri
31-Dec-2010 23:59:59 GMT
Connection: close
Transfer-Encoding: chunked
Content-Type: text/xml
 
2000




The issue is the '2000' that appears...it inserts itself every 250 lines
or there abouts and screws up the XML.
Heres the code I am using to post the request:
 
function http_post($server, $port, $url, $vars) {
 $user_agent = "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)";
 $urlencoded = "";
 while (list($key,$value) = each($vars))
  $urlencoded.= urlencode($key) . "=" . urlencode($value) . "&";
 $urlencoded = substr($urlencoded,0,-1); 
 $content_length = strlen($urlencoded);
 $headers = "POST $url HTTP/1.1
Accept: */*
Accept-Language: en-au
Content-Type: application/x-www-form-urlencoded
User-Agent: $user_agent
Host: $server
Connection: Keep-Alive
Cache-Control: no-cache
Content-Length: $content_length";
 
 $fp = fsockopen($server, $port, $errno, $errstr);
 if (!$fp) {
  return false;
 }
 
 fputs($fp, $headers);
 fputs($fp, $urlencoded);
 
 $ret = "";
 while (!feof($fp))
  $ret.= fgets($fp, $content_length);

 fclose($fp);
 
 return $ret;
 
}
 
Can anyone see where this '2000' might be comming from?
Thanks
Dean.
 


[PHP] Re: Problem with POST reply

2005-09-12 Thread Manuel Lemos

Hello,

on 09/12/2005 11:08 PM Dean Maunder said the following:

Can anyone see where this '2000' might be comming from?


It's because the response encoding is chunked. You can read about chunks 
in the RFC documents.


You may also want to try this HTTP client that can send HTTP requests 
and de-chunk the responses, when necessary:


http://www.phpclasses.org/httpclient


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



Re: [PHP] Re: Best way to mass mail

2005-09-12 Thread Matthew Weier O'Phinney
* Manuel Lemos <[EMAIL PROTECTED]> :
> on 09/12/2005 05:18 PM Matthew Weier O'Phinney said the following:
> > > > > Mails are then queued to an MTA -- in our case, Postfix.
> > > > This is the part I don't know how to do. Can you explain/show
> > > > some code?
> > > Just use the mail function and it will get queued in Postfix.
> > 
> > Or mail via SMTP to running postfix/sendmail/whatever.
>
> If he is running postfix on the same machine that postfix is running,
> it does not make much sense to send the message via SMTP because it is
> a much slower way to do the same thing.

This was more in the instance that the server with the MTA is separate
from the web server (which it often will be). You're right though -- if
the MTA is on the same machine, just use the local executables.

-- 
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

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



[PHP] RE: Problem with POST reply

2005-09-12 Thread Dean Maunder


> It's because the response encoding is chunked. You can read about
chunks in the RFC documents.
I thought if I sent a Content-Length header, then the results would be
de-chunked?


Regards
Dean.

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



[PHP] Re: Problem with POST reply

2005-09-12 Thread Manuel Lemos

Hello,

on 09/12/2005 11:29 PM Dean Maunder said the following:



It's because the response encoding is chunked. You can read about

chunks in the RFC documents.
I thought if I sent a Content-Length header, then the results would be
de-chunked?


The content-length header that you send is of the request data length. 
It has nothing to do with the response.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



Re: [PHP] RE: Problem with POST reply

2005-09-12 Thread Jasper Bryant-Greene

Dean Maunder wrote:



It's because the response encoding is chunked. You can read about


chunks in the RFC documents.
I thought if I sent a Content-Length header, then the results would be
de-chunked?


You may want to try the CURL functions for PHP which can do a POST 
request and will handle the de-chunking for you.


http://php.net/curl

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



Re: [PHP] mktime

2005-09-12 Thread Dan Brow
On Tue, 2005-09-13 at 11:13 +1200, Jasper Bryant-Greene wrote:
> Dan Brow wrote:
> > A little confused with mktime, I'm trying to get how many days are in a
> > year.
> 
> How about doing it differently. I'd tackle this problem like this:
> 
>  $year = '2005';
> $time = strtotime("1 January $year");
> $isLeapYear = date('L', $time);
> 
> if($isLeapYear == '1') {
>   $days = 366;
> } else {
>   $days = 365;
> }
> ?>



Thanks.

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



Re: [PHP] mktime

2005-09-12 Thread Dan Brow
snip
> 
> I'd shorten it up even more:
> 
>  $daysinyear = 365 + date("L", strtotime("jan 1 " . $year));
> ?>

Thanks works perfect.

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



[PHP] Problem w/ reading a txt file.

2005-09-12 Thread sub

 Problem w/ reading a txt file.
 
 The error I get is "Warning: opendir(/home/pudlz/public_html ): failed to
 open dir: No such file or directory "
 
 Here's my code::
 
 $main = file('folders.txt');
 $counter = count($main);
 
 for($i=0;$i<$counter;$i++)
 {
  if ($handle = opendir("$main[$i]"))
  {
 $b=0;
   }
 }
 
 
 It's reading and extra space at the end of all my lines. How do I prevent
 that?
 
 Andrew Darrow
 Kronos1 Productions
 www.pudlz.com

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



[PHP] xml parse engine written in php

2005-09-12 Thread Will
Free for the taking, here's a simple, lenient (flawed?) xml parse engine 
written in php if anyone is interested in expanding such a thing.


http://fribbler.us/code/

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



Re: [PHP] xml parse engine written in php

2005-09-12 Thread Jasper Bryant-Greene

Will wrote:
Free for the taking, here's a simple, lenient (flawed?) xml parse engine 
written in php if anyone is interested in expanding such a thing.


http://fribbler.us/code/



Not to put down your efforts or anything, but what's wrong with 
SimpleXML, DOM XML, XML Reader, XML Parser etc. all of which are native 
PHP functions?


--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

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



Re: [PHP] xml parse engine written in php

2005-09-12 Thread Will

Jasper Bryant-Greene wrote:


Will wrote:

Free for the taking, here's a simple, lenient (flawed?) xml parse 
engine written in php if anyone is interested in expanding such a thing.


http://fribbler.us/code/



Not to put down your efforts or anything, but what's wrong with 
SimpleXML, DOM XML, XML Reader, XML Parser etc. all of which are 
native PHP functions?


I don't know, I've not looked at them. Does offering another 
implementation of a concept imply that there is something wrong with 
existing implementations? If that is the case, I wouldn't have bothered 
sharing since I don't want to offend anyone. It was just a learning 
exercise.


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



Re: [PHP] xml parse engine written in php

2005-09-12 Thread Jasper Bryant-Greene

Will wrote:

Jasper Bryant-Greene wrote:


Will wrote:

Free for the taking, here's a simple, lenient (flawed?) xml parse 
engine written in php if anyone is interested in expanding such a thing.


http://fribbler.us/code/



Not to put down your efforts or anything, but what's wrong with 
SimpleXML, DOM XML, XML Reader, XML Parser etc. all of which are 
native PHP functions?


I don't know, I've not looked at them. Does offering another 
implementation of a concept imply that there is something wrong with 
existing implementations? If that is the case, I wouldn't have bothered 
sharing since I don't want to offend anyone. It was just a learning 
exercise.




No, of course the offering of a new implementation does not imply there 
is something wrong with the existing ones. However, re-inventing the 
wheel is an expensive exercise unless there is something wrong with the 
existing implementations.


I hope that you don't take this the wrong way; I was merely pointing out 
that someone else has already done this.


--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

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



[PHP] PHP 5, LDAP/Active Directory

2005-09-12 Thread Joe Wollard

Greetings all:

I've looked through php.net and scoured Google for a solution to an  
issue I'm having with PHP and LDAP but have so far found nothing. I'm  
trying to build an intranet site that uses the company LDAP (Active  
Directory really) service but I can't seem to get around the  
"Operations error" and other such messages when trying to bind.


On my server I'm running:
Fedora Core 4
Apache 2
PHP 5 compiled with OpenLDAP

I must confess that I'm very new to LDAP so it is likely that my  
problem is inexperience, but it seems that this issue has been  
resolved by others so I'm trying to figure out what I'm doing wrong.


To shed more light on the topic, bug #30670 [ http://bugs.php.net/ 
bug.php?id=30670&edit=0 ] seems to fit my situation perfectly. As  
some of the posts on that bug suggest, I've tried using

ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION,3);
ldap_set_option($ldap, LDAP_OPT_REFERRALS,0);
between ldap_connect and ldap_bind but I still get the "Operations  
error" message. Everyone seems to be able to get this to work as long  
as they are running PHP4, but I have yet to see (or realize I've  
seen) a solution from someone using PHP5. I've also found where  
"blizzards at libero dot it" has posted "When querying a windows  
2000/2003 AD you MUST use only SASL and not TLS (non supported)."

- Is this true?

Another thing worth mentioning here is that the company I work for  
has allowed us to build our own intranet system for our Dept and  
offers little to no support for server specs and settings, but I will  
try to get any information to the list that might be helpful.


Thanks in advance for any advice or direction you can provide on this  
topic.

-Joe W

Re: [PHP] can't connect to mysql

2005-09-12 Thread Gustav Wiberg

Hi there!

What code are you using? Try with the mysqli...
http://se2.php.net/manual/en/ref.mysqli.php

/G

- Original Message - 
From: "blackwater dev" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, September 13, 2005 3:09 AM
Subject: [PHP] can't connect to mysql


I finally got php5 compiled with mysql but now I can't connect using
mysql_connect without getting the error of:

Warning: mysql_connect() [function.mysql-connect]: Can't connect to
local MySQL server through socket '/tmp/mysql.sock' (2) in...

I can ssh into the box and log in to mysql so I think it's running. 
Plus if I try to run mysqld, I get this error:


ning] Asked for 196608 thread stack, but got 126976
050912 19:57:04 [ERROR] Can't start server: Bind on TCP/IP port:
Address already in use
050912 19:57:04 [ERROR] Do you already have another mysqld server
running on port: 3306 ?
050912 19:57:04 [ERROR] Aborting

050912 19:57:04 [Note] mysqld: Shutdown complete

What could be wrong??

Thanks!

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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 2005-09-10

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