Jump to content

Search the Community

Showing results for tags 'dynamic urls'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hey everyone, I'm working on teaching myself php/mysql by build a Content Management System I've got to a certain point which I'm quite proud of but I've hit a bit of a bump. at current my dynamic page urls are "index.php?pid=1" However I would like them to be actual words e.g. "/home-page" "/example-page". I have no idea how to even begin to do this, I've seen a lot of posts about using .htacess and url re-writes but I don't seem to be able to get these to work. Current build menu code in functions.php: // *************************************** // Start Build Menu // *************************************** $sqlCommand = "SELECT id, linklabel, seourl FROM pages WHERE showing='1' ORDER BY pageorder ASC"; $query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error()); $menuDisplay = ''; while ($row = mysqli_fetch_array($query)) { $pid = $row["id"]; $linklabel = $row["linklabel"]; $seourl = $row["seourl"]; $menuDisplay .= '<a href="index.php?id=' . $pid . '">' . $linklabel . '<a><br .>'; } mysqli_free_result($query); // *************************************** // End Build Menu // *************************************** I have added the extra seourl field into the database so when a new page is created it grabs the page title, removes the spaces and replaces them with - so a page called example page one will turn into example-page-one. However I am completely lost on how to use the seourl to load the content in the page. This is also how I currently pull the content from the database for the page info. // *************************************** // Select Page ID and Content, Keywords/Description // *************************************** if (!$_GET['id']) { $pageid = '1'; } else { $pageid = ereg_replace("[^0-9]", "", $_GET['id']); } $sqlCommand ="SELECT pagebody, description, keywords FROM pages WHERE id='$pageid' LIMIT 1"; $query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error()); while ($row = mysqli_fetch_array($query)) { $body = $row["pagebody"]; $desc = $row["description"]; $keywords = $row["keywords"]; } mysqli_free_result($query); // *************************************** // Select Page ID and Page Title // ************************************ If anyone has any advice or can point me in the right direction that would be fantastic! Thanks
×
×
  • 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.