Jump to content

$_POST Vars to file using fopen()


l!m!t

Recommended Posts

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.