# PHP File Name

**URL:** https://forum.kirupa.com/t/php-file-name/223036
**Category:** programming
**Created:** [April 18, 2007, 11:10pm UTC](https://forum.kirupa.com/t/php-file-name/223036 "2007-04-18T23:10:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pod\_clock](https://avatars.discourse-cdn.com/v4/letter/p/f08c70/32.png) [@pod\_clock](https://forum.kirupa.com/u/pod_clock)
#### Post date: [April 18, 2007, 11:10pm UTC](https://forum.kirupa.com/t/php-file-name/223036/1 "2007-04-18T23:10:55Z")

</div>

Hi, I’m very new to PHP, so bear with me. I’m sending text from Flash to a PHP script so that it can be written to a text or xml file. Here’s the script:

\<?php  
$filename = “myFolder/results.xml”;  
$raw\_xml = file\_get\_contents(“php://input”);

print $raw\_xml;

$fp = fopen($filename, “w”);  
fwrite($fp, $raw\_xml);  
fclose($fp);  
?\>

This works fine, but what I’d like to do is name the output file from flash. Would it be possible to do something like set a variable that’s from the first word of the input file’s contents, and use that as the file name?

Thanks.
