Category "php"

how to remove %20 in the url in php

Current Code: <?php include('conn.php'); $sql = mysql_query("select min(news_id) 'min' from news"); $res = mysql_fetch_array($sql); $qry=mysql_query("s

Post Form Data To phpmyadmin Database

I need to post data from a website (HTML5 based) to a database on PHPMyAdmin. I have the database created as sewcute and a table named members. I'm using XAMMP

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

I have a little problem with my if(isset($_POST['submit'])) code. What I want is some echos and a table to not appear when the script is open but I do want it t

PHP Find Array Index value in multi-line array

I have a multi-line array value setup in existing code (written by an former team member) as follows: $array1['Alpha'] = "New York,Los Angeles,Washington"; $arr

Yii2: How do I debug console commands?

The Yii2 debugger seems to only work for web requests. How can I debug console commands (CLI)? Eg. I need to see the SQL statements that were executed during a

Scheduled tasks (cronjobs) how to do that on one server only

I have a PHP solution where a number of tasks run every minute with cronjobs (wget URL's on server). That is all fine, but I would like to be able to launch mul

HTML and PHP in one file

I'm a PHP newbie trying to sort some basics out. I have a user-form that leads to a mysql select query, which works fine. Every tutorial I have found so far has

json_encode turns array into an object

I am have created a 'liking' system for a site but I'm having a bit of trouble with json_encode and json_decode. I use arrays to store who has liked a post, so

Can't call javascript alert alertify library from PHP

I am using javascript alertify library for customized alerts. When I call alertify from javascript everything is ok, but, If I do It from PHP doesnt works. THe

Empty PHP POST Variables

Background Web-based contact form. Problem The $_POST array is empty. When errors are enabled, no errors (except empty array values) are found. The code was

Connection refused when trying to send mail using postfix

I want to use the mail() function in PHP. In order to do that, I've installed postfix. I am running on Ubuntu 18.04. My problem is that I can't send mail as I h

How to give apache permission to write to home directory?

My server is in /var/www/html I have a php script in /var/www/html/fileio_test/io_test.php <?php $logging = <<< LOG This is a test LOG; $testfil

How to edit Records using CodeIgniter

how do i edit my records?i keep getting to wrong pages.. thanks in advance really need help i based my code in my delete function i got from yesterday but i hav

Is there a way to correctly use sanitize_text_field and wp_unslash that doesn't cause psalm to error with "expects string, possibly different type"

I am writing a WordPress plugin, and need to correctly unslash and sanitise a variable in PHP. I am using psalm as my static analysis tool, and it is identifyin

how do i retrieve and display the alt text of an image in wordpress?

how do i retrieve and display the alt text of an image in wordpress? trying to substitute the title for the alt. here is the original code. <?php while ( ha

PHP: remove filename from path

Say I have an path: images/alphabet/abc/23345.jpg How do I remove the file at the end from the path? So I end up with: images/aphabet/abc/

Can I write PHP code across multiple lines per statement?

Is it okay to write code like this, with statements spanning across multiple lines? $db_selected = mysql_select_db( 'my_dbase', mysql_connect(

Yii Ajax Submit button

Yii 1.1.14 I'm trying to make a popup to select a year and then get some reporting output for the selected year : The popup is generated by CJuiDialog. Insi

How to get values inside <![CDATA[values]] > using php DOM?

How can i get values inside <![CDATA[values]] > using php DOM. This is few code from my xml. <Destinations> <Destination>

Why does codeigniter & Linux server throws unserialize() session data error when user tries to login

I am developing an app using CodeIgniter and I have deployed this app on a linux server, the issues I am facing is this error ERROR - 2022-01-06 11:48:16 -->