I have this file ‘gardens.php’, which pulls data from a table called ‘generalinfo’ and I use fopen to send that data to a file called ‘index.html’. Here is the issue, only one option is filled. I have a demo running here Garden Demo <– this is a new updated page an…
Tag: php
How to sort files by date in PHP
I currently have a script which allows me to output the list of files inside the same directory. The output shows the names, and then I used filemtime() function to show the date when the file was modified. How will I sort the output to show the latest modified file? This is what I have for now: Answer You ne…
How can I encrypt a cookie value?
How can I encrypt, and later decrypt, a cookie value in PHP? How secure will the encryption be? Answer I can not simply think of a situation where encrypting data in the cookie is useful. If you want to retain secret data about the user or his preferences, information, whatever, then store it on the server in…
Loading HTML dynamically using JavaScript and PHP
I have the following code: Some html… Other html…
Help Reading Binary Image Data from SQL Server into PHP
I cannot seem to figure out a way to read binary data from SQL server into PHP. I am working on a project where I need to be able to store the image directly in the SQL table, not on the file system. Currently, I have been using a query like this one: INSERT INTO myTable(Document) SELECT * FROM OPENROWSET(BUL…
Invalid argument supplied for foreach()
It often happens to me to handle data that can be either an array or a null variable and to feed some foreach with these data. When you feed a foreach with data that are not an array, you get a warning: Warning: Invalid argument supplied for foreach() in […] Assuming it’s not possible to refactor …
How can we re-use the deleted id from any MySQL-DB table?
How can we re-use the deleted id from any MySQL-DB table? If I want to rollback the deleted ID , can we do it anyhow?
PHP & MySQL Pagination
I have a MySQL query I want to paginate 10 results per page. How Can I do it? Answer Here is a nice starting point:
imagecreatefrompng() Makes a black background instead of transparent?
I make thumbnails using PHP and GD library but my code turn png transparency into a solid black color, Is there a solution to improve my code? this is my php thumbnail maker code: Thank you Answer After imagecreatetruecolor():
What is the “->” PHP operator called? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Closed 4 years ago. Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. What do you call this arrow looking …