Jump to content

[SOLVED] Undefined index on my form


runnerjp

Recommended Posts

ok im getting Undefined index on this line.. print_r($_REQUEST['form']);

 

below is the full script its form

 

<?php
ini_set("display_errors", "1");
error_reporting(E_ALL);
echo "<pre>";
echo "POST:";
print_r($_POST);
echo "FILES:";
print_r($_FILES);
echo "</pre>";
if ((($_FILES["file"]["type"] == "application/msword"))
&& ($_FILES["file"]["size"] < 500000))
  {
  if ($_FILES["file"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
    }
  else
    {
    echo "Upload: " . $_FILES["file"]["name"] . "<br />";
    echo "Type: " . $_FILES["file"]["type"] . "<br />";
    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
    echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";

    if (file_exists("entrys/" . $_FILES["file"]["name"]))
      {
      echo $_FILES["file"]["name"] . " already exists. ";
      }
    else
      {
      move_uploaded_file($_FILES["file"]["tmp_name"],
      "entrys/" . $_FILES["file"]["name"]);
      echo "Stored in: " . "entrys/" . $_FILES["file"]["type"];
      }
    }
  }
else
  {
  echo "Invalid file".$_FILES["file"];
  }

print_r($_REQUEST['form']);



?>

 

and here is my form

 

why is it displaying this error??

 

 <form  action="/include/addfixture.php" method="post" onsubmit="return AIM.submit(this, {'onStart' : startCallback, 'onComplete' : completeCallback})"enctype="multipart/form-data">
      <div><label>Name:</label> <input type="text" name="name" /></div>
      <div><label>File:</label> <input type="file" name="file" /></div>
      <div><input type="submit" name="form"value="SUBMIT" /></div>
   </form>

Link to comment
https://forums.phpfreaks.com/topic/180974-solved-undefined-index-on-my-form/
Share on other sites

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.