What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Printing to a webpage from a .txt file via php

Printing to a webpage from a .txt file via php
Author: Message:
banky
Senior Member
****

Avatar
Fwee

Posts: 546
Reputation: 19
34 / Male / –
Joined: May 2004
O.P. Printing to a webpage from a .txt file via php
What I want to do is basically have a page that has fields that say like

[ ] Option 1
[ ] Option 2
[ ] Option 3
Etc...

And when the person select's the option(s) then hits the submit button it'll run the php script and on the next page it would print the option's they picked from the uploaded txt files... So say they picked

Options 1 and clicked submit... Assuming Option 1 is associated with option1.txt it would then print what ever text is in option1.txt into the next page...

So far I have this

code:
<?php

DEFINE('SCRIPT_DIR', $_SERVER['DOCUMENT_ROOT'].'/cscripts/');

$option1 = file(SCRIPT_DIR.'option1.txt');
$option2   = file(SCRIPT_DIR.'option2.txt');
$option3   = file(SCRIPT_DIR.'option3.txt');

?>


This only defines variables to use when printing such as

code:
<?php
print "$option1";
?>



Which should print out what's in option1.txt but on a page i have using

code:
<?php

DEFINE('SCRIPT_DIR', $_SERVER['DOCUMENT_ROOT'].'/cscripts/');

$option1 = file(SCRIPT_DIR.'option1.txt');
$option2   = file(SCRIPT_DIR.'option2.txt');
$option3   = file(SCRIPT_DIR.'option3.txt');

?>
<?php
print "$option1";
?>


Prints out array instead of what's in the txt file.; \

This post was edited on 09-11-2007 at 02:24 AM by banky.
09-11-2007 02:20 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Printing to a webpage from a .txt file via php - by banky on 09-11-2007 at 02:20 AM
RE: Printing to a webpage from a .txt file via php - by ShawnZ on 09-11-2007 at 02:24 AM
RE: Printing to a webpage from a .txt file via php - by banky on 09-11-2007 at 02:27 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On