Tagged Questions
Questions about PHP, a widely-used general-purpose scripting language that is especially suited for Web development.
-5
votes
0answers
34 views
Career Move — PHP to .NET/Java [on hold]
I have been interviewing for the last year trying to figure out where I want to land in terms of location (going back to Phoenix, AZ where I was born and raised) and I am now having an issue with the ...
-4
votes
0answers
18 views
How to listen/read from a pipe client/server on php [on hold]
my little scenario: i have for example a file called daemon.php witch is a php socket server and a client.php file witch is a file able to respond to server earlier based on the third party data.
My ...
1
vote
2answers
85 views
Can i write html on one line only in my php code?
i need to embed a html 301 redirect in my php code and i wanted to save chars in my html.
Can i write HTML on one line since it is parsed? Is there anything against this practice?
?>
<!DOCTYPE ...
0
votes
1answer
59 views
Are there any strong reasons to use DI for sub-classes that are known to be tightly coupled to their parent containers?
I have Product classes for Products A through Z. And each Product class has its own set of product-specific subclasses, which I'd say are tightly coupled to them, like so:
//specific product class ...
0
votes
1answer
48 views
php Database operations in separate files?
I have a single page application. Select boxes need to be filled with select queries from the database.
How do I structure the application?
Currently I have a file add_details.php. It contains a ...
-4
votes
0answers
39 views
What is the motivation behind developing LLVM for PHP? [on hold]
who started this?:
What is the motivation behind developing LLVM for PHP?
Plz Experienced Knowledgeable programmers must explain this...
-4
votes
0answers
21 views
an elearning platform in PHP,mySQL and a connected second databases in MongoDB & both having live updates capabilities [on hold]
I've been developing an elearning platform in PHP,mySQL.
Now, I'd like to create second databases in MongoDB & connect both with live updates
I've been searching for this answer quite eagerly ...
0
votes
2answers
88 views
Should I extend an interface or keep it independent?
I'm trying to decide whether to extend a base interface with additional methods or create several independent interfaces. I have a Task interface that looks like this
interface Task
{
public ...
0
votes
1answer
36 views
Laravel using models
I started working with Laravel about a month ago and I started by reading the documentation etc. Now I'm working on a project in Laravel 4.2 and I skipped some parts of the full documentation. In my ...
-1
votes
1answer
50 views
keeping of all javascript functions in one place [duplicate]
In php website I am using different javascript functions in different pages for example page a calls functions 1,2,3 and page b calls functions 2, 4, 6 and page c calls functions 3, 6
can I place ...
-4
votes
0answers
29 views
how do I make like this picture using CodeIgniter? [on hold]
how do I make like this picture using CodeIgniter?
Date | Answered | Unanswered | Duration |
2015-01-11 20:07:00 | 10 | 20 | 20 |
2015-01-12 20:07:00 ...
1
vote
1answer
73 views
Calculating winning probability for 2 teams using their history?
So I'm working on this project where I have a database full of team winning history. For example let's say these are all football teams. Every match has 2 participants (2 teams) and always a winner.
...
0
votes
0answers
66 views
+50
Laravel 5 Multi-App
So my work has a dashboard built in codeigniter where every app on the dashboard has its own subfolder in controllers / models / views and nothing is shared. I have been tasked with upgrading this to ...
0
votes
1answer
96 views
2 Classes that share similar behaviours but unrelated.
I'm working on something at the moment and am a little confused.
I'm working on an enquiry system in PHP (it's Opencart Based, so MVC).
An enquiry comes in and depending on what form it was ...
-2
votes
0answers
16 views
Scope in software devlopment after ignou mca with 1 year experience [closed]
I have completed bsc it (64%), 12 th (57%) and 10th (63%). currently doing mca from ignou last sem and working as software devloper (android and core php). i am going to complete mca and 1 yr ...
0
votes
0answers
2 views
PHP/SOAP - How to print multiple results [migrated]
I'm trying to parse the result in PHP from a SOAP request.
Sometimes the response can be in a single object, but sometimes it can be multiple array results, and then my PHP breaks.
If it's only a ...
-2
votes
2answers
109 views
Understanding PHP variables [closed]
I ran into an error which I have trouble explaining, and it's probably due to my lack of understanding of how variables work in PHP.
Whenever I run my web-app, I get the error that I am trying to ...
-2
votes
0answers
32 views
PHP include all classes vs autoloader [closed]
Is it a bad practice to include all PHP classes which we might need?
For example if it doesn't reduce performance you may say no, it' not.
1
vote
3answers
166 views
OOP implementation doubts with databases
I was starting a project today and after designing the database structure and how the data would be stored etc, I started the implementation. I am doing this on php, but the language isn't really ...
-2
votes
0answers
25 views
PHP ADLdap - security considerations when moving from intranet to internet [closed]
I have an application developed using PHP. Authentication is handled via our intranet using the ADLdap library.
I've been asked to make this application public facing. It currently runs on a CentOS ...
0
votes
0answers
39 views
Calculate the time remaining until a subscription [migrated]
I have a subscription that can be subscribed to every month, every two months or every 3 months. That's represented as a subscription_frequency of 1, 2 or 3.
I then have a month_joined property (1 ...
1
vote
2answers
73 views
How to organize code which converts from one type to another
If I have a DateRange class, and I want to translate a DateRange into SQL (e.g. some_col >= '2015-3-5' AND some_col <= '2015-3-5'), where should I put the method that does the translating? ...
2
votes
1answer
145 views
MVC with Post/Redirect/Get
I have a question in mind for the MVC pattern for a long time now. When using the Post/Redirect/Get principle then it doesn't make sense to use ONE model in the sense of MVC, right? Why should I ...
0
votes
0answers
16 views
problem with “real_escape_string” [migrated]
i am having some troubles my the "real_escape_string" and i need some help
login.php
<?php include('Connections/local.php'); ?>
<?php
function GetSQLValueString($sql) {
$sql = ...
0
votes
2answers
47 views
Executing scripts in parallel based on dependency tree
We have an app that is using a fairly simple stack (Linux, PHP, Oracle, Shell Scripts, etc).
We have a series of scripts that need to be executed:
/scr/app1/start.sh
/scr/app2/start.php
...
-1
votes
0answers
47 views
php website on multiple servers
talking about a given website (written in php) that is hosted on multiple servers (more than 10 web and database servers with load balancer), I was wondering about few things that i am unable to ...
0
votes
0answers
4 views
How do I remove spammy links in WP theme footer? [migrated]
I got a little obstruction. I have a free theme, which I like, but I found out that in the footer there are too many commercial links (Let me say spammy links). I want to keep the credits to the ...
-1
votes
1answer
40 views
Laravel - BLOB File Management System - Possible obstacles?
I'm working on this weird project where I need to upload huge files (500mb+) and store them in a postgresql table as a blob.
Before you start telling me that storing files in the database is bad and ...
0
votes
1answer
73 views
Best way to centralise a php project (except bitbucket)
The structure is as follows:
A: this is the live/production website
B: this is the staging, which is a copy of live
C: this is the testing environment for designers
2 developer and 2 designers. ...
-4
votes
0answers
26 views
Sync Microsoft dynamics(nav) with remote mysql [closed]
I am very new to dynamics.I want to sync dynamics data with Mysql Databse in my server.So that when ever I enter new data into Nav it should also reflect in my website(which is build with PHP and ...
0
votes
0answers
25 views
Prevent Timeout for large scripts without changing any System Settings
Current Option
If I have a process that I know may take a while I have been chopping it up using ajax to do a part of the request then once the ajax is returned do the next part of the request.
This ...
0
votes
1answer
57 views
Where to put utility classes in php mvc?
I'm working on my first MVC website, where can I put utility classes like Security and Date (my native date) classes, are they model too?
App
|
|--- Model
|--- Controller
|--- View
1
vote
1answer
26 views
PHPUnit > Best approach to mock container objects? (e.g. $item->id)
I'm using PHPUnit test doubles to mock models, libraries etc. But when I want to return an array perhaps of container objects, how best to do so. Here is what I'm currently doing:
/**
* This is just ...
1
vote
1answer
42 views
PHP MVC Model with a method to fetch all of the model from database
I have a crazy question, consider I'm developing a blog website, There is two model named Post and Comment, now I wanna add a method to fetch all comments from database, which model should I choose to ...
0
votes
0answers
13 views
How to push data from one page to another [PHP] [migrated]
I'm using sockets.io, express and php and I was wondering if it is possible to push something of a page (that only a specific user can see at the time) to another page other can see. For example, if ...
1
vote
1answer
101 views
Need to store Multiple Images (path) into MySQL after upload [duplicate]
I am trying to build my own little eCommerce CMS, and i want the expert opinion on how to handle multiple uploaded files (images).
For Example:
A user adds a new item, fills the necessary form data ...
0
votes
2answers
294 views
Storing and retrieving simple data within a framework
I'm determined to get a decent answer to this, because while I have my own approach (constants) I'm not convinced I'm doing it as efficiently as I could be.
So I'm editing the entire question, to ...
0
votes
0answers
36 views
Preserving Pre-formatted Multi-Line Strings in Node.js Scripts
There is a lot I don't like about PHP, but one thing I love is multi-line strings:
$query = <<<EOT
select
field1
,field2
,field3
from tableName
where
field1 = 123
EOT;
...
0
votes
1answer
76 views
Database object mapping, good practices [closed]
I think I've understood the basic idea behind object mapping but there is one gap in my knowledge base that I hope to fill now. First let me tell you what I understand out of the whole thing.
I have ...
2
votes
1answer
79 views
Scheme/Design Pattern for allowing a certain outside class to set properties
I came up with a solution (in PHP) to a problem and am wondering if it is a named Design Pattern, and if it is good practice.
I have a collection class and an item class. The collection class is the ...
0
votes
1answer
62 views
How to efficiently determine when changes occur in event lists
We have a system that stores event information.
There is a primary list of events as well as a secondary list, these may overlap.
Secondary lists are combined with the primary based on 3 main rules.
...
0
votes
2answers
62 views
PHP extended class method requires same signature including object class requirement? [duplicate]
Not sure exactly how to phrase the question succinctly for the title.
I have a collection class that extends another collection class.
The parent collection-class has a method addMember(someClass ...
0
votes
0answers
58 views
How to dynamically print a URL as a QR Code using PHP (Drupal Views)
I'm working a small home project, and I wish to dynamically produce a QR code on a content Node (I'm using the Drupal 7.3x CMS framework and specially the Barcode Module). I've not had much success in ...
0
votes
1answer
79 views
How to appropriately structure a script used in an AJAX call?
When I first learned AJAX, I was also teaching myself the languages of PHP, JavaScript, SQL, HTML, and CSS. I followed my coworkers existing web apps as examples of how to write my own web ...
0
votes
1answer
58 views
How to handle coding errors in my PHP AJAX code?
How do I handle coding errors in my PHP which has no GUI, only an API? I am concerned that I might never know that there are any. Note that only I will develop the client side. This is not a public ...
0
votes
1answer
31 views
Architecture: Validate polymorphic votes - Controller or Model?
I have a question because I don't want to do something wrong.
I have a polymorphic relation called votes. Well, I want to save votes but I need to validate if a user already has voted. But even if, ...
0
votes
2answers
44 views
Best Way To Store Images For Mobile Synchronization
The scenario is, I have a Web Dashboard (Developed using PHP + MySQL) and have Android and iOS Apps synchronizing data from the Web Dashboard (only one way i.e. Dashboard to Mobile Apps)
Now the ...
0
votes
1answer
68 views
Is this a good service locator, and is this service locator pattern(?) OK?
I'm working in Zend framework 1 and was using Zend_Registry to store objects so that I could replace them in my controllers while unit testing:
$auth = Zend_Registry::get('Auth'); // set in ...
0
votes
0answers
53 views
PHP mail templates
I'm working on a webshop (used to be for just one product, expanding it to multiple products and multiple shops hooked up to one backoffice, can't use PrestaShop because of compatibility).
We send 3 ...
3
votes
1answer
207 views
How to hide a honeypot ( excluding external CSS and JS )
I am adding spam protection to my personal php framework and I think honeypots are a great way to block spam. Unfortunately they weren't invented yesterday and probably most bots do fetch CSS and can ...