Questions about PHP, a widely-used general-purpose scripting language that is especially suited for Web development.

learn more… | top users | synonyms

2
votes
2answers
276 views

Should I put utility methods inside a class?

I have been working on a library which contains a large set of functions. For the sake of simplicity, I am going to use just one set as an example. I am not sure which is the better way, in terms of ...
0
votes
2answers
296 views

How to lock a script or web application to be used for the licenced user?

I built a web application using PHP. Now, I want to sell this web application online for customers but I want to guarantee that only one customer (only one website) use this. Is there a way to make ...
-1
votes
1answer
3k views

2 hour interview question for a senior software engineer [closed]

what kind of a question should be asked to test the programming and DB knowledge of a developer ? i am guessing 2 hours practical would be fine. This is for a senior PHP resource and can anybody ...
1
vote
2answers
385 views

Importance of stored procedures and triggers in building web applications? [duplicate]

Almost in every interview for the position of web developer, they ask about stored procedures and triggers well I am aware from their definition and basic usage but the truths is I have never used any ...
2
votes
3answers
237 views

How to insert a database layer in PHP

I maintain and add features on a freelance basis to a website written in PHP. The application was started in PHP4 by a junior programmer back in 2006, and features some very insecure and ...
2
votes
1answer
128 views

Incremental seek on MySQL result

When outputting data in a large file, I try to make it a habit to incrementally output data in chunks, to prevent reading the entire large file into memory. As an example to show what I mean: $fp = ...
0
votes
3answers
499 views

Is it safe to just use MySQLi?

I have developed an open source PHP application and currently it uses both the MySQLi or MySQL extension for backwards compatibility. I'm wondering about switching it over to only be compatible with ...
3
votes
3answers
443 views

Avoiding boilerplate in PHP classes

I am working on a PHP code and as it grows getting more and more tired of repeating the same standard pattern again and again and again: class BolerPlate { protected $property1; protected ...
1
vote
1answer
111 views

A way to include SQlite into an application where the drivers aren't already installed on the system?

I'm an open source web application for use in my university. Currently professors usually have a website, but do to the fact that they're teaching multiple classes in a given term, they don't care to ...
-1
votes
2answers
151 views

How i may develop in php and html? [closed]

I am learning php from the internet on codeacademy.com. I have also learned html and css but the problem that i dont know how can i build a complete website then ! I study everything on its side. But ...
0
votes
0answers
147 views

Pattern or solution for using classes with different interface the same way

What I would like to achieve is to use classes (now two, later more) with different interface the same way, so I would like avoid using decisions based on the interface on upper levels for instance, I ...
1
vote
3answers
439 views

How will I restrict the number of users logged in based on session?

I have a software (in cloud) with so many registered users. I want to restrict the number of users logged in at a time to certain number (configuration based, let's say 100). If the 101 user tries ...
-2
votes
1answer
624 views

web spider for facebook

I just subscribed to a facebook page which post links to different open source projects or code archives. I'll like to save those links and descriptions to a local db. How can I do that? I heard ...
2
votes
2answers
464 views

Getting help in programming while holding the reins tightly

I am starting an Internet business. Basically the most important part, the part that is making me actual money is still missing. I tried to deal with those issues several times but I always get ...
4
votes
5answers
514 views

What are the advantages/disadvantages of using objects as parameters to other object methods?

I'm mostly thinking of PHP here, but if you want to refer to other languages that's fine. An object has a method that requires data contained in another class of object. Should I extract that data ...
3
votes
3answers
351 views

Shared hosting for a PHP application

I was reading Essential PHP Security and chapter 8 talks about problems with hosting your PHP app in a shared hosting environment. Some of the problems he mentions are: - Exposed source code and ...
1
vote
1answer
183 views

How do I go about debugging a PHP error?

I am coming from .NET to PHP. I am playing around with a long file written by someone else (called "cryptographp.inc.php"). It builds and returns an image to the browser. I want to show the image ...
2
votes
3answers
537 views

Web Development on Windows but on Linux Environment [closed]

I do PHP Development on WAMP but sometime it don't work properly when I upload the files to a Linux server, its involve a lot of testing and annoying. I am looking for a solution to do PHP ...
-5
votes
5answers
599 views

Can PHP handle mouse events? [closed]

I'm a newbie in php and i want to know if php can handle mouse events such as upon mouseCicked, mouseDoubleClicked, mouseMoved, mouseHovered etc.. And can events like button click , like displaying ...
1
vote
4answers
750 views

Inserting HTML code with jquery

One of our web applications is a page that takes in a serial number and various information is returned and displayed to the user. The serial is passed via AJAX, and based on the response, one of the ...
0
votes
6answers
814 views

many include files vs one large include file

The company I work for is in the process of completely overhauling our current intranet site by moving it onto a Drupal framework. One area I am questioning is the number of include files we have. As ...
0
votes
0answers
313 views

Flight framework, static or non-static?

I recently came across the Flight micro-framework, I want to use for a project because it seems lightweight, easily extensible and maintained. Most of the other micro-frameworks I looked into and ...
1
vote
1answer
166 views

Unused dependencies and constructor injection

I have a class that has 3 dependencies. WritabbleDBConnection, ReadOnlyDBConnection and a QueryFilter utility object. I want to do constructor Injection so my class would look something like this. ...
2
votes
1answer
395 views

Benefits of setting PHP memory_limit to lower value for specific PHP script?

I need to execute just few lines of PHP code on every single page of my website. This PHP code does not require more than 4MB memory. That is why i want to allocate just 4MB memory to all pages by ...
0
votes
1answer
290 views

Is my application vulnerable to SQL injection if I don't specify each type in Doctrine2?

I thought Doctrine 2 DBAL prepared statements were safe from SQLi. But I found this confusing bit in the docs: By default the Doctrine DBAL does no escaping. Escaping is a very tricky business ...
0
votes
1answer
102 views

LGPL and commerical application in PHP

I have rather specific question about licensing but first of all I would just like to state that I already read a lot of Q&A's here but I'm still not sure about the problem in that particular ...
4
votes
1answer
401 views

Is there a way to prevent the editing of HTML and CSS contents in a page using Firebug-like tools?

Is there a way to prevent the editing of HTML and CSS contents in a page using Firebug-like tools? I found that some users are editing some values in hidden fields and some contents which written ...
8
votes
3answers
481 views

Two components offering the same functionality, required by different dependencies

I'm building an application in PHP, using Zend Framework 1 and Doctrine2 as the ORM layer. All is going well. Now, I happened to notice that both ZF1 and Doctrine2 come with, and rely on, their own ...
0
votes
1answer
428 views

Designing new application from scratch, TDD, MVC, OOD based [duplicate]

I'm about to improve my skills in all that is related to designing applications from scratch using proper OOD principles, involving MVC pattern and using TDD approach to do it. I have a project for ...
1
vote
1answer
132 views

How to maximise the features of MySQL when used with php

I asked this question a while back on SO (http://stackoverflow.com/questions/15506040/maximising-the-features-of-php-and-mysql-when-used-together) but it's a recurring topic, so I thought I'd ask in a ...
0
votes
2answers
215 views

Is this a good measure of PHP script usage of the system?

I've been trying to see a way to get a measure of how much a PHP script costs of memory to the server. Well, I've found some solutions out there that requires some software to make tests and even ...
0
votes
1answer
109 views

How PHP manages memory in this case?

I have a very basic question, so sorry if this is not the place for it. If I have a file "config.php" with some configurations in some variables and in some page I include this file, each time the ...
0
votes
0answers
145 views

Model design used in Zend Framework 1.8 Web application development

I am currently reading Zend Framework 1.8 web application development by Keith Pope. In this book an application called storefront which is a shopping cart is being built. But I am not able to ...
-1
votes
1answer
84 views

Take dynamic PHP array, package up as separate files inside a single zip file

I have this dynamic data in PHP, but for each array record, I want to allow a downloadable option to save a zip archive of all records (each as a separate file). These are actually DNS zone records ...
3
votes
3answers
312 views

Custom PHP Template Engine

I've been developing a custom PHP template engine to suit just my needs and also to get a little more practice with PHP. What I did was to create a Template class that simply receives as constructor ...
4
votes
1answer
366 views

Is a PHP file secure enough on a GoDaddy Server to hard code an AES salt into the file?

So I am creating a web api for an app I am making. The data is sanitized before it is sent to my web api and then encrypted before it is stored in my MySql server. The phone app sanitizes then ...
2
votes
3answers
557 views

High traffic chat - how to check if there is new message and show it for all users

I already had question about this but obviously it was not accepted very well, apparently too long when it's actually more information so you could have given me better answer. Ok, I will be much ...
0
votes
2answers
1k views

Display error message with jQuery without reloading page

I created login form. When user clicks on login button this form shows up with some fade effect (jQuery). What I want to do is to display error message in this form when user inputs invalid data. ...
0
votes
1answer
140 views

how do design the database tables for file download statistics

I have the web application where i am serving file downloads in php. All is working fine and i have the download column in file field where i increment it. But i want to have full statictics of ...
-1
votes
4answers
1k views

Creating a Website Without a Framework [closed]

I've been using PHP Frameworks for so long that I've actually forgot the "best practices" for create websites without one. Usually I will use Symfony, or more recently I've been using Laravel. A ...
-3
votes
2answers
277 views

Make PHP code run on .net? [closed]

I can write PHP application in linux platform. However, I getting a request to explore the idea to run PHP application into .NET. I have zero .NET knowledge. So wondering, is it possible? Is it ...
5
votes
3answers
917 views

random unique pair numbers from two range

I want to write a function that return random unique pair numbers every time call it from a range until resetting it. Something like this: function randomUniquePairs($ranges, $reset = false){ if ...
1
vote
2answers
1k views

SMS verification in web application [closed]

This is my first project related to SMS verification. How to implement SMS verification in online ordering web application? For example:- when we try to reset the password in amazon's website, it ...
1
vote
2answers
413 views

How can I work on multiple programming languages at same time [duplicate]

It always happen to me that if I leave the stuff for 1-2 months I forget the stuff. 5 months back I had symfony project and I did that. At that time I was very much confident that I can do any ...
0
votes
2answers
260 views

Is PHP “list()” language construct a bad convention?

PHP supports the list() language construct which, in short, allows you to return multiple values from a function and then attach them to different variable, eg: function myBigReturn(){ return ...
0
votes
3answers
2k views

The best possible way to implement Business Rules in PHP

I'm planning to write an e-commerce app using PHP & MySQL with lots & lots of custom rules. Say for example, I want to have a rule like "Give Customer X, a 10% a discount for Product Y if he ...
-1
votes
1answer
502 views

Syncing chat on android device with web application

I am trying to make a chat application in android. Just a one on one chat. However I also want the chat to be synced with the web app that runs on the browser. I am confused about how to go about it. ...
2
votes
3answers
295 views

Using two versions of a class in the same code

At my job, in our core project, we have a Validation class that has been evolving with the years. And ee have an old project with an User class that uses an old version of the Valdiation class. And ...
10
votes
6answers
2k views

Web Developer and Math [duplicate]

I have just learned HTML/CSS and I practice everything I read to make it more understandable to me and I really enjoy it. My goal is to be a Modern Web Developer both front and back-end, so I won't ...
0
votes
5answers
787 views

Building a web app with encrypted MySQL database entries?

I have some experience in building PHP based websites with MySQL access, storing encrypted user details, but all other fields being plain text. My most recent project will require sensitive data to be ...