Jump to content
MakeWebGames

Help Tutorial


peterisgb

Recommended Posts

This is only a basic mod that i made today, But it beats the default one.
Update the questions and answers to suit your needs.
This is v1 of this mod so i may update it and release new versions here.
create a blank page and call it help.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.


Here is the Sql.

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

  • Like 2
Link to comment
Share on other sites

I probably would have just stored all these in a database and just do some rough query searches for questions and answers. Plus it would probably condense your code by like 75%

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Something like that

Edited by KyleMassacre
Link to comment
Share on other sites

10 minutes ago, KyleMassacre said:

I probably would have just stored all these in a database and just do some rough query searches for questions and answers. Plus it would probably condense your code by like 75%

 

$db->query("select * from `faq` where `question` like '%{$ask}%' or where `answer` like '%{$ask}%'");

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Something like that

As i said this is v1, but yes this is the way i was planning to go with it. but for not i just wanted to get it working.
Your welcome to give it a go and post back 🙂

 

Edited by peterisgb
Link to comment
Share on other sites

  • 2 years later...
2 hours ago, peterisgb said:

Out of curiosity, how hard is it to update mccodes v2 to work in PHP 8?

Seems like once you remove/replace deprecated functions it'll work as normal. That's what I noticed. For example, the legendary mysql_real_escape_string. Once you remove that 90% of errors disappear since its always used in every escape situation although someone posted here an article showing why its the worst function to use which is a good thing its been deprecated.

 

Moreover, all the danger is coming from the very statement in question: zounds of PHP users still do believe that the notorious mysqli_real_escape_string() function's only purpose is "to protect SQL from injections" (by means of escaping some fictional "dangerous characters"). If only they knew the real purpose of this honest function, there would be no injections in the world! If only they were formatting their queries properly, instead of "protecting" them - they'd have real protection as a result.

https://phpdelusions.net/sql_injection#badpractices

 

What MTG did with match() is what you could do to improve the codes by using new PHP 8 functions. Beautiful ain't it!! 😉

Link to comment
Share on other sites

The $db->escape is just a shortcut to the function itself. Just as how other functions work, instead of calling mysqli_real_escape_string, they just use $db->escape to then call mysqli_real_escape_string. Like $db->query class function is a shortcut for mysqli_query php function.

Check your class_db_mysqli.php file for the function escape(). You'll see what it uses. 😉

But yep, that change was only for mysql and not mysqli. I just thought to mention that example after reading about this a while back. As we already know mccodes wasn't made with best of practices. I did also notice errors with the main menu, smenu using that define() function. But to make it work on php 8 shouldn't be too much of a hassle tbh 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...