Showing results 1 to 19 of 19

Thread: PHP form submit -> forum post

  1. #1
    Senior Member
    Retired Staff Member

    Celestial Entity
    gamepin126's Avatar
    Join Date
    Oct 2004
    Posts
    20,793

    Default PHP form submit -> forum post

    I don't know anything about PHP, but I'm confident in my ability to stumble around a language until I get what I want. Thing is I don't really know where to begin looking so if someone could point me in any direction I'd appreciate it.


    Basically I want a PHP page to have several form inputs. When the user hits sumbit, a 'bot' will make a forum post in the mod forums. Also upon being accepted, it will auto create the account. tbh I'd be totally happy with just the first part, the second would just be nice.

    It's very similar to this
    Insomniax: I wish I was hardcore...

    but it lacks the bot feature and I don't have access to the code. I'm using Joomla and PHPBB3. Although I'm not using Joomla as a CMS, however it will be the wrapper for the php script I'm writing, if that's of any consequence.

    To reiterate, I'm not looking for handouts or anything (although I won't be refusing any) but maybe some links on form->db requests and db->bot forum posts would be very helpful. I tried looking and everything I found was so vague that I couldn't really tell if it was what I wanted or not, or totally off base to begin with.
    "A Responsible Citizen Not Only Shares Culture, But Destroys The Copyright Industries"

    "Elegance is not a dispensable luxury but a quality that decides between success and failure. "
    "It Don't Mean a Thing (If It Ain't Got That Swing)"
    “Absence of evidence is not evidence of absence.”

  2. #2

    High Priest
    arcanise's Avatar
    Join Date
    Jul 2009
    Location
    yuma arizona
    Posts
    1,598

    Default

    get opera, right click desired webpage and click source

    a page will load with the exact coding

    its best to use phpbb
    mobo ASUS P6X58D Premium
    CPU Intel i7 965 bloomfield xe OC'd 3.6Ghz
    ram OCZ gold edition 12GB 1600 Mhz DDR3
    video GTX 465 OC'd 770//1540//1700 CSM
    HDD's 1X kingston 60GB SSD
    HDD's 1X WD 512GB 10,000 RPM
    HDD's 1X WD 1TB 7200 RPM
    Case Cooler master sniper
    cool things Aerocool touch screen fan controller
    OS: win 7 ult X64

  3. #3
    Senior Member

    Inquisitor
    MiCrOz's Avatar
    Join Date
    Aug 2005
    Location
    Cherry Hill, NJ
    Posts
    4,807

    Default

    Quote Originally Posted by arcanise View Post
    get opera, right click desired webpage and click source

    a page will load with the exact coding

    its best to use phpbb

    Quote Originally Posted by Dyndrilliac View Post
    Seriously, I have done a lot of drugs. A lot of ****ing drugs. I would snort a line of cocaine off a piss stained urinal in some truck-stop dive with my closest friends and family looking on in disgust before I took anything from somebody I didn't know and trust. That's just ****ing dumb.

  4. #4
    MENOS EL OSO Senior Member
    Moderator

    Prophet
    kds's Avatar
    Join Date
    Sep 2004
    Location
    Chicago
    Posts
    6,990

    Default

    well i can give you started on a few things.
    to post some form data to a php page, you do something along the lines of this

    in a .html file (or .php file even)
    Code:
    <form action="mypage.php" method="POST">
    <input type="text" name="mydata1">
    <input type="text" name="mydata2">
    <input type="submit" value="Submit">
    </form>
    mypage.php
    Code:
    // all data posted will be in the array $_POST
    $mydata1 = $_POST['mydata1'];
    $mydata2 = $_POST['mydata2'];
    // now to insert this into a database (assuming MySQL)
    mysql_connect('server', 'user', 'pass');
    mysql_select_db('db_name');
    mysql_query("INSERT INTO tableName (tableField1, tableField2) VALUES('".$mydata1."', '".$mydata2."')));
    so this code just posts two text fields to a php page and then inserts them into some database. i'm not sure if this is what you're looking for? just a starter. tell me if you need more help.
    Quote Originally Posted by Fagazukin
    It's been clear that some are convinced that Aka is really a psychological problem retard

  5. #5
    custom user title Senior Member

    Crusader
    applesauce's Avatar
    Join Date
    Jun 2004
    Posts
    3,433

    Default

    It sounds to me like you need to do some reading on HTML DOM:
    HTML DOM Introduction

    Then see:
    PHP Simple HTML DOM Parser

    And read:
    PHP Forms

    Then make it safe:
    PHP: str_replace - Manual
    Tip: Protect yourself against SQL Injection

    Not exactly a hand out but if I understand what you're after, this is a pretty good intro to doing what you want. I've used the same methods to make a 'bot' to steal content from tube sites.

  6. #6
    Senior Member
    Retired Staff Member

    Celestial Entity
    gamepin126's Avatar
    Join Date
    Oct 2004
    Posts
    20,793

    Default

    Thanks for the links I'll make sure to go through those. I made my forms and the tables in the db so I'm right at that point.
    "A Responsible Citizen Not Only Shares Culture, But Destroys The Copyright Industries"

    "Elegance is not a dispensable luxury but a quality that decides between success and failure. "
    "It Don't Mean a Thing (If It Ain't Got That Swing)"
    “Absence of evidence is not evidence of absence.”

  7. #7
    custom user title Senior Member

    Crusader
    applesauce's Avatar
    Join Date
    Jun 2004
    Posts
    3,433

    Default

    Oh, if the database is something that is on your side, you won't have to worry about any of the html dom stuff. I thought you were trying to remote post.

  8. #8
    Senior Member
    Retired Staff Member

    Celestial Entity
    gamepin126's Avatar
    Join Date
    Oct 2004
    Posts
    20,793

    Default

    No, I'm reading the inputs and formatting them and storing it into the DB. The bot's going to look for a boolean and if there's one that not off it's going to post it. And by bot I just mean some account that's not associated with anyone, that only posts these things.
    "A Responsible Citizen Not Only Shares Culture, But Destroys The Copyright Industries"

    "Elegance is not a dispensable luxury but a quality that decides between success and failure. "
    "It Don't Mean a Thing (If It Ain't Got That Swing)"
    “Absence of evidence is not evidence of absence.”

  9. #9

    Default

    It's impossible to post things via a bot.... How would that even work?

  10. #10
    Senior Member

    Inquisitor
    MiCrOz's Avatar
    Join Date
    Aug 2005
    Location
    Cherry Hill, NJ
    Posts
    4,807

    Default

    Quote Originally Posted by sd333221 View Post
    It's impossible to post things via a bot.... How would that even work?
    Hardly impossible. You've obviously never noticed the spambots that post on here.

    Unless you mean by a SC bot, which in that case is still hardly impossible.

    Quote Originally Posted by Dyndrilliac View Post
    Seriously, I have done a lot of drugs. A lot of ****ing drugs. I would snort a line of cocaine off a piss stained urinal in some truck-stop dive with my closest friends and family looking on in disgust before I took anything from somebody I didn't know and trust. That's just ****ing dumb.

  11. #11
    MENOS EL OSO Senior Member
    Moderator

    Prophet
    kds's Avatar
    Join Date
    Sep 2004
    Location
    Chicago
    Posts
    6,990

    Default

    Quote Originally Posted by sd333221 View Post
    It's impossible to post things via a bot.... How would that even work?

    wf are you talking about? shut the **** up and don't post here.
    Quote Originally Posted by Fagazukin
    It's been clear that some are convinced that Aka is really a psychological problem retard

  12. #12

    Default

    Ok there are two approaches.
    For the clean approach you need access to the forum database, then you can add a post by using mysql queries.
    For the dirty approach you can simulate http-post and get requests to manually add the post as if a user would make it

  13. #13
    MENOS EL OSO Senior Member
    Moderator

    Prophet
    kds's Avatar
    Join Date
    Sep 2004
    Location
    Chicago
    Posts
    6,990

    Default

    so why the **** did you say it's impossible?
    Quote Originally Posted by Fagazukin
    It's been clear that some are convinced that Aka is really a psychological problem retard

  14. #14
    custom user title Senior Member

    Crusader
    applesauce's Avatar
    Join Date
    Jun 2004
    Posts
    3,433

    Default

    Quote Originally Posted by sd333221 View Post
    It's impossible to post things via a bot.... How would that even work?
    Php script running on a cron job, or an app written in language of your choice, with access to the database.

  15. #15

    Default

    Quote Originally Posted by kds View Post
    so why the **** did you say it's impossible?
    Because I first thought it was impossible but was mistaken as it seems

  16. #16
    MENOS EL OSO Senior Member
    Moderator

    Prophet
    kds's Avatar
    Join Date
    Sep 2004
    Location
    Chicago
    Posts
    6,990

    Default

    Quote Originally Posted by kds View Post
    wf are you talking about? shut the **** up and don't post here.
    Quote Originally Posted by Fagazukin
    It's been clear that some are convinced that Aka is really a psychological problem retard

  17. #17
    =) Senior Member
    Developer

    Supreme Being
    K? Pŕo?ćtiόnŹ's Avatar
    Join Date
    Oct 2004
    Posts
    11,794

    Default

    If my browser can submit forms why cant any other application I make?
    Quote Originally Posted by Voice Of Korhal View Post
    Let us hope so, if that Reverse Engineering crap actually works, I'll be amazed.

  18. #18
    KC's Seal of Approval
    Disciple
    stopthe_bomb's Avatar
    Join Date
    Nov 2008
    Location
    Couldn't think of anything clever...
    Posts
    544

    Default

    So basically for the first part you just need an HTML page with the form and all the inputs? You can do all of that with dreamweaver without knowing the first thing about HTML. Sorry if I'm just completely off the subject with what your talking about, but I took a few Web Design classes and this all sounds really familiar. I know by setting the method to post the target to self and the action to mailto:[email protected] the form information will be sent to your email. How would you go about getting it into a database?

    I'm curious ^^
    7654321 1234567

  19. #19
    MENOS EL OSO Senior Member
    Moderator

    Prophet
    kds's Avatar
    Join Date
    Sep 2004
    Location
    Chicago
    Posts
    6,990

    Default

    Quote Originally Posted by stopthe_bomb View Post
    So basically for the first part you just need an HTML page with the form and all the inputs? You can do all of that with dreamweaver without knowing the first thing about HTML. Sorry if I'm just completely off the subject with what your talking about, but I took a few Web Design classes and this all sounds really familiar. I know by setting the method to post the target to self and the action to mailto:[email protected] the form information will be sent to your email. How would you go about getting it into a database?

    I'm curious ^^
    you must post it to a page that can handle posted data and also interact with a database. pinner is using PHP to do this. if you look at my first post in this thread, i posted a small example that does this.
    Quote Originally Posted by Fagazukin
    It's been clear that some are convinced that Aka is really a psychological problem retard

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 05-08-2007, 02:45 PM
  2. Submit Quote?
    By Ideal Maxima in forum Flame Board
    Replies: 10
    Last Post: 01-11-2007, 04:48 PM
  3. Submit a storyline contest
    By DA( in forum Graphics and Arts
    Replies: 0
    Last Post: 06-25-2006, 12:03 PM

Posting Rules

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