Hi
One little question.
I've got 3 forms made for searching some data on one web page.
First submit button name is Submit
Second submit button name is Submit1
Third submit button name is Submit2
all three forms action is:
<form method=post action="result.php">
In page "result.php" should be results of serching.
How to determine witch Submit button has submited criteria for searching.
Each Submit button submits diferent criteria to search dataWhat exactly do you mean, and what is inside results.php, and could you be more specific about this criteria, it would helpa lot if we know what the situation is. And where does results.php get the datat from? Sgould it display data depening on which form submits it? Tell us, what exactly are yuo trying to achive with this?It should display data depening on which form submits criteria.
Should it be something like:
if ($submit == "Submit")
{
// code for editing database
} elseif ($submit =="Submit1")
{
//code for updating records
}elseif ($submit == "Submit2")
{
//code for deleting records
} else
{
echo "I have no idea what I should be doing.";
}
I don't get it
Should "Submit" be name="Submit" or value="Search"
part of form that submits
<input type="submit" name="Submit" value="Search">ok, now I get what your trying to say, well I think yuo should use a hiden field instead of the submit button and elclose it in a form. like this
<input type='hidden' name='submit' value='submit1'>
So in the php you call it like this
if ($submit == "Submit")
{
// code for editing database
} elseif ($submit =="Submit1")
{
//code for updating records
}elseif ($submit == "Submit2")
{
//code for deleting records
} else
{
}
wihout any problem, you can change the name of the hidden field and then the name &submit will have to be changed. This way, you just change the value of the hidden field.[
One little question.
I've got 3 forms made for searching some data on one web page.
First submit button name is Submit
Second submit button name is Submit1
Third submit button name is Submit2
all three forms action is:
<form method=post action="result.php">
In page "result.php" should be results of serching.
How to determine witch Submit button has submited criteria for searching.
Each Submit button submits diferent criteria to search dataWhat exactly do you mean, and what is inside results.php, and could you be more specific about this criteria, it would helpa lot if we know what the situation is. And where does results.php get the datat from? Sgould it display data depening on which form submits it? Tell us, what exactly are yuo trying to achive with this?It should display data depening on which form submits criteria.
Should it be something like:
if ($submit == "Submit")
{
// code for editing database
} elseif ($submit =="Submit1")
{
//code for updating records
}elseif ($submit == "Submit2")
{
//code for deleting records
} else
{
echo "I have no idea what I should be doing.";
}
I don't get it
Should "Submit" be name="Submit" or value="Search"
part of form that submits
<input type="submit" name="Submit" value="Search">ok, now I get what your trying to say, well I think yuo should use a hiden field instead of the submit button and elclose it in a form. like this
<input type='hidden' name='submit' value='submit1'>
So in the php you call it like this
if ($submit == "Submit")
{
// code for editing database
} elseif ($submit =="Submit1")
{
//code for updating records
}elseif ($submit == "Submit2")
{
//code for deleting records
} else
{
}
wihout any problem, you can change the name of the hidden field and then the name &submit will have to be changed. This way, you just change the value of the hidden field.[