ericthomson Posted January 4, 2012 Share Posted January 4, 2012 I am trying to create a very basic "forum"/comments section and I want to know how to have a page be automatically created once the form is submitted. I have found the code: <?php function wwwcopy($link,$file) { $fp = @fopen($link,"r"); while(!feof($fp)) { $cont.= fread($fp,1024); } fclose($fp); $fp2 = @fopen($file,"w"); fwrite($fp2,$cont); fclose($fp2); } //Example on using this function //wwwcopy("http://www.domain.com/list.php?member=sample", "sample.html"); //Another example //wwwcopy("http://www.domain.com/list.php?member=sample2", "sample2.html"); ?> I am using post for my forum (not even sure how get would handle the comments section). How can I use this (or tweak it)? The variables I am passing are $User, $Email, $Title, $Comments, $Date. Would I still use it the same? ie: wwwcopy("http://www.domain.com/forum/new-post.php?User=$User&Email=$Email&Title=$Title&Comments=$Comments&Date=$Date", "X.php");? Also, the value for X is up in the air. I've considered using the auto increment id(index) number from the mySQL database this is saved in. Link to comment https://forums.phpfreaks.com/topic/254375-create-a-new-file-after-form-submission/ Share on other sites More sharing options...
trq Posted January 4, 2012 Share Posted January 4, 2012 You should look into storing your data in a database rather than creating an actual file for each post. Every time someone posts a new topic here do you think a new file is created? Link to comment https://forums.phpfreaks.com/topic/254375-create-a-new-file-after-form-submission/#findComment-1304329 Share on other sites More sharing options...
ericthomson Posted January 4, 2012 Author Share Posted January 4, 2012 No, but I was under the impression that dynamic pages cannot be crawled? Is that true? Link to comment https://forums.phpfreaks.com/topic/254375-create-a-new-file-after-form-submission/#findComment-1304335 Share on other sites More sharing options...
trq Posted January 4, 2012 Share Posted January 4, 2012 No, it is not true. Link to comment https://forums.phpfreaks.com/topic/254375-create-a-new-file-after-form-submission/#findComment-1304339 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.