Re: fread question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 you have magic_quotes_runtime turned on LOCALLY. Use phpinfo() to see.
NOmagic_quotes_runtime Off

 you actually managed to put the backslashes into your text file.
NO
<td><input name="letter" type="file" id="letter" size="50" maxlength="255" 
/>
.
.
.
.
<?php
process_uploaded_file('letter');
function process_uploaded_file($fname) {
    // Assumes set of $_POST variables in the form: name, name_fname, 
name_size, name_type
    $_POST[$fname.'_fname'] = $_FILES[$fname]['name'];
    $_POST[$fname.'_size'] = $_FILES[$fname]['size'];
    $_POST[$fname.'_type'] = $_FILES[$fname]['type'];
    $_POST[$fname.'_fname'] = strtr($_POST[$fname.'_fname'],' 
%&*;:"{}[]|\<>,/()%$#@!','________________________'); //fix special chars in 
name
    $_POST[$fname.'_fname'] = strtr($_POST[$fname.'_fname'],"'","_");
    $fileHandle = fopen($_FILES[$fname]['tmp_name'], "r");
    $_POST[$fname] =stripslashes(fread($fileHandle, 
$_POST[$fname.'_size']));


Neither

<ceo@xxxxxxxxx> wrote in message 
news:20081218155854.69674.qmail@xxxxxxxxxxxxxxxxxx
>
> PHP does *not* do the addslashes on $_POST when you cram something into it 
> in your PHP code.
>
> It does it during the process of auto-filling up $_POST.
>
> So either:
> A) you have magic_quotes_runtime turned on LOCALLY. Use phpinfo() to see.
> B) you actually managed to put the backslashes into your text file.
>
> PS
> You really shouldn't be cramming data into $_POST, imho.
> Too confusing for later development/maintenance.
> $_POST should be "read only"
> Copy the parts of $_POST you want into something else, and add in your 
> file contents as well.
> 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux