PHP Variables Link/Display
<p>I'm passing variables from my Flash MP3 player to a PHP script to record what songs have played.  Now I want the PHP script to display one varable and include it in an Amazon link.</p>

<p>This is what I have but can't seem to get it to work.</p>

<pre><code>&lt;?php
$var1  = $_POST['var1']; //get the Artist Name and Title from Flash and store it in a PHP variable
$var2 = $_POST['var2']; //ignored
//This lines combines the two variables into one string. 
//To concatinate vars in PHP use a period or dot ".", much like Flash uses a plus sign "+". 

$add = $var1 . "+" . $var2 . "|";
//opens or creates (if it doesn't already exist) our text file (songsplayed.txt) 
//for writing (not reading) and places the pointer at the end.
$open = fopen('songsplayed.txt', 'a'); 
//writes to our specified file our string
$write = fwrite($open, $add); 

echo $var1;
echo

&lt;a type="amzn" search=\"$var1\" category="music"&gt;
&lt;img border="0" src="/buttons/buy-now-button-amazon.png" alt="Buy now @ Amazon"&gt;&lt;/a&gt;
?&gt;
</code></pre>
