3 Replies - 729 Views - Last Post: 05 February 2013 - 10:41 AM Rate Topic: -----

#1 ingus16  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-February 13

Two form actions in one form

Posted 05 February 2013 - 09:56 AM

Hi all !
I have problem with my php code. I din't paste all code , because its too big, and only need example answer or where can i foind solution. I just paste how i made my code and what is problem.
And i have two problems.
First one is how variable
$linkorig
can see after
$_POST['formsubmitted']
, when i get it from redirected page ?
Second question is how can do form submit with different action , after all error checking ?


<?php

$linkorig=$_POST['link-orig']; // get destination link from redirected page , for excample http://mikrotik.lv -- works fine

if (isset($_POST['formsubmitted'])) 
{
// script try login with credentials  with  <form action="login.php"   --- works fine
//Error checking !
if (empty($error)) //if not found any errors
{
// login with credentials and same form but  with  <form action="other_login.php"   --- i dont know how to do :(/>
}

}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login Form</title>
</head>
<body>

<form name="login"  action="login.php"  method="post" class="registration_form" onsubmit="return doLogin()" >
 <input type="hidden" name="dst" value="<?php echo $linkorig; ?>" />
 <input type="hidden" name="popup" value="true" />
  <fieldset>
    <legend>Login Form  </legend>
    <p>Enter Your username and Password Below  </p>
    <div class="elements">
      <label for="name">Email :</label>
      <input type="text" id="e-mail" name="username" size="25" value="" />
    </div>
    <div class="elements">
      <label for="Password">Password:</label>
      <input type="password" id="Password" name="password" size="25" />
    </div>
    <div class="submit">
     <input type="hidden" name="formsubmitted" value="TRUE" value="OK" />
      <input type="submit" value="Login" />
    </div>
  </fieldset>
</form>
<!-- $(if error) -->
<br /><div style="color: #FF8080; font-size: 9px"> </div>
<!-- $(endif) -->
<script type="text/javascript">
<!--
  document.login.username.focus();
//-->
</script>
</body>
</html>


Is This A Good Question/Topic? 0
  • +

Replies To: Two form actions in one form

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3490
  • View blog
  • Posts: 10,058
  • Joined: 08-June 10

Re: Two form actions in one form

Posted 05 February 2013 - 10:05 AM

View Postingus16, on 05 February 2013 - 05:56 PM, said:

Second question is how can do form submit with different action , after all error checking ?

depends what you mean by action. if you mean the <form>s attribute action, there can only be one per form. if it is a set of statements on the server-side, well, that would be a matter of programming.
Was This Post Helpful? 0
  • +
  • -

#3 ingus16  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-February 13

Re: Two form actions in one form

Posted 05 February 2013 - 10:33 AM

May its possible with javascript or php
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3490
  • View blog
  • Posts: 10,058
  • Joined: 08-June 10

Re: Two form actions in one form

Posted 05 February 2013 - 10:41 AM

definitely.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1