Jump to content

[SOLVED] Dynamically create new pages


unknown101

Recommended Posts

 

Hello guys,

 

Ive created a basic site whereby a user search is carried out giving the main results.  Along with each of the results returned I need to have a "More" option with each one, so basically if this is clicked a page loads just for that result and further information is given about it.  Each of the returned results has a unique ID which i could use to create a new page about it i.e.  www.domain.com/ID_Number

 

How do I go about doing this?

 

Any help or suggestions appreciated

 

Link to comment
Share on other sites

Just to give a basic idea. U make the link as "index.php?id=xx" where xx is the article id. Supposing u retrieve the articles from the database:

 

<?php
$id = $_GET['id'];
$resultsText = mysql_query("SELECT * FROM articles WHERE id=$id");
$valuesText = mysql_fetch_array($resultsText);
echo $valuesText['text'];
?>

Link to comment
Share on other sites

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.