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


Groups > comp.lang.php > #18044

Re: Beginner question on using PHP and POST

From Martin Leese <please@see.Web.for.e-mail.INVALID>
Newsgroups comp.lang.php
Subject Re: Beginner question on using PHP and POST
Date 2019-08-24 12:35 -0600
Organization A noiseless patient Spider
Message-ID <qjs00u$s7e$1@dont-email.me> (permalink)
References <5d616255$0$31423$426a74cc@news.free.fr>

Show all headers | View raw


Dan Wissme wrote:
...
> 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

Perhaps I have misunderstood what it is you
are trying to do, but what is wrong with a
list of links?  The pages such as meat.html
already exist, so you know the list of links
to offer.

Something like:
<ul>
<li><a href="meat.html">Meat</a></li>
<li><a href="vegies.html">Vegies</a></li>
...
</ul>

Alternatively, put them in a <select> list.
Something like:
<form method="POST" action="...">
<p>
<select id="food">
<option value="meat.html">Meat</option>
<option value="vegies.html">Vegies</option>
...
</select>
<button type="button" onclick="displayPage();">Display page</button>
</p>
<form>

Writing the JavaScript function displayPage()
has been left as an exercise for Dan :-)

Neither approach comes anywhere near PHP; I
see no need for PHP.

-- 
Regards,
Martin Leese
E-mail: please@see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/

Back to comp.lang.php | Previous | NextPrevious in thread | Next 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