php-general Digest 4 Jun 2009 13:22:19 -0000 Issue 6158
Topics (messages 293581 through 293597):
Re: Best Encryption Algorithm
293581 by: Luke
how to manage permissions for file uploader
293582 by: Lamp Lists
293587 by: Al
293588 by: Phpster
Re: Query Regarding a Player
293583 by: Eddie Drapkin
293584 by: Ashley Sheridan
Re: forms problem
293585 by: PJ
293586 by: PJ
293589 by: Shawn McKenzie
293590 by: Andrew Ballard
293597 by: Al
Re: Zebra Striped Table Example
293591 by: Raymond Irving
293595 by: Ashley Sheridan
PHP HELP
293592 by: tRace DOliveira
Timestamps and strftime
293593 by: John Comerford
293594 by: Mayer, Jonathan
293596 by: John Comerford
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 ---
2009/6/3 Andrew Ballard <[email protected]>
> On Wed, Jun 3, 2009 at 4:17 PM, Paul M Foster <[email protected]>
> wrote:
> > On Wed, Jun 03, 2009 at 07:57:32PM +0100, Ashley Sheridan wrote:
> >
> > <snip>
> >
> >> A single-phase Caesar cypher is by far the best. It worked for Julias
> >> Caesar, and damn it, it will work for us!
> >
> > ROT13 FTW!
> >
> > Paul
> >
> > --
> > Paul M. Foster
> >
>
> ROT26 - because it's twice as strong! :-P
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I was once working with a very problematic partner that kept changing data
in our database, so I rot13d all the data and told him it was some advanced
encryption and he never worked it out :)
--
Luke Slater
:O)
--- End Message ---
--- Begin Message ---
to upload an image for a photo gallery (my own code) I have to have permission
for the directory images 0777.
but having permission for a directory 0777 is REALLY bad idea, isn't it?
I'm "owner" of the directory (lamp:lamp images).
what to do to set my code has permission to upload an image into the images
directory and have permissions on the directory 0755?
I googled for file uploader scripts and classes to se how they handle it but I
can't see that part. just file/size/type validation and moving uploaded file to
final destination.
thanks.
-LL
--- End Message ---
--- Begin Message ---
Lamp Lists wrote:
to upload an image for a photo gallery (my own code) I have to have permission
for the directory images 0777.
but having permission for a directory 0777 is REALLY bad idea, isn't it?
I'm "owner" of the directory (lamp:lamp images).
what to do to set my code has permission to upload an image into the images
directory and have permissions on the directory 0755?
I googled for file uploader scripts and classes to se how they handle it but I
can't see that part. just file/size/type validation and moving uploaded file to
final destination.
thanks.
-LL
A simple way is have your program create the dir, instead of you doing it with
ftp or a file manager on the sever. Then your scripts will "own" the dir.
--- End Message ---
--- Begin Message ---
This is fairly simple to do as an http upload. With the folder above
the web root, it less if an issue since general users can't gain
access, a script can do all the interaction needed. Plus you can chown
the permissions with php
Bastien
Sent from my iPod
On Jun 3, 2009, at 17:24, Lamp Lists <[email protected]> wrote:
to upload an image for a photo gallery (my own code) I have to have
permission for the directory images 0777.
but having permission for a directory 0777 is REALLY bad idea, isn't
it?
I'm "owner" of the directory (lamp:lamp images).
what to do to set my code has permission to upload an image into the
images directory and have permissions on the directory 0755?
I googled for file uploader scripts and classes to se how they
handle it but I can't see that part. just file/size/type validation
and moving uploaded file to final destination.
thanks.
-LL
--- End Message ---
--- Begin Message ---
But it's client side software and you can't rely on it existing for general
use.
On Wed, Jun 3, 2009 at 2:52 PM, Ashley Sheridan
<[email protected]>wrote:
> On Wed, 2009-06-03 at 09:18 -0500, haliphax wrote:
> > On Wed, Jun 3, 2009 at 8:14 AM, Hemant Patel <[email protected]>
> wrote:
> > > Hi All,
> > > I hope you all are doing great.We are developing a
> application
> > > on our end and we got a problem with a Audio/Vedio player.As flash
> player is
> > > working well with client side but it has limitation of file formats
> like it
> > > can run .flv file format only.If we go for media player then it won't
> run
> > > on Linux Server.
> > >
> > > Now i want to develop a player which can run any file format
> at
> > > client side.Can anybody suggest any algorithm or protocol to build a
> Player?
> >
> > As many have already done, you might consider just transcoding the
> > "bad" formats into FLV and stick with your current Flash player setup.
> > There are many ffmpeg tutorials out there that should help you out
> > [1].
> >
> > 1.
> http://vexxhost.com/blog/2007/05/20/how-to-convertencode-files-to-flv-using-ffmpeg-php/
> >
> > --
> > // Todd
> >
> Or use HTML code for the VLC player, which will play pretty much
> anything and is cross-platform and cross-os. It's not as fully
> customisable as Flash, but it has some nice options that you can play
> about with with Javascript.
>
>
> Ash
> www.ashleysheridan.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On Wed, 2009-06-03 at 17:54 -0400, Eddie Drapkin wrote:
> But it's client side software and you can't rely on it existing for general
> use.
>
> On Wed, Jun 3, 2009 at 2:52 PM, Ashley Sheridan
> <[email protected]>wrote:
>
> > On Wed, 2009-06-03 at 09:18 -0500, haliphax wrote:
> > > On Wed, Jun 3, 2009 at 8:14 AM, Hemant Patel <[email protected]>
> > wrote:
> > > > Hi All,
> > > > I hope you all are doing great.We are developing a
> > application
> > > > on our end and we got a problem with a Audio/Vedio player.As flash
> > player is
> > > > working well with client side but it has limitation of file formats
> > like it
> > > > can run .flv file format only.If we go for media player then it won't
> > run
> > > > on Linux Server.
> > > >
> > > > Now i want to develop a player which can run any file format
> > at
> > > > client side.Can anybody suggest any algorithm or protocol to build a
> > Player?
> > >
> > > As many have already done, you might consider just transcoding the
> > > "bad" formats into FLV and stick with your current Flash player setup.
> > > There are many ffmpeg tutorials out there that should help you out
> > > [1].
> > >
> > > 1.
> > http://vexxhost.com/blog/2007/05/20/how-to-convertencode-files-to-flv-using-ffmpeg-php/
> > >
> > > --
> > > // Todd
> > >
> > Or use HTML code for the VLC player, which will play pretty much
> > anything and is cross-platform and cross-os. It's not as fully
> > customisable as Flash, but it has some nice options that you can play
> > about with with Javascript.
> >
> >
> > Ash
> > www.ashleysheridan.co.uk
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
As is the Flash player... Admittedly, it has a higher market
penetration, but your argument stands for both. If there are things you
really have to deliver, and you can't force flv formats on them, the use
VLC.
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Tom Chubb wrote:
> 2009/6/3 PJ <[email protected]>:
>
>> The code:
>> ...snip
>> <div id="loginbox">
>> <form name="login" method="post" action="<? echo
>> $_SERVER['PHP_SELF'] ?>">
>> <h2>accès client <br /><input type="text"
>> name="title" value="<? echo $user; ?>" size="10" /><br />
>> mot de passe <br /><input type="text" name="title" value="<?
>> echo $passwd; ?>" size="10" /><br />
>> <input class="submit" name="submit" type="submit"
>> value=" entrez " /><br /></h2>
>> <h2><a href="inscription.php"> Inscription </a></h2>
>> </form>
>> </div
>> snip...
>>
>> PROBLEM 1: On Firefox3, the first input (accès client) does not accept
>> any input, does not show the cursor; the second input (mot de passe)
>> works fine.
>>
>> PROBLEM 2: The form does not appear on IE 6
>>
>> Running FreeBSD 7.1, apache22, php 5, using sessions, CSS
>>
>> Am I doing something wrong?
>>
>> --
>> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
>> -------------------------------------------------------------
>> Phil Jourdan --- [email protected]
>> http://www.ptahhotep.com
>> http://www.chiccantine.com/andypantry.php
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
> I think the first problem is because both your inputs are defined as "title".
>
Does that change anything in the functionanlity? If so, how?
Bastien says it works in IE8; here it does not in IE6. :-)
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
AngeloZanetti wrote:
>
> Shawn McKenzie wrote:
>
>> PJ wrote:
>>
>>> PROBLEM 1 solved: errant <div>s removed; strange that they were
>>> inhibiting entry of data into form field?
>>>
>>> PROBLEM 2 not resolved: but the form was off the page and clipped in
>>> upper right hand corner. What can be done to get it to show correctly?
>>>
>>>
>> Remove the link to any stylesheets that you're using and see what it
>> looks like.
>>
>>
>>
>>
>
> Where is your source code / form so we can see what is going on?
>
> http://www.Elemental.co.za http://www.Elemental.co.za
> http://www.wapit.co.za http://www.wapit.co.za
>
The code:
...snip
<div id="loginbox">
<form name="login" method="post" action="<? echo
$_SERVER['PHP_SELF'] ?>">
<h2>accès client <br /><input type="text"
name="title" value="<? echo $user; ?>" size="10" /><br />
mot de passe <br /><input type="text" name="title" value="<?
echo $passwd; ?>" size="10" /><br />
<input class="submit" name="submit" type="submit"
value=" entrez " /><br /></h2>
<h2><a href="inscription.php"> Inscription </a></h2>
</form>
</div
snip...
I had posted this earlier... just before finding the blockage for the input in
PROBLEM 1, though I don't know why some stray <div>s would cause that.
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
PJ wrote:
> AngeloZanetti wrote:
>> Shawn McKenzie wrote:
>>
>>> PJ wrote:
>>>
>>>> PROBLEM 1 solved: errant <div>s removed; strange that they were
>>>> inhibiting entry of data into form field?
>>>>
>>>> PROBLEM 2 not resolved: but the form was off the page and
>>>> clipped in upper right hand corner. What can be done to get it
>>>> to show correctly?
>>>>
>>>>
>>> Remove the link to any stylesheets that you're using and see what
>>> it looks like.
>>>
>>>
>>>
>>>
>> Where is your source code / form so we can see what is going on?
>>
>> http://www.Elemental.co.za http://www.Elemental.co.za
>> http://www.wapit.co.za http://www.wapit.co.za
>>
>
> The code: ...snip <div id="loginbox"> <form name="login"
> method="post" action="<? echo $_SERVER['PHP_SELF'] ?>">
> <h2>accès client <br /><input type="text" name="title"
> value="<? echo $user; ?>" size="10" /><br /> mot de passe <br
> /><input type="text" name="title" value="<? echo $passwd; ?>"
> size="10" /><br /> <input class="submit" name="submit" type="submit"
> value=" entrez " /><br /></h2> <h2><a
> href="inscription.php"> Inscription </a></h2> </form> </div snip...
>
> I had posted this earlier... just before finding the blockage for the
> input in PROBLEM 1, though I don't know why some stray <div>s would
> cause that.
>
>
Based on the fact that you said things were "off the page and clipped in
the upper right hand corner", I thought that you had a style that may
have positioned the div or the form or something. If you disable all
styles, whether in the head of the document or via an external
stylesheet, then that should show the form on the page as it should.
--
Thanks!
-Shawn
http://www.spidean.com
--- End Message ---
--- Begin Message ---
On Wed, Jun 3, 2009 at 7:13 PM, PJ <[email protected]> wrote:
> Tom Chubb wrote:
>> 2009/6/3 PJ <[email protected]>:
>>
>>> The code:
>>> ...snip
>>> <div id="loginbox">
>>> <form name="login" method="post" action="<? echo
>>> $_SERVER['PHP_SELF'] ?>">
>>> <h2>accès client <br /><input type="text"
>>> name="title" value="<? echo $user; ?>" size="10" /><br />
>>> mot de passe <br /><input type="text" name="title" value="<?
>>> echo $passwd; ?>" size="10" /><br />
>>> <input class="submit" name="submit" type="submit"
>>> value=" entrez " /><br /></h2>
>>> <h2><a href="inscription.php"> Inscription </a></h2>
>>> </form>
>>> </div
>>> snip...
>>>
>>> PROBLEM 1: On Firefox3, the first input (accès client) does not accept
>>> any input, does not show the cursor; the second input (mot de passe)
>>> works fine.
>>>
>>> PROBLEM 2: The form does not appear on IE 6
>>>
>>> Running FreeBSD 7.1, apache22, php 5, using sessions, CSS
>>>
>>> Am I doing something wrong?
>>>
>>> --
>>> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
>>> -------------------------------------------------------------
>>> Phil Jourdan --- [email protected]
>>> http://www.ptahhotep.com
>>> http://www.chiccantine.com/andypantry.php
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>>
>> I think the first problem is because both your inputs are defined as "title".
>>
> Does that change anything in the functionanlity? If so, how?
> Bastien says it works in IE8; here it does not in IE6. :-)
>
I'm not sure about functionanlity, but it definitely changes the
functionality. ;-)
It means that regardless of whether someone is able to enter a value
in the field you have labeled "accès client", your PHP page will never
see it because it will look at the value from the field you have
labeled "mot de passe", even if it is left blank. And that is true
regardless of which browser they are using. In some scripting platform
other than PHP, or if you process the raw post data yourself it could
be different, but in PHP the variable $_POST['title'] will only have
one value in it, and it will be the last one passed by the form. (In
this case, "mot de passe".)
Andrew
--- End Message ---
--- Begin Message ---
PJ wrote:
The code:
...snip
<div id="loginbox">
<form name="login" method="post" action="<? echo
$_SERVER['PHP_SELF'] ?>">
<h2>accès client <br /><input type="text"
name="title" value="<? echo $user; ?>" size="10" /><br />
mot de passe <br /><input type="text" name="title" value="<?
echo $passwd; ?>" size="10" /><br />
<input class="submit" name="submit" type="submit"
value=" entrez " /><br /></h2>
<h2><a href="inscription.php"> Inscription </a></h2>
</form>
</div
snip...
PROBLEM 1: On Firefox3, the first input (accès client) does not accept
any input, does not show the cursor; the second input (mot de passe)
works fine.
PROBLEM 2: The form does not appear on IE 6
Running FreeBSD 7.1, apache22, php 5, using sessions, CSS
Am I doing something wrong?
Always W3C validate html and CSS .
Use Firefox's "Web Developer" extension. It's super. It would have shown you the
problems in minutes, see the "forms" selections. I also use the "HTML Validator"
extension. Leave it active and as you develop and test your resultant html code,
it'll check your pages on the fly. When you see the red circle, with a cross,
click the circle and get an error report in detail.
--- End Message ---
--- Begin Message ---
Hi Ashley,
Thanks for the feedback. See my comments below:
> Doesn't work in the majority of browsers out there at the
> moment.
I've tested it in IE7, FF3, Safari3 and Opera9. Which Browsers have you tested
it in?
> For striped tables, you're still better off
> using server-side code to apply a class to every other row of the
> table. Pure
> CSS solutions are not ready
The zebra example was created using server-side code (Raxan PDI) and can be
made to use CSS classes if you so desire:
$page['table tr:even']->addCSS('row-color');
$page->reply();
The above example will generate html tags that can be rendered in all html
browsers.
The Raxan Framework is very flexible enough to allow developers to create just
about anything they want.
I would recommend that you download the framework and give the examples a try
to see how easy it is to create both Ajax and Non-Ajax webpages.
If you have any questions feel free to drop me a line or post a comment inside
the forum.
__
Raymond Irving
Quickly build and maintain PHP Ajax application
Raxan PDI - http://raxanpdi.com
--- End Message ---
--- Begin Message ---
On Wed, 2009-06-03 at 21:58 -0700, Raymond Irving wrote:
> Hi Ashley,
>
> Thanks for the feedback. See my comments below:
>
> > Doesn't work in the majority of browsers out there at the
> > moment.
>
> I've tested it in IE7, FF3, Safari3 and Opera9. Which Browsers have you
> tested it in?
>
> > For striped tables, you're still better off
> > using server-side code to apply a class to every other row of the
> > table. Pure
> > CSS solutions are not ready
>
> The zebra example was created using server-side code (Raxan PDI) and can be
> made to use CSS classes if you so desire:
>
> $page['table tr:even']->addCSS('row-color');
> $page->reply();
>
> The above example will generate html tags that can be rendered in all html
> browsers.
>
> The Raxan Framework is very flexible enough to allow developers to create
> just about anything they want.
>
> I would recommend that you download the framework and give the examples a try
> to see how easy it is to create both Ajax and Non-Ajax webpages.
>
> If you have any questions feel free to drop me a line or post a comment
> inside the forum.
>
> __
> Raymond Irving
> Quickly build and maintain PHP Ajax application
> Raxan PDI - http://raxanpdi.com
>
>
I tested in Firefox 2, just showed a plain vanilla table, with no row
colours at all. My guess is, it won't work with IE6 either. These are
the two browsers most common at the moment (as far as my stats go)
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Can anyone help me to install APC in Xampp on windows ?
--- End Message ---
--- Begin Message ---
Hi,
I am having a problem trying to use a date that I take from a MySQL
database. The field is defined as a timestamp in the database. I
extract it using PDO and I am trying to use the value with strftime as
follows:
foreach ($stmt->fetchall(PDO::FETCH_ASSOC) as $row) {
echo strftime("%j",$row['UpdateDate']);
}
but it returns the following error:
PHP Notice: A non well formed numeric value encountered...
I understand that this is because strftime is expecting a numeric value
and that ,$row['UpdateDate'] is a character but I am not sure how to
resolve the issue. Any help would be apprecaited.
TIA,
JC
--- End Message ---
--- Begin Message ---
Off the top of my head, would strtotime work?
ie
strftime("%j",strtotime($row['UpdateDate']))
-----Original Message-----
From: John Comerford [mailto:[email protected]]
Sent: 04 June 2009 07:10
To: [email protected]
Subject: [PHP] Timestamps and strftime
Hi,
I am having a problem trying to use a date that I take from a MySQL
database. The field is defined as a timestamp in the database. I
extract it using PDO and I am trying to use the value with strftime as
follows:
foreach ($stmt->fetchall(PDO::FETCH_ASSOC) as $row) {
echo strftime("%j",$row['UpdateDate']);
}
but it returns the following error:
PHP Notice: A non well formed numeric value encountered...
I understand that this is because strftime is expecting a numeric value
and that ,$row['UpdateDate'] is a character but I am not sure how to
resolve the issue. Any help would be apprecaited.
TIA,
JC
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Thanks Jonathan,
Thats exactly what I needed.
I appreciate the help,
JC
Mayer, Jonathan wrote:
Off the top of my head, would strtotime work?
ie
strftime("%j",strtotime($row['UpdateDate']))
-----Original Message-----
From: John Comerford [mailto:[email protected]]
Sent: 04 June 2009 07:10
To: [email protected]
Subject: [PHP] Timestamps and strftime
Hi,
I am having a problem trying to use a date that I take from a MySQL
database. The field is defined as a timestamp in the database. I
extract it using PDO and I am trying to use the value with strftime as
follows:
foreach ($stmt->fetchall(PDO::FETCH_ASSOC) as $row) {
echo strftime("%j",$row['UpdateDate']);
}
but it returns the following error:
PHP Notice: A non well formed numeric value encountered...
I understand that this is because strftime is expecting a numeric value
and that ,$row['UpdateDate'] is a character but I am not sure how to
resolve the issue. Any help would be apprecaited.
TIA,
JC
--
Option Systems Pty. Ltd.
53 Waverley Road, Malvern East, VIC 3145
PO Box 7, Caulfield East, VIC 3145
Phone: 03 9571 0100 Fax: 03 9571 0500
The information in this e-mail is confidential and is intended solely for the addressee.
Any views or opinions presented are solely those of the author
and do not necessarily represent those of Option Systems Pty.Ltd.
If you are not the intended recipient, please delete this message and
contact the sender.
--- End Message ---