Questions about PHP, a widely-used general-purpose scripting language that is especially suited for Web development.
1
vote
0answers
15 views
Handling recursive cURL POST request
I've basically came here for some advise based on my criteria,
The application I'm trying to build is built completely from an API. It's like a "marketplace bidding" application, what I'm trying to ...
1
vote
2answers
100 views
How to show data to the user using PHP?
I'm always trying to find new methods on development. So I looked into some websites and analyzed their ways of presentation.
Returning part of the page using AJAX
Normally I will use an array to ...
0
votes
0answers
9 views
Manipulate CSV when the number of column are unknown [migrated]
I am trying to capture data from different pages..I make an array of it and then I write cvs file using PHP ( for the moment, I am planning the things)..
Now issue is, if array contains always same ...
1
vote
1answer
43 views
Twitter in app browser + user agent string
Recently (I believe some weeks ago) with the latest update of the Twitter app for iOS, all links found inside tweets are opened in Twitter's build-in browser. My question is how to find Twitter's ...
0
votes
0answers
12 views
Pull changing image from img src with php [migrated]
I'm trying to use PHP to pull an image from weather.com (the current condition image), but I can't figure out how to do so, as the image changes when the weather does, so I cant link directly to it. ...
-5
votes
1answer
45 views
When does PHP become slow? [closed]
I want to build a private online social network for some companies. I know many developers, some of them use PHP, some use Python and some use .NET (ASP.NET).
I have heard good things about PHP such ...
3
votes
1answer
38 views
How to achieve N-Tier type in Codeigniter MVC
I know that N-Tier intended to separate layers on different network
but I would like to have the same code separation in codeigniter
I got this idea to have
Model : for database CRUD - > Data layer
...
0
votes
0answers
31 views
How to create a portable PHP 5.4 install? [migrated]
How do I create a portable version of PHP 5.4 without upgrading / affecting the existing PHP, since there are live websites running on that server.
It's like running 2 instances of PHP?
-2
votes
1answer
74 views
How to refresh a page when click the back button in the browser? [closed]
I created a form in HTML. When click on the form it will submit data and I need to check with a database and open another page.
After clicking on submit if I click on the back button in the browser ...
4
votes
2answers
216 views
Java vs PHP Memory / CPU Consumption
I work in a PHP based company. There is a project where we want to create a backend service. Senior members here are going for PHP, even though it is slower than Java. Their only point of contention, ...
2
votes
1answer
84 views
Is there's a way to speed up my php code which parse XML files
I'm developing a web application and we are using XML as a database and I'm using Linux as a platform and centos 6.5 as a server. Changing some value would make a lot a lot of changes in about six XML ...
4
votes
2answers
309 views
Which of these OOP examples demonstrate proper OOP concepts?
I'm still trying to wrap my head around OOP. All of the following examples work, of course, but is there one (or possibly another) that best exemplifies OOP concepts?
/**
* For the following ...
2
votes
1answer
74 views
Codeigniter/MVC workflow
Bit of a workflow question.
I'm just staring with MVC and wondered how other people usually work in MVC? The 2 options I see is to code the model and controller completely first and then work on the ...
-4
votes
1answer
165 views
Do people still dislike PHP? [closed]
I've ran across a number of topics on this particular exchange site, and I've seen many many comments "stop using php" and making fun of it. I'm a php user and I find it quite good and useful, I've ...
77
votes
8answers
4k views
You're hired to fix a small bug for a security-intensive site. Looking at the code, it's filled with security holes. What do you do?
I've been hired by someone to do some small works on a site. It's a site for a large company. It contains very sensitive data, so security is very important. Upon analyzing the code, I've noticed it's ...
0
votes
1answer
190 views
I'm trying to create a visual representation of something, but I don't know what words to use, so I'll try to describe it
My project team is making a site that will use reddit style voting to track users' opinions on various issues, and use the data to create a "heat map". I say heat map in quotes because I'm not sure ...
1
vote
2answers
90 views
Managing Alerts in Web Application Using RESTful API
I have designed a RESTful API and I am now working on creating a web application to use the service.
One thing I am struggling with is how to manage alerts in the web application (similar to the ...
6
votes
2answers
267 views
What is the difference between PHP and ASP.NET Web Forms in page size?
I plan to program web applications for small companies. When I read about ASP.NET Web Forms, I liked its way of building dynamic sites.
However, I have heard from a friend that Web Forms could ...
15
votes
7answers
922 views
Why are references rarely used in PHP?
I have some C++ knowledge and know that pointers are commonly used there, but I've started to look at PHP open source code and I never see code using references in methods.
Instead, the code always ...
2
votes
2answers
104 views
Validating Emails in PHP
I wrote the following function to validate emails for a web app I'm working on:
function validate_email($email) {
$valid = true;
if(!filter_var($email, FILTER_VALIDATE_EMAIL)) {
...
8
votes
3answers
170 views
Is the term 'Front-End' synonymous with 'Client-Side'? If so, is this always the case?
As a relatively new (self-taught) web developer, I've heard the terms front-end, client-side, back-end, and server-side quite often. To me, front-end and back-end were always synonymous with ...
-1
votes
2answers
77 views
Store and trigger cron-'like' actions with PHP and (My)SQL [closed]
I'm crashing my head over a design decision, and I'm trying to get some more inspiration/hints/tips/.. from other programmers.
What is the goal:
I want to run one cron task (php script) every ...
-2
votes
1answer
68 views
Alternative to simplexml_load_string() function [closed]
I am using simplexml_load_string for xml string interpreting to object from results of a REST API. It's working fine in my local server, which is using PHP5. But my hosting is in Yahoo and the service ...
3
votes
2answers
205 views
I need advice developing a sensitive data transfer/storage/encryption system
I got closed on SO and told to post this here as it's about general application design as opposed to specific code.
Intro
I'm currently working on a project which involves the daily extraction of ...
4
votes
2answers
212 views
PHP OOP: Should every object contain all the data?
I'm trying to learn PHP OOP "properly", and I was wondering, should the constructor grab all the information in the database and store it in the object?
To use an example I'm trying to create using ...
0
votes
2answers
294 views
Simple real-world PHP OOP example?
I'm trying to learn PHP OOP, but when I've followed tutorials, all the examples seem to involve things like:
class Human {
$_sex;
public function setSex($sex) {
$this->_sex = ...
1
vote
1answer
106 views
Algorithm for tracking progress of controller method running in background
I am using Codeigniter framework for PHP on Windows platform. My problem is I am trying to track progress of a controller method running in background. The controller extracts data from the ...
0
votes
3answers
106 views
Changing behaviour of abstract class without modifying subclasses
I am facing a problem with changing behaviour of a library (thus cannot or don't want to change its internals because of future updates, etc.).
In this library there is an abstract class which shares ...
-2
votes
2answers
162 views
Interview - Create a portfolio to show my skills [closed]
I have around five years of experience in PHP development
and around one year of experience with ExpressionEngine.
I use PHP 5, HTML, CSS, JavaScript and other web technologies.
I decided to create ...
1
vote
1answer
195 views
What is a practical level of abstraction in a web application? [closed]
(Originally asked on StackOverflow - http://stackoverflow.com/questions/14896121/what-is-a-practical-level-of-abstraction-in-a-web-application)
I still consider myself a newcomer to OO programming, ...
1
vote
0answers
62 views
Codeigniter modular separation with Phing
I am thinking of managing a product source I am doing using Codeigniter + HMVC.
Right now my folder structure is something like this:
application
|-modules
|-module1
| |--controllers
...
1
vote
0answers
113 views
codeigniter pagination - how to have multiple sets of pagination links on one view
Problem
I don't know how to create two sets of pagination links one view.
Background Information
I have a situation where I have parent / child tables that I have to display on the same view - ...
2
votes
3answers
163 views
Is it possible to get a job in corporate software houses without a degree [closed]
I have been developing web applications in PHP from two years and have worked with three organizations. I started with no programming knowledge at all, I had interest in web development so I read some ...
-3
votes
0answers
52 views
API for iOS & Android [closed]
I am creating an API written in PHP to serve requests from an iOS app & Android. Now there is method wherein the app will submit a username and password for login. I am concern of the security, ...
6
votes
4answers
255 views
Applying DRY to an inheritance hierarchy
I'm working on refactoring a legacy application where I implemented the State pattern successfully as shown in the following diagram:
As you see there is a common behavior between the 3 states, so ...
-1
votes
1answer
138 views
Migrating from PHP to ASP .NET MVC [closed]
I plan on migrating a website from PHP to ASP .NET MVC. However, since the website is large and this migration can't be done in a short time I plan to use both MVC and PHP pages together. So the idea ...
-2
votes
0answers
139 views
What basic PHP/MYSQL interview questions should I focus on? [duplicate]
I am a 19 year old web developer and mostly I've taught myself and haven't really worked with others in a development environment. On the 25th of February I have a technical interview in San ...
1
vote
1answer
117 views
Is declaring fields on classes actually harmful in PHP?
Consider the following code, in which the setter is deliberately broken due to a mundane programming error that I have made for real a few times in the past:
<?php
class TestClass {
...
1
vote
1answer
63 views
Single-Tenant Databases - creating and updating new tenants via PHP
We've built a single-tenant webapp in PHP and as it stands each hosted 'site' has its own database.
However we need to be able to run a script to create their database, assign a mysql user, and ...
0
votes
1answer
88 views
Why does flask use Jinja2 and not xpath?
I'm just starting out with python and since I'm coming from a PHP background (thus have to adjust my mind to wrap around new concepts) one major question still stands without answer - why does Flask ...
1
vote
1answer
204 views
Possible with PHP MVC Framework? A better solution to client 'override' of core functionality?
Background / The Problem
I need to make a (large) application with a certain set of core functionality, and certain functionality for multiple clients within it. Each client has different ...
-3
votes
1answer
149 views
Does anyone knows a good minimal php mvc framework? [closed]
I've been developing using frameworks since the last year, and is true that those pieces of software really help me and improve my development, that's until you need to fulfill your client's dreams, ...
0
votes
0answers
46 views
annoying “yo-yo”effect on sidebar [closed]
my sidebar at
http://ntm.at/r0sa is doing annoying yoyo-effects, you can see it especially when you click on "projects"...
has anyone an idea or firebug and can help me how to make the sidebar slower ...
8
votes
4answers
349 views
In MVC, can/should basic data retrieval from the Model be done in the View?
Given the concept of 'skinny controllers, fat models' and the general acceptance that Views can directly call on Models when requiring data for output, should one consider handling the 'get and ...
-1
votes
2answers
123 views
dechex(4000) - Why is it not signed?
Why does PHP's dechex(4000) not return a signed hexadecimal value?
It returns:
fa0
As opposed to:
0xfa0
And is signed the correct term to use in describing this problem? Or is there a better ...
2
votes
2answers
84 views
Explain this function (mt_rand, base_convert)
Recently I found a function to generate a random string of numbers and letters, and It was really compact and concise and I liked it alot. The problem Is I have no idea what it is doing, or how to ...
5
votes
4answers
138 views
QR Codes as Booking Confirmations for Conference?
A client of mine is holding a conference and we have the task of creating a booking system for them. However they have requested that we use QR codes so that on the door, a person can simply present ...
4
votes
2answers
262 views
About clean code
Example: I have a method that formats the output based on a parameter from an object. The question is, should I pass the object that holds the parameter to the method, or just the required param?
...
7
votes
3answers
319 views
Is it a basic principle, or highly desirable, to have class methods that return “$this” rather than a value?
I've really just begun to learn OOP. I started about a year ago and have written probably 15,000 lines of it. But I wrote it all with hardly any experience looking at other people's OOP.
Most of my ...
2
votes
2answers
237 views
How to fix bad fundamentals? [closed]
I am a native PHP developer, and have been for about a year or so. I love PHP and it was very easy for me to learn, but I have developed some bad habits along the way due to never having a formal ...