Page 1 of 1

CFM to PHP anybody?

Posted: Sat May 09, 2009 8:03 pm
by yukon721
I have two pretty simple CFM codes that I need converted to PHP. Unfrtanetly I'm not to familar with PHP and thought maybe someone could help me do this.

The following codesin cfm are:

CODE 1

Code: Select all

 
cfcontent type="text/xml" />
<cfheader name="expires" value="mon, 06 jan 1990 00:00:01 gmt">
<cfheader name="pragma" value="no-cache">
<cfheader name="cache-control" value="no-cache">
 
<cfdirectory action="list" directory="#ExpandPath ('userUploads')#" name="uploadedFiles" filter="*.*" sort="dateLastModified DESC" />
<files>
    <cfoutput query="uploadedFiles">
        <f name="#name#" size="#size#" path="userUploads/#name#" />
    </cfoutput>
</files>
 
 
CODE 2
 
<!--- Files are uploaded into the userUploads folder. --->
<cffile action="upload" fileField="Filedata" destination="#ExpandPath ('userUploads')#" nameConflict="makeUnique" />
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
<html>
<head>
<title> Upload Page </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
 
<body>
    <h3>Upload Successful</h3>
</body>
</html>
 
Any help with this is much appreciated.

Yukon721

Re: CFM to PHP anybody?

Posted: Sun May 10, 2009 2:02 pm
by Christopher
Take a look at the documentation for the $_FILES superglobal for uploading and the header() function for setting headers.