You are here: Using octal number from user input « PHP « IT news, forums, messages
Using octal number from user input

Posted by Bob on 10/02/12 11:06

Hi there,

I'm have trouble using numeric user input specified in octal (first digit of
0). It keeps getting interpreted as a decimal number.

User enters 040 in field uinput on form

print $_POST['uinput'] * 2;

output is 80, not 100

Any insight appreciated. Do I need to assign the value a variable first?
What I want to do is accept input as either decimal, hexadecimal or octal as
the user prefers.

I am using php version 4.3.10 but want to be compatible with 4.1.0

-Bob

 

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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация