WEB PHP Array

Discussion in 'OT Technology' started by quid, Sep 14, 2007.

  1. quid

    quid I Piss Excellence OT Supporter

    Joined:
    Aug 28, 2004
    Messages:
    50,352
    Likes Received:
    3
    Location:
    california
    so i have a form. can i load each input box in to an array then split up the array by a portion of the name of the input box?

    each input box has a link to a picture, each picture has a couple of links. i want to put all of the links to all of the pictures into one array, then be able to segregate the links by type.
     
  2. LEGbEND

    LEGbEND .

    Joined:
    Jun 26, 2001
    Messages:
    23,270
    Likes Received:
    6
    Location:
    Shitcago
    Like?
    Code:
    
    <form>
    
    <input type="text" name="fields[field1]" value="pants" />
    <input type="text" name="fields[field2]" value="dants" />
    
    </form>
    
    
    You know that all form fields are passed as $_POST array and that you can get the info for any field correlating to the "name" attribute?

    Code:
    
    <input type="text" name="pants" value="dants" />
    
    echo $_POST['pants'] would show "dants"
    
    
     
  3. quid

    quid I Piss Excellence OT Supporter

    Joined:
    Aug 28, 2004
    Messages:
    50,352
    Likes Received:
    3
    Location:
    california
    right i know that, the problem im running into is i dont know the entire name attribute (it's the result of another script being run) but i know part of it.

    the field names are for example

    variableLINK, variableHTML
    variable1LINK, variable1HTML
    variable2LINK, variable2HTML


    either way, i think i just figured a different way aroudn this problem
     

Share This Page