Need help with saving and displaying form answers

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
getchoo
Forum Newbie
Posts: 1
Joined: Fri Sep 02, 2005 7:20 pm

Need help with saving and displaying form answers

Post by getchoo »

OK, first off I don't know what I'm doing at all. I'm using a wysiwyg program(I need to take some classes). Occasionally going to the source and fixing/figuring stuff out. I have it all pretty much working the way I want it to. Except the form. It has name, email and comments. When they hit submit it goes to the thank you page. I want the thank you page to display the name and comments. Then I want the email to be saved to a text file. I have searched for days but cant find anything. I kinda find stuff but then just fiddle with it, because I have no clue what I'm doing. They cant be that hard but I don't know where to start. Any help getting it up and running would be greatly appreciated. Again all I need is for the form email to be saved to a text file, and the name and comments be displayed on the thank you page. Man it stinks to try and do something when your lost.


Here is the whole page. Again if this is wrong I'm sorry. Clueless.




Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<!--  Created with the CoffeeCup HTML Editor 2005  -->
<!--           http://www.coffeecup.com/           -->
<!--        Brewed on 8/29/2005 8:53:54 AM         -->
<head>
  <title>Crispin Glover for Joker</title>
  <meta name="generator" content="CoffeeCup HTML Editor 2005G -  http://www.coffeecup.com">
  <meta name="description" content="A petition, to get Crispin Glover to play the role of The Joker in the Batman Begins sequel.">
  <meta name="keywords" content="Batman Begins, Batman Begins com, batman begins sequel, batman begins dvd batman begins review, batman begins soundtrack,  batman begins pic,  batman begins cast,  batman begins joker,  batman begins toy,  batman begins rumor,  batman, Christian Bale  batman begins, Batman Returns, Batman and Robin, Batman Forever, Batman Returns, batman joker, joker, joker crispin glover, crispin glover joker">
</head>
<body bgcolor="#000000" text="#ffffff" link="#c0c0c0" vlink="#969696" alink="#ff0000">
<p style="MARGIN: 1em auto; FONT: 11px arial,sans-serif; TEXT-ALIGN: center" align="center"><a title="Pre-Order Batman Today" href="http://www.amazon.com/exec/obidos/ASIN/B000AU9UYM/davesmostlyab-20" target="http://www.amazon.com/exec/obidos/ASIN/B000AU9UYM/davesmostlyab-20"></a><a href="http://www.amazon.com/exec/obidos/ASIN/B000AU9UYM/davesmostlyab-20" target="_blank"><IMG style="Z-INDEX: 100; LEFT: 118px; POSITION: absolute; TOP: 66px" height=70 alt="" src="Preorder.gif" width=113 border=0></a><IMG style="Z-INDEX: 100; LEFT: 788px; POSITION: absolute; TOP: 345px" height=164 alt="" src="Crispin Joker.gif" width=130 border=0><IMG style="Z-INDEX: 100; LEFT: 108px; POSITION: absolute; TOP: 334px" height=230 alt="" src="Joker Text.gif" width=640 border=0><a href="http://www.amazon.com/exec/obidos/ASIN/B000AU9UYM/davesmostlyab-20" target="_parent"><IMG style="Z-INDEX: 100; LEFT: 83px; POSITION: absolute; TOP: 111px" height=113 alt="" src="Batman DVD.gif" width=100 border=0></a><a title="Pre-Order Batman Begins Today" href="http://www.amazon.com/exec/obidos/ASIN/B000AU9UYM/davesmostlyab-20" target="http://www.amazon.com/exec/obidos/ASIN/B000AU9UYM/davesmostlyab-20"></a></p>
<p style="MARGIN: 1em auto; FONT: 11px arial,sans-serif; TEXT-ALIGN: center" align="center"><IMG height=34 alt="" src="Crispin TOP.gif" width=240 border=0></p>
<p style="MARGIN: 1em auto; FONT: 11px arial,sans-serif; TEXT-ALIGN: center" align="center">&nbsp;</p>
<p style="MARGIN: 1em auto; FONT: 11px arial,sans-serif; TEXT-ALIGN: center" align="center"><IMG height=100 alt="" src="Batman Logo.gif" width=260 border=0><br><font color="#800080"></p><A href="index.html">
<div style="Z-INDEX: 100; LEFT: 103px; POSITION: absolute; TOP: 270px"><font face="Fixedsys" color="#ffffff" size="5">Home</font></div></a><A href="The_Batcave.php">
<div style="Z-INDEX: 100; LEFT: 189px; POSITION: absolute; TOP: 271px"><font face="Fixedsys" color="#ffffff" size="5">The Batcave</font></div></a></FONT><!-- phpForms.net form BEGIN -->
<STYLE>
<!--
.phpForms_pgtitle
{
    font-family : Arial;
    font-size   : 18px;
    color       : #1200d9;
    font-weight : bold;
}
.phpForms_btn
{
    border-top-width    : 1px;
    border-left-width   : 1px;
    border-bottom-width : 1px;
    border-right-width  : 1px;
    border-top-color    : #e4e4e4;
    border-left-color   : #e4e4e4;
    border-right-color  : #c1c1c1;
    border-bottom-color : #c1c1c1;
    font                : Verdana, Arial, Helvetica, sans-serif;
    color               : #000000;
}
-->
</STYLE>

<script language="JavaScript">
<!--
var aIds = Array( 'pg_8b349cd230' );
function ChangePage( to_hide, to_show )
{
   var tbl_hide = document.getElementById( aIds[to_hide] );
   var tbl_show = document.getElementById( aIds[to_show] );

   if ( typeof(tbl_hide)=='object' && tbl_hide!=null )
    if ( typeof(tbl_show)=='object' && tbl_show!=null )
    {
       tbl_hide.style.display = 'none';
       tbl_show.style.display = '';
    }
}
function NotEmpty( old_res, id, field_title )
{
   if ( old_res==0 )
   {
      var el = document.getElementById( id );
      if ( typeof(el)=='object' && el!=null )
        if ( el.value=='' )
        {
           alert( 'Please fill in your "' + field_title + '"' );
           return 1;
        }
   }
   return 0;
}

-->
</script>

<p align="left"><br><br><br><br><font face="Fixedsys" size="5">&nbsp;</p>
<div style="Z-INDEX: 100; LEFT: 398px; POSITION: absolute; TOP: 270px"><font face="Fixedsys" size="5">Pictures</font></div>
<p align="left"></FONT><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<input type="hidden" name="act" value="idx">
<input type="hidden" name="code" value="01">
<input type="hidden" name="fid" value="d473c4c47e">

<script language="JavaScript">
<!--
function CheckPage8b349cd230()
{
   var nResult = 0;
   nResult += NotEmpty( nResult, 'fld_4d70dcc312','Name' );
   nResult += NotEmpty( nResult, 'fld_df5e650281','E-Mail' );
   nResult += NotEmpty( nResult, 'fld_eb79272ab8','Comments' );

   if ( nResult == 0 )
   {
      if (1)
      {
         var el = document.getElementById( 'frm_d473c4c47e' );
         if ( typeof(el)=='object' && el != null ) el.submit();
      }
      else ChangePage( 0, 1 );
   }
}
-->
</script>
 <!-- Page --></p>
<div align="left">

<form name="frm_d473c4c47e" id="frm_d473c4c47e" method="post" enctype="multipart/form-data" action="http://www.crispingloverforjoker.com/Thank_You.php" onsubmit="return false;">
     <table id="pg_8b349cd230" border="0" cellpadding="2" cellspacing="1" width="600" bgcolor="#000000" class="phpForms_main" style="BORDER-RIGHT: #777777 1px solid; BORDER-TOP: #777777 1px solid; BORDER-LEFT: #777777 1px solid; BORDER-BOTTOM: #777777 1px solid">


      <tr>
          <td width="30%" align="middle" bgcolor="#000000" valign="top">
      <p align="center">
             <span>Name</span> </p>
          </td>
          <td width="70%" align="enter" bgcolor="#000000">
             <input name="fld_4d70dcc312" id="fld_4d70dcc312" style="WIDTH: 100%">
          </td>
      </tr>
      <tr>
          <td width="30%" align="middle" bgcolor="#000000" valign="top">
             <span>E-Mail</span>
          </td>
          <td width="70%" align="middle" bgcolor="#000000">
             <input name="fld_df5e650281" id="fld_df5e650281" style="WIDTH: 100%">
          </td>
      </tr>
      <tr>
          <td width="30%" align="middle" bgcolor="#000000" valign="top">
             <span>Comments</span>
          </td>
          <td width="70%" align="middle" bgcolor="#000000">
             <input name="fld_eb79272ab8" id="fld_eb79272ab8" style="WIDTH: 100%">
          </td>
      </tr>

      <tr><!-- Buttons -->
          <td colspan="2" align="middle" class="phpForms_main">
            <input type="button" value="Submit" onclick="CheckPage8b349cd230();" style="WIDTH: 30%; BACKGROUND-COLOR: #a2a2a2" class="phpForms_btn">

          </td>
      </tr>

     </table><!-- /Page -->

</form></div><!-- /phpForms.net form END -->




</body>
</html>
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

You have to write the code for your http://www.crispingloverforjoker.com/Thank_You.php page.

Simply test if the required $_POST['whatever'] are set.
Echo the variables.
Meaby send a mail to you.
And finally fwrite the data in a file.
Post Reply