| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Member | i am also in need of php help :( imjust bstarting to learn php, and i would like some help on appending a file using a form. e.g i have index.php in my browser and it has a text field on it i want whatever is in the text field to write to the file test.txt this is the current code i have (dont laugh plz, this is the second day ive tryed and learnt php (about the 3rd hour)) PHP Code: Inf
__________________ http://www.InfernalGFX.co.uk // Nearing Completion |
| |
| | #2 (permalink) |
| Senior Member | Take a look at the example in the manual: http://ph.php.net/manual/en/function.fopen.php Also try not to mix your PHP and Html. It's better to get into good habits earlier rather than later ![]() Lux PS: you've got the variable $txt but you're never writing anything to it...
__________________ 1 Cent Web Hosting @ Online HostGatorVoucher.com Adsense Hack for Vbulletin - Fully 3.6 Compatible ForexArea.com Free E-Course in Programming EA's |
| |
| | #3 (permalink) |
| NamePros Member | okay i know all of that on the link you gave me, its kinda not what i asked. can anyone else help me? theres a script called cutenews that uses this method. ive been looking at its php and i cant figure out how it works if nobody can help then nevermind thanks anywayInf
__________________ http://www.InfernalGFX.co.uk // Nearing Completion |
| |
| | #4 (permalink) |
| DNOA Member | PHP Code:
__________________ codeboards A high-quality community of programmers -- Join today and post! We want new members! |
| |
| | #5 (permalink) |
| Eating Pie | Next code you will need is the writing code. There are many different ways of doing this mind you. As well if this isn't private information txt file is fine if it is try finding another format such as .db or try adding none viewing into htaccess Anyways the code for the fwrite you can learn at http://www.php.net/fwrite This fwrite function is the function which writes to an opened file. Also make sure you chmod the file text.txt to 777. Best of luck. Please post when you finsh your project!
__________________ I feel old. |
| |
| | #6 (permalink) |
| NPQ's PA, Slave, and On Call Coder Technical Services | PHP Code:
__________________ |
| |
| | #7 (permalink) | |
| Eating Pie | Quote:
That may work but you should verify that the fields are actually there.. Here is a fixed version of your code. PHP Code: Wish you the best of luck.
__________________ I feel old. | |
| |
| | #8 (permalink) |
| NamePros Member | okay if my SEMI WORKING database does not work i will try using all of the versions you guys have posted, but i just coded this and it partially works. feel free to try it out, it appends files quite well i guess, needs tweaking though, thanks for the help guys PHP Code: EDIT:-----> okay i have done it, and it is currently under further development eventually ill have a full script for use with the templates i will be selling ![]() a sample of the script is...... http://www.infernalgfx.co.uk/tests/p...ffdb2/form.php just write something in the box and submit it, it then takes you to a screen confirming what you just wrote (this is the form that actually adds to the database). once you have wrote to that click this link: http://www.infernalgfx.co.uk/tests/p...ffdb2/test.txt and it shows what you just wrote (at the bottom and encoded in html(if you ctrl+a to select it all and paste it into dreamweaver or front page you will see it in a graphical view)) thanks ![]() Inf
__________________ http://www.InfernalGFX.co.uk // Nearing Completion Last edited by Infernal; 08-10-2005 at 07:05 PM. |
| |
| | #10 (permalink) |
| NamePros Regular | try using the the mode a+ when you assigning the file handler.
__________________ Live Support : Zubair11 [at] hotmail.com Free SEO Directory! || Free Games and Songs || eBloggy.net Zubair.info || Mixcat Interactive |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tutorial: Getting started with PHP (The Basics) | deadserious | Webmaster Tutorials | 60 | 11-17-2007 11:35 AM |
| Googlism - What does google think of you? | deadserious | The Break Room | 55 | 12-15-2005 09:09 AM |
| Beware of PHP! | PolurNET | The Break Room | 25 | 03-29-2005 03:04 PM |