php-general Digest 19 Sep 2006 17:55:58 -0000 Issue 4356

Topics (messages 241926 through 241949):

Re: How to parse raw mail headers and messages?
        241926 by: Manuel Lemos

Re: symlink
        241927 by: Chris

PDF.
        241928 by: João Cândido de Souza Neto
        241929 by: Ray Hauge
        241930 by: João Cândido de Souza Neto

Re: Frustrated trying to get help from your site
        241931 by: Kae Verens
        241932 by: Kae Verens

Re: My apologies
        241933 by: Kae Verens
        241934 by: Kae Verens

Re: Reverse of date("w")
        241935 by: Kevin Murphy

FTP Copy
        241936 by: Matt Palermo
        241946 by: Tom Atkinson

Long Shot Question
        241937 by: Ray Hauge
        241938 by: Jay Blanchard
        241939 by: Ray Hauge
        241940 by: Jay Blanchard
        241941 by: Ray Hauge
        241942 by: Ray Hauge
        241943 by: Ray Hauge
        241949 by: Tony Marston

chown(), chgrp()
        241944 by: Rahul S. Johari
        241945 by: John Nichel
        241947 by: Rahul S. Johari
        241948 by: Steve Edberg

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
Hello,

on 09/18/2006 03:48 AM Mathijs said the following:
> Is there a way to parse mail headers from a RAW mail received from
> sendmail?
> 
> Like extracting the from, reply-to etc.. etc.. and also the message(s).
> Also mabye Multipart email's en attachments?

You may want to take a look at this MIME message parser class.

It can parse any e-mail message without depending on any PHP extensions.

It can also parse very large messages without exhausting the available
memory. Optionally, attachments can be saved to separate files. This is
essencial to parse messages with attachments .

http://www.phpclasses.org/mimeparser


-- 

Regards,
Manuel Lemos

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

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

--- End Message ---
--- Begin Message ---
Ross wrote:
Can someone explain how and why you would use a symlink in php?

For the same reason you use them in a normal unix based environment.

For example a symlink from /usr/bin/php to /usr/local/bin/php - they "appear" to be the same so you can use either.

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

--- End Message ---
--- Begin Message ---
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 

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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 

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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?

<?php
function getDayFromInteger($integer)
{

   $days = array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');

   if (isset($days[$integer]))
   {
      return $days[$integer];
   }

   return false;

}
?>

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

--- End Message ---
--- Begin Message ---
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 

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
[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 ... 

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
[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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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 

--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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]

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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 Edberg                                http://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center                            [EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin             (530)754-9127 |
+---------------- said t e lawrence, picking up his fork ----------------+

--- End Message ---

Reply via email to