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
Help with syntax
Hi all!
The $bridge variable is not getting passed while it is contained in the line below:
Internal class functions don't seem to get executed.
Hi. Can someone please put me out of my misery on this. I don't write much PHP and this has me baffl
Downloading file (Headers)
I'm trying to make users download a file, but they must wait 60 seconds before it begins.
But
cURL Upload Help
OK, I am creating a bridge from a local program to my website and I am trying to find the best way t
Parse Error
Hi Guys,
I have a function in my class which returns a string link variable. The problem is i
Session
I am having a little trouble with a session. Not sure if it is my browser or what. I know I do not
Allegro crashes when running load_bitmap. Why?
I can not get Allegro to load any BMP images. Here is a section of test code. The picture is in the
EXplanation help
Hey all,
I am still fairly new to PHP programming and I am trying to put together a page wher
Certain files upload, while others do not
I want to read the data from an uploaded file. Not sure why, but it only uploads for certain files.
TimeStamp Column Problem...
I'm mad at my self and thinking I'm a little retarded. It just be some one mistake I'm missing here.