PHPNewbie55 Posted September 17, 2007 Share Posted September 17, 2007 Hey this is my first post!! Cool Forum...! ------------------------------------------------- OK Here is what I am trying to do.... I am trying to create an RSS Feed from my MySQL Database Category Structure... The ONLY part I need help with... I need to be able to CREATE a page with PHP. I know about the mkdir() and how to use that... But these RSS pages do not exist yet.. and I need to create them with PHP. So how would I go about creating a PAGE... The fputs() command requires that the page I am trying to update already exist... I need something similar that will CREATE it and then I can fputs() the data into the page.... I have exhausted all other resources and I can not find this info any where... Any help would be GREATLY APPRECIATED! Quote Link to comment https://forums.phpfreaks.com/topic/69620-solved-how-to-create-a-non-existant-page/ Share on other sites More sharing options...
btherl Posted September 17, 2007 Share Posted September 17, 2007 Which function do you use before fputs(), and what problem do you have? Are you using fopen()? Can you post your code? Quote Link to comment https://forums.phpfreaks.com/topic/69620-solved-how-to-create-a-non-existant-page/#findComment-349830 Share on other sites More sharing options...
PHPNewbie55 Posted September 17, 2007 Author Share Posted September 17, 2007 Yes I am using fopen("BUT THIS FILE DOES NOT EXIST", "w"); Then I use the fputs() But what I am looking for something like mkdir() but more like mkPAGE()... LOL I have no idea... Quote Link to comment https://forums.phpfreaks.com/topic/69620-solved-how-to-create-a-non-existant-page/#findComment-349837 Share on other sites More sharing options...
PHPNewbie55 Posted September 17, 2007 Author Share Posted September 17, 2007 Lets just say you wanted to make a text file on your server that did not exist.... In a directory that was chmod 644 so you could write to it... If a file exists I can fputs() all day long... But if the file does not exist..??? How would you tell PHP to create it for you with the proper permissions to fputs() data later...???? Quote Link to comment https://forums.phpfreaks.com/topic/69620-solved-how-to-create-a-non-existant-page/#findComment-349839 Share on other sites More sharing options...
btherl Posted September 17, 2007 Share Posted September 17, 2007 fopen("file", "w") will create a file that doesn't exist. But the directory MUST exist first. You need to check the return value of fopen() to see that it's really opened the file. If fopen() isn't working, there may be a permissions problem. Quote Link to comment https://forums.phpfreaks.com/topic/69620-solved-how-to-create-a-non-existant-page/#findComment-349847 Share on other sites More sharing options...
PHPNewbie55 Posted September 17, 2007 Author Share Posted September 17, 2007 OMG.... LOL... It was in front of my face the whole time... I just forgot to give my folder the right permissions so it was goiving me an error.... MAN.... I guess that is what you get for staring at a big page of PHP script all day... You just lose focus...! Thanks for bringing it into focus for me.... If you knew how much time I wasted today... heh heh heh..! Quote Link to comment https://forums.phpfreaks.com/topic/69620-solved-how-to-create-a-non-existant-page/#findComment-349859 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.