Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem na dhost.info z wysyłaniem zmiennych, ani poprze link, ani poprzez formularz
Saladin
post
Post #1





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 29.08.2004

Ostrzeżenie: (0%)
-----


Prosze o pomoc! Zarejestrowałem się na dhost.info i otrzymałem konto, ale mam problem bo nie moge wysyłać zminnych ani przez link, ani przez formularz. Na stronie w FAQ znalazłem coś takiego, ale nie moge sobie poradzić:

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.


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>


A ty plik php który ma tą zmienną otrzymywać:
Cytat
<?
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
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.12.2025 - 18:00