Hi,

I insert into database with Submit button in same page. After clicking submit, i want whole page to be refreshed. How can i do it? Code is below and where can i add something to refresh after insert.

Thanks

<form name="form1" method="post" action="">
.....
<input type="submit" name="Submit" value="Add" onClick="javascript: form.action='insert.php';">
</form>
<?php
if ($_POST["Submit"] == "Add") {
....inserting data in here
}
?>

Recommended Answers

All 2 Replies

You are going to have to stick this part:

<?php
if ($_POST["Submit"] == "Add") {
....inserting data in here
}
?>

at the top so that you don't leave any white space before the opening <?php tag. Then after your mysql_query use a the header() function.

header("location: " . $_SERVER['REQUEST_URI']);

hi friends,

I just wanna know how can we add a reply option on every comment in php.
please help us

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.