Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   a basic question about using forms in html file (http://www.programmingforums.org/showthread.php?t=10919)

boraciner Aug 2nd, 2006 8:38 AM

a basic question about using forms in html file
 
I'm not experianced in php this is why ,I have a question about using forms..
When I put two form actions (<forma action> .. </form> ) in a html file.. Although I press the second's button ,It moves to first php file using first form action ..

How can I do it ?
is using two "form action" in a html file true?

Thanks a lot ..

DaWei Aug 2nd, 2006 9:11 AM

Perhaps you could show some real code?

big_k105 Aug 2nd, 2006 10:07 AM

if you have it setup like this

[html]<form action="somefile.php?do=firstForum" method="POST">
<input type="submit" />
</form>

<form action="somefile.php?do=secondForm" method="POST">
<input type="submit" />
</form>[/html]

When it goes into the php file it should go to the place where your looking for $_REQUEST['do'] is equal to secondForm and not to the part that is looking for firstForm. Other then that I really can't help much until you show us the code you are using, that isn't working.

boraciner Aug 3rd, 2006 2:22 AM

Ok.. I'll write the original code here ..

boraciner Aug 3rd, 2006 3:00 AM

:

<form action="first.php">
<input type="text" name="a" >
<input type="submit" value="submit" name="submit">
</form>


<form action="second.php">
<input type="text" name="b" >
<input type="submit" value="submit" name="submit">
</form>



because of being deleted I wrote the codes as I remmember. It should have been like this...

Is there any mistake?

DaWei Aug 3rd, 2006 7:55 AM

That works. Personally, I wouldn't name my submit buttons the same, but that's just me. Perhaps you're not describing your problem correctly. The quality of your answers is going to depend on the quality of your question. "The code that didn't work MIGHT have been this" doesn't really hack it. Your method is by default, GET, not POST.

boraciner Aug 3rd, 2006 9:36 AM

ok.. you're right It works.. I tried on my laptop a few days ago but It didn't work.. I'm using my desktop now..
thank you

I guess ,apache server on my laptop doesn't work correctly

boraciner Aug 3rd, 2006 10:15 AM

I tried these codes on my laptop again.. It didn't work again .. how can I change php.ini file ?
what should I do to work this code?

DaWei Aug 3rd, 2006 10:44 AM

I don't know, I'm not sitting in your chair. Have you considered running a diff on your various .ini files?

EDIT: Please do not PM me with a copy of your post. Private solutions defeat the purpose of the forum.

boraciner Aug 3rd, 2006 12:19 PM

ok.. thank u.

have a nice day..


All times are GMT -5. The time now is 12:52 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC