Added: 2 years ago
From: flashbuilding
Views: 14,972
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (34)

Sign In or Sign Up now to post a comment!
  • Hi,

    A quick question. I am building a site a bit more complex than on the tutorial but with some similarities. I have opted to use pagetitles rather then Page ID's to load up the relevant data. [It is a gaming website so it makes searching for a game easier rather than remebering a number]

    Is there a way, instead of using only numbers like in the tutorial, to only load the page if there is a matched pagetitle in the mysql database? If not, is there a way to put some security in place

    regards

  • @HazzerProductions Yes, you will use this to replace all other characters if they are not a number or a character: $page = preg_replace("/[a-z0-9]*/i", "", $_GET["page"]);

    For the database, you must make sure the title of page is unique to avoid duplicate entries of the same page title.

  • Adam thx for the tutorial, i just have one question, how can i send the the user to the home page, if he enters manually an invalid PID number? i d really appreciate ur help. thx again

  • Hey Adam, Thanks for clarifying the deprecated error - ereg_replace to preg_replace.. Mucho Apprieciated

  • I've hand coded html, css, ect, and used dreamweaver also in the past. Just trying to enter back into the design field, but unsure if i should focus solely on your type of barebones approach, or go the Drupal route. The D. route seems so so much more user friendly. The maintenance of keeping up to date manually vs. drupal .... i duno. drupal.org/node/65922 brings up the importance of keeping up to date, and the ease of drupal for this. ... your 2Cents please. thanks.

  • I've been viewing your stuff. looks good, but questions. How would your bare bones approach compare to using drupal? I like your approach, but with security issues, updates, depricated tags, etc, wouldn't one be better to approach CMS design using Drupal instead. After all.. there comes a time when maintenance becomes too overwhelming, especially if you do it All 100% yourself with your approach. To limit this issue, without being a serious php programer, wouldn't D. be better? thanks for advice

  • @flashbuilding

    I keep getting the following error message: Undefined index: pid in ...

    Please note that after I click one of the generated pages, say "home" , the error disappears.

    I was trying to paste the code here, but this form would generate an error, thus could not submit it to you for whatever reason.

    Thanks for your help.

  • Comment removed

  • there is my code: pastebin . com/FD1Ny5hM

  • Hi Adam, my question is in image to simplify my question take a look please.

    img651.imageshack.us/img651/69­94/questioni.jpg

  • ereg_replace() is deprecated, thus it doesn't work. I am trying to use the new function preg_replace() function to filter everything but numbers, in video #4

    This is the structure of the function:

    preg_replace($pattern, $replacement, $string);

    $pageid=ereg_replace("[^0-9]".­"".$_GET['pid']);

    This what I am testing with no luck: $pageid=preg_replace("[^1-9]",­"",$_GET['pid']);

    Thanks.

  • @JJDR04 - I fixed that issue in my recent PHP Pagination tutorial. Here is the fix:

    $pageid = preg_replace('#[^0-9]#i', '', $_GET['pid']); // filter everything but numbers for security(new)

  • @flashbuilding

    Thanks so much for your help.

  • @JJDR04 Hi everyone, i come here just to ask about the code because mine dont work too and i saw the answer!!! thank you very much!!!

  • @marciobremer

    Adam is the only one to thank here. Not only he teaches us lots of great stuff, he also provides great support.

  • Bless you !

  • Awesome, thank you very much for sharing this :)

  • Why am I getting an error with this code? It's saying that 'pid' is undefined. Did you define it before this? What do you think could be the poblem?

  • @Kiajw

    I am geeting the same error... any luck?

  • Comment removed

  • Cant wait for Part 5

  • Adam - Where is Part 5, i cannot find it. Cheers

  • hey i want my mouse cursors like you.......which softwares did u use????????/

  • Thank you Adam

  • You are very welcome!

  • Nice!

    Maybe, for some extra fun, you could make one of those 'things' that it only shows your domain name in the URL box. So it doesn't show all the crap that comes after it. I hope you know what i mean..!

    Is it .htts acces file thingy? Anyway,

    Thanks in advance

  • it's called url hidding. Google it / Bing it/ Yahoo it.

  • Comment removed

  • I did a big search on Google, altough i can't find anything really usefull.. :(

  • Try going to the developphp forum and ask this question. I will answer your question there. It is a bit difficult to explain how to do this in a youtube comment. :)

  • Man these tuts are getting interesting every day. Good stuff there M8.

  • good good very good

  • yo! dude have you checked out my latest email reply yet? :(

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more