Javascript – Why does not my PHP code work?

What happens is that I try to register some values ​​in mysqli, and I do not understand why it is not, because this code has always worked for me. The only thing that PHP does is the "echoes" with which, if they work correctly as desired, that is, what does not work is what is in the other, with the exception of the "echo".

if (isset ($ _ POST (& # 39; retrieve & # 39;))) {
$ db = mysqli_connect ("localhost", "root", "", "userlist12");
$ email = $ _POST (& # 39; email & # 39;);
$ sql2 = ("SELECT * FROM users WHERE email = & # 39; $ email & # 39;");
$ q = mysqli_query ($ db, $ sql2);
$ row = mysqli_fetch_array ($ q);
$ username = $ row (& # 39; username & # 39;);
if (mysqli_num_rows ($ q) == 0) {
echo & # 39;& # 39 ;; else {{

$ code = hash (& # 39; sha256 & # 39 ;, time (). rand (9999, 999999));
$ sql = "INSERT INTO recovery VALUES (& # 39; $ code & # 39 ;, & # 39; username & # 39 ;, & # 39; & # 39;";
mysqli_query ($ db, $ sql);
echo & # 39;& # 39 ;;
}
}

php – Unknown characters between each letter when reading the CSV uploaded to Laravel

I'm trying to upload a CSV file, read its contents, and import that data into a database, but apparently I get an error where an unknown character appears between each character.

This is my code:

    $file = $request->file('file');
    $fileName = $file->getRealPath();
    $file = fopen($fileName, "r");

    $i = 0;
    while (($column = fgetcsv($file, 10000, ";")) !== FALSE) {

        if ($i == 0){
            $i++;
            continue;
        }
        echo print_r($column);$i++;    
    }

    fclose($file);

I get that from print_r:

Enter image description here

Any ideas why it could be? I tried to open the CSV encoding UTF8 and UTF16, but I still have this problem.

Thank you in advance.

PHP – Error generating PDF send data using the GET method

I'm trying to create a PDF report that collects information from a table of data. This table contains a field called PIN. The situation is that I have an administration window in which I have records from another table, and these records also have a field named PIN corresponding to my data table from which I extract the information to generate the PDF ,

The problem is that when trying to generate PDF, the PIN selected by the GET method is sent to the URL of the file that generated the PDF DO NOT GENERATE However, if you send the PIN via URL, the page will be empty.
Thanks for your help.

Button code that sends the PIN from which you want to generate the PDF.

  ";?>

PDF generated code:

 set_charset("utf8"); 
$sql = "SELECT * FROM datos WHERE pin ='{$_GET('pin')}' ORDER BY pin ASC";   
$result = mysqli_query($conn, $sql); 

while($row = mysqli_fetch_array($result))  
{      
$output .= 'TODO EL CONTENIDO HTML DEL PDF CONSULTADO CON EL DATO "PIN"';  
}  
return $output; 
}  
if(isset($_POST("generate_pdf")))  
{  
require_once('TCPDF-master/tcpdf.php');
//PROPIEDADES DEL PDF
}  

php – Show comment menu in dashboard only if the site contains a comment

I'd like to hide the Comments menu in the Dashboard until the site no longer has any comments. I tried to do this with the following code, but it does not work:

function remove_mainmenu_pages() {
        global $user_ID;
        if ( 1 < wp_count_comments( get_the_ID() )->approved ) {
                remove_menu_page( 'edit-comments.php' );
    }
}
add_action( 'admin_menu', 'remove_mainmenu_pages' );

Thank you so much!

php – Checkout onepage redirects to shopping cart in magento 1.9

Using Magento 1.9.1. On the websites https://byroninbloom.com.au/ and https://www.neoflamshop.com.au/, after the last step in Checkout, a loop / forward to the shopping cart is executed. The items in the shopping cart will not be removed. I searched for days and tried every possible solution that I could find, such as:

1) Cookie lifetime has been increased from 3600 to 86400

2) Redirect disabled cookies on CMS page = no

3) web / url / redirect_to_base 0 instead of 1

4) Delete the folders var / cache and var / sessions

5) Disabled and changed shipping and payment methods

6) Increase the memory limit to 256 MB

and so on … Here is the system log of another site that has the same problem.

2019-11-06T06: 03: 54 + 00: 00 ERR (3): Warning: Varien_Simplexml_Element :: hasChildren (): Memory allocation in /home/neoflamcom/public_html/lib/Varien/Simplexml/Element.php on line 84 failed 2019 -11-11T06: 05: 18 + 00: 00 ERR (3): warning: simplexml_load_string (): (null) entity: line 393: parser error: Out of memory in /home/neoflamcom/public_html/app/code/core/ Mage / Core / Model / Layout / Update.php on line 450 2019-11-11T06: 05: 18 + 00: 00 ERR (3): Warning: simplexml_load_string (): ship to / home / neoflamcom / public_html / app / code / core / Mage / Core / Model / Layout / Update.php on line 450 2019-11-11T06: 05: 18 + 00: 00 ERR (3): warning: simplexml_load_string (): ^ in / home / neoflamcom / public_html / app / code / core / Mage / Core / Model / Layout / Update.php on line 450 2019-11-11T06: 05: 18 + 00: 00 ERR (3): Warning: simplexml_load_string (): Entity: Line 393: Parser Error: Additional content at the end of the document in / home / neoflamcom / pub lic_html / app / code / core / Mage / Core / Model / Layout / Update.php on line 450 2019-11-11T06: 05: 18 +00: 00 ERR (3): Warning: simplexml_load_string (): Shipping to / home /neoflamcom/public_html/app/code/core/Mage/Core/Model/Layout/Update.php on line 450 2019-11-11T06: 05: 18 + 00: 00 ERR (3): Warning: simplexml_load_string (): ^ in /home/neoflamcom/public_html/app/code/core/Mage/Core/Model/Layout/Update.php on line 450

So you think it's not enough memory? I hope someone can help.

php – I can not register with this code

I can not register with this code, go straight to the other one:

$ con = new RFQ ("mysql: host = localhost; dbname = pit", "root", "");
$ sql = $ con> prepare ("INSERT INTO invocation values ​​(null,?,?,?,?,?,?,?,?)");
$ sql-> execute (array ($ _ SESSION (# code; #), $ animal_name, "", $ data, $ time, $ service, "Scheduled");

if ($ sql-> rowCount ()> 0) {
header (& # 39; location: ../ restricted / indexa.php & # 39;);
} else {
header (& # 39; location: ../ restricted / indexa.php & # 39;);
}
?>
Send modal data:

Time schedule

×

Pet name

Date of consultation

Time schedule

service

R $ 50.00 "> bath
R $ 30.00 "> Tosa
R $ 65.00 "> bath / groom
R $ 100.00 "> medical examination
R $ 100.00 "> vaccination
R $ 150.00 "> Medical examination / vaccination

Abort
Time schedule