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

learn more… | top users | synonyms

1
vote
0answers
40 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
0answers
16 views

Need Free domain and PHP Web hosting with MySQL [on hold]

I am trying to search for a free web domain and hosting site, but there are many hosting sites each with some limitation, this confuse me a lot. I am working on a web project in PHP with MySQL db and ...
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 ...
0
votes
1answer
17 views

Load partial data and data sorting

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
94 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
0answers
15 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
28 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
votes
0answers
43 views

Basic PHP Factory Pattern code review [on hold]

I have an object, KbArticle, that originally in it's constructor, would try to return null if the SQL query that retrieves the data for its required properties came up with 0 rows. A friend told me ...
1
vote
1answer
141 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 ...
3
votes
2answers
230 views

What's a good simple way to combat the n+1 problem?

I'm trying to better understand performance in PHP. One issue I'm thinking about is the n+1 problem. By n+1 I mean something like this: $posts = Posts::getPosts(); foreach($posts as $post) { ...
1
vote
2answers
194 views

Repository pattern implementation that knows nothing (Jon Snow) 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 ...
-1
votes
1answer
69 views

PHP4 constructor does not work with namespaces [on hold]

Here's a scenario: whenever accessing class using namespaces in php, it doesn't launch the standard constructor, but only the 'magic' method. What's wrong here and what can be fixed? hierarchy ...
0
votes
0answers
21 views

Doctrine 2 and Concrete table inheritance

I use Doctrine 2 and I've read some articles on inheritance strategies' mapping with ORM. I've seen three main strategies : "Class table inheritance", "Concrete table inheritance" and "Single table ...
0
votes
1answer
66 views

How can I cancel all running mysql queries in a web application?

I am running a web application which has to scan (mysql query on a particular column) a huge MySQL table, which has over 100,000 records. The problem I find that when a user requests another page ...
-2
votes
0answers
96 views

How to convert some paragraph to html codes with using some symbols for each tags [on hold]

RESOURCE: web page url: "http://en.wikipedia.org/wiki/Anarchism" Text file equivalent to above url html content (Some part of the content, not fully): '''Anarchism''' is a [[political ...
-3
votes
0answers
19 views

Regular expression(preg_replace) in php [duplicate]

I tried below code for replace some text with regular expression pattern..but i cant get properly: Following scenario: My input 'the is good [[text]] [[link1|text1]] [[link2|text2]] [[text]]' ...
1
vote
1answer
103 views

AJAX or web sockets for client-server communication?

I recently took a course on AngularJS, and quite frankly I loved the concepts of a website that fetches json to handle subsequent requests, however I still feel like Javascript is far too slow for ...
-5
votes
0answers
38 views

Regular expression in php [closed]

$patterns = array ('~\[\[(.*)(\|)(.*)\]\]~U','~\[\[(.*)\]\]~U'); $replace = array ('textpluslink','text'); echo preg_replace($patterns, $replace, 'the is good [[text]] [[link1|text1]] [[link2|text2]] ...
1
vote
2answers
124 views

How do two applications communicate? [on hold]

Say I had a PHP page with a calculator interface, but I want to transfer the sum to Windows Calculator.exe and then get a reply from the application back to my PHP page, how do you go about doing ...
-2
votes
0answers
11 views

Convert symbols to html tags in php [migrated]

<?php //Read file $file = 'sample.txt'; $file_copy = 'sample1.txt'; $homepage = file_get_contents($file, NULL, NULL,10); echo htmlspecialchars($homepage); //Write file $current = ...
1
vote
1answer
58 views

Repository Pattern: Doctrine2 vs Microsoft Entity Framework?

I have been using Symfony2 with Doctrine2 for some years. I have recently started using Microsoft's Entity Framework with MVC5. From my Symfony2 experience I understand that a repository's job is only ...
-2
votes
0answers
41 views

Checking against database for various conditons: PHP [closed]

I am new to PHP programming and getting learned as I do this project. The first phase of the project needed to get all the profile information (id, name, code, date, etc…) under different customer ...
1
vote
0answers
112 views

MVC content management framework with an admin panel

I've lately been developing my own MVC content management system using PHP and, at least in my mind, am a little stuck with the system design. I believe this would apply to building a content ...
1
vote
1answer
146 views

Should we live by using Suhosin with PHP?

A lot of my security experienced friends have told me that I need to code my web applications for working under the Suhosin PHP patch, Suhosin being "an advanced protection system for PHP ...
0
votes
0answers
54 views

PHP Password_Hash Function [migrated]

I've been reading up on the usage of the PHP Password_Hash Function it states that it automatically generates a salt and manually generating one is not advised. With this in mind, does this mean I ...
2
votes
0answers
69 views

Use and manage Front End Assets for Web

I am a beginner and am currently developing a kind of cms using PHP. The number of libraries that we can potentially use in the front end is large. I have a question about properly selecting, ...
-1
votes
0answers
20 views

How to access the nth object in a Laravel collection object? [migrated]

I have a laravel collection object. I want to use the nth model within it. How do I access it? Edit: I cannot find a suitable method in the laravel documentation. I could iterate the collection in ...
-1
votes
1answer
79 views

Cloud Newbie … what should I know while creating my App [closed]

I never developed for the Cloud, and to tell you the truth I am not fully 100% sure of what Cloud is when coming down to servers and services. I am starting to develop an App where I will need to be ...
-1
votes
2answers
178 views

Is PHP the only popular language that mixes simple and associative arrays into a single type? [closed]

I'm doing a research on PHP and wondering if there any other commonly used programming langues that use an associative array for both simple indexed element storage and key-value functionality. Does ...
1
vote
1answer
69 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 ...
0
votes
1answer
71 views

When to used static visibility? [duplicate]

I can't attain the primary used of Static Visibility. My question is why they used static method & properties in this code? class PassHash { // blowfish private static $algo = '$2a'; ...
0
votes
0answers
6 views

Bootstrap Active tab on modal hidden [migrated]

I am using Bootstrap as Framework for designing a form, the form has fields in several tabs, I added a onSubmit event that displays a modal if there are any empty field cancels the submit and focuses ...
-1
votes
1answer
27 views

php and mysql hosting service that fulfills my registeration system [closed]

Kindly tell that how to make a registration system that work with php and MySql . I tried the demo that is here but how it works with the online web hosting . I have registered the free hosting at ...
0
votes
0answers
79 views

A kind of actions handler on my PHP project? [migrated]

I wanted to do something like actions handler. I don't know how it should look like. But I started to make something like that: MySQL: CREATE TABLE `handlers` ( `name` varchar(65) NOT NULL default ...
-2
votes
4answers
225 views

What is the name of this design pattern? [closed]

I have been using this "design pattern" (may or may not be an "official" design pattern) for a while and I wanted to know if it had a name (so that I could name my classes after it). Example in PHP ...
0
votes
0answers
27 views

Laravel 4: Binding/linking two users together

I'm building a unittest system. At some point I want to bind two users together in order to make an assignment for those two. So when the admin chooses to link two students together the system should ...
1
vote
1answer
85 views

Taxonomy / Classification of real world objects. Development suggestions [closed]

I have to develop a taxonomy/classification program based on classification algorithms and i would like to have some suggestions. The aim is to help the one using the program to categorize an object ...
0
votes
0answers
14 views

Writing Models in PyroCMS/Codeinighter Models

In Pyrocms there are Admin views and User views. Im developing a complex module where my model file is getting to be rather large. Should I be abstracting logic in my model files to also be User ...
0
votes
2answers
122 views

Flaws in my PHP development setup - sharing sources causing lags

I have following development setup for my PHP projects: Working station running on Windows 7 with PhpStorm IDE. GIT for version controlling. CentOS on virtual machine (VirtualBox) with Apache and ...
0
votes
2answers
134 views

Failed to allocate memory - What is it trying to say?

In my early days of programming I often used to get memory related fatal errors in the following format: Fatal error: Allowed memory size of <some big number> bytes exhausted (tried to ...
0
votes
1answer
147 views

Face Recognition(OpenCV) with MySQL and PHP

First of all I have asked this question on stackoverflow and got down vote for question being not belonging to the site. I am trying my luck se now(more suitable to se I guess) and I hope I will not ...
1
vote
1answer
186 views

Advice on refactoring PHP Project

I have a small SAS ERP that was written some years ago using PHP. At that time, it didn't use any framework, but the code isn't a mess. Nowadays, the project grows and I’m now working with 3 more ...
7
votes
1answer
130 views

Securely sending data from shared hosted PHP script to local MSSQL

I'm trying to add data from a webhook (from a web cart) to a local Microsoft SQL Server. It seems like the best route for me is to use a PHP script to listen for new data (POST as json), parse it, ...
2
votes
1answer
76 views

Do objects maintain identity under all non-cloning conditions in PHP?

PHP 5.5 I'm doing a bunch of passing around of objects with the assumption that they will all maintain their identities - that any changes made to their states from inside other objects' methods will ...
1
vote
1answer
27 views

Correct process for creating builds reliant on 3rd party packages

I work on a Symfony 2 codebase. We use a number of third-party packages (most are in the Symfony Standard Edition). We use composer for dependencies. We current have all of our third-party code ...
0
votes
0answers
73 views

Penny auction concept and how the timer works

I am creating a penny auction site using PHP yii framework. The main consideration of the system is to update the database records of all active auctions (max 15 auctions) with the current ticker ...
0
votes
1answer
136 views

Website File and Folder Structure

I am having a problem learning how proper website structure should be. And by that I mean how to code the pages and how folder structure should be. Currently I am navigating around my website using ...
0
votes
1answer
52 views

exception for string literal conventions

If I'm used to use ' for string literals in PHP, would it be better if I'll stick to it in any situation or can there be exceptions when it would increase readability? example: $foo = "bar'baz"; // ...
0
votes
0answers
76 views

Static methods and static functions? [duplicate]

I want to call a function in a static context in a class. For instance: class test { public function a1() { //do something... } public static function a2() { . . . $this->a1(); } but $this is ...
0
votes
0answers
43 views

ffmpeg: cut multiple input files with seeking to one output file

I have list of video files (loaded from database), each with start and end time of requested interval: # file begin end v1.mp4 1:01 2:01 v2.mp4 3:02 3:32 v3.mp4 2:03 5:23 And ...