Categories
Mastering Development

How do I connect to a MySql database with PDO in PHP

When creating a PDO object to connect to my database I’m catching my ‘Could not connect’, and am unsure how to correct it. I’ve confirmed correct username, password, and database. Sql server is currently running. <?php try { $pdo = new PDO(‘mysql:host=127.0.0.1;dbname=todo’, ‘root’, ”); } catch (PDOException $e) { die(‘Could not connect’); } What possible […]

Categories
Mastering Development

Rails – mark invalid nested fields

Rails is not marking nested attributes as invalid when validations fail. For example: I have two models; User and UserProfile. User contains email and password UserProfile contains username, first_name, last_name, etc User validates that email is present and unique UserProfile validates that username is present and matches a regex On the sign-up form, User accepts […]

Categories
Mastering Development

vue firebase user not authenticating after entering email and password

for some reason my firebase authentication doesn’t seem to be going through. I don’t get any error back from firebase when authenticating so it should be fine, but when I am posting to firebase I run a check to make sure that a valid user exists and my function returns saying that there isn’t a […]

Categories
Linux Mastering Development Ubuntu

ssh public key password denied

Entering my password when prompted gives publickey, password denied error: root@kali:~# ls .ssh/ id_rsa id_rsa.pub known_hosts root@kali:~# ssh-copy-id -i ~/.ssh/id_rsa.pub root@10.0.2.15 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: “/root/.ssh/id_rsa.pub” /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be […]

Categories
CMS Drupal Mastering Development

How to add class to all text inputs in Drupal 8?

Explain please how to add same class (form__text) to all text, email, password, search, textarea inputs in Drupal 8?

Categories
Mastering Development

IONIC 5 empty FormData

I am performing a user profile, however when creating the FormData for sending it is being generated empty, even with all other fields having values. Below is the code cadastro.ts import { Component, OnInit } from ‘@angular/core’; import { Router } from ‘@angular/router’; import { FormGroup, FormBuilder, Validators } from ‘@angular/forms’; import { AlertController, ActionSheetController […]

Categories
CMS Mastering Development Wordpress

Change user metadata on registration (show_admin_bar_front = false)

This is my first contact with WP Development, and I’m trying to not display the WP admin bar after the registration. Since it’s metadata called ‘show_admin_bar-front’, I’m updating that right after creating the user. if(count($error) == 0) { wp_create_user( $username, $password, $email); $user_id = get_current_user_id(); update_user_meta($user_id, ‘show_admin_bar_front’, ‘false’); echo “User Created Successfully!”; exit(); } As […]

Categories
Linux Mastering Development Ubuntu

Shell script regarding user accounts changes

I need to make a shell script that alerts the users when changes are made to their accounts.Can someone please help me?I’m talking about changes that are made in the file that the holds their user information, like name, password,DoB,ID, etc. The changes need to be registered in a file.

Categories
Mastering Development

How can I convert a const char* to a string in CLR/C++ with FLTK to obtain the value of an FL_Input or other widget?

I have been recently constructing a program. The end goal is to get what the user has written in the Fl_Input box and write it into my database. To do this I am going to need a callback on a button that allows me to at least get the string value of an Fl_Input->value() The […]

Categories
Mastering Development Software

How do I get the selected value of the second dropdown from the first dropdown via MY-SQL?

I am building an editor for a blog. Each post will be categorised. I am trying to get all the posts, with the category that they have been assigned to be displayed as dropdown menu. So, when the user clicks on a post title from the first dropdown menu, then the second category dropbox will […]