Page 1 of 1

Increasing font size

Posted: Thu Aug 23, 2007 4:30 am
by BurnCK
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Could anyone tell me how to increase the font size in this code please :

Code: Select all

<?
error_reporting(0);
include "config.inc";
require "phpom_head.php";
$ip_list_exist = 

@fopen("ip_list.txt","r");
        if ($ip_list_exist)
        {
$mydate = date("D d M Y - h : i a",time());
#echo "<b><center><font size=2>".$mydate."</font></center></b>";
echo "<body 

bgcolor=".$bgcolo.">";$img=$myback_colort=$bgcolo;
#include "pom.html";
echo "<table 

width=400 border=1 cellspacing=0 cellpadding=0 align='center'> <tr><td><i><b>";

$sc1="</b></td><td><i><b>";
		$ip_list=file("ip_list.txt");
               for ($i=0; 

$i<count($ip_list);$i++){
$ip_address=split("\t",$ip_list[$i]);
$ip_services=split(",",$ip_address[1]);
	$services_num = count($ip_services)-1;
	for 

($j=0;$j<$services_num; $j++){
	if ($ip_services[$j]=='--') { $img=$myback_colort;}
		

if ( !isset($img)) {
	$todo=fsockopen($ip_address[0],$ip_services[$j],$errno,$errstr,5);
		

if (!$todo) { 
			$img="#ff0000";$status="down";
if (isset($to)){ 

mail($to,$subject,$message,"From:$from\n$replyto\nX-Mailer:PHP/".phpversion()); }
		

} else {
			$img="00ff33"; $status="up";	
		};
}
if ($j==0){ 

echo "<tr><td><small>".$ip_address[2]."</small></td><td><small>". 

$ip_address[0]."</small></td>";}
echo "<td bgcolor=".$img." 

align=center><small>".$ip_services[$j]."</small></td>";
#echo "<td 

bgcolor=".$img."></a></td>";
unset($img);
}
}echo "</table>";
} else { print"The file ip_list.txt 

does not exist"; 
}
?>
</body>
I noticed '<font size=2>' within the code and tried changing it but nothing happened. It currently looks like this :-

Image

Thanks for any help ! :)


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Thu Aug 23, 2007 5:31 am
by aceconcepts
You haven't set the font-size of anything!

Try

Code: Select all

<span style=\"font-size:12px;\">" . $data . "</span>
or simply insert a backslash "\" before the quotes in your html font size.

Posted: Thu Aug 23, 2007 5:49 am
by BurnCK
Sorry, Im a complete noob.....Im not sure where Im meant to put the code you gave me.

Posted: Thu Aug 23, 2007 6:00 am
by Steve Mellor
For example:

remove

Code: Select all

<font size=2>".$mydate."</font>
and insert:

Code: Select all

<span style=\"font-size:12px;\">".$mydate."</span>
The font tag is a bit out of date now. You might want to have a look at a few CSS tutorials. It seams daunting when you first start but it will totally alter the way you think about constructing websites.

Posted: Thu Aug 23, 2007 7:53 am
by aceconcepts
Whenever you echo html elements you must place a \ backslash before the " double-quotes. Otherwise you'll just end up reading the data and not the formatting.

Like Steve said, CSS will totally change the way you approach web design/development.