View Full Version : Can I make this form do 2 actions on submit?

09-18-2009, 10:38 AM

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


Phil Jackson
09-18-2009, 10:47 AM
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

09-18-2009, 11:13 AM

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.



09-18-2009, 11:30 AM
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.

09-18-2009, 12:05 PM
Here is some of the code from the index.php file:

if($submit == "Search" || $yes == "yes")
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>");


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.