yogen Posted June 30, 2011 Share Posted June 30, 2011 I am trying out this code for so long and now am tired because it is not getting connected with mysql. Whereas previously it was working fine. I am using a godaddy account and don't know what the issue is. Please guide me. Thanks in Advance <?php $errorMsg = ""; $firstname = ""; $lastname = ""; $email = ""; $pass = ""; $gender = ""; $date = ""; $month = ""; $year = ""; if (isset ($_POST['firstname'])){ $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $email = $_POST['email']; $pass = $_POST['password']; $gender = $_POST['gender']; $date = $_POST['date']; $month = $_POST['month']; $year = $_POST['year']; $firstname = stripslashes($firstname); $lastname = stripslashes($lastname); $email = stripslashes($email); $pass = stripslashes($pass); $gender = stripslashes($gender); $date = stripslashes($date); $month = stripslashes($month); $year = stripslashes($year); $firstname = strip_tags($firstname); $lastname = strip_tags($lastname); $email = strip_tags($email); $pass = strip_tags($pass); $gender = strip_tags($gender); $date = strip_tags($date); $month = strip_tags($month); $year = strip_tags($year); include"scripts/connect_to_mysql.php"; $emailCHecker = mysql_real_escape_string($email); $emailCHecker = eregi_replace("`", "", $emailCHecker); $sql_email_check = mysql_query("SELECT email FROM members WHERE email='$emailCHecker'"); $email_check = mysql_num_rows($sql_email_check); if ((!$firstname) || (!$lastname) || (!$email) || (!$pass) || (!$gender) || (!$date) || (!$month) || (!$year)) { $errorMsg = 'ERROR: You did not submit the following required information:<br /><br />'; if(!$firstname){ $errorMsg .= ' * First Name<br />'; } if(!$lastname){ $errorMsg .= ' * Last Name<br />'; } if(!$email){ $errorMsg .= ' * Email Address<br />'; } if(!$pass){ $errorMsg .= ' * Login Password<br />'; } if(!$gender){ $errorMsg .= ' * Confirm Gender<br />'; } if(!$date){ $errorMsg .= ' * Confirm date<br />'; } if(!$month){ $errorMsg .= ' * Confirm Month<br />'; } if(!year){ $errorMsg .= ' * Confirm Year<br />'; } else if ($email_check > 0){ $errorMsg = "<u>ERROR:</u><br />Your Email address is already in use inside our database. Please use another.<br />"; } else { $firstname = mysql_real_escape_string($firstname); $lastname = mysql_real_escape_string($lastname); $email = mysql_real_escape_string($email); $pass = mysql_real_escape_string($pass); $gender = mysql_real_escape_string($gender); $date = mysql_real_escape_string($date); $month = mysql_real_escape_string($month); $year = mysql_real_escape_string($year); $firstname = eregi_replace("`", "", $firstname); $lastname = eregi_replace("`", "", $lastname); $email = eregi_replace("`", "", $email); $pass = eregi_replace("`", "", $pass); $gender = eregi_replace("`", "", $gender); $date = eregi_replace("`", "", $date); $month = eregi_replace("`", "", $month); $year = eregi_replace("`", "", $year); $db_password = md5($pass); $sql = mysql_query("INSERT INTO members (firstname, lastname, email, password, sign_up_date, gender, date, month, year) VALUES ('$firstname','$lastname','$email','$db_password', NOW(),'$gender','$date','$month','$year')"); or die (mysql_error()); $id = mysql_insert_id(); mkdir("members/$id, 0777"); $to = "$email"; $from = "noreply@mydomain.com"; $subject = "Complete your registration"; $message = "Hi $firstname, Complete this step to activate your login identity at yourdomain. Click the line below to activate when ready. http://www.mydomain.com/activation.php?id=$id&sequence=$db_password If the URL above is not an active link, please copy and paste it into your browser address bar Login after successful activation using your: E-mail Address: $email Password: $pass See you on the site! noreply@mydomain.com"; $headers = "From: $from\r\n"; $headers .= "Content-type: text\r\n"; mail($to, $subject, $message, $headers); $msgToUser = "<h2>One Last Step - Activate through Email</h2><h4>OK $firstname, one last step to verify your email identity:</h4><br /> In a moment you will be sent an Activation link to your email address.<br /><br /> <br /> <strong><font color=\"#990000\">VERY IMPORTANT:</font></strong> If you check your email with your host providers default email application, there may be issues with seeing the email contents. If this happens to you and you cannot read the message to activate, download the file and open using a text editor. If you still cannot see the activation link, contact site admin and briefly discuss the issue.<br /><br /> "; include"msgToUser.php"; exit(); } }else { $firstname = ""; $lastname = ""; $email = ""; $pass = ""; $gender = ""; $date = ""; $month = ""; $year = ""; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/ Share on other sites More sharing options...
xyph Posted June 30, 2011 Share Posted June 30, 2011 Try isolating the issue. What line is the error on? What is the error? Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237033 Share on other sites More sharing options...
requinix Posted June 30, 2011 Share Posted June 30, 2011 $sql = mysql_query("INSERT INTO members (firstname, lastname, email, password, sign_up_date, gender, date, month, year) VALUES ('$firstname','$lastname','$email','$db_password', NOW(),'$gender','$date','$month','$year')"); or die (mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237037 Share on other sites More sharing options...
Pikachu2000 Posted June 30, 2011 Share Posted June 30, 2011 1) When posting code, enclose it within the forum's . . . BBCode tags. 2) DO NOT double, or in your case TRIPLE, post Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237039 Share on other sites More sharing options...
yogen Posted June 30, 2011 Author Share Posted June 30, 2011 I didn't get you. Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237043 Share on other sites More sharing options...
yogen Posted June 30, 2011 Author Share Posted June 30, 2011 Also, the line error is 104 or die (mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237045 Share on other sites More sharing options...
xyph Posted June 30, 2011 Share Posted June 30, 2011 Take the semicolon off of line 103 $sql = mysql_query("INSERT INTO members (firstname, lastname, email, password, sign_up_date, gender, date, month, year) VALUES ('$firstname','$lastname','$email','$db_password', NOW(),'$gender','$date','$month','$year')") or die (mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237048 Share on other sites More sharing options...
yogen Posted June 30, 2011 Author Share Posted June 30, 2011 didn't work. Still the same error message :'( Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237051 Share on other sites More sharing options...
jcbones Posted June 30, 2011 Share Posted June 30, 2011 That error should give you a line number, what is it? Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237052 Share on other sites More sharing options...
yogen Posted June 30, 2011 Author Share Posted June 30, 2011 Parse error: syntax error, unexpected T_LOGICAL_OR in /home/content.../register_script.php on line 104 VALUES ('$firstname','$lastname','$email','$db_password', NOW(),'$gender','$date','$month','$year')") Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237053 Share on other sites More sharing options...
xyph Posted June 30, 2011 Share Posted June 30, 2011 I copy and pasted your script. I removed the semicolon from line 103. I no longer received a parse error. It did work <?php $errorMsg = ""; $firstname = ""; $lastname = ""; $email = ""; $pass = ""; $gender = ""; $date = ""; $month = ""; $year = ""; if (isset ($_POST['firstname'])){ $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $email = $_POST['email']; $pass = $_POST['password']; $gender = $_POST['gender']; $date = $_POST['date']; $month = $_POST['month']; $year = $_POST['year']; $firstname = stripslashes($firstname); $lastname = stripslashes($lastname); $email = stripslashes($email); $pass = stripslashes($pass); $gender = stripslashes($gender); $date = stripslashes($date); $month = stripslashes($month); $year = stripslashes($year); $firstname = strip_tags($firstname); $lastname = strip_tags($lastname); $email = strip_tags($email); $pass = strip_tags($pass); $gender = strip_tags($gender); $date = strip_tags($date); $month = strip_tags($month); $year = strip_tags($year); include"scripts/connect_to_mysql.php"; $emailCHecker = mysql_real_escape_string($email); $emailCHecker = eregi_replace("`", "", $emailCHecker); $sql_email_check = mysql_query("SELECT email FROM members WHERE email='$emailCHecker'"); $email_check = mysql_num_rows($sql_email_check); if ((!$firstname) || (!$lastname) || (!$email) || (!$pass) || (!$gender) || (!$date) || (!$month) || (!$year)) { $errorMsg = 'ERROR: You did not submit the following required information:<br /><br />'; if(!$firstname){ $errorMsg .= ' * First Name<br />'; } if(!$lastname){ $errorMsg .= ' * Last Name<br />'; } if(!$email){ $errorMsg .= ' * Email Address<br />'; } if(!$pass){ $errorMsg .= ' * Login Password<br />'; } if(!$gender){ $errorMsg .= ' * Confirm Gender<br />'; } if(!$date){ $errorMsg .= ' * Confirm date<br />'; } if(!$month){ $errorMsg .= ' * Confirm Month<br />'; } if(!year){ $errorMsg .= ' * Confirm Year<br />'; } else if ($email_check > 0){ $errorMsg = "<u>ERROR:</u><br />Your Email address is already in use inside our database. Please use another.<br />"; } else { $firstname = mysql_real_escape_string($firstname); $lastname = mysql_real_escape_string($lastname); $email = mysql_real_escape_string($email); $pass = mysql_real_escape_string($pass); $gender = mysql_real_escape_string($gender); $date = mysql_real_escape_string($date); $month = mysql_real_escape_string($month); $year = mysql_real_escape_string($year); $firstname = eregi_replace("`", "", $firstname); $lastname = eregi_replace("`", "", $lastname); $email = eregi_replace("`", "", $email); $pass = eregi_replace("`", "", $pass); $gender = eregi_replace("`", "", $gender); $date = eregi_replace("`", "", $date); $month = eregi_replace("`", "", $month); $year = eregi_replace("`", "", $year); $db_password = md5($pass); $sql = mysql_query("INSERT INTO members (firstname, lastname, email, password, sign_up_date, gender, date, month, year) VALUES ('$firstname','$lastname','$email','$db_password', NOW(),'$gender','$date','$month','$year')") or die (mysql_error()); $id = mysql_insert_id(); mkdir("members/$id, 0777"); $to = "$email"; $from = "noreply@mydomain.com"; $subject = "Complete your registration"; $message = "Hi $firstname, Complete this step to activate your login identity at yourdomain. Click the line below to activate when ready. http://www.mydomain.com/activation.php?id=$id&sequence=$db_password If the URL above is not an active link, please copy and paste it into your browser address bar Login after successful activation using your: E-mail Address: $email Password: $pass See you on the site! noreply@mydomain.com"; $headers = "From: $from\r\n"; $headers .= "Content-type: text\r\n"; mail($to, $subject, $message, $headers); $msgToUser = "<h2>One Last Step - Activate through Email</h2><h4>OK $firstname, one last step to verify your email identity:</h4><br /> In a moment you will be sent an Activation link to your email address.<br /><br /> <br /> <strong><font color=\"#990000\">VERY IMPORTANT:</font></strong> If you check your email with your host providers default email application, there may be issues with seeing the email contents. If this happens to you and you cannot read the message to activate, download the file and open using a text editor. If you still cannot see the activation link, contact site admin and briefly discuss the issue.<br /><br /> "; include"msgToUser.php"; exit(); } }else { $firstname = ""; $lastname = ""; $email = ""; $pass = ""; $gender = ""; $date = ""; $month = ""; $year = ""; } } ?> Also, eregi_replace() is deprecated Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237054 Share on other sites More sharing options...
yogen Posted June 30, 2011 Author Share Posted June 30, 2011 Hey, Thanks it worked this time but there is nothing getting inserted in mysql Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237056 Share on other sites More sharing options...
xyph Posted June 30, 2011 Share Posted June 30, 2011 So you're getting a MySQL error? Or is the query not even being executed? Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237058 Share on other sites More sharing options...
yogen Posted June 30, 2011 Author Share Posted June 30, 2011 I am not getting any error msg. It's simply redirecting to me to register.php and there is no data values inserted in mysql. Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237060 Share on other sites More sharing options...
yogen Posted June 30, 2011 Author Share Posted June 30, 2011 It's simply redirects me to "register_script.php" and there is no error message now. Also, no data is inserted in mysql. Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237062 Share on other sites More sharing options...
xyph Posted June 30, 2011 Share Posted June 30, 2011 I don't see any redirects in your code. There might be some in 'msgToUser.php' Comment them out, then see if there are error messages. Debugging someone else's code for you is getting kind of tired. I'm thinking you should hire someone to fix this :/ Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237063 Share on other sites More sharing options...
yogen Posted June 30, 2011 Author Share Posted June 30, 2011 I used a header instead and it doesn't work. Do you have a simple register script? Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237065 Share on other sites More sharing options...
xyph Posted June 30, 2011 Share Posted June 30, 2011 Yes, I do, but I don't offer free support for it, and it's not meant to be implemented by someone who doesn't understand OO-PHP Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1237069 Share on other sites More sharing options...
noorim07 Posted July 17, 2011 Share Posted July 17, 2011 Help me! Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/ezbung07/public_html/download.php on line 288 <?php /*************************************************************** Getfile 1.4 Copyright (c) 2007-10 Gowon Patterson - All Rights Reserved this script is licensed under the Open Software License 3.0 http://www.opensource.org/licenses/osl-3.0.php ***************************************************************/ // Download directory where downloads are located. MUST end with a trailing slash ( "/" ) define('BASE_DIR','/www/user/downloads/'); define('ENCRYPT_FILENAME',TRUE); // use encrypted filenames? true/false define('HOTLINK_PROTECTION',TRUE); // enable hotlinking? true/false define('HOTLINK_PAGE_URL','http://www.ezbajukurung.com'); // Hotlink URL //Allowed domains separated by commas (HTTP_HOST allowed by default), DO NOT include "http://", //Asterisk (*) is a wildcard (to easily include all names in a given set) $allowed_domains="*.ezbajukurung.com"; define('LOG_DOWNLOADS',TRUE); // log downloads? true/false define('LOG_FILE','downloads.txt'); // log file name define('LOG_LIST_NUM',200); // number of items shown in log view define('USERNAME','lina'); //Set password used to view log define('PASSWORD','ezlinazzz11'); //Set password used to view log define('LOG_CSS',' body { background-color: #fff; color: #000; font-family: "Trebuchet MS", sans-serif; } table { width: 100%; color: #7BAC90; margin: 0 0 1em 0; font: 80%/150% "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Lucida, Helvetica, sans-serif; } table, tr, th, td { margin: 0; padding: 0; border-spacing: 0; border-collapse: collapse; } thead { background-color: #000; } thead tr th { padding: 1em 0; text-align: center; color: #FAF7D4; border-bottom: 3px solid #999; } tbody tr td { background-color: #eee; } tbody tr.odd td { background-color: #ddd; } tbody tr th, tbody tr td { padding: 0.1em 0.4em; border: 1px solid #999; } tbody tr th { padding-right: 1em; text-align: right; font-weight: normal; background-color: #aaa; text-transform: uppercase; } tbody tr th:hover { background-color: #ddd; } tbody tr:hover td { background: #ccc; color: #000; } table a { color: #854400; text-decoration: none; } table a:visited { text-decoration: line-through; } table a:hover { text-decoration: underline; } th.asc{ background-image: url(../images/asc.gif); } th.des{ background-image: url(../images/des.gif); } '); // Allowed extensions list: 'extension' => 'mime type' $allowed_ext = array ( // archives 'zip' => 'application/zip', // documents 'pdf' => 'application/pdf', 'doc' => 'application/msword', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', // executables 'exe' => 'application/octet-stream', // images 'gif' => 'image/gif', 'png' => 'image/png', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', // audio 'mp3' => 'audio/mpeg', 'wav' => 'audio/x-wav', // video 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mpe' => 'video/mpeg', 'mov' => 'video/quicktime', 'avi' => 'video/x-msvideo' ); /////////////////////////////////// // DO NOT EDIT BEYOND THIS POINT // /////////////////////////////////// #checks the referer of the script function getReferer() { preg_match('@^(?:http://)?([^/]+)@i',$_SERVER['HTTP_REFERER'], $match); return $match[1]; } #Takes all data in flat-file, turns into multidimensional array function read_flatfile($filename,$delimiter="\t") { $fd=fopen($filename,'r'); if (!$fd) return FALSE; while (!feof($fd)) { $line=fgets($fd); $values=explode($delimiter, $line); $linearray=array(); foreach ($values as $Value) { $linearray[] = $Value; } $data[]=$linearray; } fclose($fd); return $data; } #checks if referer domain is okay function hotlink_check() { global $allowed_domains; $allowed_domains.=','.$_SERVER['HTTP_HOST']; $domains=explode(',',str_replace(' ','',$allowed_domains)); $referer=getReferer(); $site=array(); foreach ($domains as $value) { $site[]='^'.str_replace('*','([0-9a-zA-Z]|\-|\_)+',str_replace('.','\.',$value)).'$'; } foreach ($site as $pattern) { if(eregi($pattern,$referer)) $MATCH=TRUE; if($MATCH==TRUE) break; } if($MATCH==TRUE) return TRUE; else return FALSE; } // Check if the file exists, Check in subfolders too function find_file ($dirname, $fname, &$file_path) { $dir = opendir($dirname) or die("Cannot open directory: $dirname"); while (false !== ($file = readdir($dir))) { //echo $file.'|'.md5($file); if (empty($file_path) && $file != '.' && $file != '..') { if (is_dir($dirname.'/'.$file)) { find_file($dirname.'/'.$file, $fname, $file_path); } else { if (ENCRPYT_FILENAME && md5($file) == $fname ) { $file_path = $dirname.'/'.$file; return; } elseif (file_exists($dirname.'/'.$fname)) { $file_path = $dirname.'/'.$fname; return; } } } } } // find_file define('HOTLINK_PASS',hotlink_check()); if(HOTLINK_PROTECTION&&!HOTLINK_PASS&&$_SERVER['QUERY_STRING']!='admin') { header('HTTP/1.1 403 Forbidden'); header('Location: '.HOTLINK_PAGE_URL); die(); } $DL=explode("/",$_SERVER['QUERY_STRING']); set_time_limit(0); // max script execution time (0 = no limit) if ($DL[0]!='admin') { $fname=str_replace("%20"," ",basename($DL[0])); // Remove any path info $file_path = ''; find_file(BASE_DIR, $fname, $file_path); // get full file path (including subfolders) if (!isset($DL[0]) || empty($DL[0]) || !is_file($file_path)) die("\nFile could not be found. Make sure you specified the correct file name."); $fsize = filesize($file_path); // get file size in bytes $fname = basename($file_path); $fext = strtolower(substr(strrchr($fname,"."),1)); // get file extension // check if allowed extension if (!array_key_exists($fext, $allowed_ext)) die("$fext This file type is not allowed."); // get mime type if ($allowed_ext[$fext] == '') { $mtype = ''; // mime type is not set, get from server settings if (function_exists('mime_content_type')) $mtype = mime_content_type($file_path); else if (function_exists('finfo_file')) { $finfo = finfo_open(FILEINFO_MIME); // return mime type $mtype = finfo_file($finfo, $file_path); finfo_close($finfo); } if ($mtype=='') $mtype="application/octet-stream"; } else $mtype = $allowed_ext[$fext]; // get mime type defined by admin $asfname=(!isset($DL[1])||empty($DL[1])) ? $fname:$DL[1]; //Save as if used // set headers header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Type: $mtype"); header("Content-Disposition: attachment; filename=\"$asfname\""); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".$fsize); ob_end_flush(); @readfile($file_path); if (!LOG_DOWNLOADS) die(); $f=@fopen(LOG_FILE, 'a+'); // log downloads if ($f) { @fputs($f, date("Y-m-d\t H:i:s")."\t".$_SERVER['REMOTE_ADDR']."\t".$_SERVER['HTTP_REFERER']."\t".$fname."\r\n"); @fclose($f); } } else { //Logview $user = $_SERVER['PHP_AUTH_USER']; $pass = $_SERVER['PHP_AUTH_PW']; $validated = (USERNAME == $user) && (PASSWORD == $pass); if (!$validated) { header('WWW-Authenticate: Basic realm="Getfile 1.4"'); header('HTTP/1.0 401 Unauthorized'); die ("You do not have access to this area."); } if (isset($_POST['ExportLog'])) { // Export Log header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Type: text/plain"); header("Content-Disposition: attachment; filename=\"log_".date("Y_m_d").".txt\""); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize(LOG_FILE)); ob_end_flush(); @readfile(LOG_FILE); die(); } elseif (isset($_POST['ClearLog'])) @unlink(LOG_FILE); $data=@read_flatfile(LOG_FILE); $date=$data[0][0]; $count=count($data) - 1; unset($data[$count]); echo "<html>\n<head>\n<title>Getfile 1.4</title>\n<style>".LOG_CSS."</style>\n<script>\n"; echo <<< END function sortableTable(tableIDx,intDef,sortProps){ var tableID = tableIDx; var intCol = 0; var intDir = -1; var strMethod; var arrHead = null; var arrMethods = sortProps.split(","); this.init = function(){ arrHead = document.getElementById(tableID).getElementsByTagName('thead')[0].getElementsByTagName('th'); for(var i=0;i<arrHead.length;i++){ arrHead[i].onclick = new Function(tableIDx + ".sortTable(" + i + ",'" + arrMethods[i] + "');"); } this.sortTable(intDef,arrMethods[intDef]); } this.sortTable = function(intColx,strMethodx){ intCol = intColx; strMethod = strMethodx; var arrRows = document.getElementById(tableID).getElementsByTagName('tbody')[0].getElementsByTagName('tr'); intDir = (arrHead[intCol].className=="asc")?-1:1; arrHead[intCol].className = (arrHead[intCol].className=="asc")?"des":"asc"; for(var i=0;i<arrHead.length;i++){ if(i!=intCol){arrHead[i].className="";} } var arrRowsSort = new Array(); for(var i=0;i<arrRows.length;i++){ arrRowsSort[i]=arrRows[i].cloneNode(true); } arrRowsSort.sort(sort2dFnc); for(var i=0;i<arrRows.length;i++){ arrRows[i].parentNode.replaceChild(arrRowsSort[i],arrRows[i]); arrRows[i].className = (i%2==0)?"":"alt"; } } function sort2dFnc(a,b){ var col = intCol; var dir = intDir; var aCell = a.getElementsByTagName("td")[col].innerHTML; var bCell = b.getElementsByTagName("td")[col].innerHTML; switch (strMethod){ case "int": aCell = parseInt(aCell); bCell = parseInt(bCell); break; case "float": aCell = parseFloat(aCell); bCell = parseFloat(bCell); break; case "date": aCell = new Date(aCell); bCell = new Date(bCell); break; } return (aCell>bCell)?dir:(aCell<bCell)?-dir:0; } } var t1 = new sortableTable("t1",0,"int,date,float,float,str,str"); window.onload = function(){ t1.init(); } END; echo "\n</script>\n</head><body>\n\n<p>Log Start Date: $date<br />Total Downloads: $count<br />Download Path: ".BASE_DIR."<br />"; echo 'Encypted Filenames: <strong>'.((ENCRYPT_FILENAME) ? "ENABLED":"DISABLED").'</strong><br />'; echo 'Hotlink Protection: <strong>'.((HOTLINK_PROTECTION) ? "ENABLED":"DISABLED").'</strong><br />'; echo 'Log Downloads: <strong>'.((LOG_DOWNLOADS) ? "ENABLED":"DISABLED").'</strong><br /></p>'; echo '<form action="?admin" method="POST"><p>'; echo '<input type="input" name="filename" value="Filename to encrypt (ex. `docs.txt`)" onfocus="this.value='';" class="noprint" /> <input type="submit" name="EncryptName" value="Encrpyt Filename" class="noprint" />'; if (isset($_POST['EncryptName'])) echo ' Code for <strong>"'.$_POST['filename'].'"</strong>: <strong>'.md5($_POST['filename']).'</strong>'; if (is_file(LOG_FILE)) echo '<br /><input type="submit" name="ExportLog" value="Export Log" class="noprint" /><input type="submit" name="ClearLog" value="Clear Log" class="noprint" />'; echo '</p></form>'; echo "\n\n<table id=\"t1\"><thead><tr><th>##</th><th>Date</th><th>Time</th><th>IP Address</th><th>Referer</th><th>File Downloaded</th></tr></thead>\n\n<tbody>"; for ($i=($count - 1); isset($data[$i]); $i--) { if ($data[$i][0]!='') { if ($i==($count - 1 - LOG_LIST_NUM)) break; echo "<tr><td>".($i+1)."</td>"; for ($g=0; isset($data[$i][$g]); $g++) { echo "<td>"; if ($g==3) echo "<a href=\"".$data[$i][$g]."\">".$data[$i][$g]."</a>"; else echo $data[$i][$g]; echo "</td>"; } echo "</tr>\n\n"; } } echo "</tbody></table>\n\n</body>\n</html>"; } //End Logview ?> Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1243607 Share on other sites More sharing options...
dcro2 Posted July 17, 2011 Share Posted July 17, 2011 On line 288, you're using single quotes to wrap the string but you're also using them inside the string. You need to escape them with backslashes: echo '... onfocus="this.value=\'\';" ...'; Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1243632 Share on other sites More sharing options...
noorim07 Posted July 17, 2011 Share Posted July 17, 2011 Thank you so very much...no errors display.... but as I click the link that suppose to download the file it don't happen instead it jump to my main web page...can give me info? Quote Link to comment https://forums.phpfreaks.com/topic/240839-parse-error-syntax-error-unexpected-t_logical_or/#findComment-1243642 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.