Jump to content

Form email & phone validate


faces3

Recommended Posts

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 by faces3
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.