PC Nerd
Members-
Posts
1,122 -
Joined
-
Last visited
Never
Everything posted by PC Nerd
-
thanks, that worked
-
thanks, thats working ;D
-
i do use css, but it works with everyother page ( the tables that is) adding the <tr> in the <thead> didnt work any more suggestions ???
-
ok, ive echod out a table, 4 sections, 2 on top and 2 on the bottom. now the bottem left imag is being displayed before the table is even created.... could anyone help me with this: [code]html> <head> <link rel="stylesheet" type="text/css" href="B_A-CSS.css"> <title>Battle Ages Login</title> </head> <body> <table> <thead> <td class = 'left'> <img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'left'> </td> <td class = "centre"> </td> <td class = 'right'> <img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'right'> </td> </thead> <tbody> <tr hight="250"> <td width="20%"> </td> <td width="60%" hight="75"> <b> <center> <h1>BASE</h1> </center> </b> <?php #40 if(!$_COOKIE){ echo "Please login again. <a href= 'B_A-Home.php'>log in again here</a>"; } else{### Display normal page require("inc_files/Database_link.inc"); $User_Name = $_COOKIE['User_Name']; $General_Stats_SQL = "SELECT Points, Research, Sustainability, Attack, Defense, Friends, Units, Resource_1 FROM General_Stats WHERE User_Name = '".$User_Name."'"; $Query = mysqli_query($DB_Server, $General_Stats_SQL); #echo $General_Stats_SQL; $Stats = mysqli_fetch_array($Query); $Stats['M_Power'] = $Stats['Attack'] + $Stats['Defense'] /2; echo "<center>"; echo "<table width='100%' hight='75'>"; echo "<tr hight='200'>"; echo "<td width='50%' hight='50'>"; echo "<p>POINTS: ".$Stats['Points']."</p>"; echo "<p>RESEARCH COUNT: ".$Stats['Research']."</p>"; echo "<p>SUSTAINABILITY: ".$Stats['Sustainability']."</p>"; echo "<p>MILITARY POWER: ".$Stats['M_Power']."</p>"; echo "<blockquote>"; echo "<p>ATTACK: ".$Stats['Attack']."</p>"; echo "<p>DEFENSE: ".$Stats['Defense']."</p>"; echo "</blockquote>"; echo "<p>FRIENDS: ".$Stats['Friends']."</p>"; echo "</td>"; echo "<td width='50%' hight='50'>"; echo "<h2>Preferances</h2>"; echo "</td>"; echo "</tr>"; echo "<tr hight='200>"; [color=yellow]echo "<td width='50%' hight=50'>"; echo "<h3>RECENT RESEARCH</h3>"; echo "<img src='Graphics\TECHS.GIF' alt='Techs'>"; echo "</td>";[/color] echo "<td width='50%' hight='50'>"; echo "RECENT SITE DOVELOPMENTS"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</center>"; } ?> </td> <td width="20%"> </td> </tr> </tbody> </table> </body> </hmtl> [/code] the yellow code is being displayed before the table is created??? any suggestions as to why this is happening.... is it my HTML???
-
ok, this is what ive had to do for my normal server....... ive had to port forward port 81 ( any port you want will work becauase my isp blocks port 80 outgoing ( or shaterver) ( port 80 is defult http)) and then get people to type :81 after the url........... now they also block port 25.... outgoing only for hosting becauase they use that port for their mail... so i am going to use mercury mailserver.... free and came with xampp, so i thinnk all i d ghave to do is port forward another prot and then set email to go to the mail server.... and redirect to outside world.... through another port.... i think that should help
-
i used echo $Query..... NO OUT PUT...? the error is on the line after the query is sent ( i echod using the line in between.... ( so the error is on line 53)) any more suggestions
-
i dont know.... thats why im posting here
-
thjis is what ive got: $Stats = mysqli_fetch_array($Query, MYSQLI_BOTH); now that reutrns : Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\xampp\xampp\htdocs\Battle-Ages\B_A-Base.php on line 52
-
could you explain about the 2nd argument in all of those queries..... not the $query..... becauase i dont know what thise mean thanks
-
ok, errors at present: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\xampp\xampp\htdocs\Battle-Ages\B_A-Base.php on line 52 thanks
-
ok...... switched them around and got this error: Warning: mysqli_query() expects parameter 1 to be mysqli, string given in C:\xampp\xampp\xampp\htdocs\Battle-Ages\B_A-Base.php on line 51 Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\xampp\xampp\xampp\htdocs\Battle-Ages\B_A-Base.php on line 52
-
in reply to the comement about require();, its ok, the inc files are souronded by <?php and ?> tags. but it helps be remember which are the included files, and chich are the php scripts thanks anyway, very valid point
-
ok, error fixed, now im getting the error with this code: [code]require("inc_files/Database_link.inc"); $User_Name = $_COOKIE['User_Name']; $General_Stats_SQL = "SELECT Points, Research, Sustainability, Attack, Defense, Friends, Units, Resource_1 FROM Table_1 WHERE User_Name = ".$User_Name; $Query = mysqli_query($DB_Server, $General_Stats_SQL); $Stats = mysqli_fetch_array($Query); $Stats['M_Power'] = $Stats['Attack'] + $Stats['Defense'] /2;[/code] the line defining the mysqli_fetch_arry()...... ERROR: Warning: mysqli_query() expects parameter 1 to be mysqli, string given in C:\xampp\xampp\xampp\htdocs\Battle-Ages\B_A-Base.php on line 51 Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\xampp\xampp\xampp\htdocs\Battle-Ages\B_A-Base.php on line 52 i thought i got it correct, i know the $DB_Server is correct, its the query thats not working. thankyou for all your help.......
-
ok, the error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in URL/B_A-Base.php on line 62 code: [code]<html> <head> <link rel="stylesheet" type="text/css" href="B_A-CSS.css"> <title>Battle Ages Login</title> </head> <body> <table> <thead> <td class = 'left'> <img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'left'> </td> <td class = "centre"> </td> <td class = 'right'> #20 <img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'right'> </td> </thead> <tbody> <tr hight="250"> <td width="20%"> </td> <td width="60%" hight="75"> <b> <center> <h1>BASE</h1> </center> </b> <?php #40 if(!$_COOKIE){ echo "Please login again. <a href= 'B_A-Home.html'>log in again here</a>"; } else{### Display normal page require("inc_files/Database_link.inc"); $User_Name = $_COOKIE['User_Name']; $General_Stats_SQL = "SELECT Points, Research, Sustainability, Attack, Defense, Friends, Units, Resource_1 FROM Table_1 WHERE User_Name = ".$User_Name; $Query = mysql_Query($General_Stats_SQL, $DB_Server); $Stats = mysql_fetch_array($Query); $Stats['M_Power'] = $Stats['Attack'] + $Stats['Defense'] /2; echo "<center>"; echo "<table border='1' width='100%' hight='75'>"; echo "<tr hight='200'>"; echo "<td width='50%' hight='50'>"; echo "<p>POINTS: .$Stats['Points']."</p>"; echo "<p>RESEARCH COUNT: ."$Stats['Research']."</p>"; echo "<p>SUSTAINABILITY: ."$Stats['Sustainability']."</p>"; echo "<p>MILITARY POWER: ."$Stats['M_Power']."</p>"; echo "<blockquote>"; echo "<p>ATTACK: ."$Stats['Attack']."</p>"; echo "<p>DEFENSE: ."$Stats['Defense']."</p>"; echo "</blockquote>"; echo "<p>FRIENDS: ."$Stats['Friends']."</p>"; echo "</td>"; echo "<td width='50%' hight='50'>"; echo "<h3>Preferances</h3>"; echo "</td>"; echo "</tr>"; echo "<tr hight='200>"; echo "<td width='50%' hight=50'>"; echo "<h3>RECENT RESEARCH</h3>"; echo "<img src="Graphics\TECHS.GIF" alt="Techs">"; echo "</td>"; echo "<td width='50%' hight='50'>"; echo "RECENT SITE DOVELOPMENTS"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</center>"; } ?> </td> <td width="20%"> </td> </tr> </tbody> </table> </body> </hmtl> [/code] im completely stupped
-
ok... ive added the array index, and the string formated accourding to jesirose AND THERE IS STILL THIS ERROR :< i dont understand about the {} in string formatting but i dont think it applies. thanks for your help, but are there anymore suggestions?
-
well you could do a sort of validation code that "header();" to the account page....... you may have to uise the ob_start();, and ob_end_fluch(); good luck
-
in terms of learning PHP, xampp is a great way to runn a server on your own computer etc., thats whay i run
-
100% sure its the right file......
-
still the error..... thanks anyway anymore suggestions
-
thats meant to be #60.............. a comment for the page line, by anyway, getting rid of it still cauase the error on line 62
-
im receiving this error, which is usually shown when youve left out the ; or somethingbut i havent........ the ontly thing which could be wrong is probably the array value which im trying to echo, this is my error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in URL\B_A-Base.php on line 62 my code...... [code]<?php #40 if(!$_COOKIE){ echo "Please login again. <a href= 'B_A-Home.html'>log in again here</a>"; } else{### Display normal page require("inc_files/Database_link.inc"); $User_Name = $_COOKIE['User_Name']; $General_Stats_SQL = "SELECT Points, Research, Sustainability, Attack, Defense, Friends, Units, Resource_1 FROM Table_1 WHERE User_Name = ".$User_Name; $Query = mysql_Query($General_Stats_SQL, $DB_Server); $Stats = mysql_fetch_array($Query); $Stats['M_Power'] = $Stats['Attack'] + $Stats['Defense'] /2; echo "<center>"; echo "<table border='1' width='100%' hight='75'>"; echo "<tr hight='200'>"; $60 echo "<td width='50%' hight='50'>"; echo "<p>POINTS: $Stats['Points']</p>"; echo "<p>RESEARCH COUNT: $Stats['Research']</p>"; echo "<p>SUSTAINABILITY: $Stats['Sustainability']</p>"; echo "<p>MILITARY POWER: $Stats[']</p>"; echo "<blockquote>"; echo "<p>ATTACK: $Stats['Attack']"</p>"; echo "<p>DEFENSE: $Stats['Defense']</p>"; echo "</blockquote>"; echo "<p>FRIENDS: $Stats['Friends']</p>"; echo "</td>"; echo "<td width='50%' hight='50'>"; echo "<h3>Preferances</h3>"; echo "</td>"; echo "</tr>"; echo "<tr hight='200>"; echo "<td width='50%' hight=50'>"; echo "<h3>RECENT RESEARCH</h3>"; echo "<img src="Graphics\TECHS.GIF" alt="Techs">"; echo "</td>"; echo "<td width='50%' hight='50'>"; echo "RECENT SITE DOVELOPMENTS"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</center>"; } ?>[/code] does any one have any suggestions as to what could be cauaseing this
-
thanks, that solved it. i had resecently re made my database from scratch with a new design, and had forgot to make the autoincrement option active thanks
-
wqell i know that the field extra is auto_increment, thats in the mysqli databas itsself ( im using phpmyadmin) also, i thought the code section if ($Rank_query_result = mysqli_query($DB_Server, $rank_query)) { $current_rank = mysqli_num_rows($Rank_query_result); $current_rank ++; } would have created the unique ID, or sles the code above it that ive commented out.
-
i dont understand ???
-
i have the following code, but it says that there is a duplicate entry or something.... here is the error: Duplicate entry '0' for key 1SQL= INSERT INTO General_Stats (User_Name, `Password`, Email, Security_Number, F_Name, L_Name, Age, Account_Created, Rank, Level, Active, Attack, Defense, Sustainability, Resource_1, Resource_2, Resource_3, Friends, Religeon) VALUES ('Bogus1', 'PASSWORD', 'TRUE EMAIL', '4361 - 452 - 858', 'NAME', 'L_NAME', '17 - 25', '21/01/2007 13-25-43', '3', '1', 'NOT_ACTIVE', '1', '1', '1', '200', '0', '0', '0', '0') here is the code: [code]<?php include("inc_files\Database_link.inc"); $rank_query = "SELECT User_Name FROM General_Stats order by Rank DESC"; #$current_rank = '1'; #if ($Rank_Query_Result = mysqli_query($DB_Server, $rank_query)) { # if (mysqli_num_rows($Rank_Query_Result) > 0) { # while ($row = mysqli_fetch_assoc($Rank_Query_Result)) { # $current_rank++; # } # } #} if ($Rank_query_result = mysqli_query($DB_Server, $rank_query)) { $current_rank = mysqli_num_rows($Rank_query_result); $current_rank ++; } $User_Name = $_POST['User_Name']; $Password = $_POST['Password']; $Email = $_POST['Email']; $Security_Number = $_POST['Security_Number']; $F_Name = $_POST['F_Name']; $L_Name = $_POST['L_Name']; $Age = $_POST['Age']; $_POST['Created'] = date("d/m/Y H-i-s"); $Created = $_POST['Created']; $_POST['Rank'] = $current_rank;# + 1; $Rank = $_POST['Rank']; #$subject = "New Battle Ages Acccount Confirmation"; #$Message = "To ".$F_Name."<br>"; #$Message = $Message."User Name :".$User_Name."<br>"; #$Message = $Message."Password :".$Password."<br>"; #$Message = $Message."Security Number :".$Security_Number."<br><br>"; #$Message = $Message."Please type your Security Number into the field below ( with no spaces or dash's), to activate your account"; #$Message = $Message."Thankyou for signing up to Battle-Ages. Please email us a the above address for help and support.<br><br>Yours, Battle-Ages Administraion Team"; #$header = "From: admin@battle-ages.itsmyland.com"; #$Send_Mail = mail($to, $subject, $Message, $header); $New_Player_SQL = "INSERT INTO General_Stats (User_Name, `Password`, Email, Security_Number, F_Name, L_Name, Age, Account_Created, Rank, Level, Active, Attack, Defense, Sustainability, Resource_1, Resource_2, Resource_3, Friends, Religeon) VALUES ('$User_Name', '$Password', '$Email', '$Security_Number', '$F_Name', '$L_Name', '$Age', '$Created', '$Rank', '1', 'NOT_ACTIVE', '1', '1', '1', '200', '0', '0', '0', '0')"; $New_Player_Query = mysqli_query($DB_Server, $New_Player_SQL) or die ("<h3>Error</h3>\n<br><br>\n<p>An error has occured while submitting your details to the Database. As a result your account has not been created, although you may still receive your confirmation email. If you do receive your Email, please ignore it, and resubmit your account request in 24 hours.</p><br><br>".mysqli_error($DB_Server)."SQL= ".$New_Player_SQL); [/code] there is more code below that but im 99% sure its irrelevant id appreciate any help with explainging the error and finding the code cauaseing it and help to fix the error, THANKS