Jump to content

[SOLVED] Getting line error


Alienware

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>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.