Jump to content

Help? Bad parse error?


kernelgpf

Recommended Posts

So the error I'm getting is unexpected T_VARIABLE on line 28. Not only is there no problem before line 28, if I cut out the rest of the script, lines 28 and above work perfectly. My entire script:

 

<?php
include "config.php";
session_start();

include "header.html";
$v=$_SERVER["DOCUMENT_ROOT"];

$loggedin=$_SESSION["loggedin"];

if($_GET['action'] == "login"){
$username=$_POST['username'];
$password=$_POST['password'];

if($username == "admin" && $password == "admin"){
$_SESSION["loggedin"]="yes";
$loggedin=$_SESSION["loggedin"];

print "Successfully logged in! <a href='images.php?'>Manage images?</a>";
include "footer.html";
exit;
}
else{
print "Incorrect login info.";
include "footer.html";
exit;
}
}


if(empty($loggedin)){
print "<p><form method=post action=images.php?action=login>
Username: <input type=text name=username><br>
Password: <input type=password name=password><br>
<input type=submit name=submit value='Login'></form>";
include "footer.html";
exit;
}
//right here is lin 28

if($_GET['action'] == "managelitters"){
//upload new current litter

if($_GET['upload'] == "yes"){
$bitch=$_FILES["bitch"]["name"];
$stud=$_FILES["stud"]["name"];
$puppy1=$_FILES["puppy1"]["name"];
$puppy2=$_FILES["puppy2"]["name"];
$puppy3=$_FILES["puppy3"]["name"];
$puppy4=$_FILES["puppy4"]["name"];
$puppy5=$_FILES["puppy5"]["name"];
$puppy6=$_FILES["puppy6"]["name"];
$puppy7=$_FILES["puppy7"]["name"];
$puppy8=$_FILES["puppy8"]["name"];
$puppy1c=mysql_real_escape_string($_POST['puppy1caption']);
$puppy2c=mysql_real_escape_string($_POST['puppy2caption']);
$puppy3c=mysql_real_escape_string($_POST['puppy3caption']);
$puppy4c=mysql_real_escape_string($_POST['puppy4caption']);
$puppy5c=mysql_real_escape_string($_POST['puppy5caption']);
$puppy6c=mysql_real_escape_string($_POST['puppy6caption']);
$puppy7c=mysql_real_escape_string($_POST['puppy7caption']);
$puppy8c=mysql_real_escape_string($_POST['puppy8caption']);
$litterc=mysql_real_escape_string($_POST['littercaption']);

$place="$v/new_images/";

if(empty($bitch) || empty($stud)){
print "You must have a bitch and a stud to enter a litter.";
include "footer.html";
exit;
}

$bitchplace="$place"."$bitch";

if(move_uploaded_file($_FILES["filetest"]["tmp_name"],$bitchplace)){
//uploaded bitch image, can fail if bitch already uploaded
}

$studplace="$place"."$stud";

if(move_uploaded_file($_FILES["filetest"]["tmp_name"],$studplace)){
//uploaded bitch image, can fail if stud already uploaded
}

$puppy1place="$place"."$puppy1";

if(move_uploaded_file($_FILES["filetest"]["tmp_name"],$puppy1place)){
//uploaded bitch image, can fail if puppy already uploaded
}

for($i=1;$i<8;$i++){


$puppyplace="$place"."$puppy$i";
$puppy$iplace="$place"."$puppy$i";

if(!empty($puppyplace)){
if(move_uploaded_file($_FILES["filetest"]["tmp_name"],$puppyplace)){
//uploaded bitch image, can fail if puppy already uploaded
}
}

}

mysql_query("insert into current(bitch,stud,puppy1,puppy2c,puppy2,puppy2c,puppy3,puppy3c,puppy4,puppy4c,puppy5,puppy5c,puppy6,puppy6c,puppy7,puppy7c,puppy8,puppy8c,litterc)values('$bitchplace','$studplace','$puppy1place','$puppy1c','$puppy2place','$puppy2','$puppy3','$puppy3palce','$puppy4','$puppy4place','$puppy5','$puppy5place','$puppy6','$puppy6place','$puppy7','$puppy7place','$puppy8','$puppy8place','$litterc'");
$litterID=mysql_insert_id();

print "Successfully added a litter. Click <a href='currentlitters.php'>here</a> to see it.";
include "footer.html";
exit;
}

$query=mysql_query("select bitch,stud,text from current ORDER BY ID DESC");

print "<form method=post action=images.php?action=managelitters&upload=yes enctype=multipart/form-data>
Upload a new litter<p>
Bitch: <input type=file name=bitch><br>
Stud: <input type=file name=stud><br>
Puppy 1: <input type=file name=puppy1><br>
Puppy Caption: <input type=text name=puppy1caption><br>
Puppy 2: <input type=file name=puppy2><br>
Puppy Caption: <input type=text name=puppy2caption><br>
Puppy 3: <input type=file name=puppy3><br>
Puppy Caption: <input type=text name=puppy3caption><br>
Puppy 4: <input type=file name=puppy4><br>
Puppy Caption: <input type=text name=puppy4caption><br>
Puppy 5: <input type=file name=puppy5><br>
Puppy Caption: <input type=text name=puppy5caption><br>
Puppy 6: <input type=file name=puppy6><br>
Puppy Caption: <input type=text name=puppy6caption><br>
Puppy 7: <input type=file name=puppy7><br>
Puppy Caption: <input type=text name=puppy7caption><br>
Puppy 8: <input type=file name=puppy8><br>
Puppy Caption: <input type=text name=puppy8caption><p>
Litter Caption/Text: <input type=text name=littercaption><br>
<input type=submit name=submit value='Add Current Litter'></form><p>";

print "Edit an existing current litter:<br>";
while($row=mysql_fetch_array($query)){
print "<a href='images.php?action=managelitters&edit=ID'>$row[bitch] x $row[stud]</a><br>";

}

print "<hr noshade>";
}

print "<a href='images.php?action=managelitters'>Manage Current Litters</a><br>
<a href='images.php?action=manageupcoming'>Manage Upcoming Litters</a><p>";










include "footer.html";
?>

 

I can't find any problems with the rest of it either.

Link to comment
Share on other sites

Line 28 can also include line breaks. For me.. where you have the line28 comment, is infact line 38.

 

What you'd do.. maybe, is bit by bit.. insert a line, if you say everything before line 28 in your books is fine, add a few more lines, check then.. and so on. It can be something near the bottom of the page is triggering it, or it could generally be that line.

 

What is your exact error.

Link to comment
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.