Page Reload
Posted on
16th Feb 2014 07:03 pm by
admin
I am having issues getting a page to reload after I submit data to a database. This form should input data to a DB and then I want it to reload and list what is in database. I have gotten it to reload and list the data but it always lists everything through to the second to last entry. The most current entry does not get listed. I must refresh the page to get it to list.
main form
Code: [Select]<?php
Did you know?Explore Trending and Topic pages for more stories like this.
include 'refresh.php'; //should refresh the page
include 'dbc.php'; //database connection
include 'list_categories.php'; //lists all the categories from the database
echo "<br />";
?>
<form name="form1" method="post" action="add_category.php">
Add Category : <input name="category" type="text" id="category"><input type="submit" name="submit" value="Submit"></p>
</form>
<form name="form2" method="post" action="delete_category.php">
Delete: <?php include 'get_categories.php'; ?><input type="submit" name="submit" value="Submit">
</form>
<a href="http://budget.themarkhart.com/delete_all_categories.php">Delete All</a>
<a href="menu.php">Menu</a>
refresh.php
Code: [Select]<?php
$page = $_SERVER['PHP_SELF'];
header("Refresh: url=$page");
?>
list.php
Code: [Select]<?php
include 'dbc.php';
$result = mysql_query("SELECT * FROM categories order by category ASC");
while($row = mysql_fetch_array($result))
{
echo $row['category'];
echo "<br />";
}
?>
No comments posted yet
Your Answer:
Login to answer
103
23
Other forums
Where do I put CRON code
So I've figured out alot about how to automatically run a php function. I can't figure out where to
(sub)screen resize modification doesn't work after ECC 6 EhP 4 installation
Hello,
We have previously extended the size of the custom data tab on PO transaction ME23
Libraries in C++
Hi all,
I have two libraries. one is based targeted on linux platform and uses another li
how to timeout $doc = new DOMDocument()->load($url)
I am currently using this $doc->load($url) to fetch an rss feed.
If a feed takes long than
Curly Bracket Delimeters.
I'd always believed that the starting and ending delimeters in preg_ functions had to be the same ch
Beginner question regarding Array's
Hi everyone, the page im working on has an array of variable at the top...
Code: $define_li
How to Handle more than one submit button in single form?
Hi
I have one PHP file which contains one Form. In this form there are two Submit type Buttons
Embedding flash object in Else statement
This is my first major project in PHP and I'm having some trouble embedding a flash object in an Els
Getting PHP to ammended the selected in option field
Hey Guys
thanks for everyones help so far. This site and its users are oozing awesomness.
Looking for help on using joining mysql tables and php....
Does anyone have any good links to references on how to pull mysql data, through joining tables and