Skip to main content
Inspiring
March 30, 2009
Question

PHP to CFM

  • March 30, 2009
  • 1 reply
  • 551 views
I found a php code and I want to convert it to CFM. I already converted most of the code by there're some that I don't know how to. I'll post the part that I don't know how to. Hopefully someone can help me


This topic has been closed for replies.

1 reply

Inspiring
March 30, 2009
dchard wrote:
> I found a php code and I want to convert it to CFM. I already converted most of
> the code by there're some that I don't know how to. I'll post the part that I
> don't know how to. Hopefully someone can help me
>
>
>
>
> <?php
> if($_GET['album_id']=="1"){
> $tofold="/images/";
> }else if($_GET['album_id']=="2"){
> $tofold="/images2/";
> }else{
> $tofold="/images3/";
> }
> if($_GET['do']=="redirect"){
> $host = $_SERVER['HTTP_HOST'];
> $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
> header("location: http://".$host.$uri.$tofold);
<cflocation url="...">
> die();
> }


> $filekeys = array_keys($_FILES);
> $filekey=$filekeys[0];
> $uploaddir = dirname($_SERVER['PATH_TRANSLATED']).$tofold;
> $uploadfile = $uploaddir . basename($_FILES[$filekey]['name']);
> if (move_uploaded_file($_FILES[$filekey]['tmp_name'], $uploadfile)) {
>
> //echo "File is valid, and was successfully uploaded.\n";
> } else {
> //echo "Possible file upload attack!\n";
> }

This code uploads the first file that the user sent. Use <cffile
action="upload"...>

--
Mack