php-general Digest 11 Dec 2009 18:10:06 -0000 Issue 6482

2009-12-11 Thread php-general-digest-help
php-general Digest 11 Dec 2009 18:10:06 - Issue 6482 Topics (messages 300381 through 300388): Re: file_get_contents ($file) works -- file_get_contents ($url) returns false 300381 by: Gaurav Kumar Re: Upload dir 300382 by: Gaurav Kumar 300383 by: kranthi

Re: [PHP] Upload dir

2009-12-11 Thread kranthi
my mistake didn't use move_uploaded_file to see if the uploading is working or not in the first case but i could not understand why 1. ini_get() is giving correct value while $_FILES['file']['tmp_name'] is ignoring that. 2. move_uploaded_file($_FILES['file']['tmp_name'],

Re: [PHP] Upload dir

2009-12-11 Thread Richard Quadling
2009/12/11 kranthi kranthi...@gmail.com: How can i change the temporary upload directory? var_dump(ini_get('upload_tmp_dir'));      gives me (and that is set in php.ini) string '/var/www/cgi-bin' (length=16) but var_dump($_FILES)                                                     gives me

Re: [PHP] Upload dir

2009-12-11 Thread Ashley Sheridan
On Fri, 2009-12-11 at 15:44 +, Richard Quadling wrote: 2009/12/11 kranthi kranthi...@gmail.com: How can i change the temporary upload directory? var_dump(ini_get('upload_tmp_dir')); gives me (and that is set in php.ini) string '/var/www/cgi-bin' (length=16) but

Re: [PHP] Using Curl to replicate a site

2009-12-11 Thread Ashley Sheridan
On Thu, 2009-12-10 at 16:25 +, Ashley Sheridan wrote: On Thu, 2009-12-10 at 11:25 -0500, Robert Cummings wrote: Joseph Thayne wrote: If the site can be a few minutes behind, (say 15-30 minutes), then what I recommend is to create a caching script that will update the necessary

[PHP] move_uploaded_file

2009-12-11 Thread Roberto
Am I just drunk or blind or the documentation is simply wrong? From the official doc (http://uk2.php.net/manual/en/function.move-uploaded-file.php): ?php $uploads_dir = '/uploads'; foreach ($_FILES[pictures][error] as $key = $error) { if ($error == UPLOAD_ERR_OK) { $tmp_name =

Re: [PHP] move_uploaded_file

2009-12-11 Thread Joseph Thayne
You should be able to use either an absolute or relative path. In the code below, the path specified is absolute (it starts with /). If you want it to be relative to your current directory, change the line to: $uploads_dir = 'uploads'; or $uploads_dir = '../uploads'; So basically, it all

[PHP] Backup to local drive

2009-12-11 Thread Ben Miller
Hello - I have an application I'm building that allows users to store personal information and files (images, PDFs, etc.) in our database, but I need a way for them to be able to save the HTML output of that personal data to a local (for the user) flash drive. I'm guessing I'm going to need a

Re: [PHP] Backup to local drive

2009-12-11 Thread Joseph Thayne
If you are wanting to save the information as a PDF (formatted the same as the HTML page), check out tcpdf at www.tcpdf.org. It is fairly simple to implement and can interpret an HTML page causing it to be saved as PDF. Joseph Ben Miller wrote: Hello - I have an application I'm building

Re: [PHP] move_uploaded_file

2009-12-11 Thread Roberto
HI, Premise 1: echo exec(pwd); - /home/prof3ta/projects/moodle/htdocs/feedback_tool Premise 2: I have an upload folder with 777 permissions under: /home/prof3ta/projects/moodle/htdocs/upload Premise 3: The server root is obviously htdocs: /home/prof3ta/projects/moodle/htdocs This said, the

Re: [PHP] Backup to local drive

2009-12-11 Thread Roberto
Hi, you lost me a bit. Let say a user uploads a PDF file to one of your servers. What do you mean when you say I want the users to be able to save the HTML output of their data?!? Roberto Aloi http://aloiroberto.wordpress.com Twitter: @prof3ta On Fri, Dec 11, 2009 at 6:44 PM, Ben Miller

Re: [PHP] move_uploaded_file

2009-12-11 Thread Joseph Thayne
When used in PHP, an absolute path does not go off the web root. In Premise 3 below, an absolute path of /upload will NOT bring up the directory /home/prof3ta/projects/moodle/htdocs/upload but rather simply /upload In Windows terms, an absolute path would be C:\upload versus

[PHP] Server-side encryption to prevent form hacking: new idea?

2009-12-11 Thread Kelly Jones
If you have an HTML form select field xyz with possible values apple, banana, and cucumber, anyone can easily set xyz to an arbitrary value. To prevent this, I create a hidden field code[xyz] with value: base64_encode(mcrypt_ecb( MCRYPT_RIJNDAEL_256,$salt,apple,banana,cucumber,MCRYPT_ENCRYPT));

Re: [PHP] Server-side encryption to prevent form hacking: new idea?

2009-12-11 Thread Mattias Thorslund
Kelly Jones wrote: If you have an HTML form select field xyz with possible values apple, banana, and cucumber, anyone can easily set xyz to an arbitrary value. To prevent this, I create a hidden field code[xyz] with value: base64_encode(mcrypt_ecb(

Re: [PHP] Server-side encryption to prevent form hacking: new idea?

2009-12-11 Thread Michael Shadle
you don't necessarily need encryption, you could use digests instead and issue a use-once ticket as well. On Fri, Dec 11, 2009 at 12:29 PM, Mattias Thorslund matt...@thorslund.us wrote: Kelly Jones wrote: If you have an HTML form select field xyz with possible values apple, banana, and

[PHP] Issue with $HTTP_POST_VARS Not getting Variables

2009-12-11 Thread Eric Lommatsch
Hello, I am working with a login page to use with an application that we are planning to make available as a web service. The login.php page itself works correctly, however when I try and pass parameters to the login page the are not being recognized by the login.php page. Here is the basic

Re: [PHP] Issue with $HTTP_POST_VARS Not getting Variables

2009-12-11 Thread Ashley Sheridan
On Fri, 2009-12-11 at 13:37 -0700, Eric Lommatsch wrote: Hello, I am working with a login page to use with an application that we are planning to make available as a web service. The login.php page itself works correctly, however when I try and pass parameters to the login page the are

Re: [PHP] Server-side encryption to prevent form hacking: new idea?

2009-12-11 Thread Andrew Ballard
On Fri, Dec 11, 2009 at 3:34 PM, Michael Shadle mike...@gmail.com wrote: On Fri, Dec 11, 2009 at 12:29 PM, Mattias Thorslund matt...@thorslund.us wrote: Kelly Jones wrote: If you have an HTML form select field xyz with possible values apple, banana, and cucumber, anyone can easily set xyz to

RE: [PHP] Issue with $HTTP_POST_VARS Not getting Variables

2009-12-11 Thread Eric Lommatsch
Doh, I should have thought of that! Thanks, that is what happens when you use code that someone else has writen and included with a software package. At least I assumed that the code was already written correctly to accept parameters. I guess it wasn't. Thank you Eric H. Lommatsch Programmer

Re: [PHP] Issue with $HTTP_POST_VARS Not getting Variables

2009-12-11 Thread Roberto Aloi
Because you're passing the args through the Url (GET), not through a POST request. Roberto Aloi On 11 Dec 2009, at 20:37, Eric Lommatsch er...@micronix.com wrote: Hello, I am working with a login page to use with an application that we are planning to make available as a web service. The

RE: [PHP] Backup to local drive

2009-12-11 Thread Ben Miller
Users would be updating data via form input (address, tel, product catalogues, etc.) as well as uploading files (images, PDFs, etc.), creating their own presentations and saving those presentations to a flash drive as HTML files with calls to the images/PDFs so that they can simply plug their

RE: [PHP] Backup to local drive

2009-12-11 Thread Ashley Sheridan
On Fri, 2009-12-11 at 14:25 -0700, Ben Miller wrote: Users would be updating data via form input (address, tel, product catalogues, etc.) as well as uploading files (images, PDFs, etc.), creating their own presentations and saving those presentations to a flash drive as HTML files with calls

RE: [PHP] Backup to local drive

2009-12-11 Thread Ben Miller
Too much reliance on the user knowing how to extract the files to the flash drive – need something that does it all for them so all they have to do is insert the flash drive on their own computer to store the preformatted presentation and then insert into a prospect’s computer and either a)

RE: [PHP] Backup to local drive

2009-12-11 Thread Ashley Sheridan
On Fri, 2009-12-11 at 14:36 -0700, Ben Miller wrote: Too much reliance on the user knowing how to extract the files to the flash drive – need something that does it all for them so all they have to do is insert the flash drive on their own computer to store the preformatted presentation

RE: [PHP] Backup to local drive

2009-12-11 Thread Ben Miller
That’s exactly why I need something that will put all the needed files directly onto the flash drive – to take that responsibility away from the user. Pulling the data from the DB and creating the folder structure is easy with PHP – just not sure how to copy that folder structure and related

RE: [PHP] Backup to local drive

2009-12-11 Thread Ashley Sheridan
On Fri, 2009-12-11 at 15:04 -0700, Ben Miller wrote: That’s exactly why I need something that will put all the needed files directly onto the flash drive – to take that responsibility away from the user. Pulling the data from the DB and creating the folder structure is easy with PHP – just

Re: [PHP] move_uploaded_file

2009-12-11 Thread Roberto
Hi Joseph, I'm perfectly fine with the concepts of absolute/relative path and webroot, trust me. For me it was just unclear from the documentation the fact that the target path in the move_uploaded_file function was absolute with respect to the file system and not to the webroot. At the beginning

[PHP] ErrorException and set_exception_handler()

2009-12-11 Thread Hannes Magnusson
Hello randallgirard Since the bug tracker isn't really a discussion forum, lets move it to the General PHP User List (which is a discussion forum). Regarding bug#50446[1] you filed, either I am misunderstanding what you are hoping to achieve or you are misunderstanding the expected

Re: [PHP] move_uploaded_file

2009-12-11 Thread Ashley Sheridan
On Fri, 2009-12-11 at 22:14 +, Roberto wrote: Hi Joseph, I'm perfectly fine with the concepts of absolute/relative path and webroot, trust me. For me it was just unclear from the documentation the fact that the target path in the move_uploaded_file function was absolute with respect

Re: [PHP] Backup to local drive

2009-12-11 Thread Joseph Thayne
PHP cannot create a folder structure on your local machine. I don't think Javascript or VBScript can either. Your best bet is with the zip files. Windows users have it fairly simple actually (as much as I hate to admit it) as all they would have to do is right-click and Extract. You can

Re: [PHP] Backup to local drive

2009-12-11 Thread Ashley Sheridan
On Fri, 2009-12-11 at 16:52 -0600, Joseph Thayne wrote: PHP cannot create a folder structure on your local machine. I don't think Javascript or VBScript can either. Your best bet is with the zip files. Windows users have it fairly simple actually (as much as I hate to admit it) as all

[PHP] Re: ErrorException and set_exception_handler()

2009-12-11 Thread Hannes Magnusson
On Fri, Dec 11, 2009 at 23:39, Randall Girard randallgir...@hotmail.com wrote: Okay, my mistake. E_USER_WARNING and E_USER_NOTICE are supposed to continue execution, correct? Correct. Then  I will restate what I previously said. throwing ErrorException from an No no. Stop there.

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-11 Thread René Fournier
Hi Gaurav, On 2009-12-11, at 2:55 PM, Gaurav Kumar wrote: A very typical problem. Good you sent the error message. This problem can be caused due to one of the following- 1. I have faced similar problem due to local firewall settings. Don't think this is it, since (1) the firewall

[PHP] Transparent PNGs: Merging

2009-12-11 Thread Alex Davies
Hi All, I apologise if this is a newbie post; i'm new to transparent graphics (PNGs in my case). I have a transparent PNG on disk, which I want PHP to load into memory and add some text to (watermarking, I guess). This seems to be what is achieved @