Merge lp:~chinthakarukshan/sahana-agasti/Basic_Database_Creater into lp:sahana-agasti

Proposed by Chandima
Status: Needs review
Proposed branch: lp:~chinthakarukshan/sahana-agasti/Basic_Database_Creater
Merge into: lp:sahana-agasti
Diff against target: 143 lines (+112/-0)
6 files modified
DatabaseCreater.php (+36/-0)
index.php (+12/-0)
nbproject/private/private.properties (+2/-0)
nbproject/project.properties (+7/-0)
nbproject/project.xml (+9/-0)
validator.php (+46/-0)
To merge this branch: bzr merge lp:~chinthakarukshan/sahana-agasti/Basic_Database_Creater
Reviewer Review Type Date Requested Status
Agasti Mayon Release Team Pending
Review via email: mp+200171@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

1. By Chinthaka

Initial Import

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'DatabaseCreater.php'
--- DatabaseCreater.php 1970-01-01 00:00:00 +0000
+++ DatabaseCreater.php 2013-12-30 04:43:08 +0000
@@ -0,0 +1,36 @@
1
2<?php
3//require_once 'validator.php';
4global $Sys_Info;
5?>
6<html>
7<body>
8
9<form action="validator.php" method="post">
10 <table>
11 <tr>
12 <td>Host Name:<td>
13 <td><input type="text" name="hname" /></td>
14 <td><?php echo $Sys_Info['errorhostname']?></td>
15 <tr>
16 <tr>
17 <td>Database Admin Username:<td>
18 <td><input type="text" name="adminname" /></td>
19 <tr>
20 <tr>
21 <td>Database Admin Password:<td>
22 <td><input type="password" name="adminpassword" /></td>
23 <tr>
24 <tr>
25 <td>Database name:<td>
26 <td><input type="text" name="dbname" /></td>
27 <tr>
28
29 </table>
30<input type="submit" value="Create Database"/>
31</form>
32
33
34</body>
35</html>
36
037
=== added file 'index.php'
--- index.php 1970-01-01 00:00:00 +0000
+++ index.php 2013-12-30 04:43:08 +0000
@@ -0,0 +1,12 @@
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title></title>
6 </head>
7 <body>
8 <?php
9 // put your code here
10 ?>
11 </body>
12</html>
013
=== added directory 'nbproject'
=== added directory 'nbproject/private'
=== added file 'nbproject/private/private.properties'
--- nbproject/private/private.properties 1970-01-01 00:00:00 +0000
+++ nbproject/private/private.properties 2013-12-30 04:43:08 +0000
@@ -0,0 +1,2 @@
1index.file=index.php
2url=http://localhost/Vesuvius_Installer/
03
=== added file 'nbproject/project.properties'
--- nbproject/project.properties 1970-01-01 00:00:00 +0000
+++ nbproject/project.properties 2013-12-30 04:43:08 +0000
@@ -0,0 +1,7 @@
1include.path=${php.global.include.path}
2php.version=PHP_5
3source.encoding=UTF-8
4src.dir=.
5tags.asp=false
6tags.short=true
7web.root=.
08
=== added file 'nbproject/project.xml'
--- nbproject/project.xml 1970-01-01 00:00:00 +0000
+++ nbproject/project.xml 2013-12-30 04:43:08 +0000
@@ -0,0 +1,9 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<project xmlns="http://www.netbeans.org/ns/project/1">
3 <type>org.netbeans.modules.php.project</type>
4 <configuration>
5 <data xmlns="http://www.netbeans.org/ns/php-project/1">
6 <name>database_creater</name>
7 </data>
8 </configuration>
9</project>
010
=== added file 'validator.php'
--- validator.php 1970-01-01 00:00:00 +0000
+++ validator.php 2013-12-30 04:43:08 +0000
@@ -0,0 +1,46 @@
1
2<?php
3//require_once 'DatabaseCreater.php';
4global $Sys_Info;
5$Sys_Info=array();
6
7$Sys_Info['hostname']=$_POST["hname"];
8$Sys_Info['adminname']=$_POST["adminname"];
9$Sys_Info['adminpassword']=$_POST["adminpassword"];
10$Sys_Info['databasename']=$_POST["dbname"];
11
12if($Sys_Info['hostname']==null)
13 {
14 echo "Enter the host name <br>";
15 //break;
16 }
17if($Sys_Info['databasename']==null)
18 {
19 echo "Enter the databasename you want to create <br>";
20 }
21
22if($Sys_Info['hostname']!=null && $Sys_Info['databasename']!=null)
23 {
24
25 $link = mysql_connect($Sys_Info['hostname'], $Sys_Info['adminname'], $Sys_Info['adminpassword']);
26 if(!$link){
27 exit('Could not connect to database: '. mysql_error());
28 }
29 if($link){
30 if (mysql_query("CREATE DATABASE ".$Sys_Info['databasename'],$link))
31 {
32 echo "Database successfully created";
33 }
34 else
35 {
36 echo "Error creating database: " . mysql_error();
37 }
38
39 }
40 }
41
42?>
43
44
45
46

Subscribers

People subscribed via source and target branches

to status/vote changes: