Function execution before page reload



Okay...I have another 'newbie' question;

I have a function that loads a page and the action is
$_SERVER['HTTP_SELF'];
In the form that is in a function(method?) within a class a variable
is passed back to a mysqli connection and database and updates the
database.
The problem is that when the page is reloaded it does not show the
updated information in the database with the $_SERVER['HTTP_SELF']. Why
is the page loaded with the same information? Is it cached from the
browser? Is there a way to have the functions execute before the
$_SERVER['HTTP_SELF'] action executes?

Example code ======================================
// Show info of users not updated
echo "<form action='".$_SERVER['PHP_SELF']."' method='post'><table
style=\"font: 14px solid #000000; border: 2px solid #CCC000;\">";
echo "<tr><td colspan='2' style=\"background: #C0C0C5; text-align:
center; font: 18px solid #000000;\">Credit Card
Applications</td></tr>";
echo "<tr><td colspan='2' style=\"background: #FFFFE0; text-align:
left; font: 12px solid #000000;\">New Applications In Database Needing
Approval:</td></tr>";
echo "<tr><tr><td colspan='2' style=\"border: 2px solid #000000;
width: 100%;\">";

if ($result->num_rows == 0) {echo "NO NEW APPLICATIONS<br />";}
while($row = $result->fetch_assoc()){

echo "<input type='checkbox' name='perinfo[]'
value='".$row['userID']."' >".$row['userID']." : ".$row['username']." -
".$row['recdate']."<br />";
} // end while
echo "</td></tr><tr>";
echo "<td align=\"center\"><input style=\"font: 10px solid
#000000;\" type=\"submit\" value=\"UPDATE INFO\" name='updatedb'
/></td><td style=\"text-align: center;\"><input type=\"reset\"
style=\"font: 10px solid #000000;\" value=\"RESET CHOICES\"
/></td></tr></form></table>";
$result->free();

} // end function

public function dbConnect(){
include('dbconn.php');
$mysqli = new mysqli($dbnet, $dbuser, $dbpass, $dbname);

if (mysqli_connect_errno()){ printf("Can't connect to MySQL Server.
Errorcode: %s\n", mysqli_connect_error());
exit;
} // end if
return $this->mysqli=$mysqli;


} // end function
End Example Code ===================================================

Thanks for the help!

Schmidty

.



Relevant Pages

  • Re: Seeking VB.net tutor
    ... I started as a newbie in November, I had no VBA, or access programming ... I started with some simple applications, and database, if I got ... stuck I asked a question here. ... There are loads of poeple in here always willing to help. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: include_once() within a function
    ... Mikhail Kovalev wrote: ... I've never had a PHP file take that long! ... It loads a 1,8 MB array stored as serialized in a file....=) ... A relational database would speed things up considerably. ...
    (comp.lang.php)
  • Re: One Time Popup Form
    ... using the startup properties of your database. ... I am a newbie at access and it would help if you gave me a step by step list. ... the data gets saved to the underlying table. ...
    (microsoft.public.access.formscoding)
  • Re: Setting drop-down box to database value
    ... You would have to have a recordset that loads the values into the dropdown, ... Total_Hours is a drop-down box. ... | the value stored in the database. ...
    (microsoft.public.frontpage.programming)
  • Getting a list of static objects.
    ... I have a test application that loads some data from a database. ... is then iterated a number of times, and the memory consumption of the ... stack variable is holding a reference (I use static variables heavily for ...
    (microsoft.public.dotnet.framework)