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

learn more… | top users | synonyms

-4
votes
0answers
34 views

Best approach for data storage in custom web app

I'm designing a system with clients where I have following data structure: users table: user,pass,name,address,phone,email,creditcard,verificationcode,ispro,istrial,regdate,etc. session table: ...
2
votes
2answers
72 views

PHP package management with/without Composer

I noticed that many (large) PHP applications use Composer for managing the dependencies. I'm currently trying to figure out if I should switch to Composer (at the moment I'm simply keeping my ...
-4
votes
0answers
31 views

Learning back-end development: Php vs NodeJS [on hold]

Hi i've already programmed in few languages: java, c++, objective-c Now i'd love to learn some web development, mainly back-end. ( i've already learned the basics of html,css,javascript and jquery ) ...
-3
votes
0answers
22 views

Php form validation with fwrite() and fopen() [on hold]

I want that php first validate the form and when the form is validated completely it runs fwrite script and when any field is empty, it returns an error and do not run frwite script. Am i doing right ...
-2
votes
0answers
49 views

Django vs Rails for SaaS Startup [on hold]

Several friends and I have a SaaS idea we want to flush out and build a prototype. We have already decided on AngularJS for the front-end, so we need to find a framework that plays well with ...
1
vote
0answers
20 views

Recommend an approach to decouple Product and Access code constructs, in order to simplify Product testing

I have some code that tightly couples Product specific code and Product-Access code. I am not sure how to untangle it. So for example, for testing Product, I have to mock up Access objects. And ...
-4
votes
0answers
33 views

Wordpress site prevent acces wp-admin of live [on hold]

I have a wordpress site on my production server now the point is i want to stop the user to access the admin panel of the production server www.live.com/wp-admin And to change or access the admin ...
0
votes
0answers
6 views

Insert Dynamic HTML content for Electronic Catalogue - Magazine [migrated]

I am making an electronic book(magazine). But i have 200 pages(in jpg format). So, in order to avoid writing the same line code for 200 pages i want to find out how to do it with javascript and php. ...
0
votes
1answer
39 views

How much available are HHVM hosting providers? [on hold]

I am new to php and I want to know that if I start development for HHVM, will I be able to host it on some shared server? For Example like php hosting providers. I have nowhere seen an HHVM provider ...
-1
votes
0answers
57 views

Should I use the at symbol (@) in my php code [migrated]

I have recently learned how to use the @ symbol in my php code and I have learned to love it. However I have also been told that @ is not efficient performance wise. Is the elegance it provides enough ...
0
votes
1answer
67 views

Continuous Integration for different languages [on hold]

So, I understand Continuous Integration in theory, and have used Beanstalk. However, I've been charged with creating the process at my current PHP shop. My hope was maybe PHPCI, since it looked ...
3
votes
2answers
250 views

C# static practices coming from dynamic background

I have been dappling in C# after coming from several years in PHP. I don't find the language particularly difficult, although there are considerably more constructs for me to get used to. My question ...
-1
votes
0answers
47 views

Daily task manager with locked hours after task is set [closed]

I need to create a daily task manager for a shipyard in php and MySQL. I've some boats recorded inside a MySQL database. Each of them has an INT field that is filled with the time (expressed in ...
-5
votes
0answers
44 views

which language is best to learn [closed]

i know c,c++,html&css and basic java-script , i want to know that for which next language i should go for? i am totally confuse in ruby,java,php,asp,python,.net which should i start learning?? I ...
-2
votes
0answers
6 views

PHP/SQL Question [migrated]

There's my problem... I have the following variables: $days_a = $array_total['days']; // This one display days $hours_a = $array_total['hours']; // This one display hours $minutes_a = ...
0
votes
0answers
25 views

Managing customer-specific modules in a composer/PHP-based SaaS

I'm developing a business-to-business SaaS. I expect that most of my customers will be able to use my mainline product, and I intend to deploy it in an independent instance for each customer. Some ...
3
votes
2answers
75 views

Using Prolog to implement authorization rules

I'm working on a user management "pseudoframework" in PHP, and I'm trying to implement fine-grained rule-based authorization. I'm using a combination of SQL and condition-checking functions written ...
0
votes
0answers
28 views

Querying all data vs required data [duplicate]

If I have a MySQL database that has a table that contains user data, would it be better to load all of the data from the table when loading a page that requires a users data (only one users data is ...
2
votes
3answers
372 views

Class design - should methods call other methods?

I'm writing a very basic custom class for coupons and I've come up with a basic layout for the class, which consists of a number of small methods as I generally understand is a best practice. What ...
2
votes
1answer
112 views

PHP MVC as backend for iOS app

So, essentially, the question is, to develop a PHP back-end to an iOS application, would you implement an MVC architecture on the PHP side? Or no, since the client side (iOS) already has an MVC ...
0
votes
1answer
43 views

How to organize conversion logic for strategy pattern?

I have a Color class. It has a property model which is a class that implements ColorModel interface, this property could be a RGB, Hex or HSL classes which implementing ColorModel interface. // ...
3
votes
1answer
98 views

Features of a routing system

I have been tinkering with the idea of creating a routing system as a learning experience and not for some production purpose. I have trying to decide what features are a must have and what features ...
2
votes
2answers
102 views

Serving a Website as only Cached HTML Pages

Lets say that I want to develop a website where all pages will be dynamically generated and 'printed' into static HTML files. I will then serve these HTML files from a container (such as an Amazon ...
1
vote
0answers
33 views

First programming job with few resources to learn from [duplicate]

I recently started my first programming job after working for a couple of years developing websites. This new company focuses on PHP and has had only one developer responsible for the code since the ...
1
vote
0answers
105 views

What is the best way to approach building search functionality for a large website using PHP, MySQL and JQuery [closed]

I've a question I'm hoping I can get some assistance on because It's causing me a lot of stress in work trying to get it sorted. I figured this was the best place to ask it as it's not a specific ...
0
votes
2answers
73 views

PHP conditional test func call against two values

I was wondering if there's a one liner for PHP that would allow me test multiple values against a function call. As example, say I want to test if foo() returns either 1 or 2, (in pseudo code) if( ...
2
votes
0answers
62 views

Sharing constructor code between classes that do not inherit from each other

There is a PHP library of classes (generated from a WSDL) that cannot be changed. These look like the below for simplicity. class System extends \SoapClient { public function __construct(array ...
-2
votes
1answer
57 views

PHP vs ROR for AJAX and responsive design [closed]

I'm in the planning phase of making a website for calculating various mathematical problems, as a school/sparetime project with a couple of friends. We're gonna start off with implementing a "right ...
-3
votes
0answers
8 views

Moving a user uploaded image on a shared server [migrated]

<?php $img1Name = $_FILES['img1']['name']; $target = 'uploads/'; move_uploaded_file($_FILES['img1']['tmp_name'], $target); ?> <img src="<?php echo 'uploads/' . $img1Name ?>"/> Why ...
-2
votes
1answer
61 views

Front-end or Back-end Implementation of API? [closed]

Lets say I want to implement an API from an external website, for example like Dribbble or Last.fm. I'm fairly new to this new generation of front-end MVC's (angular, etc), and most example's I've ...
1
vote
2answers
195 views

Is generating a large random number more unique than generating each digit in that number?

I'm using a PRNG (PHP's default rand() implementation) to generate unique 16 digit numbers. Does it make sense to generate digits one by one, or the number at once? I'm using PHP.
1
vote
1answer
117 views

How to avoid switches? [duplicate]

I use Laravel as a PHP framework, although the question is not exactly about laravel, more about structuring controller methods. I have a route to orders page. Depending on the user role I need to ...
0
votes
1answer
120 views

How to choose between different ways to write some code?

I would like to validate point in a two-dimensional rectangular Cartesian coordinate. I found following regular expression solution on stackoverflow ^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$ . Another ...
1
vote
1answer
101 views

Help Improve DB model/strategy, for use in refactoring SQL-ridden legacy code

Question: Which design pattern do I use to help me refactor legacy SQL code into separate classes? Goal Bring in concepts of data separation and database separation and also latest modern ...
-2
votes
0answers
30 views

Second AJAX call unloading result of the first [migrated]

<script> var result; function init(){ var name = window.name; name = name.split(","); getCompany(); setTimeout(200); ...
2
votes
0answers
46 views

String comparison equivalence between mysql database and php code [migrated]

I wonder if it is possible to compare two strings using mysql and php and obtain the same results. In mysql I have a = b collate utf8_general_ci For PHP I found a promising way to do it with the ...
0
votes
0answers
42 views

Rewrite Engine vs Boostrap type index file

I currently use apache mod rewrite on a site to redirect various queries / visitors such as this: if you come to example.com/authors/, you are redirected to authors.php if you come to ...
1
vote
1answer
50 views

Patterns for subclass constructors that vary the parent class constructor slightly

So, my problem is in the context of an MVC-style approach. The code here is PHP, but I'm hoping this is a design issue independent of it. abstract class Controller { private $domain; private ...
0
votes
1answer
73 views

How to determine which service to call

I have modeled my application using multiple 'user' domain objects. Candidate Recruiter Administrator Each entity extends from an AbstractUser implementing UserInterface. interface UserInterface ...
2
votes
1answer
292 views

Why is PHP so hated? [closed]

Lately I've been coming across several jokes and comics about how apparently awful PHP is. As a complete ignorant of the language, why is this? Is it my own perception or is this the overall general ...
1
vote
1answer
96 views

How to design large applications with little planning experience [closed]

I understand there is plenty of information on the internet about planning and implementing said solid plan in building a large software application, but I was hoping to get something a little more ...
0
votes
1answer
55 views

Notify about starting event

I am having quite a hard time figuring out how to solve this problem. Basically I have a mini social network with notifications and events. I want to add such functionality where 1 day before an event ...
4
votes
1answer
283 views

How to move php documentation closer to standards?

I have an large php project. I used to document it with NaturalDocs, but I didn't include the documentation generation in the build process for a long time ( years ). I recently started using ...
1
vote
1answer
154 views

Should we use data object (or the data transfer object) for sharing data between these three classes?

I found an article by Martin Fowler that has made me doubt my design choices, particularly about data objects. Martin Fowler has written an article about what he thinks is a code smell. In this ...
0
votes
1answer
102 views

How can I avoid the “global $dbh” anti-pattern?

This is what most of my database-related library code looks like: lib.php <?php $dbh = new PDO(...); function doSomeDatabaseThing() { global $dbh; return $dbh->doStuff(); } function ...
0
votes
0answers
47 views

Automatically verifying INSERTs when building a PHP(5.3.3) application

I am building a form in PHP. I would like to automatically verify that INSERT queries are successful, and populate data correctly, as opposed to running queries in Workbench or MySQL with every code ...
0
votes
3answers
259 views

Using PHP or C++ for in real world electronic devices

I want to use my programing skills to make my day-to-day life easier, to do this I want to be able to program in my appliances like alarm clock or microwave or refrigerator, air conditioner etc, wish ...
0
votes
2answers
69 views

Parameters Stored as Sessions - Pros / Cons?

Some background on my system: I have 1 query with multiple pages. There are filtering parameters on the left of the page which $_POSTs on submission. The posted parameters will change the query at ...
1
vote
2answers
177 views

Good way to count unique anonymous visitors of articles

I'm building a website with articles, and I'd like to count unique-per-day visits for each article. The idea to use cookies suggests itself, but I simply can't set a cookie for each and every article ...
1
vote
1answer
60 views

Would this be considered a plugin or template type architecture?

I would like to build a system that basically offers the option to make various APIs interchangeable for usage to the end user. For example, the person using the software would have the option of ...