| | |
How do I get an input form to reload itself
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2005
Posts: 1
Reputation:
Solved Threads: 0
Hi guys, hope you can help me. I've created a form in Dreamweaver (using the insert record wizard) which is linked to a MYSQL database. Trouble is once all the information is inputted and submitted I want the page to reload itself again so I have a fresh form to insert data again. For some reason it redirects to a new htm page (and not the PHP page I originally started with) e.g data.htm and not data.php. Any ideas would be appreciated.
•
•
Join Date: Feb 2005
Posts: 31
Reputation:
Solved Threads: 2
A script can call itself by: $PHP_SELF (v4) or _SERVER['PHP_SELF'] (v5).
To make it happen in HTML, you simply need to add a statement like:
<form action="_SERVER['PHP_SELF']" method="post">
Make sure you use the appropriate conditional so that the script does not get in a loop, i.e. if ($safe_to_proceed) { ... }. Similary if you wish to call your $PHP_SELF script direct from the script itself then we're talking recursion. So be forewarned that recursiuon is great but best used ONLY on simple tight algorithms.
To make it happen in HTML, you simply need to add a statement like:
<form action="_SERVER['PHP_SELF']" method="post">
Make sure you use the appropriate conditional so that the script does not get in a loop, i.e. if ($safe_to_proceed) { ... }. Similary if you wish to call your $PHP_SELF script direct from the script itself then we're talking recursion. So be forewarned that recursiuon is great but best used ONLY on simple tight algorithms.
![]() |
Similar Threads
- retain input data on page reload (PHP)
- How can we export datas to Excel sheet. Becaause the input is in given form? (C#)
- How do I get a form to capture ALL keyboard input? (C#)
- Input without a form for DLL (Visual Basic 4 / 5 / 6)
- Problem with Input Form (ASP)
- How do I create own Shout box/or input and display form? (PHP)
Other Threads in the PHP Forum
- Previous Thread: Can't connect error on createuser
- Next Thread: help with ip adresses!!!!!!!!!!!!!
| Thread Tools | Search this Thread |
.htaccess alerts apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code convert cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include insert ip javasciptvalidation javascript joomla keywords limit link login mail matching menu methods mlm multiple mysql network object oop paypal pdf php problem query radio random recursion recursive redirect remote script search securephp server sessions shot sms source space sql subscription syntax system table tutorial tutorials update upload url validator variable video web youtube





