php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16573 Accessing Data from HTML page using post method
Submitted: 2002-04-12 13:31 UTC Modified: 2002-04-12 13:34 UTC
From: afagundes at slb dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.1.2 OS: Win95 WinNT4.0
Private report: No CVE-ID: None
 [2002-04-12 13:31 UTC] afagundes at slb dot com
Ok, i'm trying to access data from a html page using the method post and php file. It works perfectly, but usually a have problems with the variable names.
For example, i have a text field in a html page and i want to pass the information typed in that text field to a php file, because i need to manipulate this data from the text field. That text field i called tf_project the html page index.html and the php file script.php.
Ok, when i click on the html button to pass the data I'm supposed to be capable to access the data just accessing the $tf_project variable in the php script that the post method called. The method post you can invoke using the html tag in html file like that:
<form name="form1" method="post" action="../php/script.php">
Then, the problem that i'm reporting is, in the php script the  $tf_project variable value is empty, but it's supposed to store the value passed from the html text field. If i change the text's field name to textproject and try to access the value again in the php script using now $textproject it works. I tough it was a php limitation with the "_" character to name variables, but in another situation i was using text filed name =  project and php variable $project, then i had the same problem again, i just changed the names to title1 and $title1 and my php script worked perfectly!!
I'm using the php4.1.1 and win95 for development, i executed the same test in winnt and with php4.1.2 in the both operational systems, the same problem occurred again.
I made these simple examples just to verify the same problem that i always have in my php applications when i use html and php.
If it is not a bug  could you tell me if is there a php limitation when you name a variable in a php script? it's really hard expend 3 hours to discover that your script works perfectly and the problem is the variable name!!
Thanks,
Adriano

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-12 13:34 UTC] sander@php.net
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 12:01:28 2024 UTC