1 Reply Latest reply on Mar 30, 2009 2:33 PM by Newsgroup_User

    PHP to CFM

    Level 1
      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


        • 1. Re: PHP to CFM
          Level 7
          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