HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Confirmation page problem
Post new topic   Reply to topic    HTML Help Forum -> HTML Form
View previous topic :: View next topic  
Author Message
httpnewcomer



Joined: 06 Sep 2009
Posts: 3

PostPosted: Sun Sep 06, 2009 7:43 pm     Confirmation page problem Reply with quote

On the form of my html file, I want the user to double check if they really want to SEND the information to me.

I want to do it like this:
1) after the user hitting the "SEND" button on my .html page (see below), I will bring him to the confirm.php page (see below).
2) Then he needs to hit "yes" or "no" to confirm his action.

I read some posts here and end up into the following codes. But it doesn't work that the "Status" valuable is not passed to the .php file, i.e. the "echo $_SESSION['info1']" command is not carried out if I hit the "yes" botton. (The echo "Yes"; command works fine.)

Can someone help me? Thanks!


----------------------------------------
.html file
----------------------------------------
<form method="POST" action="./confirm.php" TARGET="_blank">
<input type="radio" name="Status" value="Good">
<input type="submit" name="submit" value="Send">
</form>

----------------------------------------
confirm.php file
----------------------------------------
<?php
session_start();
$Status = Trim(stripslashes($_POST['Status']));
$_SESSION['info1'] = $_POST['Status'];
?>

<form method="post">
<fieldset>
<legend>Confirmation</legend>
Do you really want to do something?
<input type="submit" name="confirm" value="Yes">
<input type="submit" name="confirm" value="No">
</fieldset>
</form>

<?php
switch($_POST['confirm']) {
case 'Yes':
echo $_SESSION['info1'];
echo "Yes";
break;
case 'No':
echo "No";
break;
}
?>
httpnewcomer



Joined: 06 Sep 2009
Posts: 3

PostPosted: Mon Sep 07, 2009 7:53 am     Reply with quote

p.s. I am new in writing html etc. I heard that the double check can be done by using JAVA, but I don't want to use it since some web browser may block it.

If possible, can anyone help me to modify the code above to work or write a code for me using php and html?
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> HTML Form All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial