# From a textfield to another textfield

**URL:** <https://forum.kirupa.com/t/from-a-textfield-to-another-textfield/222144>\
**Category:** programming\
**Created:** [April 11, 2007, 7:07am UTC](https://forum.kirupa.com/t/from-a-textfield-to-another-textfield/222144 "2007-04-11T07:07:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mymelody](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@mymelody](https://forum.kirupa.com/u/mymelody)\
**Post date:** [April 11, 2007, 7:07am UTC](https://forum.kirupa.com/t/from-a-textfield-to-another-textfield/222144/1 "2007-04-11T07:07:05Z")

</div>

I have some problem to send data from a textfield to another textfield.  
The first textfield shows the ten latest news with just the date and the headline.  
In the second textfield the latest news is shown.

When you click at one of the news in the first textfield the news should appear in the second textfield with the entire text of the news.

I don’t know how I can link the news to the other textfield.  
The information is stored in a database and I get the information with a phpscript to flash.

Here is my flashcode and my phpscript.

```auto

System.useCodepage = true;
arkiv.html = true;

send_l = new LoadVars();
result_l = new LoadVars();
send_l.sendAndLoad("http://**/getarkiv.php", result_l, "POST");
result_l.onLoad = function(success) {
arkiv.html = true;
 
 if (success) {
  
for (i = 0; i < result_l.newsCount; i++) {
   arkiv.htmlText += result_l['news'+i+'date']+"<br>";
   arkiv.htmlText +="<b>"+result_l['news'+i+'headline']+"</b><br><br>";   
 
  }
 } else {
  trace("error==" + unescape(result_l));
 }
};

 

```

```php

$connection = mysql_connect(**); 
mysql_select_db ('**');

$query = "SELECT * FROM news ORDER BY newId DESC LIMIT 10";
$result = mysql_query($query) or die ("error");
$newsCount = mysql_num_rows($result);
 
for ($count = 0; $count < $newsCount; $count++){
    $news = mysql_fetch_array($result);
    $newId = $news['newId'];
    $date = $news['date'];
    $headline = $news['headline'];
 
 $output .= "&news" . $count . "newId=" . $newId; 
 $output .= "&news" . $count . "date=" . $date;
    $output .= "&news" . $count . "headline=" . $headline;
}
$output .="&newsCount=".$newsCount;
echo $output;  
mysql_close($connection);

```
