WEB The form tag's action attribute

Discussion in 'OT Technology' started by Coaxsist, Dec 6, 2009.

  1. Coaxsist

    Coaxsist Re-create... Innovate

    Joined:
    Feb 11, 2008
    Messages:
    1,032
    Likes Received:
    0
    Is it possible to call more than 1 php script with a web url here?

    Something like:
    Code:
    <form method="post" action="http://www.domain.com/php/script1.php5","http://www.domain.com/php/script2.php5","http://www.domain.com/php/script3.php5>
    
    Thanks!
     
  2. Ricky

    Ricky █▄ █▄█ █▄ ▀█▄

    Joined:
    Jun 17, 2005
    Messages:
    38,767
    Likes Received:
    6
    i cant think of a way without multiple pages being opened

    hmm.
     
  3. fishbulb

    fishbulb Active Member

    Joined:
    Oct 29, 2001
    Messages:
    6,848
    Likes Received:
    4
    Location:
    md
    Just include/require the 2nd php script at the top of the php file the form is posted to, it will have access to the same $_POST/$_GET variables.
     
    Last edited: Dec 6, 2009
  4. Coaxsist

    Coaxsist Re-create... Innovate

    Joined:
    Feb 11, 2008
    Messages:
    1,032
    Likes Received:
    0
    Can I include every other script I need to as well as the 2nd one?
    edit: Seems like I'd be able to...
     
  5. Coaxsist

    Coaxsist Re-create... Innovate

    Joined:
    Feb 11, 2008
    Messages:
    1,032
    Likes Received:
    0
    That's what I thought, but thats just not an option.
     
  6. Insert Tokens

    Insert Tokens Making Cancer My Bitch OT Supporter

    Joined:
    Jan 12, 2006
    Messages:
    8,315
    Likes Received:
    70
    Location:
    Tasmania
    Or just post it to a single file that includes all the files you want.. roundabout way to do it, but lets you keep your files seperate if required.
     
  7. Coaxsist

    Coaxsist Re-create... Innovate

    Joined:
    Feb 11, 2008
    Messages:
    1,032
    Likes Received:
    0
    My immediate thought would be a .zip, and I know that can't be right. What extension? Do I need a certain program to save as that extension?
     
  8. Insert Tokens

    Insert Tokens Making Cancer My Bitch OT Supporter

    Joined:
    Jan 12, 2006
    Messages:
    8,315
    Likes Received:
    70
    Location:
    Tasmania
    If you want it submitted to these files:

    script1.php5
    script2.php5
    script3.php5


    Make a file called whatever.php with this in it:

    Code:
    <?
    include "script1.php5";
    include "script2.php5";
    include "script3.php5";
    ?>
    
    Then submit your forms to whatever.php

    :dunno:
     
  9. Coaxsist

    Coaxsist Re-create... Innovate

    Joined:
    Feb 11, 2008
    Messages:
    1,032
    Likes Received:
    0
    Hmmm, I'll try that. I just watched killerphp's php include tut vid and I've been wanting to try it.

    Thanks.

    edit: no "php" after the first "?" ?
     
  10. jvblackxj

    jvblackxj VW4Life

    Joined:
    Mar 14, 2003
    Messages:
    100
    Likes Received:
    0
    Some installs of php don't require the "php" after the <?

    You should be able to change the setting in the php.ini file, but be careful in there don't change any settings unless you know what you are doing.
     
  11. Coaxsist

    Coaxsist Re-create... Innovate

    Joined:
    Feb 11, 2008
    Messages:
    1,032
    Likes Received:
    0
    I don't. I'm a PHP nub right now. I'm assuming the latest version of php doesn't require it?
     
  12. fishbulb

    fishbulb Active Member

    Joined:
    Oct 29, 2001
    Messages:
    6,848
    Likes Received:
    4
    Location:
    md
    It's not a version thing, its a setting that is either turned on or off on the server.

    Short tags or short open tags.
    http://php.net/manual/en/ini.core.php

    If you create a somename.php file and put <?php phpinfo(); ?> inside of it, visiting that page will give you all sorts of useful info about the server config.
     

Share This Page