Tag Archives: sed

Is this correct object oriented programming in php? [closed]

Questions: Could this be classified as correct OOP programming? class Greeting { public $greet = array(‘Hi’,’Hello’, ‘Howzit’, ‘Ola’, ‘Whats up’); function __construct($name) { $this->name = $name; shuffle($this->greet); } } $hi = new Greeting(‘INSERTNAMEHERE’); /*NAME OF PERSON GOES HERE*/ echo $hi->greet[1] .’ ‘. $hi->name; Answers:

How to design a hierarchical role based access control system

Questions: Basic deal is, we have a custom built “kickstart” for our projects. For this we are looking at redoing the user control. I know there are a lot of questions out there about general rbac, but I cannot find any on hierarchical rbac? Our requirements are: Roles can be assigned to group permissions If… Read More »

How to connect to MySQL using php [closed]

Questions: I have been working on a form that uses PHP to send e-mails to my account. To save room and de-clutter my mailbox account I am now trying to now use the same PHP to send the info to a MySQL server to log the data. The code I have been trying to make… Read More »

Difference between 2 time() values [closed]

Questions: I have 2 time() values, for example: 1379078542 1379078574 How do I work out their diffidence and display the output as years, months, weeks, days, hours, minutes, seconds etc. The 2 values above have a difference of 32 seconds I think, so in this case, I would want to display 32 seconds. Answers:

What should every PHP programmer know? [closed]

Questions: I would like to be a PHP/MySQL programmer What are the technologies that I must know? Like: Frameworks IDEs Template Engines Ajax and CSS Frameworks Please tell me the minimum requirements that I must know, and tell me your favourite things in the previous list? Thanks Answers:

Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given in [closed]

Questions: <?php if(isset($_POST[‘submit’])){ $data_missing = array(); if(empty($_POST[‘first_name’])){ // Adds name to array $data_missing[] = ‘First Name’; } else { // Trim white space from the name and store the name $f_name = trim($_POST[‘first_name’]); } if(empty($_POST[‘last_name’])){ // Adds name to array $data_missing[] = ‘Last Name’; } else{ // Trim white space from the name and store… Read More »

Value with same name in Array [closed]

Questions: I want to check is there a value with same name in array, if there is a value with same name, how can i get it. Let’s say i have <?php if (is_array(Yii::app()->session[‘cart_values’])) { foreach ( Yii::app()->session[‘cart_values’] as $value) { ?> and what is next, again go through another array which contain $files name… Read More »