MyBB Community Forums

Full Version: Help with my Code "Submit"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi to all i made this Html but i dont know how to send this to a specified group or person when he/ she submit the data. By the way im using the pagemanager script if you have any nice idea on how to implement it will be a nice idea.

[Image: agree.jpg]


This is my code
<html>

 <head>

 <title>{$mybb->settings['bbname']} - {$lang->registration}</title>

 {$headerinclude}

 </head>

 <body>

 {$header}
<br>
<br>
<br>

<div align="center">
<strong><center> Agreement</center></strong>
<table width="587">
                            <tr>
                              <td width="128">&nbsp;</td>
                            </tr>
                            <tr>
                              <td valign="top"><span class="h3">
<strong>                                <label for="first_name">First Name: </label>
                              </strong></span></td>
                              <td colspan="3" valign="top"><input  type="text" name="first_name" maxlength="50" size="30" />                              </td>
                            </tr>
                             <tr>
                              <td valign="top""><span class="h3">
<strong>                                <label for="last_name">Forum Username: </label>
                              </strong></span></td>
                              <td colspan="3" valign="top"><input  type="text" name="last_name" maxlength="50" size="30" />                              </td>
                            </tr>
                            <tr>
                              <td valign="top"><span class="h3">
<strong>                                <label for="email">Email Address: </label>
                              </strong></span></td>
                              <td colspan="3" valign="top"><input  type="text" name="email" maxlength="80" size="30" />                              </td>
                            </tr>
                            <tr>
                              <td valign="top" class="h3"><strong>
                                <label for="comments">Site Description: </label>
                              </strong> </td>
                              <td colspan="3" valign="top"><textarea  name="comments" maxlength="10000" cols="50" rows="6"></textarea></td>
                            </tr>
                            <tr>
                              <td style="text-align:center"><!-- We are grateful to you for keeping this link in place. thank you. --></td>
                              <td width="56""><input type="submit" value="Submit" /></td>
                              <td width="288" "></td>
                              <td width="80"></td>
                            </tr>
                          </table>

 </body>

 </html>
You need to enclose all your inputs in HTML <form> tags. Then set the action property of the form to point to the PHP file that handles the verifying/checking/sending of the message.

Form HTML forms with PHP, check this tut: http://www.tizag.com/phpT/examples/formex.php
Thanks Wildcard

May i also know how to deliver the message to a specific Group IP and a User ID?
A quick Google brought me this link to a thread right here on MyBB Dodgy http://community.mybb.com/thread-114471.html

Anytime I want to know how to do something in MyBB (or really in any language or platform), I just type what I want to know in Google and usually within minutes I have my answer. For your question, I just typed "mybb send a pm through php code" into Google and got pages of MyBB forum links Smile

Just trying to help you get answers quicker Wink
thanks Wildcard

Im having a difficulty because im trying to insert the code in my pagemanager
You're welcome m8 Smile
By the way Im having a difficulty because im trying to insert the code in my pagemanager
my pagemanager didnt accept the complete sample codes
Not knowing the situation it makes it hard to say but I think you need to follow the sample page manager file uploaded as php.xml and build a template and output it.

Then link the form to submit to the PHP file that gets the form data from $_POST and sends the PM. You can even simplify things by using an if() block to check $_POST and then set the form's action property to the same page manager page (ie misc.php?page=yourpage)

I am between projects so I would be willing to help if you get stuck.