Today, We want to share with you PHP Web Application create Installer scripts.In this post we will show you , hear for php project install script we will give you demo and example for implement.In this post, we will learn about How To Create User-Friendly PHP Script Installation with an example.
PHP Web Application create Installer scripts
There are the Following The simple About PHP Web Application create Installer scripts Full Information With Example and source code.
As I will cover this Post with live Working example to develop PHP Installer: Create PHP application install scripts, so the some major files and Directory structures for this example is following below.
Connecting to MySQL with PHP
database-app ->data(folder) -->init.sql ->public -->css --->style.css ->templates -->footer.php -->header.php ->common.php ->config.php ->intall.php
database-app/data/init.sql
CREATE DATABASE memberlist; use memberlist; CREATE TABLE members ( id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, memberfname VARCHAR(30) NOT NULL, memberlname VARCHAR(30) NOT NULL, membermail VARCHAR(50) NOT NULL, memberage INT(3), membercity VARCHAR(50), date TIMESTAMP );
database-app/config.php
PDO::ERRMODE_EXCEPTION );
database-app/intall.php
exec($sql); echo "Database and table members created successfully."; } catch(PDOException $error) { echo $sql . "
" . $error->getMessage(); }
database-app/common.php
database-app/public/index.php
database-app/public/create.php
$_POST['memberfname'], "memberlname" => $_POST['memberlname'], "membermail" => $_POST['membermail'], "memberage" => $_POST['memberage'], "membercity" => $_POST['membercity'] ); $sql = sprintf( "INSERT INTO %s (%s) values (%s)", "members", implode(", ", array_keys($new_member)), ":" . implode(", :", array_keys($new_member)) ); $mystmt = $connection->prepare($sql); $mystmt->execute($new_member); } catch(PDOException $error) { echo $sql . "Back to home
" . $error->getMessage(); } } ?>successfully added.Add a Member
database-app/public/templates/footer.php
PHP Installer Create PHP application install scripts