Go to Post And Dave, although I know you have connections, please don't slow the earth's rotation to get more time on the caption contest. ;) - Billfred [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications > Website Design/Showcase
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-10-2004, 23:30
Billfred's Avatar
Billfred Billfred is offline
...and you can't! teach! that!
FRC #5402 (Iron Kings); no team (AndyMark)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: The Land of the Kokomese, IN
Posts: 8,533
Billfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond repute
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?
__________________
William "Billfred" Leverette - Gamecock/Jessica Boucher victim/Marketing & Sales Specialist at AndyMark

2004-2006: FRC 1293 (D5 Robotics) - Student, Mentor, Coach
2007-2009: FRC 1618 (Capital Robotics) - Mentor, Coach
2009-2013: FRC 2815 (Los Pollos Locos) - Mentor, Coach - Palmetto '09, Peachtree '11, Palmetto '11, Palmetto '12
2010: FRC 1398 (Keenan Robo-Raiders) - Mentor - Palmetto '10
2014-2016: FRC 4901 (Garnet Squadron) - Co-Founder and Head Bot Coach - Orlando '14, SCRIW '16
2017-: FRC 5402 (Iron Kings) - Mentor

94 events (more than will fit in a ChiefDelphi signature), 14 seasons, over 61,000 miles, and still on a mission from Bob.

Rule #1: Do not die. Rule #2: Be respectful. Rule #3: Be safe. Rule #4: Follow the handbook.
  #2   Spotlight this post!  
Unread 13-10-2004, 00:04
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
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)?
__________________
AIM --> Woloi
Email --> ian@woloschin.com

Last edited by Ian W. : 13-10-2004 at 00:06.
  #3   Spotlight this post!  
Unread 13-10-2004, 00:22
NoodleKnight's Avatar
NoodleKnight NoodleKnight is offline
24 Hours of LeMons?
FRC #0100 (WHS&CHS Robotics)
Team Role: Alumni
 
Join Date: Aug 2004
Rookie Year: 2003
Location: Davis, CA
Posts: 320
NoodleKnight has much to be proud ofNoodleKnight has much to be proud ofNoodleKnight has much to be proud ofNoodleKnight has much to be proud ofNoodleKnight has much to be proud ofNoodleKnight has much to be proud ofNoodleKnight has much to be proud ofNoodleKnight has much to be proud ofNoodleKnight has much to be proud of
Send a message via AIM to NoodleKnight
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?
__________________
WHS/CHS Robotics - Team 100 (2003-2006):
2006- Delphi's Driving Tommorow's Technology @ Davis | Imagery Award @ SVR | 2004- SVR Finalists (w/ 691 and 1280)| 2003- Delphi's Driving Tommorow's Technology @ Sac
  #4   Spotlight this post!  
Unread 13-10-2004, 00:52
Jack's Avatar
Jack Jack is offline
FIRST Scouting Network
AKA: Andrew Schenk
FRC #0201 (The FEDS)
Team Role: Alumni
 
Join Date: Feb 2002
Rookie Year: 2002
Location: Rochester Hills
Posts: 643
Jack is a jewel in the roughJack is a jewel in the roughJack is a jewel in the rough
Send a message via AIM to Jack
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:
<?php

$passwd 
'YOUR PASSWORD';  //Change this value!!

if (isset($_POST['submit']))
{
    if (
$_POST['passwd'] == $passwd)
    {
        
$fp fopen('status.txt''w');
        
fwrite($fp$_POST['status']);
        
fclose($fp);
    } else {
        echo 
'<b>Invalid Password!!</b><hr />';
    }
}

?>
<html>
<body>
<h3>Change Status</h3>
<form action="status.php" method="post">
Password:&nbsp;&nbsp;<input type="password" name="passwd" />
<br />
Status:&nbsp;&nbsp;
<select name="status">
    <option value="off" selected>Off</option>
    <option value="on">On</option>
</select>
<br />
<input type="submit" name="submit" value="Update Status" />
</form>
</body>
</html>
Change the YOUR_PASSWORD to what you would like the status updateing password to be. (Leave the ' ' around your password, but you don't enter them when you enter your password.) Whenever you want to change your on-air status, go to http://www.billfredinthenighttime.com/status.php, enter your password, pick the new status, and click update.

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:
..... <a href="aboutbillfred.html">about Billfred</a> | <a href="aboutbitn.html">about BitN</a> | <a href="oldnews.html">older news</a> | <a href="links.html">links</a> | <a href="downloads.html">downloads</a> | <a href="http://wusc.sc.edu">WUSC</a>
<br><br> <?php

$status 
trim(strtolower(file_get_contents('status.txt')));

switch (
$status)
{
    case 
'on':
        
?>
            PUT HTML FOR 'ON' HERE
        <?php
        
break;
    default:
        
?>
            PUT HTML FOR 'OFF' HERE
        <?php

}

?>..... Uhm, hi.<br><br>

If you're reading this, you've obviously found my website.  Sucker--erm, <i>lucky you!</i><br><br>
Change the PUT HTML FOR blah.. to whatever html you would like to display for your on or off status.

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.
__________________
Team 201 - 2003 Great Lakes Semifinalists & 2003 Archimedes Division Finalists :|: Webmaster of www.feds201.com -> FBI Scouting
Winner of The 2003 ChiefDelphi Web Award for: User That Started The Most Non Chit Chat Threads
Winner of: 2003 FIRST Ventures with 5451.68 End Points

All about me: http://knehcsa.vze.com
**Check out the New FIRST Scouting Network**
  #5   Spotlight this post!  
Unread 13-10-2004, 09:48
Billfred's Avatar
Billfred Billfred is offline
...and you can't! teach! that!
FRC #5402 (Iron Kings); no team (AndyMark)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: The Land of the Kokomese, IN
Posts: 8,533
Billfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond repute
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.
__________________
William "Billfred" Leverette - Gamecock/Jessica Boucher victim/Marketing & Sales Specialist at AndyMark

2004-2006: FRC 1293 (D5 Robotics) - Student, Mentor, Coach
2007-2009: FRC 1618 (Capital Robotics) - Mentor, Coach
2009-2013: FRC 2815 (Los Pollos Locos) - Mentor, Coach - Palmetto '09, Peachtree '11, Palmetto '11, Palmetto '12
2010: FRC 1398 (Keenan Robo-Raiders) - Mentor - Palmetto '10
2014-2016: FRC 4901 (Garnet Squadron) - Co-Founder and Head Bot Coach - Orlando '14, SCRIW '16
2017-: FRC 5402 (Iron Kings) - Mentor

94 events (more than will fit in a ChiefDelphi signature), 14 seasons, over 61,000 miles, and still on a mission from Bob.

Rule #1: Do not die. Rule #2: Be respectful. Rule #3: Be safe. Rule #4: Follow the handbook.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 23:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi