Categories
PHP

how can i make a PHP that shows on a limited number of views

I’m looking for a code that runs a php code in a different time of views, example i have this code <?php echo “Hello world!”; ?> now all i need to do is how to make this code open only to 100 or 200 first unique users ? and others just make them see blank […]

Categories
PHP

Exclamation mark difference

What is the difference between using an exclamation mark before a variable in a if statement and inside an equal sign? before a variable: if(!$a == $b) { //do something } inside an equal sign: if($a != $b) { //do something } notice that in one example it is !$a and in the other example […]

Categories
PHP

Return the date to be more readable in PHP

I would like to convert a date like this 2018-06-30 to something more readable like Vendredi 29 Juin 2018. So this is what I use: $date = ‘2018-06-29’; $jour = array(“Dimanche”,”Lundi”,”Mardi”,”Mercredi”,”Jeudi”,”Vendredi”,”Samedi”); $mois = array(“”,”Janvier”,”Février”,”Mars”,”Avril”,”Mai”,”Juin”,”Juillet”,”Août”,”Septembre”,”Octobre”,”Novembre”,”Décembre”); echo $jour[date(“w”)].” “.date(“d”).” “.$mois[date(“n”)].” “.date(“Y”); But it returns me the current actual date. What I missing here please ? Thanks. I […]

Categories
PHP

Submit Contact Form Default Text In Text Box

Building a contact form. I have required input fields Your Name, E-mail and phone. Person has to enter information in these fields or else they will get error message. My fourth field is a message text box. In that field using placeholder= I have a default message I am interested in: “get_the_title (of the post)”. […]

Categories
PHP

Line Chart – Set data to the existing current point label in Line-chart

So I have a line-chart diagram that consists of four lines with data, on the xAxes I have a set of dates that is from the current date up to 180 days back that I’ve set dynamically with JavaScript. What I really have to do is take the certain data from the database which I’m […]

Categories
PHP

update.php not returning errors, but no updates to database

I have checked similar questions to this on here and tried some solutions, but I cannot get it to work. I am newer to php and cannot figure out what the problem is since no errors are returned. It has be be a simple error, but I cannot find it. Here is my update.php and […]

Categories
PHP

Coinwarz API returns broken JSON

Using Coinwarz great API for getting coin difficulties for some time. Lately, couldn’t parse the returned JSON anymore. I notified their support. API call: https://www.coinwarz.com/v1/api/profitability/?apikey=XXX&algo=all The issue: One of the values had a ‘NaN’, which prevented json_decode to parse the code.

Categories
PHP

Getting a script to fetch Facebook video links on android browsers

These coding for Facebook links are fetching errors on android browsers only. What might be missing in coding? Below is a text form of PHP and json file for the script /* * {lib_name; facebook} */ /** * Description of Facebook * * @hadit / / {source_info}{“name”:”Facebook.com”,”website”:”https://www.facebook.com/&#8221;}{end_source_info} */ class Facebook { function getMediaInfo($url) { $data […]

Categories
PHP

gRPC and XAMPP not working

For a project I want to test the new database from Firebase, Firestore with PHP. But before i can use it, I need a couple of tools. I am trying for a day now to get it work, but no success. I’m stuck on gRPC. I installed is, and it’s working on my Mac and […]

Categories
PHP

print_r() has been disabled for security reasons Using Codeigniter

I’m Using codeigniter 3.1.6 print_r() has been disabled for security reasons this type of error regenerated so how to fixed it.