LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

2110 solutions found in plugin-api

Page 97 of 106
0 votes
2 ans
32 views
"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

I'm running a PHP script and continue to receive errors like: > Notice: Undefined variable: my_variable_name in C:\wamp\www\mypath\index.php on line 1...

database Solved
PE
asked 5 months ago by Pekka
0 votes
3 ans
30 views
Get the first element of an array

I have an array: `array( 4 => 'apple', 7 => 'orange', 13 => 'plum' )` I would like to get the first element of this arr...

php-dev Solved
HS
asked 5 months ago by hsz
0 votes
3 ans
31 views
How do you use bcrypt for hashing passwords in PHP?

Every now and then I hear the advice "Use bcrypt for storing passwords in PHP, bcrypt rules". But what is `bcrypt`? PHP doesn't offer any such...

php-dev Solved
VI
asked 5 months ago by Vilx-
0 votes
3 ans
30 views
Enumerations on PHP

I know that PHP doesn't yet have native Enumerations. But I have become accustomed to them from the Java world. I would love to use enums as a way to give p...

php-dev Solved
HE
asked 5 months ago by Henrik Paul
0 votes
3 ans
31 views
How can I sanitize user input with PHP?

Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML t...

php-dev Solved
BR
asked 5 months ago by Brent
0 votes
3 ans
34 views
Secure hash and salt for PHP passwords

It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which mechanism to use for password protection. This...

php-dev Solved
LU
asked 5 months ago by luiscubal
0 votes
2 ans
33 views
What are Long-Polling, Websockets, Server-Sent Events (SSE) and Comet?

I have tried reading some articles, but I am not very clear on the concepts yet. Would someone like to take a shot at explaining to me what these technologie...

server-admin Solved
US
asked 5 months ago by user1437328
0 votes
3 ans
33 views
PHP array delete by value (not key)

I have a PHP array like so: $messages = [312, 401, 1599, 3, ...]; Given that **the values in the array are unique**, how can I delete the element with...

php-dev Solved
AD
asked 5 months ago by Adam Strudwick
0 votes
3 ans
33 views
How do I expire a PHP session after 30 minutes?

I need to keep a session alive for 30 minutes and then destroy it.

php-dev Solved
TO
asked 5 months ago by Tom
0 votes
2 ans
32 views
What is stdClass in PHP?

Please define what `stdClass` is.

php-dev Solved
KE
asked 5 months ago by Keira Nighly
0 votes
3 ans
35 views
How do I use PHP to get the current year?

I want to put a copyright notice in the footer of a web site, but I think it's incredibly tacky for the year to be outdated. How would I make the year u...

php-dev Solved
JD
asked 5 months ago by JD Graffam
0 votes
2 ans
29 views
Returning JSON from a PHP Script

I want to return JSON from a PHP script. Do I just echo the result? Do I have to set the `Content-Type` header?

php-dev Solved
SC
asked 5 months ago by Scott Nicol
0 votes
2 ans
34 views
What is the difference between public, private, and protected?

When and why should I use `public`, `private`, and `protected` functions and variables inside a class? What is the difference between them? Examples:...

general-dev Solved
AD
asked 5 months ago by Adam Halasz
0 votes
3 ans
37 views
Detecting request type in PHP (GET, POST, PUT or DELETE)

How can I detect which request type was used (GET, POST, PUT or DELETE) in PHP?

php-dev Solved
UN
asked 5 months ago by UnkwnTech
0 votes
2 ans
30 views
Where can I find php.ini?

Today I needed to install the IBM DB2 library. I went through all the steps up to `make install`, and I found ibm_db2.so in `$PHP_HOME/lib/extensions/somecompl...

php-dev Solved
NE
asked 5 months ago by necromancer
0 votes
2 ans
38 views
Login API in moodle angular 8

I need to login my user from my website to the moodle page.I have build function that create user and make enroll to course,Now i need to make auto login....

moodle-core Solved
VL
asked 5 months ago by Vladimir Potapov
0 votes
2 ans
35 views
Moodle change badges image size

when I create a badge in Moodle 3.5, the core automatically creates 3 thumbs for the badge icon (35x35, 100x100, 512x512). I should increase the size of the 100...

moodle-core Solved
BT
asked 5 months ago by btb84
0 votes
2 ans
36 views
"Not available unless: You belong to <Some group>" : How to hide this message in moodle course

I&#39;m building a Moodle course for my students who are part of different batches. Each batch refers same lesson notes, but the Quiz and Assignment activities...

moodle-core Solved
CO
asked 5 months ago by code
0 votes
3 ans
32 views
Adding new moodle UI elements according to the onchange event of a select element

I&#39;m new in moodle and I always programmed at client-side. I think maybe I&#39;m missing something because of that reason. I need to provide the user with di...

moodle-core Solved
GA
asked 5 months ago by gal007
0 votes
2 ans
27 views
Moodle: web service call to get assignments under course

I have an application where I need to fetch records from Moodle using the core Web Service API. I am receiving courses and categories with the following API...

moodle-core Solved
TE
asked 5 months ago by TechNo