Posts by Juven_v • 2,619 points
158 posts
- 
		3 votes2 answers574 viewsA: How to consume JSON files in PHP in different ways?Actually the form of reading is similar to the first example you quoted. For example, when using json Decode I can access the array clients, products, etc. See an example applied to your situation.… 
- 
		1 votes2 answers954 viewsA: PHP failed to open stream when trying to include top folderSuppose the following folder hierarchy: raiz pasta1 arquivo1.php pasta2 arquivo2.php index.php If you’re inside the file arquivo1.php and want to make a require for the archive index.php Voce must… 
- 
		0 votes2 answers994 viewsA: PHP does not receive POST JsonYou have an almost functional example, except for two details (Object Freeze in javascript and use an empty variable in json_encode). Running the minimal example all runs as expected. See:… 
- 
		2 votes1 answer69 views
- 
		0 votes1 answer55 viewsA: Error picking up API dataThe value output passed as parameter in the url should not be js, it should be json. The json_decode function, as you used, will not interpret the result of your request as a valid json. Put in the… 
- 
		0 votes1 answer296 viewsA: Create event click to dynamic buttonI imagine the problem is using the . btndeleteitem class instead of the #btndeleteitem id. Fixing is: $("#tblitens").on("click", "#btndeleteitem", function(e) { alert("Teste!"); });… 
- 
		0 votes2 answers739 viewsA: Check if the user is active in the databaseAssuming you already have the active column created and the values are boolean 0 or 1, do so: //............. //Se o email não existir na base de dados gera um alerta if (count($users) <= 0):… 
- 
		0 votes3 answers1157 viewsA: Get value from dynamically created fieldsYou can use the selector :jquery input to return all input tags inside the episodeField element. I added a button and an event to manipulate the action of capturing the values and serializing,… 
- 
		2 votes1 answer446 viewsA: SELECT always returns the last recordExactly the expected behavior is happening. To get the dynamic selection, either you make an ajax request to each selection of an option of your select (to be done a specific search by id), or you… 
- 
		0 votes1 answer109 viewsA: Error When Listing Object Data in PHPYou do not have a valid json code, tested with jslint. You can test with the function echo json_last_error_msg (), it should return syntax error. Test like this: $data =… 
- 
		0 votes2 answers514 viewsA: How do I do a javascript updating form data?I suppose (without testing everything) that the problem is in the javascript function. You should not use json_encode in this situation (it will simply put a string on the variable in question).… 
- 
		6 votes5 answers1493 viewsA: How to create a function to validate time in PHPThere is a mistake in the call of the validateHoras function, it is passing the parameter but does not return anything after the execution. The variable you print is the same one you pass as… 
- 
		0 votes1 answer1423 viewsA: Warning: mysqli_fetch_object() expects Parameter 1 to be mysqli_result, Boolean Given in /home/omeganim/public_html/index.php on line 39Usually this error happens when the query executed in the database shows some error. Soon after the execution of $conexao->query print the last error that happened in the database with… 
- 
		0 votes1 answer221 viewsA: Infinite Scroll with PHP arrayYou can load the entire array at once using ajax (maybe with jQuery), php (server) would return the json-encoded array, javascript would listen to the onscroll event to display the content in html.… 
- 
		0 votes2 answers593 viewsA: php-upload image and upload to databaseYour code works (with the observation that in my environment there was no execution of functions in javascript, because you did not put them). With the form you posted: Click on Upload image: File… 
- 
		0 votes1 answer32 viewsA: php/sql - phpmyadmin binary value show on web pageYou made a little mistake using the function base64_decode instead da base64_encode. The base64_encode function converts your image data into binary so that it can be interpreted with MYME Base64 by… 
- 
		0 votes1 answer136 viewsA: Phpmailer does not send hostedThe hosting (Hostinger) you are using blocks access to port 587 for free plan users. In any of the plans your code must work. 
- 
		0 votes1 answer549 viewsA: Request ajax does not return what I wantThe situation requires good debugging. Use the browser debug tools to see which errors the php page is returning. In the most famous browsers, right-click --> inspect element --> network tab.… 
- 
		1 votes1 answer441 viewsA: List data with Ajax and PHPI assume you are using jQuery. To put new content at the top of the table just use the function prepend (insert content at the beginning of an element). Something like this:… 
- 
		1 votes1 answer620 viewsA: Can’t find the php controller with LaravelAssuming the routes are correct and the naming of names is in accordance with the standards of the Laravel, the problem should be here: class Contato2Controller.php extends Controller { ... left a .… 
- 
		0 votes1 answer123 viewsA: Filter in CAKEPHP 2.0Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Entidadesendereco.Uf' in 'Where clause' When such an error occurs it is because the column in question does not exist in the specified… 
- 
		0 votes2 answers421 viewsA: Problem when mounting JSON with database returnThere’s a similar question in stackoverflow. To achieve the desired effect you can use some Orm (frameworks Aravel, cakephp, ... or something standalone like notorm). Using any of these will require… 
- 
		1 votes2 answers83 viewsA: When importing an xml file it comes blankWith the code snippets shown there is no error. Putting everything together in a file (except xml) and passing the right condition to the switch, everything works. See: <?php $condicao =… 
- 
		3 votes1 answer418 viewsA: Error Reading XML with namespace in PHPThere’s an answer in stackoverflow which provides a basis for solving your problem. The problem is that the simple load xml extension, cannot parse the namespaces present in your xml. This can be… 
- 
		0 votes1 answer216 viewsA: Select an ID of a radiobutton query and store it in a sessionOne possibility is to use an ajax request to send the id of the request that was clicked to the server. To avoid having to change many things in your code you can use the fetch api (available in… 
- 
		0 votes1 answer166 viewsA: How to clear the Foreign Keys field in SQLTo remove foreign key references you can do: ALTER TABLE nome_tabela DROP FOREIGN KEY nome_constraint; If you want to delete only the data (records) you can make a delete table in the user_store… 
- 
		2 votes1 answer335 viewsA: Render view through controller using Slim Framework 3I have already lost many hours with a similar error. The problem is in this excerpt: $app->get('/home', '\App\Http\Controller\Teste::main'); With the use of "::" you are calling a static method.… 
- 
		0 votes1 answer27 viewsA: Regarding the post in phpIt would be interesting to put a print of the ue appears when you run the file. But since I don’t know if the file name in the action exists, we can remove the action attribute, causing the browser… 
- 
		0 votes1 answer73 viewsA: Dynamic SELECT with second load errorBasically the change event is only triggered when the user interacts with the element. When javascript changes the values of select the change event is not triggered, then you must fire it manually.… 
- 
		1 votes1 answer372 viewsA: Function js works only onceBasically your <div id="tabela"></div> is removed with the $("#tabela").replaceWith(). Then after the first request there is no more element with table id. Switch to $("#tabela").html()… 
- 
		2 votes1 answer809 viewsA: Android: sending and receiving json with php and registering in the databaseAt first glance I suppose the code on the server is entering the if (isset($_POST) ) , but it is reading the data sent by the client in the wrong way. In the Android code all the data sent are… 
- 
		0 votes1 answer180 viewsA: Problem picking up data by ID in the API with SlimIn the get_people_id function, just remove the quotes from the id column. Type like this: $sql = "SELECT * FROM peoples WHERE id = '$people_id'"; As it comes to be returned an empty JSON means that… 
- 
		5 votes2 answers5829 viewsA: Error in connection with bank using PDOBasically this domain name is not accessible on the public network. If the code is hosted on Hostinger, just put it as localhost. Another alternative is to put the ip address of the mysql server… 
- 
		1 votes1 answer287 viewsA: Rest Web Service using Slim Framework, in PHP, always gives error when called by an Ajax method, although it runs?Go to your browser’s developer tools, in the Network section, see the response to the ajax request. There must be the reason of execution is giving error. If the data are recorded correctly, the… 
- 
		0 votes1 answer34 viewsA: Route with the character "."Back in the documentation There are some ways to do that. Some of them: /download/{file} Just one more thing, which error do you get? route not found? or just can’t read the extension?… 
- 
		0 votes1 answer284 viewsA: Slim Framework simplexml_load_string parser errorDude, I see you’re passing the xml and the slim parser is not getting it. I imagine the problem is here: data: { xml : xml} It is unlikely that the above code sends an xml as a string. Just try:… 
- 
		1 votes1 answer354 viewsA: Creating cakephp route 3The line $routes->resources('Usuarios'); will create all possible routes. A official documentation There are some examples of how you can limit that. Example of Cakephp documentation:… 
- 
		1 votes1 answer569 views
- 
		2 votes1 answer143 viewsA: How to compress a bzip2 file by PHPIn php.net you have examples of how to compress with the extension zip and bzip2. In the previous bzip2 link, the example compresses a string. Then you can read the file as string. Follow example… 
- 
		0 votes1 answer133 views
- 
		1 votes1 answer158 viewsA: Simultaneous access API RestDatabase managers are able to avoid multiple access. Of course it is possible that after a select an Insert of another query is made. To make it more reliable you can make a select transaction… 
- 
		0 votes2 answers1469 viewsA: Dynamically Update php Session with jQueryThere’s no way to guess. See what the load() request is returning. In your web browser go to inspect element, you will have a tab called network (network) in it Select the ajax requests and see what… 
- 
		2 votes1 answer461 viewsA: How to print cable with dynamic values in mpdf?Dude, when a doubt like that comes up go straight to documentation. The mpdf setHeader does not do what you want (iterate over a list of users and print a custom header for each). What you should do… 
- 
		0 votes3 answers558 viewsA: List Categories with Subcategories of the same table with another tableWhat you want can be achieved with the use of joins. Example: select * from manuais_categorias as m left join manuais_categorias as n on m.id = n.id_pai LEFT JOIN manuais_tecnicos on… 
- 
		1 votes2 answers177 viewsA: Friendly URL in an automated way with all pagesUse a library to route urls. Basically you define a url (without regard to the domain name: www.domain.com.br), and say what should be executed when a request is made with the declared signature:… 
- 
		0 votes2 answers2338 viewsA: pass parameter to another html pageI think that could be simpler. You just want to return data from the server, so just use the http GET method in the page request details by passing the vacancy id. Something more or less like this:… 
- 
		1 votes1 answer34 viewsA: Problems when saving imageFirst see if the variable $imagem has a valid upload file, using the function is_uploaded_file ( string $filename ) . class Image { public function save($image) { var_dump(is_uploaded_file… 
- 
		1 votes1 answer58 viewsA: SQL Select unique categories sorted by popularityThe suggestion of the Reginaldo Rigo comment is a good solution. Optionally you can remove the first sql query sql("SELECT DISTINCT id_categoria FROM relacao_categoria"); and make a Join Inner in… 
- 
		0 votes1 answer203 viewsA: Publish Facebook page SDK phpFrom what I can tell you’re not using the Facebook sdk autoload. Even solving the error described by you is unlikely to work. The only require_once you should do is the autoload.php file from the… 
- 
		1 votes1 answer133 viewsA: Form error, Page loading failedYou have an internal server error. Your code probably has syntax/logic/etc error. You can look at the server logs where the application is running to see what part the error is in. Or you can test…