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
1=== added file 'DatabaseCreater.php'
2--- DatabaseCreater.php 1970-01-01 00:00:00 +0000
3+++ DatabaseCreater.php 2013-12-30 04:43:08 +0000
4@@ -0,0 +1,36 @@
5+
6+<?php
7+//require_once 'validator.php';
8+global $Sys_Info;
9+?>
10+<html>
11+<body>
12+
13+<form action="validator.php" method="post">
14+ <table>
15+ <tr>
16+ <td>Host Name:<td>
17+ <td><input type="text" name="hname" /></td>
18+ <td><?php echo $Sys_Info['errorhostname']?></td>
19+ <tr>
20+ <tr>
21+ <td>Database Admin Username:<td>
22+ <td><input type="text" name="adminname" /></td>
23+ <tr>
24+ <tr>
25+ <td>Database Admin Password:<td>
26+ <td><input type="password" name="adminpassword" /></td>
27+ <tr>
28+ <tr>
29+ <td>Database name:<td>
30+ <td><input type="text" name="dbname" /></td>
31+ <tr>
32+
33+ </table>
34+<input type="submit" value="Create Database"/>
35+</form>
36+
37+
38+</body>
39+</html>
40+
41
42=== added file 'index.php'
43--- index.php 1970-01-01 00:00:00 +0000
44+++ index.php 2013-12-30 04:43:08 +0000
45@@ -0,0 +1,12 @@
46+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
47+<html>
48+ <head>
49+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
50+ <title></title>
51+ </head>
52+ <body>
53+ <?php
54+ // put your code here
55+ ?>
56+ </body>
57+</html>
58
59=== added directory 'nbproject'
60=== added directory 'nbproject/private'
61=== added file 'nbproject/private/private.properties'
62--- nbproject/private/private.properties 1970-01-01 00:00:00 +0000
63+++ nbproject/private/private.properties 2013-12-30 04:43:08 +0000
64@@ -0,0 +1,2 @@
65+index.file=index.php
66+url=http://localhost/Vesuvius_Installer/
67
68=== added file 'nbproject/project.properties'
69--- nbproject/project.properties 1970-01-01 00:00:00 +0000
70+++ nbproject/project.properties 2013-12-30 04:43:08 +0000
71@@ -0,0 +1,7 @@
72+include.path=${php.global.include.path}
73+php.version=PHP_5
74+source.encoding=UTF-8
75+src.dir=.
76+tags.asp=false
77+tags.short=true
78+web.root=.
79
80=== added file 'nbproject/project.xml'
81--- nbproject/project.xml 1970-01-01 00:00:00 +0000
82+++ nbproject/project.xml 2013-12-30 04:43:08 +0000
83@@ -0,0 +1,9 @@
84+<?xml version="1.0" encoding="UTF-8"?>
85+<project xmlns="http://www.netbeans.org/ns/project/1">
86+ <type>org.netbeans.modules.php.project</type>
87+ <configuration>
88+ <data xmlns="http://www.netbeans.org/ns/php-project/1">
89+ <name>database_creater</name>
90+ </data>
91+ </configuration>
92+</project>
93
94=== added file 'validator.php'
95--- validator.php 1970-01-01 00:00:00 +0000
96+++ validator.php 2013-12-30 04:43:08 +0000
97@@ -0,0 +1,46 @@
98+
99+<?php
100+//require_once 'DatabaseCreater.php';
101+global $Sys_Info;
102+$Sys_Info=array();
103+
104+$Sys_Info['hostname']=$_POST["hname"];
105+$Sys_Info['adminname']=$_POST["adminname"];
106+$Sys_Info['adminpassword']=$_POST["adminpassword"];
107+$Sys_Info['databasename']=$_POST["dbname"];
108+
109+if($Sys_Info['hostname']==null)
110+ {
111+ echo "Enter the host name <br>";
112+ //break;
113+ }
114+if($Sys_Info['databasename']==null)
115+ {
116+ echo "Enter the databasename you want to create <br>";
117+ }
118+
119+if($Sys_Info['hostname']!=null && $Sys_Info['databasename']!=null)
120+ {
121+
122+ $link = mysql_connect($Sys_Info['hostname'], $Sys_Info['adminname'], $Sys_Info['adminpassword']);
123+ if(!$link){
124+ exit('Could not connect to database: '. mysql_error());
125+ }
126+ if($link){
127+ if (mysql_query("CREATE DATABASE ".$Sys_Info['databasename'],$link))
128+ {
129+ echo "Database successfully created";
130+ }
131+ else
132+ {
133+ echo "Error creating database: " . mysql_error();
134+ }
135+
136+ }
137+ }
138+
139+?>
140+
141+
142+
143+

Subscribers

People subscribed via source and target branches

to status/vote changes: