php-general Digest 15 Jan 2010 19:18:43 -0000 Issue 6540

Topics (messages 301124 through 301139):

Re: To add the final ?> or not...
        301124 by: Mattias Thorslund
        301126 by: Jochem Maas

What's the best way to extract HTML out of $var?
        301125 by: alexus
        301127 by: John Meyer
        301132 by: Bruno Fajardo

Re: Need Idea to make Backup
        301128 by: Jens Geier
        301129 by: Jens Geier
        301130 by: Jens Geier

SMTP Local development to Send email in PHP; Windows Platform/ XP with no IIS
        301131 by: Gaurav Kumar
        301133 by: Kim Madsen
        301134 by: Gaurav Kumar
        301135 by: vikash.iitb.gmail.com
        301136 by: Richard Quadling
        301137 by: Gaurav Kumar

Re: strtotime
        301138 by: Bob McConnell

PHP and javascript
        301139 by: Andres Gonzalez

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

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


----------------------------------------------------------------------
--- Begin Message ---
Kim Madsen wrote:
Mattias Thorslund wrote on 09/01/2010 02:26:
A neat thing with pairing every <?php with a ?> when mixed in HTML is that these are valid XML processing instructions. If your HTML satisfies XML well-formedness, your PHP document will also be valid XML. Not that I've ever had any need to process my layout templates as XML but anyway.
I don't see your argument. PHP generates HTML or XML files. When you're aware of the XML tag of course you make sure the XML file generated is valid. Why would you ever add PHP code to a HTML file (other than for documentation, examples etc.)?

It's not much of an argument, just an observation. And the conclusions are disappointing anyway.

Certainly, if your script is designed to create XML, you'll make sure that output is valid when executed by PHP. But it is interesting to note that your PHP script file itself might qualify as valid XML under certain circumstances, in which case you could process it with an XML processor. This would let you modify the XML and still keep the PHP part of the file intact.

I haven't seen a live example that might benefit from this, but I still find it interesting.

The conditions that would need to be met, are that the content outside the <? and ?> processing instructions must be well-formed XML, and there are places where the processing instructions aren't expected in XML.

This is well-formed XML (and valid PHP):

<?xml version="1.0"?>
<?php $var = 'dynamic'; ?>
<root attr="static">
   <?php echo "$var content from PHP\n"; ?>
</root>
<?php //processing instructions can also be located after the XML content ?>

This is not well-formed XML (processing instruction within a tag). Note however that the output from PHP would be valid XML:

<?xml version="1.0"?>
<?php $var = 'dynamic'; ?>
<root <?php echo "attr=\"$var\""; ?>>
   <?php echo "$var content from PHP\n"; ?>
</root>

Neither is this (processing instruction within an attribute):

<?xml version="1.0"?>
<?php $var = 'dynamic'; ?>
<root attr="<?php echo $var; ?>">
   <?php echo "$var content from PHP\n"; ?>
</root>

And neither is this (missing opening tag for the "root" element):

<?xml version="1.0"?>
<?php $var = 'dynamic'; ?>
<?php echo "<root attr=\"$var\">\n"; ?>
   <?php echo "$var content from PHP\n"; ?>
</root>

A simple way to test this would be to use this:
$sxe = new SimpleXMLElement('the_file.php', null, true);
echo $sxe->asXML()."\n";

The inability to insert dynamic content into attributes without breaking the XML (ideas anyone?) does limit the usefulness of this technique, so I guess it will just remain a curiosity.

Cheers,

Mattias

--- End Message ---
--- Begin Message ---
Op 1/14/10 11:37 PM, Kim Madsen schreef:
> Ashley Sheridan wrote on 14/01/2010 23:30:
> 
>>> What is the difference between:
>>>
>>> <?
>>> print "hello PHPeople";
>>> ?>WHITESPACE
>>>
>>> and
>>>
>>> <?
>>> print "hello PHPeople";
>>> WHITESPACE
>>>
>>> Same shit when I look at it, a sloppy developer is what it is :-)
>>>
>>> -- 
>>> Kind regards
>>> Kim Emax - masterminds.dk
>>>
>>
>> Plenty of differences, if you include the first one as a file, the
>> whitespace gets sent to the browser because it is not part of the PHP,
>> and so is assumed to be HTML. Once this happens, the headers have been
>> sent, so you can't use different headers in your script.
> 
> Hmm... you could be right. I guess I just never made that mistake :-)

could be right? that implies you don't know and didn't bother to test it.
I'd postulate that is sloppy. In another post you mention your reliance on
your favorite editor - relying blindly on your editor to 'do the right thing'
could also be considered sloppy (no tool is perfect all of the time).

pretty much every php dev has run into the issue of header() calls failing
due to whitespace, it's almost a rite of passage - I'd only call it a mistake
if you don't bother to test your code to the extent that you actually get into
a situation that you put something so obviously broken into a production env.

you mention that you guess as to whether you made the mistake in question, 
obviously
a an off the cuff remark and no worth tripping over in it's own right but it 
does
raise an interest point, namely that only sloppy devs are satified with guess 
work,
diligent devs either know or they don't and when they don't they take the time 
to
research and test until they feel confident to say that they do know - rather 
esoteric,
probably not very pragmatic, but there you have it nonetheless.

you offer to different pieces of pseudo-code and call them 'the same shit when 
you
look at it' - again there's an argument to say that's sloppy (in terms of 
reading code)
considering they are not identical in source nor resultant output.

... same shit, different day ... or to put it another way, be very careful what 
you
post on a techie mailing list - you never know when some pendantic SOB is going 
to
rip you another 'one' in reply ;-).

--- End Message ---
--- Begin Message ---
What's the best way to extract HTML out of $var?

example of $var

$var = "<a href="http://http://stackoverflow.com/"Stack Overflow</a>"
I want

$var2 = "http://starckoverflow.com/";
example: preg_match();

what else?

-- 
http://alexus.org/

--- End Message ---
--- Begin Message ---
On 1/14/2010 7:15 PM, alexus wrote:
> What's the best way to extract HTML out of $var?
> 
> example of $var
> 
> $var = "<a href="http://http://stackoverflow.com/"Stack Overflow</a>"
> I want
> 
> $var2 = "http://starckoverflow.com/";
> example: preg_match();
> 
> what else?
> 

Actually what it looks like you want are the URLs, not the HTML. This
regular expression will match them up for you:

https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?

--- End Message ---
--- Begin Message ---
2010/1/15 alexus <ale...@gmail.com>:
> What's the best way to extract HTML out of $var?
>
> example of $var
>
> $var = "<a href="http://http://stackoverflow.com/"Stack Overflow</a>"
> I want
>
> $var2 = "http://starckoverflow.com/";
> example: preg_match();
>
> what else?

Hi,
If you simply wants to remove all tags from the string, try using the
strip_tags function (http://php.net/strip_tags).

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

--- End Message ---
--- Begin Message ---
"haliphax" <halip...@gmail.com> schrieb im Newsbeitrag 
news:952625161001140625x31d03ed5oef8216064da13...@mail.gmail.com...
> On Thu, Jan 14, 2010 at 5:45 AM, Ashley Sheridan
> <a...@ashleysheridan.co.uk>wrote:
>
>> On Thu, 2010-01-14 at 12:32 +0100, Jens Geier wrote:
>>
>> > "Ashley Sheridan" <a...@ashleysheridan.co.uk> schrieb im Newsbeitrag
>> > news:1263463572.5952.71.ca...@localhost...
>> > > On Thu, 2010-01-14 at 10:12 +0100, Jens Geier wrote:
>> > >
>> > >> "Ashley Sheridan" <a...@ashleysheridan.co.uk> 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" <a...@ashleysheridan.co.uk> 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
>>
>
> I recently used rsync (for the first time, even) in order to transfer an
> entire directory structure of several thousand files and folders from one
> VPS host to another. It worked like a dream, and the standard output could
> be captured to build a report such as the OP was asking for.
>
> Srsly, man -- take Ashley's suggestion and at least check it out. :)
>
Hello Ashley,
Hello haliphax,

yes i will try it, but please give me some time to do it ...... please .....

Kind Regards
Jens Geier 



--- End Message ---
--- Begin Message ---
"Ashley Sheridan" <a...@ashleysheridan.co.uk> schrieb im Newsbeitrag 
news:1263469507.5952.75.ca...@localhost...
> On Thu, 2010-01-14 at 12:32 +0100, Jens Geier wrote:
>
>> "Ashley Sheridan" <a...@ashleysheridan.co.uk> schrieb im Newsbeitrag
>> news:1263463572.5952.71.ca...@localhost...
>> > On Thu, 2010-01-14 at 10:12 +0100, Jens Geier wrote:
>> >
>> >> "Ashley Sheridan" <a...@ashleysheridan.co.uk> 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" <a...@ashleysheridan.co.uk> 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
>
Hello Ashley,

rsync looks like the right tool i need to use.

But i need much MORE information about it.

You have an idea where i can find a news group like this for rsync?

Kind Regards
Jens Geier 



--- End Message ---
--- Begin Message ---
"Robert Cummings" <rob...@interjinn.com> schrieb im Newsbeitrag 
news:4b4f40d3.3010...@interjinn.com...
> haliphax wrote:
>> On Thu, Jan 14, 2010 at 5:45 AM, Ashley Sheridan
>> <a...@ashleysheridan.co.uk>wrote:
>>
>>> On Thu, 2010-01-14 at 12:32 +0100, Jens Geier wrote:
>>>
>>>> "Ashley Sheridan" <a...@ashleysheridan.co.uk> schrieb im Newsbeitrag
>>>> news:1263463572.5952.71.ca...@localhost...
>>>>> On Thu, 2010-01-14 at 10:12 +0100, Jens Geier wrote:
>>>>>
>>>>>> "Ashley Sheridan" <a...@ashleysheridan.co.uk> 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" <a...@ashleysheridan.co.uk> 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
>>>
>>
>> I recently used rsync (for the first time, even) in order to transfer an
>> entire directory structure of several thousand files and folders from one
>> VPS host to another. It worked like a dream, and the standard output 
>> could
>> be captured to build a report such as the OP was asking for.
>>
>> Srsly, man -- take Ashley's suggestion and at least check it out. :)
>
> I've been using rsnapshot (it uses rsync) to do backups of remote server 
> directories:
>
>      http://rsnapshot.org/
>
> Just thought I'd throw it out there :)
>
> Cheers,
> Rob.
> -- 
> http://www.interjinn.com
> Application and Templating Framework for PHP

Hello Rob,

my source of the Backup should be my Laptop here in China and running MS 
Windows XP.
The Destination is my SERVER in Germany.

I find that rsnapshot does not run on windows ....

Kind Regards
Jens Geier



--- End Message ---
--- Begin Message ---
Hi All, Ash, Angelo,

Any ideas how to send an email in PHP on windows platform/xp on local
development machine.

System Configuration
PHP 5.2
Apache 2
No ISS
NO SMTP

Any trusted SMTP software to install on local development machine and how to
set it up with php to send an email?

Also just providing the SMTP server details in php.ini will not work for me
as this requires authentication/credentials etc..


Thanks,

Gaurav Kumar
blog.oswebstudio.com

--- End Message ---
--- Begin Message ---
Hi Gaurav

Gaurav Kumar wrote on 15/01/2010 09:54:

NO SMTP

Any trusted SMTP software to install on local development machine and how to
set it up with php to send an email?

Also just providing the SMTP server details in php.ini will not work for me
as this requires authentication/credentials etc..

Get PHPmailer and make a gmail account that you connect to and mail through.

--
Kind regards
Kim Emax - masterminds.dk

--- End Message ---
--- Begin Message ---
Sorry Kim, don't want to use phpmailer script or manually setting user
accounts u/p in the script.



On Fri, Jan 15, 2010 at 5:23 PM, Kim Madsen <php....@emax.dk> wrote:

> Hi Gaurav
>
> Gaurav Kumar wrote on 15/01/2010 09:54:
>
>
>  NO SMTP
>>
>> Any trusted SMTP software to install on local development machine and how
>> to
>> set it up with php to send an email?
>>
>> Also just providing the SMTP server details in php.ini will not work for
>> me
>> as this requires authentication/credentials etc..
>>
>
> Get PHPmailer and make a gmail account that you connect to and mail
> through.
>
> --
> Kind regards
> Kim Emax - masterminds.dk
>

--- End Message ---
--- Begin Message ---
You can install any smtp server on your windows machine and the mail() will
work with default settings. You can check this out:
http://www.softstack.com/freesmtp.html

Thanks,

Vikash Kumar
http://vika.sh


On Fri, Jan 15, 2010 at 5:30 PM, Gaurav Kumar
<kumargauravjuke...@gmail.com>wrote:

> Sorry Kim, don't want to use phpmailer script or manually setting user
> accounts u/p in the script.
>
>
>
> On Fri, Jan 15, 2010 at 5:23 PM, Kim Madsen <php....@emax.dk> wrote:
>
> > Hi Gaurav
> >
> > Gaurav Kumar wrote on 15/01/2010 09:54:
> >
> >
> >  NO SMTP
> >>
> >> Any trusted SMTP software to install on local development machine and
> how
> >> to
> >> set it up with php to send an email?
> >>
> >> Also just providing the SMTP server details in php.ini will not work for
> >> me
> >> as this requires authentication/credentials etc..
> >>
> >
> > Get PHPmailer and make a gmail account that you connect to and mail
> > through.
> >
> > --
> > Kind regards
> > Kim Emax - masterminds.dk
> >
>

--- End Message ---
--- Begin Message ---
2010/1/15  <vikash.i...@gmail.com>:
> You can install any smtp server on your windows machine and the mail() will
> work with default settings. You can check this out:
> http://www.softstack.com/freesmtp.html
>
> Thanks,
>
> Vikash Kumar
> http://vika.sh
>
>
> On Fri, Jan 15, 2010 at 5:30 PM, Gaurav Kumar
> <kumargauravjuke...@gmail.com>wrote:
>
>> Sorry Kim, don't want to use phpmailer script or manually setting user
>> accounts u/p in the script.
>>
>>
>>
>> On Fri, Jan 15, 2010 at 5:23 PM, Kim Madsen <php....@emax.dk> wrote:
>>
>> > Hi Gaurav
>> >
>> > Gaurav Kumar wrote on 15/01/2010 09:54:
>> >
>> >
>> >  NO SMTP
>> >>
>> >> Any trusted SMTP software to install on local development machine and
>> how
>> >> to
>> >> set it up with php to send an email?
>> >>
>> >> Also just providing the SMTP server details in php.ini will not work for
>> >> me
>> >> as this requires authentication/credentials etc..
>> >>
>> >
>> > Get PHPmailer and make a gmail account that you connect to and mail
>> > through.
>> >
>> > --
>> > Kind regards
>> > Kim Emax - masterminds.dk
>> >
>>
>

You only need a local SMTP server if you want to hold and relay mail.

If you want to send mail directly to the recipients SMTP server you
can do that with standard PHP.

getmxrr() is your friend here.

You provide it with the domain of the recipient and you get back the
SMTP server(s) associated with that domain.

Now, you can send the message to THEIR smtp server ...

ini_set('SMTP', xxxx);

where xxxx is one of the servers returned from getmxrr().

No authentication required.




-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--- End Message ---
--- Begin Message ---
Hi Richard, The problem is that if I am using any open source software or
any other pre-built software then I will not be able to manage through
ini_set.

Also http://www.softstack.com/freesmtp.html which vikash mentioned works
through outlook settings.

Anyways the below will help-

http://php.net/manual/en/ref.mail.php

http://glob.com.au/sendmail/

Thanks,

Gaurav Kumar
blog.oswebstudio.com



On Fri, Jan 15, 2010 at 6:21 PM, Richard Quadling
<rquadl...@googlemail.com>wrote:

> 2010/1/15  <vikash.i...@gmail.com>:
> > You can install any smtp server on your windows machine and the mail()
> will
> > work with default settings. You can check this out:
> > http://www.softstack.com/freesmtp.html
> >
> > Thanks,
> >
> > Vikash Kumar
> > http://vika.sh
> >
> >
> > On Fri, Jan 15, 2010 at 5:30 PM, Gaurav Kumar
> > <kumargauravjuke...@gmail.com>wrote:
> >
> >> Sorry Kim, don't want to use phpmailer script or manually setting user
> >> accounts u/p in the script.
> >>
> >>
> >>
> >> On Fri, Jan 15, 2010 at 5:23 PM, Kim Madsen <php....@emax.dk> wrote:
> >>
> >> > Hi Gaurav
> >> >
> >> > Gaurav Kumar wrote on 15/01/2010 09:54:
> >> >
> >> >
> >> >  NO SMTP
> >> >>
> >> >> Any trusted SMTP software to install on local development machine and
> >> how
> >> >> to
> >> >> set it up with php to send an email?
> >> >>
> >> >> Also just providing the SMTP server details in php.ini will not work
> for
> >> >> me
> >> >> as this requires authentication/credentials etc..
> >> >>
> >> >
> >> > Get PHPmailer and make a gmail account that you connect to and mail
> >> > through.
> >> >
> >> > --
> >> > Kind regards
> >> > Kim Emax - masterminds.dk
> >> >
> >>
> >
>
> You only need a local SMTP server if you want to hold and relay mail.
>
> If you want to send mail directly to the recipients SMTP server you
> can do that with standard PHP.
>
> getmxrr() is your friend here.
>
> You provide it with the domain of the recipient and you get back the
> SMTP server(s) associated with that domain.
>
> Now, you can send the message to THEIR smtp server ...
>
> ini_set('SMTP', xxxx);
>
> where xxxx is one of the servers returned from getmxrr().
>
> No authentication required.
>
>
>
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>

--- End Message ---
--- Begin Message ---
There are a variety of starting points available, depending on the
environment and application. See the Computer section of
<http://en.wikipedia.org/wiki/Epoch_%28reference_date%29> for a brief
review.

Bob McConnell

-----Original Message-----
From: haliphax [mailto:halip...@gmail.com] 
Sent: Thursday, January 14, 2010 4:14 PM
To: php-gene...@lists.php.net
Subject: Re: [PHP] strtotime

On Thu, Jan 14, 2010 at 2:53 PM, Adam Richardson
<simples...@gmail.com>wrote:

> I've not read this, but if the first valid date is Jan. 1st, 1970,
then
> passing that date back in the case of errors would lead to ambiguity.
Is
> it
> a valid date or is it an error.  Passing back the date of the day just
> before (in terms of time, I think it's the second before) the first
valid
> date lets you easily identify an error.
>
> Again, I didn't read this anywhere, though, and I could be wrong.
>
> Adam
>
> On Thu, Jan 14, 2010 at 3:47 PM, Kim Madsen <php....@emax.dk> wrote:
>
> > Hi guys
> >
> > I have a question:
> >
> > <snip>
> > Ashley Sheridan wrote on 14/01/2010 19:20:
> >
> > MySQL uses a default "0000-00-00" value for date fields generally,
but
> > when converted into a timestamp, the string equates to a false
value. In
> > PHP, timestamps are numerical values indicating the seconds since
> > Midnight of the 1st January 1969. As PHP uses loose data typing,
false
> > </snip>
> >
> > Adam Richardson wrote on 14/01/2010 19:25:
> > <snip>
> > 2. date returns 1969, because it's not passed a valid timestamp and
it
> > works from December 31, 1969 for any invalid date.
> > </snip>
> >
> > Why is this? Unixtime starts at January 1st 1970 GMT (see for
instance
> > http://php.net/microtime), I've never heard of the other dates you
> > mentioned.
> >
> > My guess is the time, date or GMT is wrong for Johns setup and
that's why
> > he get 1969 and not 1970, cause something is seting time in the past
>

Time zones. If I have PHP spit out a date for "0" as a string on my
system,
it comes back as 18:00 on December 31st, 1969, because I am in the
Central
time zone.

// Todd

--- End Message ---
--- Begin Message --- How do I call PHP code that will run server side, from javascript code that is running client side?

I have a lot of PHP server side code written and working within CodeIgniter. Now, my project has changed and (for reasons unimportant to this discussion) we are now NOT going to use apache and CodeIgniter, but instead, we are going to have to use an http server that does not support PHP internally. But I want to reuse my original PHP code. So I am thinking that I can execute the PHP code via a command line interface using the PHP cli interface instead of the PHP cgi interface. But, I will have to initiate this serversid call via javascript code running
on the client.

I know...kind of convoluted. But how would one do this if necessary?

-Andres

--- End Message ---

Reply via email to