Jump to content

How the post message can put to another page form


shebbycs

Recommended Posts

Form.php

 

<html>
<head>
<script type="text/javascript">
function addsmiley(code)
{
var pretext = document.smile.message.value;
              this.code = code;
              document.smile.message.value = pretext + code;
}

function a()
{
var x = document.smile.message.value;
if(x=="")
{
  alert("Please insert an message!");
  return false;
}

}

</script>
<style type="text/css">
body{ background-color: #d8da3d }
</style>
</head>
<body>
  <form name="smile" method="post" action="registration.php" onSubmit="return a()" >
   Your message:<br><textarea name='message' cols='40' rows='2'></textarea><br>
   <img src="smile.gif" alt="" onClick="addsmiley('')" style="cursor:pointer;border:0" />
   <img src="blush.gif" alt="" onClick="addsmiley('*blush*')" style="cursor:pointer;border:0" />
   <input type='submit' name='submit' value='Set Name' class='biasa'  ></form>
    
   

  <br> <br>
  </body>
</html>

 

Registration.php

<?php
$m=$_POST['message'];
echo("<SCRIPT LANGUAGE='JavaScript'>window.alert('$m')</SCRIPT>");
?>
<html>
<head>
<script type="text/javascript">
  function a()
{
   var x = document.register.username.value;
   var y = document.register.pass.value;
   var z = document.register.pass2.value;
   
   if(x==""&& y==""&& z=="")
   {
    alert("Please insert all message!");
    return false;
   }
   if(x=="")
   {
     alert("Please insert an username!");
     return false;
   }
   if(y=="")
   {
     alert("Please insert an password!");
     return false;
   }
   if(z=="")
   {
     alert("Please insert an password2!");
     return false;
   }
   
   if (y!=z)
   {
     alert("Your passwords did not match");
     return false;
   }
   



}
</script>
</head>
<body>



  <form name="register" method="post" action="login.php"  onsubmit="return a()">
  <table border='0'>
  <input type="text" name="<?php $m?>">
  <tr><td>Username:</td><td><input type="text"name="username" maxlength="60"></td></tr>
  <tr><td>Password:</td><td><input type="password" name="pass" maxlength="10"></td></tr>
  <tr><td>Confirm Password:</td><td><input type="password" name="pass2" maxlength="10"></td></tr>
  <tr><th colspan=2><input type="submit" name="sub" value="Register"></th></tr> </table>
  </form>
  

  </body>
</html>

 

Your message:<br><textarea name='message' cols='40' rows='2'></textarea><br>    This i took from form.php and when it passed to registration.php when im called it in javascript  <?php

$m=$_POST['message'];

echo("<SCRIPT LANGUAGE='JavaScript'>window.alert('$m')</SCRIPT>");  it can show the message im put in form.php but when im put into input text that is  <input type="text" name="<?php $m?>">  but the input text is blank not put the message im post in form php may i know which is the error

Link to comment
Share on other sites

im means the textarea message from form php im wan to take it data so im using post method but when im put that into input text it seems the text only blank not fill with the message im input from form.php

 

GM5aB.jpg

 

this above is form.php and now im put sate word and im want it to pass to the first textfield

 

IIc4f.jpg

 

this above is registration.php so im want the aaa textfield to be fill with the word sate

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.