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

learn more… | top users | synonyms

-5
votes
0answers
19 views

unable to upload images using php gd library [on hold]

<?php error_reporting(E_ALL); ini_set('display_errors', 1);?> <?php $db = mysql_connect('localhost', 'goofy', 'donalds') or die ('Unable to connect. Check your connection parameters.'); ...
-2
votes
0answers
24 views

Unicode Support and future versions of PHP [on hold]

PHP 6 was planed to enhance Unicode Support. PHP 7 roadmap does not address this as well. What will be happen for PHP regarding multilingual support?
-5
votes
0answers
17 views

Generate a dynamic dropdown and embed a php code [on hold]

I want to create a drop down dynamically and display a data in to drop down from database. and when click on product from drop down I want show two textbox.
-7
votes
0answers
16 views

I need validate and display the form results, and you should not be able to spoof the form

Here is my forms, thus far: Movie Review body { background-color: #ffffff; } .container { background-color: ...
2
votes
1answer
170 views

Lesser of two evils regarding return types

I'm implementing a system in PHP where values are represented with objects that implement an Amount interface. I'm building two different implementations of this interface, one using a simple integer ...
-2
votes
0answers
21 views

Restricting file types when uploading to my server [migrated]

i'm currently working on a project for an IT class i'm teaching, so i've set up this page on my website where students can upload html files, so they can see what the final result is. How exactly ...
-5
votes
0answers
37 views

How to open Modal box after saving data to database and show result [on hold]

I need to open modal box for showing the error message or success result after uploading data from CSV in mysql . Please suggest me how can I made it possible ? $res = true //if no error $res = ...
0
votes
1answer
60 views

PHP MVC how to access current user?

What is the best way to tell if a user is already logged in when accessing the page? I have seen many people talk about a Recognition service that will validate a user trying to login, but what about ...
0
votes
0answers
29 views

How to approach building an achievements system using redis? [on hold]

We're building an achievements system based on the interactions a user can do on the website such as answering, following, agreeing with an answer etc... by achievement I mean answering 50 questions ...
-8
votes
0answers
30 views

Unable to emails to multiple recipients using phpMailer, even after using explode function [closed]

I have been trying to send email to multiple recipients using phpMailer, also i added explode but it didn't go through. <?php include 'connect.php'; $emailID = $_POST['email']; $sql = ' ...
-7
votes
0answers
53 views

Why Frameworks are overrated over Composer? [closed]

Where-ever I see a job description, it at least asks for experience in one of the PHP frameworks. I mean like, why do employers emphasise possessing experience in one of the popular PHP frameworks? ...
0
votes
1answer
37 views

PHP Multi-Page / Session Question

I created index.php that basically looks up all the individual php files (articles) in a few subfolders and prints them out. Since the quantity of articles is over 30 and growing, I implemented a ...
-5
votes
0answers
15 views

Print PHP 2D Array to English Summary Sentence w/ Oxford Comma & Duplicates Handled [closed]

I prepared PHP script to print items of 2d array containing item description and item quantity into a summary English sentence. I thought I would expose it here. If you see how I could improve it, ...
11
votes
2answers
996 views

Is an NPath complexity of over sixteen octillion realistic? Or have I broken the tool?

I have just measured a large chunk of PHP code (1153 lines) using PHPMD (http://phpmd.org/) and it tells me the code has an NPath complexity of 16244818757303403077832757824. That looks like a ...
-3
votes
0answers
10 views

login info not stored in db after registering showing up after registering [closed]

<?php //Start the Session session_start(); require('connect.php'); //3. If the form is submitted or not. //3.1 If the form is submitted if (isset($_POST['username']) and ...
1
vote
1answer
46 views

Generic PHP web interface for handling concurrent updates optimistically

I'm looking in to writing a new PHP based CMS which handles concurrent edits optimistically like source version control rather than pessimistic locking like Wordpress. I want to be able to write some ...
-3
votes
0answers
24 views

PHP Company Web App - updating database classes [closed]

I've recently joined a small company as a junior web developer that specialises in managing customer orders for small businesses in the catering industry. The company has developed an app in PHP that ...
-3
votes
0answers
30 views

I am using the following code but it is showing a parse error so anyone please provide me the appropriate solution: [closed]

<?php /****** Include the EXCEL Reader Factory ***********/ set_include_path(get_include_path() . PATH_SEPARATOR . 'Classes/'); include 'excel.php'; if (isset($_POST) && ...
-2
votes
0answers
22 views

How to handle emoji with custom framework? [closed]

I am facing certain problems with emojies like: Looking for a consolidated library which can handle all the available emoji. It should also support all the available platforms. How to save quoted ...
0
votes
0answers
66 views

SQL Query based on URL [migrated]

I have a sql query which brings back information based on the Sessions Cookie. I want to make a link to a users profile and have a url like account.php?id=Danny Then i want to run a sql query but ...
0
votes
0answers
9 views

Unable to insert datetime value into a MySQL table using PHP [migrated]

I'm trying to run the following code in PHP: <?php require_once 'Admin/Connector.php'; $name = 'A Schandillia'; $number = '12345678910'; $latitude = '73.897687'; $longitude = '11.958271'; $sql = ...
1
vote
5answers
249 views

Are mocks in unit tests dangerous in dynamic languages?

I've started relying heavily on a mocking framework in php for my unit tests. My concern is that with a dynamic language, there is no way of enforcing a return type. When mocking, you have to ensure ...
0
votes
1answer
45 views

PHP and Subversion workflow [duplicate]

I'm working on a project in a small team at the moment working on a webapp. We originally had 3 on the team with a lead dev and now we've grown to 7 and a lead dev. At the moment our workflow is ...
1
vote
1answer
64 views

How bad is it that my index.php in a Zend Framework MVC application mixes definitions and side effects?

I'm introducing some more coding quality standards and checks via a new project - in particular, the PHP-FIG recommendations. This project using Zend Framework 2, and I have a fairly simple entry ...
0
votes
1answer
52 views

Development and testing PHP script that gets variables from external server

I have a web app that sends users to an offsite payment server to complete a transaction, and I'm working on the PHP page that users are returned to upon completion of the transaction. The script uses ...
1
vote
1answer
56 views

MVC, pagination, and massive search criteria

I am currently working on a project that has a fairly large search form - the form is 30 or fields or more. Now I can of course map this out for routing by having my application pull the parameters ...
0
votes
0answers
42 views

Class Interfaces with Multiple Classes and Dependency Injection

NOTE ON QUESTION TITLE: I did not really even know how to phrase the title so if someone can edit and make it more articulate I would really appreciate it. QUESTION: Basically, what I'm trying to do ...
0
votes
1answer
80 views

PHP - How to structure this application

Sorry if the title is leading.. I'm looking for advice for the following system I am implementing: The system is to provide quotes for customers, this is then exported to PDF and emailed to the ...
4
votes
1answer
101 views

Social network notification system

Background I am working on an app for a client that includes some social networking features. I was originally developing the mobile front-end, but circumstances have left me in charge of developing ...
-2
votes
0answers
27 views

PHP Static and Normal Functions Calling [migrated]

Can someone explain how these line of code are working class DemoStatic { function normalFunction() { echo "This is the normal function"; } static function staticFunction() { echo "This ...
1
vote
0answers
172 views

Android, PHP session and JSON object retrieval

I am working on an app in android studio.. it currently has a login and registration system that are linked to a database and both work perfectly. I am now trying to carry over the user id value ...
0
votes
1answer
143 views

Java front-end, PHP/MySQL back end methodology

I have been basically out of the programming world for about 10 years, with only a bit of dabbling here and there with small Java utilities and one large Access database I wrote for someone, and some ...
-1
votes
3answers
162 views

Is Perl used for web development? [closed]

I am a web developer. I have been using php for many years and I also know lots of other programming languages so I wanted to try making websites using them. I know Perl and want to make a website ...
-1
votes
0answers
12 views

External entities not working in simplexml [migrated]

I am parsing XML using SimpleXML in PHP 5 and external entities are not working. The XML parses, but the entities just are blank. The underlying library is libxml2. This is the code: ...
0
votes
0answers
73 views

Executing a script continuously

I'm currently working on a PHP script that receives emails sent to a specific address and replies according to their content. It's working great, but now I need it to be executed every 10 seconds. ...
-1
votes
0answers
40 views

PHP variable access across the files [migrated]

I want to get one page variable values to another page. Is it possible to do with $GLOBALS? or else how should i do? I have a variable $url = 'http://' . $_SERVER['HTTP_HOST'] . ...
0
votes
0answers
44 views

Should URL params and request params be stored in the Request object

Is it acceptable if GET parameters don't reside in the Request object, but in the URL? I am writing a small library in PHP, which is to represent the Request/Response as different entities and ...
2
votes
3answers
121 views

Extended usage of an exception

I'm in the process of building a routing system for learning purposes and have encountered an issue which I think is a bit in the grey area of best practices. Can you guys help me decide if this is ...
0
votes
0answers
10 views

PHP Netbeans coding style configuration, where is it? [migrated]

I want to standardize coding style accross all the developers computers in my office, I want to export my netbeans configuration and ask the other programmers to import it on their IDEs, do you know ...
0
votes
0answers
12 views

Edit files on multiple domains on Mambo CMS

I have multiple domains on same web server, all running on Mambo CMS. Each site uses same template and has roughly same site structure. I need to edit the same page on each website - is there a ...
-3
votes
1answer
140 views

using node.js server with mysql-module and PHP for a penny-auction website? [closed]

I'm building a penny-auction platform like DealDash and just read into the WebSocket and node.js topic. I used PHP, MySQL and Ajax to build the website. I'm nearly finished and just have to implement ...
1
vote
1answer
98 views

DI container with multiple instances of same object

I'm looking for idea to make a DI container that can store multiple instances of the same object. Usually, a DI container should store either a single instance of the object, or create new object each ...
0
votes
1answer
90 views

Upgrade object in PHP

I cannot find information on this anywhere so I assume it doesn't exist. It makes much sense for me for such functionality to exist and I want to ask whether it actually does and I am wrong in my ...
0
votes
1answer
87 views

DRY principles vs local-only variable scope in functions (PHP motivated question)

I'm new to programming and in particular new to PHP. I often find that DRY is directly opposed to the principle of keeping variables local in PHP functions. Sometimes I think that it's easier to ...
0
votes
1answer
128 views

Best OOP practice for object vs dataservice [duplicate]

I am working on a new project and am curious as to how I should go about doing something properly. Lets say I have a table called "leads" in my database. This clearly means that a single "lead" would ...
1
vote
1answer
279 views

How to avoid big class complexity while keeping encapsulation?

I'm developing a PHP library to work with big numbers (at this moment only with a "Decimal" class, but I want to add new classes, to handle Integers, Rationals, and Complex numbers). In any case, the ...
-1
votes
3answers
64 views

What is an initial skeleton of the website called? A Framework? [closed]

I am building a website but I am wondering can I call the initial set of pages a framework? Say I have a project to build a website for a school. Before I start implementing the requirements I have ...
9
votes
2answers
345 views

Should HTTP Request/Response objects be immutable?

I think it's safe to say that most web applications are based on the request/response paradigm. PHP has never had a formal abstraction of these objects. One group is trying to change this: ...
4
votes
3answers
110 views

What is Black Box Testing? Are Functional and Usability Testing its types?

I am writing about testing and I am confused about the following: What exactly is Black-Box testing? Are functional testing and Usability testing two different types of testing and are they types of ...
0
votes
1answer
49 views

PHP Composer vendors licensing

I'm using a composer as a dependency manager for my PHP project. Composer operates as a library, which uses packagist as a software repository to fetch third-party dependencies. I'm interested, ...