I’m making an automatic football league generator and got stuck on schedule. I have an algorithm for generating everything, but not schedule. Take a look: For example: And now when i have got all that data I can just use few foreach() for taking what i need. But – the thing i want is to put teams …
file_put_contents: Failed to open stream, no such file or directory
I am trying to use dompdf to save a form to an easily-readable .pdf file, and my processing script is below. I am receiving the error Warning: file_put_contents(/files/grantapps/NAME0.pdf) [function….
bind_param Number of variables doesn’t match number of parameters in prepared statement
Here is a snippet from my code: When I echo out the values for $year and $make, I am seeing values, but when I run this script, I get a null value, and the following warning appears in my log file: PHP Warning: mysqli_stmt::bind_param(): Number of variables doesn’t match number of parameters in prepared…
Haversine formula with php
I want to use this formula with php. I have a database with some values of latitute and longitude saved. I want to find, with a certain value of latitude and longitude in input, all the distances (in km) from this point with each point in the database. To do this, I used the formula on googlemaps api: Of cour…
Fatal Error – Too many open files
I try to run PHPUnit Tests in my new machine and I get this error: PHP Fatal error: Uncaught exception ‘UnexpectedValueException’ with message ‘RecursiveDirectoryIterator::__construct(/usr/lib/php/pear/File/Iterator): failed to open dir: Too many open files’ in /usr/lib/php/pear/File/I…
How to specify the files to overwrite using linux cp command on PHP?
Is it possible to tell to linux cp command which files to overwrite via PHP? Basically, I have searched the conflicts between the source and the destination folders, asked the user what files to overwrite and put them on an array. Now I want to copy the files, overwriting only the files on the array. Answer C…
What is default life time of cookies in PHP? [closed]
If I have not set any life time in cookies then what is the default life time in cookie? for e.g setcookie(“cookiename”, $value);
Database design: implementing several types of the same entity
I’m coding a Classified Ads web application. The application has several types of Ads: General ads(electronics, toys, pets, books…) Real estate (houses, apartments, terrains…) Vehicles (motocycles, cars, vans, trucks…) Each type has several common fields (id, title, description) and al…
Spanish Characters not Displaying Correctly
I am getting the lovely � box where spanish characters should be displayed. (ie: ñ, á, etc). I have already made sure that my meta http-equiv is set to utf-8: I have also made sure that the page header is set for utf-8 also: Here is the beginning stages of my code thus far: The above code is in a
Get Specific Device Information
Using just PHP, is there anyway to detect if the page is being loaded from a SPECIFIC device? Say, I would want the page to react differently if only MY iPhone was loading the page, no one else’s? The only solution I have so far is to use $_SERVER[‘REMOTE_PORT’ in conjunction with $_SERVER[&…