473,782 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to submit multiple form on single submit button with different actions

3 New Member
I am trying to login for website with autologin to forum,and vcalender
its work fine in mozilla and ie but it gives problem in safari(IN MAC)

following is the code

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. if(isset($_POST['btnsubmit']))
  4. {
  5. //echo "<pre/>";
  6. //print_r($_POST);
  7.  
  8. $username=$_POST['txtuser'];
  9. $password=$_POST['txtpass'];
  10.  
  11. $flag=0;
  12. $str =" ";
  13. $sql = "Select * from user_mast where user_name='".$username."' and pass='".$password."'";
  14. //echo $sql;
  15. $result = mysql_query($sql);
  16. $rec = mysql_num_rows($result);
  17. $row = mysql_fetch_array($result);
  18.  
  19. if($rec>0)
  20. {
  21.  $flag =1;
  22.  $str= " ";
  23.  //$user_role = $row[role_id];
  24.  $sql = "update user_mast set login_status =1 where user_name='".$username."' and pass='".$password."'";
  25. //echo $sql;
  26. mysql_query($sql);
  27.  
  28.  $_SESSION[admin_user_id] = $row[user_id];
  29.  $_SESSION[admin_user_name]= $row[user_name];
  30.  
  31.   $_SESSION['id'] =  $username;
  32.  
  33.                     echo '<form id="Login" name="Login" method="post" action="../admin/vcalendar/login.php?ccsForm=Login" >
  34.                         <input type="hidden" name="login" value="'. $username.'" maxlength="100" size="20">
  35.                         <input type="hidden" name="password" value="'. $password.'" maxlength="100" size="20">
  36.                         <input name="hidden" type="button" value="Login">
  37.                         </form>';
  38.  
  39.                         //$password = "admin123";
  40.  
  41.                     echo '<form id="frmforumlogin" name="frmforumlogin" action="../Forum/login.php?login=true&admin=true" method="post" enctype="multipart/form-data" >
  42.                     <input type="hidden" name="username" value="'. $username.'"><br />
  43.                      <input type="hidden" name="password" value="'. $password.'"><br />
  44.                     <input type="hidden" name="redirect" value="../">
  45.                     <input type="hidden" name="login" value="123">
  46.                     <input type="hidden" value="" name="login">
  47.                     </form>';
  48.  
  49.           // echo '<form name="frmadmin_check" action="home.php" method="post">
  50. //                  </form>';
  51.             echo '<script language="javascript">
  52.                      document.Login.submit();
  53.                      document.frmforumlogin.submit()
  54.                      document.location.href="home.php";
  55.                     </script>';
  56.  
  57.  
  58.  
  59. }
  60. else
  61.  $str =   "<font color='#FF0000'>Invalid User Name or Password.!</font>";
  62. }
  63.  

Thanks
Apr 14 '10 #1
4 3679
velocity00723
3 New Member
@velocity00723
Does anyone face this problem befor?
Apr 15 '10 #2
code green
1,726 Recognized Expert Top Contributor
Does anyone face this problem befor
It may help if you state what the problem is
but it gives problem in safari
In the mean time I suggesting testing the HTML source code at W3C
Apr 15 '10 #3
velocity00723
3 New Member
@code green
ok i try to explain,
when user enter his user name and password ,user must be login to mysite as well as to the phpbb forum and vcalender (which are third party tools), i just passed the user information to the respective login pages of phpbb and vcalender but it gives some problem,
it get login in my site but not in forum and vcalender
Apr 19 '10 #4
x3ak
1 New Member
You have 3 forms with different actions, what do you expect to see? 3 browser windows or what?
if you want to solve this problem this way i can suggest you to create 3 iframes , with different names, and target all that forms to that iframes, then you will be able to login user to all that sites on a single page.

PS. use jquery for javascript, it very easy and cross browser
Apr 19 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
7794
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM: The form won't submit if the link is clicked, but will submit if the SUBMIT button is clicked. I need to call a function to change the form's action according to user's input before it is submitted.
2
9591
by: ivanhoe | last post by:
All articles and tutorials I've seen on subject of forms say that if there's name and value for submit button(input tag with type="submit"), they'll get submitted along with the rest of the form... but I've just noticed (after debugging my perl script for quite a while :/ ) that it is true only when user clicks on submit, and if form is submitted via hitting enter you don't get name=value for submit buttton...
4
422
by: Bob Lehmann | last post by:
Hi, I pretty sure I've seen this problem addressed before, but I can't find any references. The short story is that I have I have multiple submit buttons on a page, each providing different functionality. For example, I have a search option, a log in option and a save text option. I would like to handle the submits in the Click event of each button. the
1
1734
by: Sophisticado | last post by:
Hi Newbie here. I am trying to have two form actions on submission using a javascript. The first calls a php class (http://www.blah.org/test.php) and the second adds data to a mySQL database via a php function call (<? php echo $editFormAction; ?>. Both actions work; however, only the second action in the fucntion runs. Here is the code: <script language=javascript> <!--
3
2432
by: Dabbler | last post by:
How do I tell wether I'm seeing autopostback vs submit button click in Page_load? Thanks for any clues.
5
20016
by: Alex Maghen | last post by:
In ASPX 2.0 with MasterPages and all that, my entire page only has one actual <FORM>. But there are several different sections of the page that provide what are functionally separate forms with separate Submit buttons. In basic HTML, I can have multiple forms on a page and the browser knows that if any of the fields for Form A have the focus, then pressing ENTER will send a Click to the submit button for Form A. Same for Form B, etc. ...
23
3232
by: mosesdinakaran | last post by:
Hi All, I need a small clarification in submitting the forms, Ur suggestions please. In a page I have two form and also two submit butons. (ie)
1
2473
by: mrbadboy | last post by:
Hi, I need to submit multiple forms with using single button. I've mentioned my code below. <? if(isset($_POST)){ print_r($_POST); } ?> <script type="text/javascript">
12
6954
by: Daniel Klein | last post by:
I'm pretty new at php and web stuff so please be gentle with me. I'm trying to get a form to submit when the user presses the Enter key. I do not want to use javascript. I've googled this to death and cant find the answer (only hints), except on the 'Experts Exhange' page and you have to pay to get the answer :-( Why is this such a secret in the open source world we live in? Daniel Klein
7
1950
by: Petr Vileta \(fidokomik\) | last post by:
I have a form with few text inputs. Every text input is followed by image type input. In this form I want to have 1 submit button on the top. A problem I want to resolve is: when user type something into text input and press enter then I want to submit form by image type button but not by submit button. I tried to use tabindex parameter but this not work as I expect. Any idea? Code example:...
0
9639
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9479
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10311
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9942
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8967
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7492
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.