1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Help Needed] Textarea to PHP

Discussion in 'PHP & Perl' started by zerodtk, Jun 30, 2011.

  1. zerodtk

    zerodtk Regular Member

    Joined:
    Jan 23, 2009
    Messages:
    210
    Likes Received:
    74
    Home Page:
    hey guys,

    so here's the situation...

    I just finished a web scraper, written in PHP, however I'm stucked at the easiest part of all -.-'

    please don't ask how, or why, I can't make this part work :D lol
    so
    let's say we create a small form like

    PHP:

    <form action="post.php" method="POST" />
    <
    textarea name="texta" id="texta" /></textarea>
    <
    input type="submit" name="submit" />
    </
    form>

    and let's create the post.php file which looks like this

    PHP:

    <?php

    echo $_POST['texta'];

    ?>

    it should work right? well, it shows absolutely nothing...
    any idea why? it drives me crazy -.-'

    the worst part of all, is that I have made like 1000 forms like this and never had a problem...now, it won't work :/

    thanks in advance,
    z
     
  2. redstone.1337

    redstone.1337 BANNED BANNED Jr. VIP Premium Member

    Joined:
    Dec 30, 2009
    Messages:
    1,259
    Likes Received:
    999
    The first thing I noticed:

    <textarea name="texta" id="texta" /></textarea>


    Correction:

    <textarea name="texta" id="texta"></textarea>
     
  3. zerodtk

    zerodtk Regular Member

    Joined:
    Jan 23, 2009
    Messages:
    210
    Likes Received:
    74
    Home Page:
    hah, yeah =D still not workin tho
     
  4. redstone.1337

    redstone.1337 BANNED BANNED Jr. VIP Premium Member

    Joined:
    Dec 30, 2009
    Messages:
    1,259
    Likes Received:
    999
    It should work, lemme try.

    EDIT: It is working. Try again. :)

    EDIT 2: Also remove the forward slash while opening the form tag. --> <form action="post.php" method="POST" />
     
    Last edited: Jun 30, 2011
  5. 0wned

    0wned Newbie

    Joined:
    Jul 14, 2009
    Messages:
    26
    Likes Received:
    21
    Occupation:
    Web Developer
    Location:
    London
    Looks like it should work. how about changing
    Code:
    <form action="post.php" method="POST" />

    to
    Code:
    <form action="post.php" method="post" />

     
  6. zerodtk

    zerodtk Regular Member

    Joined:
    Jan 23, 2009
    Messages:
    210
    Likes Received:
    74
    Home Page:
  7. clubbs

    clubbs Newbie

    Joined:
    Jan 5, 2009
    Messages:
    36
    Likes Received:
    8
    It should work.
    Is error reporting enabled on your server? May show something.
     
  8. redstone.1337

    redstone.1337 BANNED BANNED Jr. VIP Premium Member

    Joined:
    Dec 30, 2009
    Messages:
    1,259
    Likes Received:
    999
    Really weird, lol. The form is passing POST data normally (I copied your source to my page and tested) and working fine on my end. Try printing all the POST data in post.php.

    PHP:
    <?php

    echo "<pre>";
    print_r($_POST);
    echo 
    "</pre>";

    ?>
     
  9. zerodtk

    zerodtk Regular Member

    Joined:
    Jan 23, 2009
    Messages:
    210
    Likes Received:
    74
    Home Page:
    it says

    lol?:D
     
  10. xpwizard

    xpwizard Junior Member

    Joined:
    Nov 6, 2010
    Messages:
    198
    Likes Received:
    122
    In other words it's not your form that is having the problem, it's passing the data to your scraper that isn't working.

    We will need more info to help.
     
  11. zerodtk

    zerodtk Regular Member

    Joined:
    Jan 23, 2009
    Messages:
    210
    Likes Received:
    74
    Home Page:
    well, the standalone test script still won't work, however, I have added everything I wanted to the main scraper and guess what..it works like charm..not sure what the problem is tho..but it works perfectly!

    thank you all for your time and patience! keep up the good work guys!

    regards,
    z
     
  12. andey

    andey Newbie

    Joined:
    Jul 1, 2011
    Messages:
    8
    Likes Received:
    2
    Occupation:
    Rails Developer
    Location:
    Miami | Toronto
    create a phpinfo.php fle containing
    Code:
    <?php phpinfo(); ?>
    then send your form POST request to the php file as so
    Code:
    <form action="phpinfo.php" method="post">
    then scroll down all the way to the bottom and see what POST and REQUESTS it got.

    If you see nothing then it's a web server issue