Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #18048

Re: Beginner question on using PHP and POST

From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.php
Subject Re: Beginner question on using PHP and POST
Date 2019-08-26 09:27 +0200
Message-ID <gshfvaFl3tnU5@mid.individual.net> (permalink)
References <5d616255$0$31423$426a74cc@news.free.fr>

Show all headers | View raw


Dan Wissme:

> I write an HTML page foods.html containing a form like :
> 
> <form method="post" action="process.php">
>      <p><input type="text" name="food" id="food"></p>
>      <input type="submit" value="OK">
> </form>
> 
> 
> The purpose is to get from user the name of the food and open a web page 
> already existing about that food. The user may ask for 'meat' for 
> example. I will then open the web page meat.html
> 
> So I wrote a file "process.php" like that one :
> 
> <?php
> $food=htmlspecialchars($_GET["food"]);
> <--------- what then ?
> ?>
> 
> I tried echo, readfile, etc but got nothing...

Because you POST things you need $_POST[].


-- 
Arno Welzel
https://arnowelzel.de

Back to comp.lang.php | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Beginner question on using PHP and POST Dan Wissme <wissme@free.fr> - 2019-08-24 18:14 +0200
  Re: Beginner question on using PHP and POST "R.Wieser" <address@not.available> - 2019-08-24 18:47 +0200
    Re: Beginner question on using PHP and POST "R.Wieser" <address@not.available> - 2019-08-24 18:53 +0200
  Re: Beginner question on using PHP and POST Martin Leese <please@see.Web.for.e-mail.INVALID> - 2019-08-24 12:35 -0600
    Re: Beginner question on using PHP and POST Martin Leese <please@see.Web.for.e-mail.INVALID> - 2019-08-24 13:04 -0600
  Re: Beginner question on using PHP and POST Jeroen Belleman <jeroen@nospam.please> - 2019-08-24 23:59 +0200
  Re: Beginner question on using PHP and POST Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-08-25 01:31 +0100
  Re: Beginner question on using PHP and POST Arno Welzel <usenet@arnowelzel.de> - 2019-08-26 09:27 +0200

csiph-web