Closed Thread Icon

Topic awaiting preservation: PHP $_POST Pages that link to <a href="https://ozoneasylum.com/backlink?for=29722" title="Pages that link to Topic awaiting preservation: PHP $_POST" rel="nofollow" >Topic awaiting preservation: PHP $_POST\

 
Author Thread
Blacknight
Paranoid (IV) Inmate

From: INFRONT OF MY PC
Insane since: Dec 2001

posted posted 11-28-2007 17:19

Ok this one is realy strange

i have several forms on my site all sending data via $_POST ok on one form(the login Form) everything is great. On the other forms uploading ect. does not work due to $_POST being empty? isset($_POST) will be false or echo $_POST will be empty

can anyone help (or understand) me?

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 11-28-2007 17:35

Could be you haven't specified method="post" and enctype="multipart/form-data" on your <forms>?
Or perhaps you're overlooking that <input type="file"> is received via $_FILES[] (but you have to check
for more than isset($_FILES['your_field']) - that's always true wether there was a file or not submited.

so long,

->Tyberius Prime

Blacknight
Paranoid (IV) Inmate

From: INFRONT OF MY PC
Insane since: Dec 2001

posted posted 11-28-2007 17:47

my enctype is correct and the file is handled via $_FILES

the isset($-POST['sub']) where sub is a inputtype="submit"
:-(

(Edited by Blacknight on 11-28-2007 17:47)

Blacknight
Paranoid (IV) Inmate

From: INFRONT OF MY PC
Insane since: Dec 2001

posted posted 11-28-2007 18:11

ok some further infos

code:
<form method="post" action="arbeitupload.php" enctype="multipart/form-data">

Bitte Arbeit Wählen:
<select name="arb" id="arb">
<?
			mysql_connect();
			mysql_select_db();
			$query = "SELECT * FROM ... ";
			$result = mysql_query($query) or die("An error occured " . mysql_error());
			
			while ($line = mysql_fetch_array($result) ){
				print("<option value=\"".$line['id']."\">".$line['name']."</option>");
			}
?>
</select>
<input type="file" id="file" name="file"><br />
<input type="submit" value="Upload" name="sub" id="sub">
</form>




and the php

code:
if(isset($_POST["sub"])){

some php
}



all the $_POST[]elements are empty after submit

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 11-28-2007 18:21

and you're sure submiting the form?
No evil javascript that captures your 'enter' keystroke and submits something else?
What's in var_dump($GLOBALS);

Blacknight
Paranoid (IV) Inmate

From: INFRONT OF MY PC
Insane since: Dec 2001

posted posted 11-28-2007 18:33

i guess this is what i should have been looking for?

code:
["HTTP_POST_VARS"]=>  array(0) { } ["_POST"]=>  array(0) { } ["HTTP_GET_VARS"]=>  array(0) { } ["_GET"]=>  array(0) { }

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 11-28-2007 19:34

huh. that's weird.
And no include clobbering those?
A redirect in between?

Blacknight
Paranoid (IV) Inmate

From: INFRONT OF MY PC
Insane since: Dec 2001

posted posted 11-28-2007 20:00

no. there is a redirect but within the if the wired thing is it occurs with and without files there is only one form that works ..and that is excactly the same
even weirder is that it worked yesterday ..and i did no changes(well not to all of the scripts) i have a custom php.ini but appart from the max_upload_size it is idetical to the one my host uses (even used a script provided to change the original ini file)

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 11-29-2007 09:25

so... you have tried setting max_upload_size back, just in case?

« BackwardsOnwards »

Show Forum Drop Down Menu