Jump to content

Recommended Posts

(not sure where to put this)

 

Ok so i decided to make a shoutout page on my game site.

I uses the Updates script but changd it a bit so that players could post in the same way that mods would post updates.

The problem i have is that the Text box that players type in the submit, is below the shouts.

 

I have changed the code so many times but cant figure it out without getting script errors.

 

perhaps someone can help?

 

<?php
require("connections/db.php");
require("connections/require.php");
require("connections/replace.php");

$que = mysql_query("SELECT * FROM `shout` ORDER BY `id` DESC")or die(mysql_error());

$qry = mysql_query("SELECT * FROM `players` WHERE `playername` = '$player' ")or die(mysql_error());
$ary = mysql_fetch_array($qry);

$staff = $ary['player'];

if ($_POST['submit']){
$upd = strip_tags(addslashes($_POST['shout']));

if (!$upd){
$error = "Please input the shout you wish to add.";
error($error);
}elseif ($upd){

if ($staff == "0"){
$error = "Authorization required.";
error($error);
}elseif ($player){

mysql_query("INSERT INTO `shout` ( `id` , `updator` , `update` , `date` )
VALUES
( '' , '$player' , '$upd' , '$date' )")or die(mysql_error());

$up = "Update added.";
upd($up);
}}}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="connections/style.css" />
</head>
<body>
<? while($arr = mysql_fetch_assoc($que)){
$id = $arr['id'];
$updator = $arr['updator'];
$update = $arr['update'];
$date = $arr['date'];

$updator = "<a href=\"profile.php?player=".$updator."\">".$updator."</a>";
?>
<table width="75%" class="tbl" align="center">
<tr>
<td align="center" class="hdr">.::#<? print $id; ?> <b>On</b> <? print $date; ?> <b>By</b> <? print $updator; ?>::.</td></tr>
<tr><td align="left" class="tbl"> <strong>shout:</strong> <? print replace($update); ?></td></tr>
</table>
<br />
<?} if ($player){?>
<form action="" method="post">
<table width="75%" class="tbl" align="center">
<tr>
<td align="center" class="hdr">.::Add A Shout::.</td></tr>
<tr><td align="center" class="tbl"><textarea name="shout" cols="50" rows="5"></textarea></td></tr>
<tr><td align="center" class="tbl"><? sub(submit,"Add shout"); ?></td></tr>
</table>
</form>
<? } ?>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/120129-solved-getting-line-error/
Share on other sites

Hard to say without knowing what the function 'sub' does, but you can try changing it to this:

 

<tr><td align="center" class="tbl"><? sub(submit,"Add shout"); ?></td></tr>
<tr><td align="center" class="tbl"><textarea name="shout" cols="50" rows="5"></textarea></td></tr>

 

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.