Jump to content

[SOLVED] Is it possible to create a page in a database from a link on a page?


Recommended Posts

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.

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.

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?

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?

 

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']. 

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?

 

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.