I Just Wrote A Script For A Php Text Editor!

free web hosting
Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

I Just Wrote A Script For A Php Text Editor!

coolcat50
Yes, I just wrote out a script for a PHP text editing program. It is very basic but I would like to be able to actually use this and update it. First, I need version 0.7 to be proofread. It will be upgraded to 0.8 after closed beta, 0.9 after open beta, 1.0 when ready.

I would love to have some people help with this project. Right now it is a simple PHP script and HTML form. Here is the current script. I would like it to be proofread.

CODE

<?php

$fileName = "$_REQUEST['name']";
$fHandle = fopen($fileName , 'w') or die("Can't write file.");
$fContent = "$_REQUEST['content']";
fwrite($fHandle , &fContent);
fclose($fHandle);
?>
<form method="post">
<input type="text" name="name" value="Filename" /><br />
<textarea cols="30" rows="50" name="content">
Text
</textarea>
</form>


Suggestions for this will be great and I would like to make this be a pretty big project. I think it can be cool and very useful for the travelling programmer or webmaster. Thank you.

P.S.: I would love to have assistants to help with updating it and testing and all of that. Thank you.

 

 

 


Reply

Stenno
Ouch, this will get you hacked easily. They create a file x.php and put this in it:

for example:
CODE
<?

$fHandle = fopen($fileName , 'r+');

while (!feof ($handle)) {
    $buffer = fgets($handle, 4096);
    echo $buffer;
}

?>


They just run their script after they created it and it gives them login info from your database and so on. It's very important to built in a safety check, so you can check their code first before they can run it. They could also create a injection bug on purpose in the script:

CODE
<?

$page = $_GET['page'];
include($page);

?>


Makes them able to include every file on your server, even files that aren't in that specific map. So watch out with it wink.gif Make sure only you can run the script, so for instance make a login for it.

 

 

 


Reply

coolcat50
This is for the public. I guess i could install a member login system. Could you help me out?


Wait, couldn't I just mod the script to only save as .txt files

Such as

CODE

<?php
$fileName="$_REQUEST['fname']" . ".txt";
$fHandle=fopen($fileName , 'w') or die("Can't write file.");
$fContent="$_REQUEST['content']";
fwrite($fHandle,$fContent);
fclose($fHandle);
?>

Reply

MotU2510
Making it a .txt file only would make it a LOT safer. Other than that it seems fine to me.

If you did add a member login then perhaps you could add the abilty to open and edit already existing files. That would be very useful for someone who needs the ability to store and edit files on the web. I'd recommend adding a maximum file length as well, you wouldn't want someone to make a ridiculously long file which uses up all your webhost space.

Reply

coolcat50
Yeah good point. Prob about 100kb on a 2.5gig host

Reply

pop
many scripts like your is availiable for download, so developing this is point less. you need to learn php much more. i download this script and i have it already, why wait for you to develop your script, and that is also bad code if what stenno said is true. learn php first, and you have time to develop project later.

Reply

coolcat50
Well, I do know PHP fairly well. Look at my card engine. So, don't be making generalizations like that. kk

Reply

MiniK
I don't understand what the script is or what it does. Could someone expand on "text editor", please?

Reply

Fate
QUOTE(MiniK @ Oct 21 2007, 12:44 AM) *
I don't understand what the script is or what it does. Could someone expand on "text editor", please?

Notice from jlhaslip:
*deleted acronym*

text editor: noun
A program used to.. edit text
Synonym: Notepad

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : wrote, script, php, text, editor

  1. Ad Text
    Setting up ads (2)
  2. Text Visualizer
    (0)
    look: http://wasteyourtimebot.com is a text visualizer with a robot, playing the piano. type in a
    text and you will see pictures relevant (or not) to your words... what do you think?....
  3. Seeking Help With Javascript
    Need help with drag and drop type script (1)
    What i want to make is a script that has a table, which is a menu for my site, and when you click
    the top of the table you can drag it to another place in the page. This is the code: Test
    run - Right click menu - ©Jack McCrea 2008 <script type="text/javascript"> function
    coordinates(event) { if (event.button==2) { var x=event.x; var y=event.y;
    document.getElementById("element").style.left=x; document.getElementById("element").style.top=y;
    document.getElementById("element").style.visibility="visible"; var oldx=x; var oldy=y; } }
    <script type="....
  4. Browser Compatibility Problem With Firefox - Javascript + Css
    Having trouble making a script work right - any suggestions? (3)
    Hi, Im working on a website, and im trying to make a right-click menu, which opens on right click,
    wherever the cursor is, and closes on mouse out. I wrote the code below, and when i ran it in IE it
    ran fine, just how i wanted it to work. However in firefox, the menu just opened in the top left. im
    presuming this is because it doesnt like my style changing in the javascript. Any ideas, and
    suggestions? If i cant make this work, i will just make it so it works slightly differently when
    viewev in firefox so that it can just open in one place. All ideas appreciated. ....
  5. An Ode To Gmail.
    A small text about how GMail is awesome. (5)
    Everyone wanted a piece of the e-mail pie. Microsoft made a free e-mail service. Yahoo! made a
    free e-mail service. AOL did so too. Each with their goods and bads, their limitations and
    restrictions. Until the savior came. Google decided to do the smart move and make a revolutionary
    kind of e-mail. Starting off with their beta program that made use of invitations, many people
    (including me) found the truly amazing experience and the easy to use interface of GMail it's
    key points to lead the e-mail game. GMail kept spreading like mad. Then, account creation we....
  6. Problem Getting Text To Align With Different Resolutions
    (4)
    Hey! I just like fiddling around with making websites, and I'm working on one at the moment.
    However, while I can the text box to align on the designated area on the background image on my
    monitor, I'm well aware that with other resolutions and web browsers, it doesn't. (I use
    Firefox) A buddy told me to looks up some CSS but I'm not very good with it at all. What do I
    need to do to get it to centre regardless of the screen resolution the viewer uses? The website is
    optimized for 1280x1024 resolution in Firefox.....
  7. Using Unknown Fonts For Text In Webpage
    (5)
    Example(Click) The concept behind this article came a few days ago when I was chatting in the
    shoutbox here. I was thinking about whether we could include fonts (.ttf) on server and with the
    help of some frameworks we could display text in browser. Unfortunately, after much chatting and
    pleasing google (it just didn't show any mercy that day), I finally understood its not possible.
    I actually wanted headings (h1, h2... you get it?) in a webpage to use a nice font which I have.
    The problem is visitors won't have that font installed in thier system. The secon....
  8. How To Make Php Newsletter Script
    (3)
    I have seen a post on here somewhere which shows how to make a simple newsletter php script. I
    cvant find it anywhere and I wanted to ask some questions of the author. Does anyone know the one I
    mean? Cheers ....
  9. New Text Based Tactic Online Game
    it better than the old ones. (0)
    try www.ikariam.org its amazing! the only text online game with images! it's not like
    the others where your upgrade is just a click, you'll have to wait for hours even days. This
    create oppurtunity for newcomers and balance for the old players. a must try for bored of surfing
    and such /laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" />....
  10. Php Guest Online Script
    (3)
    make an index.php copy and paste this code CODE <?php $db_host = "localhost";
    $db_user = "root"; $db_pass = ""; $db_name = "test";
    $dbc = mysql_connect($db_host, $db_user, $db_pass); $dbs =
    mysql_select_db($db_name); $tm = time(); $timeout = $tm -
    (30*60);
    if($_SERVER["REMOTE_ADDR"]){$ip=$_SERVER["REMOTE_ADDR
    "];} else{$ip=$_SERVER["HTTP_X_FORWARDED_FOR"];}....
  11. Story Time!
    A Story I Wrote in Sixth Grade (2)
    I called it Kureshi's Tale, and I submitted it in this writing contest in sixth grade. Looking
    back on it now, it is absolutely horrible. It was the longest thing I had ever written at the time,
    but since then I've participated in NaNoWriMo. What are your opinions? Part I: PROLOGUE
    Kureshi was born in the Birthing Cave, 12 falls ago, on November 10. The Birthing Cave was the most
    sacred place to be brought into the world through from Heaven. It was considered to be magical, to
    wish your newborn child good luck when they entered this world. Kureshi’s Paren....
  12. Text Editors Vs Word Processors
    (6)
    There are many differences between text editor and a word processor. One of those differences is
    that most text editors are universal in editing any text based documents, while word processors can
    only edit certain types of files like Open Office. So, because of that universal editing more text
    editors are very basic and so they carry few commands, such as copy and paste and being able to save
    the document. While word processors have hundreds of commands and come with many other features
    such as templates, thesaurus, spell checker etc etc. So with all those features....
  13. Phpizabi Social Network Script
    (1)
    Hello everyone not been on for AGES! we had net problems and i had to move to qupis and now
    I've got problems. I'm making a social networking site using this script and I cant get it
    to install Everytime I go to the install page i get this QUOTE Warning: session_start() :
    open_basedir restriction in effect. File(/home/kasiks1/tmp) is not within the allowed path(s):
    (/home/karlos:/usr/lib/php:/usr/local/lib/php:/tmp) in
    /home/karlos/public_html/phpazi/install/index.php on line 1 Fatal error: session_start() : Failed
    to initialize storage module: file....
  14. Guessing Php Script
    (2)
    I am looking for: freeware php quess the person in the photo game script....
  15. Text Based Rpg Game Maker
    (3)
    Well I need one, if you can help please do...I would like it so I can have people play online.....
  16. What Is The Best Free Html Editor?
    (19)
    im looking for any kind that is free really.... i use windows but if you have one for a different
    platfor, go ahead and add it for reference for other users. If you have one for normal text editor
    and wysiwyg, add them both. i have been using notepad as my normal html editor but im looking for
    something different... at least so i can see the different colors of the codes. Right now i am
    downloading moxilla's seamonkey suite but im not sure how good it is... i will post a review if
    i ever use one. If you have used the html editor you suggest or you just heard abou....
  17. Login Script For Vbulletin.
    (9)
    For some reason when I try to logon from the main page it doesnt work, it just brings me to the
    forums unlogged. Anyone here have any ideas whats wrong with my coding? Heres the webpage:
    www.ageofilluminati.com Heres the coding im Using: QUOTE
    Forgot password? Register for free! ....
  18. How To Use Command Prompt As A Text Editor
    (6)
    In this tutorial, I will show you how you can use Command Prompt to create text files. It is very
    simple and you can also use it to write output from a command into a text file. This can be
    particularly useful when you need documentation from a DOS program in a text file when you use the
    help command or something similar. In order to do this you simply use this DOS command. echo
    Text >> test.txt This will create a new text file called test and echo the contents into it. If
    we wanted to write a 2 line document, we could do something like: echo Hello >> test.txt e....
  19. Php Downloads Script
    (4)
    I've been looking all over the net for a PHP script which can provide an interface to browse a
    downloads database. The database could be powered by MySQL. If you know a script like this, please
    post it here. Thanks in advance, Ironchicken.....
  20. Loaing Script
    (3)
    hello, I'm looking for a preloader script for my site. like it will display an loading
    image while the site is loading and the once the page has loaded the image will disapear. i tryed
    searching for one on google but i could not find one, i think i searched for the worng thing. if
    some one knows how to make one or where i can find one that would be great. Thanks....
  21. What Program Do You Use To Design Your Web?
    Frontpage, Dreamweaver, a good text editor? (92)
    I personaly choose frontpage because its easy to use but.....I use dreamweaver for PHP.....
  22. Invite Script..
    (2)
    I didn't know where else to put it /sad.gif" style="vertical-align:middle" emoid=":("
    border="0" alt="sad.gif" /> If moderators find another forum more suitable plz move this one
    /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> I am looking
    for some sort of sript or program that let's people on your website invite friends. Like they
    put in their Emailadress and mails are send to everyone in their list.. I hope someone can help me
    /sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Greetzz....
  23. Background Image Swap Script
    Change a Background Image based on clock time (15)
    Background Image Changer Script To swap the background image from your CSS file according to the
    Server Clock Time. 1.) In your CSS file, add the following rule: CODE body {
        background: url(time.png); } 2.) Create a "folder" named time.png. 3.) Into the
    folder, place three images named morning.png, day.png, night.png. 4.) Also, in the same folder,
    create an index.php file and copy/paste the following script. CODE <?php $hour =
    date('H'); if ($hour < 12 ) {     $image =
    "morning.png"; } ....
  24. Qupis : Free Hosting With Php, Mysql, Cpanel. (one Line Text Ad At Bottom)
    a member of Xisto (41)
    Hello Members, We are proud to introduce a new member to Xisto group of sites.
    Qupis : Free Web Hosting 150 MB space, 5000 MB Bandwidth, php,
    mysql, CPanel (Latest). Emails, FTP, Addon domains, Parked Domains etc.
    http://www.Qupis.com
    Feel free to add your reviews and comments about it. -Trap17
    Management ....
  25. Watermark Your Image With Simple Php Script
    found it on the net (35)
    This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
    Scripts site. Just in case the site may not show, I will include the code here: List of things
    needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
    script below with name (i.e. watermark.php) CODE <?php // this script creates a watermarked
    image from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly
    transparent gif image with the watermark - goes in the same directory as this script // ....
  26. Dev-php
    php-editor (8)
    Dev-PHP is a free php-editor from sourceforge. Official site: http://devphp.sourceforge.net/ It
    is useful programme to edit php files with good GUI platform. Get it and try to use it!!
    /biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> Please give some
    comments on it after you have used it. /smile.gif' border='0' style='vertical-align:middle'
    alt='smile.gif' /> ....
  27. Delay X Seconds In Flash
    how to action script that (1)
    How do i have to do, to tell a frame to wait x seconds after it continues playing? In Macromedia
    Flash, of course... Like: CODE stop(); "wait  x seconds"; play();
    Thanks....
  28. Web Surfing- Script Needed
    (2)
    We all know of anonymouse web surfing, Sites like http://anonymouse.ws/cgi-bin/anon-www.cgi Offer
    peope to surf the internet anonymousely, The site has baners and ads showing up and does not support
    all links. Does anyone know what script they use or where i could get one from, What script do they
    use? Also if anyone jnows how to make my own? I really want this as a addon for my site, So all help
    would be appriciated. Thanks, Mbd5882....
  29. The Best And Free Website/html Editors + Text Editors
    A good collection! Check it out. (48)
    Here they are, the best html editors. Just pick one because they are all free, or choose one of the
    ones i most recommend. WebCore Designer 2005 http://www.mpsoftware.dk/webcoredesigner.php
    HTMLGate Free http://www.mpsoftware.dk/htmlgate.php Ma Page Web http://www.aldweb.com
    MAX's HTML Beauty++ 2004 http://www.htmlbeauty.com WebWorks http://w1.213.telia.com
    PageBuilder HTML Editor http://www.tafweb.com Website Mentor http://www.dark-street.com
    Cascade DTP http://www.price-media.demon.co.uk BPlainPro http://home5.swipnet.se/~w-52253/hy....
  30. Could Someone Make A Php Script For Me?
    Script to manage clans and players (3)
    Does someone know a script where you can 1. Add clans to a roster 2. Edit clans on a roster 3. Add
    players too a clan 4. Edit players 5. Schedule matches 6. Add clan Leaders to manage their own clan
    + members 7. Add members to edit their own information And maybe some sort of scoreboard integrated
    where you can put Wins, Draws and loses and that automaticly puts best clans on the top? If there
    isnt such a script could someone create 1 for me? (its for a league ^^)....

    1. Looking for wrote, script, php, text, editor

Searching Video's for wrote, script, php, text, editor
advertisement



I Just Wrote A Script For A Php Text Editor!



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE