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. Quote 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? Quote 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? Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.