faces3 Posted April 25, 2013 Share Posted April 25, 2013 (edited) Hey! I try and try create validate to that script, but dont work... <form action= "" method="post"> Mysql tabel: <input type="text" name = "tabel" size="30" /></br> Firma nimi:<input type="text" name = "firma" size="30" /></br> Telefon:<input type="text" name = "telefon" size="30" /></br> Email:<input type="text" name = "email" size="30" /></br> Kontakt:<input type="text" name = "kontakt" size="30" /></br> <input type="submit" value="Add" /> </form> <?php $tabel = $_REQUEST['tabel']; $firma = $_REQUEST['firma']; $tel = $_REQUEST['telefon']; $email = $_REQUEST['email']; $kontakt = $_REQUEST['kontakt']; $user="root"; $password=""; $database="firma"; $con="localhost"; mysql_connect($con,$user,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="CREATE TABLE $tabel(id int(6) NOT NULL auto_increment,firma varchar(50) NOT NULL,telefon varchar(50) NOT NULL,email varchar(50) NOT NULL,kontakt varchar(50) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))"; mysql_query($query); $qu="INSERT INTO $tabel(firma, telefon, email, kontakt) VALUES ('$firma', '$tel', '$email', '$kontakt')"; mysql_query($qu); mysql_close(); ?> <?php $folder = $_REQUEST['tabel']; if(is_dir($folder)) echo "See kataloog on juba olemas!"; else { $zip = new ZipArchive; $res = $zip->open('w.zip'); if ($res === TRUE) { $zip->extractTo($folder); $zip->close(); echo 'Kaust loodud ja failid lahti pakitud!'; } else { echo 'Viga lahtipakkimisel!'; } } ?> <?php error_reporting(E_ALL); ini_set('display_errors', 1); $con=mysqli_connect("localhost","root",""); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // Create database if(isset($_POST['tabel'])){ $andmebaas = $_POST['tabel']; $sql="CREATE DATABASE $andmebaas"; if (mysqli_query($con,$sql)) { echo "Database my_db created successfully"; } else { echo "Error creating database: " . mysqli_error($con); } } ?> One thing more... i want get form name and create subdomain. I dont use cpanel. I use zpanel. I find and find google script but dont seem... all scripts is to cpanel. Someone know where i can get subdomain php script? Edited April 25, 2013 by faces3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.