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

learn more… | top users | synonyms

0
votes
0answers
2 views

PHP Require_once error

I'm currently working on a register page for my site. I use "require_once" to find the config file. On the register-exec.php page it has this line: require_once('/zds/include/php/config/config.php'); ...
-1
votes
1answer
19 views

Where exactly are the inherent WordPress Functions defined inside or ouside the core of WordPress?

If we look at http://codex.wordpress.org/Function_Reference; we see that there are core functions listed for WordPress.The first two sentences say: "The files of WordPress define many useful PHP ...
-5
votes
0answers
62 views

How do i compare PHP Efficiency between two algorithm?

Here is two function that creates 1000 files inside 1000 folders in two different fashion: First Method function createEverything() { for($i = 1; $i == 1000; $i++) { mkdir('test/'.$i); ...
-3
votes
0answers
31 views

What is the best way to process XMP metadata from pdf files using PHP? [on hold]

I want to extract all XMP metadata from pdf files using PHP. In terms of "extract" I mean, getting a text-based representation of the XMP metadata from the corresponding pdf file. What is the best way ...
-5
votes
0answers
29 views

PHP Form to Email [on hold]

Can someone help me make a php code that can send information from a formular to an email? This is the HTML code: http://pastebin.com/dRfL09vq Yes I know the code is messy and it's in another ...
-5
votes
0answers
44 views

Things which Java develops should know about php? [closed]

I am a java developer starting out to write code in php. Would be great if there are some similar best practices between them?Just to get started in php if there are equivalent stuff for the ...
-4
votes
0answers
38 views

Best approach for data storage in custom web app [closed]

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: ...
3
votes
2answers
86 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
41 views

Learning back-end development: Php vs NodeJS [closed]

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
23 views

Php form validation with fwrite() and fopen() [closed]

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
57 views

Django vs Rails for SaaS Startup [closed]

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 ...
2
votes
0answers
30 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 ...
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. ...
-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
68 views

Continuous Integration for different languages [closed]

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
256 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 ...
-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
77 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
374 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
117 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
45 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
99 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
103 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
107 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
74 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
63 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
59 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
62 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
202 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
118 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
122 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
103 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 ...
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
51 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
76 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
298 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
98 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
58 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
155 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
105 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
49 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
268 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
70 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
178 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 ...