Hi people... ran some asp code thru a php translator and the php page displays nothing but this error message. I take out the php code and it displays. I've checked and rechecked and read tons of possible scenarios... but I don't see anything. Sometimes another set of eyes and an unmelted brain helps. Any ideas? LINE54 is actually LINE12 in this pasted code.
~ Tom
Parse error: parse error, unexpected T_VARIABLE in /vservers/magicwebs/htdocs/index_database.php on line 54
<?
//dim $DataConn, $cmdDC, $rsDC;
//dim $Item, $strVendorType;
//dim $iFieldCount, $iLoopVar;
$strVendorType = @$_GET["VendorType"];
//If strVendorType = "" Then strVendorType = "Miscellaneous"
//Response.write "user selected " & strVendorType & "<br>"
// Finally we've got all our info, now to the cool stuff
// Create and establish data connection
Set $DataConn = Server.CreateObject("ADODB.Connection");
$DataConn.ConnectionTimeout = 15;
$DataConn.$CommandTimeout = 30;
//Access connection code
$DataConn.$Open "DBQ=".Server.MapPath("database.mdb").";Driver={Microsoft Access Driver (*.mdb)}";
// Create and link command object to data connection then set attributes and SQL query
Set $cmdDC = Server.CreateObject("ADODB.Command");
$cmdDC.$ActiveConnection = $DataConn;
$cmdDC.$CommandText = "SELECT * FROM Vendors WHERE (VendorType = '".$strVendorType."');";
//Response.write cmdDC.CommandText
$cmdDC.$CommandType = 1;
// Create recordset and retrieve values using command object
Set $rsDC = Server.CreateObject("ADODB.Recordset");
// Opening record set with a forward-only cursor (the 0) and in read-only mode (the 1)
$rsDC.$Open $cmdDC, , 0, 1;
?>
<span class="bodyText"><B>Results of search for :: <?= $strVendorType ?> </B>
<hr size=1 noshade><p>
<? Do While Not $rsDC.$EOF;
echo "<b>Company: </b>".$rsDC["CompanyName"];
echo " (".$rsDC["VendorType"].")<br>";
echo "<b>City: </b>".$rsDC["City"]."<br>";
echo "<b>State: </b>".$rsDC["ST"]."<br>";
echo "<b>Address: </b>".$rsDC["Address"]."<br>";
echo "<b>ZIP: </b>".$rsDC["Zip"]."<br>";
echo "<b>Country: </b>".$rsDC["Country"]."<br>";
echo "<b>Vendor Type: </b>".$rsDC["VendorType"]."<br>";
echo "<b>URL: </b>"."<a href=http://www.".$rsDC["URL"]." target=_blank>"."<b>".$rsDC["URL"]."</b></a>"."<br>";
echo "<b>Salutation: </b>".$rsDC["Salutation"]."<br>";
echo "<b>First Name: </b>".$rsDC["FirstName"]."<br>";
echo "<b>Last Name </b>".$rsDC["LastName"]."<br>";
echo "<b>Professional Title: </b>".$rsDC["ProfessionalTitle"]."<br>";
echo "<b>E-mail Address: </b>"."<a href=mailto:".$rsDC["EmailAddress"].">"."<b>".$rsDC["EmailAddress"]."</b></a>"."<br>";
echo "<b>Main Phone: </b>".$rsDC["PhoneMain"]."<br>";
echo "<b>Direct Phone: </b>".$rsDC["PhoneDirect"]."<br>";
echo "<b>Fax Number: </b>".$rsDC["FaxNumber"]."<br>";
echo "<b>Mobile Phone: </b>".$rsDC["PhoneMobile"]."<br>";
//Response.Write "<b>Account Info.: </b>" & rsDC("AccountInfo") & "<br>"
echo "<b>Payment Type: </b>".$rsDC["PaymentType"]."<br>";
echo "<b>Notes: </b>".$rsDC["Notes"]."<br>";
echo "<b>Last Modified: </b>".$rsDC["LastModifiedDate"]."<br><br>";
echo "<b><a href=index.asp><b>Click here</b></a> to Search again.</b><br>";
echo "<p><hr size=1 noshade><p>";
$rsDC.$MoveNext;
Loop;
// Close Data Access Objects and free DB variables
$rsDC.Close;
Set $rsDC = Nothing;
// can't do a "cmdDC.Close" !
Set $cmdDC = Nothing;
$DataConn.Close;
Set $DataConn = Nothing ?></span>