On the page displayed at http://64.239.76.248/example.php, you just enter your text, the generator carries that information over to the next page, and plugs it into the area of the PHP code that's generated. You just then cut and paste the code that's produced, save it as a PHP file, and you have yourself a working PHP script (which helps me eliminate the need for a "READ ME" file).
That's the idea, anyway.
Once you see how my example works, you can then understand my problems.
IF the user of this generator quotes their text, such as "READ ME," the script that this generator produces will get an error, because these quotation-marks weren't commented out with a backslash. The same would be true of the dollar sign. If they don't comment it out, the script produced will come up with an error.
So I need a way to automatically add these required backslashes to the text the user enters into the form field on the first page of http://64.239.76.248/example.php.
I understand this can be done with "addslashes()," however, I'm not looking to add backslashes to anything that uses an apostrophe. I DON'T want this geneartor to produce ...
Don\'t look twice, but you've just been taken for \$10.00 by that \"government official.\"
... out of the form input text ...
Don't look twice, but you've just been taken for $10.00 by that "government official."
I just want the generator to add backslashes to dollar signs and quotation-marks. Nothing else.
But what further complicates things is with the "real" script I'm creating my generator for, the admin of the final script will be able to plug in variables such as first name, last name, and email address. Which need to be written as ...
First Name = ".$fname."
Last Name = ".$lname."
Email = ".$email."
... in the body of the final PHP code produced by my generator. So the question is, how do I add backslashes only to quotation-marks and dollar signs not related to personalization tags, and nothing else? This would be an amazing PHP function to get my hands on. ;~)
Chayden -