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 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2008
    Posts
    43
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Can I make this form do 2 actions on submit?

    hello

    I have the code here:

    <FORM action="index.php?step=2&amp;Count=<? $submitCount = $TotalCount + 50; print($submitCount); method=post><B>In Remembrance of:</B><BR><INPUT name=nume><BR>&nbsp;<INPUT type=submit value="Light a Candle" name=submit></CENTER></FORM></TD></TR></TABLE></SCRIPT></TD></TR></TABLE></CENTER>


    Basically the form is actioning the index.php file with some other bits of code, sorry I am new to this.

    What I would like to do is to have the form action say an index2.php file as well on submit.

    Kind regards

    Antony

  • #2
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    why dont you merge both bits of code?
    you could also pass info to index2.php then use header() to post the info and result back to index.php

  • #3
    New Coder
    Join Date
    Oct 2008
    Posts
    43
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi

    Thanks for the reply, could you possibly give me an example of what this would look like using my code? as I dont really know too much about coding at the moment.

    Thanks

    Antony

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    What I would like to do is to have the form action say an index2.php file as well on submit.
    You may just include the page index2.php, in your index.php, to execute it too.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    New Coder
    Join Date
    Oct 2008
    Posts
    43
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Here is some of the code from the index.php file:

    <?
    if($submit == "Search" || $yes == "yes")
    {
    print("");
    print("Search Result: ");
    $Query = "SELECT ID, Name FROM candle WHERE Name LIKE \"%$search%\" ORDER BY ID DESC";
    $DatabaseResult = MySQL_query($Query, $DatabaseLink);
    while($DatabaseRow = MySQL_fetch_object($DatabaseResult))
    {
    $id = $DatabaseRow->ID + 5;
    print("<a href=\"index.php?Count=$id\">$DatabaseRow->Name</a>");
    }

    if(MySQL_num_rows($DatabaseResult) == 0)
    {
    print("None found.");
    print("<a href=\"index.php?Count=$TotalCount\"></a>");
    }
    }else
    {

    ?>

    How would I include the index1.php file here, I have tried repeating the code with reference to the index1.php file but that causes an error. I think this is where the file is excited.

    Thanks

    Antony


  •  

    Posting Permissions

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