Cytat
Question: php variables don't get sent to pages?
Answer: DHOST doesn't support global variables, thus you must include POST (aka HTTP_POST_VARS) or GET (aka HTTP_GET_VARS) on variables that are passed to other scripts.
$_POST['variable'] - Variables that are directly sent to same/other script.
$_GET['variable'] - Variables passed over the URL. (i.e. script.php?action=go)
If you don't want to have the hassle of adding POST or GET to all of your variables...add this to the very top of your php script:
CODE
extract($_POST);
extract($_GET);
That code turns $_POST['variable'] and $_GET['variable'] into $variable.
Answer: DHOST doesn't support global variables, thus you must include POST (aka HTTP_POST_VARS) or GET (aka HTTP_GET_VARS) on variables that are passed to other scripts.
$_POST['variable'] - Variables that are directly sent to same/other script.
$_GET['variable'] - Variables passed over the URL. (i.e. script.php?action=go)
If you don't want to have the hassle of adding POST or GET to all of your variables...add this to the very top of your php script:
CODE
extract($_POST);
extract($_GET);
That code turns $_POST['variable'] and $_GET['variable'] into $variable.
Napisałem prubny bardzo prosty skrypt:
formularz html który ma wysyłać zmienną x:
Cytat
<html>
<form method="post" action="1.php">
<input type="text" name="x">
<input type="submit">
</form>
</html>
<form method="post" action="1.php">
<input type="text" name="x">
<input type="submit">
</form>
</html>
A ty plik php który ma tą zmienną otrzymywać:
Cytat
<?
echo"$x";
?>
echo"$x";
?>
Byłbym wdzięczny gdyby ktoś napisał mi jak zmodyfikować oba te pliki według tego co napisali na dhoście by działało i przesyłanie zmiennych przy użyciu linka i formularza.
Pozdrawiam