Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
FullmetalPride
No it seems to work as long as you don't use mysqli_query. When you fetch an array, associative or not, it's an "offline" function. Same with mysqli_real_escape_string. They just change the datatypes of the already-defined results or inputs.
lol wat
What is an "offline" function? In order to use them, you need a connection to the database in order to modify values with them or use values from them.
I said use $mysqli->query, not mysqli_query. if you use mysqli_query, then you need to pass the connection as a variable after you have set the query which is procedural and disgusting.
Not telling you how to do it, just providing tips. The way you're doing this is not nice, is not user friendly, and is not consistent. MySQLi has great support for OO, so you should use it as it's meant to be used. I used this to learn: http://php.net/manual/en/book.mysqli.php - give it a read.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Jonteh
lol wat
What is an "offline" function? In order to use them, you need a connection to the database in order to modify values with them or use values from them.
I said use $mysqli->query, not mysqli_query. if you use mysqli_query, then you need to pass the connection as a variable after you have set the query which is procedural and disgusting.
Not telling you how to do it, just providing tips. The way you're doing this is not nice, is not user friendly, and is not consistent. MySQLi has great support for OO, so you should use it as it's meant to be used. I used this to learn:
http://php.net/manual/en/book.mysqli.php - give it a read.
Offline as in, you don't have to have an uplink to use mysqli_real_escape_string, or fetch_array, or whatever. You just have to have an input or a result set.
It's not that hard to convert the functions anyways, so I'll just do that now.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
FullmetalPride
Offline as in, you don't have to have an uplink to use mysqli_real_escape_string, or fetch_array, or whatever. You just have to have an input or a result set.
It's not that hard to convert the functions anyways, so I'll just do that now.
Indeed it is easy, however you're wrong; you need to be connected to the database in order to use mysqli::real_escape_string or fetch_array etc.
If you need any help, send me a PM :)
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Jonteh
Indeed it is easy, however you're wrong; you need to be connected to the database in order to use mysqli::real_escape_string or fetch_array etc.
If you need any help, send me a PM :)
Oh I didn't know that.
Thanks m8. I have something to ask right now actually.
Re: [PHP] WindPHP: "Whistler" [R26]
Finished some me page features.
- User Statistics (HC, Coins, Notifications [Except groups..])
- News Article Carousel
- Hot Campaigns
I changed my mind about the HC statistics. But, I don't know if I'm going to do minimail. I'm considering changing it to a better, custom system. I'm going to be programming Staff Picks.
Not sure about tags, either. They're not that helpful, and god knows I never used them.
Re: [PHP] WindPHP: "Whistler" [R26]
Code:
ob_start();
include("C:/inetpub/wwwroot/system/pages/" . $tplId . ".pop");
$tpl = ob_get_contents();
ob_end_clean();
Wouldn't be easier just to use
Code:
$contents = file_get_contents("C:/inetpub/wwwroot/system/pages/" . $tplId . ".pop");
eval("?>" . $contents . "<?php");
At the moment it looks like it's copy-pasta from RevCMS.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Quackster
Code:
ob_start();
include("C:/inetpub/wwwroot/system/pages/" . $tplId . ".pop");
$tpl = ob_get_contents();
ob_end_clean();
Wouldn't be easier just to use
Code:
$contents = file_get_contents("C:/inetpub/wwwroot/system/pages/" . $tplId . ".pop");
eval("?>" . $contents . "<?php");
At the moment it looks like it's copy-pasta from RevCMS.
Nope! Output buffers process php inside the file.
It's a copy paste from uber and rev. Both used ob_get_contents();
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
FullmetalPride
Nope! Output buffers process php inside the file.
It's a copy paste from uber and rev. Both used ob_get_contents();
I don't think you realise what eval(); means :P
http://stackoverflow.com/questions/1...de-in-a-string
http://www.intechgrity.com/understan...t-evaluating/#
It's also good for backdoors! :thumbup:
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Quackster
Waits this got to do with me? This is why I picked ob_get_contents, instead of eval.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
FullmetalPride
Waits this got to do with me? This is why I picked ob_get_contents, instead of eval.
Calm le fuck down. Ignore my suggestion, also you shouldn't mix PHP with HTML.
[PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Quackster
Calm le fuck down. Ignore my suggestion, also you shouldn't mix PHP with HTML.
Theres no other option lol. Unless I wanted to turn everything into a parameter, but that's not effective and definitely not user-friendly.
We're dealing with Habbo here, folks, not an enterprise business application. I'm certainly not going to waste this time attempting to make this as professional and efficient as possible while Habbo is in it's current state. After all, this is mediocre, but it's a thousand times better-written than any shockwave CMS so far.
But thanks for the suggestions. I have yet to implement auto load but that's not a high priority.
Re: [PHP] WindPHP: "Whistler" [R26]
I would highly recommend NOT using Eval... I don't even think I need to elaborate on it except to say that if you want someone to execute php code on your server, then do it.
Also, prepending ?> to an eval input won't stop anyone from just adding <?php and continuing ;)
- - - Updated - - -
oh, and I don't use eval or ob_get_contents, why do you?
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Jonteh
I would highly recommend NOT using Eval... I don't even think I need to elaborate on it except to say that if you want someone to execute php code on your server, then do it.
Also, prepending ?> to an eval input won't stop anyone from just adding <?php and continuing ;)
- - - Updated - - -
oh, and I don't use eval or ob_get_contents, why do you?
I never would use eval. Read through the source, I use output buffers.
I use it so I can put php inside of templates.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
FullmetalPride
I never would use eval. Read through the source, I use output buffers.
I use it so I can put php inside of templates.
Oh. I use functions inside tpls instead, like {function="getuserinfo()"} to separate php and html, otherwise its messy and you can't edit everything via class files.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Jonteh
Oh. I use functions inside tpls instead, like {function="getuserinfo()"} to separate php and html, otherwise its messy and you can't edit everything via class files.
I don't like HTML in my class files, actually. Makes them rather large. Plus I'm already having to write php inside the templates to use those functions, so why add those in the first place? And once I do that I end up having to use ob's to profess the functions.
Jonteh, you use ob_get_contents all the time. You used it in UberCMS and I believe illuminia.