How do I get an input form to reload itself

Reply

Join Date: Feb 2005
Posts: 1
Reputation: Swashbuckler is an unknown quantity at this point 
Solved Threads: 0
Swashbuckler Swashbuckler is offline Offline
Newbie Poster

How do I get an input form to reload itself

 
0
  #1
Feb 4th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 204
Reputation: pcschrottie is an unknown quantity at this point 
Solved Threads: 8
pcschrottie's Avatar
pcschrottie pcschrottie is offline Offline
Posting Whiz in Training

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

 
0
  #2
Feb 7th, 2005
What does the action attribute of the form - tag say?



Michael
Reply With Quote Quick reply to this message  
Join Date: Nov 2003
Posts: 360
Reputation: Gary King will become famous soon enough Gary King will become famous soon enough 
Solved Threads: 5
Team Colleague
Gary King's Avatar
Gary King Gary King is offline Offline
PHP/vBulletin Guru

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

 
0
  #3
Feb 11th, 2005
yes, check that; otherwise, just use header() function to redirect to desired page
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 31
Reputation: mcldev is an unknown quantity at this point 
Solved Threads: 2
mcldev mcldev is offline Offline
Light Poster

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

 
0
  #4
Feb 22nd, 2005
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC