944,211 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 11435
  • PHP RSS
Feb 4th, 2005
0

How do I get an input form to reload itself

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Swashbuckler is offline Offline
1 posts
since Feb 2005
Feb 7th, 2005
0

Re: How do I get an input form to reload itself

What does the action attribute of the form - tag say?



Michael
Reputation Points: 11
Solved Threads: 8
Posting Whiz in Training
pcschrottie is offline Offline
204 posts
since Dec 2004
Feb 11th, 2005
0

Re: How do I get an input form to reload itself

yes, check that; otherwise, just use header() function to redirect to desired page
Team Colleague
Reputation Points: 53
Solved Threads: 5
PHP/vBulletin Guru
Gary King is offline Offline
360 posts
since Nov 2003
Feb 22nd, 2005
0

Re: How do I get an input form to reload itself

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.
Reputation Points: 10
Solved Threads: 3
Light Poster
mcldev is offline Offline
31 posts
since Feb 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Can't connect error on createuser
Next Thread in PHP Forum Timeline: help with ip adresses!!!!!!!!!!!!!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC