• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Prob Submitting array thru form

F

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

<?php

if ( isset($_POST['doit'])Or isset($_GET['doit'])){
echo"var_dump() is: <br>";
$Formfield = $_POST['Formfield'];
var_dump($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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>M-array test</title>
</head><body>


<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" />


</form>
<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" } }

</body>
</html>


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

thanks
regards,
frustrated

PS I am aware that register_globals is off and use $_POST to access the array sent from the form
 
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.
 
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
 
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:

"https://host.serverdomain.com:8443/sitepreview/www.userdomain.com/test.php"

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.

-d
 
Back
Top