GetDotted Domains

Viewing Thread:
"PHP Help"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Fri 16/05/03 at 16:03
Regular
Posts: 787
I'm fiddling about with my site at the moment and I want to be able to get a few little things working using PHP.

All I want is a basic script that allows information that is submitted through a text box to appear on the site.

When I say basic I mean basic as in monkey_man's old chat scripts he used to have on his site.

Anybody know of any basic tutorials that could explain how to do this?

I've got a feint idea of what to do, just not how to do it!

Thanks.
Sat 24/05/03 at 21:41
Regular
"Chavez, just hush.."
Posts: 11,080
I've given up and gone for the function!

It's easier and doesn't look too bad.

Just as long as there aren't like 5000 scorers in one match!
Sat 24/05/03 at 21:17
Regular
"Chavez, just hush.."
Posts: 11,080
Still stuck but I've managed to make it look very pretty in the process.

I ~might~ be able to get this to work if I try hard enough...

If I do succeed I'll post.
Sat 24/05/03 at 20:55
Regular
"Chavez, just hush.."
Posts: 11,080
I'm confused.

How would I go by getting the data into a table?

That piece of code prints the data, but only from one text file.

If I wanted to print the data from all 6 files into the page, where would I put the scripts?

If I put them within tags it still puts all the data within the first column when I have that php code there...

I'm stuck, again.
Thu 22/05/03 at 19:28
Regular
"It goes so quickly"
Posts: 4,083
Good luck with that.

Oh, and you'll need to include the \t when writting to the file first off ... but I guess you knew that.
Thu 22/05/03 at 19:27
Regular
"Chavez, just hush.."
Posts: 11,080
Thanks for that.

I'll have a little test of it tomorrow.

At the moment though, I've gotta finish my Geography report that's in for tomorrow!

And revise for the exam.

Grrrr.
Thu 22/05/03 at 19:24
Regular
"It goes so quickly"
Posts: 4,083
Maybe have a \t (a TAB) between each bit of data per line.

When you call each line for reading and printing, use the explode function to split each bit of data into an array, so you can place each bit in its own cell, and each complete line of data in its own row.

It'll mean if anything is to large for the cell, and moves to the next line, the rest of the table will adjust and keep it all in line.

So, for each line you read from the file, use something like this:










$File = "rightframe.txt";
if (file_exists($File)) {
$fp = fopen($File, "r");
flock($fp, 1); # Lock the File.

while (! feof($fp)) {
$Line = fgets($fp, 1024);
$SingleData = explode("\t", $Line);
print " \n";
print " \n";
print " \n";
print " \n";
print " \n";
print " \n";
print " \n";
print " \n";
}

flock($fp, 3); # Release the File Lock.
fclose($fp);
} else {
print "

Can't include the text, file doesn't exist or
can't be opened.

\n";
}
?>
Date Comp. Venue Opposition Score Scorers
$SingleData[0]$SingleData[1]$SingleData[2]$SingleData[3]$SingleData[4]$SingleData[5]


Note: You won't need to include the Width for each cell, as this will be set when you first use the width in the first row.

Again, I wrote that without the ability to test it, but hopefully you'll be able to spot any common mistakes and correct them.
Wed 21/05/03 at 22:20
Regular
"Chavez, just hush.."
Posts: 11,080
Damn. I thought I was going good until I had a slight problem.

I was using the stuff I'd found to make a nice little football site for my Dads' club and what I did was to allow the details of each match to be inputted via a form and then updated on a page.

Each piece of information was stored to a new line of a file like date.txt and to display the results I just called up the results from within a table so each cell has the details of each file.

When it works the data will all be lined up nicely with each match being correctly put into the row but if for example there is too much for a cell to hold in one row and it starts another, that cell will all become out of line with the others.

http://members.lycos.co.uk/phi11ip/firstteam.php

As you can see there, the opposition team is too big for the cell and has started a new line within it. Thus throwing it out of line with the other data.

I've got two options here that I can do.

I can either set the table to grow outwards with more data so that the page would appear as being very wide. Not sure on how to do that but I can easily find out.

Or

Is there some other way in which I can get each numbered item in the txt file to be displayed in it's own row on a table?

I've got a feint idea of what I can do, I just can't get my head around it.

Could you just give me a few ideas please as to how I might manage this?

Thanks
Mon 19/05/03 at 14:51
Regular
"It goes so quickly"
Posts: 4,083
Looks good.

Glad it works :)
Sun 18/05/03 at 23:04
Regular
"Chavez, just hush.."
Posts: 11,080
www.phi11ip.com/mainpage.php

There we go. All finished.

One page down, 15 more to go!
Sun 18/05/03 at 21:56
Regular
"Chavez, just hush.."
Posts: 11,080
Drumroll...

~rumble~

Wohoo!

Thanks!

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Excellent
Excellent communication, polite and courteous staff - I was dealt with professionally. 10/10
Best Provider
The best provider I know of, never a problem, recommend highly
Paul

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.