Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2007
    Posts
    91
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question How to send array from one form to another?

    Hi,
    I've an array $streams[] and i need to send this array to next page on submit button click. I'm trying to capture this array in the next page but with no luck, need help in this matter. Please


    Code:
    <form name="stream_selection" enctype="multipart/form-data" method="post" action="selected_streams.php">
    Code:
    <input name=streams type=hidden value=$streams[]>
    Receiving the array in the next page as follows:

    Code:
    $stream[]=$_REQUEST['streams'];
    for($i=0;$i<1000;$i++)
    {
       echo "$stream[i]<br>";
      
    }
    A blank page is displayed!


    Thanks,
    Ramki.

  • #2
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Location
    C:\Windows\System32
    Posts
    1,018
    Thanks
    19
    Thanked 9 Times in 9 Posts
    <input name=streams type=hidden value=$streams[]>
    Is this statement inside the php tags if not use

    Code:
    echo "<input name=streams type=hidden value=$streams>";
    Please de-reputate me
    © 0o0o0o0

    Its better to rule in Hell then to serve in Heaven

  • #3
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    is $streams an array in php? then u gotta use

    PHP Code:
    foreach ($streams as $s) {
      echo 
    '<input name="streams[]" type=hidden value="' $s '">';

    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #4
    New Coder
    Join Date
    Oct 2007
    Posts
    91
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by shyam View Post
    is $streams an array in php? then u gotta use

    PHP Code:
    foreach ($streams as $s) {
      echo 
    '<input name="streams[]" type=hidden value="' $s '">';

    Thanks Shyam. How to access on the receiving page?

    /Ramki


  •  

    Posting Permissions

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