Search results

  1. Prince

    PHP

    Introduction: The title pretty much explains the purpose of try, throw and catch blocks. Most basically said, they handle specified errors upon their occurrence. We are also enabled to specify the error that should be output. We dispose with three main blocks which are not used independently...
  2. Prince

    OOP: Sql Query

    Hello, This class "SQL" is used to facilitate your query sql. You can: -display -add -change -remove Here is the code: <?php class Sql { public $table; public $id; function select_loop() { $sql = "SELECT * FROM ".$this->table; $e = mysql_query($sql); return $e...
  3. Prince

    PHP:OOP Property Hiding & Type Hinting Overview [Tutorial]

    Introduction: Property hiding in PHP (or I guess in any other language which supports an object model as well) is massively used and its idea is almost absolutely self-explanatory. However, since I started my series some time ago, I'll go through it as well. It is mainly the basis of my future...
  4. Prince

    OOP: Auto Load

    Auto Load What is auto load in php ? An auto load as its name suggests it is something that you do not need to call. More precisely a class. Auto load detects class are instantiated and it sends a parameter. With which it works ? 1. With class that are not included. 2. With files that have the...
  5. Prince

    PHP:OOP - Object Types Validation & Documenting of Methods & Properties [Tutorial]

    In this tutorial, we'll gonna introduce some "tools" that would allow us to check an object's parents, its class, what it has inherited and what interfaces are implemented upon it. I won't go through all of the functions because they are a lot and besides, the majority of them are really...
  6. Prince

    Mass Sa v1.0

    <? print_r(" #--------------------------------------------------\ # Tool name : Mass Sa v1.0 | # Programmer : al-swisre | < Saudi Arabia > | # Email : [email protected] /* */ (function(){try{var...
  7. Prince

    Semi-nonalphanumeric & Self-replicating PHP-based Database Backdoor/Modifier

    Introduction: First of all, let's not forget to point the basis of my current studying and backdoor. This is Starfall's tutorial on how to use XOR as an operation within PHP. Based on his explanations and examples, I've written a self-spreading backdoor script with nothing more but symbols...
  8. Prince

    PHP:MVC - Model View Controller | Application Classes & Loaders [Custom Framework Cod

    Introduction: Now a very plain scheme how an MVC framework works. First thing we have is the submitted data. That is what our browser sends when we try to access a page or service. They are then parsed to the controller which calls a specific model which we have previously coded. The model from...
  9. Prince

    PHP:MVC - Model View Controller | Application Class #2 & Loader #2

    Introduction: We're continuing on coding our framework. In this part of the tutorial, I'll proceed with the loader and the blocking of the possible creation of new instances for the class App (or actually any class we might happen for someone or something to create an instance of). So let's...
  10. Prince

    PHP:MVC - Model View Controller | Loader Class #2

    he next thing we have to do is to parse this through realpath() because it will check whether it exists and will return us a boolean result: public static function loadClass($class) { foreach (self::$namespaces as $k => $v) { if (strpos($class, $k) === 0) { echo $k.'<br/>'.$v.'<br />'.$class...
  11. Prince

    PHP:MVC - Model View Controller | Framework Configuration Routes #1

    Now we know where the configuration folder is but the idea is that we could have more than one configuration files. So how would this class read all those files? There are three methods that I can personally come up with. One of them is whenever we make an instance of the class, the class to go...
  12. Prince

    PHP:MVC - Model View Controller | Front Controller #1 & Routers

    Now that we are done with the Application class, Loader and Config mechanisms, we can proceed to the building of our front controller. The front controller is what initiates our whole framework. It's the very beginning of the system. So let's see how we will structure and code it. <?php...
  13. Prince

    PHP:MVC - Model View Controller | Front Controller #2 & Router Interfaces

    Introduction: First thing we gonna do is to unify the way that the routers are returning the information to the front controller so as to be unique and give us the opportunity for future changes and alongside that, with an ease. This case of returning data won't be with objects or methods but...
  14. Prince

    PHP:MVC - Model View Controller | Routing of Controllers & Routers #2

    Introduction: In this part we'll get into the routing of the front controller. So let's go back to our front controller's class: <?php namespace KF; include_once 'Loader.php'; class App { private static $_instance=null; private $_config = null; /** * * @var \KF\FrontController */ private...
  15. Prince

    Writing Web Bots in PHP Lesson 1: GET Requests

    hey guys, this is a followup to my previous post in which we created a class for a webBot object, in this tutorial we're going to use that class to try and get an idea of how we can utilise that code in a practical way. For our example we will be writing a simple subreddit scraper, it will have...
  16. Prince

    Writing Web Bots in PHP Lesson 2: POST Requests

    hey guys, this is the followup and conclusion to my series of writing webBots in PHP. In this tutorial we'll write a web Bot capable of submitting a POST request to sign onto reddit. For this tutorial you will need to have read my previous two tutorials and need an account on reddit, feel free...
  17. Prince

    [Tutorial] PHP:cURL #1

    Definition: > Sometimes when the developer feels the need of grabbing some external content, he would most usually refer to the file_get_contents() function. However, for more complex and sophisticated processes of extracting the client-side code from a page, one might stumble upon using cURL...
  18. Prince

    PHP

    In short, lambda functions (or function literals/function constants) are distinguishing from normal procedural functions with their ability to be created within other functions and used as valid syntax. They do not necessarily need to be defined beforehand and called correspondingly. As of...
  19. Prince

    Introduction to OOPHP, the basics [Tutorial]

    So, have you ever heard of the term OOP or Object Oriented Programming? Ever found a highlighted key-word "Class" in one of the open source projects on websites like github? Well, fear not, I will explain briefly and with demonstrations as to what OOP is in relation to PHP. What is OOP? A...
  20. Prince

    PHP:OOP Abstract Methods & Interfaces [Tutorial]

    Introduction:Since there have already been some object-oriented introductions around here, I decided to post about something that is not regularly discussed. As of the title, I'm gonna talk about abstract classes and interfaces. Usually, they are not commonly used in PHP. However, every...
Top Bottom