Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Emisand's Gunz Admin Panel v3

Status
Not open for further replies.
Newbie Spellweaver
Joined
Nov 25, 2007
Messages
11
Reaction score
0
eek! i updated post, please reread :)
I did it without the ' ' because is the same than not using them and I don't have to concatenate strings that include those constants
its not the same thingy!
by putting '' you assign them as constants
a constant is something that does not change, over time or otherwise: a fixed value.
you don't change keys so php tells you about this - they must be constants

and also, it takes more resources, start 10 benches and see yourself. using constants takes alot less ram and cpu time
if you still don't believe me look at php.net mailing lists
Twice as Fast, Half the Price.
 
Praise the Sun!
Loyal Member
Joined
Dec 4, 2007
Messages
2,502
Reaction score
986
eek! i updated post, please reread :)

its not the same thingy!
by putting '' you assign them as constants
a constant is something that does not change, over time or otherwise: a fixed value.
you don't change keys so php tells you about this - they must be constants

and also, it takes more resources, start 10 benches and see yourself. using constants takes alot less ram and cpu time
if you still don't believe me look at php.net mailing lists
Twice as Fast, Half the Price.

Euhhh as far as i know you make a constant this way:

PHP:
define("constant", "I'm a constant one.");
echo constant;
 
Experienced Elementalist
Joined
Mar 16, 2006
Messages
238
Reaction score
112
Example:
$_CFG[Name] = "George";

When PHP reads that, it will search if already exists a constant called Name, since I didn't defined any constant php "adds" the ' '. And that will be like $_CFG['Name'] = "George";

If you are a perfectionist and don't want those notices, you can disable notices from php.ini or you can edit all the array vars and add the ' '.
You can also define them as constants, but is unuseful. You wont take less ram and CPU since the panel is not massively used, it's just regularly used by the staff.
 
Newbie Spellweaver
Joined
Nov 25, 2007
Messages
11
Reaction score
0
i already know what php does.:)
i just said that doing it how you are doing is wrong
Euhhh as far as i know you make a constant this way:

PHP:
define("constant", "I'm a constant one.");
yep
even echo 'blabla '.$asd.' asd\n'; works faster than echo "blabla $asd asd\n";
 
Experienced Elementalist
Joined
Mar 16, 2006
Messages
238
Reaction score
112
Something inside ' ' is a constant.
But if it's inside " " it may not be a constant, because you can do something like this:
$string = "My name is $name"; so it's not constant.

And if you do echo 'My name is $name' you will see My name is $name and not the content of $name

What i'm doing is not wrong, I have seen the method I used at many codes and it's accepted.
It's just a method that saves me from a complex syntax at the moment of using those constants inside strings.

If I use $_STR[Name] = "Me"; I can do: echo "My name is [$_STR[Name]";

But if I use $_STR['Name'] = "Me"; I am forced to do: echo "My name is ".$_STR['Name'];
 
Experienced Elementalist
Joined
Jun 6, 2008
Messages
259
Reaction score
9
Its working fine for me except that "send item to storage" whenever i tried to send it. It always says "item send sucssecfully"
but der is not any thing in store.
But the"send item to inventory "is working fine.
Another question-
how to add the remaining things like account list and etc. I downloded the php but dont know how to add.
 
Experienced Elementalist
Joined
Mar 16, 2006
Messages
238
Reaction score
112
Its working fine for me except that "send item to storage" whenever i tried to send it. It always says "item send sucssecfully"
but der is not any thing in store.
But the"send item to inventory "is working fine.
Another question-
how to add the remaining things like account list and etc. I downloded the php but dont know how to add.

I will check the Send Item to Storage function, Someone else had the same problem.

Then, I think you don't need to add those phps, If you want to see the account list, go to the search functions, and in Search accounts, just leave the text box empty and click search, all the accounts should be displayed, the same for character list, but with the search characters, and the same for clans but with search clans.
 
Newbie Spellweaver
Joined
Nov 25, 2007
Messages
11
Reaction score
0
Something inside ' ' is a constant.
But if it's inside " " it may not be a constant, because you can do something like this:
$string = "My name is $name"; so it's not constant.

And if you do echo 'My name is $name' you will see My name is $name and not the content of $name

What i'm doing is not wrong, I have seen the method I used at many codes and it's accepted.
It's just a method that saves me from a complex syntax at the moment of using those constants inside strings.

If I use $_STR[Name] = "Me"; I can do: echo "My name is [$_STR[Name]";

But if I use $_STR['Name'] = "Me"; I am forced to do: echo "My name is ".$_STR['Name'];
if you code somethin - don't get notices or its wrong coded :wink:
closed theme for now
 
Praise the Sun!
Loyal Member
Joined
Dec 4, 2007
Messages
2,502
Reaction score
986
if you code somethin - don't get notices or its wrong coded :wink:
closed theme for now

I agree with emisand. The best / safest way of coding is:

PHP:
echo "My name is " . $res['name']. "";
However, i'm always doing it the same way as emisand:

PHP:
echo "My name is $res[name]";
It's just way easier to do. I'm getting teached both ways at school (Programming school, first year). But my teacher doesn't know PHP that well. (That's funny sometimes.)
 
Newbie Spellweaver
Joined
Nov 25, 2007
Messages
11
Reaction score
0
I agree with emisand. The best / safest way of coding is:

PHP:
echo "My name is " . $res['name']. "";
However, i'm always doing it the same way as emisand:

PHP:
echo "My name is $res[name]";
It's just way easier to do. I'm getting teached both ways at school (Programming school, first year). But my teacher doesn't know PHP that well. (That's funny sometimes.)
if you code like that
PHP:
echo "My name is " . $res['name']. "";
its useless to use ""
the best and fastest way is(text is a constant)
PHP:
echo 'My name is ' . $res['name']. '';

i haven't seen
PHP:
echo "My name is $res[name]";
for a long time in all major scripts, its because they probably coded for high-perf.

and also :)
PHP:
echo '1'.$2.'3'
echoes 123
PHP:
echo "1$23"
echoes 1, if you need to use a variable without spaces you have to add ".." its double wrong, php have to define text as a constant 2 times.
 
Praise the Sun!
Loyal Member
Joined
Dec 4, 2007
Messages
2,502
Reaction score
986
if you code like that
PHP:
echo "My name is " . $res['name']. "";
its useless to use ""
the best and fastest way is(text is a constant)
PHP:
echo 'My name is ' . $res['name']. '';
i haven't seen
PHP:
echo "My name is $res[name]";
for a long time in all major scripts, its because they probably coded for high-perf.

and also :)
PHP:
echo '1'.$2.'3'
echoes 123
PHP:
echo "1$23"
echoes 1, if you need to use a variable without spaces you have to add ".." its double wrong, php have to define text as a constant 2 times.

I know, but the official way is still to use echo "My name is " . $res['name']. "";
 
DRGunZ 2 Creator
Loyal Member
Joined
Jan 21, 2007
Messages
4,493
Reaction score
161
you dont need it, all you need is AppServ install that and open up a Internet Browser and type in either or localhost
 
Junior Spellweaver
Joined
Jun 30, 2008
Messages
118
Reaction score
0
how to make tabbel for storage rent period???
 
DRGunZ 2 Creator
Loyal Member
Joined
Jan 21, 2007
Messages
4,493
Reaction score
161
i think it would be in AccountItems.dbo
 
Status
Not open for further replies.
Back
Top