noober Posted June 13, 2009 Share Posted June 13, 2009 After clicking a hyperlink I want php to dynamically create a page in the database then go to it. Is this feasible? If it is possible, would it take too much time to do this, making the user wait for 3, 5, 10 seconds before anything even happens on the screen? How would I do this/what methods would need to be done if it is feasible? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/162072-solved-is-it-possible-to-create-a-page-in-a-database-from-a-link-on-a-page/ Share on other sites More sharing options...
.josh Posted June 13, 2009 Share Posted June 13, 2009 what do you mean by "create a page in a database?" You can click a link that goes to a script that will make a file and then redirect to that file. Is that what you are talking about? Quote Link to comment https://forums.phpfreaks.com/topic/162072-solved-is-it-possible-to-create-a-page-in-a-database-from-a-link-on-a-page/#findComment-855205 Share on other sites More sharing options...
noober Posted June 13, 2009 Author Share Posted June 13, 2009 I think that's what I'm looking for. I'm sorry, I should have explained myself more. I am using MODx CMS. I would add to the tables existent already, thus creating a new page dynamically into the cms, which after clicking the hyperlink, would be created, and the visitor would be directed to the newly created page. I'm attempting to save time in the long run and trying to find a way of having not to create each of these potential pages individually. Quote Link to comment https://forums.phpfreaks.com/topic/162072-solved-is-it-possible-to-create-a-page-in-a-database-from-a-link-on-a-page/#findComment-855218 Share on other sites More sharing options...
.josh Posted June 13, 2009 Share Posted June 13, 2009 More than likely it is possible. You would have to map out how it is stored in the database, etc.. However TBH I doubt anybody is going to go pick apart this CMS of yours to give you a more detailed answer than that. Have you tried looking for a support community for that CMS? Quote Link to comment https://forums.phpfreaks.com/topic/162072-solved-is-it-possible-to-create-a-page-in-a-database-from-a-link-on-a-page/#findComment-855221 Share on other sites More sharing options...
noober Posted June 13, 2009 Author Share Posted June 13, 2009 I'm fairly confident I can map it out and don't need help with that. I was more interested in the possibility and methods of how to exactly take the hyperlink and make it so that it it calls a php file when it's clicked. Would I simply make an include in my page for the hyperlink? Quote Link to comment https://forums.phpfreaks.com/topic/162072-solved-is-it-possible-to-create-a-page-in-a-database-from-a-link-on-a-page/#findComment-855258 Share on other sites More sharing options...
.josh Posted June 13, 2009 Share Posted June 13, 2009 well.. how does this page generation thing work? Does it need to know a bunch of params to make the page? I mean, like, do you have some kind of form with fields you are entering in and wanting the page to generate based off that? Then just post it to the page via normal form posting methods. Page generation script self-contained? Just echo the link out to it, like a normal link... pulling values from a database and wwant to generate page based on something like an id or something? same thing as the normal link, but throw a ?var=value onto the end of the link and have the page generation script grab it from $_GET['var']. Quote Link to comment https://forums.phpfreaks.com/topic/162072-solved-is-it-possible-to-create-a-page-in-a-database-from-a-link-on-a-page/#findComment-855260 Share on other sites More sharing options...
noober Posted June 15, 2009 Author Share Posted June 15, 2009 well.. how does this page generation thing work? Does it need to know a bunch of params to make the page? I mean, like, do you have some kind of form with fields you are entering in and wanting the page to generate based off that? Then just post it to the page via normal form posting methods. No. That would mean I would be basically creating every single page individually. Page generation script self-contained? Just echo the link out to it, like a normal link... Hmm. I'm not exactly sure what you mean by this. pulling values from a database and wwant to generate page based on something like an id or something? same thing as the normal link, but throw a ?var=value onto the end of the link and have the page generation script grab it from $_GET['var']. I think this is what I am looking for. Can php grab the link, or parts of it? Maybe placing a "ref=" or "id=" tag in the hyperlink for it to grab? Is there some type of reference you can provide to see examples of how this is done? Quote Link to comment https://forums.phpfreaks.com/topic/162072-solved-is-it-possible-to-create-a-page-in-a-database-from-a-link-on-a-page/#findComment-855905 Share on other sites More sharing options...
.josh Posted June 15, 2009 Share Posted June 15, 2009 If someone goes to http://www.somesite.com/somepage?ref=blah you can do for instance echo $_GET['ref']; // output: blah if you have a url like that stored in a database and are wanting to parse ref=blah out of the url (since coming from the database it would be a regular string), you can use parse_url to get it. Quote Link to comment https://forums.phpfreaks.com/topic/162072-solved-is-it-possible-to-create-a-page-in-a-database-from-a-link-on-a-page/#findComment-855910 Share on other sites More sharing options...
noober Posted June 15, 2009 Author Share Posted June 15, 2009 Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/162072-solved-is-it-possible-to-create-a-page-in-a-database-from-a-link-on-a-page/#findComment-856005 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.