daav31 Posted January 9, 2008 Share Posted January 9, 2008 Hello, I have the following code: Code: ( php ) $RecordID = $_POST['PKid']; $LastModBy= $_POST['LastModBy']; // These datetime vars live in globals.php $mySQLToday = $thisYear.'-'.$thisMonth.'-'.$thisDay; // prints todays date in YYYY-MM-DD format $attachment_type = "workAttachs"; // What is the file type for this section? $file_path = $datastore_root."/".$owner."/".$attachment_type."/".$thisYear."/".$thisMonth."/".$thisDay; $link_path = "/".$attachment_type."/".$thisYear."/".$thisMonth."/".$thisDay."/"; function mkPath($path) { $dirs=array(); $path=preg_replace('/(\/){2,}|(\\\){1,}/','/',$path); //only forward-slash $dirs=explode("/",$path); $path=""; foreach ($dirs as $element) { $path.=$element."/"; if(!is_dir($path)) {if(!mkdir($path)){ return '/tmp';} } } return $path; } $upld_dir = mkPath($file_path); if ((isset($_POST["MMUpload"])) && ($_POST["MMUpload"] == "formUpload")) { $insertSQL = sprintf("INSERT INTO files (file, content) VALUES (%s, %s)", GetSQLValueString($_POST['UpldFile'], "text"), GetSQLValueString($_POST['FKcontent'], "text")); mysql_select_db($db_common, $common); $Result1 = mysql_query($insertSQL, $common) or die(mysql_error()); } if ($_REQUEST['uploadDir']) { $output_file = array_slice($_FILES['Filedata'], 0, 1); foreach ($output_file as $files) { $uploadFile = $upld_dir . $_FILES['Filedata']['name']; if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploadFile)){ echo '<body onLoad="document.formUpload.submit()"> <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value='.$upld_dir . $files.'> <input type="hidden" name="LastModBy" value='.$_POST['LastModBy'].'> <input type="hidden" name="FKcontent" value='.$RecordID.'> </form> </body>'; $result = '<body onLoad="document.formUpload.submit()"> <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value='.$upld_dir . $files.'> <input type="hidden" name="LastModBy" value='.$LastModBy.'> <input type="hidden" name="FKcontent" value='.$RecordID.'> </form> </body>'; } $filename = 'test.txt'; // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $result) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($result) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } } } if ($_REQUEST['action'] == 'getMaxFilesize') { echo "&maxFilesize=".ini_get('upload_max_filesize') ; } ?> My problem is that the two top POST variables (in red bold) values are not posting in the output form section (in bold blue) and I do not know why, the POST variable values are echoing fine so I know they are being posted from the previous page...Thanx for any help... Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/ Share on other sites More sharing options...
drummer101 Posted January 9, 2008 Share Posted January 9, 2008 You posted $RecordID = $_POST['PKid']; $LastModBy= $_POST['LastModBy']; Was the problem However, your code is <input type="hidden" name="LastModBy" value='.$LastModBy.'> <input type="hidden" name="FKcontent" value='.$RecordID.'> More importantly <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> you're missing method="post" Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-434901 Share on other sites More sharing options...
GingerRobot Posted January 9, 2008 Share Posted January 9, 2008 More importantly <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> you're missing action="post" Or rather, method="post" Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-434902 Share on other sites More sharing options...
drummer101 Posted January 9, 2008 Share Posted January 9, 2008 Or rather, method="post" Whoops, mind is focused on lunch Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-434904 Share on other sites More sharing options...
GingerRobot Posted January 9, 2008 Share Posted January 9, 2008 Or rather, method="post" Whoops, mind is focused on lunch Haha, i know the feeling - though mine's usually focused on bed! Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-434908 Share on other sites More sharing options...
daav31 Posted January 9, 2008 Author Share Posted January 9, 2008 You posted $RecordID = $_POST['PKid']; $LastModBy= $_POST['LastModBy']; Was the problem However, your code is <input type="hidden" name="LastModBy" value='.$LastModBy.'> <input type="hidden" name="FKcontent" value='.$RecordID.'> More importantly <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> you're missing method="post" Thanks for the help, but I don't see what is wrong here? <input type="hidden" name="LastModBy" value='.$LastModBy.'> <input type="hidden" name="FKcontent" value='.$RecordID.'> Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-434944 Share on other sites More sharing options...
GingerRobot Posted January 9, 2008 Share Posted January 9, 2008 The names of the two fields you have used are LastModBy and FKcontent. These will be the names of the keys in the $_POST array, and so need to be the names used to access these variables. You should have: $RecordID = $_POST['PKcontent']; $LastModBy= $_POST['LastModBy']; Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-434955 Share on other sites More sharing options...
daav31 Posted January 9, 2008 Author Share Posted January 9, 2008 The names of the two fields you have used are LastModBy and FKcontent. These will be the names of the keys in the $_POST array, and so need to be the names used to access these variables. You should have: $RecordID = $_POST['PKcontent']; $LastModBy= $_POST['LastModBy']; But these post variables $RecordID = $_POST['PKid']; $LastModBy= $_POST['LastModBy']; contain values that were posted from the previous page...what I am doing (or want to be doing) is assigning those post variable values($_POST['PKid']) to a new variable($RecordID) and then I want to read that new variable($RecordID) value from this form (in blue): ($_REQUEST['uploadDir']) { $output_file = array_slice($_FILES['Filedata'], 0, 1); foreach ($output_file as $files) { $uploadFile = $upld_dir . $_FILES['Filedata']['name']; if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploadFile)){ echo '<body onLoad="document.formUpload.submit()"> <form name="form_upload" method="post" action="'.$_SERVER['PHP_SELF'].'"> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value="'.$upld_dir . $files.'"> <input type="hidden" name="LastModBy" value="'.$LastModBy.'"> <input type="hidden" name="FKcontent" value="'.$RecordID.'"> </form> </body>'; $result = '<body onLoad="document.formUpload.submit()"> <form name="form_upload" method="post" action="'.$_SERVER['PHP_SELF'].'"> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value="'.$upld_dir . $files.'"> <input type="hidden" name="LastModBy" value="'.$LastModBy.'"> <input type="hidden" name="FKcontent" value="'.$RecordID.'"> </form> </body>'; } I hope that makes sense, Thanx... Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435026 Share on other sites More sharing options...
Ken2k7 Posted January 9, 2008 Share Posted January 9, 2008 $_POST['PKid'] doesn't exist because there is no input named PKid Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435034 Share on other sites More sharing options...
daav31 Posted January 9, 2008 Author Share Posted January 9, 2008 $_POST['PKid'] doesn't exist because there is no input named PKid can't $_POST['PKid'] hold a value submitted through a form and hidden field from a previous page such as: <form method="post" name="form_upload" action="/page.php"> <input type="hidden" name="PKid" value="<?php echo $rowRSViewContent['PKid']; ?>" /> <input type="hidden" name="MMUpload" value="form_upload" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435054 Share on other sites More sharing options...
teng84 Posted January 9, 2008 Share Posted January 9, 2008 try to view your source code and look if hidden fields has value Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435056 Share on other sites More sharing options...
daav31 Posted January 9, 2008 Author Share Posted January 9, 2008 try to view your source code and look if hidden fields has value yes it does... Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435059 Share on other sites More sharing options...
teng84 Posted January 10, 2008 Share Posted January 10, 2008 sorry im lost. you should be fine if that has a value, can you tell us whats the problem now? Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435063 Share on other sites More sharing options...
daav31 Posted January 10, 2008 Author Share Posted January 10, 2008 sorry im lost. you should be fine if that has a value, can you tell us whats the problem now? Ok...so I have view.php page which has the following code: <form method="post" name="form_upload" action="uploadscript.php"> <input type="hidden" name="PKid" value="<?php echo $rowRSViewContent['PKid']; ?>" /> <input type="hidden" name="LastModBy" value="<?php echo $rowRSViewContent['LastModBy']; ?>" /> <input type="hidden" name="MMUpload" value="form_upload" /> </form> and the uploadscript.php page with the following code: //BEGIN PHP $RecordID = $_POST['PKid']; $LastModBy= $_POST['LastModBy']; // These datetime vars live in globals.php $mySQLToday = $thisYear.'-'.$thisMonth.'-'.$thisDay; // prints todays date in YYYY-MM-DD format $attachment_type = "workAttachs"; // What is the file type for this section? $file_path = $datastore_root."/".$owner."/".$attachment_type."/".$thisYear."/".$thisMonth."/".$thisDay; $link_path = "/".$attachment_type."/".$thisYear."/".$thisMonth."/".$thisDay."/"; function mkPath($path) { $dirs=array(); $path=preg_replace('/(\/){2,}|(\\\){1,}/','/',$path); //only forward-slash $dirs=explode("/",$path); $path=""; foreach ($dirs as $element) { $path.=$element."/"; if(!is_dir($path)) {if(!mkdir($path)){ return '/tmp';} } } return $path; } $upld_dir = mkPath($file_path); if ((isset($_POST["MMUpload"])) && ($_POST["MMUpload"] == "formUpload")) { $insertSQL = sprintf("INSERT INTO files (file, content) VALUES (%s, %s)", GetSQLValueString($_POST['UpldFile'], "text"), GetSQLValueString($_POST['FKcontent'], "text")); mysql_select_db($db_common, $common); $Result1 = mysql_query($insertSQL, $common) or die(mysql_error()); } if ($_REQUEST['uploadDir']) { $output_file = array_slice($_FILES['Filedata'], 0, 1); foreach ($output_file as $files) { $uploadFile = $upld_dir . $_FILES['Filedata']['name']; if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploadFile)){ echo '<body onLoad="document.formUpload.submit()"> <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value='.$upld_dir . $files.'> <input type="hidden" name="LastModBy" value='.$_POST['LastModBy'].'> <input type="hidden" name="FKcontent" value='.$RecordID.'> </form> </body>'; $result = '<body onLoad="document.formUpload.submit()"> <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value='.$upld_dir . $files.'> <input type="hidden" name="LastModBy" value='.$LastModBy.'> <input type="hidden" name="FKcontent" value='.$RecordID.'> </form> </body>'; } $filename = 'test.txt'; // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $result) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($result) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } } } if ($_REQUEST['action'] == 'getMaxFilesize') { echo "&maxFilesize=".ini_get('upload_max_filesize') ; } ?> //END PHP Upon clicking the edit button on the view.php page I get taken to the uploadscript.php page. Now, I know the hidden field values from view.php are getting passed to the uploadscript.php page because when I echo these: $RecordID = $_POST['PKid']; $LastModBy= $_POST['LastModBy']; they show fine, the problem is that they are not showing in this form's fields (in blue bold): //BEGIN PHP // These datetime vars live in globals.php $mySQLToday = $thisYear.'-'.$thisMonth.'-'.$thisDay; // prints todays date in YYYY-MM-DD format $attachment_type = "workAttachs"; // What is the file type for this section? $file_path = $datastore_root."/".$owner."/".$attachment_type."/".$thisYear."/".$thisMonth."/".$thisDay; $link_path = "/".$attachment_type."/".$thisYear."/".$thisMonth."/".$thisDay."/"; function mkPath($path) { $dirs=array(); $path=preg_replace('/(\/){2,}|(\\\){1,}/','/',$path); //only forward-slash $dirs=explode("/",$path); $path=""; foreach ($dirs as $element) { $path.=$element."/"; if(!is_dir($path)) {if(!mkdir($path)){ return '/tmp';} } } return $path; } $upld_dir = mkPath($file_path); if ((isset($_POST["MMUpload"])) && ($_POST["MMUpload"] == "formUpload")) { $insertSQL = sprintf("INSERT INTO files (file, content) VALUES (%s, %s)", GetSQLValueString($_POST['UpldFile'], "text"), GetSQLValueString($_POST['FKcontent'], "text")); mysql_select_db($db_common, $common); $Result1 = mysql_query($insertSQL, $common) or die(mysql_error()); } if ($_REQUEST['uploadDir']) { $output_file = array_slice($_FILES['Filedata'], 0, 1); foreach ($output_file as $files) { $uploadFile = $upld_dir . $_FILES['Filedata']['name']; if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploadFile)){ echo '<body onLoad="document.formUpload.submit()"> <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value='.$upld_dir . $files.'> <input type="hidden" name="LastModBy" value='.$_POST['LastModBy'].'> <input type="hidden" name="FKcontent" value='.$RecordID.'> </form> </body>'; $result = '<body onLoad="document.formUpload.submit()"> <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value='.$upld_dir . $files.'> <input type="hidden" name="LastModBy" value='.$LastModBy.'> <input type="hidden" name="FKcontent" value='.$RecordID.'> </form> </body>'; } $filename = 'test.txt'; // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $result) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($result) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } } } if ($_REQUEST['action'] == 'getMaxFilesize') { echo "&maxFilesize=".ini_get('upload_max_filesize') ; } ?> //END PHP Can this somehow be a variable scope issue? Thanx Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435086 Share on other sites More sharing options...
teng84 Posted January 10, 2008 Share Posted January 10, 2008 that is a hidden field so its hidden you can only see them on your src code but not on the browser.. replacehidden with text to be displayed on your browser is that what you mean? Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435090 Share on other sites More sharing options...
daav31 Posted January 10, 2008 Author Share Posted January 10, 2008 that is a hidden field so its hidden you can only see them on your src code but not on the browser.. replacehidden with text to be displayed on your browser is that what you mean? No they should be displayed when I do a test by outputting the form to a txt file... <body onLoad="document.form_upload.submit()"> <form name="form_upload" method="post" action="uploadscript.php"> <input type="hidden" name="MMUpload" value="form_upload"> <input type="hidden" name="UpldFile" value="/file.pdf"> <input type="hidden" name="FKContent" value=""> <input type="hidden" name="LastModBy" value=""> </form> </body> You see how the hidden fields in bold blue output empty values.... Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435095 Share on other sites More sharing options...
teng84 Posted January 10, 2008 Share Posted January 10, 2008 <? $RecordID = $_POST['PKid']; $LastModBy= $_POST['LastModBy']; // These datetime vars live in globals.php $mySQLToday = $thisYear.'-'.$thisMonth.'-'.$thisDay; // prints todays date in YYYY-MM-DD format $attachment_type = "workAttachs"; // What is the file type for this section? $file_path = $datastore_root."/".$owner."/".$attachment_type."/".$thisYear."/".$thisMonth."/".$thisDay; $link_path = "/".$attachment_type."/".$thisYear."/".$thisMonth."/".$thisDay."/"; function mkPath($path) { $dirs=array(); $path=preg_replace('/(\/){2,}|(\\\){1,}/','/',$path); //only forward-slash $dirs=explode("/",$path); $path=""; foreach ($dirs as $element) { $path.=$element."/"; if(!is_dir($path)) {if(!mkdir($path)){ return '/tmp';} } } return $path; } $upld_dir = mkPath($file_path); if ((isset($_POST["MMUpload"])) && ($_POST["MMUpload"] == "formUpload")) { $insertSQL = sprintf("INSERT INTO files (file, content) VALUES (%s, %s)", GetSQLValueString($_POST['UpldFile'], "text"), GetSQLValueString($_POST['FKcontent'], "text")); mysql_select_db($db_common, $common); $Result1 = mysql_query($insertSQL, $common) or die(mysql_error()); } if ($_REQUEST['uploadDir']) { $output_file = array_slice($_FILES['Filedata'], 0, 1); foreach ($output_file as $files) { $uploadFile = $upld_dir . $_FILES['Filedata']['name']; if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploadFile)){ echo '<body onLoad="document.formUpload.submit()"> <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value='.$upld_dir . $files.'> <input type="hidden" name="LastModBy" value='.$_POST['LastModBy'].'> <input type="hidden" name="FKcontent" value='.$RecordID.'> </form> </body>'; echo 'test teng'.$LastModBy.'>>>>>>>>>>>>'.$RecordID; $result = '<body onLoad="document.formUpload.submit()"> <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value='.$upld_dir . $files.'> <input type="hidden" name="LastModBy" value="'.$LastModBy.'"> <input type="hidden" name="FKcontent" value="'.$RecordID.'"> </form> </body>'; } $filename = 'test.txt'; // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $result) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($result) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } } } if ($_REQUEST['action'] == 'getMaxFilesize') { echo "&maxFilesize=".ini_get('upload_max_filesize') ; } ?> try and tell me what happen Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435135 Share on other sites More sharing options...
daav31 Posted January 10, 2008 Author Share Posted January 10, 2008 <? $RecordID = $_POST['PKid']; $LastModBy= $_POST['LastModBy']; // These datetime vars live in globals.php $mySQLToday = $thisYear.'-'.$thisMonth.'-'.$thisDay; // prints todays date in YYYY-MM-DD format $attachment_type = "workAttachs"; // What is the file type for this section? $file_path = $datastore_root."/".$owner."/".$attachment_type."/".$thisYear."/".$thisMonth."/".$thisDay; $link_path = "/".$attachment_type."/".$thisYear."/".$thisMonth."/".$thisDay."/"; function mkPath($path) { $dirs=array(); $path=preg_replace('/(\/){2,}|(\\\){1,}/','/',$path); //only forward-slash $dirs=explode("/",$path); $path=""; foreach ($dirs as $element) { $path.=$element."/"; if(!is_dir($path)) {if(!mkdir($path)){ return '/tmp';} } } return $path; } $upld_dir = mkPath($file_path); if ((isset($_POST["MMUpload"])) && ($_POST["MMUpload"] == "formUpload")) { $insertSQL = sprintf("INSERT INTO files (file, content) VALUES (%s, %s)", GetSQLValueString($_POST['UpldFile'], "text"), GetSQLValueString($_POST['FKcontent'], "text")); mysql_select_db($db_common, $common); $Result1 = mysql_query($insertSQL, $common) or die(mysql_error()); } if ($_REQUEST['uploadDir']) { $output_file = array_slice($_FILES['Filedata'], 0, 1); foreach ($output_file as $files) { $uploadFile = $upld_dir . $_FILES['Filedata']['name']; if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploadFile)){ echo '<body onLoad="document.formUpload.submit()"> <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value='.$upld_dir . $files.'> <input type="hidden" name="LastModBy" value='.$_POST['LastModBy'].'> <input type="hidden" name="FKcontent" value='.$RecordID.'> </form> </body>'; echo 'test teng'.$LastModBy.'>>>>>>>>>>>>'.$RecordID; $result = '<body onLoad="document.formUpload.submit()"> <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> <input type="hidden" name="MMUpload" value="formUpload"> <input type="hidden" name="UpldFile" value='.$upld_dir . $files.'> <input type="hidden" name="LastModBy" value="'.$LastModBy.'"> <input type="hidden" name="FKcontent" value="'.$RecordID.'"> </form> </body>'; } $filename = 'test.txt'; // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $result) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($result) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } } } if ($_REQUEST['action'] == 'getMaxFilesize') { echo "&maxFilesize=".ini_get('upload_max_filesize') ; } ?> try and tell me what happen Nothing shows up... Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435859 Share on other sites More sharing options...
rhodesa Posted January 10, 2008 Share Posted January 10, 2008 At first glance I noticed method="POST" is missing from your form element Find: <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> Replace <form name="form_upload" action='.$_SERVER['PHP_SELF'].' method="POST"> Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435867 Share on other sites More sharing options...
daav31 Posted January 10, 2008 Author Share Posted January 10, 2008 At first glance I noticed method="POST" is missing from your form element Find: <form name="form_upload" action='.$_SERVER['PHP_SELF'].'> Replace <form name="form_upload" action='.$_SERVER['PHP_SELF'].' method="POST"> Thanks...thats already taken care of...i just forgot to put it there... Quote Link to comment https://forums.phpfreaks.com/topic/85249-post-variables-are-emptynot-sure-why/#findComment-435873 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.