Hey, bin neu darf mich kurz vorstellen bin Evelina, kenne mich noch nicht so gut aus in PHP und Html aba arbeite daran.
Ich habe ein Problem ich möchte ein Ladder Script (Von einem Spiel wird das Level angezeigt) einbauen. Nur wenn ich meine Daten eingebe von meinem host kommt folgendes:
Meine Daten habe ich durch 123 ausgetauscht.
Der Fehler muss sollte beim mysql datein liegen..
Parse error: syntax error, unexpected T_VARIABLE in /usr/export/www/vhosts/funnetwork/hosting/adminlge/functions.inc.php on line 9
Ich weiß, dass es sich um ein Zeichen handeln muss...
Hier der ganze Code:
PHP
<?php
// (c)2003 by zuLu.TrunkZ
//--------------------------------------//
// MySQL Functions: //
//--------------------------------------//
mysql_connect($localhost $123 $d123) || die("Can't Connect to MySql-Server: ".mysql_error());
mysql_select_db($123) || die("Database not found!");
function get_mysql_row($query,$display = "yes"){
if($result = mysql_query($query))
if (mysql_num_rows($result) <= 1 && mysql_num_rows($result) > 0){
return mysql_fetch_array($result);
}
else{
if($display == "yes"){
echo("<p><font color=\"#ff0000\">ERROR: The query returned " . mysql_num_rows($result) . " row(s)!</font>");
echo("<br>Query : " . $query . "</p>");
}
return 0;
}
if($display == "yes"){
print_mysql_error($query);
}
return 0;
}
function get_mysql_rows($query,$display = "no"){
$current_row = 0;
if($result = mysql_query($query))
if (mysql_num_rows($result) > 0){
while ($row = mysql_fetch_array($result)){
$nb_cols = mysql_num_fields($result);
for($i=0;$i<$nb_cols;$i++)
$mysql_array[$current_row][$i] = $row[$i];
$current_row++;
}
return $mysql_array;
}
else{
if ($display == "yes"){
echo("<p><font color=\"#ff0000\">ERROR: The query returned no rows</font>");
echo("Query : " . $query . "</p>");
}
return 0;
}
if ($display == "yes"){
print_mysql_error($query);
}
return 0;
}
function get_mysql_value($query,$display = "yes"){
if($result = mysql_query($query))
if (mysql_num_rows($result) <= 1 && mysql_num_rows($result) > 0){
$row = mysql_fetch_array($result);
return $row[0];
}
else{
//echo("<p><font color=\"#ff0000\">ERROR: The query returned " . mysql_num_rows($result) . " row(s)!</font>");
//echo("<br>Query : " . $query . "</p>");
return 0;
}
if ($display == "yes"){
print_mysql_error($query);
}
return 0;
}
function execute_query($query){
global $msg_adm_error_occured,
$msg_adm_operation_succesful;
if ($result = mysql_query($query))
return $result;
else
print_mysql_error($query);
}
function execute_queries($query,$type_error="none"){
global $msg_error_sql_db;
$flag = 1;
while ($each_query = each($query))
if (!(mysql_query($each_query[1]))){ // if error...
if(strtoupper($type_error) == "DEBUG"){
echo($msg_error_sql_db);
echo("<br>Mysql Query : " . $each_query[1]);
echo("<br>Mysql Error : " . mysql_error());
}
else{
if (strtoupper($type_error) == "SMOOTH")
echo("<br>" . $each_query[1] . " <font color=\"#ff0000\">[ERROR]</font>");
}
$flag = 0;
}
else{
if($type_error=="smooth")
echo("<br>" . $each_query[1] . " <font color=\"#006600\">[OK]</font>");
}
return $flag;
}
function print_mysql_error($query){
echo("<P>There was an error executing the following MySQL query:");
echo("<br> " . $query);
echo("<br> The Error returned by the database looks like this :");
echo("<br><font color=\"#ff0000\">" . mysql_error() . "</font>");
echo("<br>If this problem goes on, please contact webmaster.</p>");
}
//--------------------------------------//
// Formular Funktionen: //
//--------------------------------------//
function print_start(){
echo("<form action=\"".$PHP_SELF."\" Method=\"POST\">");
}
function print_input($text,$var){
echo("<b>".$text."<br>");
echo("<input type=\"TEXT\" NAME=\"".$var."\" value=\"".$$var."\" MAXLENGTH=\"17\" size=\"17\"><br>");
}
function print_hidden($varname,$val){
echo("<input type=\"Hidden\" Name=\"".$varname."\" value=\"".$val."\">");
}
function print_checkbox($tb_question,$tb_name, $checked = "null"){
if ($checked == 1) $checked = "checked";
echo($tb_question." ");
echo("<input type=\"checkbox\" NAME=\"" . $tb_name . "\" class=\"styles\" $checked><br>");
}
function print_submit_end($text){
echo("<input type=\"submit\" value=\"".$text."\">");
echo("</form>");
}
function print_hidden_array($accounts,$accname="accname"){
$nb_accs=count($accounts);
for($i=0;$i<$nb_accs;$i++){
print_hidden("accname[$i]",$accounts[$i][0]);
}
}
//--------------------------------------//
// Sonstige Funktionen: //
//--------------------------------------//
function get_pic($accname){
$sql = "select pic from ladder_accounts where account = '".$accname."'";
$return = get_mysql_value($sql);
return $return;
}
function umbruch($y){
for($i=0;$i<$y;$i++){
echo("<br>");
}
}
function get_accs(){
$sql = "Select account FROM ladder_accounts";
$return = get_mysql_rows($sql);
return $return;
}
function do_not_remove_please($dsgn_fontsize,$dsgn_fontcolor){
echo("<br><br><br><span style=\"font-size: ".$dsgn_fontsize."; color: ".$dsgn_fontcolor.";\">.: Ladder Script 2.1c by <a href=\"mailto:trunks123@gmx.de\">zuLu.TrunkZ</a> :.<br>");
echo(".: visit <a href=\"http://www.z-tribe.de/\">z-tribe.de</a> and <a href=\"http://www.zuLu-tourney.de/\">zuLu-tourney.de</a> :. </span></center></center>");
}
function list_accs(){
$accounts = get_accs();
if($accounts){$nb_accs = count($accounts);}
else{$nb_accs=0;}
echo($nb_accs." Account(s) gefunden!<br><br>");
echo("<table>");
for($i=0;$i<$nb_accs;$i++){
echo("<tr><td valign=\"middle\">");
echo("<span style=\"font-size: ".$dsgn_fonsize."; color: ".$dsgn_fontcolor.";\"><b>".$accounts[$i][0]."</b></span>");
echo("</td><td valign=\"middle\">");
print_admin_start("deleteacc");
print_hidden("account",$accounts[$i][0]);;
print_submit_end("Delete !");
echo("</td></tr>");
}
echo("</table>");
}
?>
Alles anzeigen
Danke schon mal