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

learn more… | top users | synonyms

2
votes
1answer
11 views

Building a DBAL from scratch

I am considering building a DBAL from scratch with PHP to use within my projects and also to learn through the process. I have noticed on SO and other reputable forums that whenever this is mentioned ...
0
votes
0answers
24 views

gnu lesser general public license question

I have a question about Thingiviews license. I have a site that has to do with 3D Printing, it is not done yet but I was wondering if I would be able to use it on my site, The big reason I am asking ...
0
votes
0answers
22 views

User Generated Content and Hotlink Protection

I have a website that allows for users to paste content (like snippets of code, etc) for sharing. Like Pastebin and Github, I also have a "raw" link that will display the raw contents of those posts. ...
0
votes
0answers
15 views

Class/Object with different sets of configurations, singletons etc (PHP)

I want to produce maintainable code for configuring one or multiple classes differently depending whether in a production or development environment. For example, making a Paypal class/object that ...
0
votes
2answers
104 views

How can I handle Bots in a site that creates a database item every page

I have an eCommerce platform that creates a basket as soon as the user lands on the site if they don't already have one (from session or cookies). It then stores the basket information in session and ...
-3
votes
0answers
21 views

Show display error for specific ip address in wamp server [on hold]

I'm working at gaint project which is share between 3 developers, the project is place at developer's 1 computer I'm developer 2 when I ask to dev 1 open(on) the error reporting function he open it ...
0
votes
1answer
35 views

Ensuring non conflicting components in a modular system

So lets say we are creating a simple "modular system" framework. The bare bones might be the user management. But we want things like the Page Manager, the Blog, the Image Gallery to all be ...
2
votes
2answers
138 views

Is it good practice to declare and set properties in abstract classes?

I am using PHP and designing some abstract classes. I can declare properties with constant values within my abstract class and access/overwrite them from any class which extends this without re ...
-2
votes
0answers
18 views

DIBS MAC calculation problem in PHP [on hold]

$msg = "acceptReturnUrl=test.com&amount=100&currency=EUR&merchant=########&orderId=&test=1"; $K = "############################################################"; function ...
-4
votes
0answers
33 views

How to use multi queries in PHP that can solve my problem? [on hold]

I have recently started doing PHP and MySQL. I've done a lot and now I was thinking to apply all my knowledge and build a very simple Social Network just for practice. I am doing it in object oriented ...
1
vote
2answers
63 views

Visitor only applicable when using the Composite pattern?

For a long time I've tried to get my head wrapped around the visitor pattern, and somehow this thing keeps being rather fuzzy to me. I'm currently under the impression it is only useful to apply ...
-4
votes
1answer
69 views

What are the differences between lists in C# and arrays in PHP? [on hold]

I am a php developer and I want to learn some basics of C# but I really can't get my head around how lists work in C#. What are the main differences between a C# List<T> and a PHP array?
-4
votes
2answers
298 views

True/false on the left or the right? [duplicate]

I have heard that generally, an expression like: if (true === $variable) is faster than: if ($variable === true) My question is about the performance, not the readability. Questions such as this ...
-2
votes
0answers
24 views

Scheme Advice, ways to improve

I'm gonna create a Student Information System with Laravel and MySQL. My two current planned tables are: enrollees & enrollees_detail enrollee id -> int last_name ...
-2
votes
1answer
119 views

Advantages and Disadvantages of C CGI over PHP? [closed]

I've developed a lot of websites with PHP but sometime after learning C programming I found out that it's possible to do the same thing using C CGI. But I still don't know if it will be worth ...
-2
votes
0answers
35 views

Capturing client request headers (complete) along with IP address information? [closed]

I want to write client request to a file with two things/information headers ip address The code I'm testing on free hosting service.Code is <? $headers= apache_request_headers(); foreach ...
-1
votes
0answers
8 views

php export data to cvs [migrated]

I need a help exporting search query by clicking on export button. I am able to get data from database to the browser. However, when I click on export button, it refreshes the page, and doesnt do ...
-4
votes
0answers
30 views

Would you recommend APF 'Adventure PHP Framework' over another MVC Framework [closed]

It was suggested to me to use APF, the Adventure PHP Framework, on an upcoming project. I was leaning towards Laravel or Symfony2 with a MongoDB and PostgresQL Database. I doesn't have a conventional ...
-3
votes
0answers
37 views

how to select a specific word in specific column php mysql [closed]

I have table with only one column that contains a text (200 char) and I want to select a specific word that comes after my keyword to use is in autocomplete for my textbox field. suppose that: row ...
-4
votes
0answers
91 views

Ajax File Upload Progress bar [closed]

I have jqurey for Single file upload code with showing percentage, It's code is I'm recoding the for multiple file upload in the one time. But isn't upload the files. please help for resold the ...
-3
votes
0answers
49 views

How to create a Cloud Storage Server ( with PHP ) [closed]

How can i build my own "Cloud Storage Server" with PHP like Google Drive / SkyDrive / DropBox / Box / Filaty so users can upload their files into this website Thanks a lot.
-3
votes
1answer
97 views

PHP or Python for a webservice? [closed]

I did a REST webservice with Python. As I need to expand it, I'm wondering if Python is really the best choice. My team is working on both PHP and Python. Is one better than the other in terms of ...
0
votes
1answer
139 views

Implementing a strategy pattern with dependency injection

Okay, so the goal here is to implement a strategy pattern that can be tested using any sort of automated testing tool. I've been struggling with this problem conceptually for a few weeks now and I ...
1
vote
1answer
104 views

DDD - Business rule that depends on a service

I got confused about if a domain is required to access an external service in some state of it's life cycle. The business rule is this : If an Employee is accepting a JobSeeker's JobApplication, ...
0
votes
0answers
78 views

Use a global variable, a singleton, or something else

Preface: I am working in PHP (Abandon hope all ye who enter here). Background: There exists a large set of global functions in PHP, a number of which are miscellaneous system calls, like sleep (and ...
0
votes
1answer
70 views

New User Registration Logic [closed]

I am writing up a user registration application in PHP as part of my learning process. I have written up the general rules my code should follow. Please let me know what you guys think of it. Have ...
1
vote
1answer
99 views

Naming convention for subclasses which extend/inherit baseclasses [closed]

Zend provide a naming convention for Abstract/Interface classes which states you end these classes with the class type respectively. I am curios how to name my sub-classes which extend/implement ...
-4
votes
3answers
96 views

How to inherit from two parent classes

I have many classes with many relationship I draw Uml that relation between them: Is this relation true and how to implement this?
1
vote
1answer
55 views

Loosely compare user input with database record [closed]

I have a database table with 3 columns; id, question and answer. On the front-end, I have a PHP application that shows questions to the user. The application would then compare the user input with the ...
0
votes
1answer
37 views

Automating form error handling

I'm not sure if I'm being clever or making things more difficult. I'm working within a custom MVC framework, and within some of my "views" which contain forms I'm preserving input and styling errors ...
0
votes
0answers
86 views

API Client Design

I'm designing a client to the Tomtom WEBFLEET.connect API in PHP. (You can read more about the API through the full documentation here: ...
1
vote
2answers
95 views

Separating php and html code [closed]

What is the industrial practice on how to separate html and php code in a web project? Using echos to generate html is considered bad but what is the standard way to achieve the sought separation? ...
0
votes
1answer
97 views

Is a PHP array an example of a dynamic data structure?

I did my homework, and it says that dynamic data structures are "data structures that change in size as a program needs it to by allocating and de-allocating memory from the heap". So I was ...
-2
votes
2answers
164 views

Securing PHP source code from illegal copy [closed]

my IT boss asks what is the best way to secure the PHP source code against illegal copy of the code once it is deployed to clients. Is there a PHP compiler that will make the final codes unreadable? ...
1
vote
3answers
218 views

PHP coding practice [closed]

I'm a self taught PHP programmer. Because I have no formal training in PHP, I often find my coding style to be considerably different than example code I find on the Internet. I've slowly started ...
0
votes
1answer
60 views

testing: which code layers should I aim to test?

Say I have this code: Design { public function load() { $this->loadProduct(); $this->loadService(); ... } public function loadProduct() { ...
0
votes
1answer
69 views

Best practice for storing information from a php script for future use

My employer uses forms to help people search for products. The product lists can change from time to time and the forms need to be updated again. The product information can be accessed through a ...
-1
votes
4answers
143 views

Is Object Oriented Design necessary when building Symfony web apps? [on hold]

I am primarily a software developer, and as such, I do a lot of reading on the subject of Object Oriented Design; the 5 SOLID principles, design patterns, composition over inheritance etc. I ...
0
votes
0answers
59 views

How should one handle accessing a 'local' API?

I'm currently writing a project that is using a few separate virtual machines for the database, API and front-end website (currently 1 of each). I'm writing my code in PHP, and all of these virtual ...
-1
votes
0answers
9 views

Logical clean up [migrated]

I am currently having logical structure errors and I can't seem to think of a proper way of writing it out so it looks clean. Currently, I have a table in my database named USER. User has 6 fields out ...
3
votes
1answer
113 views

Should a stored proc try to do more, in the attempt to avoid php mysql back and forth overhead

I have a REST architecture, running PHP on the server side which store and query a Mysql database. I am re-evaluating one architecture design decision: DECISION to re-evaluate: In an attempt to ...
0
votes
1answer
139 views

Is there a Pattern or a Refactoring Method to pull data-loading out of existing Class

I am refactoring legacy codebase. Part of it is a loadProduct() function inside a larger "everything" class. loadProduct() loads data from a database. I want to move this loading-data part out of ...
1
vote
3answers
210 views

Authentication with If/Else

For keeping the "Administration Panel" secure to those who are logged in, for my web application, is the best practice to use an If/Else Statement? if($_SESSION['logged_in'] == true) { include ...
1
vote
3answers
287 views

PHP Code base design: Single “queries.php” file, or spread queries across different php files/classes?

When I create PHP projects, is it better to put all database (e.g. MySql) queries in a single file (i.e. "queries.php")? Or is it better to place the respective queries in any "model" classes (i.e. ...
0
votes
1answer
91 views

Building a webservice with mvc [closed]

I'am planning my website over here based on MVC. And I am thinking about a webservice (who knows, maybe one day I'll create an android app or something). The site and the webservice will behave ...
0
votes
2answers
131 views

mysql, store a single piece of data per row

I am preparing to write a database system using PHP and MYSQL which will store every piece of info sent to it as an individual row. Each row will store several piece of meta data (time stamp, who ...
3
votes
3answers
198 views

OOP what is meant by object-to-object communication

I've been reading in basic concepts of OOP,as i'm trying to make this shift from transactional scripts to more oop manner in php, and i often come across this definition : An object stores its ...
0
votes
1answer
89 views

Examples of designing a database that handles point tracking?

I'm attempting to expand my knowledge of how database designs and concepts work. I'm working on a hobby web/mobile app for practice that will challenge me. However, I am running into an issue. What ...
-2
votes
0answers
19 views

Retrieve options for the second drop down box from DB based on first Drop down box [migrated]

I am currently working on a small project. I have to retrieve some data from a DB (MySQL) and insert it into a webpage as a select (Drop Down box). The code I have written in PHP is: <?php // ...
0
votes
1answer
159 views

How can I deal with a slow API in PHP?

I'm writing a public web app to get stock data from a magento store. I've accessed the data, but it turns out that i have to query each product individually for stock data. With thousands of items ...