HardwareHeaven.com
Looking for the skin chooser?
 
 
  • Home

  • Reviews

  • Articles

  • News

  • Tools

  • GamingHeaven

  • Forums

  • Network

 

Go Back   HardwareHeaven.com > Forums > Software / Tools > Programming, Coding, (Web)Design


Programming, Coding, (Web)Design Discuss all your programming or design needs with likeminded people.

Reply
 
Thread Tools
Old Aug 6, 2003, 07:11 AM   #1
BANNED
 
Join Date: Jul 2002
Location: Indiana , USA
Posts: 2,677
Rep Power: 0
Sourcer_2002 is on a distinguished road

help for a LAN .... i need some html help

Ok im making an interal web for a LAN, its used as a file sever and tourney registration, will its comeing along really well. But i cant find a way to get the name that user put as there nick to go to txt file....basicly i need something that it is simple where users can put there nick / sn and it will be sent to a txt file that the name is added to.

Any help would be apricated ... cuz im stumped.

Also is there a why to make a web page or code that will take or read data from a .txt file and display it?\

TIA

Last edited by Sourcer_2002; Aug 7, 2003 at 04:32 AM.
Sourcer_2002 is offline   Reply With Quote


Old Aug 6, 2003, 08:35 AM   #2
BSD SMASH!
 
Malus's Avatar
 
Join Date: May 2002
Location: A rabbit hole. . .
Posts: 1,170
Rep Power: 0
Malus is on a distinguished road

You'll definitely need something like PHP or Perl to be able to do that. I'm assuming you have an Apache or IIS server set up?
__________________
quad (FreeBSD/amd64 8-CURRENT): Intel Q6600 - Asus P5E-VM HDMI - 2x2 GB Kingston PC6400 DDR2 Ram - Seagate 320GB 7200RPM HD - 2xSeagate 1TB 7200RPM HD in RAID 1 via ZFS - Lite-On 20x DVD Multi Recorder - Coolermaster Centurion 5

router (FreeBSD/amd64 8-CURRENT):
Intel E4500 - Intel D945GCNL - 2 GB PC6400 Mushkin Ram - Lite-On 48x24x48x16 - Seagate 320GB 7200RPM HD - Silverstone SST-SG02-F

wanderer (FreeBSD/i386 7-CURRENT): Lenovo Thinkpad T61p

mini (OS X 10.5): Intel Core 2 Duo @ 1.8Ghz, 4 GB Mushkin PC5400 Ram -
Headroom MicroDAC

Portable sound: Rockboxed iPod Video -> Westone UM2's
Not-So-Portable Sound: Headroon MicroDAC -> Singlepower PPX3-SLAM -> Grado RS-1's or Beyerdynamic DT-880's
Very-Not-Portable-Sound: Squeezebox v3 -> Denon AVR-1507 -> B&W 683's & Sunfire HRS-10
Malus is offline   Reply With Quote
Old Aug 6, 2003, 11:22 PM Threadstarter Thread Starter   #3
BANNED
 
Join Date: Jul 2002
Location: Indiana , USA
Posts: 2,677
Rep Power: 0
Sourcer_2002 is on a distinguished road

apache is what im useing, and ill simplfiy what i want done .. i want a user to be able to put there name in a text box and submit it, i would like that submited name to be saved in a txt or database ( the same txt file that other names are in, so i want to add its name not overwrite ) and then have a page that can "read" what is in the file or database and display it....or to just have the sumbited name go to a webpage...
Sourcer_2002 is offline   Reply With Quote
Old Aug 6, 2003, 11:59 PM Threadstarter Thread Starter   #4
BANNED
 
Join Date: Jul 2002
Location: Indiana , USA
Posts: 2,677
Rep Power: 0
Sourcer_2002 is on a distinguished road

is there a way to do it dreamwaver? Or php that writes to a mysql database?
Sourcer_2002 is offline   Reply With Quote
Old Aug 7, 2003, 12:37 AM Threadstarter Thread Starter   #5
BANNED
 
Join Date: Jul 2002
Location: Indiana , USA
Posts: 2,677
Rep Power: 0
Sourcer_2002 is on a distinguished road

help me please!!!
Sourcer_2002 is offline   Reply With Quote
Old Aug 7, 2003, 04:33 AM Threadstarter Thread Starter   #6
BANNED
 
Join Date: Jul 2002
Location: Indiana , USA
Posts: 2,677
Rep Power: 0
Sourcer_2002 is on a distinguished road

I dont feel like im explaing this right here is another go...
Ok i want a simple a field where a user can enter his name and it will be saved in a database or txt file...

EXAMPLE

i enter my name here on page register.htm: Sourcer
it is saved in registered.txt without overwriting the old enterys
then its displayed on results.htm

the simpler the easier as this for a lan and i dont need anything bad...also i would like to adapt this for a 12 man team Battlefield registration...some software that could do this that is made for lans would nice also....any help would grateful

Thanks in advance!

Sourcer

also sorry if this in the wrong area i wasnt sure where to put it.
Sourcer_2002 is offline   Reply With Quote
Old Aug 7, 2003, 06:29 AM   #7
BSD SMASH!
 
Malus's Avatar
 
Join Date: May 2002
Location: A rabbit hole. . .
Posts: 1,170
Rep Power: 0
Malus is on a distinguished road

http://www.php.net/

All the answers lie there.

To display a textfile, you would use an include like this:

Code:
<?php include ("file url goes here"); ?>
in your html. To make the list editable, you'll have to add a form to your page and have it run another php function.
__________________
quad (FreeBSD/amd64 8-CURRENT): Intel Q6600 - Asus P5E-VM HDMI - 2x2 GB Kingston PC6400 DDR2 Ram - Seagate 320GB 7200RPM HD - 2xSeagate 1TB 7200RPM HD in RAID 1 via ZFS - Lite-On 20x DVD Multi Recorder - Coolermaster Centurion 5

router (FreeBSD/amd64 8-CURRENT):
Intel E4500 - Intel D945GCNL - 2 GB PC6400 Mushkin Ram - Lite-On 48x24x48x16 - Seagate 320GB 7200RPM HD - Silverstone SST-SG02-F

wanderer (FreeBSD/i386 7-CURRENT): Lenovo Thinkpad T61p

mini (OS X 10.5): Intel Core 2 Duo @ 1.8Ghz, 4 GB Mushkin PC5400 Ram -
Headroom MicroDAC

Portable sound: Rockboxed iPod Video -> Westone UM2's
Not-So-Portable Sound: Headroon MicroDAC -> Singlepower PPX3-SLAM -> Grado RS-1's or Beyerdynamic DT-880's
Very-Not-Portable-Sound: Squeezebox v3 -> Denon AVR-1507 -> B&W 683's & Sunfire HRS-10
Malus is offline   Reply With Quote
Old Aug 7, 2003, 06:31 AM Threadstarter Thread Starter   #8
BANNED
 
Join Date: Jul 2002
Location: Indiana , USA
Posts: 2,677
Rep Power: 0
Sourcer_2002 is on a distinguished road

thanks man...so i can have the form save a txt file and that php function will display it?
Sourcer_2002 is offline   Reply With Quote
Old Aug 7, 2003, 08:28 AM   #9
Unbiased.
 
Join Date: Jun 2002
Posts: 4,812
Rep Power: 0
ToshiroOC is on a distinguished road

Post the HTML and I'll edit some PHP in to do what you want it to do.
__________________
[img][/img]
[color=White]Peace be with you, Joe.[/color]
Driverheaven Staff Member (Supermoderator)
ToshiroOC is offline   Reply With Quote
Old Aug 7, 2003, 06:49 PM Threadstarter Thread Starter   #10
BANNED
 
Join Date: Jul 2002
Location: Indiana , USA
Posts: 2,677
Rep Power: 0
Sourcer_2002 is on a distinguished road

well if you could just make a blank page with a form feild to sumbmit a name and have it save to a file and then be displayed on another page would be great....i can do the rest.
Sourcer_2002 is offline   Reply With Quote
Old Aug 8, 2003, 12:12 AM   #11
Unbiased.
 
Join Date: Jun 2002
Posts: 4,812
Rep Power: 0
ToshiroOC is on a distinguished road

Here's some code I'm ripping out of something else I've already written. Just copy it into a file named list.php and run it on apache after installing PHP, and it should work fine.

EDIT: It's not working perfectly, so once I have apache and php downloaded onto this computer I'll fix it up.

EDIT: Updated, now dynamically changes # of textboxes...

Code:
<?php
$names = unserialize(file_get_contents('names.list'));
if (isset($_POST['newdata']) && $_POST['newdata'] && ($_POST['password'] == 'pwd')) //change pwd to any password you want
{
     while (list ($ltp, $ltpv) = each ($_POST) )
          $names[$ltp] = (string)$ltpv;
     $fp = fopen('names.list', 'w');
     fwrite( $fp , serialize($names));
     fclose( $fp );
}
?>

<html>
<head>
<title>Name List</title>
</head>
<body>
<form method="post" action="list.php">
<?php
$limit = 5;
for ($i = 1;; $i++)
{
if ($i >= $limit)
{ 
break;
}
$namenum = 'name'.$i;
if ($names[$namenum])
{ 
$nameval = $names[$namenum];
}
else
{
$nameval = '';
}
$textbox = '<input type="text" name="name'.$i.'" value="'.$nameval.'" /><br />';
echo $textbox;
$spareboxes = 3; //change 3 to any number of extra empty text boxes you want
if ( (($limit - $i) <= $spareboxes) && ($names[$namenum]) )
{
$limit++;
}
}
?>
<br />Password to update:<br />
<input type="password" name="password" /><br />
<input type="submit" name="submit" value="Submit" />
<input type="hidden" name="newdata" value="1" />
</form>
</body>
</html>
Note: I haven't tested it yet, since I'm not at home at the moment. I'll try and get it tested in a few minutes.
__________________
[img][/img]
[color=White]Peace be with you, Joe.[/color]
Driverheaven Staff Member (Supermoderator)

Last edited by ToshiroOC; Aug 8, 2003 at 02:28 AM.
ToshiroOC is offline   Reply With Quote
Reply

Bookmarks

Thread Tools