Categories
PHP

php-mailparse composer not loading on server

I have an Ubuntu php7.0 server and I am trying to use a php Mailparse script I found here However I confirmed that composer is installed on the server and mailparse is also on the server. However the below script returns a 500 error and I tracked it down to the top two lines of […]

Categories
PHP

PHP Fatal error: Call to a member function fetch_assoc() on boolean [duplicate]

This question already has an answer here: mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource 33 answers if(isset($_POST[‘checkLogin’])) { $Email = $_POST[’email’]; $Password = hash(‘sha256’, $_POST[‘password’]); $Status = 0; $stmt = $con->prepare(“SELECT * FROM users WHERE Email = ? AND Password = ? LIMIT 1”); if(!$stmt->bind_param(‘ss’, $Email, $Password)) { echo 3; } $stmt->execute(); $result = […]

Categories
PHP

Code Igniter does not recognize my base-url when I call a controller

My app recognizes main page index.php (that calls a controller which name is Home and shows this Home page, as expected). Although when I call a topic in the menu (which is also a controller), it fails with this error: HTTP Error 404.0 – Not Found http://alfa.teste:80/estrutura where http://alfa.teste/ is the base url and ‘estrutura’ […]

Categories
PHP

Laravel Query for 2 tables Join

When i run any php command it gives me this error PHP Warning: PHP Startup: Unable to load dynamic library ‘mysqli’ (tried: /usr/lib/php/20170718/mysqli (/usr/lib/php/20170718/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqli.so (/usr/lib/php/20170718/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0 Ubuntu 16 os PHP 7.0 showing in phpinfo php 7.2 showing […]

Categories
PHP

Time Based IP Block with MySQL PHP

I am using ajax to store votes and currently trying to give every IP Adresse that has already voted a Block for 18 hours. First I’m storing the IP and Time in the database but I can’t seem to figure out how I check if the IP is found in my array and then if […]

Categories
PHP

Typeahead.js — refresh data

I have managed to get this code to work for an application — http://twitter.github.io/typeahead.js/ but, the problem I have run into, is that I need to be able to re-load the data. I would rather not duplicate the code to do this, although it’s an option, it seems kind of silly. I have inserted some […]

Categories
PHP

rewrite javascript and php code in a different order to execute differently

var settings = TurnstileSettings(); var ts = new TurnstilePod_v2(); var d = ts.registerDiv(‘ride-tickets-choices’,new Date(<?php echo $year; ?>,<?php echo $month; ?>,<?php echo $day; ?>)<?php echo $additional_data; ?>); d.suppress.calendar = true; d.suppress.directions = true; d.notifications.tripConfirm = ‘Are you sure you would like to purchase tickets for |departureDate| with a |tripName|?’; d.setTripIds( [<?php echo $trip_ids; ?>] ); ts.initialize(); […]

Categories
PHP

how often I can send data to server

I am doing project in Android which requires to send data to the server continuously and store it in database.My question is that how often can i send data to the server. I am using hostinger basic plan. I want to know weather any other hosting site offers me more requests per second. Once i […]

Categories
PHP

Accessing elements of a deeply nested arrays PHP

I have a response coming from an API, which sends a nested array, I am looking an efficient way without using foreach which is very slow array:1 [▼ 0 => {#250 ▼ +”locationId”: 111 +”startTimeInterval”: 5 +”usePreferredTimes”: “No” +”locationHours”: array:1 [▶] +”serviceCategories”: array:1 [▼ 0 => {#253 ▼ +”serviceCategoryId”: 301 +”serviceCategoryName”: “Services” +”services”: array:1 [▼ […]

Categories
PHP

Are there better solutions than redirect header location?

At the moment i’m preventing a resubmit with a redirect header location. But I imagine that the page loads slower because it’s a waste of time to go to one place just to be redirected to another. It adds one extra step to the process. What other options do I have with PHP? Is there […]