Jump to content

MarcyS

New Members
  • Posts

    6
  • Joined

  • Last visited

MarcyS's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Great idea! I could add a new column and sanitize it before storing it in the database so it's displayed in the exact way it's stored. I'm so new to php and programming in general so trying to learn. Thanks a bunch for the clear explanations.. really helped me a lot! Much appreciated!
  2. What a great explanation. Thank you, Ch0cu3r. My only confusion.. and what got me thinking about a situation such is this.. how does a site like upworthy.com manage to pull only the domain name followed by the post with no other identifier in the url?
  3. I am just curious how one would go about this.. Let's say I have a mysql table called articles and 3 columns: postid, title, content ...and I wanted to format my url to look like mysite.com/this-is-my-title I understand that the normal approach is to query for postid and include that in the url.. and probably use a rewrite rule in htaccess, but is it possible to simply query the database for the title only and append to the url after .com/ ? I understand that in such a case, every title would have to be unique, but still curious about the approach. Since the url would have to be sanitized and dashes added, can you still make a request by title? Thanks!
  4. Well at least I won't beat my head against the wall over this anymore. Thanks for letting me know that it can't really be done this way. I modified htaccess to allow for post/id/title.. and that's much better than what it was. Thanks for the reply!
  5. I've been trying for hours to rewrite my current url: domain.com/post.php?id=7 ...and make it appear like this: domain.com/this-is-my-title I haven't been able to do it yet. All the online examples show using an id first or something, but I really like just .com/title only. So.. can I do that? I've seen other sites achieve it, such as upworthy, so I know it's possible. Part II: How would I call the new page from index.php? I have a database table called 'article' and the column I need is 'title' and there's obviously a postid for each entry.. I can manage to use php enough to put a dash in between all the words of the title and remove all special characters but... Not sure how to make the call though. I mean... I see that $theArticle['title'] returns the title in my current code, but displaying the url only? Is what I'm trying possible? Thanks for any suggestions!
×
×
  • 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.