Most voted "php" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to the PHP programming language. For example: questions about classes, methods, functions, syntax and general use of this language. Do not use this tag if PHP is used circumstantially, but has no relation to the question problem. For example: do not use this tag for questions about HTML formatting, CSS or Javascript code.
Learn more…27,244 questions
Sort by count of
-
-4
votes0
answers39
viewsWhich of these methods is best to handle a PHP input in order to avoid SQL Injection?
prepare() and bind_param() filter_input filter_sanitize…
-
-4
votes0
answers21
viewsPass the video id to another form?
In my code, I have a loop that displays several videos that have the ID stored in a BD. The detail is that I need, when clicking on any of the listed videos, to open another page and display the ID…
-
-4
votes1
answer41
viewsHow to get the value of a GET in PHP
Would you like to take the value that comes after the bar without using the ? ( query ) Example ( of how it is ) : https://foo.com/teste.php?p=acme As I wish : https://foo.com/acme I can already…
-
-4
votes0
answers19
viewsrequire_once does not find my files Laravel
I have this require DIR that is not able to fetch the files, I have tried to write the complete path and in a more simplified way, if anyone can help me thank you require_once…
-
-4
votes1
answer67
viewsPass the $rfprod parameter by clicking on the line for a PHP program (POST Method)
<div id="posiciona"> <table id="mostra_prod" cellpadding="1" cellspacing="3" bordercolor="#000000"> <thead> <tr> <td align="right"…
-
-4
votes1
answer498
viewsSimple query of Mysql
I know very little about SQL and I’m thinking about a very simple system - but I don’t know how to set it up and it’s for a public school that doesn’t have a programmer to hire at the moment. I have…
-
-4
votes1
answer578
viewsPHP with java script and css
Develop an application for Conversion of Measures. The application may convert the following measures: a) Length: kilometre, metre and centimetre. b) Mass: kilogram and gram. c) Temperature: Celsius…
-
-4
votes1
answer1704
viewsWarning error: mysql_fetch_array() expects Parameter 1 to be Resource, Boolean Given in
I know you probably have other similar answers, but none of them I thought you needed. In the database I have a table with id, name, version, upload and size. I just need to get the version of the…
-
-4
votes1
answer249
viewsComposer/Laravel...[BUGS]
Hello, I’m with a system in php to give maintenance...only I wanted to upload the application to do the tests and I’m not succeeding,I searched the net did some things, and even so I come across…
-
-4
votes1
answer36
viewsConnection problems
When sending the form to register the email entered in the field it should simply register in the database, but it does not register, how can I solve? <?php $conect =…
-
-4
votes1
answer327
viewsCall AJAX / jquery in the middle of PHP code
I have a PHP code structure and, within it, I want to automatically call a $.get AJAX for another PHP page. Example: <?php $cod = 1; $mod = 2; $text = 3; como chamar um ajax automaticamente aqui,…
-
-4
votes1
answer56
viewsError when inserting into BD
Guys, I’m having a problem registering customers in the comic book. When I click the sign up button, it just refreshes the page and does not insert the client in the comic book. No error and…
-
-4
votes1
answer886
viewsHow to format value in php?
I have the following code <?php ini_set('display_errors', true); error_reporting(E_ALL); include_once("con.php"); $pdo = conectar(); $id_empresa = $_GET['id_empresa']; $data = $_GET['data'];…
phpasked 7 years, 10 months ago GustavoSevero 2,567 -
-4
votes2
answers231
viewsError Parse error: syntax error, Unexpected ';' in C: xampp htdocs adoption backend valida.php on line 32
Guys I’m not finding the mistake please someone help me: <?php session_start(); //Incluindo a conexão com banco de dados include_once("conexao.php"); //O campo usuário e senha preenchido entra no…
phpasked 7 years, 8 months ago Emmanuel Siqueira 3 -
-4
votes1
answer57
viewsError Login System
I’m trying to create a login system, but the system is not logging in with registered users, I tried to create a condition where only users register can access the login. Error: Warning:…
phpasked 7 years, 7 months ago Matheus Pellegrini 25 -
-4
votes1
answer145
viewsIF x SWITCH - Simulating
I believe that all of us always time to make some deals in conditions with few values. I made a test between the IF and the SWITCH. All content, was created to SIMULATE a more identical structure…
-
-4
votes1
answer87
viewsIs there any way to write this code in a more didactic way?
Basically the code loops through the database for posts, but it will only post if the scheduled date is less or equal to the current date. He searches the bank for all posts and lists, but those…
-
-4
votes1
answer195
viewsPHP - Upload Multiple images
Hello, I created a code where I simply upload multiple images. But I’m not able to enter the values of the urls 'im/pd/'. $file_name_new; of the variable $file_destination in the comic book. At DB I…
phpasked 7 years, 6 months ago user21312321 27 -
-4
votes1
answer75
viewsPHP - You have an error in your SQL syntax;
Hello I have an error here! I have the same code as another page but on this page it works and this one does not... error: You have an error in your SQL syntax; check the manual that Corresponds to…
-
-4
votes1
answer878
viewsSQLSTATE[08004] [1040] Too Many Connections
This is my connection class: /** * Conn.class [ CONNECTION ] * Abstract connection class. Singleton standard. * Returns a PDO object by the static getConn() method; * * @copyright (c) 2017, Horacio…
-
-4
votes2
answers97
viewsHow to convert a value (which appears to be octal) to literal string in PHP (5.6)?
How to convert a value (which appears to be an octal) to a literal string in PHP (5.6)? Example: //considere $mes=08; ou $mes=09; $mes = 08; echo $mes; // Retorna 0 $result = (string) $mes; echo…
phpasked 7 years, 3 months ago Jonathan Paulista 3 -
-4
votes1
answer237
viewsError saving to mysql
Good afternoon to all... I would like to know the reason for the error in the array below... This happens when I pass it to record in the database Array ( [arquivo] => Array ( [name] =>…
-
-4
votes1
answer47
viewsUse PHP PDO for search
Where is the error in my code. I do not know why it does not return the search result. <?php require_once('db_connect.php'); $conectar = new…
-
-4
votes1
answer49
viewsPagination losing the data
I am developing a page that has paging. However, when I click on a page number I get the error: Notice: Undefined index: tipo_consulta in C: xampp htdocs controle_gastos tipoconsulta.php on line 37…
-
-4
votes1
answer32
viewsSort array in PHP by key value (With fields with integer values)
I have a multidimensional array of type echo "<pre>"; print_r($order_info); exit(); Array ( [0] => Array ( [order_product_id] => 3227 [seller_id] => 27 ) [1] => Array (…
-
-4
votes3
answers131
viewsMake a request on the server with 2 parameters
Well, I’m making a person use a "range" and decide a value, as soon as the person modifies the range, a search is being done in the database about a game and its value, use ajax with php for this,…
-
-4
votes2
answers561
viewsPHP/ HTML zip code search
What is missing for this code bring the result of the zip code ? <!DOCTYPE html> <!--<! -- Trazer Resultados CEP, Rua, Bairro e Estado --> <html lang="pt-br"> <!-- Declaração…
-
-4
votes1
answer463
viewsHow to delete content from TXT file using PHP?
I am doing a php web project to monitor the network assets in my work I have a file named 'log.txt' at the root of my project which is fed with log information with date, time, ip etc. Line by line.…
-
-4
votes1
answer69
viewsHow to insert at the same time without giving duplicate key error?
<section class="content"> <div class="row"> <div class="col-md-12"> <div class="box box-primary"> <!-- form start --> <form role="form"…
-
-4
votes1
answer42
viewsTechnical help. Grouping websites and improving traffic
I have a somewhat technical question, where I don’t have the science to know which decision to make, so I come to ask for help in the decision. Is she: I have several systems, each with its own…
-
-4
votes1
answer187
viewsHow to insert HTML using PHP in indented form
I created a PHP file that when executed CREATES an html file already with an html code inside it. Later this PHP file that is being executed TAKES this HTML file and inserts another html code in a…
-
-4
votes1
answer1258
viewsProblem generating PDF with mPDF in hosting
The following is, I installed mPDF via Composer to develop the localhost project (on the PC). Everything works normally on the machine. I uploaded the VENDOR folder to the hosting, but it’s not…
-
-4
votes1
answer73
viewsError index, help me please
I tried everything, I don’t know why you’re making a mistake, PLEASE HELP ME THE MISTAKE IS: ( ! ) Notice: Undefined index: usuario_id in C: wamp64 www full table excluirAdminUserDoador.php on line…
-
-4
votes1
answer50
viewsUse function to compare value and mark radio buttom
I need to create a function to compare value and mark radio buttom. $checklistIni = unserialize($row_rsRegistros['checklistIni']); $a = join(',', array_values($checklistIni)); function…
-
-4
votes1
answer38
viewsClosing PHP tag appearing on the page
I’m using file .php but when I try to access the site it appears ?> at the top of the page and I’ve checked, has no tag without closing or something like that. <?php session_start();…
phpasked 6 years, 4 months ago user154343 1 -
-4
votes1
answer381
viewsPass PHP variable value inside while loop for javascript
I have a variable inside a code php with a while loop and need to modify this variable $codigo inside the javascript. This variable $codigo receives a different number for each repeat loop…
-
-4
votes1
answer183
viewsforeach HTML table
I am trying again to create a table with the entered data using $_SESSION <?php session_start() ?> <!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="UTF-8">…
-
-4
votes2
answers1628
views$. ajax -> I’m lost with this error "Uncaught Referenceerror: $ is not defined"
Honestly, I started a little while ago in this area, and I’m lost, I can’t understand why this mistake continues. This is my HTML <!DOCTYPE html> <html lang="pt-br"> <head>…
-
-4
votes1
answer149
viewsView photo registered in the bank
I want to display a photo registered in the database that was registered in a type blob attribute. However I do not want to display the photo through a link where you click and open the photo, on…
-
-4
votes1
answer385
viewsFatal error: Uncaught Error: Call to a Member Function bind_param() on Boolean in C: xampp Stack trace: #0 {main} thrown in C
<?php include("conecta.php"); $id = 0; $nome = $_POST['nome']; $cpf = $_POST['cpf']; $pis = $_POST['pis']; $dataCadastroPIS = $_POST['dataCadastroPIS']; …
-
-4
votes1
answer95
viewsWhat is the correct way to insert a necessary data into a constructor in PHP?
How should I place the parameters inside the constructor’s parentheses? I tried as follows as seen in videos but has the following error: OBS.: I am using the terminal, I am using the file…
-
-4
votes2
answers696
viewsHow to upload the contents of a variable to the backend using javascript fetch?
I can’t replace ajax with fetch I’m taking all libraries out of my code, and I’m trying to make the most of the resources pure javascript offers, like fetch. However, I am not able to make a request…
php javascript ajax fetch internal-server-errorasked 5 years, 7 months ago Matheus Ricardo Brunelli 1 -
-4
votes1
answer42
viewsphp code if does not run only Else
<form method="GET"> salário: <input type="number" name="salario"> <br> tempo de serviço (em meses): <input type="number" name="tds"> <br> n° reclamações:…
-
-4
votes2
answers43
viewsPossibility to search in one or more columns of the same SQL table
I have a splint where several products are displayed. On the left side, there are several options for the person to make filters in the product list. I am trying to create a form if the variable has…
-
-4
votes1
answer279
viewsLogin and password system check date [PHP]
Good night! I am working on a PHP project, and I came across a barrier, right at the end of my system: It’s pretty simple even, it works like this: 1- ADMIN registers user, password and assigns an…
phpasked 5 years, 4 months ago Lucas Copatti 1 -
-4
votes1
answer25
viewsread files pdf on browser
someone could help me with a problem, how can I get a link from a pdf file and open it in the browser itself using php note: the varialvel $file = 'article.pdf' comes from the database. <ul…
phpasked 5 years, 2 months ago Mateus Gomes 1 -
-4
votes2
answers52
views -
-4
votes1
answer44
viewsAdd inputs if it is filled with a certain value
I have a registration screen that has 30 inputs and in it I will report values from 0 to 99 and I have another Total input. I need that, when certain quantities of inputs are filled in, the Quantity…
-
-4
votes1
answer31
viewsPhp and Javascript - Pass javascript array to Php function on the same page
good afternoon, I have an html with some checkbox: <input type="checkbox" name="item" value="UM" onclick="verificaChecks()">1 <input type="checkbox" name="item" value="DOIS"…
-
-4
votes1
answer68
viewsSyntax errors, Unexpected end of file on Laravel
I am getting this error in my code at the end of the file, I could not find the error in the code: Syntax errors, Unexpected end of file. Here is my code from the web.php file that is giving the…