PHP

PHP
3 years ago

Outputting 20 different random numbers within a range using php

PHP
I've created this code to output 20 random numbers from 5 to 100 in PHP. All the numbers must be different from each other. While executing I'm taking...
3 years ago

Declaring a global variable inside a function

PHP
I have two PHP files. In the first I set a cookie based on a $_GET value, and then call a function which then sends this value on to the other file. ...
3 years ago

How to set the default controller in yii2

PHP
I have UserControler and I run it in virtual server http://basic.com/index.php?r=user/index. How can I set up UserController and action index to be th...
3 years ago

Email Validation in cakephp Model

PHP
I have the below setup of validation rules. For some reason, 'on' => 'create' block doesn't work. The conditions to be implemented are standard cre...
3 years ago

Why I can not send Maindrill Mail from development server(localhost)?

PHP
I am using Mandrill API to send email. I have register my send domain and set my DKIM and SPF record properly inside Mandrill Setting page. Followin...
3 years ago

PHP: Check if string is part of an array

PHP
I'm working on my little ticketing-system based on PHP. Now I would like to exclude senders from being processed. This is a possible list of exclude...
3 years ago

symfony2 php access object of another entity

PHP
I know its very lame question to ask. I have One Entity ContentSelector and another is Content in Content Selector I have a property Content where I h...
3 years ago

PHP: Issues with querying multiple tables

PHP
My search function works well when it queries just a single table. But when I query more than one table in the same database (using 'UNION'), am faced...
3 years ago

Select dropdown from date range

PHP
Is there a simple if statement to default select the correct date from the dropdown? so for example if the date is 02/11/16 then it will default selec...
3 years ago

Error serializing an object tree with SplObjectStorage

PHP
I have implemented a simple Composite pattern using SplObjectStorage, like the example above: class Node { private $parent = null; public fu...
3 years ago

Alternative for $_SERVER['HTTP_REFERER'] PHP variable in MSIE

PHP
I have used $_SERVER['HTTP_REFERER'] variable in my application (used PHP). On Firefox above variables is wokring. But i observed that $_SERVER['HTTP_...
3 years ago

Run Linux Commands Using PHP

PHP
I have seen many questions about Running Linux Commands using PHP, but my problem is different. I am using a shared hosting Linux server, and I want t...
3 years ago

PHP Abstract Factory Pattern Implementation

PHP
I am reading about the different patterns available out there. Currently I am on the Abstract Factory Pattern and I think I have a pretty good grasp o...
3 years ago

Alternative to checking if query string empty

PHP
I was just wondering if you anyone had a better way to check for an empty string, this one works but shows the error the first time you load the form,...
3 years ago

store multiple select option into a PHP array

PHP
I have an selectbox list Is it possible to select multiple option: <select name="access_list[ ]" size="7" multiple="multiple"> <?php $res=my...
3 years ago

PHP OOP Construct explination unclear

PHP
This is not a question about a particular problem, but rather a question asking for advice and / or assistance. Im a 2nd year student, Im really stru...
3 years ago

send array from controller to model in codeigniter

PHP
Hello i need help i am trying to pass three different variables from the controller of a codeigniter to model so i created an array and pass it then i...
3 years ago

jQuery is not defined in Wordpress, but my script is enqueued properly

PHP
I am trying to load a separate javascript file mobile-menu.js to my Wordpress theme. When I look at the console, it says, "jQuery is not defined." How...
3 years ago

All php functions work but phpinfo

PHP
I recently upgraded my VPS PHP version to 7.0.3 and everything seems to work fine including php -v which shows: (I know I'm getting some warnings but...
3 years ago