$_POST problem
Moderator: General Moderators
-
movieplace.gr
- Forum Newbie
- Posts: 6
- Joined: Wed Aug 15, 2007 6:17 pm
$_POST problem
https://69.65.104.25:8443/sitepreview/h ... eesstt.php
in this page i have 3 examples that post values.... none of them works to the server....
the strange is that localy works fine....
i have also the phpinfo and at the bottom the source code... (with php)...try it localy... it works perfect....
what's wrong????
please... heeeeeeeeeelllllllllppppppppppppppppppp me....
in this page i have 3 examples that post values.... none of them works to the server....
the strange is that localy works fine....
i have also the phpinfo and at the bottom the source code... (with php)...try it localy... it works perfect....
what's wrong????
please... heeeeeeeeeelllllllllppppppppppppppppppp me....
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
-
movieplace.gr
- Forum Newbie
- Posts: 6
- Joined: Wed Aug 15, 2007 6:17 pm
***** Please use the
Code: Select all
Tag when posting code *****[/color]Code: Select all
<form action="tteesstt.php" method="post" enctype="multipart/form-data">
<select name="test[]" multiple="multiple">
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
<option value="four">four</option>
<option value="five">five</option>
</select>
<input type="submit" value="Send" />
</form>
<?php
$test=$_POST['test'];
if ($test){
foreach ($test as $t){echo 'You selected ',$t,'<br />';}
}
?>
<?
if ($HTTP_POST_VARS['check']) {
$box=$HTTP_POST_VARS['box1']; //as a normal var
$box_count=count($box); // count how many values in array
foreach ($box as $dear) {
echo $dear."<br>";
}
echo "<hr>";
}
?>
<form name="hede" method="POST" action="">
<input type="checkbox" name="box1[]" value="1"> 1
<input type="checkbox" name="box1[]" value="2"> 2
<input type="checkbox" name="box1[]" value="3"> 3
<input type="checkbox" name="box1[]" value="4"> 4
<input type="checkbox" name="box1[]" value="5"> 5 <br><br>
<input type="checkbox" name="box1[]" value="6"> 6
<input type="checkbox" name="box1[]" value="7"> 7
<input type="checkbox" name="box1[]" value="8"> 8
<input type="checkbox" name="box1[]" value="9"> 9
<input type="checkbox" name="box1[]" value="10"> 10 <br><br>
<input type="submit" name="check" value="SEND">
</form>
<form action="tteesstt.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<label>
<input type="file" name="arxeio" id="arxeio" />
</label>
<label>
<input type="submit" name="button" id="button" value="Submit" />
</label>
</form>
<?php
$arxeio=$_FILES['arxeio']['name'];
echo 'You selected ',$arxeio,'<br />';
?>
<?php
phpinfo();
?>-
movieplace.gr
- Forum Newbie
- Posts: 6
- Joined: Wed Aug 15, 2007 6:17 pm
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Some friendly advice... ALWAYS assume it's your code first. In this case, it certainly looks like it is.movieplace.gr wrote:i don't think that the code has problem.... i think that something is going wrong with php.... maybe with php.ini
Why do you use HTTP_POST_VARS? What PHP version are you using?
Where does $_POST['test'] come from?
-
movieplace.gr
- Forum Newbie
- Posts: 6
- Joined: Wed Aug 15, 2007 6:17 pm
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
The code uses variables that may not exist, and uses HTTP_POST_VARS, which is outdated and has been for quite some time.movieplace.gr wrote:i dont want to change the code.... tha code works fine everywhere except from my VPS.
Okay, I see it now.movieplace.gr wrote:The $_POST comes from the same page....
What for? It's not my script.movieplace.gr wrote:copy the source code and run it....
I assure you, PHP is fine. Your script doesn't do anything that would require different settings in PHP aside from not having error reporting on at all. print_r($_POST) to see the values that are posted.movieplace.gr wrote:something is going wrong with php.... but what???
-
movieplace.gr
- Forum Newbie
- Posts: 6
- Joined: Wed Aug 15, 2007 6:17 pm
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
So you get no values at all...? PHP doesn't control the posting of data, the server does. PHP gets the request directly from the server. if you print_r($_REQUEST) and still get the same result, then your server is flawed. I'm am not sure what settings would cause the server to stop accepting requests, but you really should confront your host about it.
-
movieplace.gr
- Forum Newbie
- Posts: 6
- Joined: Wed Aug 15, 2007 6:17 pm
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
You'll need to address the fact that your server only posts blank data to your host and see if they can fix it.movieplace.gr wrote:Localy
Array ( [test] => Array ( [0] => one [1] => two [2] => three ) [phpbb2mysql_data] => a:2:{s:11:"autologinid";s:32:"4040d2830fdda4044cb88c3492dc6ec0";s:6:"userid";i:2;} [phpbb2mysql_sid] => 1ebbf728d6b2840d18253f87dc01b31c )
Server
Array ( [test] => )