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
MII Netweaver Server stopped due to CPIC connection Problem
Dear Experts,
We have SAP XMII 12.0 setup running on Netweaver 2004s,7.0, Java Stack only.
classic dynpro : hide area and auto adjust hights
Hi,
I want to develop a similar user interface as is used in standard transaction MIGO.
Splitting Attributes
SQL> SELECT I_NAME, substr(I_NAME,1,instr(I_NAME,'O')) "First part",
substr(I_NAME, IN
Sending CC Info by email
I am a little bit less knowledgable in the security area as most developers and I know I have a lot
Using Microsoft Exchange Server with PHP
Hi,
I wanted to know if its possible to fetch email attachments from the exchange server usin
PHP submit form script causing blank page
Im trying to submit a form using this script, however nothing shows up on the page, does anyone know
Create PHP table grid help, please
I have a MySQL database setup, now it's time for the table (gridview) design in php. Here's the prob
VAT
how should I deal with VAT?
if I have a product that costs £5.00 and VAT @ 17.5% (£0.87
Binding 2 UDP sockets on same port, connected to different destinations, 1 receives
Hello,
My application wants to send/recv data to 2 different UDP ports on a remote computer, us
Mass activity scheduling
Hi experts,
Im facing some problems to deal with mass activity jobs.
When I run some