Jump to content

Recommended Posts

Hey,

 

I finally figured out how to make pages easily editable by storing all the info in a database. Now I'm trying to figure out how to make it so an admin could make a new page. I don't need the coding, if someone could point me in a general direction of where i'd find out how that would be awesome.

 

I don't understand how wordpress and them work when you make a new page... yet it's not physically there. Unless the pages can be accessed by ?p=### then how does one change ?p### to /page-name

Link to comment
https://forums.phpfreaks.com/topic/103603-solved-using-php-to-create-pages/
Share on other sites

simple example:

index.php?page=test

<?php
   $sql = "SELECT `page_content` FROM `pages` WHERE `page_name` = '".$_GET['page']."' LIMIT 1;";
   $res = mysql_query($sql);
   if (mysql_num_rows($res)) {
      $row = mysql_fetch_assoc($res);
      echo $row['page_content'];
   }else echo 'No page found';
?>

 

Beware of SQL-Injections.

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.