Click to See Complete Forum and Search --> : Requesting variables


Webskater
08-05-2005, 11:04 AM
Sorry, basic question. A friend has built a site and where it is hosted he can use .php pages. He needs to get at some form variables. I use asp so can't help him. On an asp page I would write:

<%
FirstName = Request.Form("FirstName")
%>

Can anyone tell me the php equivalent (and for getting variables out of a querystring).

Cheers

bokeh
08-05-2005, 11:23 AM
<?php
$FirstName = $_REQUEST['FirstName'];
?>

scrotaye
08-05-2005, 03:03 PM
$_REQUEST does not specify where the data is coming from.. so it could come from $_SERVER, $_SESSION, $_COOKIE, $_POST, $_GET

A more secure way of requesting the data is:

$name = $_POST['name'];
// or
$name = $_GET['name'];

bokeh
08-05-2005, 04:35 PM
$_REQUEST does not specify where the data is coming from.. so it could come from $_SERVER, $_SESSION, $_COOKIE, $_POST, $_GET

A more secure way of requesting the data is:

$name = $_POST['name'];
// or
$name = $_GET['name'];


The original used REQUEST and that is why I have used it.