How To Count Banned Words On Page?

Was not my experimenting a sort of revising ? The whole purpose was for revision to jog my memory. I thought you will be glad I did it. Is it not best to experiment and find the answers yourself rather than run to forums every half hr ?
I only appear at the forums when my experiments come to a dead-end and I’m failing to solve the puzzles.
Nevermind. No need to reply.

I use a GUI tool to build web automation .exe tools (bots). No language. The tool then converts the GUI code to a different language before compiling. Originally, it was VB (I think) but now (I reckon) it is compiled in C#.
So, it is a GUI tool. Drag and drop.
Not allowed to include commercial products links in this forum. Otherwise, I could include the link and you can check it out yourself.
Ok, since you asked then here is what I built with it. This will give you an idea of how much very little I know about programming.
Back Link Checker
DoFollow Link Checker
Content Spinner
Open Comment WP Blog Finder
Google Scraper
Youtube Scraper
Youtube Messenger

And, once I finish this cURL, guess what I’m going to do ?
Yes, build web versions of my bots so people can signup to my member sites and use the web versions for free.

Mod: I have only listed freeware tools and so I’m not spamming this forum.
I have not built any commercial bots yet. So, no need for me to spam.
Mods are welcome to have copies of my bots. Aswell as anyone else. Especially these folks:

SpaceShipTrooper
droopsnoot
mlukac89
SamA74
Mittineague
TechnoBear
:wink:

droopsnoot, if from today onwards you see I am not present on this forum then that means the mod has banned me for this post wrongfully taking it as spam. Therefore, contact them and tell them you did not take this as spam and to re-instate my account.
Remember, I only mentioned my tools as a reply to your question where you are enquiring to find-out how much experience I have in programming. Unless, I list my free tools, how will you know how much programming I know (be it with a proper programming language or some programming tool) ?
Right now, I’m not into selling but giving away my works. Therefore, no need for me to spam or solicit any service.

droopsnoot,

While I learn php, I noticed that I forget the previous chapters after I move-on to newer ones. But, I am clever (if not smart but that is changing) and guess what I am doing ? I am building a bot that will remind me the basics.
For example, we know the str_replace has 3 parameters. Now, imagine I forgot how many it has and which parameter stands for what. My bot (str_replace) tab would have 3 UIs and the UI labels would represent each parameter. That way, I won’t forget any parameter nor get confused which parameter represents what. And then, pressing the button would spit out the php function or code snippets. One way to save time writing code. get the bot to write the code.
If you ever get tired of writing the same code over and over again then drop me a PM and I’ll build you the bot (for free). You will have to supply the php code, though. The code that you want the bot to spit-out to save you time from having to write the code over and over again.
My interest here is that I get to see your coding style and ofcourse your code snippet. So, I do benefit from this exchange. I learn from your code.
If you don’t mind, you can always suggest the Admin here to create a category for tool exchanges and another for code snippet exchanges and so on. Categories that will generate lots of engagements and code sharings. This will in return attract google bot and lots of traffic and more newbies sniffing the code snippets to here. The forum would thrive. I did suggest this myself half a week ago.

Shall I PM you when I build these php coding bots ? That way, you can have a look at them and ponder well.

Cheers!

The problem is that your “experimenting” has not led you to revise what was previously explained to you, or to find the correct answer. It has led you to make guesses and draw an incorrect conclusion.

Please do revise the facts, by going over those posts where variables and strings have been explained until you have a thorough understanding of them, as suggested several times now.

At this age, I learn fast and forget double fast. Memory problem.
Therefore, getting my bots to remember them for me. Is this not wise ?
I would like to show you some of these free bots. If you don’t mind, I can PM you their links when they’re ready to share with you. I can PM too to anybody in this forum who asks for copies. I would appreciate it if the people who have been responding to my threads use them. One way, I can repay their favours.
If you like them tools then share them with the admins and other mods.
Finally, create a category for “code snippets sharing” and another for “tools to learn php fast” and finally the “tools to make php programming easier”. Then, list my free tools there for other newbies to download. Using the bots would help newbies learn php faster. They would help us to remember things. That way, we don’t forget things and encounter problems and ask the same questions over and over again on forums. Save the re-asking flood. Ok ?

NOTE: I’m not indirectly advertising my commercial wares as I don’t have any. Just mentioning what steps I am taking to remember the php basics and how I can help other newbies remember in the same way. I can help them through you and the new categories I suggested.

Notice the LIKE bug. It shows UI Man and John_Betong has LIKED Mittinueague’s post but the count shows up as 1 instead of 2.

Have you tried refreshing the page? I’m seeing a correct count of two likes on that post.

I am stuck on these 2 samples and they don’t have the RETURN.


/*
ERROR HANDLING
*/
declare(strict_types=1);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);

//script 1: https://stackoverflow.com/questions/13795789/check-if-string-contains-word-in-array
//http://php.net/manual/en/function.in-array.php
//Simplest check.

$content = 'evil';
$targets = array("evil", "devil");

if (in_array($content, $targets)) {
    echo "Script 1 - Found Banned Word: HOW TO DISPLAY MATCHING WORD HERE ?";
}
?>
<?php
/*
ERROR HANDLING
*/
declare(strict_types=1);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);

//script 6: https://stackoverflow.com/questions/32522192/check-if-an-array-element-is-in-a-string

//$email = $_POST['email'];
$email = "evil@devil.com";

if(preg_match("/\b(evil|devil)\b/", $email)){
    echo "Script 6 - Found Banned Word: HOW DO I DISPLAY THE FOUND BANNED WORD HERE ? WOULD LIKE TO SEE SNIPPET EXAMPLE";
}

?>

Ok, at first it showed the count as 2 and then I clicked the LIKE again (as I forgot I already LIKED it earlier) and the count dropped to 1 showing 2 icons of the LIKERS.
Re-LIKED but the count did not increment.
Now, refreshing fixed it.

No need to reinvent the wheel, it has already been done. Perhaps you should try out a few IDEs?

For example, Visual Studio has IntelliSense
https://msdn.microsoft.com/en-us/library/hcw1s69b.aspx

NetBeans has Smart Code Completion
https://netbeans.org/kb/73/java/editor-codereference.html

IMHO IDEs should be used as a tool, not a crutch, but they might help you learn.

You really should get in the habit of using the documentation. If you have trouble understanding it, ask.

For example, in_array.
http://php.net/manual/en/function.in-array.php

Returns TRUE if needle is found in the array, FALSE otherwise

preg_match
http://php.net/manual/en/function.preg-match.php

If matches is provided, then it is filled with the results of search. $matches[0] will contain the text that matched the full pattern, $matches[1] will have the text that matched the first captured parenthesized subpattern, and so on.

Don’t worry about the example regex patterns, regex can be difficult even for experienced programmers, but do look at the examples.

2 Likes

That’s what we use the PHP manual for, reference.

If you are doing that, you are doing it wrong.
That is why we have things like includes, custom functions, libraries, classes, etc…

2 Likes

5 posts were split to a new topic: .exe bots and PHP learning

What I actually meant was saving time from writing the very first lines that would make-up the includes, etc.
Nevermind. I’ll demonstrate to you what I mean one day.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.