I just started learning PHP, I'm sorry if the following questions sounds "dumb".
I'm trying to create a PHP script that will allow me to create new databases, pulling the name of the database to be created from a text input box on the same page.
In this case, let's assume a connection to the database has been established via another PHP script on the same page, so I am already authenticated.
This is the code I have
<form action="example.php" method="POST">
<input type="text" name="name">
<?php
// Create database
$sql="CREATE DATABASE [insert name from input here];
if (mysqli_query($con,$sql))
{
echo "Database [name] created successfully";
}
else
{
echo "Error creating database: " . mysqli_error();
}
?>
So, to be short and to the point, how can I get the input from "name" to [insert name from input here]?
Your time and help is appreciated!