Jump to content


Photo

submittion and retrieval


  • Please log in to reply
3 replies to this topic

#1 beavis2k6

beavis2k6
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 03 June 2006 - 11:08 PM

Hi guys and gals,

Ive been playing around with html for a few years now and know the very basics to put a page together. Recently i have also been playing around with PHP...such a handy tool.
Anyway, im looking for a way to make a text box, on a php page, where people can type in a link to a webpage, then when they press the submit button, it adds it to a text file or something similar (not MySQL).
Once its in this file i would like to know a way of viewing the text from it, in the body of another php page....ive tried several things but with my limited knowledge, have not come up with anything.

Thanks in advance,
Beavis

#2 stephenk

stephenk
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 04 June 2006 - 01:39 PM

[a href=\"http://www.totallyphp.co.uk/scripts/text_file_hit_counter.htm\" target=\"_blank\"]http://www.totallyphp.co.uk/scripts/text_f...hit_counter.htm[/a]

You should be able to make modifications to this script to help you. When writing to the file, you probably need to use:

<a href='".$_POST['link']."'>".$_POST['name']."</a><br />

Where the POST values are taken from the form. You need to name the textboxes 'link' and 'name' ans set the form action to the PHP file location.

Stephen

#3 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 04 June 2006 - 03:52 PM

Basically:

$data = '<a href="' . $_POST['link'] . '">' . $_POST['name'] . '</a><br />';

$file = f.open('file.htm', 'a+');
f.write($file, $data);
f.close($file):

(remove the dots from f.open, f.write, and f.close)
Important note: The file must be properly CHMOD'ed
~ D Kuang

#4 beavis2k6

beavis2k6
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 11 June 2006 - 03:11 PM

hmm thanks a lot guys...i should be able to get something sorted now =D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users