For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > January 2008 > forms and method POST - variables









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author forms and method POST - variables
Lukáš Moravec

2008-01-09, 7:02 pm

Hi,

I have one question about forms and php (which I use for Mysql too).

Do I need for variables from any form in html and method POST (then in php
script) to set these variables with:

$variable=$_POST['variable'];



For example:

<html>

<head>

<title> FORM</title>

</head>

<body>

<form action="do_something.php" method="POST">

Input something

<br>

<input type="text" name="variable">

<input type="submit" value="submit">

</FORM>

</body>

</html>



And then.in do_something.php



<html>

<head>

<title>DO SOMETHING</title>

</head>

<body>

<?php

$variable=$_POST['variable'];

echo "<br><b>Variable: </b>".$variable;

?>

</body>

</html>



Because I got some old scripts where I don´t have this setting.they worked
on MS Win2000 - PWS and PHP 4.0 but now - with apache 2.2.6, PHP 5.2 on WIN
XP it doesn´t work.



Thank you for any advice.



Lukas


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com