Re: Re: Variable post as array

From: Date: Wed, 05 Mar 2008 14:42:54 +0000
Subject: Re: Re: Variable post as array
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-271014@lists.php.net to get a copy of this message
And you don't do: $txtPhotoData = addslashes(fread(fopen($_FILES['txtPhoto']['tmp_name'], "r"), filesize($_FILES['txtPhoto']['tmp_name']))); because.... ? - Tul P.S. if you want more readable code (PHP >= 4.3.0, which you should have anyway) use: $txtPhotoData = file_get_contents($_FILES['txtPhoto']['tmp_name']); Pieter du Toit wrote:
This is line 49 $txtPhotoData = addslashes(fread(fopen($txtPhoto, "r"), filesize($txtPhoto))); the $txtPhoto is the parameter ""Angelo Zanetti"" <angelo@elemental.co.za> wrote in message news:20080305113934.591FBD019@ctb-mesg-1-3.saix.net...
What is on line 49? What variable are you passing as the parameter? -----Original Message----- From: Pieter du Toit [mailto:pieter@lpwebdesign.co.za] Sent: 05 March 2008 13:36 To: php-general@lists.php.net Subject: [PHP] Re: Variable post as array This is my problem Warning: fopen() expects parameter 1 to be string, array given in /usr/www/users/zululr/marketplace/myzululand/specials_proc.php on line 49 "Colin Guthrie" <gmane@colin.guthr.ie> wrote in message news:fqlupu$mm7$1@ger.gmane.org...
Pieter du Toit wrote:
Hi I have this weird problem, when i select a file to upload, the variable arrives as an array at the action php file, this is the code, and the variable name is txtPhoto
I'd give a shorter example. People don't want to read through all your code.. Also you shoudl post some sort of indication of what you are trying to do to get the results you describe... just saying "the variable arrives as an array" and we don't really know how you are accessing "the variable". A short example and expected/actual behaviour listing is good :) Col
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#271014) next »