PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 3rd, 2012, 02:33 PM
tech0925 tech0925 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Posts: 306 tech0925 User rank is Corporal (100 - 500 Reputation Level)tech0925 User rank is Corporal (100 - 500 Reputation Level)tech0925 User rank is Corporal (100 - 500 Reputation Level)tech0925 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 18 h 23 m 55 sec
Reputation Power: 5
Change header id to my seo friendly url?

I was able to create a function that would make an seo friendly url. My question is how do I change:

example.com?scamid=5

to:

example.com/jims-service-center-collission-repair-scam.html

Here is my index.php file:
Code:
<?php
include_once "templates/head.phtml";

$scamid = $_GET['scamid'];

if (isset($scamid))
{
include_once "templates/scam.phtml";
}

elseif (!isset($scamid)) 
{
include_once "templates/home.phtml";
}

include_once "templates/footer.phtml";
?>


Here is my scam.phtml file which should redirect to the seo friendly url above.

Code:
require_once "dbConnection.php"; 


$query = "select * from bad_words";
$result = mysql_query($query);


    while ($record = mysql_fetch_assoc($result)) 
{
    $words_array[] = $record['word'];
}



$sql = "SELECT * FROM reported_scams WHERE id=".$_GET['scamid'];
$rs_result = mysql_query($sql);

while ($row = mysql_fetch_array($rs_result)) {

$link = $row['business'];

}


require_once "functions/seourls.php";
$link = generate_seo_link($link, '-', true, $words_array);
// $siteurl is equal to http://www.example.com/
//$link is equal to jims-service-center-collission-repair-scam.html


So how can I use the header function to make this work or mod_rewrite ? Thanks, I'm still a newbie in learning

Reply With Quote
  #2  
Old October 3rd, 2012, 04:06 PM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,804 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 17 h 28 m 32 sec
Reputation Power: 6112
You do all of this in the webserver using something like mod_rewrite.
__________________
HEY! YOU! Read the New User Guide and Forum Rules

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Change header id to my seo friendly url?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap