Jump to content

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


ashiitk

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.