Posts
 
Reputation
Joined
Last Seen
Ranked #157
Strength to Increase Rep
+11
Strength to Decrease Rep
-2
99% Quality Score
Upvotes Received
124
Posts with Upvotes
110
Upvoting Members
59
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
52 Commented Posts
7 Endorsements
Ranked #260
Ranked #159
~258.94K People Reached
About Me

15+ years experience in designing highly scalable web-based distributed infrastructure.

Interests
PHP, Python, Golang, MongoDB, Redis, MySQL, jQuery, XML, XSLT, ZF, Symfony2, Scalability, Systems Architecture,…
Favorite Forums
Favorite Tags

428 Posted Topics

Member Avatar for gunnarflax

I believe what you are looking for is autoloading, which php does have. [url]http://php.net/manual/en/language.oop5.autoload.php[/url] As far as the :: are you referring to the context of self:: static:: etc or are you referencing namepspaces as the use of :: in namespaces was dropped in lieu of \

Member Avatar for odeskavita
1
542
Member Avatar for opjjuly

If your webhost does not support .htaccess and the web server is Apache...move to a better host. If your webhost does not support .htaccess and the web server is not Apache, look to see what type of url rewriting it supports. If you still can't...move to a better host. .htaccess …

Member Avatar for mervin_2
0
859
Member Avatar for Dani

What is the purpose of flushing the output buffer in a controller? Are you trying to use codeigniter in an HMVC fasion and include one controller within another?

Member Avatar for Dani
1
4K
Member Avatar for benjaminFowl87

@Full Spectrum Its not an untyped language it is a loosely typed language. You can cast values to a particular type and do type comparisons if you want/need too. @benjaminFowl87 Unit testing is a very powerful mechanism for development, but in my experience it is a different mindset than just …

Member Avatar for amit005
0
818
Member Avatar for ceeandcee30

`$dteStart->diff($dteEnd);` returns an instance of [DateInterval](http://php.net/manual/en/class.dateinterval.php) If you want the hours from the DateInterval object you can use either of these formatting options, depending on the output you want and a call to [DateInterval::format](http://php.net/manual/en/dateinterval.format.php) ( string $format ) > H - Hours, numeric, at least 2 digits with leading 0 …

Member Avatar for ceeandcee30
0
422
Member Avatar for anirban1087

@jkon I believe the OP is using MPTT (Modified Preorder Tree Traversal). sitepoint has a good example of this: [url]http://articles.sitepoint.com/article/hierarchical-data-database[/url]

Member Avatar for Rishos
0
5K
Member Avatar for tapuwa2002

Stop doing the insert in the loop. This is easily solved by using the loop to generate the insert query and then execute 1 query instead of 10000. PDO Prepared Statements Executes 10000 statements Execution Completed: 10.082677841187 seconds [CODE] $db = new PDO( 'mysql:host=127.0.0.1;dbname=examples', 'username', 'password', array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES …

Member Avatar for cereal
0
3K
Member Avatar for calebcook

Since I just wrote this code answering your first question: [CODE] <?php //Create an instance of now //This is used to determine the current month and also to calculate the first and last day of the month $now = new DateTime( 'now', new DateTimeZone( 'America/New_York' ) ); //Create a DateTime …

Member Avatar for Adriano_1
0
4K
Member Avatar for chaitu11

It sounds like you have a file with 10000+ lines in it, that you need to split into 50 line chunks and save to new files... If the file is well over your php memory limit, reading the whole thing into memory will only cause you headaches. I'd highly suggest …

Member Avatar for chaitu11
0
243
Member Avatar for eshko

@essential I may be wrong, but wouldn't the onblur event mean the field needs to lose focus? If its auto-submitting the form then it should probably wait for a delay indicating the user has finished typing. Something like the solution posted in the comments on this site: [url]http://www.openjs.com/scripts/events/check_after_typing.php[/url] works very …

Member Avatar for murat.ozkan.9028194
0
6K
Member Avatar for nalini@121
Member Avatar for alfredferg

Is the file of a variable length, where you do not know the total number of lines, or will the file always have a fixed number of lines?

Member Avatar for santoshv22
0
2K
Member Avatar for soumyakollon1

PHP is a server side language. It does not have access to the client machine. If you wanted to do something like this, you would need some kind of client based code (flash or java probably) which could possibly use php to drive some of the underlying functionality, chat, logging, …

Member Avatar for ssdwd
0
1K
Member Avatar for ashafaaiz

If you have server access or a hosting company that will install libraries for your use then a great PHP option is to use [Snappy](https://github.com/KnpLabs/snappy) it wraps the [wkhtmltopdf](http://code.google.com/p/wkhtmltopdf/) library and the [wkhtmltoimage](http://code.google.com/p/wkhtmltopdf/) library.

Member Avatar for agent21
0
668
Member Avatar for kcrazy

Personally I like Zend. It is actively developed, built around the bleeding edge features of the language and has constantly been improving. My biggest issue with CI is that it was built to support PHP4. To my understanding and from what I have read that means it uses some workarounds …

Member Avatar for jkon
0
443
Member Avatar for ovidiu_b13

I agree with jkon, the only caveat is needing a browscap.ini which isn't packaged with php by default. This can only be set in the php.ini or httpd.conf files.

Member Avatar for diafol
0
5K
Member Avatar for dany12

I used to be a big advocate of Eclipse and/or Zend Studio, but I've since switched to Sublime Text 2 and could not be happier. However, its more of a text editor than a traditional IDE.

Member Avatar for diafol
0
191
Member Avatar for veledrom

You need an extension that is built for 5.3 and VC6 and is thread safe version [url]http://downloads.php.net/pierre/php_printer-svn20100319-5.3-vc6-x86.zip[/url]

Member Avatar for crazy_chanaka
0
2K
Member Avatar for Sahil_Ar

Completely agree with vinayakgarg. Packages like vBulletin have years and years of development by a team of developers. But don't get discouraged. Put the time in and learn the tools you'll need and you'll be creating great applications before you know it. But, you have to learn the tools first.

Member Avatar for klaipedos
0
227
Member Avatar for captian

If you're going to evaluate a host, look less at the features and more at the infrastructure. If you are looking at a shared host or a reseller account than some important things to consider would be: [LIST=1] [*] Is your data protected by some kind of RAID array? [*] …

Member Avatar for anil22ece
0
353
Member Avatar for gagan22

Do you possibly have cookies disabled in FF and have php configured to use a cookie to store the session id?

Member Avatar for lieky
0
1K
Member Avatar for epicrevolt

I have used LiquidWeb and recommended to it many people for everything for shared, vps, dedicated, virtualization etc etc. In years of service I have never personally experienced a LiquidWeb outage. If you check out WHT they have great reviews and used to be very active members of that forum. …

Member Avatar for giffy
0
416
Member Avatar for dangerousdayton

The OP is not generating a pdf...the OP is creating an FDF document and specifying a form fillable pdf that loads with the populated data. -dangerousdayton When I have generated xFDF the xml version of fdf, the checkboxes have all been setup as unique fields, e.g. Payment_Visa, Payment_Mastercard, Payment_Amex etc. …

Member Avatar for Kristof_1
0
3K
Member Avatar for diafol

Alright, I'll bite the bullet and throw some fuel on the fire. Having more than a decade of php development under my belt now, I've run the gamut of template engines. I've even spun a few of my own over the years, but alas I've settled back into using purely …

Member Avatar for rajppd
0
964
Member Avatar for jkon

My results are right on par with what you are seeing. Reflection is about twice as slow as using variable variables. I also benchmarked call_user_func and found that to be just about on par with the variable variable calls. I can't say I've seen reflection used as much as I've …

Member Avatar for bato3
0
459
Member Avatar for bratbo

If you want the currently executing PHP file you can use the magic constant \__FILE__ (http://php.net/manual/en/language.constants.predefined.php) which will give the filesystem path. OR If you want to link to the current file in a url fashion you can use $_SERVER['PHP_SELF'] (http://php.net/manual/en/reserved.variables.server.php) e.g. if the url is http://www.domain.com/script.php then $_SERVER['PHP_SELF'] will …

Member Avatar for ishan1211
0
5K
Member Avatar for flynismo

For the sake of learning. I think you're whole architecture and thought process on this is wrong. There is a complete violation of single responsibility in all of your classes. We can quickly break this into three responsibilities. 1. Entity\Member - an entity which models a member 2. Validator\Contact - …

Member Avatar for mschroeder
0
383
Member Avatar for Venom Rush

Using the idea of a Honey Pot has always been a pretty effective way to prevent comment form spam. Basically add one or more additional form fields that are hidden to the browsing user that should always be blank. When a form is submitted with those fields filled in, reject …

Member Avatar for Venom Rush
0
183
Member Avatar for dany12

From a high level, your class is trying to accomplish to much in a single place. Check out the concept of SOLID (http://www.freeklijten.nl/home/2012/03/23/SOLID-The-S-is-for-Single-responsibility) What you should ultimately end up with is a set of classes that allow you to work with emails in the most generic of ways. An Email …

Member Avatar for dany12
1
129
Member Avatar for drjay1627

While a threaded set of comments like this is probably best handled by a NoSQL database the necessity to deal with them in a relational database has exsisted for some time. I would suggest looking at either Path Enumeration or a Closure Table to properly model a threaded conversation to …

Member Avatar for mschroeder
0
199
Member Avatar for gabrielcastillo

echo $array[79]->value; Something like that should do the trick, obviously depends on what the variable that contains the array is named.

Member Avatar for gabrielcastillo
0
187
Member Avatar for designalex

The easiest way to implement this, if scaling is not an issue would be to have a single database, with a table that identifies the possible sites. And then an identifier on all of the necessary records connecting the products to a particular site. On the front-ends you would simply …

Member Avatar for mschroeder
0
187
Member Avatar for tymaut

[QUOTE=rajarajan07;1249635]It will not execute server side files, we can just pass the variable to javascript from php. or we can call a php file from javascript function like window.location="delete.php". Thats it! we can't do more from javascript since it was a client side script functions.[/QUOTE] I agree with Krstevski, using …

Member Avatar for IIM
0
321
Member Avatar for McLaren

If you are using PHPUnit, then looking at the code coverage reports would be your best bet. These will show you down to the line what your tests are actually covering. Actually counting the number of methods is pointless as in a well tested solution you'll have significantly more tests …

Member Avatar for McLaren
0
103
Member Avatar for hwoarang69

In the many years I've been developing with php, mailing is always a big pain point I see. As much as I like to advocate learning how to implement something yourself to have a better understanding of how things work and then looking for a more rigorously tested solution or …

Member Avatar for hwoarang69
0
365
Member Avatar for galtectdemo
Member Avatar for veledrom

The simplest solution on windows would be to modify the hosts file so that project.local resolves to the ip of the wamp machine. I also seem to recall wamp having to be set into "online" mode to serve files outside of localhost.

Member Avatar for veledrom
0
2K
Member Avatar for mariaceline_21

Can't really help you without seeing what the code before, on and after line 8 looks like. Without seeing code I'm assuming your passing something like the return of explode() directly into another function. e.g. `$foo = array_shift( explode( '.', $bar ) );`

Member Avatar for mariaceline_21
0
241
Member Avatar for veledrom

What kind of environment is your server running? If the host is using the suPHP module instead of the standard apache DSO module then your scripts execute as your user. So any files/directories may be writable, without having to be 777 etc.

Member Avatar for veledrom
0
389
Member Avatar for cali_dotcom

I've had extensive experience with all three of those frameworks. Symfony2 - At the moment Symfony2 is the best framework I've used. The biggest feature of the whole "framework" is that it is nothing more than a collection of bundles architected together. It is extremely powerful and flexible, and you …

Member Avatar for mschroeder
0
138
Member Avatar for Dani

If you are using a MY_Controller with CI already, add a property called $ignore_cookies defaulting it to FALSE. In your controller setting the $ignore_cookies variable to TRUE will prevent the cookies from being set. Extend /system/core/Security.php CI_Security with a MY_Security and override the csrf_set_cookie() method. <?php class MY_Security { public …

Member Avatar for diafol
0
175
Member Avatar for sowh4t

It would be much easier to answer this if there was a link to the actual content you were trying to scrape. Else we can provide only theoretical answers that won't do you much good in the practical application.

Member Avatar for mschroeder
0
127
Member Avatar for CriticalError

Twig gets my vote by far. Having used a lot of different template languages for php it is the first one that really seems to get it right. The syntax is concise but yet still very verbose. It is fast, but mostly it is extensible. Twig is a pleasure to …

Member Avatar for veedeoo
0
407
Member Avatar for Miss Scarlet

A few points to consider. CI documentation suggests using an underscore naming convention (Books_model) vs camelcasing like BooksModel. Models should also start with a capital letter and be followed only by lowercase letters. Also your models should call the parent constructor. ~~~ php //... public function __construct() { parent::__construct(); } …

Member Avatar for Miss Scarlet
0
134
Member Avatar for doctorphp

Since the media is part of a namespace you have to access that namespace to be able to access those nodes easily. There are a few different ways for it to be achieved but I think this is the cleanest overall. ~~~ php <?php $feed = file_get_contents("http://news.yahoo.com/rss/europe"); $xml = new …

Member Avatar for mschroeder
0
376
Member Avatar for RazorRamon

Assuming you are not confusing a table and a database, and that the databases all reside on one server, this is relatively easy to achieve. Here is a quick example to illustrate the technique: # Database1 - Table people # ~~~ sql DROP TABLE IF EXISTS `people`; CREATE TABLE `people` …

Member Avatar for Biiim
0
1K
Member Avatar for AdilJ

If you have access to the server to install new libraries or if you have a server admin who can address this for you, I highly suggest looking at the pdftk library. http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ Instead of trying to generate the entire page with php and get the styling correct, create a …

Member Avatar for mschroeder
0
1K
Member Avatar for extjac

In my experience, having developed complex systems from scratch, Zend, Symfony2, and CodeIgniter, I can tell you that it really depends on what you want your end result to be. If you build something from scratch you have total control over every aspect, this can be both good and bad, …

Member Avatar for mschroeder
0
173
Member Avatar for sean888

A platform I've worked with in the past is [url]http://zencoder.com/[/url] but it is not free.

Member Avatar for mschroeder
0
131
Member Avatar for asif49

No recursion necessary... [CODE] <?php function getTotal( $integer ) { return array_product( range( 1, (int) $integer ) ); } echo getTotal(9); //362880 [/CODE]

Member Avatar for asif49
0
80

The End.