Most viewed questions in PHP

0 votes
1 answer

How to see indexes for a database or table in MySQL?

Hello @kartik, To see the index for a ...READ MORE

Aug 18, 2020 in PHP by Niroj
• 82,880 points
145,021 views
0 votes
0 answers

http://localhost/phpMyAdmin/ unable to connect

I tried to start phpMyAdmin from my ...READ MORE

May 27, 2022 in PHP by Kichu
• 19,050 points
70,454 views
0 votes
1 answer

How to get input field value using PHP?

Hello, Use PHP's $_POST or $_GET superglobals to retrieve the value of ...READ MORE

Nov 20, 2020 in PHP by Niroj
• 82,880 points
66,122 views
0 votes
1 answer

How to select all records from one table that do not exist in another table?

Hello @kartik, You can either do like this: SELECT ...READ MORE

Jul 21, 2020 in PHP by Niroj
• 82,880 points
51,281 views
0 votes
1 answer

How to find the php.ini file from the command line?

Hello @kartik, You can get a full phpinfo() using : php ...READ MORE

May 19, 2020 in PHP by Niroj
• 82,880 points
49,857 views
0 votes
1 answer

PHP undefined key and variable

Hi, @Dann, If you are using some variable ...READ MORE

Dec 30, 2020 in PHP by anonymous
• 65,910 points
44,608 views
0 votes
1 answer

Error:“Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP

Hello @kartik, The best way for getting input string is: $value ...READ MORE

Apr 1, 2020 in PHP by Niroj
• 82,880 points
36,772 views
0 votes
1 answer

Error:Failed to open stream : No such file or directory.

Hello @kartik, Go to the file to include ...READ MORE

Oct 1, 2020 in PHP by Niroj
• 82,880 points
36,033 views
0 votes
1 answer

MySQL - UPDATE multiple rows with different values in one query

Hello @kartik You can use a CASE statement to handle ...READ MORE

Jun 1, 2020 in PHP by Niroj
• 82,880 points
32,962 views
0 votes
1 answer

How to resolve the problem of losing a session after a redirect in PHP?

Hello @kartik, Carry out these usual checks: Make sure session_start(); is ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,880 points
32,370 views
0 votes
2 answers

How to use basic authorization in PHP curl?

If you are saying Basic authentication, then ...READ MORE

Jan 3, 2021 in PHP by Manas
• 140 points
31,862 views
+1 vote
1 answer

ERROR: Cannot add or update a child row: a foreign key constraint fails

Hello @kartik, You are getting this constraint check ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,880 points
29,300 views
0 votes
1 answer

How to store values from foreach loop into an array?

Hello @kartik, Declare the $items array outside the loop and ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
28,515 views
0 votes
2 answers

Error:“Cannot Connect to Server - A network-related or instance-specific error”?

Hello, The "sql server error 40" is appears mostly ...READ MORE

Aug 18, 2020 in PHP by Fantazma
• 140 points
28,026 views
0 votes
1 answer

How to include External CSS and JS file in Laravel?

Hello @kartik, The right way is this one: <script ...READ MORE

Oct 27, 2020 in PHP by Niroj
• 82,880 points
27,716 views
0 votes
1 answer

Error:PHP Warning: POST Content-Length of 8978294 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

Hello @kartik, 8388608 bytes is 8M, the default ...READ MORE

Sep 17, 2020 in PHP by Niroj
• 82,880 points
27,247 views
0 votes
1 answer

How to call function of one php file from another php file and pass parameters to it?

Hello @kartik, Include the first file into the ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
24,099 views
0 votes
1 answer

error: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in...

Hello @kartik, Use this SQL command: ALTER USER 'mysqlUsername'@'localhost' ...READ MORE

Oct 27, 2020 in PHP by Niroj
• 82,880 points
23,514 views
0 votes
1 answer
0 votes
1 answer

How to connect to SQL Server database from JavaScript in the browser?

Hello @kartik, You shouldn´t use client javascript to ...READ MORE

Jul 21, 2020 in PHP by Niroj
• 82,880 points
23,267 views
0 votes
1 answer

How to get Root Directory Path of a PHP project?

Hello @kartik, Try $_SERVER['DOCUMENT_ROOT'] contains this path: D:/workspace In that case you ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
21,992 views
0 votes
1 answer

How to Execute PHP function with onclick?

Hello @kartik, In javascript, make an ajax function, function ...READ MORE

Jun 16, 2020 in PHP by Niroj
• 82,880 points
21,459 views
0 votes
1 answer

How to pass multiple variables to another page in url?

Hello @kartik, Use the ampersand & to glue variables together: $url ...READ MORE

Nov 23, 2020 in PHP by Niroj
• 82,880 points
20,765 views
0 votes
1 answer

Error:Lost connection to MySQL server at 'reading initial communication packet', system?

Hello, You have to follow the below steps: bind-address ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
20,339 views
0 votes
1 answer

How do I get the base URL with PHP?

Hello @kartik, Try this: <?php echo "http://" . $_SERVER['SERVER_NAME'] ...READ MORE

Sep 15, 2020 in PHP by Niroj
• 82,880 points
20,082 views
0 votes
1 answer

How can I access the MySQL command line with XAMPP for Windows?

Hello @kartik, Your MySQL binaries should be somewhere ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,880 points
19,835 views
+1 vote
1 answer

Error: “The zip extension and unzip command are both missing, skipping.”

Hello @kartik, Depending on your flavour of Linux ...READ MORE

Aug 14, 2020 in PHP by Niroj
• 82,880 points
19,831 views
0 votes
1 answer

How to do error logging in CodeIgniter ?

Hello @kartik, CodeIgniter has some error logging functions ...READ MORE

May 19, 2020 in PHP by Niroj
• 82,880 points
18,932 views
0 votes
1 answer

How to make PDF file downloadable in HTML link?

Hello @kartik, Try this: <a href="./directory/yourfile.pdf" download="newfilename">Download the pdf</a> Where newfilename is ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
18,912 views
0 votes
1 answer

How to save DOMPDF generated content to file?

Hii, Try this: require_once("./pdf/dompdf_config.inc.php"); $files = glob("./pdf/include/*.php"); foreach($files as $file) include_once($file); $html ...READ MORE

Nov 13, 2020 in PHP by Niroj
• 82,880 points
17,843 views
0 votes
2 answers

How to catch curl errors in PHP?

For (PHP 4 >= 4.0.3, PHP 5, ...READ MORE

Nov 9, 2020 in PHP by anonymous
• 160 points
17,773 views
0 votes
1 answer

How to post the parameter in ajax call of jquery datatable?

Hello @kartik, Just pass it like a normal ...READ MORE

Jun 16, 2020 in PHP by Niroj
• 82,880 points
17,283 views
0 votes
1 answer

How do I remove quotes from a string?

Hello @kartik, Try this: str_replace('"', "", $string); str_replace("'", "", $string); Otherwise, ...READ MORE

Nov 16, 2020 in PHP by Niroj
• 82,880 points
17,210 views
0 votes
1 answer

Fatal error: Constant expression contains invalid operations

Hello @kartik, This is because a static variable ...READ MORE

Nov 8, 2020 in PHP by Niroj
• 82,880 points
17,118 views
0 votes
1 answer

How to get the Last Inserted Id Using Laravel Eloquent?

Hello @kartik, Firstly create an object, Then set ...READ MORE

Jul 22, 2020 in PHP by Niroj
• 82,880 points
17,037 views
0 votes
1 answer

How to get original URL referer with PHP?

Hello @kartik, Store it either in a cookie or ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
16,712 views
0 votes
1 answer

How to get base url in laravel using php?

Hello @kartik, You can use the URL facade ...READ MORE

Sep 17, 2020 in PHP by Niroj
• 82,880 points
16,358 views
0 votes
1 answer

Warning: mysqli_connect(): (HY000/2002): No such file or directory in /Users/kramer65/Sites/vanilla/info.php on line 3 Failed to connect to MySQL: No such file or directory

Hello @kartik, edit these two lines in /etc/php.ini (or wherever ...READ MORE

Nov 6, 2020 in PHP by Niroj
• 82,880 points
16,332 views
0 votes
1 answer

How to return an array from an AJAX call?

Hello @kartik, Use JSON to transfer data types (arrays and ...READ MORE

Nov 14, 2020 in PHP by Niroj
• 82,880 points
16,277 views
0 votes
1 answer

How to check file extension in upload form in PHP?

Hello @kartik, Using if( $ext !== 'gif') might not ...READ MORE

Nov 8, 2020 in PHP by Niroj
• 82,880 points
15,946 views
0 votes
1 answer

How to include a PHP variable inside a MySQL statement?

Hii, You can try this: $query="SELECT * FROM CountryInfo ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
15,700 views
0 votes
0 answers

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

I am getting this error in the ...READ MORE

May 19, 2022 in PHP by Kichu
• 19,050 points
15,587 views
0 votes
1 answer

Composer install error - requires ext_curl when it's actually enabled?

Hello, on php7 run for example: > sudo apt-get ...READ MORE

Apr 2, 2020 in PHP by Niroj
• 82,880 points
15,250 views
0 votes
1 answer

Fatal error: Class 'Illuminate\Foundation\Application' not found

Hello @kartik, Something is clearly corrupt in your ...READ MORE

Nov 5, 2020 in PHP by Niroj
• 82,880 points
14,438 views
0 votes
1 answer

Error:“Connection for controluser as defined in your configuration failed” with phpMyAdmin in XAMPP

Hii, I edited /etc/phpmyadmin/config.inc.php and changed the following ...READ MORE

Apr 20, 2020 in PHP by Niroj
• 82,880 points
14,372 views
0 votes
1 answer

How can I use jquery $.ajax to call a PHP function?

Hello @kartik, Use $.ajax to call a server context (or ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
13,980 views
0 votes
1 answer

Error: Maximum execution time of 60 seconds exceeded in C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php on line 140

Hello @kartik, Go to: xampp\phpMyAdmin\libraries\config.default.php Look for : $cfg['ExecTimeLimit'] = 600; You ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
13,708 views
0 votes
1 answer

How to receive JSON POST with PHP?

Hello @kartik, Try; $data = json_decode(file_get_contents('php://input'), true); print_r($data); echo $data["operacion"]; From your ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,880 points
13,653 views
0 votes
1 answer

Error:PDOException could not find driver

Hello @kartik, You need to have a module ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,880 points
13,535 views