SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cannot pull data from FORM

    Hi guys,

    When i submit my form the text page is supposed to output the data that i inserted into the textarea box and the form box, does anyone know why below is my code:

    newpost.php
    Code:
    <script src="nicEdit.js" type="text/javascript"></script>
    <script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>
    
    <div id="sample">
    
    <form name="form" action="function.php?method=posttopic" method="post">
    <b>Topic Name:</b> <input type="text" name="topicname" maxlength="30"><input type="hidden" name="topicname"><br></br>
    
    <textarea name="mtext" style="width: 100%; height: 75%;">Your message here...</textarea></div>
    
    <br><input type="submit" name="newpost" value="Post Topic">
    </form>


    function.php
    Code:
    <?php
    include "../config/database.php";
    $method=$_GET['method'];
    $messageid=$_GET['messageid'];
    $topicname=$_POST['topicname'];
    $mtext=$_POST['mtext'];
    
    if ($method=="posttopic")
    {
    echo "topic name is $topicname and text is $mtext";
    }
    ?>
    Animated Chatrooms - www.121chatrooms.net

  2. #2
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry guys problem fixed.
    Animated Chatrooms - www.121chatrooms.net


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •