Questions about PHP, a widely-used general-purpose scripting language that is especially suited for Web development.
1
vote
1answer
93 views
Progress in PHP web application design [on hold]
I have created an easy database-driven web application (with PHP+MySQL).
It's written procedurally with a few controllers (index.php) in a few
directories and a few template files and one stylesheet. ...
-4
votes
0answers
21 views
What is the code to convert this procedural PHP Sticky Form into an OOP PHP Sticky Form? [on hold]
I am new to PHP and have created this form in "Procedural style". How do I convert this to an "OOP style" of form?? Anyone ??
code of index.php(This file is run first)
<?php
...
-3
votes
0answers
31 views
imagecreatefromjpeg function not working [on hold]
For creating an image identifier I used imagecreatefromjpeg function but it does not work.
The error occurred while running the code is pasted below.
...
0
votes
1answer
126 views
How a real MVC is different from todays MVC used in the web? [on hold]
ive heard that MVC used now in days could be called webMVC because they dont implement it like the actual MVC is, so it makes me wonder if there is a guide where i can find the real MVC architecture
...
0
votes
4answers
171 views
Notifications system with too many subscribers
In my application users can subscribe to other users, like in every social network out there. However I'm experiencing some trouble when a user has too many subscribers. Every time a user posts ...
-5
votes
0answers
27 views
Annoying white background in html [on hold]
So I put an image into my site using the tag, but the thing is I set a background image using css, and now the image I inserted has this ugly white background that covers my background. If anyone ...
1
vote
0answers
20 views
PHPExcel Application With Cases
I've been working on an application for my company's intraweb which will automate production scheduling based on information from our legacy mainframe databases in addition to side tables with ...
-1
votes
0answers
34 views
Clearly defining an Implementation detail
In what way could I, when designing my API, framework or whatever decide what is and what is not an implementation detail? What questions do I ask in order to correctly answer: "Is that something my ...
-2
votes
0answers
23 views
I would like to expand a SQL query to also get the name of the ID's it is selecting. How do I do that? [migrated]
At the moment I have a very basic SQL query, however I would like to expand it in order to fetch the names of the ID's it is referencing as well. The problem is, it's a Parent > Child relationship ...
-1
votes
0answers
48 views
New site architecture : collaborate, graph, feeds, content mgt, payment [closed]
We are trying to make up our minds about what architecture and tech stack to use for a new site that is going to include (like many other sites) end user and expert collaboration, content that is ...
0
votes
0answers
74 views
Tournament bracket customized algorithm
I'm in the making of a tournament for archery but i'm stuck because they want a specific match-matching for players. There is the usual 1-32,2-31,3-30 etc but the way they want the tree is a specific ...
1
vote
0answers
76 views
Static controllers
I have built myself a PHP MVC framework to meet my needs. As pretty much all of the core classes are static, I just stumbled upon the idea of having static controllers. I know that for some reason ...
-5
votes
0answers
80 views
Need Framework idea [closed]
I have much experiences with PHP, Javascript and CSS.
I have coded much things in these two languages, but I want to code a Framework in one of these languages. Any of you guys have an idea what you ...
-4
votes
0answers
36 views
Using PHP to access a catalog [closed]
The site I am building is built on Wordpress and I was curious if anyone knows of a way to access the information on the site below with php:
...
0
votes
1answer
40 views
How to implement a Daily Recap email of Database records modified the previous day sent to Subscribed Users like Basecamp does?
I am building a Project Management module for SugarCRM. It consists of a "Project" which has information on the project like Name, description, start and completion dates,
creator name, status ...
0
votes
1answer
110 views
PHP as a target language [closed]
Are there stable well tested SDKs (as opposed to simple language converters) that allow you to develop your application in some decent language (I believe it is widely accepted that PHP is not a well ...
0
votes
0answers
62 views
The finer points of HMVC
I'm new to HMVC and whilst tutorials are great about dealing with the overall details of keeping modules separate and only letting controllers communicate, they aren't so great at explaining the ...
-2
votes
1answer
61 views
Is there a simple way to “scanf” multiline string? (or “parse-file-by-template”)" [closed]
I have a bunch of VERY similar files. Actually it is a "config" for switches. Currently I am generating it from some kind of template, like so:
!
username {username} password 'password'
!
snmp-server ...
0
votes
1answer
33 views
Does phpDocumentor tags order matter?
When we document our class, method and/or function with phpDocumentor, is there any specific order I should follow according to the standards?
I know it doesn't matter for output the document. Since ...
0
votes
0answers
38 views
Scale parts of image to fill bezier path with no wastage
I want to be able to take an image and stretch/contract each pixel row (or 5 rows for performance) to fit within a curved shape. I've been searching for this for the last few days and have turned up ...
0
votes
1answer
77 views
How to split a Service class in two but still use them like one?
I've got a class:
AuthenticationService
findLoggedInUser()
Checks session if User is logged in. If not, check client persistent user login cookie and log in.
loginUser($email, $pw, $remember = ...
-2
votes
2answers
113 views
php make dollar optional [closed]
Is there any reason the PHP language could not be updated in a future version to make the $ prefix on variable names optional? Reasons that would break existing code?
I'm thinking it would still be ...
1
vote
2answers
206 views
Workflow for obfuscated PHP code with PHP protect
Let's say I have a database-driven web application written in PHP.
After obfuscating the code with PHP protect it will
be copied to a web hosting server.
And here is the question.
What is the ...
2
votes
1answer
113 views
How to tell the View to create a cookie?
I have a LoginService class with loginUser($email, $password, $remember = false) method in the application layer of my model layer.
Now, if $remember is true it needs to create a persistent user ...
3
votes
4answers
363 views
Why is the use of conjunctions in method names a bad naming convention? [closed]
In my team, we work closely with a few software architects. They approve all design decisions of our projects, do some code reviews etc.
Our projects consist mainly of backend functionality ...
0
votes
1answer
149 views
Version controlling of a web project
We (2 developers) are developing a cakephp app that is running on a remote server. In NetBeans we both have project set up as "PHP application from remote server".
The problem is that whenever one of ...
2
votes
1answer
112 views
Using the command pattern for a sequence of tasks
I have a 'sequence of tasks' to undertake on a zip file. It can be simplified into these steps:
Validate that the file is a ZIP file and is valid
Unzip the file
Validate the contents are as ...
0
votes
1answer
117 views
Viable method of sharing our PHP project [duplicate]
We are two developers that have no previous experience in sharing one PHP project. In particular, cakePHP.
We both use NetBeans and we have set the project up as a "PHP application from a remote ...
1
vote
1answer
137 views
In MVC design, do I use a base class over an interface?
In web MVC most designs I've seen, (just choosing model layer as an example) the domain problem class, say students, always inherits the superclass "Model." The name is irrelevant, but why do they ...
-1
votes
0answers
5 views
In PHP how to save directory the php file is in to a variable (centos) [migrated]
so say my php file "example.php" is in the directory "/user/example"
I thought that the line "$dir = getcwd();" would save "/user/example" to $dir but instead it is saving the directory that the user ...
-1
votes
0answers
75 views
Helping with creating own PHP MVC - how to write good router
1 year ago I created wannabe-MVC in PHP (some parts procedural, some in classes), now I'm intending to expand it a further to be more like real MVC.
Folder/files structure:
html/
html/images/
...
3
votes
2answers
125 views
Whether to store all numbers or just their ranges in database for this application
I'm developing a (PHP MySQL) Web App which will sell dynamically generated real time cell phone numbers for cellular companies. A company will ask for, say, a thousand numbers and this app will check ...
0
votes
1answer
135 views
How do I keep my classes in MVC from becoming bloated?
I'm not sure how I should have worded the question.
If I have a Student and Classes database, and I have queries that involve both. Where do I put my queries? In one case, someone wants student ...
0
votes
1answer
76 views
Efficiency of getters/setters with database performance
I'm currently in the process of refactoring a very old personal project of mine, which used procedural PHP-in-HTML code. I'm modernising it as a learning project, using OOP where beneficial. I ...
0
votes
0answers
44 views
Database conceptual Question [duplicate]
When querying in database through PHP, is it good to open mysql connection before every query and close it as the query completes? or should we open the mysql connection as soon as the first query ...
0
votes
0answers
2 views
import existing pdf using TCPDF library [migrated]
I'm trying to import an existing pdf file to digitaly sign it using TCPDF library
$pdf = new TCPDF_IMPORT; $pdf -> importPDF('example.pdf');
when I do so I get somthing like this
So, what is ...
0
votes
2answers
136 views
Database Handler and SQL injection prevention
I've written a database model class in PHP and have written a controller class that specifically validates the data before sending it to db. I'm getting criticism that I should handle the data in ...
0
votes
1answer
298 views
Does this function do one thing only?
Is the following method considered to be doing one thing only?
I'm wondering about that since it takes an optional argument.
public function findErrors($name = null)
{
if ($name) {
...
1
vote
1answer
85 views
Is routing a site with RESTful not the best when you have very long URLs?
I've read a lot about RESTful, but I have always had a hard time figuring out how I'd use it with a very long query string. This is an in-house project, and it won't always have a simple /someAction ...
0
votes
0answers
29 views
Pitfalls of combining dependant traits and exceptions in same file as interface in php
What are the potential pitfalls of combining related class like objects (interfaces, traits, custom exceptions) in the same source file? For code reuse and only loading what I need I always separate ...
0
votes
0answers
80 views
Best practice: dynamically handle variable data, multiple file uploads and encoding with jQuery, AJAX, PHP and MySQL
I'm currently writing an e-learing web-application. I'm sorry if this is information overkill but I think it's better to describe it in detail so you get the idea. I have made thought on every point ...
1
vote
1answer
158 views
Basic PHP Object Oriented Design Review
I am attempting to learn object oriented programming by designing a simple web application related to the Catholic liturgical calendar. I have very little formalized training in programming, but I ...
4
votes
2answers
132 views
Strategy to use two different measurement systems in software
I have an application that needs to accept and output values in both US Custom Units and Metric system.
Right now the conversion and input and output is a mess. You can only enter in US system, but ...
0
votes
0answers
56 views
Approach for packing 2D shapes while minimizing total enclosing area
Not sure on my tags for this question, but in short ....
I need to solve a problem of packing industrial parts into crates while minimizing total containing area. These parts are motors, or pumps, ...
6
votes
2answers
187 views
Is this a valid implementation of the repository pattern?
I've been reading up about the repository pattern, with a view to implementing it in my own application. Almost all examples I've found on the internet use some kind of existing framework rather than ...
-1
votes
2answers
91 views
Billing from card directly [closed]
I, for the life of me, cannot find any literature on this, simply because I have no clue how it is called.
I want to learn how to implement a payment option that consists of paying with your ...
-5
votes
1answer
123 views
CAPTCHA blocking for my scraping script? [closed]
I am working on a scraping project which involves getting web data and parsing them for further use. I have been working using PHP and CURL to make scraping scripts which crawls web data and I make ...
1
vote
0answers
60 views
Single complex or multiple simple autoload functions
Using the spl_autoload_register(), should I use a single autoload function that contains all the logic to determine where the include files are or should I break each include grouping into it's own ...
0
votes
1answer
158 views
Design Pattern: A single class with multiple purposes, or multiple extended classes each with their own purpose in PHP
I'm working on a PHP framework called Carbon CMS. This framework will be used as base to build larger web applications on top of it. This framework should provide all kinds of interfaces such as ...
0
votes
2answers
113 views
When running PHPUnit tests - is it common to use a separate database for testing?
I'm running tests from the same database as I use in development. I recall using Rails and I used a separate database for testing (mainly coz the tutorial I was going by said so). Made sense though. I ...