Manrico
07-13-2003, 09:05 AM
Hello.
Im trying to build remote admin for a real estate web. Problem is, somehow my variables get lost in the way from flash to php to another php. Its an upload mod where client can browse a picture from own hdd.
flash :
function PildiId(id) {
pilt = new Loadvars();
pilt.piltid = id;
pilt.path = _root.baas;
pilt.send ("http://www.realestate.ee/php/upload.php",pilt,"POST");
}
upload.php:
<form enctype="multipart/form-data" action="up.php" method="POST">
The file: <INPUT TYPE="file" NAME="userfile">
<input type="submit" value="Upload"></FORM>
<input type="hidden" name="path" value="<? urlencode ($_POST['path']);?>">
</FORM>
<?
echo $_POST['path'];?> < ---- this one shows path OK.
up.php :
<?
$path = "X:/WWW/realestate/".$_POST['path']; // < ---- FROM HERE THE PATH IS ALREADY GONE. It shows only X:/WWW/realestate/
$max_size = 200000;
if (!isset($_FILES['userfile'])) exit;
if (is_uploaded_file($_FILES['userfile']['tmp_name']))
{if ($_FILES['userfile']['size']>$max_size) { echo "The file is too big<br>\n"; exit; }
if (($_FILES['userfile']['type']=="image/gif") || ($_FILES['userfile']['type']=="image/pjpeg") || ($_FILES['userfile']['type']=="image/jpeg"))
{
$res = copy($_FILES['userfile']['tmp_name'], $path .$_FILES['userfile']['name']);
if (!$res) { echo "upload failed!<br>\n"; exit; } else { echo "upload sucessful<br>\n"; }
echo "File Name: ".$_FILES['userfile']['name']."<br>\n";
echo "File Size: ".$_FILES['userfile']['size']." bytes<br>\n";
echo "File Type: ".$_FILES['userfile']['type']."<br>\n";} else { echo "Wrong file type<br>\n"; exit; }}
echo "Path:".$path."<br>\n";
?>
Any suggestions? Maybe theres something wrong with php.ini? I have register_globals off but i think thats not the problem.
Im trying to build remote admin for a real estate web. Problem is, somehow my variables get lost in the way from flash to php to another php. Its an upload mod where client can browse a picture from own hdd.
flash :
function PildiId(id) {
pilt = new Loadvars();
pilt.piltid = id;
pilt.path = _root.baas;
pilt.send ("http://www.realestate.ee/php/upload.php",pilt,"POST");
}
upload.php:
<form enctype="multipart/form-data" action="up.php" method="POST">
The file: <INPUT TYPE="file" NAME="userfile">
<input type="submit" value="Upload"></FORM>
<input type="hidden" name="path" value="<? urlencode ($_POST['path']);?>">
</FORM>
<?
echo $_POST['path'];?> < ---- this one shows path OK.
up.php :
<?
$path = "X:/WWW/realestate/".$_POST['path']; // < ---- FROM HERE THE PATH IS ALREADY GONE. It shows only X:/WWW/realestate/
$max_size = 200000;
if (!isset($_FILES['userfile'])) exit;
if (is_uploaded_file($_FILES['userfile']['tmp_name']))
{if ($_FILES['userfile']['size']>$max_size) { echo "The file is too big<br>\n"; exit; }
if (($_FILES['userfile']['type']=="image/gif") || ($_FILES['userfile']['type']=="image/pjpeg") || ($_FILES['userfile']['type']=="image/jpeg"))
{
$res = copy($_FILES['userfile']['tmp_name'], $path .$_FILES['userfile']['name']);
if (!$res) { echo "upload failed!<br>\n"; exit; } else { echo "upload sucessful<br>\n"; }
echo "File Name: ".$_FILES['userfile']['name']."<br>\n";
echo "File Size: ".$_FILES['userfile']['size']." bytes<br>\n";
echo "File Type: ".$_FILES['userfile']['type']."<br>\n";} else { echo "Wrong file type<br>\n"; exit; }}
echo "Path:".$path."<br>\n";
?>
Any suggestions? Maybe theres something wrong with php.ini? I have register_globals off but i think thats not the problem.