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
@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
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
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']);
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..!
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. :)
This has been flagged as spam show
Adam Rock !
SiteUssi 1 week ago in playlist How to Build Custom CMS Website Software Using PHP and MySQL
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 8 months ago
@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.
Aggregate02 5 months ago
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
hellraizer17 8 months ago
Hey Adam, Thanks for clarifying the deprecated error - ereg_replace to preg_replace.. Mucho Apprieciated
d21anthony 8 months ago
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.
agriosa 1 year ago
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
agriosa 1 year ago
@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.
JJDR04 1 year ago
Comment removed
JJDR04 1 year ago
there is my code: pastebin . com/FD1Ny5hM
marciobremer 1 year ago
Hi Adam, my question is in image to simplify my question take a look please.
img651.imageshack.us/img651/6994/questioni.jpg
marciobremer 1 year ago
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 1 year ago
@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 1 year ago
@flashbuilding
Thanks so much for your help.
JJDR04 1 year ago
@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 1 year ago
@marciobremer
Adam is the only one to thank here. Not only he teaches us lots of great stuff, he also provides great support.
JJDR04 1 year ago
Bless you !
ztarrfect 1 year ago
Awesome, thank you very much for sharing this :)
arunkom00 1 year ago
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 1 year ago
@Kiajw
I am geeting the same error... any luck?
JJDR04 1 year ago
Comment removed
darkshoktong 2 years ago
Cant wait for Part 5
mine070 2 years ago
Adam - Where is Part 5, i cannot find it. Cheers
tasticross 2 years ago
hey i want my mouse cursors like you.......which softwares did u use????????/
singhinthehouse 2 years ago
Thank you Adam
Waranle 2 years ago
You are very welcome!
flashbuilding 2 years ago
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
lucas199400 2 years ago
it's called url hidding. Google it / Bing it/ Yahoo it.
PersonalComputerHelp 2 years ago
Comment removed
lucas199400 2 years ago
I did a big search on Google, altough i can't find anything really usefull.. :(
lucas199400 2 years ago
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. :)
PersonalComputerHelp 2 years ago
Man these tuts are getting interesting every day. Good stuff there M8.
djshaanky 2 years ago
good good very good
0rang3Flash 2 years ago 2
yo! dude have you checked out my latest email reply yet? :(
cartoonking3 2 years ago