I've written a script for it, but I can't get it to work. Since my knowledge of PHP is limited, and PHP doesn't have a compiler or any error checking, I don't know what the problem is. Here's the script, any help or pointing in the right direction would be VERY much appreciated:
Code: Select all
#!/usr/local/bin/php
<?
//check if cookie is still valid
$AdminCookie = $HTTP_COOKIE_VARS["Admin"];
if ($AdminCookie=="PWGood"){
setcookie("Admin", "PWGood", time() + 600);
}
//$connection = ocilogon('username', 'password', 'orcl');
//gets the file//
$files = $_FILES['userfile']['tmp_name'];
if (file_exists($file_name))
{
$lines = file($files);
}
else
{
echo "Cannot find file";
}
foreach ($lines as $line_num => $line)
{
//first we'll get the professor's id//
$student_idlocal=strpos($line,"|");
$student_id=substr($line,0,$student_idlocal);
//first name//
$last_namelocal=strpos($line,"|",$student_idlocal+1);
$last_name=substr($line,$student_idlocal+1,($last_namelocal-$student_idlocal)-1);
//last name//
$first_namelocal=strpos($line,"|",$last_namelocal+1);
$first_name=substr($line,$last_namelocal+1,($first_namelocal-$last_namelocal)-1);
//Query to insert each professor into db//
$query1 = "INSERT INTO ROSTER VALUES ('$student_id','$last_name','$first_name')";
parse n' execute//
$results = OCIParse($connection,$query1);
$doquery1 = OCIExecute($results);
/tml confirmation of upload//
echo "<p>$last_name, $first_name</p>";
$url = "http://www.cise.ufl.edu/~rmoyer"; // target of the redirect
$delay = "3"; // 3 second delay
echo '<meta http-equiv="refresh" content="'.$delay.';url='.$url.'">';
}
?>