A little problem making to thing happen

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • webandwe
    New Member
    • Oct 2006
    • 142

    A little problem making to thing happen

    Hi, I got form that let you state a folder name, on sumbit thw script creates the folder with the name you stated, the problem is I want it to upload the php file "view.php" when the folder is created, I think I set the value wrong but can get it to work

    original script

    [PHP]
    <?php
    #include ("mymail.php ");
    $folder = $_POST['folder'];
    ?>
    <?php
    mkdir("$folder" , 0777);
    ?>
    <?
    //*************** *************** *********
    // This is downloaded from www.plus2net.co m //
    /// You can distribute this code with the link to www.plus2net.co m ///
    // Please don't remove the link to www.plus2net.co m ///
    // This is for your learning only not for commercial use. ///////
    //The author is not responsible for any type of loss or problem or damage on using this script.//
    /// You can use it at your own risk. /////
    //*************** *************** ***********
    ?>
    <!doctype html public "-//w3c//dtd html 3.2//en">

    <html>

    <head>
    <title>Mardos/title>
    <meta name="GENERATOR " content="Arachn ophilia 4.0">
    <meta name="FORMATTER " content="Arachn ophilia 4.0">
    </head>

    <body bgcolor="#fffff f" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" >
    <?

    while(list($key ,$value) = each($_FILES[images][name]))
    {
    if(!empty($valu e))
    {
    $filename = $value;

    $add = "$folder/$filename";

    //echo $_FILES[images][type][$key];
    // echo "<br>";
    copy($_FILES[images][tmp_name][$key], $add);
    chmod("$add",07 77);


    }
    }


    ?>


    </body>

    </html>

    [/PHP]


    My first try

    [PHP]

    <?php
    #include ("mymail.php ");
    $folder = $_POST['folder'];
    ?>
    <?php
    mkdir("$folder" , 0777);
    ?>
    <?
    //*************** *************** *********
    // This is downloaded from www.plus2net.co m //
    /// You can distribute this code with the link to www.plus2net.co m ///
    // Please don't remove the link to www.plus2net.co m ///
    // This is for your learning only not for commercial use. ///////
    //The author is not responsible for any type of loss or problem or damage on using this script.//
    /// You can use it at your own risk. /////
    //*************** *************** ***********
    ?>
    <!doctype html public "-//w3c//dtd html 3.2//en">

    <html>

    <head>
    <title>Mardos/title>
    <meta name="GENERATOR " content="Arachn ophilia 4.0">
    <meta name="FORMATTER " content="Arachn ophilia 4.0">
    </head>

    <body bgcolor="#fffff f" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" >
    <?

    while(list($key ,$value) = each($_FILES[images][name]))
    {
    if(!empty($valu e))
    {
    $filename = $value;
    $add= "$folder/view.php";
    $add. = "$folder/$filename";
    # I also tried it without the dot

    //echo $_FILES[images][type][$key];
    // echo "<br>";
    copy($_FILES[images][tmp_name][$key], $add);
    chmod("$add",07 77);


    }
    }


    ?>


    </body>

    </html>
    [/PHP]

    my second try

    [PHP]
    <?php
    #include ("mymail.php ");
    $folder = $_POST['folder'];
    ?>
    <?php
    mkdir("$folder" , 0777);
    ?>
    <?
    //*************** *************** *********
    // This is downloaded from www.plus2net.co m //
    /// You can distribute this code with the link to www.plus2net.co m ///
    // Please don't remove the link to www.plus2net.co m ///
    // This is for your learning only not for commercial use. ///////
    //The author is not responsible for any type of loss or problem or damage on using this script.//
    /// You can use it at your own risk. /////
    //*************** *************** ***********
    ?>
    <!doctype html public "-//w3c//dtd html 3.2//en">

    <html>

    <head>
    <title>Mardos/title>
    <meta name="GENERATOR " content="Arachn ophilia 4.0">
    <meta name="FORMATTER " content="Arachn ophilia 4.0">
    </head>

    <body bgcolor="#fffff f" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" >
    <?

    while(list($key ,$value) = each($_FILES[images][name]))
    {
    if(!empty($valu e))
    {
    $filename = $value;
    $view= "$folder/view.php";
    $add = "$folder/$filename";

    //echo $_FILES[images][type][$key];
    // echo "<br>";
    copy($_FILES[images][tmp_name][$key], $add, $view);
    chmod("$add",07 77);


    }
    }


    ?>


    </body>

    </html>

    [/PHP]
  • webandwe
    New Member
    • Oct 2006
    • 142

    #2
    Don't worry anymore got it sorted.....

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Originally posted by webandwe
      Don't worry anymore got it sorted.....
      Great! How'd you get it working?

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        Glad you found the solution to your problem. Care to post back and let us know what the solution was?

        Comment

        Working...