I want to open a fancybox automatically when I enter the website and the value read on the txt file is "1"
The content of fancybox it will be a iframe to another page (alert.php)
To read the value of txt I have this
<?php
$line = file('alert.txt');
$valrec= $line[0]; //if "1" the fancybox appear
?>
I have difficulties using what I have read.
Already Seen
Complementing previous answers, you could do :
<?php
$line = file('alert.txt');
$valrec = $line[0]; //if "1" the fancybox appear
if($valrec == 1){
?>
<script type="text/javascript">
jQuery(document).ready(function($){
$.fancybox({
href: "alert.php",
type: "iframe"
});
}); //ready
</script>
<?php
}; // closes if
?>