1234567891011121314151617181920212223242526272829303132333435 |
- <?PHP
-
- //---------------
- // Connection to server and database
- //---------------
-
- $host = "localhost";
- $basedatos = "techos";
- $user = "pablo.puig1";
- $passw = "9NA3kSExI2fGE6eV";
-
- try{
- $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1;
- }
- catch(Exception $ex){
- print("Error connecting to database: ". $ex->getMessage()) and die();
- }
-
- ?>
-
- <?PHP
- $name = $_POST['name'];
- $Sdate = $_POST['Sdate'];
- $Edate = $_POST['Edate'];
- $Pcount = $_POST['Pcount'];
- $Plimit = $_POST['Plimit'];
- $Desc = $_POST['Desc'];
-
- $queryAddUser = "INSERT INTO events (name, start_date, end_date, participant_count, participant_limit, description) VALUES ('$name', '$Sdate', '$Edate', '$Pcount', '$Plimit', '$Desc')";
- mysqli_query($connection, $queryAddUser);
- // $stmtAdd = mysqli_prepare($connection, $queryAddUser);
- // mysqli_stmt_execute($stmtAdd);
- header("Location: eventsTable.php");
- exit();
- ?>
|