1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Prob Submitting array thru form

Discussion in 'Plesk for Linux - 8.x and Older' started by face2six, Nov 8, 2005.

  1. face2six

    face2six Guest

    I am a developer dealing with migrating a stie to HOST using PLESK 7.4

    For some reason the HOST admin is unable/incapable of setting up the PHP correctly

    or is it that PLESK just hoses it from the start. I dunno

    All I know is i can not properly submit an array thru a form

    here is a simple test code that works on every other PHP linux box I use and it works fine on all but not on the PLESK server


    if ( isset($_POST['doit'])Or isset($_GET['doit'])){
    echo"var_dump() is: <br>";
    $Formfield = $_POST['Formfield'];
    echo $_POST['word'];
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>M-array test</title>

    <br />
    <form action="arraytest.php" method="post" enctype="multipart/form-data" >

    <input type="hidden" name="Formfield[parentarray][index0]" value="a">
    <input type="hidden" name="Formfield[parentarray][index1]"value="b">
    <input type="hidden" name="Formfield[parentarray][index2]" value="c">
    <input type="hidden" name="Formfield[parentarray][index3]" value="d">
    <input type="hidden" name="word" value="string">
    <input name="doit" type="submit" value="doit" />

    <br /><br />

    when submitted the var_dump() should be:<br />
    array(1) { ["parentarray"]=> array(4) { ["index0"]=> string(1) "a" ["index1"]=> string(1) "b" ["index2"]=> string(1) "c" ["index3"]=> string(1) "d" } }


    So try it out on your own PLESK. See if it works, If so please let me know how you set it up so I can straighten this **** out


    PS I am aware that register_globals is off and use $_POST to access the array sent from the form
  2. tmonsen

    tmonsen Guest

    I tried you code on a couple of accounts on my server. The program ran without a problem. I am using the latest yum install of php from http://www.atomicrocketturtle.com. The instructions for setting up the yum channels can be found on the site. You also might try posting a phpinfo() page (or at least a php, plesk, and os versions that you are using) as well as any errors that you are receiving. With additional information one of the members may be able to help you additionally.
  3. face2six

    face2six Guest

    Thanks for the reply

    the issue has NOT been resolved but thanks to the PLESK server's admin's efforts the underlying problem has been discovered. It is neither a problem with the code nor the way the PLEsk server was set up. but rather an issue with a redirect that was set up prior to my involvement with the project.

    screwy project makes for screwy bugs
  4. devenson

    devenson Guest

    Actually the problem had nothing to do with a "redirect", per se. This user's root A and www records are pointing to another server entirely, so he was addressing the site with the built in preview function like so:


    This works fine as long as you're not doing anything with php that requires overrides in vhost.conf. PHP correctly does not accept directives from an HTTP request that is not structured as indicated in the vhost.conf file.