I'm writing this little page that lets you sort of have a conversation with a perl script, and i'm having a problem.
At the top of my php I access the perl script, with some text that the user input via a textbox. The perl responds with.. we'll say "Havin' a good one?<br>". This gets appended to $lasttext, and then that value is embeded in a hidden input form object that is named lasttext. So that when someone types some new info, and hits submit again. The text from the previous run is still available, and the new stuff just gets appended onto the end of it.
$example = exec('example.pl')
$lasttext.=$example
print "<form method=POST><input value=/"$lasttext/" type=hidden name=lasttext>"
print $lasttext;
print "<input type=submit></form>"
Now the first time I hit submit the output I would get would be
Havin' a good one?
The second time, i just want it to append the next set of text on the bottom, which works, but I get some side effects. My 2nd output would be
Havin\' a good one?
Me neither!
The third output would be
Havin\\\' a good one?
Me neither!
It's hot.
etc.... It just keeps adding the slashes. Anyone have a cleaner method to do this, or know of a way to fix this? I know this is more of a php oriented question, so my appoligies, I thought it might have something to do with regex which i know 0 about.