Re: Online Highscores Help
hmm... Any idea how to change it?
Do i need to use microsoft word? because another computer in our house has it.
Re: Online Highscores Help
open it up in notepad again and do save as and change the extension to .php instead of .txt
Re: Online Highscores Help
It dosent make adifference when i put .php at the end, but while saving there are there 3 options in encoding: ANSI, UNICODE, UNICODEbidedia and UTF-8. By default it's on ANSI so im not sure if it makes a difference.
BTW thanks for help so far ketchip : )
Re: Online Highscores Help
no he means just change it.
you may need to disable hide known file types in the folder view menu.
Best of luck
Re: Online Highscores Help
The filename is displayscores.php but it is still a text file.
ooo i see that you mean, there is no .php extension. It isn't on microsoft word either =(
Is it even neccesary to complete the tutorial to upload a word document with the coding?
Thanks for the luck, think i need it ; )
Also thanks to everyone contributing there time to my problem, very (very) much appreciated.
Re: Online Highscores Help
try this:
turn off hide file extensions for known file types like this:
- select Start | Settings | Control Panels | Folder Options
- select the View tab
- UNcheck "hide file extensions for known file types"
- Click OK to finish
then try to rename the file to .php within windows
Re: Online Highscores Help
alrighty i try that in a sec...
Re: Online Highscores Help
Alright, when i try to press save it just does nothing.. Dosen't work on microsoft word either.
Re: Online Highscores Help
This is the problem a lot of people have with file extensions. Here is what you do:
1. Open a blank notepad.
2. Copy and paste the php text from the other failed one or just start over with a new one.
3. Go to File>Save As
4. Under "Save As Type" select All Files
5. Make the file name "whatever.php" without quotations.
5. Hit Save
And your done, this makes it an absolute php file, the encoding shouldn't matter, but to stay on the safe side, leave it as ANSI. I just tested this and I know it works, because instead of a text icon on the file, I have a Dreamweaver icon, which I have defaulted for php.
---EDIT---
Quote:
Originally Posted by dylan99379
<html>
<head>
<title>Online Scoreboard Tutorial - Scores</title>
</head>
<body>
<?
$service = "sql112.byethost13.com";
$username = "b13_1564643";
$password = "*******";
$database = "highscores";
mysql_connect($service, $username, $password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * FROM highscores";
$result = mysql_query($query);
$num = mysql_numrows($result);
?>
<table>
<tr class="header"><td>Pos</td><td>Name</td><td>Score</td><td>Date Submitted</td></tr>
<?
$loopindex = 0;
while ($loopindex < $num) {
$thisname = mysql_result($result, $loopindex, "name");
$thisscore = mysql_result($result, $loopindex, "combatexperience");
$thisdate = mysql_result($result, $loopindex, "datesubmitted");
$thispos = $loopindex+1;
echo ("<tr><td align=left><p>$thispos</p></td>
<td align=center><p>$thisname</p></td>
<td align=center><p>$thisscore</p></td>
<td align=center><p>$thisdate</p></td></tr>\n");
$loopindex++;
}
?>
</table>
</body>
</html>
There is a problem in the php code right here at "$database = "highscores";" That is the table name, and the database should be something longer probably like bytehost12_highscore, you will find it in the phpMyAdmin. This line is correct
"$query = "SELECT * FROM highscores" because it uses the table name. If you fix the database thing you should be alright.
Re: Online Highscores Help
Quote:
Originally Posted by Brandon
This is the problem a lot of people have with file extensions. Here is what you do:
1. Open a blank notepad.
2. Copy and paste the php text from the other failed one or just start over with a new one.
3. Go to File>Save As
4. Under "Save As Type" select All Files
5. Make the file name "whatever.php" without quotations.
5. Hit Save
And your done, this makes it an absolute php file, the encoding shouldn't matter, but to stay on the safe side, leave it as ANSI. I just tested this and I know it works, because instead of a text icon on the file, I have a Dreamweaver icon, which I have defaulted for php.
---EDIT---
Quote:
Originally Posted by dylan99379
<html>
<head>
<title>Online Scoreboard Tutorial - Scores</title>
</head>
<body>
<?
$service = "sql112.byethost13.com";
$username = "b13_1564643";
$password = "*******";
$database = "highscores";
mysql_connect($service, $username, $password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * FROM highscores";
$result = mysql_query($query);
$num = mysql_numrows($result);
?>
<table>
<tr class="header"><td>Pos</td><td>Name</td><td>Score</td><td>Date Submitted</td></tr>
<?
$loopindex = 0;
while ($loopindex < $num) {
$thisname = mysql_result($result, $loopindex, "name");
$thisscore = mysql_result($result, $loopindex, "combatexperience");
$thisdate = mysql_result($result, $loopindex, "datesubmitted");
$thispos = $loopindex+1;
echo ("<tr><td align=left><p>$thispos</p></td>
<td align=center><p>$thisname</p></td>
<td align=center><p>$thisscore</p></td>
<td align=center><p>$thisdate</p></td></tr>\n");
$loopindex++;
}
?>
</table>
</body>
</html>
There is a problem in the php code right here at "$database = "highscores";" That is the table name, and the database should be something longer probably like bytehost12_highscore, you will find it in the phpMyAdmin. This line is correct
"$query = "SELECT * FROM highscores" because it uses the table name. If you fix the database thing you should be alright.
Thanks for the very helpful reply!
I tried saving the file as php again, but it would just refresh my icons and not do anything, so i used the file editor on bytehost. I renamed that to displayhighscores(*.PHP) and it worked!
With the code problem, my database is also called highscores, so should i rename the code to b13_1564643_highscores or using the host name sql112.byethost13.com_highscores
I'll be able to reply in about 6-6.5 hours.
Again thanks everyone for there replies and help. Few names going in the credits of my game = )