Search found 214 matches

by Michalio
Wed Aug 17, 2022 12:08 pm
Forum: CSS
Topic: Image, wrapping text around it and auto hight on div..
Replies: 2
Views: 26

Re: Image, wrapping text around it and auto hight on div..

Do you want to hide the additional text in each tile and show it when you hover the tile?
by Michalio
Wed Aug 17, 2022 1:42 am
Forum: HTML Basics
Topic: <div> Full 100% width
Replies: 2
Views: 34

Re: <div> Full 100% width

the margin:auto may add some space on the right, use developers tools (each browser have good tool for that) to check the element padding/margin and its parents. You can also install Firefox Developer Edition to have advanced developer tools
by Michalio
Wed Aug 17, 2022 1:39 am
Forum: PHP coding => General
Topic: PHP Post problem
Replies: 1
Views: 41

Re: PHP Post problem

Can you share the code on the github?
by Michalio
Mon Aug 15, 2022 10:07 pm
Forum: CSS
Topic: CSS background-image-size etc
Replies: 2
Views: 37

Re: CSS background-image-size etc

you can use background-* on div, but you may have problem with the height: 100%. To set that, you will need to use flexbox or position absolute/fixed
by Michalio
Mon Aug 15, 2022 12:52 am
Forum: HTML Basics
Topic: Open a PDF file in a HTML document.
Replies: 5
Views: 352

Re: Open a PDF file in a HTML document.

Pdf.js can display the pdf, and you can embed it on the page as you want. It is described on the Step 2

If you want to use the converter that you found you need to use their API:
https://developers.convertio.co/api/docs/
by Michalio
Fri Aug 12, 2022 10:45 pm
Forum: PHP General
Topic: php 5 to php 7.4
Replies: 1
Views: 61

Re: php 5 to php 7.4

It should be

Code: Select all

$String .= $CharList[rand(0, $Max)];
by Michalio
Thu Aug 11, 2022 11:29 pm
Forum: PHP coding => General
Topic: Error on different lines.
Replies: 4
Views: 167

Re: Error on different lines.

I will show you on an example: 1. set the type of properties and a method parameters <?php class EntryPoint { private string $route; public function __construct(string $route) { $this->route = $route; $this->checkUrl(); } then you will assign only string 3. do not use include or require function <?p...
by Michalio
Thu Aug 11, 2022 10:30 pm
Forum: PHP coding => General
Topic: What is this __DIR__
Replies: 2
Views: 47

Re: What is this __DIR__

This is a magic constant, that mean you cannot change its value, but the value can be different depends where it is used (some magic constants have different value in the few lines bellow).
You can check all of the magic constants here: https://www.php.net/manual/en/language.constants.magic.php
by Michalio
Tue Aug 09, 2022 2:49 am
Forum: PHP coding => General
Topic: Error on different lines.
Replies: 4
Views: 167

Re: Error on different lines.

First of all try care more about the formatting, the code will be more readable and easily to debug. Do you have plugin for php in the vscode? It should show you places where exactly are issues. Let's describe all issues: Line 38: the equals char is missing Line 39: the equals char is missing Line 5...
by Michalio
Sun Aug 07, 2022 10:53 pm
Forum: PHP coding => General
Topic: PDO Error Check
Replies: 2
Views: 60

Re: PDO Error Check

Add at the top of the file: <?php error_reporting(NULL); ini_set('display_errors', 0); it will hide all errors, but you will able to check them on the error log. You can upgrade that a little bit: <?php if ($_ENV['SERVER_ENVIRONMENT'] === 'production') { error_reporting(NULL); ini_set('display_error...
by Michalio
Sun Aug 07, 2022 10:43 pm
Forum: PHP coding => General
Topic: store some data in server memory to be used between scripts and sessions?
Replies: 3
Views: 56

Re: store some data in server memory to be used between scripts and sessions?

ACPu is supported by php8, the old module for acp-bc was removed in php8
by Michalio
Sun Aug 07, 2022 1:11 pm
Forum: PHP Installation
Topic: No https wrapper gets loaded
Replies: 1
Views: 132

Re: No https wrapper gets loaded

What the error log said? Maybe the openssl extension file not exists or have different name so it can not be loaded
by Michalio
Sun Aug 07, 2022 1:09 pm
Forum: PHP coding => General
Topic: store some data in server memory to be used between scripts and sessions?
Replies: 3
Views: 56

Re: store some data in server memory to be used between scripts and sessions?

It may be difficult to do that only in php, you can try to use other software to archive that, for example: 1. You can use a redis service 2. You can try to use sqlite with the file located in memory (if I remember it on linux it is on the /dev/shm) 3. You can write your own in-memory database using...
by Michalio
Sun Aug 07, 2022 12:40 pm
Forum: PHP coding => General
Topic: $_GET
Replies: 1
Views: 47

Re: $_GET

This is a variable, not function, use:

Code: Select all

$_GET['name']
To learn very basic things very quickly check this: https://quickref.me/php
by Michalio
Fri Aug 05, 2022 12:32 am
Forum: PHP coding => General
Topic: Space before and after period...
Replies: 2
Views: 79

Re: Space before and after period...

For make the code more clean I can suggest to add space before and after the dots, when you concating the strings. But the code can be without space, with space, even with new line before or after, that code looks weird but it will works: include __DIR__ . ' /../Templates/' . $templateFileName ;
by Michalio
Fri Aug 05, 2022 12:28 am
Forum: PHP coding => General
Topic: The meaning of a controller.
Replies: 1
Views: 51

Re: The meaning of a controller.

Not exactly, controller exists in many architectures like MVC, but generally the controller is a dedicated class that handle requests from the user and using other classes (like services, repositories, validators, etc), for example: namespace App\Something\Controller; use Something...; public class ...
by Michalio
Mon Aug 01, 2022 11:15 pm
Forum: CSS
Topic: Three divs on one line inside another div 100% width
Replies: 2
Views: 175

Re: Three divs on one line inside another div 100% width

Use flex <div class="parent"> <div class="full-width">1</div> <div>2</div> <div>3</div> </div> .parent{ display: flex; } .parent .full-width{ flex-grow: 1; } You can read a great guide to flex here: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
by Michalio
Mon Aug 01, 2022 6:14 am
Forum: PHP coding => General
Topic: How to get saved data from option select?
Replies: 1
Views: 105

Re: How to get saved data from option select?

you need to generate something like this: <option value="1">category 1</option> <option value="2" selected>category 2</option> so you need to iterate your array to render each element and put the right value in attribute and the label in the <option> body. Then you need to add a ...
by Michalio
Mon Aug 01, 2022 6:06 am
Forum: PHP coding => General
Topic: Php to convert excel to pdf
Replies: 3
Views: 172

Re: Php to convert excel to pdf

is wamp 3.2.3 using php 5.3? this version is very old and you should not use it.
can you show you php code that you tested? can you attach also the logs?
by Michalio
Sat Jul 30, 2022 11:53 am
Forum: PHP coding => General
Topic: Need code to not only see one # href site, but how to show more than one.
Replies: 1
Views: 59

Re: Need code to not only see one # href site, but how to show more than one.

You can create an array with all websites with the name and url pattern where will be a place for token.
Then you can iterate by the array and show all or only selected (by parameter in the url or something) website
by Michalio
Sat Jul 30, 2022 10:56 am
Forum: PHP coding => General
Topic: Include header, main, footer
Replies: 6
Views: 122

Re: Include header, main, footer

The old school was when the whole html was in the page for example for login page and when you want to make small change then you should edit many files, because the code was repeated in many places. That was very bad architecture. Then someone invented the DRY (Don't Repeat Yourself) pattern, to ex...
by Michalio
Sat Jul 30, 2022 10:27 am
Forum: PHP coding => General
Topic: Unable to copy row from one database to another on same server
Replies: 1
Views: 58

Re: Unable to copy row from one database to another on same server

Add

Code: Select all

echo $sql;
to check the sql query is valid and use parameter binding:
https://www.php.net/manual/en/mysqli-stmt.bind-param.php
by Michalio
Sat Jul 30, 2022 3:54 am
Forum: PHP coding => General
Topic: Include header, main, footer
Replies: 6
Views: 122

Re: Include header, main, footer

The simples way to implement the way that I mentioned is create the function in te file that is included: function renderPage(string $pageHtml, string $template = 'main') { // This file contains the html <head> ony that is used for each pages, you can put there any data from session or other global ...
by Michalio
Sat Jul 30, 2022 3:37 am
Forum: PHP coding => General
Topic: create a file tree from a zip file
Replies: 4
Views: 81

Re: create a file tree from a zip file

So you just want to print the tree, it will be easy. First you should iterate by each file $file=nameofzip.zip'; $zip = new ZipArchive; $zip ->open($file); for( $i = 0; $i < $zip->numFiles; $i++ ){ $stat = $zip->statIndex( $i ); Then you can print the file path, but it will not be a tree echo $stat[...
by Michalio
Fri Jul 29, 2022 12:54 pm
Forum: PHP coding => General
Topic: create a file tree from a zip file
Replies: 4
Views: 81

Re: create a file tree from a zip file

You need to iterate by each file in the zip as you did, but you need to create a tree from the $stat['name'].
Hoe the tree should look like? For example the file dir1/dir2/file.txt shoule be in $tree['dir1']['dir2']['file.txt']?