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


Groups > comp.lang.php > #18042

Re: Beginner question on using PHP and POST

From "R.Wieser" <address@not.available>
Newsgroups comp.lang.php
Subject Re: Beginner question on using PHP and POST
Date 2019-08-24 18:47 +0200
Organization Aioe.org NNTP Server
Message-ID <qjrpnf$52c$1@gioia.aioe.org> (permalink)
References <5d616255$0$31423$426a74cc@news.free.fr>

Show all headers | View raw


Dan,

Two things:

> $food=htmlspecialchars($_GET["food"]);

You are POSTing, but are inspecting the $_GET array ?  No wonder you do not 
get anything (see what I did there ? :-) )

Suggestion: Try to inspect the $_POST array instead.

Some info: https://www.php.net/manual/en/reserved.variables.post.php

> I tried echo, readfile, etc but got nothing...

Correction, you did not /see/ anything.

Next time when you are not sure what, or even if you should see anything 
delimit the output with a few know characters.   My favorites are the square 
brackets:

echo "[". $food ."]"

Maybe throw in a carriage-return and linefeed for good measure too:

echo "[". $food ."]\r\n"

remark: Apologize for any errors or glaring omissions - I'm a PHP novice 
myself too. :-)

Regards,
Rudy Wieser

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