You are here: Re: conditional « PHP Language « IT news, forums, messages
Re: conditional

Posted by Christoph Burschka on 04/24/07 07:14

Geoff Berrow schrieb:
> Message-ID: <IffXh.124$F11.40@bignews1.bellsouth.net> from Art contained
> the following:
>
>
>>I'm trying to use a conditional statement for posting a form with php. The
>>problem i'm having is everytime I hit the submit button, i have to hit it a
>>second time to get the form to post. I've checked the variable $holdchk and
>>see that it's coming back as "0". Has anyone experienced this problem?
>
>
> Try
>
> <?php
>
> if ($holdchk == 1 ){
> echo "<form method=\"POST\" action=\"otherform.php\">";
> }
> else{
> echo "<form method=\"POST\" action=\"someform.php\">";
> }
>
> ?>

Yes, that's cleaner, but technically there's no reason why the two if's
shouldn't work the same way (at least for values 1 or 0 - the if-else of
course will do the "0" action for all values not equal to one).

However, the problem - having to click twice to get it to submit - is a
browser-side problem. It could be related to messy HTML code or broken
Javascript. But there's no way to tell without seeing the whole form.

--
cb

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация