Current location: Hot Scripts Forums » Programming Languages » PHP » Auto Submit Form


Auto Submit Form

Reply
  #1 (permalink)  
Old 05-30-06, 12:37 AM
ivan's Avatar
ivan ivan is offline
Newbie Coder
 
Join Date: Jul 2003
Location: malang-indonesia
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Auto Submit Form

Dear All,
I have a problem with auto submit form.
This is sample myform.php :
<?
echo "<form action=\"form_act.php\" name=\"tform\" method=\"POST\">";
echo "Name : <input type=\"text\" name=\"name\">";
echo "<input type=\"hidden\" name=\"fhidden\" value=\"My Place\">";
echo "<input type=\"submit\" name=\"submit\" value=\"SUBMIT\">";
echo("</form>");
?>

I have 2 conditions :
1) If press submit button, displayed :
Hello $_POST[name], welcome to $_POST[fhidden]

2) If not press submit button in 1 minute, auto displayed :
Time is Over ( Only 1 minute to put your name )
Hello $_POST[name], welcome to $_POST[fhidden]

help me..
__________________
irfani_f@yahoo.com
irfani.ptmunibraw.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 05-30-06, 02:13 AM
Grabber's Avatar
Grabber Grabber is offline
Newbie Coder
 
Join Date: Apr 2006
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
I am not getting your question fully but let me give you some idea and may it help.

in your form action page,

PHP Code:

if($_POST[submit]) {

// do whatever
}

else {

 
header("Refresh=60; URL='action.php' ");
   echo 
"dammit :D you have one minute<br />";
    echo 
"<input name=username size=12>";
  } 
I hope it will help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 05-30-06, 09:49 PM
ivan's Avatar
ivan ivan is offline
Newbie Coder
 
Join Date: Jul 2003
Location: malang-indonesia
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
thanks, i will try
__________________
irfani_f@yahoo.com
irfani.ptmunibraw.org

Last edited by ivan; 05-30-06 at 10:46 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 05-30-06, 10:37 PM
ivan's Avatar
ivan ivan is offline
Newbie Coder
 
Join Date: Jul 2003
Location: malang-indonesia
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Dear All,
i found it

<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<SCRIPT LANGUAGE="JavaScript"><!--
setTimeout('document.tform.submit()',60000);
//--></SCRIPT>

</head>

<body>
<form name="tform" id="tform" method="post" action="action.php">
<input name="name" type="text" id="name">
<input name="show" type="hidden" id="show" value="My Place">
<input type="submit" name="SEND" value="SUBMIT">
</form>
</body>
</html>

action.php:
<?
if ($_POST[SEND])
{
echo "Hello $_POST[name], welcome to $_POST[show]";
}
else
{
echo "Time is Over ( Only 1 minute to put your name )<br>";
echo "Hello $_POST[name], welcome to $_POST[show]";
}
?>

Thanks for your help.
__________________
irfani_f@yahoo.com
irfani.ptmunibraw.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Submit form automatically - not the submit button INTEL JavaScript 12 12-07-05 07:09 AM
submit from form 1 to form 3 bypassing form 2 buzzby PHP 1 06-01-05 03:06 PM
Form Validation - Prevent submit if fields are blank Cepeleon JavaScript 2 03-15-05 05:33 PM
submit form? tcooper PHP 5 12-12-03 04:30 PM
question on form and submit TxRanger JavaScript 2 11-03-03 12:28 PM


All times are GMT -5. The time now is 09:46 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.