Jump to content

$_POST and $_GET values not correct


rampspost

Recommended Posts

how are you testing to see what is in your code? are you echoing it? if so, your browser is interpreting it as HTML. try adding this to the top of your script:

 

header('Content-type: text/plain;');

 

can you post some of your code too?

 

<form name="data" action="index.php" method="POST">
  <input name="e" maxlength="44" alt="ICAO koodi esimene rida" type="text" class="v2li" value="p<estmaennik<<mari<liis<<<<<<<<<<<<<<<<<<<<<"><br>
  <input name="t" maxlength="44" alt="ICAO koodi esimene rida" type="text" class="v2li" value="K0000000<0est7302208F111004527302200234<<<16"><br>
  <input name="k" maxlength="44" alt="ICAO koodi esimene rida" type="text" class="v2li"><br>
  <div class="nupud">
  <input type="reset" value="Tühjenda väljad" class="nupp">
  <input type="submit" value="Saada" class="nupp"></div>
  </form>

 

And in the same index.php file:

 

if (isset($_POST["e"])){
$esimene = (string) $_POST["e"];
$teine = (string) $_POST["t"];
$kolmas = (string) $_POST["k"];

echo "on olemas<br>";
echo $esimene;
echo $teine;
} else {
echo "ei ole olemas";
}

 

and the output is:

on olemas

p<<<<<<<<<<<<<<<<<<<<<<0est7302208F111004527302200234<<<16

 

EDIT: There are easy solutions for big problems: everything is there, only the browser won't display it...

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.