-1

enter image description hereenter image description hereenter image description hereI have 3 pages.

  1. a1.php : add record
  2. a2.php : do sth
  3. a3.php : record them database

But problem is occured, transfering "html data" from a2.php to a3.php.

EXAMPLE: a record which I try to record to a1.php is that :

<form name="form1" type="post" action="sayfa_1.php">
<input type='submit' value=' gidiyoruz' >
<input type='submit' value=' gidiyoruz' >
</form>

a1.php --> a2.php --> a3. php

On a2.php, there i no problem. But then. On a3.php when I show coming data, I SEE TWO BUTTON, NO HTML CODES which is above.

pages is below.

thanks.

a1.php

<script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script> <script type="text/javascript">
//<![CDATA[
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
//]]>
</script>

<form name="form1" type="post" action="a2.php">  

<textarea rows="20" cols="90" id="anlam"  name="anlam"     style="overflow:auto;" >    </textarea>  

<input type="submit" /> 
</form>

a2.php

<?php
$anlam=$_GET["anlam"];
echo $anlam;
?>



<?php echo "<form name='fm' id='fm' action='a3.php' method='get'>";  ?>

<textarea rows="2" cols="50" name="anlam" style="visibility:hidden;"  /> <?php echo $anlam; ?> </textarea>

<input type="submit" /> 
</form>

a3.php

<?php
$anlam=$_GET["anlam"];



echo nl2br($anlam);

Pace images are above. error: a3.php (instead code, there are two button)

özgür
  • 43
  • 5
  • Do you want to print the html as string on the last page? If so, you can use htmlspecialchars() – ekholm Aug 30 '12 at 08:01

2 Answers2

1

so you want the page to send your data from one to another when you click submit button!! Use if condition with isset.

 if(isset($_POST['name_of_submit_button']))
 {
   // your code of next page
 }

n similarly continue with another page by giving another name to you submit button and applying the same condition!!

kate-06
  • 33
  • 3
0

Try using

method="post"

for your form. You could also just use an

<input type="hidden" name="anlam" value="<?php echo $anlam; ?>"/>

to transport your variable content to the last page. Are you sure, that the hidden textarea/input contains the correct value? Check the source code in your browser for this step.

Peter Ilfrich
  • 3,727
  • 3
  • 31
  • 35