php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38771 string POST data are converted to int
Submitted: 2006-09-10 18:12 UTC Modified: 2006-09-10 19:02 UTC
From: satanas at tech-at dot be Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.4.4 OS: Apache 10336100
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: satanas at tech-at dot be
New email:
PHP Version: OS:

 

 [2006-09-10 18:12 UTC] satanas at tech-at dot be
Description:
------------
When submitting a form that contain a string value and defined as text, the POST variable is displayed as a integer.

When filling the form with a text, the POST value is 0, when filling the form with ex 1234, the POST value is 1234.

But strange is another form in the HTML page work perfectly

Reproduce code:
---------------
The Form that works:
<form name='shearch' id='shearch' action='/modules/mpmanager/contbox.php?op=sendbox&send=1&onglet=1' method='post'>
<table width='100%' class='outer' cellspacing='1'>
<tr><th colspan='2'>Trouver un utilisateur</th></tr>
<tr valign='top' align='left'><td class='head'>Recherche</td><td class='even'><input type='text' name='user' id='user' size='25' maxlength='50' value='' />
<input type='submit' class='formButton' name='submit'  id='submit' value='Trouver un utilisateur' />
</td></tr>
<tr valign='top' align='left'><td class='head'>Choix</td><td class='even'>Les mots cl?s de moins de 3 caract?res seront ignor?s
</td></tr>
</table>
</form>

The form that create the issue:
<form name='read' id='read' action='/modules/mpmanager/contbox.php?send=0' method='post'>
<table width='100%' class='outer' cellspacing='1'>
<tr><th colspan='2'>Ajouter un Contact</th></tr>
<tr valign='top' align='left'><td class='head'>Contact(s)</td><td class='even'><input type='text' name='to_userid' id='to_userid' size='25' maxlength='50' value='' />
&nbsp;S?parer par une , Maximum 3 Utilisateur(s)
</td></tr>
<tr valign='top' align='left'><td class='head'></td><td class='even'><input type='reset' class='formButton' name='reset'  id='reset' value='Vider' />
<input type='submit' class='formButton' name='post_messages'  id='post_messages' value='Soumettre' />
</td></tr>
</table>


Expected result:
----------------
on the form that create the issue

if mhm is submitted

to_userid=mhm (string(3))
post_messages= Soumettre (string(9))

Actual result:
--------------
on the form that create the issue

if mhm is submitted

to_userid=0 (int(0))
post_messages= Soumettre (string(9))

if 1234 is submitted

to_userid=int(1234)
post_messages= Soumettre (string(9))

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-10 18:20 UTC] satanas at tech-at dot be
Here is a trace of the Ip packet transmitted

Transmission Control Protocol, Src Port: 3470 (3470), Dst Port: http (80), Seq: 1468, Ack: 15177, Len: 108
    Source port: 3470 (3470)
    Destination port: http (80)
    Sequence number: 1468    (relative sequence number)
    Next sequence number: 1576    (relative sequence number)
    Acknowledgement number: 15177    (relative ack number)
    Header length: 20 bytes
    Flags: 0x0018 (PSH, ACK)
    Window size: 4984
    Checksum: 0x4af3 [correct]
Hypertext Transfer Protocol
    Content-Type: application/x-www-form-urlencoded\r\n
    Content-Length: 37\r\n
    \r\n
Line-based text data: application/x-www-form-urlencoded
    to_userid=mhm&post_messages=Soumettre
 [2006-09-10 18:27 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2006-09-10 18:59 UTC] satanas at tech-at dot be
Quite difficult to have the script side, this issue is coming from a module of Xoops CMS, and I've got no other issues with others forms, either no issue with the second form included in the page.
If needed, I can create an access to the page that create the issue, a var_dump($POST) has been added to the PHP page to display the result.
 [2006-09-10 19:02 UTC] tony2001@php.net
We can't fix something we're unable to reproduce.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 14:01:31 2025 UTC