beavis2k6 Posted June 3, 2006 Share Posted June 3, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/11123-submittion-and-retrieval/ Share on other sites More sharing options...
stephenk Posted June 4, 2006 Share Posted June 4, 2006 [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:[code]<a href='".$_POST['link']."'>".$_POST['name']."</a><br />[/code]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 Quote Link to comment https://forums.phpfreaks.com/topic/11123-submittion-and-retrieval/#findComment-41698 Share on other sites More sharing options...
poirot Posted June 4, 2006 Share Posted June 4, 2006 Basically:[code]$data = '<a href="' . $_POST['link'] . '">' . $_POST['name'] . '</a><br />';$file = f.open('file.htm', 'a+');f.write($file, $data);f.close($file):[/code](remove the dots from f.open, f.write, and f.close)Important note: The file must be properly CHMOD'ed Quote Link to comment https://forums.phpfreaks.com/topic/11123-submittion-and-retrieval/#findComment-41742 Share on other sites More sharing options...
beavis2k6 Posted June 11, 2006 Author Share Posted June 11, 2006 hmm thanks a lot guys...i should be able to get something sorted now =D Quote Link to comment https://forums.phpfreaks.com/topic/11123-submittion-and-retrieval/#findComment-44293 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.