Form Problem

Discussion forum for MOD Writers regarding MOD Development.
Locked
Section 31
Registered User
Posts: 89
Joined: Sun Jul 18, 2010 3:02 am
Name: Richard Evans
Contact:

Form Problem

Post by Section 31 »

Hi All,

Okay, i have created a form, with php coding, and with my websites theme, however, the submit button is missing. Now, i have got the code in there, however, it still doesn't appear! Please check them out! Cheers

sig.php

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);  
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
if ($user->data['user_id'] == ANONYMOUS)
{
    login_box('', $user->lang['LOGIN']);
} 

if (isset($_POST['submit'])) {

$name = $_POST["name"];
$rank = $_POST["rank"];
$position = $_POST["position"];
$shipname = $_POST["shipname"];
$ncc = $_POST["ncc"];
$image = $_POST["image"];
$comments = $_POST["comments"];

$message = "Your Name: $name
Your Rank: $rank
Your Position within Section 31: $position
Your Ship Name: $shipname
Your Ship's NCC Code: $ncc
Ship Image (URL Image): $image
Any Other Comments: $comments";

$time = time();

$rawsubject = "[PENDING] $name has submitted a Sig Request";
$my_subject   = utf8_normalize_nfc($rawsubject, '', true);
$my_text   = utf8_normalize_nfc($message, '', true);

$poll = $uid = $bitfield = $options = ''; 

generate_text_for_storage($my_subject, $uid, $bitfield, $options, false, false, false);
generate_text_for_storage($my_text, $uid, $bitfield, $options, true, true, true);

$data = array( 
   'forum_id'      => 37,
   'icon_id'      => false,

   'enable_bbcode'      => true,
   'enable_smilies'   => true,
   'enable_urls'      => true,
   'enable_sig'      => true,

   'message'      => $my_text,
   'message_md5'   => md5($my_text),
            
   'bbcode_bitfield'   => $bitfield,
   'bbcode_uid'      => $uid,

   'post_edit_locked'   => 0,
   'topic_title'      => $my_subject,
   'notify_set'      => false,
   'notify'         => false,
   'post_time'       => 0,
   'forum_name'      => '',
   'enable_indexing'   => true,
);


submit_post('post', $my_subject, $user->data['username'], POST_NORMAL, $poll, $data);

    header( 'Location: http://www.section31rp.co.uk/forum/thanks.php' ) ;
}






page_header('Signature Request');

$template->set_filenames(array(
    'body' => 'sig.html',
));

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
sig.html

Code: Select all

     <!-- INCLUDE overall_header.html -->

        <html><form action='' method='post'>
        <font color=\"1b4b73\">Your Name:</font><br><input type='text' size='30' name='name' /><br>
        <font color=\"1b4b73\">Your Rank</font><br><input type='text' size='30' name='rank' /><br>
        <font color=\"1b4b73\">Your Position within Section 31:</font><br><input type='text' size='30' name='position' /><br>
        <font color=\"1b4b73\">Your Ship Name:</font><br><input type='text' size='30' name='shipname' /><br>
        <font color=\"1b4b73\">Your Ship's NCC Code:</font><br><input type='text' size='30' name='ncc' /><br>
        <font color=\"1b4b73\">Ship Image (URL Image):</font><br><textarea rows='5' cols='23.5' name='history' /></textarea><br>
        <font color=\"1b4b73\">Any Comments:</font><br><textarea rows='5' cols='23.5' name='comments' /></textarea><br>
        <input type='submit' value='Submit Request' name='submit' />
        </form></html>

        <!-- INCLUDE overall_footer.html -->
Section 31 Roleplay: forums.section31rp.co.uk
Drummer
Registered User
Posts: 199
Joined: Wed Jul 21, 2010 11:49 am

Re: Form Problem

Post by Drummer »

Dunno if this is the problem, but you shouldn't include the <html> (and </html>) tag inside your template file.
Locked

Return to “[3.0.x] MOD Writers Discussion”