|
You last visited: Today at 19:43
Advertisement
Php Help
Discussion on Php Help within the Dekaron Private Server forum part of the Dekaron category.
04/19/2013, 16:28
|
#1
|
elite*gold: 0
Join Date: Jan 2009
Posts: 488
Received Thanks: 122
|
Php Help
So I downloaded janvier123's php EX: top pvp/etc.
But how should I go about adding them to my website?
I understand how my register pages works, seeing that I do have it up and running. But for that it has to files. Php/HTML.
The files I downloaded from janvier does not. I feel lost in this area a little.
If anything someone skype me and let me know how **** works. xD
Skype: Ansem774
|
|
|
04/19/2013, 20:02
|
#2
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,853
Received Thanks: 1,876
|
PHP Code:
<?php include ('<filename.php>') ?>
|
|
|
04/20/2013, 00:37
|
#3
|
elite*gold: 0
Join Date: Jan 2009
Posts: 488
Received Thanks: 122
|
add that into my webpage and its just showing
') ?>
Then I moved the < > and its showing blank...
|
|
|
04/20/2013, 01:14
|
#4
|
elite*gold: 0
Join Date: Mar 2013
Posts: 183
Received Thanks: 78
|
Just do
Code:
<?php
//other script stuff here if needed
include 'blah.php';
//other script stuff here if needed
?>
Also look into require, require_once, and include_once.
Depending on what you're doing with the website those may be better to use.
|
|
|
04/20/2013, 01:30
|
#5
|
elite*gold: 0
Join Date: Jan 2009
Posts: 488
Received Thanks: 122
|
Kk so I have the php scripts that included that extra file. {odbc.config.php}
so I have two scrpits.
Code:
include("config/odbc.conf.php");
$odbc_char_con = odbc_connect($odbc['data_cha'],$odbc['user'],$odbc['pass']) or die("Verbinndung zum ODBC Server fehlgeschlagen,bitte zu einem späteren zeitpunkt erneut probieren.");
$odbc_acc_con = odbc_connect($odbc['data_acc'],$odbc['user'],$odbc['pass']) or die("Verbinndung zum ODBC Server fehlgeschlagen,bitte zu einem späteren zeitpunkt erneut probieren.");
echo "<center>Player Online List<br>";
echo "<table border='1'>
<tr>
<td align='center'>Char.Name</td>
<td align='center'>Level</td>
<td align='center'>Class</td>
</tr>";
$result1 = odbc_exec($odbc_acc_con,"SELECT user_no FROM account.dbo.USER_PROFILE WHERE login_flag = '1100'");
$classes = array('0' => "Azure Knight", '1' => "Segita Hunter", '2' => "Incar Magician", '3' => "Vicious Summoner", '4' => "Segnale", '5' => "Bagi Warrior");
while(odbc_fetch_row($result1)) {
$user_no = odbc_result($result1,1);
$result2 = odbc_exec($odbc_char_con,"SELECT character_name,wLevel,byPCClass FROM character.dbo.user_character WHERE user_no = '".$user_no."' ORDER by login_time DESC");
$name = odbc_result($result2,1);
$level = odbc_result($result2,2);
$class = odbc_result($result2,3);
if(!preg_match("/[[GM]]/i",$name)) {
echo "<tr>
<td align='center'>".$name."</td>
<td align='center'>".$level."</td>
<td align='center'>".$classes[$class]."</td>
</tr>";
}
}
odbc_close($odbc_char_con);
odbc_close($odbc_acc_con);
echo "</table></center>";
|
|
|
04/20/2013, 03:57
|
#6
|
elite*gold: 0
Join Date: Mar 2013
Posts: 183
Received Thanks: 78
|
Change
Code:
include("config/odbc.conf.php");
to
Code:
include 'odbc.conf.php';
As long as it's in the same directory it will work.
|
|
|
04/20/2013, 05:18
|
#7
|
elite*gold: 0
Join Date: Jan 2009
Posts: 488
Received Thanks: 122
|
Wouldn't it be like this tho?
include 'http://{EXTERNALIP}/odbc.conf.php';
Im not hosting my website from my htdocs...
|
|
|
04/20/2013, 10:21
|
#8
|
elite*gold: 0
Join Date: Mar 2013
Posts: 183
Received Thanks: 78
|
Quote:
Originally Posted by Godricc
Wouldn't it be like this tho?
include 'http://{EXTERNALIP}/odbc.conf.php';
Im not hosting my website from my htdocs...
|
*From the PHP include manual*
include 'http://www.example.com/file.php';
So yea putting the IP would work as long as it isnt in a protected directory.
But I don't see much of a purpose in storing your scripts in different locations. What I mean is having the included script in a different spot than the one calling it.
|
|
|
04/20/2013, 14:06
|
#9
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,853
Received Thanks: 1,876
|
Quote:
Originally Posted by .Genome.
*From the PHP include manual*
include 'http://www.example.com/file.php';
|
will NOT work,
PHP Code:
Warning: include() [function.include]: URL file-access is disabled in the server configuration in ... <file>
unless this is enabled, what NO server will do, unless they are retarded !
|
|
|
04/20/2013, 15:21
|
#10
|
elite*gold: 0
Join Date: Mar 2013
Posts: 183
Received Thanks: 78
|
Quote:
Originally Posted by janvier123
will NOT work,
PHP Code:
Warning: include() [function.include]: URL file-access is disabled in the server configuration in ... <file>
unless this is enabled, what NO server will do, unless they are retarded !
|
I was close saying this:
Quote:
Originally Posted by .Genome.
as long as it isnt in a protected directory.
|
But ty for the info I've never done an include from a url/ip.
|
|
|
04/21/2013, 06:16
|
#11
|
elite*gold: 0
Join Date: Jan 2009
Posts: 488
Received Thanks: 122
|
This is how it's showing up on my index...
Heres my code.
PHP Code:
<?php
include("odbc.conf.php"); $odbc_char_con = odbc_connect($odbc['data_cha'],$odbc['user'],$odbc['pass']) or die("Verbinndung zum ODBC Server fehlgeschlagen,bitte zu einem späteren zeitpunkt erneut probieren."); $odbc_acc_con = odbc_connect($odbc['data_acc'],$odbc['user'],$odbc['pass']) or die("Verbinndung zum ODBC Server fehlgeschlagen,bitte zu einem späteren zeitpunkt erneut probieren.");
echo "<center>Player Online List<br>";
echo "<table border='1'> <tr> <td align='center'>Char.Name</td> <td align='center'>Level</td> <td align='center'>Class</td> </tr>";
$result1 = odbc_exec($odbc_acc_con,"SELECT user_no FROM account.dbo.USER_PROFILE WHERE login_flag = '1100'");
$classes = array('0' => "Azure Knight", '1' => "Segita Hunter", '2' => "Incar Magician", '3' => "Vicious Summoner", '4' => "Segnale", '5' => "Bagi Warrior");
while(odbc_fetch_row($result1)) { $user_no = odbc_result($result1,1);
$result2 = odbc_exec($odbc_char_con,"SELECT character_name,wLevel,byPCClass FROM character.dbo.user_character WHERE user_no = '".$user_no."' ORDER by login_time DESC"); $name = odbc_result($result2,1); $level = odbc_result($result2,2); $class = odbc_result($result2,3);
if(!preg_match("/[[GM]]/i",$name)) {
echo "<tr> <td align='center'>".$name."</td> <td align='center'>".$level."</td> <td align='center'>".$classes[$class]."</td> </tr>";
}
} odbc_close($odbc_char_con); odbc_close($odbc_acc_con);
echo "</table></center>";
?>
EDIT: Messed with my config. Also now I get this on the page.
Verbinndung zum ODBC Server fehlgeschlagen,bitte zu einem späteren zeitpunkt erneut probieren
|
|
|
04/21/2013, 11:09
|
#12
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,853
Received Thanks: 1,876
|
my guess? you dont even have PHP installed or wrong extension
what is your FILENAME ?
|
|
|
04/21/2013, 11:49
|
#13
|
elite*gold: 0
Join Date: Jan 2009
Posts: 488
Received Thanks: 122
|
1. How do I install php? I thought it came with everything when I installed xampp!
2. The file names are... obdc.config.php / obdc.player_names.php
Both from dkunderground.
|
|
|
04/22/2013, 12:46
|
#14
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,853
Received Thanks: 1,876
|
added you on skype
|
|
|
04/22/2013, 13:29
|
#15
|
elite*gold: 0
Join Date: Jan 2009
Posts: 488
Received Thanks: 122
|
yeah, I saw that now xD. Im on there now, ganna wait for ya, because I rather talk to a php king! )
|
|
|
All times are GMT +2. The time now is 19:43.
|
|