stop inserting data in the database when refreshing the page
I am looking for a way to stop inserting or sending data in the database when refreshing the page.
here is my code:
user_details_page.php
<form action="confirm_page.php" method="post" >
User Name:
<input type="text" name="username" >
User Email
<input type="text" name="useremail" >
Password:
<input type="text" name="password" >
<input type="submit" name="submit" >
</form>
confirm_page.php
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email');
}
so the problem everytime I refresh the confirm page.php the data is sent to the database. how to stop this?
php mysql database load refresh
add a comment |
I am looking for a way to stop inserting or sending data in the database when refreshing the page.
here is my code:
user_details_page.php
<form action="confirm_page.php" method="post" >
User Name:
<input type="text" name="username" >
User Email
<input type="text" name="useremail" >
Password:
<input type="text" name="password" >
<input type="submit" name="submit" >
</form>
confirm_page.php
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email');
}
so the problem everytime I refresh the confirm page.php the data is sent to the database. how to stop this?
php mysql database load refresh
Are you manually using the browser's refresh/reload or do you click on a refresh button/link on the webpage?
– The Debi
Aug 7 '13 at 23:50
@The Debi, I mean the refresh button on the browser
– Mj Jam
Aug 8 '13 at 0:26
@nnichols, I did the validation and I put a specific part of the code to fix the problem
– Mj Jam
Aug 8 '13 at 0:29
add a comment |
I am looking for a way to stop inserting or sending data in the database when refreshing the page.
here is my code:
user_details_page.php
<form action="confirm_page.php" method="post" >
User Name:
<input type="text" name="username" >
User Email
<input type="text" name="useremail" >
Password:
<input type="text" name="password" >
<input type="submit" name="submit" >
</form>
confirm_page.php
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email');
}
so the problem everytime I refresh the confirm page.php the data is sent to the database. how to stop this?
php mysql database load refresh
I am looking for a way to stop inserting or sending data in the database when refreshing the page.
here is my code:
user_details_page.php
<form action="confirm_page.php" method="post" >
User Name:
<input type="text" name="username" >
User Email
<input type="text" name="useremail" >
Password:
<input type="text" name="password" >
<input type="submit" name="submit" >
</form>
confirm_page.php
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email');
}
so the problem everytime I refresh the confirm page.php the data is sent to the database. how to stop this?
php mysql database load refresh
php mysql database load refresh
asked Aug 7 '13 at 23:46
Mj Jam
833412
833412
Are you manually using the browser's refresh/reload or do you click on a refresh button/link on the webpage?
– The Debi
Aug 7 '13 at 23:50
@The Debi, I mean the refresh button on the browser
– Mj Jam
Aug 8 '13 at 0:26
@nnichols, I did the validation and I put a specific part of the code to fix the problem
– Mj Jam
Aug 8 '13 at 0:29
add a comment |
Are you manually using the browser's refresh/reload or do you click on a refresh button/link on the webpage?
– The Debi
Aug 7 '13 at 23:50
@The Debi, I mean the refresh button on the browser
– Mj Jam
Aug 8 '13 at 0:26
@nnichols, I did the validation and I put a specific part of the code to fix the problem
– Mj Jam
Aug 8 '13 at 0:29
Are you manually using the browser's refresh/reload or do you click on a refresh button/link on the webpage?
– The Debi
Aug 7 '13 at 23:50
Are you manually using the browser's refresh/reload or do you click on a refresh button/link on the webpage?
– The Debi
Aug 7 '13 at 23:50
@The Debi, I mean the refresh button on the browser
– Mj Jam
Aug 8 '13 at 0:26
@The Debi, I mean the refresh button on the browser
– Mj Jam
Aug 8 '13 at 0:26
@nnichols, I did the validation and I put a specific part of the code to fix the problem
– Mj Jam
Aug 8 '13 at 0:29
@nnichols, I did the validation and I put a specific part of the code to fix the problem
– Mj Jam
Aug 8 '13 at 0:29
add a comment |
9 Answers
9
active
oldest
votes
Header the user to a new page :
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES(`$username','$useremail','$email')");
}
//best outside the if statement so user isn't stuck on a white blank page.
header("location: landing_page.php");
exit;
By doing this the user who refreshes will be refreshing landing_page.php
which means it won't do the insert twice.
best advice: do a check to see if user exists first if so don't insert!
add a comment |
What is going on here is that when you refresh page, the form is submitted twice.
To prevent this, you can use sessions:
session_start();
if( $_SESSION['submit'] == $_POST['submit'] &&
isset($_SESSION['submit'])){
// user double submitted
}
else {
// user submitted once
$_SESSION['submit'] = $_POST['submit'];
}
add a comment |
Once an insert or update is done in your code you always need to redirect to another page.
See here on how to do that: How to make a redirect in PHP?
(You want to use a PHP redirect, not a Javascript or HTML one, because you obviously really need this to work.)
The confirm page should be what you redirect to after the update, not what does the insert.
Not true - that can work but there's lots of times where you need to stay on same page
– anoldermark
Feb 3 '17 at 16:06
@mark If want to stay on the same page either use Ajax or redirect back to the same page with different parameters, but if you did a normal HTML submit and don't redirect and someone refreshes the page then the same parameters are resent and you get a double submit of that data.
– developerwjk
Feb 8 '17 at 20:52
add a comment |
confirm_page.php:
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email')"); // <-- missing endquote and bracket here
header('Location: somewhere_else.php');
exit;
}
add a comment |
The best way to prevent that is to add header('Location: filename') after your query. Thus in your case,
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email');
//must be inside the condition to prevent too many redirects
header('Location: user_details_page.php');
}
add a comment |
i have this solution by using session
<?php session_start();
if(isset($_POST[$_SESSION[a][count($_SESSION[a])-1]])){
echo "somthing....";
unset($_SESSION[a]);
}
else{
echo '<form method="post">';
$_SESSION["a"]=array();
$_SESSION["a"][0]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][0].'"><br>';
$_SESSION["a"][1]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][1].'"><br>';
$_SESSION["a"][2]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][2].'"><br>';
$_SESSION["a"][3]="a".rand(1,100);
echo '<input type="submit" name="'.$_SESSION["a"][3].'" value="submit"><br>';
echo '</form>';
}
?>
add a comment |
We can stop it without redirect , best way to use PHP $_SESSION like this :
if($_SERVER['REQUEST_METHOD'] == 'POST' && empty($_SESSION['form_submit']) )
{
extract($_POST);
$sql=""INSERT INTO table (username, useremail, email) VALUES('$username','$useremail','$email')";
$_SESSION['form_submit']='true';
}
else
{
$_SESSION['form_submit']='NULL';
}
add a comment |
The fast way is to redirect the page to it's current location:
if (isset($_POST['submit']))
{
//do somthing
header("Location: $current_url");
}
add a comment |
if($_POST(submit)
{
//database insertion query
// if successful insertion
{
echo"<script language='javascript'>alert('successfully inserted')</script>";
echo"<script>document.location='your_page.php';</script>;
}
}
add a comment |
protected by Community♦ May 20 '18 at 19:46
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
9 Answers
9
active
oldest
votes
9 Answers
9
active
oldest
votes
active
oldest
votes
active
oldest
votes
Header the user to a new page :
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES(`$username','$useremail','$email')");
}
//best outside the if statement so user isn't stuck on a white blank page.
header("location: landing_page.php");
exit;
By doing this the user who refreshes will be refreshing landing_page.php
which means it won't do the insert twice.
best advice: do a check to see if user exists first if so don't insert!
add a comment |
Header the user to a new page :
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES(`$username','$useremail','$email')");
}
//best outside the if statement so user isn't stuck on a white blank page.
header("location: landing_page.php");
exit;
By doing this the user who refreshes will be refreshing landing_page.php
which means it won't do the insert twice.
best advice: do a check to see if user exists first if so don't insert!
add a comment |
Header the user to a new page :
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES(`$username','$useremail','$email')");
}
//best outside the if statement so user isn't stuck on a white blank page.
header("location: landing_page.php");
exit;
By doing this the user who refreshes will be refreshing landing_page.php
which means it won't do the insert twice.
best advice: do a check to see if user exists first if so don't insert!
Header the user to a new page :
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES(`$username','$useremail','$email')");
}
//best outside the if statement so user isn't stuck on a white blank page.
header("location: landing_page.php");
exit;
By doing this the user who refreshes will be refreshing landing_page.php
which means it won't do the insert twice.
best advice: do a check to see if user exists first if so don't insert!
answered Aug 7 '13 at 23:51
Sir
4,608951115
4,608951115
add a comment |
add a comment |
What is going on here is that when you refresh page, the form is submitted twice.
To prevent this, you can use sessions:
session_start();
if( $_SESSION['submit'] == $_POST['submit'] &&
isset($_SESSION['submit'])){
// user double submitted
}
else {
// user submitted once
$_SESSION['submit'] = $_POST['submit'];
}
add a comment |
What is going on here is that when you refresh page, the form is submitted twice.
To prevent this, you can use sessions:
session_start();
if( $_SESSION['submit'] == $_POST['submit'] &&
isset($_SESSION['submit'])){
// user double submitted
}
else {
// user submitted once
$_SESSION['submit'] = $_POST['submit'];
}
add a comment |
What is going on here is that when you refresh page, the form is submitted twice.
To prevent this, you can use sessions:
session_start();
if( $_SESSION['submit'] == $_POST['submit'] &&
isset($_SESSION['submit'])){
// user double submitted
}
else {
// user submitted once
$_SESSION['submit'] = $_POST['submit'];
}
What is going on here is that when you refresh page, the form is submitted twice.
To prevent this, you can use sessions:
session_start();
if( $_SESSION['submit'] == $_POST['submit'] &&
isset($_SESSION['submit'])){
// user double submitted
}
else {
// user submitted once
$_SESSION['submit'] = $_POST['submit'];
}
answered Aug 7 '13 at 23:54
jh314
20.1k124465
20.1k124465
add a comment |
add a comment |
Once an insert or update is done in your code you always need to redirect to another page.
See here on how to do that: How to make a redirect in PHP?
(You want to use a PHP redirect, not a Javascript or HTML one, because you obviously really need this to work.)
The confirm page should be what you redirect to after the update, not what does the insert.
Not true - that can work but there's lots of times where you need to stay on same page
– anoldermark
Feb 3 '17 at 16:06
@mark If want to stay on the same page either use Ajax or redirect back to the same page with different parameters, but if you did a normal HTML submit and don't redirect and someone refreshes the page then the same parameters are resent and you get a double submit of that data.
– developerwjk
Feb 8 '17 at 20:52
add a comment |
Once an insert or update is done in your code you always need to redirect to another page.
See here on how to do that: How to make a redirect in PHP?
(You want to use a PHP redirect, not a Javascript or HTML one, because you obviously really need this to work.)
The confirm page should be what you redirect to after the update, not what does the insert.
Not true - that can work but there's lots of times where you need to stay on same page
– anoldermark
Feb 3 '17 at 16:06
@mark If want to stay on the same page either use Ajax or redirect back to the same page with different parameters, but if you did a normal HTML submit and don't redirect and someone refreshes the page then the same parameters are resent and you get a double submit of that data.
– developerwjk
Feb 8 '17 at 20:52
add a comment |
Once an insert or update is done in your code you always need to redirect to another page.
See here on how to do that: How to make a redirect in PHP?
(You want to use a PHP redirect, not a Javascript or HTML one, because you obviously really need this to work.)
The confirm page should be what you redirect to after the update, not what does the insert.
Once an insert or update is done in your code you always need to redirect to another page.
See here on how to do that: How to make a redirect in PHP?
(You want to use a PHP redirect, not a Javascript or HTML one, because you obviously really need this to work.)
The confirm page should be what you redirect to after the update, not what does the insert.
edited May 23 '17 at 12:17
Community♦
11
11
answered Aug 7 '13 at 23:49
developerwjk
7,8262930
7,8262930
Not true - that can work but there's lots of times where you need to stay on same page
– anoldermark
Feb 3 '17 at 16:06
@mark If want to stay on the same page either use Ajax or redirect back to the same page with different parameters, but if you did a normal HTML submit and don't redirect and someone refreshes the page then the same parameters are resent and you get a double submit of that data.
– developerwjk
Feb 8 '17 at 20:52
add a comment |
Not true - that can work but there's lots of times where you need to stay on same page
– anoldermark
Feb 3 '17 at 16:06
@mark If want to stay on the same page either use Ajax or redirect back to the same page with different parameters, but if you did a normal HTML submit and don't redirect and someone refreshes the page then the same parameters are resent and you get a double submit of that data.
– developerwjk
Feb 8 '17 at 20:52
Not true - that can work but there's lots of times where you need to stay on same page
– anoldermark
Feb 3 '17 at 16:06
Not true - that can work but there's lots of times where you need to stay on same page
– anoldermark
Feb 3 '17 at 16:06
@mark If want to stay on the same page either use Ajax or redirect back to the same page with different parameters, but if you did a normal HTML submit and don't redirect and someone refreshes the page then the same parameters are resent and you get a double submit of that data.
– developerwjk
Feb 8 '17 at 20:52
@mark If want to stay on the same page either use Ajax or redirect back to the same page with different parameters, but if you did a normal HTML submit and don't redirect and someone refreshes the page then the same parameters are resent and you get a double submit of that data.
– developerwjk
Feb 8 '17 at 20:52
add a comment |
confirm_page.php:
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email')"); // <-- missing endquote and bracket here
header('Location: somewhere_else.php');
exit;
}
add a comment |
confirm_page.php:
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email')"); // <-- missing endquote and bracket here
header('Location: somewhere_else.php');
exit;
}
add a comment |
confirm_page.php:
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email')"); // <-- missing endquote and bracket here
header('Location: somewhere_else.php');
exit;
}
confirm_page.php:
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email')"); // <-- missing endquote and bracket here
header('Location: somewhere_else.php');
exit;
}
answered Aug 7 '13 at 23:50
Sammitch
19.8k42964
19.8k42964
add a comment |
add a comment |
The best way to prevent that is to add header('Location: filename') after your query. Thus in your case,
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email');
//must be inside the condition to prevent too many redirects
header('Location: user_details_page.php');
}
add a comment |
The best way to prevent that is to add header('Location: filename') after your query. Thus in your case,
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email');
//must be inside the condition to prevent too many redirects
header('Location: user_details_page.php');
}
add a comment |
The best way to prevent that is to add header('Location: filename') after your query. Thus in your case,
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email');
//must be inside the condition to prevent too many redirects
header('Location: user_details_page.php');
}
The best way to prevent that is to add header('Location: filename') after your query. Thus in your case,
if (isset($_POST['submit']))
{
$user= $_POST['username'];
$email = $_POST['useremail'];
$pass= $_POST['password'];
mysql_query("INSERT INTO table (username, useremail, email) VALUES ('$username','$useremail','$email');
//must be inside the condition to prevent too many redirects
header('Location: user_details_page.php');
}
edited Aug 8 '13 at 0:18
answered Aug 7 '13 at 23:50
Kim Barcelona
14
14
add a comment |
add a comment |
i have this solution by using session
<?php session_start();
if(isset($_POST[$_SESSION[a][count($_SESSION[a])-1]])){
echo "somthing....";
unset($_SESSION[a]);
}
else{
echo '<form method="post">';
$_SESSION["a"]=array();
$_SESSION["a"][0]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][0].'"><br>';
$_SESSION["a"][1]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][1].'"><br>';
$_SESSION["a"][2]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][2].'"><br>';
$_SESSION["a"][3]="a".rand(1,100);
echo '<input type="submit" name="'.$_SESSION["a"][3].'" value="submit"><br>';
echo '</form>';
}
?>
add a comment |
i have this solution by using session
<?php session_start();
if(isset($_POST[$_SESSION[a][count($_SESSION[a])-1]])){
echo "somthing....";
unset($_SESSION[a]);
}
else{
echo '<form method="post">';
$_SESSION["a"]=array();
$_SESSION["a"][0]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][0].'"><br>';
$_SESSION["a"][1]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][1].'"><br>';
$_SESSION["a"][2]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][2].'"><br>';
$_SESSION["a"][3]="a".rand(1,100);
echo '<input type="submit" name="'.$_SESSION["a"][3].'" value="submit"><br>';
echo '</form>';
}
?>
add a comment |
i have this solution by using session
<?php session_start();
if(isset($_POST[$_SESSION[a][count($_SESSION[a])-1]])){
echo "somthing....";
unset($_SESSION[a]);
}
else{
echo '<form method="post">';
$_SESSION["a"]=array();
$_SESSION["a"][0]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][0].'"><br>';
$_SESSION["a"][1]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][1].'"><br>';
$_SESSION["a"][2]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][2].'"><br>';
$_SESSION["a"][3]="a".rand(1,100);
echo '<input type="submit" name="'.$_SESSION["a"][3].'" value="submit"><br>';
echo '</form>';
}
?>
i have this solution by using session
<?php session_start();
if(isset($_POST[$_SESSION[a][count($_SESSION[a])-1]])){
echo "somthing....";
unset($_SESSION[a]);
}
else{
echo '<form method="post">';
$_SESSION["a"]=array();
$_SESSION["a"][0]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][0].'"><br>';
$_SESSION["a"][1]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][1].'"><br>';
$_SESSION["a"][2]="a".rand(1,100);
echo '<input name="'.$_SESSION["a"][2].'"><br>';
$_SESSION["a"][3]="a".rand(1,100);
echo '<input type="submit" name="'.$_SESSION["a"][3].'" value="submit"><br>';
echo '</form>';
}
?>
answered Aug 26 '13 at 22:30
hazem
1325
1325
add a comment |
add a comment |
We can stop it without redirect , best way to use PHP $_SESSION like this :
if($_SERVER['REQUEST_METHOD'] == 'POST' && empty($_SESSION['form_submit']) )
{
extract($_POST);
$sql=""INSERT INTO table (username, useremail, email) VALUES('$username','$useremail','$email')";
$_SESSION['form_submit']='true';
}
else
{
$_SESSION['form_submit']='NULL';
}
add a comment |
We can stop it without redirect , best way to use PHP $_SESSION like this :
if($_SERVER['REQUEST_METHOD'] == 'POST' && empty($_SESSION['form_submit']) )
{
extract($_POST);
$sql=""INSERT INTO table (username, useremail, email) VALUES('$username','$useremail','$email')";
$_SESSION['form_submit']='true';
}
else
{
$_SESSION['form_submit']='NULL';
}
add a comment |
We can stop it without redirect , best way to use PHP $_SESSION like this :
if($_SERVER['REQUEST_METHOD'] == 'POST' && empty($_SESSION['form_submit']) )
{
extract($_POST);
$sql=""INSERT INTO table (username, useremail, email) VALUES('$username','$useremail','$email')";
$_SESSION['form_submit']='true';
}
else
{
$_SESSION['form_submit']='NULL';
}
We can stop it without redirect , best way to use PHP $_SESSION like this :
if($_SERVER['REQUEST_METHOD'] == 'POST' && empty($_SESSION['form_submit']) )
{
extract($_POST);
$sql=""INSERT INTO table (username, useremail, email) VALUES('$username','$useremail','$email')";
$_SESSION['form_submit']='true';
}
else
{
$_SESSION['form_submit']='NULL';
}
answered Nov 20 '15 at 5:13
Ak Memon
116
116
add a comment |
add a comment |
The fast way is to redirect the page to it's current location:
if (isset($_POST['submit']))
{
//do somthing
header("Location: $current_url");
}
add a comment |
The fast way is to redirect the page to it's current location:
if (isset($_POST['submit']))
{
//do somthing
header("Location: $current_url");
}
add a comment |
The fast way is to redirect the page to it's current location:
if (isset($_POST['submit']))
{
//do somthing
header("Location: $current_url");
}
The fast way is to redirect the page to it's current location:
if (isset($_POST['submit']))
{
//do somthing
header("Location: $current_url");
}
answered Nov 23 '18 at 15:25
Eyal Sooliman
9801021
9801021
add a comment |
add a comment |
if($_POST(submit)
{
//database insertion query
// if successful insertion
{
echo"<script language='javascript'>alert('successfully inserted')</script>";
echo"<script>document.location='your_page.php';</script>;
}
}
add a comment |
if($_POST(submit)
{
//database insertion query
// if successful insertion
{
echo"<script language='javascript'>alert('successfully inserted')</script>";
echo"<script>document.location='your_page.php';</script>;
}
}
add a comment |
if($_POST(submit)
{
//database insertion query
// if successful insertion
{
echo"<script language='javascript'>alert('successfully inserted')</script>";
echo"<script>document.location='your_page.php';</script>;
}
}
if($_POST(submit)
{
//database insertion query
// if successful insertion
{
echo"<script language='javascript'>alert('successfully inserted')</script>";
echo"<script>document.location='your_page.php';</script>;
}
}
answered Apr 25 '18 at 11:44
Vishnu S
1
1
add a comment |
add a comment |
protected by Community♦ May 20 '18 at 19:46
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Are you manually using the browser's refresh/reload or do you click on a refresh button/link on the webpage?
– The Debi
Aug 7 '13 at 23:50
@The Debi, I mean the refresh button on the browser
– Mj Jam
Aug 8 '13 at 0:26
@nnichols, I did the validation and I put a specific part of the code to fix the problem
– Mj Jam
Aug 8 '13 at 0:29