cworkoutbackend.php 792 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

$servername="localhost";
$username="root";
$password="";
$database_name="patientdatabase";

$conn=mysqli_connect($servername,$username,$password,$database_name);

if (!$conn)
{
    die ("Connection Failed:" . mysqli_connect_error());
}
print_r ($_POST);


    $wname = $_POST['wname'];
    $wduration = $_POST['wduration'];
    $wmoves = $_POST['wmoves'];
    $wmessage = $_POST['wmessage'];
    
    // echo ($name);
    // echo ($email);
    // echo ($address);
    

    
    $sql_query = "INSERT INTO custom_workout(workout_name,workout_duration,workout_moves,instructions)
    VALUES ('$wname' , '$wduration', ' $wmoves', '$wmessage')";

if (mysqli_query($conn,$sql_query)) 
{
echo("Successful!");
header("Location: /Contract/activities1.html");
exit;
}

mysqli_close($conn);

?>