•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 427,376 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,989 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1336 | Replies: 22 | Solved
![]() |
•
•
Join Date: Mar 2008
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
i have a problem with my form. there are 2 button : a login and a register button . login but will redirect to welcome.php, register to register.php. i put the action in the form like this
<form name="login" method="post" action="welcome.php" >
the problem is both buttons turn me to welcome.php, how can i solve this ? thanks alot
<form name="login" method="post" action="welcome.php" >
the problem is both buttons turn me to welcome.php, how can i solve this ? thanks alot
•
•
Join Date: Mar 2008
Posts: 153
Reputation:
Rep Power: 1
Solved Threads: 19
You must close each form with </form> and make sure that one form is not within another.
Matti Ressler
Suomedia
Matti Ressler
Suomedia
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Suomedia - Dynamic Content Management
•
•
Join Date: Mar 2008
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
then, how can put the 2 button within a row ?
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 240
php Syntax (Toggle Plain Text)
<html> <body> <form method="post" name="test"> <input type="button" name="button1" value="login" onClick="javascript: document.test.action='login.php';document.test.submit();"><input type="button" name="button2" value="Register" onClick="javascript: document.test.action='register.php';document.test.submit();"> </form> </body> </html>
You can do it this way.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Mar 2008
Posts: 153
Reputation:
Rep Power: 1
Solved Threads: 19
And if the user has javascript turned off? Nothing happens, not good.
Your are far better to structure you page in such a way as to not depend on javascript.
Most login/register pages have form inputs for username and password for registered members, and a simple linked button to the registration page if the user is not registered:
Matti Ressler
Suomedia
Your are far better to structure you page in such a way as to not depend on javascript.
Most login/register pages have form inputs for username and password for registered members, and a simple linked button to the registration page if the user is not registered:
<html> <body> <form method="post" name="test" action='welcome.php';> <input type="submit" name="button1" value="login"><a href="register.php"><input type="button" name="button2" value="Register"></a> </form> </body> </html>
Matti Ressler
Suomedia
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Suomedia - Dynamic Content Management
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 240
If javascript is disabled, even the form validation/ajax wouldn't work.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Mar 2008
Posts: 153
Reputation:
Rep Power: 1
Solved Threads: 19
•
•
•
•
If javascript is disabled, even the form validation/ajax wouldn't work.
What Ajax? A well written script will function without either javascript or Ajax. A good example: http://holyculturedownload.com/
This is a heavily Ajaxed site. Turn off javascript and it is still functional - this allows it to have Google results like this and for users to still browse the site.
A form should not rely only on javascript for validation - the PHP side should also check the $_POST data.
Matti Ressler
Suomedia
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Suomedia - Dynamic Content Management
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 240
•
•
•
•
What Ajax? A well written script will function without either javascript or Ajax. A good example: http://holyculturedownload.com/
That unfortunately, didn't work in FF2 when I disabled javascript. Click on the "Listen" button to test. Strangely, even gmail's "send" button didn't work when I disabled javascript.
•
•
•
•
A form should not rely only on javascript for validation - the PHP side should also check the $_POST data.
Yes, ofcourse.
Last edited by nav33n : Mar 31st, 2008 at 2:19 pm.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Mar 2008
Posts: 153
Reputation:
Rep Power: 1
Solved Threads: 19
•
•
•
•
That unfortunately, didn't work in FF2 when I disabled javascript. Click on the "Listen" button to test. Strangely, even gmail's "send" button didn't work when I disabled javascript.
Now that is pedantic... the "listen" button is clearly a javascript/Ajax control. The point was that the SITE functions without javascript for the purpose of search engine indexing (which it does very well).... I dont believe that Googlebot listens to music
I think you will find that the signup page functions quite fine without Javascript (it does have it).
Similarly, forms should be designed not to be dependent on Javascript to accomplish their purpose. That Gmail fails for something so fundamental is surprising, but not acceptable.
Matti Ressler
Suomedia
Last edited by Suomedia : Mar 31st, 2008 at 3:39 pm.
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Suomedia - Dynamic Content Management
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- How can I refresh DataBase without closing Form Attached with my Coding (Visual Basic 4 / 5 / 6)
- To form a palindrome of a given string (C)
- C++ Coding :: First Ever (C++)
- Sending form email (PHP)
- Dialog Box alongwith Form (Visual Basic 4 / 5 / 6)
- php coding (PHP)
- Coding Ineternet Explorer StatusBar in .NET (ASP.NET)
- help - need coding for file attachment to a cgi file (Windows NT / 2000 / XP / 2003)
- cgi - pearl scripting (Windows NT / 2000 / XP / 2003)
Other Threads in the PHP Forum
- Previous Thread: Avoiding the same php page from opening in multiple windows
- Next Thread: Need help with PHP order form


Linear Mode