Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
HTML form Array is not working in PHP
Old 09-08-2009, 05:29 AM HTML form Array is not working in PHP
Novice Talker

Posts: 6
Trades: 0
Dear Friend,

Please help..

I have very serious issue in HTML form array.

I want to use Code as follows
Code:
<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 Code:
<?php
    
print "<pre>";
    
print_r($_POST);
    print 
"</pre>";
?>
but this works on one sever but not on other
Go Here http://www.shantiwebsolution.com/test.php
Give some input and submit. You will see PHP output
BUT
https://66.223.111.17:8443/siteprevi...e.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.

Code:
<?php
    print "<pre>";
    print_r($_POST);
    print "</pre>";
?>
<!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>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>&nbsp;</p>
<p><a href="phpinfo.php">Click here to see php info</a></p>
</body>
</html>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
phpboy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-08-2009, 05:50 AM Re: HTML form Array is not working in PHP
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You need to use foreach to display each one of the keys and their associated values

http://us.php.net/manual/en/reserved...post.php#88433
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-08-2009, 07:43 AM Re: HTML form Array is not working in PHP
Novice Talker

Posts: 6
Trades: 0
Hi chrishirst,
thanks for your quick reply.

foreach is not working too. I have tried it.

Actually this should work but it works on one server (shantiwebsolution) but not working for another one (66.223.111.17)

Please Advise.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
phpboy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to HTML form Array is not working in PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31097 seconds with 12 queries