Jump to content

Recommended Posts

I'm trying but haven't succeeded in my script below. It checks for a specific date and displays an appropriate cursor. If the date isn't found, it defaults to the cursor of the month. Everything's currently in the root folder so I can see the paths clearly.




index.php



<style>

body {cursor: url("cursor.php"), auto;}

</style>





cursor.php



<?php
$date = date("m,d");
$monthly = date('m');

if($date == "04,06"){
     echo("moustache.ani");
}
elseif($date == "12,25"){
     echo("christmas.ani");
}
else{
switch ($monthly) {
case '04': echo '<"balancing.ani">'; break;
}
}
?>


 

Link to comment
https://forums.phpfreaks.com/topic/287572-date-with-cursor/
Share on other sites

I was hoping it would so I wouldn't have to modify much being that the css is already included on every page.

It actually works if you put the cursor's url attribute in the actual page.

I was wondering why the source code was coming out a little fonky.

Thanks

Btw, I was at another php forum that was clueless

Edited by busker
Link to comment
https://forums.phpfreaks.com/topic/287572-date-with-cursor/#findComment-1475214
Share on other sites

You can reference a PHP file in the css file, but rather than have that script output the name of the cursor you want to use, you need to have it output the actual cursor content with appropriate headers. Figure out what the proper mime type is for the cursor files and output a Content-type header for it, then output the cursor file contents using readfile.

Link to comment
https://forums.phpfreaks.com/topic/287572-date-with-cursor/#findComment-1475344
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.