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

learn more… | top users | synonyms

-2
votes
0answers
49 views

Developer without good logic developing business applications that requires better logic [on hold]

I'm in programming more than 7 years now. I'm working last 2 years in company that produces business web applications. I'm making good money here, good salary. What is problem is that I love this ...
-2
votes
0answers
25 views

Ecommerce Software written in PHP [on hold]

I have to develop an ecommerce website which does not have any products but fetches all the products from external sites like Amazon etc. I know of many ecommerce solutions but they are two complex ...
-1
votes
0answers
51 views

Evenly Distribute students into rooms based on student study subjects and room capacity limitations [on hold]

The problem is that I need an algorithm (preferably in PHP) to solve the following problem. Students need to be placed into dorm rooms of varying capacities based on the subjects the student is ...
0
votes
0answers
44 views

Html/php script (POST method) works on local host but doesn't do anything on my hosting website [migrated]

I want to make a script for my website that it shows a form and a visitor can write his email and a message this is the code: <html> <head> <title>Feedback</title> ...
0
votes
2answers
41 views

Encapsulation: Separate functions for separate variables, or return a table? [PHP]

I have been making a website with PHP and I have a few classes, so far none of them really follow encapsulation rules of OOP. Lets say I have a user class like so: class User{ public $username; ...
-1
votes
0answers
5 views

Cannot pass CasperJS result back to PHP [migrated]

I am trying to pass CasperJS results to PHP but it's not working (the output is empty). Here is my code: <?php exec("casperjs test.js", $array); print_r($array); ?> The exec works for any ...
0
votes
1answer
30 views

Storing and accessing settings from database query

I am trying to figure out the best way to accomplish this so feel free to criticize my thought process. My tool has different locales and each locale can have different settings for the tool. For ...
1
vote
1answer
102 views

API Key DDOS protection

Hi I just wanted some feedback on a DDOS preventing php script that I'm designing. It is quite simple and I wanted some feedback on whether you guys think it would be effective. I'm currently using ...
0
votes
1answer
135 views

How can I fetch data from more than one web services simultaneously in PHP?

I have 3 web services that are providing me data for my hotel booking engine. It is taking too long if I run them sequentially. Therefore I wanted to run them using threads, but I am not sure if php ...
6
votes
5answers
2k views

What are the advantages to using SQL query builders?

Are there any advantages to using a query builder, rather than using raw SQL? E.g. $q->select('*') ->from('posts') ->innerJoin('terms', 'post_id') ->where(...) vs: SELECT * FROM ...
5
votes
2answers
187 views

How to handle a vendor who asks for the solution of an issue they could not solve

Being a small department of developers, it's not uncommon for us to outsource projects. We have a set of companies that we really like to work with, very reliable and good local people who appreciate ...
2
votes
2answers
159 views

Best pratice for return json in a REST application?

I'm starting now with REST (using Laravel 4.2) and Mobile (Android, iOS, SP, etc.) applications. Initially I'm checking if the request is ajax/json and then return a json response. But this ...
3
votes
1answer
774 views

synchronization web service methodologies or papers

I am building a web service (PHP+JSON) to sync with my iphone app. The main goals are: Backup Provide a web view for printing / sorting, manipulating. allow a group sync up and down. I am aware of ...
0
votes
0answers
70 views

When to use packages or Repositories in Laravel?

I'm a Laravel (PHP) developer, and new with DI, Packages (workbench) and Repositories (Pattern). I want to know about the best concept/methodology for a more flexible design; ie. the project can grow ...
1
vote
1answer
92 views

Web Application: Combining View Layer Between PHP and Javascript-AJAX

I'm developing web application using PHP with CodeIgniter MVC framework with a huge real time client-side functionality needs. This is my first time to build large scale of client-side app. So I ...
-1
votes
0answers
32 views

How to list sub-categories when a parent category is selected? ( PHP MySQL ) [closed]

So here's my situation I am working on MVC Patern. It's not any framework. It's just a basic setup of MVC done by myself. I am building a classifieds Ads Website. There are some categories and some ...
10
votes
4answers
3k views

`trigger_error` vs `throw Exception` in the context of PHP's magic methods

I'm having a debate with a colleague over the correct usage (if any) of trigger_error in the context of magic methods. Firstly, I think that trigger_error should be avoided except for this one case. ...
2
votes
3answers
99 views

Multiple many to many relations or one option table?

Let's say I have a database of persons who have some properties. For the sake of this problem let's say all of these properties relate as N-N. I can either create two tables for each property (one ...
0
votes
1answer
349 views

Does it make sense to break fluid interface if a bad argument is passed?

If I chain some setters together and one of them does not return $this, then I will get a fatal error. But maybe that is a good thing. $object = new object(); ...
0
votes
1answer
32 views

Roles configuration strategy

We're close to start new project using sf2, and, probably, FosUserBundle. Keeping that in mind - what's the best strategy to define roles? App will be used by multiple divisions inside our company ...
-1
votes
0answers
45 views

How can we create a desktop based application in php? [duplicate]

I this possible to create a web based application in php if we can please provide me some link of that app also if applicable in youtube provide me youtube link. My search: I search on google and ...
-2
votes
0answers
19 views

Google App Engine File Upload Error - PHP [closed]

PHP Warning: File Upload Mime headers garbled in Unknown on line 0 When i am trying to submit form with large data in texarea and uploading image also.
0
votes
1answer
49 views

How can I configure updates in a CMS like WordPress?

I have a CMS built in core PHP. Till now, if a new version is released, it is downloaded to client machine in zipped form. And then client has to manually unzip the folder and copy that to required ...
0
votes
1answer
82 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 ...
0
votes
1answer
627 views

Reporting Solution in PHP / CodeIgniter - Server side logic vs client side

I'm building a report for an end user. They would like to see a list of all widgets... but then also like to see widgets with missing attributes, like missing names, or missing size. So i was ...
1
vote
1answer
204 views

How to discover a class in PHP dynamically much like a plug-in architecture

I'm encountering a common issue in PHP (and most other languages) at the moment, where systems I'm designing need to be updated in multiple places to add new features, whereas I would like to have a ...
0
votes
0answers
15 views

MYSQL selecting multiple rows of same type [migrated]

From this MYSQL table which has several hundred cities divided into different sets, I need a page to display a clickable link pertaining to each set (i.e. set 1, set 2 etc.) in a list and when one is ...
2
votes
2answers
98 views

I have a legacy project that I'm working on, how should I improve its structure?

I have a slightly old PHP project I'm working on for a client (I think it was started around 5 years ago), it makes extensive use of the outmoded mysql_query function, which is concerning not only ...
0
votes
0answers
40 views

PHP: frequent file system write

I am building a game based on PHP and MySQL. Basically there is a player-vs-player mode but I figured I should add a player-vs-computer mode as well, since players may not be online at all times, ...
9
votes
6answers
2k views

Can someone help me understand MVC? [duplicate]

I've read a few articles on the MVC pattern and tried to understand what it exactly is. But till now, what I get is a plain diagram showing 3 modules of Model, View and Controller. Some say that it ...
0
votes
0answers
43 views

Zend framework 2 authentication - only storing the user ID in session

I've just put together my first app using Zend_Authenticate. According to some tutorials I've read they store the user's "email" column. Is this recommended? I've read to store the ID only, then on ...
0
votes
0answers
21 views

Are Components ideal for packaging and reusing find() requests?

I find myself loading several models over and over again throughout my application. Instead of typing the code to load the model, run a find, would it be reasonable to put that code in a method and ...
0
votes
0answers
18 views

Should I use session or cache to keep the time it last polled when polling to server at intervals?

I'm building a web chat app using session to keep the time the app last polled so that the server can determine whether messages exist between the current polling time and last polling time. It works ...
2
votes
2answers
178 views

optimizing webapp workflow

I have a debug and a live server running a LAMP setup with some python scripts. By now I'm working with eclipse and Expandrive (via SSH) on the debug server. Whenever I want to release new code on the ...
1
vote
0answers
49 views

PHP Framework that favors better general habits over convention

This is intended as an objective question. I've been reading about most of the Frameworks for PHP. We use Cake at work, and I've had exposure to CodeIgniter and Symphony. They all have their own ...
0
votes
0answers
25 views

Deleting dynamic elements from a database

I have a select dropdown, with '+' and '-' buttons that add and remove items before submission. I would like to be able to remove the elements with the '-' button after they have been added to the ...
6
votes
1answer
7k views

PHP Framework for RESTful Web Service

I have been going round in circles with this question for days - which is the best PHP framework to use to create a RESTful Web service? I've trawled the web for info and have come across three main ...
0
votes
0answers
22 views

Verifying and insertion of details in db [migrated]

I need to insert the details (name, id , number )of many documents into database if they are not already existing and if they exist i just need to do a update for any changed information. I have ...
0
votes
0answers
43 views

How to loop through a foreach in php? [migrated]

I need to retrieve day and amount data according to car name. i managed to retrieve carname,car image using foreach and while loop but I'm unable to loop through day and amount of rental for that car. ...
2
votes
1answer
157 views

PHP Cache Strategy - Genius or Sheer Stupidity?

I have a shared hosting with limited capabilities. Memcache and mod_cache are not available to me. I would like to implement my own PHP caching method to cache the results of load-intensive SQL query. ...
2
votes
2answers
249 views

Repository pattern implementation that knows nothing about the database table and column names

I've seen around the Internet and Github, implementations for the design pattern Repository that knows about database table and column names. I was think, if I want to work with the database as a ...
0
votes
0answers
20 views

Can't post data to php, Can't see why [migrated]

I have some data from a form that is being sent to a php script to send an email, it is from a template but I think it is wrong. I have isolated the part of the code that is to blame. The specific ...
-1
votes
1answer
30 views

Load partial data and data sorting [closed]

I have one database table that I query on load and display items in a list sorted out by dates (latest first). However, as the table may become quite big, I only fetch the n first rows. To see more ...
0
votes
2answers
117 views

Is there a better way to load objects?

I have always kept the code to load an object within the object itself. That way no matter what method is creating the object, it always has access to the method to load the object. However this does ...
0
votes
2answers
225 views

How do I handle 3rd party search result data (via cache)

I have a search function on my site and it is taking data from 6 different 3rd party resources. The problem is, it takes too long requesting the data over and over again on the results page. I've ...
0
votes
0answers
27 views

Rendering STL file to STL viewer which is in new page

I've uploaded a STL file as an additional file for a product. And it gets downloaded in frontend as shown in screen shot. When I click on that link for STL Downloader, then that STL file will be ...
0
votes
1answer
29 views

Creating a voting platform for submissions during timeperiod

I have a site where stories are submitted at any time by users. The staff would like the ability to create a voting period at any time. For example, they can choose to open up voting from today until ...
1
vote
1answer
142 views

What is the simplest archive file format to aim for when writing collections of files?

I've created a PHP-based document management system and hosted it on my Raspberry Pi. I created a "backup" function that zips together all the documents, but it takes too long due to the hardware ...
0
votes
1answer
157 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
vote
2answers
566 views

Search and Replace in MVC

What would be a good MVC/OOP/GRASP/SOLID structure for a search/replace functionality. Methods: search/searchNext/replace/replaceAll. I'm interested only in the PHP arhitecture and how a professional ...