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.com //
/// You can distribute this code with the link to www.plus2net.com ///
// Please don't remove the link to www.plus2net.com ///
// 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="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<?
while(list($key,$value) = each($_FILES[images][name]))
{
if(!empty($value))
{
$filename = $value;
$add = "$folder/$filename";
//echo $_FILES[images][type][$key];
// echo "<br>";
copy($_FILES[images][tmp_name][$key], $add);
chmod("$add",0777);
}
}
?>
</body>
</html>
[/PHP]
My first try
[PHP]
<?php
#include ("mymail.php");
$folder = $_POST['folder'];
?>
<?php
mkdir("$folder", 0777);
?>
<?
//***************************************
// This is downloaded from www.plus2net.com //
/// You can distribute this code with the link to www.plus2net.com ///
// Please don't remove the link to www.plus2net.com ///
// 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="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<?
while(list($key,$value) = each($_FILES[images][name]))
{
if(!empty($value))
{
$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",0777);
}
}
?>
</body>
</html>
[/PHP]
my second try
[PHP]
<?php
#include ("mymail.php");
$folder = $_POST['folder'];
?>
<?php
mkdir("$folder", 0777);
?>
<?
//***************************************
// This is downloaded from www.plus2net.com //
/// You can distribute this code with the link to www.plus2net.com ///
// Please don't remove the link to www.plus2net.com ///
// 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="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<?
while(list($key,$value) = each($_FILES[images][name]))
{
if(!empty($value))
{
$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",0777);
}
}
?>
</body>
</html>
[/PHP]