0

Hi,i have following code:

  if (!isset($_POST['submit']))
{

<form action="" method="post">
<input type="submit" name="submit"  value="Go"></input>
</form>
}
else
{
  if (!isset($_POST['submittwo']))
{

<form action="" method="post">
<input type="submit" name="submittwo"  value="Go"></input>
</form>
}
else
{
 }
}

As you can see first block of code it's ordinary form which submit to itself,and in else there is again same form.If i would put this

<

form action="bla.php" name="submittwo" value="Go"> in second block it is working,but i want to make it work without using external file same as first form it is.I know that can be done since i saw some scripts like phplitesql which are entirely coded in single file,and they have tons of forms in it.But code is a bit toocomplex for me to understood it so it would be good if someone know how to do that.

3
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by diafol
2

why make life difficult?
one form, one file, one other file called to do the submit (and validation)
second form, second file, second other file called to validate and submit.

This is SOOOO much simpler, safer and easier to write and troubleshoot than a more complex system, which you've just said you can't understand, so probably can't troubleshoot for errors!
KISS rules.

And if you can't write simple code, why look for a more complex solution???

Edited by drjohn: typo

0

Well very simple,because that is difference between simple and advanced programming,and once i learn it,i will be able to incorporate that to my coding philosophy.In shortly i want to learn how to store entire code into single file,because that way i believe script will execute much faster compared to case when multiple files is used and also less lines will be needed.Only disadvantage is a mess when you need to edit something,but with good documentation and pointers that problem can be solved.And also that script which i pointed is actualy very simple considering all features which it have but since it have 5000 lines it will take some time to figure out how it works.Here is url if you want to see:http://code.google.com/p/phpliteadmin/ or just type in google "one php file script" to see other examples.

0

You have totally misunderstood the purpose of the file you gave a link to!
It is an SQLite database administration tool!
It is NOT a script to process a form!!!

0

Lol,i didnt misunderstood anything,it served it's exact purpose,and that is to found out how to have multiple form submits in one file and i figured that out by reading source of that file.

Edited by LukaHorvatic

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.