[PHP] PDF.

2006-09-19 Thread Jo�o C�ndido de Souza Neto
Hi everyone.

I´m using the fpdf class to create pdf files report and it works fine.

Now i need to get a standard pdf and put some data into for complete data. 
There´s some way to get an existent pdf file and put data into?

Thanks a lot.

-- 
João Cândido de Souza Neto
Curitiba Online
[EMAIL PROTECTED]
(41) 3324-2294 (41) 9985-6894
http://www.curitibaonline.com.br 

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



Re: [PHP] PDF.

2006-09-19 Thread Ray Hauge
On Tuesday 19 September 2006 08:21, João Cândido de Souza Neto wrote:
> Hi everyone.
>
> I�m using the fpdf class to create pdf files report and it works fine.
>
> Now i need to get a standard pdf and put some data into for complete data.
> There�s some way to get an existent pdf file and put data into?
>
> Thanks a lot.
>
> --
> Jo�o C�ndido de Souza Neto
> Curitiba Online
> [EMAIL PROTECTED]
> (41) 3324-2294 (41) 9985-6894
> http://www.curitibaonline.com.br

FPDI extends the FPDF class to allow you to import an existing PDF and then 
put data on top of it.  I use it a lot at work.

http://fpdi.setasign.de/index.php

-- 
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] PDF.

2006-09-19 Thread Jo�o C�ndido de Souza Neto
Ok, I´ll take a look at this.

Thanks a lot.

"Ray Hauge" <[EMAIL PROTECTED]> escreveu na mensagem 
news:[EMAIL PROTECTED]
On Tuesday 19 September 2006 08:21, João Cândido de Souza Neto wrote:
> Hi everyone.
>
> Im using the fpdf class to create pdf files report and it works fine.
>
> Now i need to get a standard pdf and put some data into for complete data.
> Theres some way to get an existent pdf file and put data into?
>
> Thanks a lot.
>
> --
> Joo Cndido de Souza Neto
> Curitiba Online
> [EMAIL PROTECTED]
> (41) 3324-2294 (41) 9985-6894
> http://www.curitibaonline.com.br

FPDI extends the FPDF class to allow you to import an existing PDF and then
put data on top of it.  I use it a lot at work.

http://fpdi.setasign.de/index.php

-- 
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] Frustrated trying to get help from your site

2006-09-19 Thread Kae Verens

Richard Lynch wrote:

In brief, to explain a snapshot in layman's terms:


that's probably a bad idea.

anyone that doesn't know what a snapshot is, probably shouldn't need to know - 
they are most likely working in a package-based environment (either Windows, 
or an RPM-based Linux), where it would be more beneficial to explain how they 
can upgrade their systems using packages.


If you go down the route of explaining what a "snapshot" is, then you will 
find yourself being asked what "gcc" is, and where you can get it...


Tim, you are better off asking one of your administrators for help.

Kae

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



[PHP] Re: My apologies

2006-09-19 Thread Kae Verens

Howard, Tim wrote:

documentation on your site.  When I find the solution to my problem, I
will be sure to add comments to the appropriate page so that you will
not have to endure the ranting of frustrated programmers.



of course, you still haven't explained what the problem is, that you are having.

Kae

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



Re: [PHP] Reverse of date("w")

2006-09-19 Thread Kevin Murphy

Kevin Murphy wrote:


Not really. If it were always "today" that would work, but in this
case, I was thinking of storing a day of the week in a database
("3"), and then display the info based on that digit. So assuming
that the number was in fact 3, then:

echo date("D","3");

Would return "Wed".

Is there any function like that? Oh, and it has to run on PHP 4.



Any reason you wouldn't write it yourself?




No reason. and its what I was planning on. I just was hoping that  
there was a pre-built function that I was just not seeing. Your  
solution above is probably the best one. Thanks.


--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada Community College
www.wncc.edu
775-445-3326

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



[PHP] FTP Copy

2006-09-19 Thread Matt Palermo
I've been looking on php.net, but can't find anything that covers this... 
Basically, I am using PHP FTP to connect to an FTP server and run some 
functions.  I want to copy a directory on the FTP server to another 
directory on the FTP server.  Since there isn't an ftp_copy() function, I 
have to use ftp_get() to bring the file to the local webserver temp folder, 
then use ftp_put() to place it into a different folder on the FTP server. 
This is quite a big pain, since the webserver is not on the same network as 
the remote FTP server, so it must download the file and then upload it to a 
different place (takes a long time).  Is there an FTP that will just copy 
the file/folder from the FTP server without the need to download/upload it 
somewhere else?

Thanks,

Matt 

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



[PHP] Long Shot Question

2006-09-19 Thread Ray Hauge
Hello everyone,

This is a tad off-topic, but I'm at my wits end.  I'm working on a loan 
calculator for our load advisors to give an estimated monthly payment.  We 
had one, but it was really bad (gave horribly wrong information) and I've had 
to re-write it.  The particular question about this loan calculator is on a 
graduated repayment type.  This is where the loan pretty much starts off 
paying only interest and then increases the payments by a certain percentage 
(graduation factor) every time the rate increase is supposed to happen 
(graduation term)... which is usually two years.

I've looked all over google, wikipedia, and I've even called our servicers 
(who you'd think would help you out, but instead they just tell you they 
can't give me those calculations).  I have found a few other calculators 
online that do this sort of thing, but I can't exactly see the source code 
that way ;)

This seems like a somewhat standard calculation for loans and interest bearing 
accounts. Does anyone know how to calculate the graduation factor?  I've been 
able to figure out it's based off the loan term, loan balance, and initial 
interest rate.

Example:
$30,000 balance
6% initial interest rate
20 year loan term

with those variables you would get a graduation factor of 6.95%

So, the first payment would be $166.53, and then after the graduation term (2 
years) the payment would increase to $178.10, then two years later increase 
again, and so on.  That differnce in payment is pretty close to the 
graduation factor.  It's probably off due to the rounding.

Thanks for placating me when grasping for straws ;)

-- 
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] Long Shot Question

2006-09-19 Thread Jay Blanchard
[snip]
This seems like a somewhat standard calculation for loans and interest
bearing accounts. Does anyone know how to calculate the graduation
factor?  I've been able to figure out it's based off the loan term, loan
balance, and initial interest rate.
[/snip]

It is called amortization ... 

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



Re: [PHP] Long Shot Question

2006-09-19 Thread Ray Hauge
On Tuesday 19 September 2006 10:20, Jay Blanchard wrote:
> [snip]
> This seems like a somewhat standard calculation for loans and interest
> bearing accounts. Does anyone know how to calculate the graduation
> factor?  I've been able to figure out it's based off the loan term, loan
> balance, and initial interest rate.
> [/snip]
>
> It is called amortization ...

I should have known that ;)  That's what happens when you're looking too 
closely at a problem.

thanks!

-- 
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] Long Shot Question

2006-09-19 Thread Jay Blanchard
[snip]
[snip]
This seems like a somewhat standard calculation for loans and
interest
bearing accounts. Does anyone know how to calculate the
graduation
factor?  I've been able to figure out it's based off the loan
term,   loan balance, and initial interest rate.
[/snip]
It is called amortization ... 
[/snip]

http://www.hughchou.org/calc/formula.html

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



Re: [PHP] Long Shot Question

2006-09-19 Thread Ray Hauge
On Tuesday 19 September 2006 10:25, Jay Blanchard wrote:
> [snip]
>   [snip]
>   This seems like a somewhat standard calculation for loans and
> interest
>   bearing accounts. Does anyone know how to calculate the
> graduation
>   factor?  I've been able to figure out it's based off the loan
> term, loan balance, and initial interest rate.
>   [/snip]
> It is called amortization ...
> [/snip]
>
> http://www.hughchou.org/calc/formula.html

Ah, I've already used that to construct my amortization table for the standard 
repayment type, but this repayment type was a bit different in that the 
payment changes, and I had to find out the rate of that change.  I think what 
I was looking for was:

http://en.wikipedia.org/wiki/Amortization_%28business%29

Thanks for the help

-- 
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] Long Shot Question

2006-09-19 Thread Ray Hauge
On Tuesday 19 September 2006 10:34, Ray Hauge wrote:
> http://en.wikipedia.org/wiki/Amortization_%28business%29


Actually, I"m not so sure that's what I was looking for.  These loans are 
student loans, which differ slightly from mortgage loans.  Usually the market 
determines the adjustment in an ARM loan, but these have to increase payment 
steadily so that the loan is still paid off by the end of the year.

At least I think I'm on the right track now.

-- 
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] Long Shot Question

2006-09-19 Thread Ray Hauge
On Tuesday 19 September 2006 10:38, Ray Hauge wrote:
> On Tuesday 19 September 2006 10:34, Ray Hauge wrote:
> > http://en.wikipedia.org/wiki/Amortization_%28business%29
>
> Actually, I"m not so sure that's what I was looking for.  These loans are
> student loans, which differ slightly from mortgage loans.  Usually the
> market determines the adjustment in an ARM loan, but these have to increase
> payment steadily so that the loan is still paid off by the end of the year.
>

I meant paid off at the end of the term...

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



[PHP] chown(), chgrp()

2006-09-19 Thread Rahul S. Johari

Is there a way to find out if a file can be chown¹d or chgrp¹d ? Something
like is_writeable() ... Except that you¹re trying to find out if you can
change the Owner or Group of a file.

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



Re: [PHP] chown(), chgrp()

2006-09-19 Thread John Nichel

Rahul S. Johari wrote:

Is there a way to find out if a file can be chown¹d or chgrp¹d ? Something
like is_writeable() ... Except that you¹re trying to find out if you can
change the Owner or Group of a file.



Who will say it first?

http://www.php.net/manual/en/function.fileowner.php

--
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: FTP Copy

2006-09-19 Thread Tom Atkinson

ftp_rename() should be able do that

Matt Palermo wrote:
I've been looking on php.net, but can't find anything that covers this... 
Basically, I am using PHP FTP to connect to an FTP server and run some 
functions.  I want to copy a directory on the FTP server to another 
directory on the FTP server.  Since there isn't an ftp_copy() function, I 
have to use ftp_get() to bring the file to the local webserver temp folder, 
then use ftp_put() to place it into a different folder on the FTP server. 
This is quite a big pain, since the webserver is not on the same network as 
the remote FTP server, so it must download the file and then upload it to a 
different place (takes a long time).  Is there an FTP that will just copy 
the file/folder from the FTP server without the need to download/upload it 
somewhere else?


Thanks,

Matt 


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



Re: [PHP] chown(), chgrp()

2006-09-19 Thread Rahul S. Johari

Here's the interesting things. I did exactly that to begin with... And I
never got the "file can't be chmoded!" ... Instead, I actually got the "Mode
changed to" notification that I had set in the "else {" case.
However... The mode of the file never changed! Even though !chmod didn't say
that mode cannot be changed It wasn't really changing the mode. Which is
why I thought it doesn't work this way.


On 9/19/06 11:58 AM, "Jay Paulson" <[EMAIL PROTECTED]> wrote:

> If (!chmod("/somedir/somefile", 775)) {
> echo "file can't be chmoded!";
> }

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] chown(), chgrp()

2006-09-19 Thread Steve Edberg

At 11:01 AM -0400 9/19/06, Rahul S. Johari wrote:

Is there a way to find out if a file can be chown'd or chgrp'd ? Something
like is_writeable() ... Except that you're trying to find out if you can
change the Owner or Group of a file.



fileperms() perhaps?

http://php.he.net/manual/en/function.fileperms.php

You'd have to compare the return value against the uid/gid the 
webserver runs as, which can be obtained via getmyuid()/getmygid():


http://php.he.net/manual/en/function.getmyuid.php

Alternatively, you could check if the file exists, then attempt to 
chown/chgrp it. If the chown()/chgrp() returns false, you probably 
don't have permission.


steve



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



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

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



[PHP] Re: Long Shot Question

2006-09-19 Thread Tony Marston
Take a look at http://www.tonymarston.net/php-mysql/amortise.html which 
documents the loan amortisation program which I wrote in PHP. You can run it 
online and even download the source code to run it locally.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

"Ray Hauge" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hello everyone,
>
> This is a tad off-topic, but I'm at my wits end.  I'm working on a loan
> calculator for our load advisors to give an estimated monthly payment.  We
> had one, but it was really bad (gave horribly wrong information) and I've 
> had
> to re-write it.  The particular question about this loan calculator is on 
> a
> graduated repayment type.  This is where the loan pretty much starts off
> paying only interest and then increases the payments by a certain 
> percentage
> (graduation factor) every time the rate increase is supposed to happen
> (graduation term)... which is usually two years.
>
> I've looked all over google, wikipedia, and I've even called our servicers
> (who you'd think would help you out, but instead they just tell you they
> can't give me those calculations).  I have found a few other calculators
> online that do this sort of thing, but I can't exactly see the source code
> that way ;)
>
> This seems like a somewhat standard calculation for loans and interest 
> bearing
> accounts. Does anyone know how to calculate the graduation factor?  I've 
> been
> able to figure out it's based off the loan term, loan balance, and initial
> interest rate.
>
> Example:
> $30,000 balance
> 6% initial interest rate
> 20 year loan term
>
> with those variables you would get a graduation factor of 6.95%
>
> So, the first payment would be $166.53, and then after the graduation term 
> (2
> years) the payment would increase to $178.10, then two years later 
> increase
> again, and so on.  That differnce in payment is pretty close to the
> graduation factor.  It's probably off due to the rounding.
>
> Thanks for placating me when grasping for straws ;)
>
> -- 
> 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



[PHP] Resource problem affecting Curl functions

2006-09-19 Thread Mark Krenz

  I run a shared webserver with a few hundred vhost containers in
Apache's config.  Recently I got to a point where I added enough vhosts
to cause a problem with curl functions in PHP.  Basically, when PHP
tries to make the curl call to get the webpage, it just hangs the HTTP
request to my webserver.  If I remove a few vhost containers, the
problem stops, if I add them back, the problem starts again.

  I've tried turning up several ulimit values in the apache init script,
but none of those fixed the problem.  I know that its not a problem with
the number of file handles that apache can open because I also had to do

ulimit -n 32768

in the apache init script recently in order to allow more logfiles to be
opened.

  Anyone have any ideas as to what might be causing the curl problem?


This is running on:

Apache 2.0.51
PHP 4.3.10
Linux 2.6.13


/proc/sys/fs/file-max is set to 524288

lsof | wc -l  returns 33497 


Thanks,

Mark

ps. I am well aware that I need to upgrade my software so there is no
need to tell me to do that. I'm working on it.

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



Re: [PHP] Frustrated trying to get help from your site

2006-09-19 Thread Jürgen Wind



Jon Anderson wrote:
> 
> Jay Blanchard wrote:
>> So let me send a rant to other users, in fact a general list of users,
>> because I cannot read. If I could I would know that I subscribed to a
>> list where questions are asked to other users rather than me trying to
>> send an e-mail to the president of PHP (a hat worn proudly). The entire
>> sire is documentation and anywhere from one to five minutes of even the
>> lightest reason would have spelled that out, not to mention that the
>> second link across the top of the page says in very vague terms,
>> 'documentation'. Is this a run on paragraph? I am asking because English
>> is incredibly frustrating and difficult to use.
>>
>> Department of Technology indeed.
>>   
> As an aside, I think that the online and offline (downloadable) PHP 
> documentation is probably the clearest, best organized and complete set 
> of documentation for any programming language I've run into online.
> 
> I honestly think that the PHP coders/documentors deserve a lot of 
> gratitude for the immense effort that must have gone into documenting 
> the immense list of built-in stuff that PHP has.
> 
> jon
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
FULL ACK!
-- 
View this message in context: 
http://www.nabble.com/Frustrated-trying-to-get-help-from-your-site-tf2292725.html#a6394118
Sent from the PHP - General mailing list archive at Nabble.com.

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



[PHP] Magic method __set won't be called for protected variables

2006-09-19 Thread Satyam
I have a series of properties set as protected in my class which I meant to 
have them accessed externally through __set and __get.  Unfortunately, it 
seems that since the properties do exist, the magic methods don't get 
called, but then I get an error "Cannot access protected property x", 
which I didn't meant to access directly, that's what I put the __set and 
__get magic methods there.


There is no problem if the variable has another name than the external 
property, if I use $obj->something  and the variable is declared protected 
$_something, the magic methods are called, but then I have different 
'external' names than the 'internal' ones, something which I wanted to 
avoid.


Since I want to have them with the same name, I might declare the variables 
public, but I wanted to use the magic methods to validate the values 
assigned to these variables.


Any ideas?

Thanks

Satyam

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



[PHP] DOM: Problem with loadXML(), createProcessingInstruction()

2006-09-19 Thread Chris Boget
Apparently, loadXML() overwrites the existing structure of the document when 
called.  The problem is that when I try to add a PI (namely a stylesheet), 
it adds it to the end of the document thus making so that the XML is not 
transformed by the client.


To get around this, I thought I could just import my XML string into a 
DOMNode, but I do not see any method for that class analogous to the 
loadXML().  I looked at the possiblity of adding children to the document at 
specific positions (such that I could add the PI as the first child) but I 
do not see a DOMDocument method that allows it.  appendChild() merely adds 
the child to the end of the document.


Has anyone found a workaround for this; a workaround the fact that loadXML() 
completely replaces the existing document structure?


thnx,
Chris 


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



[PHP] [Solved] Re: [PHP] DOM: Problem with loadXML(), createProcessingInstruction()

2006-09-19 Thread Chris Boget
Has anyone found a workaround for this; a workaround the fact that 
loadXML() completely replaces the existing document structure?


It's amazing what you find out after you've already made yourself look 
foolish.


$xmlStr = 'blah';

$doc = new DOMDocument( '1.0', 'UTF-8' );
$docFragment = $doc->createDocumentFragment();
$docFragment->appendXML( $xmlStr ); // Why this isn't called also loadXML()
   // I have no 
idea.  It would make sense
   // that it 
would be so as to maintain
   // 
consistency in names of methods
   // where it 
relates to functionality,
   // 
particularly when that functionality is
   // similar 
across classes.

$doc->appendChild( $doc->createProcessingInstruction( 'blah', 'blah' );
$doc->appendChild( $docFragment );
echo $doc->saveXML(); 


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



Re: [PHP] how to get page count when uploading files

2006-09-19 Thread Richard Lynch
On Mon, September 18, 2006 3:18 pm, Børge Holen wrote:
> Would php at all take precaution of the px size of the letters, if any
> of the
> above issues were to be resolved? That would be at document level for
> starters, and probably should be resolved in the first place?

The RTF parser may or may not attempt to account for font sizes...

You're kind of asking a question like:

Does the hammer take account of the size of the nail?

Well, yeah, sort of, if you have the right hammer to match up with the
nail you are trying to use...

PHP is a general programming language, a hardware store full of
hammers, not a specific hammer, and does not directly address fontsize
in a Word document in and of itself.

Individual RTF parsers or Word document handling software might, and
might be written in PHP.  Or they might be written in some other
language, and you could use PHP to run those programs to figure out
the page count within the documents and report that back to PHP.

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



Re: [PHP] chown(), chgrp()

2006-09-19 Thread Rahul S. Johari
Ok, my code follows. Basically I'm printing ...
my Owner/Group, the existing Owner/Group of the file, the Owner/Group of the
file After trying to change it.

The most interesting thing is... I get absolutely no errors, no warnings,
and everything prints out as if everything worked... Except that its' not
actually changing anything at all!!

The fact that it's not changing anything is a secondary issue... What
surprises me is that chown,chgrp or chmod doesn't give any error or warning
for the fact that it's not doing anything. Except the is_writeable() which
actually prints "Is not writeable" The if(chown) etcetera continue
printing as if they changed the Owner/Group/Perms Even though they
didn't.

code: 

if (!is_writable("/home/folder/documents/path/osmd.dbf")) {
echo "Is not writeable";
}

$fileowneruidb=fileowner("/home/folder/documents/path/osmd.dbf");
echo $fileowneruidb;
$fileownerarrayb=posix_getpwuid($fileowneruidb);
$fileownerb=$fileownerarrayb['name'];
echo "Owner is $fileownerb";

echo "My owner :".getmyuid()."";
if(chown("/home/folder/documents/path/osmd.dbf", getmyuid())) {
$fileowneruida=fileowner("/home/folder/documents/path/osmd.dbf");
echo $fileowneruida;
$fileownerarraya=posix_getpwuid($fileowneruida);
$fileownera=$fileownerarraya['name'];
echo "Owner changed to $fileownera";
}

$filegrpb=filegroup("/home/folder/documents/path/osmd.dbf");
echo $filegrpb;
$filegrparrayb=posix_getgrgid($filegrpb);
$filegrpb=$filegrparrayb['name'];
echo "Group is $filegrpb";

echo "My owner :".getmygid()."";
if(chgrp("/home/folder/documents/path/osmd.dbf", getmygid())) {
$filegrpa=filegroup("/home/folder/documents/path/osmd.dbf");
echo $filegrpa;
$filegrparraya=posix_getgrgid($filegrpa);
$filegrpa=$filegrparraya['name'];
echo "Group changed to $filegrpa";
 }

if (chmod("/home/folder/documents/path/osmd.dbf", 0755)) {
echo "Mode changed to 0755";
}



On 9/19/06 12:09 PM, "Steve Edberg" <[EMAIL PROTECTED]> wrote:

> fileperms() perhaps?
> 
> http://php.he.net/manual/en/function.fileperms.php
> 
> You'd have to compare the return value against the uid/gid the
> webserver runs as, which can be obtained via getmyuid()/getmygid():
> 
> http://php.he.net/manual/en/function.getmyuid.php
> 
> Alternatively, you could check if the file exists, then attempt to
> chown/chgrp it. If the chown()/chgrp() returns false, you probably
> don't have permission.
> 
> steve

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



Re: [PHP] how to get page count when uploading files

2006-09-19 Thread Børge Holen
On Tuesday 19 September 2006 18:22, Richard Lynch wrote:
> On Mon, September 18, 2006 3:18 pm, Børge Holen wrote:
> > Would php at all take precaution of the px size of the letters, if any
> > of the
> > above issues were to be resolved? That would be at document level for
> > starters, and probably should be resolved in the first place?
>
> The RTF parser may or may not attempt to account for font sizes...
>
> You're kind of asking a question like:
>
> Does the hammer take account of the size of the nail?
>
> Well, yeah, sort of, if you have the right hammer to match up with the
> nail you are trying to use...
>
> PHP is a general programming language, a hardware store full of
> hammers, not a specific hammer, and does not directly address fontsize
> in a Word document in and of itself.
>
> Individual RTF parsers or Word document handling software might, and
> might be written in PHP.  Or they might be written in some other
> language, and you could use PHP to run those programs to figure out
> the page count within the documents and report that back to PHP.

Yes, it was more of a comment to ther previous comments here rather than a 
factual question for my part, but then again you never know.

Nice comparison btw 

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

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

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



Re: [PHP] FTP Copy

2006-09-19 Thread Chris

Matt Palermo wrote:
I've been looking on php.net, but can't find anything that covers this... 
Basically, I am using PHP FTP to connect to an FTP server and run some 
functions.  I want to copy a directory on the FTP server to another 
directory on the FTP server.  Since there isn't an ftp_copy() function, I 
have to use ftp_get() to bring the file to the local webserver temp folder, 
then use ftp_put() to place it into a different folder on the FTP server. 
This is quite a big pain, since the webserver is not on the same network as 
the remote FTP server, so it must download the file and then upload it to a 
different place (takes a long time).  Is there an FTP that will just copy 
the file/folder from the FTP server without the need to download/upload it 
somewhere else?


You can't do this through ftp itself so I think you're out of luck.

--
Postgresql & php tutorials
http://www.designmagick.com/

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



[PHP] preg_replace (again)

2006-09-19 Thread Peter Lauri
Hi group,

 

I know I am a little bit stupid when it comes to actually figuring out how
to use the preg_match and preg_replace. This is what I am facing:

 

A string like this: This is some _color:pink_ colored text _color_ that I
want to transfer

 

Should convert to: This is some colored text that
I want to transfer

 

Anyone who see a simple solution to this? Right now I have created an ugly
script that do the same thing, but I want to start to learn and use
preg_match.

 

Thanks.

 

/Peter

 

www.lauri.se   - Personal web site

www.dwsasia.com   - Company web site 

 

 

 



Re: [PHP] chown(), chgrp()

2006-09-19 Thread Børge Holen
On Tuesday 19 September 2006 22:22, Rahul S. Johari wrote:
> Ok, my code follows. Basically I'm printing ...
> my Owner/Group, the existing Owner/Group of the file, the Owner/Group of
> the file After trying to change it.

Does apache have write access to write to yer file, that goes for either o+r 
or that group or user is apache.

>
> The most interesting thing is... I get absolutely no errors, no warnings,
> and everything prints out as if everything worked... Except that its' not
> actually changing anything at all!!
>
> The fact that it's not changing anything is a secondary issue... What
> surprises me is that chown,chgrp or chmod doesn't give any error or warning
> for the fact that it's not doing anything. Except the is_writeable() which
> actually prints "Is not writeable" The if(chown) etcetera continue
> printing as if they changed the Owner/Group/Perms Even though they
> didn't.
>
> code:
>
> if (!is_writable("/home/folder/documents/path/osmd.dbf")) {
> echo "Is not writeable";
> }
>
> $fileowneruidb=fileowner("/home/folder/documents/path/osmd.dbf");
> echo $fileowneruidb;
> $fileownerarrayb=posix_getpwuid($fileowneruidb);
> $fileownerb=$fileownerarrayb['name'];
> echo "Owner is $fileownerb";
>
> echo "My owner :".getmyuid()."";
> if(chown("/home/folder/documents/path/osmd.dbf", getmyuid())) {
> $fileowneruida=fileowner("/home/folder/documents/path/osmd.dbf");
> echo $fileowneruida;
> $fileownerarraya=posix_getpwuid($fileowneruida);
> $fileownera=$fileownerarraya['name'];
> echo "Owner changed to $fileownera";
> }
>
> $filegrpb=filegroup("/home/folder/documents/path/osmd.dbf");
> echo $filegrpb;
> $filegrparrayb=posix_getgrgid($filegrpb);
> $filegrpb=$filegrparrayb['name'];
> echo "Group is $filegrpb";
>
> echo "My owner :".getmygid()."";
> if(chgrp("/home/folder/documents/path/osmd.dbf", getmygid())) {
> $filegrpa=filegroup("/home/folder/documents/path/osmd.dbf");
> echo $filegrpa;
> $filegrparraya=posix_getgrgid($filegrpa);
> $filegrpa=$filegrparraya['name'];
> echo "Group changed to $filegrpa";
>  }
>
> if (chmod("/home/folder/documents/path/osmd.dbf", 0755)) {
> echo "Mode changed to 0755";
> }
>
> On 9/19/06 12:09 PM, "Steve Edberg" <[EMAIL PROTECTED]> wrote:
> > fileperms() perhaps?
> >
> > http://php.he.net/manual/en/function.fileperms.php
> >
> > You'd have to compare the return value against the uid/gid the
> > webserver runs as, which can be obtained via getmyuid()/getmygid():
> >
> > http://php.he.net/manual/en/function.getmyuid.php
> >
> > Alternatively, you could check if the file exists, then attempt to
> > chown/chgrp it. If the chown()/chgrp() returns false, you probably
> > don't have permission.
> >
> > steve

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

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



RE: [PHP] preg_replace (again) [solved]

2006-09-19 Thread Peter Lauri
Just to share my solution:

preg_replace('/_color:(.*?)_(.*?)_color_/i', '$2',
$html);

/Peter

-Original Message-
From: Peter Lauri [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 20, 2006 9:42 AM
To: 'PHP General'
Subject: [PHP] preg_replace (again)

Hi group,

 

I know I am a little bit stupid when it comes to actually figuring out how
to use the preg_match and preg_replace. This is what I am facing:

 

A string like this: This is some _color:pink_ colored text _color_ that I
want to transfer

 

Should convert to: This is some colored text that
I want to transfer

 

Anyone who see a simple solution to this? Right now I have created an ugly
script that do the same thing, but I want to start to learn and use
preg_match.

 

Thanks.

 

/Peter

 

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] Latest PHP distribution?

2006-09-19 Thread Willem Herbst

I have PHP 4.4 installed running on a Open SUSE 10 box, can someone
please tell me where I find the latest version for OPEN SUSE?

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



Re: [PHP] Latest PHP distribution?

2006-09-19 Thread Chris

Willem Herbst wrote:

I have PHP 4.4 installed running on a Open SUSE 10 box, can someone
please tell me where I find the latest version for OPEN SUSE?


http://www.php.net/

Or do you mean rpms (or whatever opensuse uses)? STW?

Better off asking your opensuse mailing list, php.net doesn't build any 
distributions rpms or packages, that's up to the distributions themselves.


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] Resource problem affecting Curl functions

2006-09-19 Thread Google Kreme

On 19 Sep 2006, at 12:12 , Mark Krenz wrote:

  I run a shared webserver with a few hundred vhost containers in
Apache's config.


Are these vhosts all contained in httpd.conf, or are they separate  
files?


Does it make a difference?

--
...when you're no longer searching for beauty or love, just some kind  
of life with the edges taken off.  When you can't even define what it  
is that you're frightened of; this song will be here.


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