| Welcome, Guest |
You have to register before you can post on our site.
|
| Online Users |
There are currently 12 online users. » 0 Member(s) | 12 Guest(s)
|
| Latest Threads |
Test, just a XRumer 23 St...
Forum: Announcements
Last Post: XRumer23lip
09-25-2025, 01:01 AM
» Replies: 0
» Views: 30
|
Comment créer un sous-dom...
Forum: Cpanel
Last Post: XRumer23lip
10-28-2024, 04:29 AM
» Replies: 1
» Views: 1,188
|
Tutorial: Create an Onlin...
Forum: Ellohost
Last Post: mikox
08-03-2024, 07:46 AM
» Replies: 0
» Views: 288
|
Tutoriel : Créer un Site ...
Forum: Ellohost
Last Post: mikox
08-03-2024, 07:45 AM
» Replies: 0
» Views: 314
|
Tutorial: Create a Profes...
Forum: Ellohost
Last Post: mikox
08-03-2024, 07:13 AM
» Replies: 0
» Views: 220
|
Tutoriel : Créer un Site ...
Forum: Ellohost
Last Post: mikox
08-03-2024, 07:12 AM
» Replies: 0
» Views: 252
|
Slither.io - Become the L...
Forum: Others
Last Post: mikox
04-05-2024, 07:30 AM
» Replies: 0
» Views: 310
|
MooMoo.io - Build, Defend...
Forum: Others
Last Post: mikox
04-05-2024, 07:28 AM
» Replies: 0
» Views: 331
|
Smash Karts - The Ultimat...
Forum: Others
Last Post: mikox
04-05-2024, 07:26 AM
» Replies: 0
» Views: 712
|
Dream Chef - A Cooking Ad...
Forum: Others
Last Post: mikox
04-05-2024, 07:24 AM
» Replies: 0
» Views: 305
|
|
|
| How to protect a website with a password |
|
Posted by: aaron - 07-22-2023, 04:28 AM - Forum: Others
- No Replies
|
 |
<!DOCTYPE html>
<html>
<head>
<title>How to protect a website with a password</title>
</head>
<body>
<h1>How to protect a website with a password</h1>
<ul>
<li>To protect access to your website via username and password authentication, you will need to upload an .htaccess file and an htpasswd file to the root of your FTP account, using FileZilla or a similar FTP transfer software.</li>
</ul>
The <code>.htaccess</code> file will contain the path where the username and password authorized to access it are stored. It should contain the following code:
<code>
AuthType Basic
AuthName "Authentication name"
AuthUserFile /var/www/Mydomain.com/htdocs/.htpasswd
Require valid-user
</code>
<p>The term <code>Mydomain.com</code> should be replaced by your domain name.</p>
<ul>
<li>The <code>.htpasswd</code> file will contain the user name authorized to connect as well as its password, which will be encrypted. The creation of the <code>.htaccess</code> and <code>.htpasswd</code> file can be done via a text editor such as Notepad.</li>
</ul>
<p>Information: the <code>.htaccess</code> and <code>.htpasswd</code> files are hidden files, so it is possible that when you make an FTP connection via an FTP transfer software, you do not see them. In this case, it will be necessary to display the hidden files on your software.</p>
<p><a href="https://ellohost.com"><button style="padding: 10px 20px; background-color: blue;">Join ellohost</button></a></p>
</body>
</html>
|
|
|
| Création de la Vue pour CodeIgniter |
|
Posted by: aaron - 07-20-2023, 01:40 PM - Forum: Others
- No Replies
|
 |
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Création de la Vue pour CodeIgniter</title>
</head>
<body>
<h2>Création de la Vue pour CodeIgniter</h2>
<p>Nous allons créer une vue qui affichera la liste des agences.</p>
<ol>
<li>Rendez-vous dans le dossier app/Views et créez un nouveau fichier nommé agencies.php. Le nom du fichier doit correspondre à la vue que vous avez indiqué au contrôleur à charger, comme indiqué dans la dernière ligne de la méthode view().</li>
<li>Collez le code suivant et enregistrez le fichier :</li>
</ol>
<blockquote>
<code>
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body>
<div class="row mt-3">
<table class="table table-bordered" id="agencies">
<thead>
<tr>
<th>Id</th>
<th>Nom</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<?php if($agencies): ?>
<?php foreach($agencies as $agency): ?>
<tr>
<td><?php echo $agency['id']; ?></td>
<td><?php echo $agency['name']; ?></td>
<td><?php echo $agency['email']; ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</body>
</html>
</code>
</blockquote>
<p>La vue affichera les informations transmises par le contrôleur dans le tableau $data. Les résultats ne seront pas époustouflants car nous n'avons pas encore ajouté de style à notre vue. Cependant, vous pouvez ajouter un style en ligne ou faire référence à une feuille de style CSS dans la vue ultérieurement.</p>
Notre application d'exemple est complète. Vous devriez pouvoir exécuter cette application en entrant l'URL suivante dans votre navigateur :
http://votredomaine.com/Agencies
L'application web appellera le contrôleur des agences créé et triera les éléments de la base de données.
<br><br> <a href="https://ellohost.com"> <button style="padding: 10px 20px; background-color: blue;">Rejoindre ellohost</button> </a>
</body>
</html>
|
|
|
| Creating the View for CodeIgniter |
|
Posted by: aaron - 07-20-2023, 01:38 PM - Forum: Others
- No Replies
|
 |
<!DOCTYPE html>
<html lang="en">
<head>
<title>Creating the View for CodeIgniter</title>
</head>
<body>
<h2>Creating the View for CodeIgniter</h2>
<p>We'll create a view that will display the list of agencies.</p>
<ol>
<li>Enter the app/Views folder, and create a new file titled agencies.php. The file’s name has to correspond to the view that you told the controller to load, featured in the last line of the view() method.</li>
<li>Paste in the following code and save the file:</li>
</ol>
<blockquote>
<code>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body>
<div class="row mt-3">
<table class="table table-bordered" id="agencies">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<?php if($agencies): ?>
<?php foreach($agencies as $agencies1): ?>
<tr>
<td><?php echo $agencies1['id']; ?></td>
<td><?php echo $agencies1['name']; ?></td>
<td><?php echo $agencies1['email']; ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</body>
</html>
</code>
</blockquote>
<p>The view will display the information passed by the controller in the $data array. The results won’t be stunning since we haven’t added styling to our view. However, you can add inline styling or reference a CSS stylesheet in the view later.</p>
Our sample application is complete. You should be able to run this application by entering the following URL in your browser:
http://yourdomain.com/Agencies
The web application will call the agencies’ controller created and sort the elements of the database.
<br><br> <a href="https://ellohost.com"> <button style="padding: 10px 20px; background-color: blue;">Join ellohost</button> </a>
</body>
</html>
|
|
|
| Création du Contrôleur pour CodeIgniter |
|
Posted by: aaron - 07-20-2023, 01:32 PM - Forum: Others
- No Replies
|
 |
<!DOCTYPE html>
<html>
<head>
<title>Création du Contrôleur pour CodeIgniter</title>
</head>
<body>
<h2>Création du Contrôleur pour CodeIgniter</h2>
<a href="https://ellohost.com/forum/showthread.php?tid=78">Créer une table phpMyAdmin</a>
<a href="https://ellohost.com/forum/showthread.php?tid=76">Créer le Modèle</a>
<p>Pour créer un itinéraire en utilisant le contrôleur, de cette façon, chaque fois qu'un utilisateur fait une demande, la vue sera alimentée avec les informations du modèle.</p>
<ol>
<li>Pour créer un nouveau contrôleur, accédez au répertoire app/Controllers et créez un fichier nommé Agencies.php. Rappelez-vous, les contrôleurs de CodeIgniter doivent avoir le même nom que la classe à l'intérieur.</li>
<li>Collez le code suivant dans le fichier :</li>
</ol>
<pre>
<?php namespace App\Controllers;
use CodeIgniter\Controller;
use App\Models\AgencyModel;
class Agencies extends Controller
{
}
</pre>
<ol start="3">
<li>Nous allons créer une fonction simple pour trier toutes les entrées de la base de données de la plus élevée à la plus basse. Pour ce faire, ajoutez ce code au fichier :</li>
</ol>
<pre>
public function index()
{
$model = new AgencyModel();
$data['agencies'] = $model->orderBy('id', 'DESC')->findAll(); return view('agencies', $data);
}
</pre>
<ol start="4">
<li>Le code complet ressemblera à ceci :</li>
</ol>
<pre>
<?php namespace App\Controllers;
use CodeIgniter\Controller;
use App\Models\AgencyModel;
class Agencies extends Controller
{
public function index()
{
$model = new AgencyModel();
$data['agencies'] = $model->orderBy('id', 'DESC')->findAll(); return view('agencies', $data);
}
}
</pre>
<br><br> <a href="https://ellohost.com"> <button style="padding: 10px 20px; background-color: blue;">Rejoindre ellohost</button> </a>
</body>
</html>
|
|
|
| Creating the Controller for CodeIgniter |
|
Posted by: aaron - 07-20-2023, 01:30 PM - Forum: Others
- No Replies
|
 |
<!DOCTYPE html>
<html>
<head>
<title>Creating the Controller for CodeIgniter</title>
</head>
<body>
<h2>Creating the Controller for CodeIgniter</h2>
<a href="https://ellohost.com/forum/showthread.php?tid=78">Create a phpMyAdmin Table</a>
<a href="https://ellohost.com/forum/showthread.php?tid=76">Create the Model</a>
<p>To create a route using the controller, this way whenever a user makes a request, the view will be supplied with the information from the model.</p>
<ol>
<li>To create a new controller, go to the app/Controllers directory and create a file named Agencies.php. Remember, CodeIgniter's controllers must have the same name as the class inside it.</li>
<li>Paste the following code into the file:</li>
</ol>
<pre>
<?php namespace App\Controllers;
use CodeIgniter\Controller;
use App\Models\AgencyModel;
class Agencies extends Controller
{
}
</pre>
<ol start="3">
<li>We'll create a simple function to sort all the database entries from highest to lowest. To do so, add this code snippet to the file:</li>
</ol>
<pre>
public function index()
{
$model = new AgencyModel();
$data['agencies'] = $model->orderBy('id', 'DESC')->findAll(); return view('agencies', $data);
}
</pre>
<ol start="4">
<li>The complete code will look like this:</li>
</ol>
<pre>
<?php namespace App\Controllers;
use CodeIgniter\Controller;
use App\Models\AgencyModel;
class Agencies extends Controller
{
public function index()
{
$model = new AgencyModel();
$data['agencies'] = $model->orderBy('id', 'DESC')->findAll(); return view('agencies', $data);
}
}
</pre>
<br><br> <a href="https://ellohost.com"> <button style="padding: 10px 20px; background-color: blue;">Join ellohost</button> </a>
</body>
</html>
|
|
|
| Création du Modèle pour CodeIgniter |
|
Posted by: aaron - 07-20-2023, 01:25 PM - Forum: Others
- No Replies
|
 |
<!DOCTYPE html>
<html>
<head>
<title>Création du Modèle pour CodeIgniter</title>
</head>
<body>
<h2>Création du Modèle pour CodeIgniter</h2>
<p>Une fois que la <a href="https://ellohost.com/forum/showthread.php?tid=76">table de base de données</a> a été créée, commencez à travailler sur la logique métier. Pour cela, créez un modèle qui récupérera les valeurs de la base de données.</p>
<ol>
<li>Accédez au Gestionnaire de fichiers</li>
<p>Les modèles sont placés dans le répertoire public_html/app/Models afin de ne pas interférer avec la structure du répertoire de l'application. Accédez au répertoire Models et créez un nouveau fichier PHP appelé AgencyModel.php.</p>
<li>Collez le code suivant dans le fichier AgencyModel.php :</li>
</ol>
<pre>
<?php namespace App\Models;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Model;
class AgencyModel extends Model
{
protected $table = 'agencies';
protected $allowedFields = ['name', 'email'];
}
</pre>
<p>Comme vous pouvez le voir, la classe de modèle (AgencyModel) étend la classe générique Model fournie par CodeIgniter. Notez que CodeIgniter exige que tous les noms de classe commencent par une lettre majuscule.</p>
<br><br> <a href="https://ellohost.com"> <button style="padding: 10px 20px; background-color: blue;">Rejoindre ellohost</button> </a>
</body>
</html>
|
|
|
| Creating the Model for CodeIgniter |
|
Posted by: aaron - 07-20-2023, 01:24 PM - Forum: Others
- No Replies
|
 |
<!DOCTYPE html>
<html>
<head>
<title>Creating the Model for CodeIgniter</title>
</head>
<body>
<h2>Creating the Model for CodeIgniter</h2>
<p>Once the <a href="https://ellohost.com/forum/showthread.php?tid=76">database table</a> has been created, begin working on the business logic. To do this, create a model that will retrieve the database values.</p>
<ol>
<li>Access File Manager</li>
<p>Models are placed in the public_html/app/Models directory so they won't interfere with the application's directory structure. Go to the Models directory and create a new PHP file called AgencyModel.php.</p>
<li>Paste the following code into the AgencyModel.php file:</li>
</ol>
<pre>
<?php namespace App\Models;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Model;
class AgencyModel extends Model
{
protected $table = 'agencies';
protected $allowedFields = ['name', 'email'];
}
</pre>
<p>As you can see, the model class (AgencyModel) extends the generic Model class that CodeIgniter provides. Note that CodeIgniter requires all class names to begin with a capital letter.</p>
<br><br> <a href="https://ellohost.com"> <button style="padding: 10px 20px; background-color: blue;">Join ellohost</button> </a>
</body>
</html>
|
|
|
| Création d'une table phpMyAdmin pour CodeIgniter |
|
Posted by: aaron - 07-20-2023, 01:18 PM - Forum: Others
- No Replies
|
 |
<!DOCTYPE html>
<html>
<head>
<title>Création d'une table phpMyAdmin pour CodeIgniter</title>
</head>
<body>
<h2>Création d'une table phpMyAdmin pour CodeIgniter</h2>
<p>Cette section couvrira les étapes pour créer une table avec phpMyAdmin via hPanel. Cette table est essentielle car elle formera la base de notre application.</p>
<ol>
<li>Connectez-vous à votre compte d'hébergement. Accédez à la section Bases de données et sélectionnez phpMyAdmin.</li>
<li>Recherchez la base de données que vous avez synchronisée avec CodeIgniter et cliquez sur Entrer dans phpMyAdmin :</li>
<img src="https://ellohost.com/imageshack/uploads/1689858914_64b93362c7d6a.jpeg" width="40%" alt="Interface phpMyAdmin">
<li>Une fois là-bas, sélectionnez la section SQL, collez cette requête, puis cliquez sur Exécuter :</li>
</ol>
<pre>
CREATE TABLE agencies (
id int(11) NOT NULL AUTO_INCREMENT COMMENT 'Clé primaire',
name varchar(100) NOT NULL COMMENT 'Nom',
email varchar(255) NOT NULL COMMENT 'Adresse e-mail',
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT=''AUTO_INCREMENT=1;
INSERT INTO agencies(id, name, email) VALUES
(1, 'Development', 'awesomeinbox@domain.com'),
(2, 'Production', 'sparkingjoy@domain.net'),
(3, 'Testing', 'user@mydomain.com'),
(4, 'Building', 'editor@mydomain.net'),
(5, 'Debugging', 'anotherawesomeinbox@anotherdomain.com');
</pre>
<p>Cela ressemblera à ceci :</p>
<img src="https://ellohost.com/imageshack/uploads/1689858914_64b93362c7d6a.jpeg" width="40%" alt="Requête phpMyAdmin">
<p>Cette requête créera automatiquement une base de données remplie des données que nous pourrons utiliser ultérieurement.</p>
<br><br> <a href="https://ellohost.com"> <button style="padding: 10px 20px; background-color: blue;">Rejoindre ellohost</button> </a>
</body>
</html>
|
|
|
| Creating a phpMyAdmin Table in CodeIgniter |
|
Posted by: aaron - 07-20-2023, 01:17 PM - Forum: Others
- No Replies
|
 |
<!DOCTYPE html>
<html>
<head>
<title>Creating a phpMyAdmin Table in CodeIgniter</title>
</head>
<body>
<h2>Creating a phpMyAdmin Table in CodeIgniter</h2>
<p>This section will cover the steps to create a table with phpMyAdmin via hPanel. This table is essential because it will form the basis of our application.</p>
<ol>
<li>Log in to your hosting account. Navigate to the Databases section and select phpMyAdmin.</li>
<li>Look for the database that you have synced with CodeIgniter and click Enter phpMyAdmin:</li>
<img src="https://ellohost.com/imageshack/uploads/1689858914_64b93362c7d6a.jpeg" width="40%" alt="phpMyAdmin Interface">
<li>Once there, select the SQL section, paste in this query, and press Go:</li>
</ol>
<pre>
CREATE TABLE agencies (
id int(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary Key',
name varchar(100) NOT NULL COMMENT 'Name',
email varchar(255) NOT NULL COMMENT 'Email Address',
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT=''AUTO_INCREMENT=1;
INSERT INTO agencies(id, name, email) VALUES
(1, 'Development', 'awesomeinbox@domain.com'),
(2, 'Production', 'sparkingjoy@domain.net'),
(3, 'Testing', 'user@mydomain.com'),
(4, 'Building', 'editor@mydomain.net'),
(5, 'Debugging', 'anotherawesomeinbox@anotherdomain.com');
</pre>
<p>It will look like this:</p>
<img src="https://ellohost.com/imageshack/uploads/1689858914_64b93362c7d6a.jpeg" width="40%" alt="phpMyAdmin Query">
<p>This query will automatically create a database filled with the data that we will be able to use later.</p>
<br><br> <a href="https://ellohost.com"> <button style="padding: 10px 20px; background-color: blue;">Join ellohost</button> </a>
</body>
</html>
|
|
|
| Configurer CodeIgniter pour votre site web |
|
Posted by: aaron - 07-20-2023, 01:12 PM - Forum: Others
- No Replies
|
 |
<!DOCTYPE html>
<html>
<head>
<title>Configurer CodeIgniter pour votre site web</title>
</head>
<body>
<h2>Configurer CodeIgniter pour votre site web</h2>
<p><strong>Étape 1. Installation de CodeIgniter</strong></p>
<p>CodeIgniter peut être installé automatiquement via Composer ou manuellement en utilisant le Gestionnaire de fichiers.</p>
<p><strong>Installer CodeIgniter 4 en utilisant Composer</strong></p>
<ol>
<li>Connectez-vous à votre compte SSH et accédez au répertoire racine public_html avec cette commande :</li>
<pre>cd domains/votre-domaine.com/public_html</pre>
<li>Installez CodeIgniter 4.</li>
<pre>composer create-project codeigniter4/appstarter project-root</pre>
<li>Pour plus de commodité, déplacez le contenu de project-root dans le répertoire public_html.</li>
<pre>mv project-root/* /home/u123456789/domains/votre-domaine.com/public_html</pre>
<li>Une fois terminé, entrez cette URL dans le navigateur :</li>
<pre>https://votre-domaine.com/public</pre>
</ol>
<p><strong>Installer CodeIgniter 4 manuellement</strong></p>
<ol>
<li>Téléchargez la dernière version de CodeIgniter.</li>
<li>Utilisez le Gestionnaire de fichiers pour extraire le contenu dans le répertoire racine - votre-domaine.com/public_html.</li>
<li>Le dossier framework-4.1.9 apparaîtra. Ouvrez-le et double-cliquez sur le dossier à l'intérieur.</li>
<li>Appuyez sur CTRL + A pour sélectionner tous les fichiers, puis utilisez le bouton Déplacer pour tout transférer dans public_html.</li>
<li>Ouvrez le navigateur et entrez cette URL :</li>
<pre>https://votre-domaine.com/public</pre>
</ol>
<p><strong>Étape 2. Configuration de CodeIgniter</strong></p>
<p>Après avoir installé CodeIgniter, il est essentiel de le configurer pour qu'il fonctionne correctement.</p>
<p>Configuration de CodeIgniter pour les plans partagés</p>
<ol>
<li>Accédez au Gestionnaire de fichiers et ouvrez le fichier Database.php pour le modifier. Voici le chemin complet :</li>
<pre>/domains/votre-domaine.com/public_html/app/Config/Database.php</pre>
<li>Localisez la section suivante du fichier et remplacez les détails par les informations de votre nouvelle base de données - nom d'utilisateur, mot de passe et nom de la base de données.</li>
<pre>
public $default = [
'DSN' => '',
'hostname' => 'localhost',
'username' => 'u123456789_user',
'password' => 'Y0ur$tr0ngPa$$w0rd',
'database' => 'u123456789_name',
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'),
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
];
</pre>
<li>Configurez votre nom de domaine en modifiant le fichier App.php de CodeIgniter situé ici :</li>
<pre>/domains/votre-domaine.com/public_html/app/Config/App.php</pre>
<li>Localisez la ligne suivante et changez sa valeur par votre véritable nom de domaine :</li>
<pre>public $baseURL = 'https://votre-domaine.com/';</pre>
</ol>
<p>Configuration des hôtes virtuels sur un serveur VPS</p>
<ol>
<li>Assurez-vous que la racine du document est synchronisée avec le répertoire d'installation de CodeIgniter. Pour ce faire, ouvrez le fichier hôte virtuel.</li>
<pre>sudo nano /etc/apache2/sites-enabled/000-default</pre>
<li>Modifiez /chemin/vers/codeigniter par le chemin réel du répertoire d'installation de CodeIgniter.</li>
<pre><VirtualHost *:80>
DocumentRoot /chemin/vers/codeigniter
[...]
<VirtualHost *:80>
</pre>
<li>Pour un processus de développement plus efficace, supprimez index.php du format d'URL de CodeIgniter.</li>
<pre>
public $indexPage = 'index.php';
Remplacez-le par ceci :
public $indexPage = '';
</pre>
<li>Créez un fichier .htaccess dans le dossier racine de CodeIgniter.</li>
<pre>sudo nano public_html/.htaccess</pre>
<li>Collez les lignes suivantes dans le fichier :</li>
<pre>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php?/$0 [PT,L]
</pre>
<li>Indiquez à Apache qu'il doit rechercher le fichier .htaccess nouvellement créé. Pour cela, ouvrez à nouveau le fichier hôte virtuel :</li>
<pre>sudo nano /etc/apache2/sites-enabled/000-default</pre>
<li>Assurez-vous que AllowOverride est défini sur All.</li>
<pre>
<Directory>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
<Directory>
</pre>
</ol>
<br><br> <a href="https://ellohost.com"> <button style="padding: 10px 20px; background-color: blue;">Rejoignez ellohost</button> </a>
</body>
</html>
|
|
|
|