Q qah661 Baseband Member Messages 40 Feb 8, 2008 #1 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
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
R RAZ0R1 Solid State Member Messages 13 Feb 8, 2008 #2 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.
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.
David Lindon Golden Master Messages 15,233 Feb 10, 2008 #3 You can pass it via the query string ?var=value Is that what you meant?
M McTrAyN In Runtime Messages 221 Feb 24, 2008 #4 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.
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.