Jump to content

Automatic Post Type in Title?


Recommended Posts

Ok, so can someone edit this code:

<center>
<table height="300px" bgcolor="#FFFF00" cellspacing="1" width="75%">
<tbody>
<tr>
<td>
<table height="433" bgcolor="#000000" cellpadding="10px" cellspacing="1" width="995">
<tbody>
<tr>
<td bgcolor="#000000" valign="top" width="20%">

<div id="menu" align="right" >
<a href="/forums/index.php">HOME</a> | 
<a href="mailto:xxxxxxx@trigamer.com">CONTACT</a> | 
<a href="">ABOUT (soon)</a>
</div>

<?php 
$fid = $_GET['fid'];
require "global.php"; 
if ($_POST)
{
if (! trim($message) ) {
// message is blank
}
$user = $_POST['user'];
$password = $_POST['password'];
$message = $_POST['message'];
$title = $_POST['title'];
$date = time();

$data = sprintf("INSERT INTO threads (tid, fid, title, user, dateline) VALUES (DEFAULT, $fid, '$title', '$user', $date)");
mysql_query($data);
$tid = mysql_insert_id();
$data = sprintf("INSERT INTO posts VALUES (DEFAULT, $tid, '$user', '$message', $date)");
mysql_query($data);
header( 'Location: replythread.php?tid='.$tid );
exit;
}
echo '
<font size=5><b>Add a New Post:</b></font>
<form action="" method="POST" name="formpost" onsubmit="return validate();">
<table>
<tr><td>Username:</td><td><input name="user" /></td></tr>
<tr><td>Password (optional):</td><td><input type="password" name="password"></td></tr>
<tr><td>Post Title:</td><td><input name="title" /></td></tr>
<tr><td valign="top">Message: </td><td><textarea rows="10" cols="50" name="message"></textarea></td></tr>
</table>
<input type="submit" value=" Add new post " />
</form>';
?>
</td></tr></tbody></table></td></tr></tbody></table><br />
</center>

<script>
function validate() {return true;

}
</script>

 

So that a tickable box can be beside "Post title" to the right of the text box that says, "Review," so that when a post is made, it will have "Review:" before the post title on the forum?

 

Here is what the code above shows you:

newpostm.png

 

And this is what I want it to look like on the forums:

newpost2.png

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/257254-automatic-post-type-in-title/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.