php-general Digest 14 Jan 2010 13:26:14 -0000 Issue 6538
Topics (messages 301086 through 301100):
Re: header("Location:...") fails
301086 by: Shawn McKenzie
php mail() function and ezmlm
301087 by: Bob Strasser
301088 by: vikash.iitb.gmail.com
Re: Need Idea to make Backup
301089 by: Jens Geier
301092 by: Ashley Sheridan
301096 by: Jens Geier
301097 by: Ashley Sheridan
parse date field
301090 by: John Taylor-Johnston
301091 by: vikash.iitb.gmail.com
301093 by: Lester Caine
301094 by: John Taylor-Johnston
301095 by: Michael Kjeldsen
weird xml tag
301098 by: Devendra Jadhav
301099 by: Ashley Sheridan
301100 by: Devendra Jadhav
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:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Robert Cummings wrote:
> Just make your life easy and create a redirect() function that generates
> the header instruction, makes a relative URL into an absolute URL and
> does the exit call. Then you just need to do:
>
> redirect( 'target.php' );
>
> Sooooooooo much simpler :)
>
> Cheers,
> Rob.
Definitely! Technically, header() with Location: should have an
absolute URL, though it works without one most of the time.
--
Thanks!
-Shawn
http://www.spidean.com
--- End Message ---
--- Begin Message ---
I'm having trouble sending info from a form to the list-subscr...@domain
Does anyone know why ezmlm doesn't recognize the mail() function?
--- End Message ---
--- Begin Message ---
Can you send it to other email addresses?
--
Vikash Kumar
http://vika.sh
On Thu, Jan 14, 2010 at 12:16 PM, Bob Strasser <[email protected]>wrote:
> I'm having trouble sending info from a form to the list-subscr...@domain
> Does anyone know why ezmlm doesn't recognize the mail() function?
>
>
--- End Message ---
--- Begin Message ---
"Ashley Sheridan" <[email protected]> schrieb im Newsbeitrag
news:1263391167.5952.62.ca...@localhost...
> On Wed, 2010-01-13 at 14:57 +0100, Jens Geier wrote:
>
>> Hello Ashley,
>>
>> yes rsync is a good idea, but does this also work if there is only a
>> internet conection to may SERVER ?
>>
>> Kind Regards
>> Jens Geier
>>
>> "Ashley Sheridan" <[email protected]> schrieb im Newsbeitrag
>> news:1263377397.5952.60.ca...@localhost...
>> > On Wed, 2010-01-13 at 10:53 +0100, Jens Geier wrote:
>> >
>> >> Hello,
>> >>
>> >> my idea is to make a backup of some paths of my laptop via PHP.
>> >>
>> >> I like to use a MySQL Datebase to trace which file was uploaded from
>> >> which
>> >> path and so on.
>> >>
>> >> Also it should be uses to look up it is nessasery to backup this file
>> >> because it was changed since last time or not.
>> >>
>> >> All this files should be uploaded to the SERVER in a special folder
>> >> where
>> >> this files run to a tape backup machine.
>> >>
>> >> I hope some one can give me some ideas for this.
>> >>
>> >> Kind Regards
>> >> Jens Geier
>> >
>> > There's a few ways to go about doing this, but I reckon you should do
>> > something similar to the following:
>> >
>> > * schedule a cron job to run as often as you want the backup to be
>> > done, and have the cron call a script
>> > * the script can either be php and use your own code to create
>> > copies of files and check file dates for backup purposes, or use
>> > the rsync tool which pretty much does all of this for you
>> > automatically
>> > * update a database as you need. this can be done either from a
>> > php script or directly via mysql on the console
>> >
>> > If you do use PHP for this, you'll want to code it as a CLI script
>> > rather than a web page script. On the whole it won't make much of a
>> > difference, but obviously some global variables will change a bit.
>> >
>> > Thanks,
>> > Ash
>> > http://www.ashleysheridan.co.uk
>> >
>
> I don't understand what you mean?
>
> Ps, please try not to top-post.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
Hello Ashley,
i try to make a backup from some paths of my local laptop harddrive to a
folder on my server. Even if i'm not in the company.
If i'm outside (this time i'm in China) i have to copy it through the
Internet that is using http or ftp transport protocol.
The start of the copy is when the user clicks to a buttom and start the
backup process.
Kind Regards
Jens Geier
--- End Message ---
--- Begin Message ---
On Thu, 2010-01-14 at 10:12 +0100, Jens Geier wrote:
> "Ashley Sheridan" <[email protected]> schrieb im Newsbeitrag
> news:1263391167.5952.62.ca...@localhost...
> > On Wed, 2010-01-13 at 14:57 +0100, Jens Geier wrote:
> >
> >> Hello Ashley,
> >>
> >> yes rsync is a good idea, but does this also work if there is only a
> >> internet conection to may SERVER ?
> >>
> >> Kind Regards
> >> Jens Geier
> >>
> >> "Ashley Sheridan" <[email protected]> schrieb im Newsbeitrag
> >> news:1263377397.5952.60.ca...@localhost...
> >> > On Wed, 2010-01-13 at 10:53 +0100, Jens Geier wrote:
> >> >
> >> >> Hello,
> >> >>
> >> >> my idea is to make a backup of some paths of my laptop via PHP.
> >> >>
> >> >> I like to use a MySQL Datebase to trace which file was uploaded from
> >> >> which
> >> >> path and so on.
> >> >>
> >> >> Also it should be uses to look up it is nessasery to backup this file
> >> >> because it was changed since last time or not.
> >> >>
> >> >> All this files should be uploaded to the SERVER in a special folder
> >> >> where
> >> >> this files run to a tape backup machine.
> >> >>
> >> >> I hope some one can give me some ideas for this.
> >> >>
> >> >> Kind Regards
> >> >> Jens Geier
> >> >
> >> > There's a few ways to go about doing this, but I reckon you should do
> >> > something similar to the following:
> >> >
> >> > * schedule a cron job to run as often as you want the backup to be
> >> > done, and have the cron call a script
> >> > * the script can either be php and use your own code to create
> >> > copies of files and check file dates for backup purposes, or use
> >> > the rsync tool which pretty much does all of this for you
> >> > automatically
> >> > * update a database as you need. this can be done either from a
> >> > php script or directly via mysql on the console
> >> >
> >> > If you do use PHP for this, you'll want to code it as a CLI script
> >> > rather than a web page script. On the whole it won't make much of a
> >> > difference, but obviously some global variables will change a bit.
> >> >
> >> > Thanks,
> >> > Ash
> >> > http://www.ashleysheridan.co.uk
> >> >
> >
> > I don't understand what you mean?
> >
> > Ps, please try not to top-post.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> Hello Ashley,
>
> i try to make a backup from some paths of my local laptop harddrive to a
> folder on my server. Even if i'm not in the company.
>
> If i'm outside (this time i'm in China) i have to copy it through the
> Internet that is using http or ftp transport protocol.
>
> The start of the copy is when the user clicks to a buttom and start the
> backup process.
>
> Kind Regards
> Jens Geier
>
>
>
The script needs to be set up on your local machine. I don't think HTTP
will help you much here, as that isn't great for transferring files
upstream I've found. Googling 'rsync ftp example' brings about over
230,000 results, have you actually tried looking?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
"Ashley Sheridan" <[email protected]> schrieb im Newsbeitrag
news:1263463572.5952.71.ca...@localhost...
> On Thu, 2010-01-14 at 10:12 +0100, Jens Geier wrote:
>
>> "Ashley Sheridan" <[email protected]> schrieb im Newsbeitrag
>> news:1263391167.5952.62.ca...@localhost...
>> > On Wed, 2010-01-13 at 14:57 +0100, Jens Geier wrote:
>> >
>> >> Hello Ashley,
>> >>
>> >> yes rsync is a good idea, but does this also work if there is only a
>> >> internet conection to may SERVER ?
>> >>
>> >> Kind Regards
>> >> Jens Geier
>> >>
>> >> "Ashley Sheridan" <[email protected]> schrieb im Newsbeitrag
>> >> news:1263377397.5952.60.ca...@localhost...
>> >> > On Wed, 2010-01-13 at 10:53 +0100, Jens Geier wrote:
>> >> >
>> >> >> Hello,
>> >> >>
>> >> >> my idea is to make a backup of some paths of my laptop via PHP.
>> >> >>
>> >> >> I like to use a MySQL Datebase to trace which file was uploaded
>> >> >> from
>> >> >> which
>> >> >> path and so on.
>> >> >>
>> >> >> Also it should be uses to look up it is nessasery to backup this
>> >> >> file
>> >> >> because it was changed since last time or not.
>> >> >>
>> >> >> All this files should be uploaded to the SERVER in a special folder
>> >> >> where
>> >> >> this files run to a tape backup machine.
>> >> >>
>> >> >> I hope some one can give me some ideas for this.
>> >> >>
>> >> >> Kind Regards
>> >> >> Jens Geier
>> >> >
>> >> > There's a few ways to go about doing this, but I reckon you should
>> >> > do
>> >> > something similar to the following:
>> >> >
>> >> > * schedule a cron job to run as often as you want the backup to
>> >> > be
>> >> > done, and have the cron call a script
>> >> > * the script can either be php and use your own code to create
>> >> > copies of files and check file dates for backup purposes, or
>> >> > use
>> >> > the rsync tool which pretty much does all of this for you
>> >> > automatically
>> >> > * update a database as you need. this can be done either from a
>> >> > php script or directly via mysql on the console
>> >> >
>> >> > If you do use PHP for this, you'll want to code it as a CLI script
>> >> > rather than a web page script. On the whole it won't make much of a
>> >> > difference, but obviously some global variables will change a bit.
>> >> >
>> >> > Thanks,
>> >> > Ash
>> >> > http://www.ashleysheridan.co.uk
>> >> >
>> >
>> > I don't understand what you mean?
>> >
>> > Ps, please try not to top-post.
>> >
>> > Thanks,
>> > Ash
>> > http://www.ashleysheridan.co.uk
>> >
>> Hello Ashley,
>>
>> i try to make a backup from some paths of my local laptop harddrive to a
>> folder on my server. Even if i'm not in the company.
>>
>> If i'm outside (this time i'm in China) i have to copy it through the
>> Internet that is using http or ftp transport protocol.
>>
>> The start of the copy is when the user clicks to a buttom and start the
>> backup process.
>>
>> Kind Regards
>> Jens Geier
>
> The script needs to be set up on your local machine. I don't think HTTP
> will help you much here, as that isn't great for transferring files
> upstream I've found. Googling 'rsync ftp example' brings about over
> 230,000 results, have you actually tried looking?
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
No, i have not.
Because i also think that there will not a finish software.
So i think i have to write something by my own.
That is the reason i ask for ideas to do so.
I just read here the following thread:
[PHP] Read directory; store filenames found in mySQL table?
That is something that is running in that direction in try to go.
Kind Regards
Jens Geier
--- End Message ---
--- Begin Message ---
On Thu, 2010-01-14 at 12:32 +0100, Jens Geier wrote:
> "Ashley Sheridan" <[email protected]> schrieb im Newsbeitrag
> news:1263463572.5952.71.ca...@localhost...
> > On Thu, 2010-01-14 at 10:12 +0100, Jens Geier wrote:
> >
> >> "Ashley Sheridan" <[email protected]> schrieb im Newsbeitrag
> >> news:1263391167.5952.62.ca...@localhost...
> >> > On Wed, 2010-01-13 at 14:57 +0100, Jens Geier wrote:
> >> >
> >> >> Hello Ashley,
> >> >>
> >> >> yes rsync is a good idea, but does this also work if there is only a
> >> >> internet conection to may SERVER ?
> >> >>
> >> >> Kind Regards
> >> >> Jens Geier
> >> >>
> >> >> "Ashley Sheridan" <[email protected]> schrieb im Newsbeitrag
> >> >> news:1263377397.5952.60.ca...@localhost...
> >> >> > On Wed, 2010-01-13 at 10:53 +0100, Jens Geier wrote:
> >> >> >
> >> >> >> Hello,
> >> >> >>
> >> >> >> my idea is to make a backup of some paths of my laptop via PHP.
> >> >> >>
> >> >> >> I like to use a MySQL Datebase to trace which file was uploaded
> >> >> >> from
> >> >> >> which
> >> >> >> path and so on.
> >> >> >>
> >> >> >> Also it should be uses to look up it is nessasery to backup this
> >> >> >> file
> >> >> >> because it was changed since last time or not.
> >> >> >>
> >> >> >> All this files should be uploaded to the SERVER in a special folder
> >> >> >> where
> >> >> >> this files run to a tape backup machine.
> >> >> >>
> >> >> >> I hope some one can give me some ideas for this.
> >> >> >>
> >> >> >> Kind Regards
> >> >> >> Jens Geier
> >> >> >
> >> >> > There's a few ways to go about doing this, but I reckon you should
> >> >> > do
> >> >> > something similar to the following:
> >> >> >
> >> >> > * schedule a cron job to run as often as you want the backup to
> >> >> > be
> >> >> > done, and have the cron call a script
> >> >> > * the script can either be php and use your own code to create
> >> >> > copies of files and check file dates for backup purposes, or
> >> >> > use
> >> >> > the rsync tool which pretty much does all of this for you
> >> >> > automatically
> >> >> > * update a database as you need. this can be done either from a
> >> >> > php script or directly via mysql on the console
> >> >> >
> >> >> > If you do use PHP for this, you'll want to code it as a CLI script
> >> >> > rather than a web page script. On the whole it won't make much of a
> >> >> > difference, but obviously some global variables will change a bit.
> >> >> >
> >> >> > Thanks,
> >> >> > Ash
> >> >> > http://www.ashleysheridan.co.uk
> >> >> >
> >> >
> >> > I don't understand what you mean?
> >> >
> >> > Ps, please try not to top-post.
> >> >
> >> > Thanks,
> >> > Ash
> >> > http://www.ashleysheridan.co.uk
> >> >
> >> Hello Ashley,
> >>
> >> i try to make a backup from some paths of my local laptop harddrive to a
> >> folder on my server. Even if i'm not in the company.
> >>
> >> If i'm outside (this time i'm in China) i have to copy it through the
> >> Internet that is using http or ftp transport protocol.
> >>
> >> The start of the copy is when the user clicks to a buttom and start the
> >> backup process.
> >>
> >> Kind Regards
> >> Jens Geier
> >
> > The script needs to be set up on your local machine. I don't think HTTP
> > will help you much here, as that isn't great for transferring files
> > upstream I've found. Googling 'rsync ftp example' brings about over
> > 230,000 results, have you actually tried looking?
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> No, i have not.
>
> Because i also think that there will not a finish software.
>
> So i think i have to write something by my own.
> That is the reason i ask for ideas to do so.
>
> I just read here the following thread:
>
> [PHP] Read directory; store filenames found in mySQL table?
>
> That is something that is running in that direction in try to go.
>
> Kind Regards
> Jens Geier
>
>
>
But I've told you that the best tool to do it is rsync. This is a tool,
not a whole large peice of software with a GUI, etc. You use it in
conjunction with other software to achieve what you need. Have you even
looked up at what rsync is?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
How do I parse a date field from mysql?
I was hoping this would work:
$mydata->birthday = "2007-02-13";
#What month is it?
echo date("F", $mydata->birthday);
#What year is it?
echo date("Y", $mydata->birthday);
What am I missing? All I get is December 1969. Hmmm?
I am looking at the manual:
http://ca.php.net/manual/en/function.date.php
http://ca.php.net/manual/en/function.mktime.php
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
--- End Message ---
--- Begin Message ---
Use strttotime() function. This will work as intended.
$mydata->birthday = strtotime("2007-02-13");
#What month is it?
echo date("F", $mydata->birthday);
#What year is it?
echo date("Y", $mydata->birthday);
-
--
Vikash Kumar
http://vika.sh
On Thu, Jan 14, 2010 at 3:31 PM, John Taylor-Johnston <
[email protected]> wrote:
> How do I parse a date field from mysql?
>
> I was hoping this would work:
>
> $mydata->birthday = "2007-02-13";
> #What month is it?
> echo date("F", $mydata->birthday);
> #What year is it?
> echo date("Y", $mydata->birthday);
>
> What am I missing? All I get is December 1969. Hmmm?
>
> I am looking at the manual:
> http://ca.php.net/manual/en/function.date.php
> http://ca.php.net/manual/en/function.mktime.php
> http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
John Taylor-Johnston wrote:
How do I parse a date field from mysql?
I was hoping this would work:
$mydata->birthday = "2007-02-13";
This just stores a string to the variable $mydata->birthday - where did you
define $mydata->birthday as a data object?
$mydata->birthday = date("2007-02-13");
#What month is it?
echo date("F", $mydata->birthday);
#What year is it?
echo date("Y", $mydata->birthday);
What am I missing? All I get is December 1969. Hmmm?
I am looking at the manual:
http://ca.php.net/manual/en/function.date.php
http://ca.php.net/manual/en/function.mktime.php
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
--- End Message ---
--- Begin Message ---
Super, thanks. 5:14 a.m. - My head is fogging :p
vikash wrote:
Use strttotime() function. This will work as intended.
$mydata->birthday = strtotime("2007-02-13");
#What month is it?
echo date("F", $mydata->birthday);
#What year is it?
echo date("Y", $mydata->birthday);
On Thu, Jan 14, 2010 at 3:31 PM, John Taylor-Johnston
<[email protected]
<mailto:[email protected]>> wrote:
How do I parse a date field from mysql?
I was hoping this would work:
$mydata->birthday = "2007-02-13";
#What month is it?
echo date("F", $mydata->birthday);
#What year is it?
echo date("Y", $mydata->birthday);
What am I missing? All I get is December 1969. Hmmm?
I am looking at the manual:
http://ca.php.net/manual/en/function.date.php
http://ca.php.net/manual/en/function.mktime.php
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On 01/14/2010 11:01 AM, John Taylor-Johnston wrote:
How do I parse a date field from mysql?
I was hoping this would work:
$mydata->birthday = "2007-02-13";
#What month is it?
echo date("F", $mydata->birthday);
#What year is it?
echo date("Y", $mydata->birthday);
What am I missing? All I get is December 1969. Hmmm?
I am looking at the manual:
http://ca.php.net/manual/en/function.date.php
http://ca.php.net/manual/en/function.mktime.php
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
Something like:
<?php
date_default_timezone_set('Europe/Copenhagen');
$somedate = '2007-02-13';
echo date("F", strtotime($somedate));
echo "\n";
echo date("Y", strtotime($somedate));
Output:
[mich...@archie ~]$ php a.php
February
2007
--- End Message ---
--- Begin Message ---
Hi All,
I am writing module to display recent Wordpress blog posts in drupal.
I am taking RSS feeds of blog. I am using simple xml library of PHP to parse
xml.
Now the problem is I get weird tag in XML.
<dc:creator>Jason Bourne</dc:creator>
when i convert this xml into object by using simplexml_load_string I am not
getting dc:creator in the object as dc:creator is not valid variable name.
can someone tell me how to access it?
appreciate your help
--
Devendra Jadhav
देवेंद्र जाधव
--- End Message ---
--- Begin Message ---
On Thu, 2010-01-14 at 18:00 +0530, Devendra Jadhav wrote:
> Hi All,
>
> I am writing module to display recent Wordpress blog posts in drupal.
> I am taking RSS feeds of blog. I am using simple xml library of PHP to parse
> xml.
> Now the problem is I get weird tag in XML.
> <dc:creator>Jason Bourne</dc:creator>
> when i convert this xml into object by using simplexml_load_string I am not
> getting dc:creator in the object as dc:creator is not valid variable name.
> can someone tell me how to access it?
> appreciate your help
>
>
>
It's not a weird XML tag, it's a namespace. The tag is <creator> and
it's within the dc namespace. I've not used simplexml before, but I
believe it handles namespaces.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Hi Ashley,
Thank you very much for your help.
simplexml handles namespace.
here is the link for reference
http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/
I am very happy.
Thank you very much again. :D
On Thu, Jan 14, 2010 at 6:06 PM, Ashley Sheridan
<[email protected]>wrote:
> On Thu, 2010-01-14 at 18:00 +0530, Devendra Jadhav wrote:
>
> Hi All,
>
> I am writing module to display recent Wordpress blog posts in drupal.
> I am taking RSS feeds of blog. I am using simple xml library of PHP to parse
> xml.
> Now the problem is I get weird tag in XML.
> <dc:creator>Jason Bourne</dc:creator>
> when i convert this xml into object by using simplexml_load_string I am not
> getting dc:creator in the object as dc:creator is not valid variable name.
> can someone tell me how to access it?
> appreciate your help
>
>
>
>
>
> It's not a weird XML tag, it's a namespace. The tag is <creator> and it's
> within the dc namespace. I've not used simplexml before, but I believe it
> handles namespaces.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
--
Devendra Jadhav
देवेंद्र जाधव
--- End Message ---