
SchweppesAle
Members-
Posts
328 -
Joined
-
Last visited
Everything posted by SchweppesAle
-
Question/Help: Securely sending data to database
SchweppesAle replied to shinichi_nguyen's topic in PHP Coding Help
He's saying that issue would not be on the server side(php) but rather making sure that the data is not intercepted. browser->hacker(aka:asshole)->server(php) you need a way of encrypting the data in transit. -
wait...lol, sorry didn't read through the whole thing. Yea, I guess that would be an advantage. I'll leave it as is then without the private construct, thanks for the feedback.
-
you're right, i forgot the private __construct().
-
bump?
-
Search engine crawlers and protected pages
SchweppesAle replied to marcin_koss's topic in PHP Coding Help
pretty sure $_SESSION is server side. -
attributes() http://www.php.net/manual/en/simplexmlelement.attributes.php
-
something like this? $i = 0; while($row_getBus = mysql_fetch_assoc($getBus)) { $bus_dates[$i]['jan_date'] = $row_getBus['jan_date']; $bus_dates[$i]['feb_date'] = $row_getBus['feb_date']; $bus_dates[$i]['mar_date'] = $row_getBus['mar_date']; $bus_dates[$i]['apr_date'] = $row_getBus['apr_date']; $bus_dates[$i]['may_date'] = $row_getBus['may_date']; $bus_dates[$i]['jun_date'] = $row_getBus['jun_date']; $bus_dates[$i]['jul_date'] = $row_getBus['jul_date']; $bus_dates[$i]['aug_date'] = $row_getBus['aug_date']; $bus_dates[$i]['sep_date'] = $row_getBus['sep_date']; $bus_dates[$i]['oct_date'] = $row_getBus['oct_date']; $bus_dates[$i]['nov_date'] = $row_getBus['nov_date']; $bus_dates[$i]['dec_date'] = $row_getBus['dec_date']; $i++; } you'll probably need to tweak the for() construct below it foreach($bus_dates as $bus) { //will iterate through each database entry so $bus['jan_date'] == $bus_dates[0]['jan_date'] on the first run }
-
Hi, I was hoping someone could explain to me the negative consequences of implementing the singleton pattern into a factory class. Here's the code I just started working on: <?php class bfactory { private static $getGenerator; private static $getParser; public static function getGenerator() { require_once('kind8_generator.php'); if(!isset(self::$getGenerator)) { self::$getGenerator = new generator(); } return self::$getGenerator; } public static function getParser() { require_once('parse_url.php'); if(!isset(self::$getParser)) { self::$getParser = new parseURL(); } return self::$getParser; } } ?> From what I've read, the process of creating new instances of a single class is very costly in terms of performance so I figured doing something like this would be a positive. However, I've also been reading a lot regarding how this can have a negative impact on maintenance, etc. Was hoping someone could provide a few examples of how this could backfire before I go any further. Thanks
-
Hi, i have the following variables which I've stored within a config class. I'm using a function to return said data, however I was wondering if there's a better/safer way of doing this. Example: if a hacker managed to slip a file within the apache server. What's to stop him from also including this file then creating an object which returns our database config? Is there anyway to avoid this? class BConfig { private $database = 'CMS'; private $username = 'someusername'; private $password = 'apassword'; public function getDatabaseConfig() { $configuration = array( 'database' => $this->database, 'username' => $this->username, 'password' => $this->password ); return $configuration; } }
-
*slams head on keyboard* lol, thanks
-
Livesite update via SVN and SSH/SFTP
SchweppesAle replied to SchweppesAle's topic in Other Libraries
*forum -
http://koduleht.eu/phptest/taketest.php?2 I'd recommend getting Godaddy on the phone though. There's no reason why you shouldn't at least have version 5 installed.
-
Livesite update via SVN and SSH/SFTP
SchweppesAle replied to SchweppesAle's topic in Other Libraries
Oh man, this shouldn't be under the MySQL form -
That entire paragraph starting from - "Objects are designed to be black boxes". Huge - thanks a lot man. I think I'm finally starting to understand.
-
Hi, I'm still kind of new to SVN; however I was wondering if there's a way to keep a live site up to date with our latest subversion repository. I understand that this can be done with a post commit hook, I'm just not entirely sure how to actually go about doing it.
-
so instead of SELECT orders.orderid , orders.cartid , skus.skuid , skus.price , products.productid , COUNT(products.productid) AS productOrders , products.name FROM orders INNER JOIN items ON (items.cartid = orders.cartid) INNER JOIN products ON (products.productid = items.productid) INNER JOIN skus ON (skus.productid = products.productid) GROUP BY orders.orderid ORDER BY productOrders DESC LIMIT 10 do this? SELECT orders.orderid , orders.cartid , MAX(orders.cartid) AS maxOrders , skus.skuid , skus.price , products.productid , COUNT(products.productid) AS productOrders , products.name FROM orders INNER JOIN items ON (items.cartid = orders.cartid) INNER JOIN products ON (products.productid = items.productid) INNER JOIN skus ON (skus.productid = products.productid) GROUP BY orders.orderid ORDER BY productOrders DESC LIMIT 10 ?
-
GROUP BY clase did the trick, you're a genius. Thanks
-
In short, the goal is to eliminate any duplicate order.orderid columns. I thought that by setting orders as the primary table it would only match orders against each table then return an entry if a relationship where present among all four tables.
-
Oh man, I think I've somehow confused the joins then. Say I wanted to combine all the tables together, but only for each entry of the order table. Which join should I use?
-
hi, we only have about 120 entries within the order table yet this join query is pulling in over 500. Where did I goof? SELECT orders.orderid , orders.cartid , skus.skuid , skus.price , products.productid , products.name FROM orders INNER JOIN items ON (items.cartid = orders.cartid) INNER JOIN products ON (products.productid = items.productid) INNER JOIN skus ON (skus.productid = products.productid)
-
nvm, I solved this issue using the OFFSET function "LIMIT 20 OFFSET 20" Still wish I knew why Limit 20, 40 doesn't work though. It's kind of weird
-
Anyone know why the following query is returning 40 entries instead of 20? SELECT products.productid , products.keywords , products.categories , products.description , products.summary , products.brandid , products.price , products.detail_1 , brands.brandid as BID , products.name , brands.name AS BN FROM products LEFT JOIN brands ON (products.brandid = brands.brandid) WHERE (lcase(products.name) like '%shirt%' OR lcase(products.keywords) like '%shirt%' OR lcase(products.description) like '%shirt%' OR lcase(brands.name) like '%shirt%' OR lcase(products.summary) like '%shirt%' OR lcase(products.detail_1) like '%shirt%') AND products.status = '1' ORDER BY length(products.name) asc LIMIT 20, 40
-
Yup, you sure would! so it really doesn't matter?
-
It's really not my project to begin with. I'm just picking up where someone else left off.
-
Looks like a solid implementation of the MVC design pattern. Say I had a controller which simply includes all files within a "generic procedural library" and used them as a model though. I would still be able to perform any necessary operations from within the model and then retrieve data which would then be passed over to the view.