You should and always should use the superglobal counter parts, so your form is is passing a GET parameter, so:
CODE
if(isset($_GET['registrate'])) { ... body }
If you were to want to get say an input field from a form with a method of post, it would simply be:
CODE
$_POST['thenameofthefield']
NDBoost
Sep 4 2009, 03:15 PM
correct me if im wrong (i havent read much about PHP5) but couldnt you set the superglobal to a var to make it easier to handle later on?
IE:
CODE
$registrate = $_GET['registrate'];
if(isset($registrate)) { ... body }
Ed
Sep 4 2009, 03:37 PM
QUOTE(NDBoost @ Sep 4 2009, 04:15 PM)
correct me if im wrong (i havent read much about PHP5) but couldnt you set the superglobal to a var to make it easier to handle later on?
IE:
CODE
$registrate = $_GET['registrate'];
if(isset($registrate)) { ... body }
You can, but there's little point. Unless you're directly altering the value of $_GET['registrate'], there's no real reason, it is just one more variable the php internal table has to keep track of.
madeinukraine
Sep 4 2009, 03:38 PM
so i must rewrite all text?
Can i use my text that i allready write in this server?
Ed
Sep 4 2009, 03:40 PM
QUOTE(madeinukraine @ Sep 4 2009, 04:38 PM)
so i must rewrite all text?
Can i use my text that i allready write in this server?
You should rewrite it for portability, a lot of servers have register_globals off, those who have it on are behind the times.
madeinukraine
Sep 4 2009, 03:43 PM
how to write "<form....>"????
Ed
Sep 4 2009, 03:44 PM
QUOTE(madeinukraine @ Sep 4 2009, 04:43 PM)
how to write "<form....>"????
That remains the same, it's just the php you need to change, so any POST elements are $_POST['nameoffield'] and any GET elements are $_GET['nameoffield'], there's also a $_REQUEST which is either.
English - is foreign language for me... sorry but i ts to hurt Can you write little example by form with (only first line)???
i found some examples in russian languages but it doesnt work(((
Ed
Sep 5 2009, 01:42 AM
CODE
<?php if($_SERVER['REQUEST_METHOD'] == 'POST') { if(isset($_POST['name'])) { echo 'The name you have entered is: ', htmlspecialchars($_POST['name, ENT_QUOTES), "<br>\n"; } } ?>