Sending Data to a PHP Page

qah661

Baseband Member
Messages
40
I want to know, how can I (if it is possible) send data through a web request to a php page. For instance, when I connect to my php page, how can I pass a letter or number, and let the page recive and store it?

Please let me know,
Thanks :)
 
if its form data then all you would need is $_REQUEST['VarName']; on the php page to get that data, to store it use sessions, cookies or a database.
 
You could do:
yourpage.php?letter=l

and retrieve it by:
PHP:
<?php
$letter = trim($_GET['letter']);
?>

If that's what your trying to do.. Or you could you a POST and access it by:
PHP:
<?php
$post = trim($_POST['letter']);
?>

I would reccomend the first option and would probably replace the trim with a custom security function e.g.:
PHP:
function secure($var) {
if($var == '') {
echo 'Hmm... Var is empty!';
} else {
$var = mysql_real_escape_string($var);
return $var;
?>

I wouldn't do what RAZOR said becuase request is POST and GET and that could open the website up to hackers if not secured tightly.
 
Back
Top Bottom