Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Problem...

$
0
0

Problem with get data form and add database. Its all in same page.

	 <form action= "" method="post">
     <input type="text" name = "database" size="30" />
 <input type="text" name = "firma" size="30" />
 <input type="text" name = "telefon" size="30" />
 <input type="text" name = "email" size="30" />
 <input type="text" name = "koduleht" size="30" />
 <input type="text" name = "kontakt" size="30" />
 <input type="text" name = "aeg" size="30" />
     <input type="submit" value="Add" />
     </form>
<?php
$tabel = $_REQUEST['database'];
$firma = $_REQUEST['firma'];
$tel = $_REQUEST['telefon'];
$email = $_REQUEST['email'];
$kontakt = $_REQUEST['kontakt'];
$con=mysqli_connect("localhost","root","kala", $tabel);
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

INSERT INTO $tabel
            (firma, telefon, email, kontakt)
            VALUES    ('$firma' , '$tel' , '$email' , '$kontakt');


mysqli_close($con);
?>


Viewing all articles
Browse latest Browse all 13200

Trending Articles