hi ya i got some about parse error i do not know what is it

  • mikan
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Aug 04, 2006
  • Posts: 14
  • Loc: thailand
  • Status: Offline

Post August 25th, 2006, 1:48 am

Parse error: parse error, unexpected T_STRING in C:\Program Files\Apache Group\Apache2\htdocs\dvddb\yaztest5.php on line 44
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post August 25th, 2006, 1:48 am

  • katana
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Sep 07, 2004
  • Posts: 2390
  • Loc: Edinburgh, Scotland
  • Status: Offline

Post August 25th, 2006, 2:00 am

It would be a lot easier to help you if you post the code relating to line 44 of "yaztest5.php".
Why do geeks get Halloween and Christmas confused?
Because 31 Oct == 25 Dec
www.darren-king.co.uk

Post August 25th, 2006, 2:05 am

I had that once, and I found I missed out a '{' or '}' some where.
Maybe you have..
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 22766
  • Loc: Pittsburgh PA
  • Status: Offline

Post August 25th, 2006, 8:42 am

More likely missing a semi-colon at the end of a line. Most likely on or around line 43.
"There's no place like 127.0.0.1 except for ::1."
Play sports pools and discuss sports topics at Boasting Rights Sports Forum
Get paid to write articles - www.associatedcontent.com
  • mikan
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Aug 04, 2006
  • Posts: 14
  • Loc: thailand
  • Status: Offline

Post August 26th, 2006, 6:48 pm

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>isbn search</title>
<script type="text/javascript">
function fillterm()
{
typeofsearch = 1003
switch(document.searchform.whichsearch.selectedIndex)
{
case 0:typeofsearch=1003;break;
case 1:typeofsearch=4;break;
case 2:typeofsearch=7;break;
case 3:typeofsearch=1036;break;
}
document.searchform.term.value = "@attr 1="+typeofsearch+" "+document.searchform.term.value;
document.searchform.submit();
}
</script>
</head>
<body onload="document.searchform.term.value=''">

<?php

$host = $_POST['host'];
$term = $_POST['term'];
$num_hosts = count($host);
if (empty($term) || count($host) == 0)
{
echo '<form method="get">
<input type="checkbox" name="host[]" value="bagel.indexdata.dk/gils">
GILS test
<input type="checkbox" name="host[]" value="melvyl.cdlib.org/CDL90" checked="1">
MELVYL
<input type="checkbox" name="host[]" value="z3950.loc.gov:7090/voyager" checked="1">
LoC
<br>
RPN Query:
<input type="text" size="30" name="term">
<input type="submit" name="action" value="Search">
';
}

Search in:<select name="whichsearch"><option value="1">Author</option>
<option value="2">Title</option>
<option value="3">ISBN</option>
<option value="4">Author/Title/Subject</option>
</select>
<BR>

Search: <input type="text" size="30" name="term" value="">
<input type="button" name="action" onclick="fillterm()" value="Search">
<?php
}
else
{
/*
$host = array();
$host[] = "z3950.loc.gov:7090/voyager";
$host[] = "bagel.indexdata.dk/gils";
$host[] = "melvyl.cdlib.org/CDL90";
$num_hosts = count($host);

$term = $_GET["title"];
$term = "@attr 1=1036 " . $term;
*/
echo 'You searched for ' . htmlspecialchars($term) . '<br>';
for ($i = 0; $i < $num_hosts; $i++) {
$id[] = yaz_connect($host[$i]);
yaz_syntax($id[$i],"sutrs");
yaz_search($id[$i],"rpn",$term);
}
yaz_wait();

for ($i = 0; $i <$num_hosts; $i++)
{
echo '<hr>' . $host[$i] . ":";
$error = yaz_error($id[$i]);
if (!empty($error))
{
echo "Error: $error";
}
else
{
$hits = yaz_hits($id[$i]);
echo "Result Count $hits";
}
if($rec=="")
{
$rec="Error: No matching documents were found.\nError: Please try searching again.";
$hits=1;
}
for($p = 1; $p <= $hits; $p++)
{
if (empty($rec)) continue;
//Splitting every seperate line in the search result.
$result1 = explode("\n", $rec);
$result2 = "";
$previous = "xxxxxxxxxx";
$counter=0;
//Keep looping untill the array returns empty and we've processed
//everything from the search record.
for($counter=0;$counter < sizeof($result1);$counter++)
{
//Split each line at the : followed by a tab
$result2 = explode(":\t",$result1[$counter]);
//If there are multiple lines of the same name(E.G. Note)
//Then add the next line to the already existing entry
//after a whitespace, or else just make a new entry in
//the array.

if($result2[0]==$previous)
{
$REC_["$p"]["$result2[0]"].= "\n".$result2[1];
}
else
{
$REC_["$p"]["$result2[0]"].=$result2[1];
}
$previous = $result2[0];
}
}
}
// } The above if has been commented

$resultstogo = count($REC_);
?>
<TABLE border=1 cellspacing=0 cellpadding=0>
<form name="displayresult" action="editmovie.php" method="post">
<input type="hidden" name="Author">
<?php

for($c=1;$c<$resultstogo;$c++)
{
echo "<TR><TD>"
."<TABLE border=0 cellspacing=0 cellpadding=0>"
."<TR><TD><B>Author:</B></TD><TD>".$REC_["$c"]["Author"]."</TD></TR>"
."<TR><TD><B>Title:</B></TD><TD>".$REC_["$c"]["Title"]."</TD></TR>"
."<TR><TD><B>ISBN:</B></TD><TD>".$REC_["$c"]["ISBN"]."</TD></TR>"
."</TABLE>"
."</TD><TD><input type=\"button\" onclick=\"selectresult($c);\" value=\"Add to library\"></TD></TR>";
}
echo "<table>";
?>
print_r($REC_);



<br>

</body>
</html>

Post August 26th, 2006, 8:22 pm

change this

PHP Code: [ Download ] [ Select ]
 
RPN Query:
 
<input type="text" size="30" name="term">
 
<input type="submit" name="action" value="Search">
 
';
 
}
 
 
 
Search in:<select name="whichsearch"><option value="1">Author</option>
 
<option value="2">Title</option>
 
<option value="3">ISBN</option>
 
 
  1.  
  2. RPN Query:
  3.  
  4. <input type="text" size="30" name="term">
  5.  
  6. <input type="submit" name="action" value="Search">
  7.  
  8. ';
  9.  
  10. }
  11.  
  12.  
  13.  
  14. Search in:<select name="whichsearch"><option value="1">Author</option>
  15.  
  16. <option value="2">Title</option>
  17.  
  18. <option value="3">ISBN</option>
  19.  
  20.  


to
PHP Code: [ Download ] [ Select ]
 
RPN Query:
 
<input type="text" size="30" name="term">
 
<input type="submit" name="action" value="Search">
 
';
 
}
 
?>
 
Search in:<select name="whichsearch"><option value="1">Author</option>
 
<option value="2">Title</option>
 
<option value="3">ISBN</option>
  1.  
  2. RPN Query:
  3.  
  4. <input type="text" size="30" name="term">
  5.  
  6. <input type="submit" name="action" value="Search">
  7.  
  8. ';
  9.  
  10. }
  11.  
  12. ?>
  13.  
  14. Search in:<select name="whichsearch"><option value="1">Author</option>
  15.  
  16. <option value="2">Title</option>
  17.  
  18. <option value="3">ISBN</option>


found around line 40
error is on line 43 code starts around line 40
  • mikan
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Aug 04, 2006
  • Posts: 14
  • Loc: thailand
  • Status: Offline

Post August 26th, 2006, 8:31 pm

//below line is result of the code i have changed as you told me ...thank^^
//Parse error: parse error in c:\appserv\www\dvddb\yaztest5.2.php on line 23

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>isbn search</title>
<script type="text/javascript">
function fillterm()
{
typeofsearch = 1003
switch(document.searchform.whichsearch.selectedIndex)
{
case 0:typeofsearch=1003;break;
case 1:typeofsearch=4;break;
case 2:typeofsearch=7;break;
case 3:typeofsearch=1036;break;
}
document.searchform.term.value = "@attr 1="+typeofsearch+" "+document.searchform.term.value;
document.searchform.submit();
}
</script>
</head>
<body onload="document.searchform.term.value=''">

<?php RPN Query:
<input type="text" size="30" name="term">
<input type="submit" name="action" value="Search">
}

Search in:<select name="whichsearch"><option value="1">Author</option>
<option value="2">Title</option>
<option value="3">ISBN</option> ?>
}
Search in:<select name="whichsearch"><option value="1">Author</option>
<option value="2">Title</option>
<option value="3">ISBN</option>
<option value="4">Author/Title/Subject</option>
</select>
<BR>

Search: <input type="text" size="30" name="term" value="">
<input type="button" name="action" onclick="fillterm()" value="Search">

<?php
}
else
{

$host = array();
$host[] = "z3950.loc.gov:7090/voyager";
$host[] = "bagel.indexdata.dk/gils";
$host[] = "melvyl.cdlib.org/CDL90";
$num_hosts = count($host);

$term = $_GET["title"];
$term = "@attr 1=1036 " . $term;

echo 'You searched for ' . htmlspecialchars($term) . '<br>';
for ($i = 0; $i < $num_hosts; $i++) {
$id[] = yaz_connect($host[$i]);
yaz_syntax($id[$i],"sutrs");
yaz_search($id[$i],"rpn",$term);
}
yaz_wait();

for ($i = 0; $i <$num_hosts; $i++)
{
echo '<hr>' . $host[$i] . ":";
$error = yaz_error($id[$i]);
if (!empty($error))
{
echo "Error: $error";
}
else
{
$hits = yaz_hits($id[$i]);
echo "Result Count $hits";
}
if($rec=="")
{
$rec="Error: No matching documents were found.\nError: Please try searching again.";
$hits=1;
}
for($p = 1; $p <= $hits; $p++)
{
if (empty($rec)) continue;
//Splitting every seperate line in the search result.
$result1 = explode("\n", $rec);
$result2 = "";
$previous = "xxxxxxxxxx";
$counter=0;
//Keep looping untill the array returns empty and we've processed
//everything from the search record.
for($counter=0;$counter < sizeof($result1);$counter++)
{
//Split each line at the : followed by a tab
$result2 = explode(":\t",$result1[$counter]);
//If there are multiple lines of the same name(E.G. Note)
//Then add the next line to the already existing entry
//after a whitespace, or else just make a new entry in
//the array.

if($result2[0]==$previous)
{
$REC_["$p"]["$result2[0]"].= "\n".$result2[1];
}
else
{
$REC_["$p"]["$result2[0]"].=$result2[1];
}
$previous = $result2[0];
}
}
}
// } The above if has been commented

$resultstogo = count($REC_);
?>
<TABLE border=1 cellspacing=0 cellpadding=0>
<form name="displayresult" action="editmovie.php" method="post">
<input type="hidden" name="Author">
<?php

for($c=1;$c<$resultstogo;$c++)
{
echo "<TR><TD>"
."<TABLE border=0 cellspacing=0 cellpadding=0>"
."<TR><TD><B>Author:</B></TD><TD>".$REC_["$c"]["Author"]."</TD></TR>"
."<TR><TD><B>Title:</B></TD><TD>".$REC_["$c"]["Title"]."</TD></TR>"
."<TR><TD><B>ISBN:</B></TD><TD>".$REC_["$c"]["ISBN"]."</TD></TR>"
."</TABLE>"
."</TD><TD><input type=\"button\" onclick=\"selectresult($c);\" value=\"Add to library\"></TD></TR>";
}
echo "<table>";
?>
print_r($REC_);



<br>

</body>
</html>
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 22766
  • Loc: Pittsburgh PA
  • Status: Offline

Post August 27th, 2006, 8:30 am

That wasn't quite entirely right but not your fault. There's small buf in the php BBCode that adds an ?> whether it's supposed to be there or not.


Change this
<?php RPN Query:
<input type="text" size="30" name="term">
<input type="submit" name="action" value="Search">
}

Search in:<select name="whichsearch"><option value="1">Author</option>
<option value="2">Title</option>
<option value="3">ISBN</option> ?>

Remove the ?> after </option> and The <?PHP at the beginning and get rid of the end brackets. Should look like this.

RPN Query:
<input type="text" size="30" name="term">
<input type="submit" name="action" value="Search">


Search in:<select name="whichsearch"><option value="1">Author</option>
<option value="2">Title</option>
<option value="3">ISBN</option> ?>

Search in:<select name="whichsearch"><option value="1">Author</option>
<option value="2">Title</option>
<option value="3">ISBN</option>
<option value="4">Author/Title/Subject</option>
</select>
<BR>

Search: <input type="text" size="30" name="term" value="">
<input type="button" name="action" onclick="fillterm()" value="Search">
"There's no place like 127.0.0.1 except for ::1."
Play sports pools and discuss sports topics at Boasting Rights Sports Forum
Get paid to write articles - www.associatedcontent.com
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 22766
  • Loc: Pittsburgh PA
  • Status: Offline

Post August 27th, 2006, 8:40 am

On second thought skip that. I just realized that RPN query is part of php. I was thinking that was just part of your HTML. Had never heard of it before.
"There's no place like 127.0.0.1 except for ::1."
Play sports pools and discuss sports topics at Boasting Rights Sports Forum
Get paid to write articles - www.associatedcontent.com
  • mikan
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Aug 04, 2006
  • Posts: 14
  • Loc: thailand
  • Status: Offline

Post August 27th, 2006, 8:52 am

the code should like as it before right but anyhow what is going wrong in the code now?

Post Information

  • Total Posts in this topic: 10 posts
  • Users browsing this forum: Danny1337 and 232 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2010 Unmelted, LLC. Driven by phpBB © 2010 phpBB Group.