I am sorry if has any unclear sentences beacuse I am bad in explaining thingy..
So i have three sample file name.html, time.html and insert.php.. in name.html, after i click the button and it will pop up another window (time.html). Then in time.html after i click the submit button, the insert.php will execute.
name.html
<form method = "post">
<h3>Name: </h3><input type ="text" name= "student_name" id="studentName">
<input type="button" name="submit">
</form>
time.html
<form method="post" action="insert.php">
<input type="time" name="time_name" id="my_time">
<br><br>
<input type="submit" name="myButton" id="myButton">
</form>
insert.php
<?php
$name = $_POST['student_name'];
$time = $_POST['time_name'];
if(mysqli_query($connect, "INSERT INTO student (student_name, time)
VALUES ('$name', '$time')")){
....}else{ ...}
My question: Is there a way that the insert.php can retrieve both name and time information in the html files but not only in time.html.
If I add in the insert.php file in name.html, the php file will execute first.
<form method = "post" action= "insert.php">
<h3>Name: </h3><input type ="text" name= "student_name" id="studentName">
<input type="button" name="submit">
</form>
::Most of the sentence makes no sense, if any unclear sentence please let me know.. Also, i couldn't think any better title for this question..
Edit: Seems like i found the solution.. I just add an action in the name.php.
In name.html i change to name.php
<form method = "post" action = "<? include 'time.php' ?>" >
<h3>Name: </h3><input type ="text" name= "student_name" id="studentName">
<input type="button" name="submit">
</form>
In time.html change to time.php
Thanks for helping me out!!