You are here: Re: Cannot use "-" in variable names? « PHP Programming Language « IT news, forums, messages
Re: Cannot use "-" in variable names?

Posted by Malcolm Dew-Jones on 12/09/05 21:49

Justin Koivisto (justin@koivi.com) wrote:

: Kim Andrι Akerψ wrote:
: >
: > You can safely use "_" (underscore) instead. If you need to use it in a
: > query string or form field, use $_POST, $_GET or $_REQUEST.

: - characters in those arrays are replaced by _ automagically...

There must be a config setting to do that, cause I have never observed
that behaviour. The following uses - in the html parameter names.


<?php

echo "the-name = [";
echo $_REQUEST['the-name'];
echo "]\n";


echo "hidden-name = [";
echo $_REQUEST['hidden-name'];
echo "]\n";

?>

<form>

<input type="text" name="the-name" />

<input type="hidden" name="hidden-name" value="a hidden value" />

<input type=submit />

</form>

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация