Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coolgames
    New Member
    • Oct 2007
    • 168

    Form

    Hey, everything with the code works perfectly but 1 thing.... when a player submits something, the data goes trough but,

    the value='$note1' << doesn't seem to work... the form is just blank. Is there anyway i can make the data in $note1 appear?

    [HTML]
    rawoutput("<tex tarea name='note1' rows='10' cols='60' class='input' value='$note1'> </textarea>");
    rawoutput("<inp ut type='submit' class='button' value='".transl ate_inline("Sen d")."'></form>");
    [/HTML]
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    There is no such attribute as 'value' for <textarea>. To get it to appear, it needs to be between the element tags.

    Comment

    • coolgames
      New Member
      • Oct 2007
      • 168

      #3
      Originally posted by drhowarddrfine
      There is no such attribute as 'value' for <textarea>. To get it to appear, it needs to be between the element tags.
      o.o; was i stupid .... you are correct (= i placed $name between my element tags and it worked perfectly :P 1 more problem though

      When a user submits this form, i want him to be taken to 'mail.php' and i tried redirects and stuff but none of them seem to work. How can i re-direct once a user hits the Submit button?

      [HTML] rawoutput("<for m action='runmodu le.php?module=m ailnotepad&op=w rite' method='POST'>" );
      output("`)TESTI NG `0");
      rawoutput("<br> <textarea name='note1' rows='7' cols='60' class='input'> $note1 </textarea>");
      rawoutput("<inp ut type='submit' class='button' value='".transl ate_inline("Sub mit!")."'></form>");
      rawoutput("</form>");
      [/HTML]

      Comment

      • nomad
        Recognized Expert Contributor
        • Mar 2007
        • 664

        #4
        Originally posted by coolgames
        o.o; was i stupid .... you are correct (= i placed $name between my element tags and it worked perfectly :P 1 more problem though

        When a user submits this form, i want him to be taken to 'mail.php' and i tried redirects and stuff but none of them seem to work. How can i re-direct once a user hits the Submit button?

        [HTML] rawoutput("<for m action='runmodu le.php?module=m ailnotepad&op=w rite' method='POST'>" );
        output("`)TESTI NG `0");
        rawoutput("<br> <textarea name='note1' rows='7' cols='60' class='input'> $note1 </textarea>");
        rawoutput("<inp ut type='submit' class='button' value='".transl ate_inline("Sub mit!")."'></form>");
        rawoutput("</form>");
        [/HTML]

        you could try this, but this is done in PHP.
        [PHP]
        <?php
        // send email
        $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>" ); //this will change to your specs.
        // redirect to success page
        if ($success){
        print "<meta http-equiv=\"refresh \" content=\"0;URL =thankscontact. htm\">";//this will change to your specs.
        }
        else{
        print "<meta http-equiv=\"refresh \" content=\"0;URL =error.htm\">";
        }
        ?>

        [/PHP]

        nomad

        Comment

        • coolgames
          New Member
          • Oct 2007
          • 168

          #5
          Nope, that won't work at all since i am not doing this on a blank php/html page. The info and stuff will be stored in a Database, etc... it's for a core engine and that's how it should be done.

          Thanks though

          Originally posted by nomad
          you could try this, but this is done in PHP.
          [PHP]
          <?php
          // send email
          $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>" ); //this will change to your specs.
          // redirect to success page
          if ($success){
          print "<meta http-equiv=\"refresh \" content=\"0;URL =thankscontact. htm\">";//this will change to your specs.
          }
          else{
          print "<meta http-equiv=\"refresh \" content=\"0;URL =error.htm\">";
          }
          ?>

          [/PHP]

          nomad

          Comment

          Working...