Web lists-archives.com

RE: how to insert PHP into confirrmation page


Concerning below question

I have a question.

What is the meaning of

$out .=


Saneyuki Hori



From: sh [mailto:hosayuki@xxxxxxxxx]
Sent: Monday, October 01, 2018 11:42 AM
To: php-general@xxxxxxxxxxxxx
Subject: how to insert PHP into confirrmation page



I am a new member. I have a question about form page and confirmation page.

The question is how to get word count in confirmation page from form page by PHP. The program is as below which is part of whole page. 


Function of getting word count is:  str_word_count($_POST["sentence"]

I am waiting for fast answer from a member.


[form page, by html]

<form name="namae" method="post" action="">

    <table class="formTable">


      <th>language combination</th>

   <td><select name=" language combination ">

      <option value="" selected> ----</option>

      <option value="japaneseenglish">  japaneseenglish </option>

      <option value=" englishjapanese ">  englishjapanese </option>    


   <td><input size="30" type="hidden" name="word_count" /></td>



        <th> sentence </th>

       <td><textarea name="sentence" rows="4" cols="40"></textarea></td></tr>



[confirmation page, by php]


function confirmOutput($arr){

global $hankaku,$hankaku_array;

$html = '';

foreach($arr as $key => $val) {

$out = '';  



foreach($val as $key02 => $item){



      $out .= connect2val($item);


      $out .= $item . ', ';



  $out = rtrim($out,', ');

}else{ $out = $val; }

if(get_magic_quotes_gpc()) { $out = stripslashes($out); } 

$out = nl2br(h($out));

$key = h($key);       

I tried as follows:
  I added:
      $out .= str_word_count($_POST["sentence"]).;

     $out = nl2br(h($out));


But in all columns word count was added. I need word count only in textarea.



Saneyuki Hori