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
Running a cron job through PHP/Apache?!
Hello all,
I have a PHP script which makes a cron file from user input. When i try to run the cro
having a small php error tha deals with the 'foreach'
Last night i was working on a script for a cart and it seemed to working good, until this morning. F
Problems generating word documents on server side for security reasons
I have a problem with word documentation generation when generating a word document (docx) with PHP.
Error In Syntax
I got this error:
Code: Parse error: syntax error, unexpected '>' in /home/bucket/publ
Google Wave
So... has anyone used it yet? Is it any good?
http://wave.google.com/help/wave/about.html#vid
upload form file types....
Hey all, I am learning PHP and I am writing a script from the W3C Schools tutorials for uploading fi
Why will this program not run if the variables are not global?
Hey guys I have a kind of perplexing situation that is probably simple, but I can't seem to understa
Transform value 0 in no and 1 in yes help needed
Hello,
I have this in the table: "value" type int 0 to represent false and 1 to represe
BAPI BBP_INB_DELIVERY_CREATE - material number missing in delivery
Hi Experts,
I was able to successfully create an Inbound delivery with reference to a PO
Basic Forum Tutorial
Hi, I'm new to PHP. I want to build a basic forum for my site using PHP and MySQL. I've searched t