HI
any help is very much appreciated 🙂
I am getting an parse error below in the line i have commented..what is an T_String error?
<?php
// include the methods
include("showlister_methods.inc");
if (isset($submit))
{
// parse the $_POST vars into something useful
// and check for nulls on required fields
$month = $_POST['month'];
$day = $_POST['day'];
$day_ofweek = $_POST['day_ofweek'];
if ($_POST['headliner']) {
$headliner = $_POST['headliner'];
} else {
die_now("<h3>Sorry</h3><p>headliner is a required field. Use your browser 'back' button to fix this.</a></p>");
}
if ($_POST['support']) {
$support = $_POST['support'];
} else {
die_now("<h3>Sorry</h3><p>support is a required field. Use your browser 'back' button to fix this.</a></p>");
}
$djs = $_POST['djs'];
$ticketaddl = $_POST['ticketaddl'];
$path = "images/";
$max_size = 200000;
if (!isset($HTTP_POST_FILES['userfile']) && $HTTP_POST_FILES['userfile'] !='')
$name= $HTTP_POST_FILES['userfile'] ['name'];
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
if ($HTTP_POST_FILES['userfile']['size']>$max_size) { echo "The file is too big<br>\n"; exit; }
if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg")) {
if (file_exists($path . $HTTP_POST_FILES['userfile']['name'])) { echo "The file already exists<br>\n"; exit; }
$res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path .
$HTTP_POST_FILES['userfile']['name']);
if (!$res) { echo "upload failed!<br>\n"; exit; } else { echo "upload sucessful<br>\n"; }
echo "File Name: ".$HTTP_POST_FILES['userfile']['name']."<br>\n";
echo "File Size: ".$HTTP_POST_FILES['userfile']['size']." bytes<br>\n";
echo "File Type: ".$HTTP_POST_FILES['userfile']['type']."<br>\n";
} else { echo "Wrong file type<br>\n"; exit; }
}
?>
<html>
<head>
<title>showlister :: edited show [2]</title>
<link rel="stylesheet" type="text/css" href="showlister.css">
</head>
<body>
<?php
// read in the connection settings
require("showlister_settings.inc");
// connect to the RDBMS
$db = mysql_connect("$site","$user","$pass")
or die_now("<h2>Could not connect to database server</h2><p>Check passwords and sockets</p>");
// select the database
mysql_select_db("$database",$db)
or die_now("<h2>Could not select database $database</h2><p>Check database name</p>");
// add the edited show to the database
$result = mysql_query("UPDATE $database_table SET day='$day', month='$month', day_ofweek='$day_ofweek', headliner='$headliner', support='$support', djs='$djs', ticketaddl='$ticketaddl', name='$name') WHERE
show_id='$show_id',$db");
// echo out the most recent addition, for error checking
$result = mysql_query("SELECT $show_id FROM $database_table WHERE day='$day', month='$month', day_ofweek='$day_ofweek', headliner='$headliner', support='$support', djs='$djs', ticketaddl='$ticketaddl', name='$name',$db");
//GETTING error: parse error, unexpected T_STRING HERE IN THIS LINE
while($row = mysql_fetch_array($result)) {
$the_id = $row["show_id"];
$the_month = $row["month"];
$the_day = $row["day"];
$the_dayofweek = $row["day_ofweek"];
$the_headliner = $row["headliner"];
$the_support = $row["support"];
$the_djs = $row["djs"];
$ticketaddl = $row["ticketaddl"];
$name = $row["name"];
echo("<div class='box'><h3>showlister :: edited entry</h3></div>
<div class='box'>
<table border='1' width='100%'>
<tr>
<td>date</td>
<td>headliner</td>
<td>support</td>
<td>djs</td>
<td>ticketaddl</td>
<td>image of headliner</td>
</tr>
<tr>
<td>$the_month,$the_day,$the_dayofweek</td>
<td>$the_headliner</td>
<td>$the_support</td>
<td>$the_djs</td>
<td>$ticketaddl</td>
(<td><img src=\"images/$name\"></td>)
</tr>
</table>
</div>");
}
?>
<?php
footer();
?>
thank you for looking..