|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
PHP question
Alright, so I've got my radio show's site up right now. (It's http://www.billfredinthenighttime.com if you're interested.)
I'm trying to come up with a way to send up an alert (displaying an image) that I'm on the air at that time without having to dive into the HTML. My host supports PHP (in fact, that's how I got the nifty random image at the top going), but I honestly don't know a thing about it. So, can someone point me to a way to do that? Or even better, point me to a way to learn to do that? |
|
#2
|
||||
|
||||
|
Re: PHP question
I learned PHP by reading the documentation (www.php.net), but I'm not sure if that's the best way for you to find what you're looking for. I can't say I've ever had to do something like that, but perhaps you could run a few search strings in Google, and find something? Anything I can think of at the moment is needlessly complicated for what you're looking for.
Or, you could ask our benevolant forum overload (Brandon for short), because the forums have that little "LED" that turns green if a user has logged on. Perhaps you can get some code from that (or he can help write some code from that)? Last edited by Ian W. : 13-10-2004 at 00:06. |
|
#3
|
||||
|
||||
|
Re: PHP question
I got my first taste of PHP at www.w3schools.com
Then I later bought a book. I run my own forums and so forth, I'm guessing that the LED thing works by basically: when the user logs on, set a value in the SQL database to "on", so when you call a page which display's the username, it will show the online image (which is the green LED). When the user logs off, the opposite happens and you see a red LED. May sound confusing... I can't think of any better way to put it. And I could be very very very wrong. Also, you're still going to need to use some HTML when writting your own PHP scripts. Maybe you can try googling for a script that does what you want? |
|
#4
|
|||||
|
|||||
|
Re: PHP question
Alrighty..
First off, you're going to need to change the extention of index.html to index.php (Be sure to update any links you have on your site to index.html )Next, because we want to keep this as simple as possible, create a file in same directory where index.php is located and call it status.txt You'll need to be sure that this file is writeable by the webserver. (That means to change it's mode to 644 or 664 or 666, one of those should work. You can change the file's mode in your ftp client.) Next, create the file status.php and paste this as its contents: PHP Code:
Next, insert the php code below in the spot in your index.php file where you want to display your status. For example: PHP Code:
This isn't the most graceful way of updateing your status, but it's pretty quick and very functional. If ya have any questions, ask and someone should be able to help ![]() Jack PS: If you would rather have your status change automatically depending on the date/time, you could have that instead. |
|
#5
|
|||||
|
|||||
|
Re: PHP question
That's perfect!
(And I think I'll just keep it so I can flip it manually. I substitute fairly often for other shows, so I'm not always on when I think I will or won't be.) Leave it to Chief Delphi to have all the 1337 (but graciously professional) h4x0rz. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| openFIRST PHP 5 Compatibility | Timothy D. Ginn | FIRST-related Organizations | 0 | 30-07-2004 13:45 |
| PHP and Wiki Error | Venkatesh | Website Design/Showcase | 2 | 24-07-2004 15:51 |
| PHP Question | Joshua May | Website Design/Showcase | 9 | 11-06-2004 20:50 |
| PHP Question | Raven_Writer | Website Design/Showcase | 2 | 22-05-2004 18:42 |
| What's better, PERL/cgi or PHP/my_sql? | mikefrei | Programming | 10 | 27-05-2002 22:50 |