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.

4
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by mcldev
0

A script can call itself by: $PHP_SELF (v4) or _SERVER (v5).

To make it happen in HTML, you simply need to add a statement like:

<form action="_SERVER" 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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.