|
|
 |
Re: FN-FORUM: Stupid question
date posted 3rd October 2006 17:19
[EMAIL REMOVED] wrote:
> I was wrong it still doesn't work..
>
> I have
>
> title="Update the Booking" onClick="JavaScript: return validate_form();">
> title="Delete the Booking">
>
> and I am using
>
>
> if ($_POST['Delete'] !== "" & trim($_POST['Delete']) == "Delete Booking") {
>
>
> I have also tried various other combinations.
>
>
>
> if ($_POST['Delete'] !== "") {
>
> goes into that bit of code even though I haven't posted the form
>
>
I think the first method should work if you use "and" or "&&" (logical
operators) instead of just "&" (bitwise operator, which doesn't do what
you want here).
The second method doesn't work because an empty string "" is not the
same as an unset value, which is what you get if Delete doesn't exist in
the $_POST array at all. Instead, try:
if (isset($_POST['Delete'])) {
Dave
|
 |
|