I removed a couple of urls (noted by removed), but here is the code. Any help would be greatly appreciated. I haven't had a chance to tidy my code up yet...hope you can follow it 🙂
<?
$isbns=explode("\n",$isbns);
$listname=stripslashes($listname);
$description=stripslashes($description);
$submittedby=stripslashes($submittedby);
$notes=stripslashes($notes);
$recip="email-withdrawn";
$body="Title: $listname\n\nDescription: $description\n\nNotes: $notes\n\nSubmitted by: $submittedby\n\n";
foreach($isbns as $isbn_num => $isbn){
$isbn=trim($isbn);
$summary="";
if($isbn==""){
}else{
$location="http://removed/search/?searchtype=i&searcharg=".$isbn;
$location=eregi_replace('{KU}','&',$location);
$lines=file($location);
$match="bibInfoLabel"."\"".">Title";
$corpmatch="bibInfoLabel"."\"".">Corp author";
$recmatch="videorecording";
$summatch="bibInfoLabel"."\"".">Summary";
$sumend="<td VALIGN=TOP";
$autmatch="bibInfoLabel"."\"".">Author";
if(isset($author)){
unset($author);
}
foreach ($lines as $line_num => $line) {
if(ereg($corpmatch, $line)){
$num=$line_num+2;
$x=".<";
$aut=explode(">",$lines[$num]);
$aut=explode(",",$aut[1]);
$author=$aut[0];
} elseif(ereg($autmatch, $line)){
$num=$line_num+2;
$x=">";
$aut=explode(">",$lines[$num]);
$aut=explode("<",$aut[1]);
$author=$aut[0];
}
if(ereg($match, $line)){
$num=$line_num+3;
$stuff=explode("/",$lines[$num]);
if(ereg(".<",$stuff[0])){
$stuff=explode(".<",$stuff[0]);
}
if (ereg("<",$stuff[0])){
$stuff=explode("<",$stuff[0]);
} elseif(ereg("<",$stuff[0])){
$stuff=explode("<",$stuff[0]);
}
$title=$stuff[0];
if(ereg(";",$stuff[1])){
$temp=";";
} else {
$temp=".<";
}
$stuff2=explode($temp, $stuff[1]);
if(!isset($author)){
if(ereg("by ",$stuff[1])){
$stuff2=explode("by ", $stuff2[0]);
$author=$stuff2[1];
} elseif(!isset($author)) {
$author=$stuff[1];
}
}
}
if(ereg($summatch, $line)){
$num=$line_num+2;
$summary[0]=$lines[$num];
$sumstuff="1";
$num++;
$exit=0;
do{
echo "$lines[$num]<BR>";
if(!ereg($sumend, $lines[$num])){
$exit=1;
} else {
array_push($summary,$lines[$num]);
$sumstuff="0";
$num++;
}
} while($exit<>0);
}
}
if($sumstuff=="0"){
array_pop($summary);
$summary=implode($summary);
$sumstuff="1";
}
if(ereg("</TD>",$summary)){
$summary=explode("</TD>",$summary);
$summary=$summary[0];
}
if(ereg(".<",$author)){
$author=explode(".<",$author);
$author=$author[0];
}
if(ereg(";",$author)){
$author=explode(";",$author);
$author=$author[0];
}
$body .= "<TR>\n";
$body .= "<TD>\n";
$body .= "<IMG SRC=\"http://*removed*/*removed*.pl?isbn=$isbn/SC.gif&client=wes\">\n";
$body .= "</TD>\n";
$body .= "<TD>\n";
$body .= "<BOLD>\n";
$body .= "<A HREF=\"http://*removed*/search/?searchtype=i&searcharg=$isbn\">$title</A>\n";
$body .= "</BOLD>\n";
$body .= "<BR> by $author\n";
$body .= "<BR>\n";
$body .= "$summary\n";
$body .= "<BR>\n";
$body .= "<BR>\n";
$body .= "<A HREF=\"https://*removed/search~S6/i$isbn/i$isbn/-6,0,0,B/request&FF=i$isbn&1,1,\">Reserve it</A>\n";
$body .= "</TD>\n";
$body .= "</TR>\n";
}
}
mail($recip,$listname,$body, "From: $submittedby");
echo("Mail sent!");
?>