UGN Security Forums
My ProfileMember DirectoryLogin
Search our ForumsView our FAQView our Site Rules
View our CalendarView our Active TopicsGo to our Main Page

UGN Security Store
 

Network Sites UGN Security, The GoNix Initiative, Elite Web Gamers, Back of the Web, EveryDay Helper, VNC Web Design & Development
December
Su M Tu W Th F Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Sponsored Links
Latest Postings
Latest Reviews
Topic Options
Rate This Topic
#18215 - 03/06/03 02:52 AM How would i change the font color in this php script?
Rapture Offline
Member

Registered: 04/23/02
Posts: 212
Loc: Redwood
Code:
 <?
    $delim = "\n";
    $quotefile = "quotes.txt";
    // okay, let's get going. 
    $fp = fopen($quotefile, "r");
    $contents = fread($fp, filesize($quotefile)); 
    $quote_arr = explode($delim,$contents); 
    fclose($fp); 
    // initiate randomness
    srand((double)microtime()*1000000); 
    // generate random quote index 
    $quote_index = (rand(1, sizeof($quote_arr)) - 1); 
    // get quote at $quote_index and return it 
    $herequote = $quote_arr[$quote_index]; 
    echo $herequote; 
?> 
 

Top
Sponsored Links
      
#18216 - 03/06/03 04:48 AM Re: How would i change the font color in this php script?
Gremelin Offline

Community Owner
*****

Registered: 02/28/02
Posts: 7193
Loc: Portland, OR; USA
Code:
echo <font>$herequote</font>;
I think lol... I'm probably wrong, but I THINK thats where you put it...
_________________________
Donate to UGN Security here.
UGN Security, Back of the Web, Elite Web Gamers & VNC Web Design Owner

Top
#18217 - 03/06/03 09:33 AM Re: How would i change the font color in this php script?
SilentRage Offline
DollarDNS Owner

Registered: 03/04/02
Posts: 1273
Loc: OH, USA
I agree with gizmo although I might have to remind you the obvious - which gizmo left out. Put quotes around it like so:

echo "$herequote";
_________________________
Domain Registration, Hosting, Management
http://www.dollardns.net

Top
#18218 - 03/06/03 10:56 AM Re: How would i change the font color in this php script?
Gremelin Offline

Community Owner
*****

Registered: 02/28/02
Posts: 7193
Loc: Portland, OR; USA
thought that went without sayin?
_________________________
Donate to UGN Security here.
UGN Security, Back of the Web, Elite Web Gamers & VNC Web Design Owner

Top
#18219 - 03/06/03 03:27 PM Re: How would i change the font color in this php script?
SilentRage Offline
DollarDNS Owner

Registered: 03/04/02
Posts: 1273
Loc: OH, USA
that's what I just said. Just reminding him of the obvious, which is why you left it out. He just seemed rather newbie to PHP so I told him.
_________________________
Domain Registration, Hosting, Management
http://www.dollardns.net

Top
#18220 - 03/06/03 03:36 PM Re: How would i change the font color in this php script?
Gremelin Offline

Community Owner
*****

Registered: 02/28/02
Posts: 7193
Loc: Portland, OR; USA
I wa sjust too lazy to sit and list shit he should ahve known :x...
_________________________
Donate to UGN Security here.
UGN Security, Back of the Web, Elite Web Gamers & VNC Web Design Owner

Top
#18221 - 03/06/03 04:06 PM Re: How would i change the font color in this php script?
Rapture Offline
Member

Registered: 04/23/02
Posts: 212
Loc: Redwood
actually when i tried that before i got a parse error on that line. I gave up trying to do it INSIDE the php script so i just broke out of php and used html

Code:
<center><b><i><font color="#ffffff">
<?
    $delim = "\n";
    $quotefile = "quotes.txt";
    // okay, let's get going. 
    $fp = fopen($quotefile, "r");
    $contents = fread($fp, filesize($quotefile)); 
    $quote_arr = explode($delim,$contents); 
    fclose($fp); 
    // initiate randomness
    srand((double)microtime()*1000000); 
    // generate random quote index 
    $quote_index = (rand(1, sizeof($quote_arr)) - 1); 
    // get quote at $quote_index and return it 
    $herequote = $quote_arr[$quote_index]; 
    echo $herequote; 
?>
</center></b></i></font>
I was thinking WAY to hard on this one the other night. I shoulda realized it was something easy like that.

Top
#18222 - 03/07/03 02:58 AM Re: How would i change the font color in this php script?
§intå× Offline


*****

Registered: 12/03/02
Posts: 3255
Loc: Maryland
did you escape the quote's? let me show you

Code:
<?

    $delim = "\n";
    $quotefile = "quotes.txt";
    // okay, let's get going.
     $fp = fopen($quotefile, "r");
    $contents = fread($fp, filesize($quotefile));
     $quote_arr = explode($delim,$contents);
     fclose($fp);
     // initiate randomness    srand((double)microtime()*1000000);
     // generate random quote index
     $quote_index = (rand(1, sizeof($quote_arr)) - 1);
     // get quote at $quote_index and return it
     $herequote = $quote_arr[$quote_index];
     echo "<font color=\"FFFFFF\">$herequote</font">;
 ?>
If you do not put the \ before the " inside an echo statement you wil get a parse error. the \ escapes the quotes and treats it as just plain ole text.
_________________________
My New site OpenEyes

Top

Moderator:  §intå×, Gremelin 
Featured Member
Registered: 02/28/02
Posts: 7193
Forum Stats
2152 Members
46 Forums
36290 Topics
71460 Posts

Max Online: 1567 @ 04/25/10 05:20 AM
Top Posters
UGN Security 29451
Gremelin 7193
§intå× 3255
SilentRage 1273
Ice 1146
pergesu 1136
Infinite 1041
jonconley 955
Girlie 908
unreal 860
Newest Members
cdefgh368568, HushHush, golqm, Tim050, Gecko666
2151 Registered Users
Who's Online
0 registered (), 261 Guests and 308 Spiders online.
Key: Admin, Global Mod, Mod
Latest News


Donate
  Get Firefox!
Get FireFox!