Discussion:
Help with PHP script to Coldfusion
(too old to reply)
mikejs2
2006-04-18 13:58:35 UTC
Permalink
I have a PHP script that I need to create in coldfusion. I'm fairly new to
coldfusion and would appreciate any help. Here is the PHP script... The code is
suppose to retrieve the HTTP POST data from the url. I would be open to doing
this in Javascript as well. Thanks again...

/* Script Start */

//Get the file POST data
$filePost = $_POST;

//Break the file list into an array
$filePost = explode($fileDelimiter, $filePost);
TSB
2006-04-18 14:55:41 UTC
Permalink
<cfset arrayList = ListToArray(url.urlVar)>

I accessed the URL vars directly via url scope, and the default delimiter is
comma otherwise add a delimiter to the listToArray function. In the PHP
example it looks like you had a var that held the url var name. I hope this
helps.

Trevor
http://www.burnette.us
Mr Black
2006-04-18 20:36:18 UTC
Permalink
I would guess something like this:

<cfset filePost=GetHttpRequestData()>
<cfset filePost=ListToArray(filePost.content, fileDelimiter)>
BSterner
2006-04-19 04:27:18 UTC
Permalink
The '$_POST' environment variable in php is analogous to the "FORM" environment
variable in CF.



<cfscript>
/* Script Start */

//Get the file POST data
filePost = FORM[filePostVariable];

//Break the file list into an array
filePost = listToArray(filePost, fileDelimiter);
</cfscript>
Mr Black
2006-04-19 18:08:34 UTC
Permalink
Should it be

<CFFILE action="upload" filefield="filePostVariable" . . .>
<CFFILE action="read"....>
<cfset filePost=ListToArray(..,fileDelimiter)>

Looks like they parse uploaded file here?

Loading...