Bypassing browser cached documents.
Heisenberg - Digital Alchemist, Software Architect, Automation Specialist and Mechanical Engineer.
Labels
Sunday, 29 October 2023
foce browser to get the latest version of a document and to not use cache.
Wednesday, 30 August 2023
HTML mouse over hover text
The following examples should work;
<td title="Look at me" >Hover Over me</td><p title="Look at me" >Hover Over me</p> // We can also use php in there, like the below; <td title="<?= get_message_text($row['MESSAGE_NO']) ?>"><?= $row['MESSAGE_NO'] ?></td> Friday, 1 April 2022
How to echo a double space with PHP
When echoing text with PHP, if the string contains more than one space, the extra spaces are lost when rendered in the browser.
the following is a workaround;
str_replace(' ', ' ', $my_text);
This is especially important if we want to display values returned from a database query and the value has a double space for example and of course if that double space is important.
Tuesday, 21 September 2021
Detect screen size in php
Detecting the screen size in php, is not something that can be done with php alone but the following is what I use to kind of get around it.
Saturday, 17 April 2021
HTML date picker
<input type="date" id="start" name="trip-start"
value="2018-07-22"
min="2018-01-01" max="2018-12-31">
Tuesday, 3 November 2020
HTML Semantic Elements
HTML Semantic Elements
Thursday, 30 April 2020
Change text in an HTML document and passing php variable to javascript.
If we were using php to echo the html then unfortunately, once the echo is done, the html is created so to speak and it's no longer possible to change or update it.
But, we can use javascript, as per the example below, where the 1st line could be high up on the page and would display old text and once the script below runs, this old text would be changed to new text.
This can of course be done by embedding php echo statements to include variables, which is also a way of passing a variable from php to javascript.
<p align="left" id="id1">old text</p>
<script>
document.getElementById("id1").innerHTML = "new text";
</script>
OR
<script>
document.getElementById("dt").innerHTML = "<?php echo $someVar ?>";
</script>
Tuesday, 28 April 2020
basic web page redirect or reload
The following is a basic web page redirect;
<html>
<head>
<meta HTTP-EQUIV="refresh" CONTENT="3; URL=index.html">
</head>
</html>
function reload_page()
{
window.location = window.location.href;
}
</script>