error in transferring value got from a form to the other
Posted: Thu Sep 27, 2007 2:47 pm
feyd | Please use
I put in var="This is variable"
in the next page form2.php -[/syntax]
I got the output - "This is variable"
fine till now
Then in next page form3.php -
I got output - "This" 
Where all string gone ??? why it is showing only first word ??? please help
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I have made a form form1.php-
[syntax="html"]
<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 -[/syntax]
Code: Select all
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 -
Code: Select all
if($_SERVER["REQUEST_METHOD"]=="POST" && $_POST["submit2"]) {
$var = $_POST["var"];
echo $var;
}Where all string gone ??? why it is showing only first word ??? please help
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]