SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: form action

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question form action

    how can i change the form action dynamically suppose( temp.php,temp1.php,temp3.php)etc. in a press one submit button.
    Give me the idea anyone

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    You could set up a switch() function to control the action depending on an incoming variable.

    Can you explain how the form is going to be controlled?

    example switch:
    PHP Code:
    $action $_GET['action']; // action coming from a URL....

    switch($action) {
        case 
    'temp1' :
        
    $form_action 'temp1.php';
        break;
        case 
    'temp2' :
        
    $form_action 'temp2.php';
        break;
        case 
    'temp3' :
        
    $form_action 'temp3.php';
        break;
        default :
        
    $form_action 'temp.php';
        break;
    }

    echo 
    '<form name="myform" action="'$action .'" method="post" />';
    // etc 
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question form action

    it is working but first time clicking it is not possible,second time clicking it should go in specific page.

    how it is solve ?

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Can you tell us what you are trying to do and why? That way we can give you a better answer!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


Bookmarks

Posting Permissions

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