Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Server-side Scripting _ PHP Form to a Forum

Posted by: Talas Mar 18 2007, 07:29 PM

Hello,
I am new to php scripting, but I want to be able to post a new topic (or post, if easier) from my php form that currently emails me to a phpbb forum. Is there any way to do this?

Posted by: Brian Chandler Mar 19 2007, 03:31 AM

Yes, of course there is. You make the form being submitted a (functional) copy of the form that submits to the forum in the usual way. For example, I am now typing in the text box of a forum submission form. If you copied the text of this form and put it inside a completely different page, the information sent to this forum would be exactly the same.


Posted by: Talas Mar 19 2007, 06:35 PM

how though

Posted by: Pattons3rd Mar 19 2007, 07:59 PM

Go to a reply page of the forum and copy the form code.
If you will post the URL I will try and get it for you.

Posted by: Talas Mar 19 2007, 10:57 PM

This is the forum, it currently emails me the info

CODE
<form method="post" action="http://admin.procgl.com/staff/staffapp.php" name="StaffApplication">
    <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">
    <!-- STEP 2: Put your email address in the 'recipients' value.
                 Note that you also have to allow this email address in the
                 $TARGET_EMAIL setting within formmail.php!
    -->
    <input type="hidden" name="recipients" value="staffapps6SBprocgl.com" />
    <!-- STEP 3: Specify required fields in the 'required' value -->
    <input type="hidden" name="required" value="email:Your email address,realname:Your name" />
    <!-- STEP 4: Put your subject line in the 'subject' value. -->
    <input type="hidden" name="subject" value="ProCGL Staff Application" />

    <table cellspacing="5%">
    <tr>
        <td>
        <p>Please enter your real name:</p>
        </td>
        <td><input type="text" name="realname" />
        </td>
    </tr>
        <tr>
        <td>
        <p>Please enter your game name:</p>
        </td>
        <td><input type="text" name="gamname" />
        </td>
    </tr>
    <tr>
        <td>
        <p>Please enter your email address:</p>
        </td>
        <td><input type="text" name="email" />
        </td>
    </tr>
    <tr>
        <td><p>Who told you we were looking for staff??</p>
        </td>
        <td>
    <select name="staffrecruiter[]" size="5">
     <option value="cory">UnderOath</option>
     <option value="talas">Talas</option>
     <option value="blade">Blade</option>
     <option value="irc">IRC Channel</option>
     <option value="other">Other</option>
    </select>
         </td>
    </tr>
    <tr>
        <td valign="top"><p>What Skills do you have??</p>
        </td>
        <td valign="top">
            <select name="skills[]" multiple size="5">
                <option value="HTML">HTML/PHP/MYSQL Coding</option>
                <option value="LeagueAdmin">League Administration</option>
                <option value="ForumAdmin">Forum Administration</option>
                <option value="LeagueExp">League Experiance</option>
                <option value="Other">Other (Please specify below)</option>
            </select>&nbsp;
            </ br><FONT
color=#c0c0c0>(Select all that apply; use CTRL-click to select)</font>
         </td>
    </tr>
    <tr>
        <td valign="top">
        <p>Why should we accept you?</p>
        </td>
        <td><textarea name="mesg" rows="10" cols="50"></textarea>
        </td>
    </tr>
    <tr>
        <td><input type="submit" value="Apply!" /></td>
        <td></td>
    </tr>
    </table>
</form>


I want it to post the info it would email me to a phpbb forum with the fourm id as 16 and the topic as 5

Posted by: Darin McGrew Mar 19 2007, 11:10 PM

What is the URL of the phpbb forum?

Posted by: Brian Chandler Mar 19 2007, 11:11 PM

Well, replace the code you have shown us with a copy of the submit form for the forum (which you haven't shown us, so we can't guess what it looks like). Then you can customise the appearance to look more like whatever your form now looks like.

Normally, though, a post to a forum does not specify the topic number, which would be assigned automatically. After all, what if there's already a topic number 5? If you want to add distinctly new functionality, you have to look at the forum program, and modify it accordingly. (Or of course pay someone else to do it for you.)

Posted by: Talas Mar 20 2007, 12:12 AM

its the standard posting.php for phpbb, and the link is forum.procgl.com

Posted by: Brian Chandler Mar 20 2007, 03:47 AM

Right, then use your browser to download the file http://forum.procgl.com/posting.php and look at the source of this page. Find the <form> tag that starts and </form> that ends the submission form. Clip this out, and paste it into your page, then modify as required.


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)