Jump to content

error in transferring value got from a form to the other form


Recommended Posts

Hi,

   I have made a form form1.php-

<form method="post" action="form2.php" >	
<input name="var" type="text">
<input type="submit" name="submit1" >

 

I put in var="This is variable"

 

in the next page form2.php -

 

if($_SERVER["REQUEST_METHOD"]=="POST" && $_POST["submit1"]) {
$var = $_POST["var"];
echo $var;
}

<form method="post" action="form3.php" >	
<input name="var" type="hidden" value="<?=$var?>">
<input type="submit" name="submit2">

 

I got the output - "This is variable"

fine till now

 

Then in next page form3.php -

if($_SERVER["REQUEST_METHOD"]=="POST" && $_POST["submit2"]) {
$var = $_POST["var"];
echo $var;
}

 

I got output - "This"   :(

 

Where all string gone ??? why it is showing only first word ??? please help

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.