Professional Web Applications Themes

Form submission fills form values with garbage - PHP Development

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 ...

  1. #1

    Default 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
    [url]http://www.ratlhead.com/php.gif[/url] 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!
    ratlhead Guest

  2. #2

    Default Re: Form submission fills form values with garbage

    [email]ratlheadratlhead.com[/email] (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
    Matthias Esken Guest

  3. #3

    Default Re: Form submission fills form values with garbage

    Matthias Esken <muelleimer2003usenetverwaltung.org> wrote in message news:<bku5e9.o0.1usenet.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 cht 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!
    ratlhead Guest

  4. #4

    Default Re: Form submission fills form values with garbage

    > 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

    Timo Henke Guest

  5. #5

    Default Re: Form submission fills form values with garbage

    [email]ratlheadratlhead.com[/email] (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...
    BKDotCom Guest

  6. #6

    Default Re: Form submission fills form values with garbage

    "ratlhead" <ratlheadratlhead.com> wrote in message
    news:fd9c5ab3.0309241539.5ec6e27aposting.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
    > [url]http://www.ratlhead.com/php.gif[/url] 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?


    Randell D. Guest

Similar Threads

  1. Submission Form?
    By withhisstripes in forum Macromedia Dynamic HTML
    Replies: 3
    Last Post: August 22nd, 07:12 PM
  2. Submission Form
    By withhisstripes in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: July 19th, 07:17 PM
  3. multiple form submission
    By sasquatch72 in forum Dreamweaver AppDev
    Replies: 0
    Last Post: March 27th, 06:35 AM
  4. Populate form values based on previous same form fields
    By Rizyak in forum PHP Development
    Replies: 2
    Last Post: June 11th, 04:27 PM
  5. Form Auto Submission
    By lawrence in forum PHP Development
    Replies: 3
    Last Post: July 10th, 09:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139