Jump to content

how to get a value from a posted page


otuatail

Recommended Posts

Hi

I am trying to retreave a value from a previouse p[osted page. Problem is it is encripted.

 

<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="text" name="F">
<input type="submit" name="submit" value="Submit" />
</form>

--------------
echo("Value " . $__FILES["Friend"]);

tried $_POST and $_GET

There must be a way to retreve this. works with a normal post.



 

Link to comment
https://forums.phpfreaks.com/topic/154387-how-to-get-a-value-from-a-posted-page/
Share on other sites

what does enctype mean then.

<html>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
Name:<br>
<input type="text" name="val" value="XXX"> e.g. Becky , Colin , My Party
<br><br>
<label for="file">Filename:</label><br>
<input type="file" name="file" id="file" />
<br><br>
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>

 

 

<?php
include ("ftpInclude.inc");
connectDB(1);
echo("Value " . $_FILES["val"]);

if (
(($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "mage/bmp")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg")
|| ($_FILES["file"]["type"] == "application/pdf")

|| ($_FILES["file"]["type"] == "application/vnd.ms-powerpoint")
|| ($_FILES["file"]["type"] == "application/vnd.openxmlformats-officedocument.presentationml.presentation")
|| ($_FILES["file"]["type"] == "application/msword")
|| ($_FILES["file"]["type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document")
|| ($_FILES["file"]["type"] == "application/vnd.ms-excel")
|| ($_FILES["file"]["type"] == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|| ($_FILES["file"]["type"] == "text/plain")

)
&& ($_FILES["file"]["size"] < 2000000))
  {
  if ($_FILES["file"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
    }
  else
    {
    $real = $_FILES["file"]["name"];
    $GetName = ServerName($_FILES["file"]["name"]);
    move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $GetName);
    echo "Stored in: " . "upload/" . $GetName;
    $sqlFtp = "INSERT INTO ftp (RealName,FrendlyName,ServerName) VALUES ('" . $real . "', 'Desmond' , '" . $GetName . "')";
    $query = mysql_query($sqlFtp);
    $result = mysql_affected_rows();
    echo $result;
    
    }
  }
else
  {
  //echo "Invalid file";
  }
?>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.