Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Change the colors with the include statement

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Change the colors with the include statement

Postby DanD » Sun Nov 03, 2002 5:42 am

This is kind of a noob question but in de search i couldn't
find the answer so i try it here..

When I include a textfile with the statement:

<?
include("textfile.txt");
?>

How can i change the color output of the textfile ?
I also want to change the normal font with another font.
DanD
New php-forum User
New php-forum User
 
Posts: 6
Joined: Sun Nov 03, 2002 5:37 am

Postby DoppyNL » Sun Nov 03, 2002 5:55 am

with php your building html-pages.

So simply insert some html-code before and after the include to taylor the page you want.

Greetz Daan
DoppyNL
 

Postby DanD » Sun Nov 03, 2002 6:26 am

I tried it before and it didn't work..

It works fine now... tnx
DanD
New php-forum User
New php-forum User
 
Posts: 6
Joined: Sun Nov 03, 2002 5:37 am

Postby DanD » Sun Nov 03, 2002 6:56 am

But i still cannot size the included text.
I now have added the following lines to include:

<font face='verdana' size='1'>
<?
include("online_list.txt")
?>
</font>


And these are the lines I want to include:

<table border='0' width='100%'>
<tr>
<td>
> <a href="http://www.notrelevant.nl/cgi-bin/board/ikonboard.cgi?act=Profile;CODE=03;MID=68-1017007908">Dj Wim</a><br>
</tr>
</td>
</table>


How can i change the size of the included text/table ?

and i cannot edit the included text.
DanD
New php-forum User
New php-forum User
 
Posts: 6
Joined: Sun Nov 03, 2002 5:37 am

Postby DoppyNL » Sun Nov 03, 2002 7:11 am

the <td> elements have their own style and will not be changed by html-tags outside the table.

The only thing you can do (I think, I could be wrong) is make a style-sheet that wich will change the looks of td-cells.

you can do that by placing this in the "head" of your html-page:
Code: Select all
<style type="text/css"><!-- td{font-size:9pt;font-family:Verdana} --></style.

change it to the options you want ofcourse.
This will change all td-cells on your page though.

Greetz Daan
DoppyNL
 

Postby DanD » Sun Nov 03, 2002 7:18 am

WOW,

that works fine... thanx a lot !!
DanD
New php-forum User
New php-forum User
 
Posts: 6
Joined: Sun Nov 03, 2002 5:37 am

Postby DanD » Sat Nov 09, 2002 9:11 am

Can you please help me again we another problem with the include
statement ?

I've got another text file which I include. the textfile looks like this:

320 text
300 text
290 text
200 text

when I include this text file with:

include ("download.txt");

the output looks like this:

320 text'300 text'290 text'200 text

and the output must be:

320 text
300 text
290 text
200 text


I've included it within a table but I think that doesn't matter.
You can take a look at the output at:

http://www.djresource.org

and scroll to the bottom
DanD
New php-forum User
New php-forum User
 
Posts: 6
Joined: Sun Nov 03, 2002 5:37 am

Postby Oleg Butuzov » Sat Nov 09, 2002 2:06 pm

By the first.

when are you include a file, php include it like a php-script... so all that between <? ?> is PHP, all other is HTML.
ifyou will creat and run html file with this content you will uderstod me...
---Content---
320 text
300 text
290 text
200 text
---Content---

What you can do?

You can create for including files with such content

320 text <br>
300 text <br>
290 text <br>
200 text <br>

or
<pre>
320 text
300 text
290 text
200 text


But!

you can use file function...
http://www.php.net/file - is manual...

Code: Select all
$content=file("data.txt");
$lines=count($content);
for ($i=0; $i < $lines; $i++)
{
echo "$content[$i]";
}
]
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.