Jump to content

m118

Members
  • Posts

    59
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

m118's Achievements

Member

Member (2/5)

0

Reputation

  1. hello I need to fix code display problem. The code below cause the disorder problem. When I delete the part of it , the code display in the right way. I do not really understand it . The template try to use bx_textarea to display code,so I find the function in it. Finally , I found this function cause the disorder code problem. <?php echo bx_highlight(bx_textarea($view_query_result['jdescription']), $kwd_search);?> if ($char == "<") { $skip=1; } elseif ($char == ">") { $skip=0; } elseif ($char == " ") { $wrap=0; } if ($skip==0) { $wrap=$wrap+1; } function bx_wordwrap($a_str, $a_break_length=75) { $length = strlen($a_str); for ($i=0; $i<=$length; $i=$i+1) { $char = substr($a_str, $i, 1); if ($char == "<") { $skip=1; } elseif ($char == ">") { $skip=0; } elseif ($char == " ") { $wrap=0; } if ($skip==0) { $wrap=$wrap+1; } $res_str = $res_str . $char; if ($wrap>$a_break_length) { $res_str = $res_str." "; $wrap=0; } } return $res_str; } function bx_textarea($text) { return nl2br(preg_replace('/\t/',' ',bx_wordwrap($text, 75))); }//end function bx_textarea($text)
  2. hello This is a database configuration file for PHP JOBSITE. I need to edit it . After I put the mysql_query("SET NAMES 'UTF-8'"); into the program. It is still not working. I do not know why. Please tell me . Thank you very much <?php function bx_db_connect() { global $db_link; $db_link = @mysql_connect ( DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD ); if ( $db_link ) { mysql_query("SET NAMES 'UTF-8'"); if ( ! @mysql_select_db ( DB_DATABASE ) ) return false; return $db_link; } else { return false; } } function bx_db_checkconnection() { global $db_link; $nr_check = 1; $res_ping = mysql_ping( $db_link); while( !$res_ping && $nr_check < 5) { @mysql_close($db_link); @bx_db_connect(); $res_ping = mysql_ping( $db_link) ; if(!$res_ping ) { sleep(2); } $nr_check++; } if(!$res_ping ) { return false; }else{ return true; } } function bx_db_query ( $sql, $execute=true ) { global $db_link,$bx_temp_query, $bx_query_time; $bx_temp_query=$sql; if ($execute) { if (function_exists("mysql_ping")){ bx_db_checkconnection(); } $query_time = microtime(); $query_start = explode(' ', $query_time); $res = @mysql_query ( $sql, $db_link ); $query_end = explode(' ', microtime()); $bx_query_time = number_format(($query_end[1] + $query_end[0] - ($query_start[1] + $query_start[0])), 3); if (DEBUG_MODE=="yes" && $bx_query_time >1) { //write slow query logs: $fp = fopen(DIR_SERVER_ROOT."logs/mysql_slow_query", "a"); fwrite($fp, date('Y-m-d h:i:s')." - Slow query (time: ".$bx_query_time.")\n"); fwrite($fp, $sql); fclose($fp); } return $res; } else { echo "<br /><span style=\"font-size: 12px; color: #FF0000\">".$sql."</span><br />"; } } function bx_db_close () { global $db_link; return @mysql_close ( $db_link ); } function bx_db_num_rows ( $res ) { return @mysql_num_rows ( $res ); } function bx_db_fetch_array ( $res ) { return @mysql_fetch_array ( $res ); } function bx_db_free_result ( $res ) { return @mysql_free_result ( $res ); } function bx_db_error () { global $db_link; $ret = @mysql_error ($db_link); if ( strlen ( $ret ) ) { return $ret; } else { return "Unknown error"; } } function bx_db_fatal_error ( $msg ) { echo "<H2>Error</H2>\n"; echo "<!--begin_error(dbierror)-->\n"; echo "$msg\n"; echo "<!--end_error-->\n"; exit; } function bx_db_data_seek($db_query, $row_number) { $result = @mysql_data_seek($db_query, $row_number); return $result; } function bx_db_insert_id() { global $db_link; $result = @mysql_insert_id($db_link); return $result; } function bx_db_insert($db_table,$db_fields,$db_values) { return bx_db_query("insert into ".$db_table." ($db_fields)"." values ($db_values)"); } ?>
  3. hello I use php jobsite software to create a jobsite. There is a problem. The article can not display in the right way. I have change the meta to the UTF-8. This is the links. I have been working on this problem for one week, so far I have not get a solution. I hope someone know about php jobsite. Thank you very much. http://jobs.enorstar.com/article.php?title=-and-21152-and-25343-and-22823-and-39640-and-26657-and-65306-and-23601--and-19994-and-25351-and-23548-and-20197-and-26381-and-21153-and-2002-6-and-26680-and-24515&article_id=14&auth_sess=e619b48cd50396951e1b8a653e155102&ref=d0c1f49fc9c73798df000c4c9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> This is database connection file. <?php function bx_db_connect() { global $db_link; $db_link = @mysql_connect ( DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD ); if ( $db_link ) { if ( ! @mysql_select_db ( DB_DATABASE ) ) return false; return $db_link; } else { return false; } } function bx_db_checkconnection() { global $db_link; $nr_check = 1; $res_ping = mysql_ping( $db_link); while( !$res_ping && $nr_check < 5) { @mysql_close($db_link); @bx_db_connect(); $res_ping = mysql_ping( $db_link) ; if(!$res_ping ) { sleep(2); } $nr_check++; } if(!$res_ping ) { return false; }else{ return true; } } function bx_db_query ( $sql, $execute=true ) { global $db_link,$bx_temp_query, $bx_query_time; $bx_temp_query=$sql; if ($execute) { if (function_exists("mysql_ping")){ bx_db_checkconnection(); } $query_time = microtime(); $query_start = explode(' ', $query_time); $res = @mysql_query ( $sql, $db_link ); $query_end = explode(' ', microtime()); $bx_query_time = number_format(($query_end[1] + $query_end[0] - ($query_start[1] + $query_start[0])), 3); if (DEBUG_MODE=="yes" && $bx_query_time >1) { //write slow query logs: $fp = fopen(DIR_SERVER_ROOT."logs/mysql_slow_query", "a"); fwrite($fp, date('Y-m-d h:i:s')." - Slow query (time: ".$bx_query_time.")\n"); fwrite($fp, $sql); fclose($fp); } return $res; } else { echo "<br /><span style=\"font-size: 12px; color: #FF0000\">".$sql."</span><br />"; } } function bx_db_close () { global $db_link; return @mysql_close ( $db_link ); } function bx_db_num_rows ( $res ) { return @mysql_num_rows ( $res ); } function bx_db_fetch_array ( $res ) { return @mysql_fetch_array ( $res ); } function bx_db_free_result ( $res ) { return @mysql_free_result ( $res ); } function bx_db_error () { global $db_link; $ret = @mysql_error ($db_link); if ( strlen ( $ret ) ) { return $ret; } else { return "Unknown error"; } } function bx_db_fatal_error ( $msg ) { echo "<H2>Error</H2>\n"; echo "<!--begin_error(dbierror)-->\n"; echo "$msg\n"; echo "<!--end_error-->\n"; exit; } function bx_db_data_seek($db_query, $row_number) { $result = @mysql_data_seek($db_query, $row_number); return $result; } function bx_db_insert_id() { global $db_link; $result = @mysql_insert_id($db_link); return $result; } function bx_db_insert($db_table,$db_fields,$db_values) { return bx_db_query("insert into ".$db_table." ($db_fields)"." values ($db_values)"); } ?>
  4. The code likes this . 非 320;莫属
  5. I have put it on the web page . It is still not working. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. hello I use the a template called job-site. I can add Chinese character into the database, but I can not display all of the information on the web page. there are a litter bit disordered code on the web page. It is not all of the word is disordered code. I have use the this command . mysql_query("SET NAMES 'utf8'"); I do not know why . Please tell me . Thank you very much.
  7. Thank you . Actually, it is working out.
  8. The data can be displayed , but it does not reach the goal.
  9. hello I need write a program related to the mysql database. it need to search begin time and endtime and contractor name. I write a program , it does not work out. Please tell me how to fix it . Begintime and endtime are in the different row. $select1="select * from nt_contract_list where begintime >='2009-08-07' and endtime <='2010-04-30' order by begintime DESC "; The program is not working , Please tell me how to fix it . Thank you very much.
  10. I need write a program. I need turn page program, so I have to use limit and between and commands together. command line select sum(price) price from a group by name limit a, b between c and d . Is it correct ? Thank you very much.
  11. how to set up to save files as UTF-8 without BOM ? I try to display chinese word.
  12. This is the print screem of the program. I did not find the problem. [attachment deleted by admin]
  13. I get an error message on the web page. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\AppServ\www\mission1\m.php:1) in D:\AppServ\www\mission1\m.php on line 1 I have put the session_start code on the top of the program, but it is not working. Please tell me how to fix it. Thank you very much. <?php session_start(); if(isset($_SESSION['myusername'])) { print "Your session username: ".$_SESSION['myusername']. "<br>"; print "Your session password: ".$_SESSION['mypassword']."<br>"; } else { print "Session does not exist"; } ?>
  14. Is this related to the php version ?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.