Hi im new to stackoverflow and php I have made a custom external css everytime when I try to change the color of something it doesn’t update but if I got on another device it is there half of the time. Why is it doing this?
I also have undefined variable $seconddata
if someone can help
$first = '<a class="info">Test</a>'
$secondData = '<a>info</a>'
echo $first;
echo $seconddata;
>Solution :
Since you said that other devices get the update and not your pc it is safe to assume your browser is caching your files, if you are in chrome you can open developer tools, hold down on the refresh button next to the url bar and then press Empty Cache and Hard Reload.
Alternatively what you can do to bypass caching in html is add a parameter to your css url and change it each time you want to release a css update or automatically change it with a php variable that changes each time you load the page, example below.
<link type="text/css" rel="stylesheet" href="yourcss.css?<?php echo date('h:i:s'); ?>" />
As for the undefined variable $seconddata, it is because you are defining $secondData with a capital D and you are trying to call it with a lower case d. Use this code below.
$first = '<a class="info">Test</a>'
$secondData = '<a>info</a>'
echo $first;
echo $secondData;