Jump to content

HTML form Array is not working in PHP

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
phplover

phplover

    Newbie

  • Members
  • Pip
  • 2 posts
Dear Friend,

Please help..

I have very serious issue in HTML form array.

I want to use Code as follows
<input type="text" name="myname[]">

<input type="text" name="myname[]">

<input type="text" name="myname[]">

array of Text elements in HTML and need to be handled in PHP.
To retrieve values via following PHP code
<?php

	print "<pre>";

	print_r($_POST);

	print "</pre>";

?>

but this works on one sever but not on other (Please Correct URLs - I used it wrong way to misguide parser to preventing me urls)
Go Here w-ww . shantiwebsolution.com/test.php
Give some input and submit. You will see PHP output
BUT
htt-ps : / / 66.223.111.17:8443/sitepreview/http/together-ware.com/test.php
Give some input and submit. You will not see out put.

Please Advise if any configuration setting are required to be edited.

I have posted complete Code below for above sample urls.


<?php

	print "<pre>";

	print_r($_POST);

	print "</pre>";

?>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

</head>


<body>

<form id="form1" name="form1" method="post" action="">

  <input type="text" name="textfield[]" />

  <input type="submit" name="Submit" value="Submit" />

</form>

<p> </p>

<p><a href="phpinfo.php">Click here to see php info</a></p>

</body>

</html>




#2
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
I get a "connection untrusted" when I visit your web site.


I run your code on my computer and get this as output:

Quote

Array
(
[textfield] => Array
(
[0] => 5
)

[Submit] => Submit
)

Perhaps, you don't have PHP set up correctly? Or, you put the code in a .html file instead of .php?

#3
phplover

phplover

    Newbie

  • Members
  • Pip
  • 2 posts
Hi chili5,

thanks for your quick response.

Yes you are true. code is working nice in local computer as well as on one server (shantiwebsolution) but for (66.223.111.17) server code is not working properly.

Yes I am also 100% sure about php setting but not sure about which php setting is not working.

do you have any other advise?

Thanks