l!m!t Posted March 2, 2010 Share Posted March 2, 2010 I am a PHP newbie, hoping someone can give some insight on an approach for the following. I would like to be able to $_post variables from an HTML form into predefined areas of an HTML template and then save it. Is fopen() and preg_match put into a loop the best approach for this? For example if my html template which I want to post to has the following text. " I am {{sample}} text replace {{me}}". I would want to replace the variables "sample" and "me". The form "field names would be the values in the template (eg: " sample" and "me" and the script would search for values contained in the brackets. preg_match("/{{[A-z0-9_]*}}/i", $vars, $locate); Does this logic make any sense is there another way to do this aside for preg? Link to comment https://forums.phpfreaks.com/topic/193876-_post-vars-to-file-using-fopen/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.