473,396 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Form submission fills form values with garbage

Hey all,

I'm attempting to do some form processing on a server that has
register_globals off, however, I've run into a confusing situation and
need some help.

Basically, the form is a multi-part/form-data form as I have it upload
a file in addition to submit a number of other fields, but the error I
have occurs even when no upload is done.

When I submit the form, all my input field variables get filled with
garbage. Here's the html before submission for one of the fields:

<FORM name="product" action="product.php?mode=add" method="post"
encType="multipart/form-data">
<INPUT type=hidden value=100000000 name=MAX_FILE_SIZE>
Product Name: <INPUT VALUE=<? print ("\"$productname\""); ?> size=30
name=productname>

The form submits to itself and does some error checking, but to try to
figure this out, I print the variable from the form submission before
my code even touches it at the top of the page and it's garbage.

echo $_POST["productname"];

To see an example of all the garbage my fields get, you can look at
http://www.ratlhead.com/php.gif And the garbage there changes...it's
random. You can see my echo statement that I do right before doing
any PHP stuff.

I'm totally confused, as I had this code working on another server,
but not on this one. And I'm guessing something to do with the PHP
enviroment is the problem.

Any input would be appriciated! Thanks!
Jul 17 '05 #1
5 3420
ra******@ratlhead.com (ratlhead) schrieb:
Product Name: <INPUT VALUE=<? print ("\"$productname\""); ?> size=30
name=productname>

The form submits to itself and does some error checking, but to try to
figure this out, I print the variable from the form submission before
my code even touches it at the top of the page and it's garbage.
Try

Product Name: <INPUT VALUE="<?php echo($productname); ?> size="30"
name="productname">

I'm totally confused, as I had this code working on another server,
but not on this one. And I'm guessing something to do with the PHP
enviroment is the problem.


Please give us the versions of PHP on both servers.

Regards,
Matthias
Jul 17 '05 #2
Matthias Esken <mu************@usenetverwaltung.org> wrote in message news:<bk*********@usenet.esken.de>...
Try

Product Name: <INPUT VALUE="<?php echo($productname); ?> size="30"
name="productname">

Please give us the versions of PHP on both servers.

Regards,
Matthias


I tried what you mentioned and still get the problem. Both PHP
versions are 4.3.3

I know it sounds totally whack that randomly that form works and other
times it doesn't, but that's how it's been going when I don't touch
the code and submit the form blank. Someone suggested maybe it's the
default charset in the php.ini file, but that's not the case.

I know none of that is much help, but I'm not sure what else to say
without posting the whole file, which I don't really think is
necessary.

Thanks for the help and suggestion!
Jul 17 '05 #3
> I know none of that is much help, but I'm not sure what else to say
without posting the whole file, which I don't really think is
necessary.

Thanks for the help and suggestion!


Is it always YOU who submit the data? i ran into a similar
trouble when people using MACs submitted their Data. Totaly
confusing characters came along.

regards

timo

Jul 17 '05 #4
ra******@ratlhead.com (ratlhead) wrote in message > > Try

Product Name: <INPUT VALUE="<?php echo($productname); ?> size="30"
name="productname">


for what it's worth, you're missing the closing value paren ( should
be one after '?>') which probably results in different problems.

Product Name: <INPUT VALUE="<?php echo $_POST['productname']; ?>"
size="30" name="productname">

What is the value that you entered in your screen cap? was it
"body"something?

Occasionaly I get strange transfers when my server is heavily
loaded...
Jul 17 '05 #5
"ratlhead" <ra******@ratlhead.com> wrote in message
news:fd**************************@posting.google.c om...
Hey all,

I'm attempting to do some form processing on a server that has
register_globals off, however, I've run into a confusing situation and
need some help.

Basically, the form is a multi-part/form-data form as I have it upload
a file in addition to submit a number of other fields, but the error I
have occurs even when no upload is done.

When I submit the form, all my input field variables get filled with
garbage. Here's the html before submission for one of the fields:

<FORM name="product" action="product.php?mode=add" method="post"
encType="multipart/form-data">
<INPUT type=hidden value=100000000 name=MAX_FILE_SIZE>
Product Name: <INPUT VALUE=<? print ("\"$productname\""); ?> size=30
name=productname>

The form submits to itself and does some error checking, but to try to
figure this out, I print the variable from the form submission before
my code even touches it at the top of the page and it's garbage.

echo $_POST["productname"];

To see an example of all the garbage my fields get, you can look at
http://www.ratlhead.com/php.gif And the garbage there changes...it's
random. You can see my echo statement that I do right before doing
any PHP stuff.

I'm totally confused, as I had this code working on another server,
but not on this one. And I'm guessing something to do with the PHP
enviroment is the problem.

Any input would be appriciated! Thanks!


I'll throw in my two pence worth...

first... have you tried createing another form, something basic that has two
boxes in it for example, and then seeing if you can post the data
successfully on your own server?

secondly... I'm just trying to be helpful here... but what you could do is
change the action on your server to post it to mine... I'll leave it up for
a day but you could change it to something like <FORM
ACTION=http://www.wiredwords.net/phpinfo.php METHOD=POST> and see the
result... Its not a full PHP info, it just dumps POST, GET and REQUEST data
in to a table... if it turns up corrupted there then it might be client
related... at least it should help you get one step closer to resolveing the
problem...

I'll disable the script within 24hours unless you email me otherwise... you
can email me at
randelld
at
fiprojects
dot
com

cheers
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Robin | last post by:
Ok, I have a form that on clicking of the Update button first updates the specific record in the db, then Inserts if the vMemo field is not empty. The problem that I'm having is that After...
2
by: Logical | last post by:
I have a form which houses basic inputs, as well as a few multiple select forms. I need to parse all the 'values' which are in this multiple select form (it gets manipulated dynamically client...
16
by: lawrence | last post by:
I was told in another newsgroup (about XML, I was wondering how to control user input) that most modern browsers empower the designer to cast the user created input to a particular character...
3
by: Jack | last post by:
Hi, I have a asp input form of a financial report. Here most of the fields are text boxes where the user need to input the values corresponding to an item. However, there are few items which are...
10
by: Steve Benson | last post by:
Our regular programmer moved on. I'm almost clueless in Javascript/ASP and got the job of adapting existing code. In the page below, everything works until I added the function checkIt() to...
3
by: User | last post by:
Form A (Main) Text Box 1 Text Box 2 Text Box 3 Form B (Pop-up) Choose a selection for Form A/Text Box 3 Scenario:
6
by: brettev | last post by:
World, I work at a university where the professors have a system to input grades for assignments and calculate final grades, which is output to an excel file. they are then required to get on a...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
2
by: anusha.vempati9 | last post by:
Hi All, I am calling a cgi file from a perl module. The cgi file contains the HTML form and some HTML fields(like check boxes). In my logic, I am trying to submit the form and calling the same...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.