[PHP] bibtex

2009-06-03 Thread Michael A. Peters
Is there already a php class that can parse a bibtex file and produce 
html formated works cited / bibliography output?


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



[PHP] memcached as session handler 3x more reads then writes

2009-06-03 Thread Stan

Hi,

Does anyone have an experience with using memcached session handler or 
possibly enough knowledge of internal php session processing who could 
explain why we do get 3x more session set commands then get commands?
in data it is actually 1:1, same amount of data is being written as read 
which is what we expect but we are confused by set:get ratio. Apart from 
that session handling seems to be stable and with no problems.


Thanks Stan


here is memcache stat:


   [pid] = 12709
   [uptime] = 98239
   [time] = 1244029678
   [version] = 1.2.6
   [pointer_size] = 64
   [rusage_user] = 359.122443
   [rusage_system] = 533.937369
   [curr_items] = 149742
   [total_items] = 12530243
   [bytes] = 412168840
   [curr_connections] = 58
   [total_connections] = 4983
   [connection_structures] = 286
   [cmd_get] = 5765795
   [cmd_set] = 16948817
   [get_hits] = 5683669
   [get_misses] = 82126
   [evictions] = 0
   [bytes_read] = 50024940586
   [bytes_written] = 50218604759
   [limit_maxbytes] = 1073741824
   [threads] = 4




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



Re: [PHP] MySQL after oracle, still Wise?, was Web application design .......

2009-06-03 Thread Sancar Saran
On Tuesday 02 June 2009 11:36:28 pm optoma...@rogers.com wrote:
 Everybody has given Angus really great advice in this previous thread
 and I have learned a lot too. I hope no one mines the fork but I am in
 the exact same situation as Angus. If anyone could spare a bit of time
 regarding application infrastructure I would really appreciate it.

 I know there are lots of databases out there and PostgreSQL is held in
 high regard but the overwhelming majority of examples seem to use MySQL.
 Considering that Oracle has bought Sun, do you think it is still wise to
 use it for new applications? Oracle does not have much street cred in
 open source circles, maybe they'll cause trouble later and MySQL was
 already forking was it not? I'd like to use the same DB for a few years.

 I am attracted to building an application from scratch but I will never
 get an object relational mapper to work without a framework. If I go the
 scratch route, I'd better get my database done right(as was advised in
 the previous thread!)and getting that right probably starts with
 choosing the right DB.

 Any thoughts?-Patrick

Check the popular projects (phpBB, TYPO3, Drupal) when they start to move 
MySQL to somewhere it time to start moving.

And if you so much thinking about future DB change. Just wrote compatible sql 
and use multi drive layer (phpADO db).

And you are problem free

Regards

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



RE: [PHP] MySQL after oracle, still Wise?, was Web application design .......

2009-06-03 Thread Bob McConnell
From: Sancar Saran

 And if you so much thinking about future DB change. Just wrote
compatible sql 
 and use multi drive layer (phpADO db).
 
 And you are problem free

I have some questions about this suggestion. We currently have
production systems using Postgres, Sybase ASA, Oracle and MS SQL Server.
Only one product currently supports more than one, it can be installed
with ASA or connect to an existing Oracle server. This unfortunate mix
was brought about by several acquisitions over the past ten years. We
also have a group talking about using MySQL for a portal project. One
product did use MySQL prior to their switch to per server license fees,
which made them far too expensive for the distributed system they were
used in. So that project switched to Postgres.

But what is the ADO layer going to look like in order to support any or
all combinations of these back ends? How much of a kludge will it have
to become?

Is there any code out there that will support most of these, or do we
have to write it all ourselves?

Most of my SQL experience has been with Sybase ASA. I am playing with
Postgres a little bit now, and the differences can be both subtle and
glaring. But I don't know either one well enough to understand how to
design an ADO interface, let alone how to bring in the other options.

Thank you,

Bob McConnell

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



Re: [PHP] MySQL after oracle, still Wise?, was Web application design .......

2009-06-03 Thread Eddie Drapkin
Sadly, Mr. Saran wasted a lot of time writing a pluggable backend db layer,
as one is built into PHP now, PDO: http://us2.php.net/pdo

Sybase / MsSQL: http://www.php.net/manual/en/ref.pdo-dblib.php
Postgres: http://us2.php.net/manual/en/ref.pdo-pgsql.php
Oracle: http://us2.php.net/manual/en/ref.pdo-oci.php

The only difference in using them is the dsn you pass to the constructor,
which can even be dynamically generated if you see fit.  The actual usage
from driver-to-driver is the same; I've used it on postgres, mysql and
sqlite.  Based from the meeting notes of several 6.0 developer notes, it
might or might not be the only database extension not in PECL soon.

On Wed, Jun 3, 2009 at 8:51 AM, Bob McConnell r...@cbord.com wrote:

 From: Sancar Saran

  And if you so much thinking about future DB change. Just wrote
 compatible sql
  and use multi drive layer (phpADO db).
 
  And you are problem free

 I have some questions about this suggestion. We currently have
 production systems using Postgres, Sybase ASA, Oracle and MS SQL Server.
 Only one product currently supports more than one, it can be installed
 with ASA or connect to an existing Oracle server. This unfortunate mix
 was brought about by several acquisitions over the past ten years. We
 also have a group talking about using MySQL for a portal project. One
 product did use MySQL prior to their switch to per server license fees,
 which made them far too expensive for the distributed system they were
 used in. So that project switched to Postgres.

 But what is the ADO layer going to look like in order to support any or
 all combinations of these back ends? How much of a kludge will it have
 to become?

 Is there any code out there that will support most of these, or do we
 have to write it all ourselves?

 Most of my SQL experience has been with Sybase ASA. I am playing with
 Postgres a little bit now, and the differences can be both subtle and
 glaring. But I don't know either one well enough to understand how to
 design an ADO interface, let alone how to bring in the other options.

 Thank you,

 Bob McConnell

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




Re: [PHP] Re: PHP Security

2009-06-03 Thread Andrew Ballard
On Tue, Jun 2, 2009 at 7:39 PM, Shawn McKenzie nos...@mckenzies.net wrote:
 Grant Peel wrote:
 Hi all,

 I am currently setting up the next generation web server for our company and 
 am in need of general consulting/advice on php set up security issues.

 Any one with knowledge and expierience please feel free to reply :-).

 -Grant

 Do not under any circumstances put the web server on the Internet.

 --
 Thanks!
 -Shawn
 http://www.spidean.com


Furthermore, disconnect all storage media to make sure no one is able
to access files that they should not access, remove any network
interface cards and smash them to make sure malicious users cannot
even connect to the machine, and fill any I/O ports with superglue to
ensure that no one can plug any unauthorized devices. Oh, and be sure
to remove the power supply to prevent local terminal access.  ;-)

Andrew

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



[PHP] Query Regarding a Player

2009-06-03 Thread Hemant Patel
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?

With Regards,
Hemant Patel


Re: [PHP] Best Encryption Algorithm

2009-06-03 Thread Matty Sarro
I believe none of the AES algorithms have been compromised so far. DES is
known to be broken, 3DES was just severely compromised. I don't know where
blowfish stands at the moment.

On Wed, Jun 3, 2009 at 9:20 AM, Hemant Patel hemant.develo...@gmail.comwrote:

 Hello Everyone,
  Hope you all are doing great.
  Now we are creating a application which has high level
 of security so its obvious that we will require a algorithm for
 encryption/decrytpion.So Can anybody suggest me the best algorithm for
 encryption(irrespective of any languageJust a Algorithm).


 With Regards,
 Hemant Patel



Re: [PHP] Best Encryption Algorithm

2009-06-03 Thread Bruno Fajardo
Hi there!

Try out AES.
http://en.wikipedia.org/wiki/Advanced_Encryption_Standard

Bruno.

2009/6/3 Hemant Patel hemant.develo...@gmail.com

 Hello Everyone,
                      Hope you all are doing great.
                      Now we are creating a application which has high level
 of security so its obvious that we will require a algorithm for
 encryption/decrytpion.So Can anybody suggest me the best algorithm for
 encryption(irrespective of any languageJust a Algorithm).


 With Regards,
 Hemant Patel

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



[PHP] Re: Project Euler [Oh, this isn't spam mail...]

2009-06-03 Thread Eduardo Varela

Andrew Hucks andrewphpm...@gmail.com wrote in message
news:fa5046930904281330q218de147n5b295eeb9702a...@mail.gmail.com...
 This isn't a question. :-D.

 Anyways, there's a website that I came across which has kept me up
 past bedtime the past few nights.

 Project Euler is a series of challenging mathematical/computer
 programming problems that will require more than just mathematical
 insights to solve. Although mathematics will help you arrive at
 elegant and efficient methods, the use of a computer and programming
 skills will be required to solve most problems.

 http://projecteuler.net/index.php?section=problems

 Take a look. A fun thing to do when you're bored.

That is a good place for people interested in Numbers Theory. I registered
and had a good time adding even numbers and multiples of three below 1000.

When you answer correctly a problem, you can access to a forum where you can
post a mathematical demonstration of your work, or the code of the program
used, or both.


Eduardo
Buenos Aires, 8.7 ºC, fearing dengue mosquitoes and feverish pigs.





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



Re: [PHP] Best Encryption Algorithm

2009-06-03 Thread haliphax
On Wed, Jun 3, 2009 at 8:28 AM, Bruno Fajardo bsfaja...@gmail.com wrote:
 Hi there!

 Try out AES.
 http://en.wikipedia.org/wiki/Advanced_Encryption_Standard

 Bruno.

 2009/6/3 Hemant Patel hemant.develo...@gmail.com

 Hello Everyone,
                      Hope you all are doing great.
                      Now we are creating a application which has high level
 of security so its obvious that we will require a algorithm for
 encryption/decrytpion.So Can anybody suggest me the best algorithm for
 encryption(irrespective of any languageJust a Algorithm).

This link [1] should explain the algorithm to a point, as well as work
as a good place to jump off from and investigate other algorithm
choices. Below the main article, there is also a list of PHP
implementations (as well as additional languages).

As for Blowfish--if you're going down that road, I would recommend its
successor, Twofish [2].

1. http://en.wikipedia.org/wiki/Advanced_Encryption_Standard
2. http://en.wikipedia.org/wiki/Twofish

HTH,


-- 
// Todd

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



Re: [PHP] Query Regarding a Player

2009-06-03 Thread haliphax
On Wed, Jun 3, 2009 at 8:14 AM, Hemant Patel hemant.develo...@gmail.com 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

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



[PHP] forms problem

2009-06-03 Thread PJ
The code:
...snip
div id=loginbox
form name=login method=post action=? echo
$_SERVER['PHP_SELF'] ?
h2accegrave;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
h2a 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 --- p...@ptahhotep.com
   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



Re: [PHP] forms problem

2009-06-03 Thread Bastien Koert
On Wed, Jun 3, 2009 at 11:55 AM, PJ af.gour...@videotron.ca wrote:
 The code:
 ...snip
 div id=loginbox
        form name=login method=post action=? echo
 $_SERVER['PHP_SELF'] ?
            h2accegrave;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
            h2a 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 --- p...@ptahhotep.com
   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



works in IE8 and Chorme

Doesn't look like anything is wrong..post more code


-- 

Bastien

Cat, the other other white meat

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



[PHP] forms problem

2009-06-03 Thread PJ
PROBLEM 1 solved: errant divs 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?

-- 
Hervé Kempf: Pour sauver la planète, sortez du capitalisme.
-
Phil Jourdan --- p...@ptahhotep.com
   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



[PHP] Web friendly file names

2009-06-03 Thread Skip Evans

Hey all,

I have a file uploader module that allows users to upload 
documents and of course people are using all kinds of file 
names that are not web friendly.


I guess the best solution is to replace any non alphanumeric 
with maybe '_' the underscore? How does that sound?


Unfortunately, after 20+ years of coding I cannot get my brain 
around regular expressions to any decent level of proficiency, 
I know sad.


I'd like to hear other solutions for this problem, I am 
thinking of a regexp that replaces special chars with the 
underscore; sounds pretty robust and globally acceptable?


Opinions, witticisms, flames, quotations by famous débutantes?

(The last is optional)
--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

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



Re: [PHP] forms problem

2009-06-03 Thread Tom Chubb
2009/6/3 PJ af.gour...@videotron.ca:
 The code:
 ...snip
 div id=loginbox
        form name=login method=post action=? echo
 $_SERVER['PHP_SELF'] ?
            h2accegrave;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
            h2a 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 --- p...@ptahhotep.com
   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.

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



[PHP] Amazon s3 and PHP

2009-06-03 Thread R B
Hi,

Do you know if amazon s3 hosting support php files?

Thanks.

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



Re: [PHP] Web friendly file names

2009-06-03 Thread Richard Heyes
Hi,

 I have a file uploader module that allows users to upload documents and of
 course people are using all kinds of file names that are not web friendly.

 I guess the best solution is to replace any non alphanumeric with maybe '_'
 the underscore? How does that sound?

 Unfortunately, after 20+ years of coding I cannot get my brain around
 regular expressions to any decent level of proficiency, I know sad.

 I'd like to hear other solutions for this problem, I am thinking of a regexp
 that replaces special chars with the underscore; sounds pretty robust and
 globally acceptable?

I replace any non alpha chat with a hyphen, then replace two or more
hyphens with one. Simple, but I would also include the date so that
naming clashes are less likely (if it's applicable). So you might end
up with something similar to this:

/product/2009/06/03/24ct-gold-earrings

Or if using the date is not applicable, you could get something like this:

/product/24ct-gold-earrings

-- 
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net - updated 23rd May)
PHP mail: RMail (www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate)
PHP SMTP: http://www.phpguru.org/smtp

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



Re: [PHP] Web friendly file names

2009-06-03 Thread Eddie Drapkin
Why not just urlencode() the filename? (and suggest people use a URL
shortening service and/or provide one)

On Wed, Jun 3, 2009 at 12:31 PM, Richard Heyes rich...@php.net wrote:

 Hi,

  I have a file uploader module that allows users to upload documents and
 of
  course people are using all kinds of file names that are not web
 friendly.
 
  I guess the best solution is to replace any non alphanumeric with maybe
 '_'
  the underscore? How does that sound?
 
  Unfortunately, after 20+ years of coding I cannot get my brain around
  regular expressions to any decent level of proficiency, I know sad.
 
  I'd like to hear other solutions for this problem, I am thinking of a
 regexp
  that replaces special chars with the underscore; sounds pretty robust and
  globally acceptable?

 I replace any non alpha chat with a hyphen, then replace two or more
 hyphens with one. Simple, but I would also include the date so that
 naming clashes are less likely (if it's applicable). So you might end
 up with something similar to this:

 /product/2009/06/03/24ct-gold-earrings

 Or if using the date is not applicable, you could get something like this:

 /product/24ct-gold-earrings

 --
 Richard Heyes
 HTML5 graphing: RGraph (www.rgraph.net - updated 23rd May)
 PHP mail: RMail (www.phpguru.org/rmail)
 PHP datagrid: RGrid (www.phpguru.org/rgrid)
 PHP Template: RTemplate (www.phpguru.org/rtemplate)
 PHP SMTP: http://www.phpguru.org/smtp

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




Re: [PHP] Web friendly file names

2009-06-03 Thread Skip Evans
You mean like this? This would work as a good file name to be 
on the server and link to?


$filename = urlencode($_FILES['myfile']['name']);
move_uploaded_file($_FILES['myfile']['tmp_name'], $filename);

Think that would do the trick?

Skip

Eddie Drapkin wrote:
Why not just urlencode() the filename? (and suggest people use a URL 
shortening service and/or provide one)


On Wed, Jun 3, 2009 at 12:31 PM, Richard Heyes rich...@php.net 
mailto:rich...@php.net wrote:


Hi,

  I have a file uploader module that allows users to upload
documents and of
  course people are using all kinds of file names that are not web
friendly.
 
  I guess the best solution is to replace any non alphanumeric with
maybe '_'
  the underscore? How does that sound?
 
  Unfortunately, after 20+ years of coding I cannot get my brain around
  regular expressions to any decent level of proficiency, I know sad.
 
  I'd like to hear other solutions for this problem, I am thinking
of a regexp
  that replaces special chars with the underscore; sounds pretty
robust and
  globally acceptable?

I replace any non alpha chat with a hyphen, then replace two or more
hyphens with one. Simple, but I would also include the date so that
naming clashes are less likely (if it's applicable). So you might end
up with something similar to this:

/product/2009/06/03/24ct-gold-earrings

Or if using the date is not applicable, you could get something like
this:

/product/24ct-gold-earrings

--
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net http://www.rgraph.net -
updated 23rd May)
PHP mail: RMail (www.phpguru.org/rmail http://www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid
http://www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate
http://www.phpguru.org/rtemplate)
PHP SMTP: http://www.phpguru.org/smtp

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




--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

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



Re: [PHP] Web friendly file names

2009-06-03 Thread Eddie Drapkin
Well, erm, no.

I'd store the filename, etc. as-is in the database, and then link it with
urlencode() and you should be able to serve a file called A non friendly
name! site.com/A%20non%20friendly and a modern webserver should be fine
with that, and even most browsers will allow you to type site.com/A non
friendly... without the url escaped characters and it will url escape them
in the request.  The only issue is that the urlencoded special characters
are a lot uglier, which may or may not be a consideration for you.

On Wed, Jun 3, 2009 at 12:39 PM, Skip Evans s...@bigskypenguin.com wrote:

 You mean like this? This would work as a good file name to be on the server
 and link to?

 $filename = urlencode($_FILES['myfile']['name']);
 move_uploaded_file($_FILES['myfile']['tmp_name'], $filename);

 Think that would do the trick?

 Skip

 Eddie Drapkin wrote:

 Why not just urlencode() the filename? (and suggest people use a URL
 shortening service and/or provide one)

 On Wed, Jun 3, 2009 at 12:31 PM, Richard Heyes rich...@php.net mailto:
 rich...@php.net wrote:

Hi,

  I have a file uploader module that allows users to upload
documents and of
  course people are using all kinds of file names that are not web
friendly.
 
  I guess the best solution is to replace any non alphanumeric with
maybe '_'
  the underscore? How does that sound?
 
  Unfortunately, after 20+ years of coding I cannot get my brain
 around
  regular expressions to any decent level of proficiency, I know sad.
 
  I'd like to hear other solutions for this problem, I am thinking
of a regexp
  that replaces special chars with the underscore; sounds pretty
robust and
  globally acceptable?

I replace any non alpha chat with a hyphen, then replace two or more
hyphens with one. Simple, but I would also include the date so that
naming clashes are less likely (if it's applicable). So you might end
up with something similar to this:

/product/2009/06/03/24ct-gold-earrings

Or if using the date is not applicable, you could get something like
this:

/product/24ct-gold-earrings

--
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net http://www.rgraph.net -
updated 23rd May)
PHP mail: RMail (www.phpguru.org/rmail http://www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid
http://www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate
http://www.phpguru.org/rtemplate)
PHP SMTP: http://www.phpguru.org/smtp

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



 --
 
 Skip Evans
 Big Sky Penguin, LLC
 503 S Baldwin St, #1
 Madison WI 53703
 608.250.2720
 http://bigskypenguin.com
 
 Those of you who believe in
 telekinesis, raise my hand.
  -- Kurt Vonnegut

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




Re: [PHP] Web friendly file names

2009-06-03 Thread Skip Evans
Oh, of course that makes sense, and I suppose the PHP 
move_uploaded_file() function has no problem with weird and 
crappy file names?


Skip

Eddie Drapkin wrote:

Well, erm, no.

I'd store the filename, etc. as-is in the database, and then link it 
with urlencode() and you should be able to serve a file called A non 
friendly name! site.com/A%20non%20friendly.. 
http://site.com/A%20non%20friendly and a modern webserver should 
be fine with that, and even most browsers will allow you to type 
site.com/A http://site.com/A non friendly... without the url escaped 
characters and it will url escape them in the request.  The only issue 
is that the urlencoded special characters are a lot uglier, which may or 
may not be a consideration for you.


On Wed, Jun 3, 2009 at 12:39 PM, Skip Evans s...@bigskypenguin.com 
mailto:s...@bigskypenguin.com wrote:




--

Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

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



Re: [PHP] Amazon s3 and PHP

2009-06-03 Thread Bastien Koert
On Wed, Jun 3, 2009 at 12:27 PM, R B rbp...@gmail.com wrote:
 Hi,

 Do you know if amazon s3 hosting support php files?

 Thanks.

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



yep, depending on the AMI you use to set up the server. There are many
supporting php5, but not many supporting mysql5


-- 

Bastien

Cat, the other other white meat

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



[PHP] PHP/Javascript Job in Madrid

2009-06-03 Thread barbara

Hi all,
I am Bárbara Vilela and I work at Tuenti in the Human Resources 
department in Madrid. Tuenti is a social application and our mission is 
to improve the communication and transmission of information between 
people who know each other. Already the #6 most-trafficked website in 
Spain, Tuenti is also one of the fastest-growing Alexa Top 500 sites and 
one of the largest invite-only websites worldwide.
I am writing you because we have job opportunities for PHP/JavaScript 
Engineers that could be interesting for you.

You can find more information about this position here:
http://tbe.taleo.net/NA11/ats/careers/requisition.jsp?org=TUENTITECHNOLOGIEScws=1rid=25 

If you think you fit for this job please send me an e-mail with your CV 
and I´ll get in contact with you soon.

Thank you very much,
Bárbara Vilela Fernandes


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



Re: [PHP] Web friendly file names

2009-06-03 Thread Eddie Drapkin
As far as I know it will only bug out when the host filesystem would bug
out, ie UTF-16 characters tend to explode on my linux setup that I develop
on, and PHP's file handlign doesn't like them, but then again neither does
the filesystem.  Stuff like Some silly name! YAY# work fine, on the
other hand.

On Wed, Jun 3, 2009 at 1:00 PM, Skip Evans s...@bigskypenguin.com wrote:

 Oh, of course that makes sense, and I suppose the PHP move_uploaded_file()
 function has no problem with weird and crappy file names?

 Skip

 Eddie Drapkin wrote:

 Well, erm, no.

 I'd store the filename, etc. as-is in the database, and then link it with
 urlencode() and you should be able to serve a file called A non friendly
 name! site.com/A%20non%20friendly.. http://site.com/A%20non%20friendly
 and a modern webserver should be fine with that, and even most browsers will
 allow you to type site.com/A http://site.com/A non friendly... without
 the url escaped characters and it will url escape them in the request.  The
 only issue is that the urlencoded special characters are a lot uglier, which
 may or may not be a consideration for you.

 On Wed, Jun 3, 2009 at 12:39 PM, Skip Evans s...@bigskypenguin.commailto:
 s...@bigskypenguin.com wrote:


 --
 
 Skip Evans
 Big Sky Penguin, LLC
 503 S Baldwin St, #1
 Madison WI 53703
 608.250.2720
 http://bigskypenguin.com
 
 Those of you who believe in
 telekinesis, raise my hand.
  -- Kurt Vonnegut

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




Re: [PHP] Web friendly file names

2009-06-03 Thread Bastien Koert
On Wed, Jun 3, 2009 at 1:18 PM, Eddie Drapkin oorza...@gmail.com wrote:
 As far as I know it will only bug out when the host filesystem would bug
 out, ie UTF-16 characters tend to explode on my linux setup that I develop
 on, and PHP's file handlign doesn't like them, but then again neither does
 the filesystem.  Stuff like Some silly name! YAY# work fine, on the
 other hand.

 On Wed, Jun 3, 2009 at 1:00 PM, Skip Evans s...@bigskypenguin.com wrote:

 Oh, of course that makes sense, and I suppose the PHP move_uploaded_file()
 function has no problem with weird and crappy file names?

 Skip

 Eddie Drapkin wrote:

 Well, erm, no.

 I'd store the filename, etc. as-is in the database, and then link it with
 urlencode() and you should be able to serve a file called A non friendly
 name! site.com/A%20non%20friendly.. 
 http://site.com/A%20non%20friendly
 and a modern webserver should be fine with that, and even most browsers will
 allow you to type site.com/A http://site.com/A non friendly... without
 the url escaped characters and it will url escape them in the request.  The
 only issue is that the urlencoded special characters are a lot uglier, which
 may or may not be a consideration for you.

 On Wed, Jun 3, 2009 at 12:39 PM, Skip Evans s...@bigskypenguin.commailto:
 s...@bigskypenguin.com wrote:


 --
 
 Skip Evans
 Big Sky Penguin, LLC
 503 S Baldwin St, #1
 Madison WI 53703
 608.250.2720
 http://bigskypenguin.com
 
 Those of you who believe in
 telekinesis, raise my hand.
  -- Kurt Vonnegut

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





how about just hashing the filename? Store them in a week-year folder
and store a record in the db with the real file name and the hash.
-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] Amazon s3 and PHP

2009-06-03 Thread R B
To configure a AMI have some extra fee?

Do you have a link to read how to run php files in amazon s3?

Thanks.


On Wed, Jun 3, 2009 at 11:13 AM, Bastien Koert phps...@gmail.com wrote:

 On Wed, Jun 3, 2009 at 12:27 PM, R B rbp...@gmail.com wrote:
  Hi,
 
  Do you know if amazon s3 hosting support php files?
 
  Thanks.
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 

 yep, depending on the AMI you use to set up the server. There are many
 supporting php5, but not many supporting mysql5


 --

 Bastien

 Cat, the other other white meat



Re: [PHP] Amazon s3 and PHP

2009-06-03 Thread Bastien Koert
On Wed, Jun 3, 2009 at 1:43 PM, R B rbp...@gmail.com wrote:
 To configure a AMI have some extra fee?

 Do you have a link to read how to run php files in amazon s3?

 Thanks.


 On Wed, Jun 3, 2009 at 11:13 AM, Bastien Koert phps...@gmail.com wrote:

 On Wed, Jun 3, 2009 at 12:27 PM, R B rbp...@gmail.com wrote:
  Hi,
 
  Do you know if amazon s3 hosting support php files?
 
  Thanks.
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 

 yep, depending on the AMI you use to set up the server. There are many
 supporting php5, but not many supporting mysql5


 --

 Bastien

 Cat, the other other white meat



s3 is storage...you also need a virtual machine running in the ec2
that can serve the pages...the best place to start is the amazon site

-- 

Bastien

Cat, the other other white meat

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



[PHP] Re: forms problem

2009-06-03 Thread Shawn McKenzie
PJ wrote:
 PROBLEM 1 solved: errant divs 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.

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Zebra Striped Table Example

2009-06-03 Thread Ashley Sheridan
On Mon, 2009-06-01 at 08:10 -0700, Raymond Irving wrote:
 Hello,
 
 There are many different ways and techniques that we can use to add alternate 
 colors to table rows. Here's another solution that's very simple and straight 
 forward. For example:
 
 $page['table tr:even']-css('background:#eee');
 
 Check out the full example code at 
 http://raxanpdi.com/zebra-striped-table.html
 
 
 Best regards,
 __
 Raymond Irving
 Quickly build and maintain PHP Ajax applications
 Raxan PDI - http://raxanpdi.com
 
 
Doesn't work in the majority of browsers out there at the moment. Always
remember, just because you have the latest release of a browser, a lot
of people who just surf the web don't even know the difference and how
to upgrade. 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


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Web friendly file names

2009-06-03 Thread Paul M Foster
(Sorry, I hit the wrong button and sent the reply only to Skip.)

On Wed, Jun 03, 2009 at 11:18:57AM -0500, Skip Evans wrote:

 Hey all,

 I have a file uploader module that allows users to upload
 documents and of course people are using all kinds of file
 names that are not web friendly.

 I guess the best solution is to replace any non alphanumeric
 with maybe '_' the underscore? How does that sound?

 Unfortunately, after 20+ years of coding I cannot get my brain
 around regular expressions to any decent level of proficiency,
 I know sad.

 I'd like to hear other solutions for this problem, I am
 thinking of a regexp that replaces special chars with the
 underscore; sounds pretty robust and globally acceptable?

 Opinions, witticisms, flames, quotations by famous débutantes?

Here's what I do on some of my webpages:

$fname = preg_replace(%[^A-Za-z0-9_\.]%, _, $_POST['fname']);

This says to replace any character which isn't alphanumeric or
underscore or period, with an underscore. You can add characters to the
first expression in preg_replace to allow more characters, or change the
underscore expression with nothing () or whatever. I typically simply
eliminate bad stuff by using  as the second parameter for
preg_replace.

To expand further on one thing: inside the first parameter, you'll see
the open square bracket ([) which indicates the beginning of a character
grouping or class. The next character, the caret (^) indicates negation.
So that expression means that anything which doesn't match these
characters gets whatever the next parameter is.

Paul

-- 
Paul M. Foster

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



[PHP] Using File_exists?

2009-06-03 Thread Miller, Terion
I wrote this little script (part of a much much larger one I am working at)
anyways, I am trying to get it to compare a file name from a db to an actual
file in a folder and then tell me if it does or doesn't exist, the problem I
have is that the files do exist, I echo them out, but it says file does not
exist right after that it echos the file for me What do I have wrong?

 $FileName = $row['Image'];   


  $ImageName = $row['Image'];
 

  $ImageName = str_replace(/, , $ImageName);

 
$FilePath = 
http://localhost:/HarrisAutomate/output/WebImagesHiRes/$ImageName;;

//$BackupPath = 
http://localhost:/HarrisAutomate/WebImagesHiRes/output/backup/;;




if (file_exists($FilePath))  {

echo The file $ImageName exists;
}
else {
echo The file $ImageName does not exist  . 'br /';
}


   


 $FileName = str_replace(/, , $FileName);

  $FileName = str_replace(.jpg, , $FileName);


  



echo ($FileName) . 'br /';

echo 'img src=' . $FilePath .'' . 'br /';


Thanks guys! 
Terion 


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



Re: [PHP] Redirect not working on server

2009-06-03 Thread Ashley Sheridan
On Tue, 2009-06-02 at 20:43 -0700, revDAVE wrote:
 Thank you Jay - Shawn  Paul for helping this newbie!
 
 
 --
 Thanks - RevDave
 Cool @ hosting4days . com
 [db-lists 09]
 
 
 
 
Also, according to the spec, the URL should be in absolute form, not
relative like you have there.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Web friendly file names

2009-06-03 Thread Eric Butera
On Wed, Jun 3, 2009 at 2:29 PM, Paul M Foster pa...@quillandmouse.com wrote:
 (Sorry, I hit the wrong button and sent the reply only to Skip.)

 On Wed, Jun 03, 2009 at 11:18:57AM -0500, Skip Evans wrote:

 Hey all,

 I have a file uploader module that allows users to upload
 documents and of course people are using all kinds of file
 names that are not web friendly.

 I guess the best solution is to replace any non alphanumeric
 with maybe '_' the underscore? How does that sound?

 Unfortunately, after 20+ years of coding I cannot get my brain
 around regular expressions to any decent level of proficiency,
 I know sad.

 I'd like to hear other solutions for this problem, I am
 thinking of a regexp that replaces special chars with the
 underscore; sounds pretty robust and globally acceptable?

 Opinions, witticisms, flames, quotations by famous débutantes?

 Here's what I do on some of my webpages:

 $fname = preg_replace(%[^A-Za-z0-9_\.]%, _, $_POST['fname']);

 This says to replace any character which isn't alphanumeric or
 underscore or period, with an underscore. You can add characters to the
 first expression in preg_replace to allow more characters, or change the
 underscore expression with nothing () or whatever. I typically simply
 eliminate bad stuff by using  as the second parameter for
 preg_replace.

 To expand further on one thing: inside the first parameter, you'll see
 the open square bracket ([) which indicates the beginning of a character
 grouping or class. The next character, the caret (^) indicates negation.
 So that expression means that anything which doesn't match these
 characters gets whatever the next parameter is.

 Paul

 --
 Paul M. Foster

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



Also don't forget to check for uniqueness after doing all of these
transformations fellas.  In my experience users love uploading the
same names over and over. :)

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



RE: [PHP] Best Encryption Algorithm

2009-06-03 Thread Daevid Vincent
http://www.schneier.com/blog/archives/2007/01/sha1_cracked.html 

 -Original Message-
 From: Matty Sarro [mailto:msa...@gmail.com] 
 Sent: Wednesday, June 03, 2009 6:27 AM
 To: Hemant Patel
 Cc: PHP General
 Subject: Re: [PHP] Best Encryption Algorithm
 
 I believe none of the AES algorithms have been compromised so 
 far. DES is
 known to be broken, 3DES was just severely compromised. I 
 don't know where
 blowfish stands at the moment.
 
 On Wed, Jun 3, 2009 at 9:20 AM, Hemant Patel 
 hemant.develo...@gmail.comwrote:
 
  Hello Everyone,
   Hope you all are doing great.
   Now we are creating a application 
 which has high level
  of security so its obvious that we will require a algorithm for
  encryption/decrytpion.So Can anybody suggest me the best 
 algorithm for
  encryption(irrespective of any languageJust a Algorithm).
 
 
  With Regards,
  Hemant Patel
 
 


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



Re: [PHP] Using File_exists?

2009-06-03 Thread Eddie Drapkin
just initially, and this might be a typo but

$FilePath =
http://localhost:/HarrisAutomate/output/WebImagesHiRes/$ImageName;;

//$BackupPath =
http://localhost:/HarrisAutomate/WebImagesHiRes/output/backup/;;

$FilePath has an /output/ that $BackupPath doesn't.

Also, make sure you don't have safe_mode or open_basedir restricting the
files php can see, although I'm reasonably sure the fact that it's an URL
should nullify that.  Also, make sure you have allow_url_fopen turned on.

On Wed, Jun 3, 2009 at 2:31 PM, Miller, Terion tmil...@springfi.gannett.com
 wrote:

 I wrote this little script (part of a much much larger one I am working at)
 anyways, I am trying to get it to compare a file name from a db to an
 actual
 file in a folder and then tell me if it does or doesn't exist, the problem
 I
 have is that the files do exist, I echo them out, but it says file does not
 exist right after that it echos the file for me What do I have wrong?

 $FileName = $row['Image'];


  $ImageName = $row['Image'];


  $ImageName = str_replace(/, , $ImageName);


 $FilePath =
 http://localhost:/HarrisAutomate/output/WebImagesHiRes/$ImageName;;

 //$BackupPath =
 http://localhost:/HarrisAutomate/WebImagesHiRes/output/backup/;;




 if (file_exists($FilePath))  {

 echo The file $ImageName exists;
 }
 else {
echo The file $ImageName does not exist  . 'br /';
 }





 $FileName = str_replace(/, , $FileName);

  $FileName = str_replace(.jpg, , $FileName);






 echo ($FileName) . 'br /';

 echo 'img src=' . $FilePath .'' . 'br /';


 Thanks guys!
 Terion


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




Re: [PHP] Query Regarding a Player

2009-06-03 Thread Ashley Sheridan
On Wed, 2009-06-03 at 09:18 -0500, haliphax wrote:
 On Wed, Jun 3, 2009 at 8:14 AM, Hemant Patel hemant.develo...@gmail.com 
 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



Re: [PHP] Best Encryption Algorithm

2009-06-03 Thread Eddie Drapkin
Another camper on the AES / Rijndael bandwagon.  I don't think there's even
been a theoretical attack point for anything 128 bit, but I could be wrong.

And re: sha1, sha1 isn't an encryption algorithm...

On Wed, Jun 3, 2009 at 9:28 AM, Bruno Fajardo bsfaja...@gmail.com wrote:

 Hi there!

 Try out AES.
 http://en.wikipedia.org/wiki/Advanced_Encryption_Standard

 Bruno.

 2009/6/3 Hemant Patel hemant.develo...@gmail.com
 
  Hello Everyone,
   Hope you all are doing great.
   Now we are creating a application which has high
 level
  of security so its obvious that we will require a algorithm for
  encryption/decrytpion.So Can anybody suggest me the best algorithm for
  encryption(irrespective of any languageJust a Algorithm).
 
 
  With Regards,
  Hemant Patel

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




Re: [PHP] Best Encryption Algorithm

2009-06-03 Thread Ashley Sheridan
On Wed, 2009-06-03 at 14:43 -0400, Eddie Drapkin wrote:
 Another camper on the AES / Rijndael bandwagon.  I don't think there's even
 been a theoretical attack point for anything 128 bit, but I could be wrong.
 
 And re: sha1, sha1 isn't an encryption algorithm...
 
 On Wed, Jun 3, 2009 at 9:28 AM, Bruno Fajardo bsfaja...@gmail.com wrote:
 
  Hi there!
 
  Try out AES.
  http://en.wikipedia.org/wiki/Advanced_Encryption_Standard
 
  Bruno.
 
  2009/6/3 Hemant Patel hemant.develo...@gmail.com
  
   Hello Everyone,
Hope you all are doing great.
Now we are creating a application which has high
  level
   of security so its obvious that we will require a algorithm for
   encryption/decrytpion.So Can anybody suggest me the best algorithm for
   encryption(irrespective of any languageJust a Algorithm).
  
  
   With Regards,
   Hemant Patel
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
A single-phase Caesar cypher is by far the best. It worked for Julias
Caesar, and damn it, it will work for us!


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Using File_exists?

2009-06-03 Thread Miller, Terion



On 6/3/09 1:41 PM, Eddie Drapkin oorza...@gmail.com wrote:

just initially, and this might be a typo but

$FilePath =
http://localhost:/HarrisAutomate/output/WebImagesHiRes/$ImageName;;

//$BackupPath =
http://localhost:/HarrisAutomate/WebImagesHiRes/output/backup/;;

$FilePath has an /output/ that $BackupPath doesn't.

Also, make sure you don't have safe_mode or open_basedir restricting the files 
php can see, although I'm reasonably sure the fact that it's an URL should 
nullify that.  Also, make sure you have allow_url_fopen turned on.

On Wed, Jun 3, 2009 at 2:31 PM, Miller, Terion tmil...@springfi.gannett.com 
wrote:
I wrote this little script (part of a much much larger one I am working at)
anyways, I am trying to get it to compare a file name from a db to an actual
file in a folder and then tell me if it does or doesn't exist, the problem I
have is that the files do exist, I echo them out, but it says file does not
exist right after that it echos the file for me What do I have wrong?

 $FileName = $row['Image'];


  $ImageName = $row['Image'];


  $ImageName = str_replace(/, , $ImageName);


$FilePath =
http://localhost:/HarrisAutomate/output/WebImagesHiRes/$ImageName;;

//$BackupPath =
http://localhost:/HarrisAutomate/WebImagesHiRes/output/backup/;;




if (file_exists($FilePath))  {

echo The file $ImageName exists;
}
else {
echo The file $ImageName does not exist  . 'br /';
}





 $FileName = str_replace(/, , $FileName);

  $FileName = str_replace(.jpg, , $FileName);






echo ($FileName) . 'br /';

echo 'img src=' . $FilePath .'' . 'br /';


==

Thanks I went through and checked those suggestions and it wasn't any of them...

What I am trying to do is to match a file name from a db to the file in the 
folder of images
Which that part is working I can match them and display them, but it keeps 
telling me they aren't there ...right before it displays...



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



Re: [PHP] Best Encryption Algorithm

2009-06-03 Thread Michael Shadle
+1 for AES 256-bit

On Wed, Jun 3, 2009 at 11:43 AM, Eddie Drapkin oorza...@gmail.com wrote:
 Another camper on the AES / Rijndael bandwagon.  I don't think there's even
 been a theoretical attack point for anything 128 bit, but I could be wrong.

 And re: sha1, sha1 isn't an encryption algorithm...

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



Re: [PHP] Using File_exists?

2009-06-03 Thread Jo�o C�ndido de Souza Neto
Try to define $FilePath as follows:

$FilePath = 
$_SERVER[document_root]./HarrisAutomate/output/WebImagesHiRes/$ImageName;

In this way it should work.

-- 
João Cândido de Souza Neto
SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS
Fone: (0XX41) 3033-3636 - JS
www.siens.com.br

Miller, Terion tmil...@springfi.gannett.com escreveu na mensagem 
news:c64c2fbf.2b80%kmille...@springfi.gannett.com...



On 6/3/09 1:41 PM, Eddie Drapkin oorza...@gmail.com wrote:

just initially, and this might be a typo but

$FilePath =
http://localhost:/HarrisAutomate/output/WebImagesHiRes/$ImageName;;

//$BackupPath =
http://localhost:/HarrisAutomate/WebImagesHiRes/output/backup/;;

$FilePath has an /output/ that $BackupPath doesn't.

Also, make sure you don't have safe_mode or open_basedir restricting the 
files php can see, although I'm reasonably sure the fact that it's an URL 
should nullify that.  Also, make sure you have allow_url_fopen turned on.

On Wed, Jun 3, 2009 at 2:31 PM, Miller, Terion 
tmil...@springfi.gannett.com wrote:
I wrote this little script (part of a much much larger one I am working at)
anyways, I am trying to get it to compare a file name from a db to an actual
file in a folder and then tell me if it does or doesn't exist, the problem I
have is that the files do exist, I echo them out, but it says file does not
exist right after that it echos the file for me What do I have wrong?

 $FileName = $row['Image'];


  $ImageName = $row['Image'];


  $ImageName = str_replace(/, , $ImageName);


$FilePath =
http://localhost:/HarrisAutomate/output/WebImagesHiRes/$ImageName;;

//$BackupPath =
http://localhost:/HarrisAutomate/WebImagesHiRes/output/backup/;;




if (file_exists($FilePath))  {

echo The file $ImageName exists;
}
else {
echo The file $ImageName does not exist  . 'br /';
}





 $FileName = str_replace(/, , $FileName);

  $FileName = str_replace(.jpg, , $FileName);






echo ($FileName) . 'br /';

echo 'img src=' . $FilePath .'' . 'br /';


==

Thanks I went through and checked those suggestions and it wasn't any of 
them...

What I am trying to do is to match a file name from a db to the file in the 
folder of images
Which that part is working I can match them and display them, but it keeps 
telling me they aren't there ...right before it displays...




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



Re: [PHP] Book site question

2009-06-03 Thread AngeloZanetti



bruce-60 wrote:
 
 Hi List...
 
 A little while ago... (in a land far away!!).. Someone posted some
 questions
 about a site he/she was creating having to do with textbooks... I'm trying
 to find that person to talk to them about what they were doing... I've
 searched my past emails but can't find it.. So, maybe I imagined it!!
 
 I've got a situation where I'm going to be dealing with books, and it
 might
 be useful to talk with whoever was working on the app..
 
 If this email finds you, and you were the person working on the app...
 Please get back to me!!
 
 Thanks
 
 -bruce
 
 
 

Hi Bruce 

Did you try searching the archives?

http://www.Elemental.co.za http://www.Elemental.co.za 
http://www.wapit.co.za http://www.wapit.co.za 

-- 
View this message in context: 
http://www.nabble.com/Book-site-question-tp23844151p23857413.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] Using File_exists?

2009-06-03 Thread Miller, Terion
Tried that too with no luck...



On 6/3/09 2:01 PM, João Cândido de Souza Neto j...@consultorweb.cnt.br 
wrote:

$_SERVER[document_root]./HarrisAutomate/output/WebImagesHiRes/$ImageName;


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



Re: [PHP] Why doesn't mySQL stop a query when the browser tab is closedL

2009-06-03 Thread AngeloZanetti



Bastien Koert-3 wrote:
 
 
 
 On Jun 2, 2009, at 21:13, Daevid Vincent dae...@daevid.com wrote:
 
 I just noticed a horrible thing.

 I have a query (report) that can take 15 minutes or more to generate  
 with
 mySQL. We have  500 Million rows. This used to be done in real time  
 when we
 had less rows, but recently we got a big dump of data that shot it up.

 So, noticing via myTop the query taking so long, I closed my web  
 page tab.
 The query did NOT go away! WTF? So mysqld continued to peg the CPU  
 at 75% to
 135% (yes, top shows that if you have quad cpus. *sigh*)

 Is there some way to force this to work sanely? Some php.ini or  
 my.cnf file
 that has a setting to abort queries when the web page has gone away?

 Not sure which mailing list this belongs on so I'll post to both PHP  
 and
 mySQL. Although it feels this is a PHP problem as it should know  
 that the
 Apache thread went away and therefore close the mySQL connection and  
 kill
 the query. Conversely, mysql should know that it's connection (via  
 PHP) went
 away and should equally abort. So you're both wrong! :)
 
 Once the query is started, the only way to kill it is to kill the  
 process id in the mysql server.
 
 But I have a question about the db and current size:
 1. Do you need all that data currently? If you could archive a portion  
 away, there may be performance gains
 2. Can you partition the tables to work with smaller datasets ( could  
 be a performance gain here) ?
 
 Bastien 

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

Hi, 

have you tried to optimize the database to ensure that it runs faster? 

Also make sure you use best practices when quering the database, only search
for relevant columns and not select * from 

Hope this helps probably best to search on the mysql website for help /
research material

Let us know what your outcome is if you managed to fix it

http://www.Elemental.co.za http://www.Elemental.co.za 
http://www.wapit.co.za http://www.wapit.co.za 

-- 
View this message in context: 
http://www.nabble.com/Why-doesn%27t-mySQL-stop-a-query-when-the-browser-tab-is-closedL-tp23843810p23857439.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] Web application design considerations - a good reference ?

2009-06-03 Thread AngeloZanetti



Tony Marston wrote:
 
 If you are building a business application with PHP rather than an
 ordinary 
 website then I suggest that you use a framework instead of trying to 
 reinvent the wheel (and making a hash of it). The Radicore framework was 
 specifically designed for CRUD applications - it uses forms to perform 
 Create/Read/Update/Delete operations on the database - so it would be a 
 better fit than one which was designed for common-or-garden websites.
 
 The heart of any database application is the database design. Get this
 wrong 
 and you are stuffed from the very start. Once you have used the rules of 
 data normalisation to design your database you simply build it, then
 import 
 the database into the Radicore data dictionary. Then you export each table 
 to produce a class file for that table. Still in the data dictionary you
 can 
 build end-user transactions by selecting a database table, a transaction 
 pattern, then pressing the 'generate' button. This will generate the
 scripts 
 and the screen layouts to access the table,  and you can run these scripts 
 through the Radicore menu system. All this without having to write a
 single 
 line of SQL, HTML or even PHP. The only PHP code you need to write is when 
 you want to alter the default behaviour or implement custom business
 rules.
 
 The Radicore framework comes with a built-in Role Based Access Control 
 (RBAC) system, and Audit Logging system and a Workflow system. It was 
 designed using the Three Tier Architecture and MVC design patterns, so
 makes 
 maximum use of reusable modules.
 
 There is an enormous amount of documentation to be found at 
 http://www.radicore.org as well as a tutorial and some sample
 applications. 
 Try it and see.
 
 -- 
 Tony Marston
 http://www.tonymarston.net
 http://www.radicore.org
 
 Angus Mann angusm...@pobox.com wrote in message 
 news:e23929c24916447cbef5c45eac9af...@guspc...
 Hi all.

 I'm working on a PHP project for my own personal business use. It will 
 handle billing and invoices as well as payments and time management, 
 bookings, appointments and a few more. I may add things like personal 
 messaging between the various users and a customer login to check on the 
 progress of their accounts.

 It is a big project and will probably take a year or so to complete in my 
 spare time.

 I have made a couple of starts but I have no experience in creating such 
 large applications and I find I often end up with spaghetti code. I've 
 tried using session variables to keep track of where and what the program 
 is doing but there are so many permuations and combinations I found
 myself 
 writing endless streams of if's, and's and or's just to figure out what 
 page to display.

 The code is not the probblem for me...it's the flow and organization of 
 the code.

 Can anybody point me to a good book or tutorial that lays down the 
 principles and gives some suggestions for integrating the many
 subroutines 
 of a large application? I want to make the code readable and logical in 
 its flow, and avoid repetition of code segments.

 Much appreciated.
 Angus




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


How easy is it to write custom modules that plugin to the Radicore
framework?

I am always interested in those kinds of aspects of frameworks.

I see that you are one of the team members, with a Framework like Radicore I
wonder how much support and help from others you will receive especially the
community.

Anyway worth having a look at.

http://www.Elemental.co.za http://www.Elemental.co.za 
http://www.wapit.co.za http://www.wapit.co.za 
-- 
View this message in context: 
http://www.nabble.com/PHP-problem-tp23825924p23857549.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] Using File_exists?

2009-06-03 Thread Jo�o C�ndido de Souza Neto
Sorry,

I forgot only a single detail.

It´s DOCUMENT_ROOT instead of document_root.

Have you tried it?

-- 
João Cândido de Souza Neto
SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS
Fone: (0XX41) 3033-3636 - JS
www.siens.com.br

Miller, Terion tmil...@springfi.gannett.com escreveu na mensagem 
news:c64c3427.2b88%kmille...@springfi.gannett.com...
Tried that too with no luck...



On 6/3/09 2:01 PM, João Cândido de Souza Neto j...@consultorweb.cnt.br 
wrote:

$_SERVER[document_root]./HarrisAutomate/output/WebImagesHiRes/$ImageName;



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



Re: [PHP] Using File_exists? (RESOLVED)

2009-06-03 Thread Shawn McKenzie
João Cândido de Souza Neto wrote:
 The var $_SERVER[DOCUMENT_ROOT] in your case contais 
 /Applications/MAMP/htdocs/ so using it whenever you change your server, 
 it´ll work without any change.
 

Yes, moral of the story is: file_exists() is for use on a file system or
using a wrapper that supports stat(), which HTTP does not.


-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Using File_exists? (RESOLVED)

2009-06-03 Thread Jo�o C�ndido de Souza Neto
Exactly.

-- 
João Cândido de Souza Neto
SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS
Fone: (0XX41) 3033-3636 - JS
www.siens.com.br

Shawn McKenzie nos...@mckenzies.net escreveu na mensagem 
news:95.f5.19828.e94d6...@pb1.pair.com...
 João Cândido de Souza Neto wrote:
 The var $_SERVER[DOCUMENT_ROOT] in your case contais
 /Applications/MAMP/htdocs/ so using it whenever you change your server,
 it´ll work without any change.


 Yes, moral of the story is: file_exists() is for use on a file system or
 using a wrapper that supports stat(), which HTTP does not.


 -- 
 Thanks!
 -Shawn
 http://www.spidean.com 



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



Re: [PHP] Best Encryption Algorithm

2009-06-03 Thread Paul M Foster
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

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



Re: [PHP] Best Encryption Algorithm

2009-06-03 Thread Andrew Ballard
On Wed, Jun 3, 2009 at 4:17 PM, Paul M Foster pa...@quillandmouse.com 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



Re: [PHP] Best Encryption Algorithm

2009-06-03 Thread Luke
2009/6/3 Andrew Ballard aball...@gmail.com

 On Wed, Jun 3, 2009 at 4:17 PM, Paul M Foster pa...@quillandmouse.com
 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)


[PHP] how to manage permissions for file uploader

2009-06-03 Thread Lamp Lists
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



  

Re: [PHP] Query Regarding a Player

2009-06-03 Thread Eddie Drapkin
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 
a...@ashleysheridan.co.ukwrote:

 On Wed, 2009-06-03 at 09:18 -0500, haliphax wrote:
  On Wed, Jun 3, 2009 at 8:14 AM, Hemant Patel hemant.develo...@gmail.com
 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




Re: [PHP] Query Regarding a Player

2009-06-03 Thread Ashley Sheridan
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 
 a...@ashleysheridan.co.ukwrote:
 
  On Wed, 2009-06-03 at 09:18 -0500, haliphax wrote:
   On Wed, Jun 3, 2009 at 8:14 AM, Hemant Patel hemant.develo...@gmail.com
  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


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



Re: [PHP] forms problem

2009-06-03 Thread PJ
Tom Chubb wrote:
 2009/6/3 PJ af.gour...@videotron.ca:
   
 The code:
 ...snip
 div id=loginbox
form name=login method=post action=? echo
 $_SERVER['PHP_SELF'] ?
h2accegrave;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
h2a 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 --- p...@ptahhotep.com
   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 --- p...@ptahhotep.com
   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



Re: [PHP] forms problem

2009-06-03 Thread PJ
AngeloZanetti wrote:

 Shawn McKenzie wrote:
   
 PJ wrote:
 
 PROBLEM 1 solved: errant divs 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'] ?
   h2accegrave;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
   h2a 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 divs would cause that.


-- 
Hervé Kempf: Pour sauver la planète, sortez du capitalisme.
-
Phil Jourdan --- p...@ptahhotep.com
   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



[PHP] Re: how to manage permissions for file uploader

2009-06-03 Thread Al



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.


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



Re: [PHP] how to manage permissions for file uploader

2009-06-03 Thread Phpster
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 lamp.li...@yahoo.com 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





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



Re: [PHP] forms problem

2009-06-03 Thread Shawn McKenzie
PJ wrote:
 AngeloZanetti wrote:
 Shawn McKenzie wrote:
 
 PJ wrote:
 
 PROBLEM 1 solved: errant divs 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'] ? 
 h2accegrave;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 h2a
 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 divs 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

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



Re: [PHP] forms problem

2009-06-03 Thread Andrew Ballard
On Wed, Jun 3, 2009 at 7:13 PM, PJ af.gour...@videotron.ca wrote:
 Tom Chubb wrote:
 2009/6/3 PJ af.gour...@videotron.ca:

 The code:
 ...snip
 div id=loginbox
        form name=login method=post action=? echo
 $_SERVER['PHP_SELF'] ?
            h2accegrave;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
            h2a 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 --- p...@ptahhotep.com
   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

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



Re: [PHP] Zebra Striped Table Example

2009-06-03 Thread Raymond Irving

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


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



[PHP] PHP HELP

2009-06-03 Thread tRace DOliveira
Can anyone help me to install APC in Xampp on windows ?