Loading...


bookmark - Online HTML/PHP Editor: Edit File In Browser!

Online HTML/PHP Editor: Edit File In Browser!

 
 Discussion by Nqon with 16 Replies.
 Last Update: January 28, 2011, 6:41 pm ( View Rated (5) )
 
bookmark - Online HTML/PHP Editor: Edit File In Browser!  
Quickly Post to Online HTML/PHP Editor: Edit File In Browser!  w/o signup Share Info about Online HTML/PHP Editor: Edit File In Browser!  using Facebook, Twitter etc. email your friend about Online HTML/PHP Editor: Edit File In Browser! Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

Im wondering how you can load a file into a text area and edit it. Lets say i have a php file called test.php and id like this file to be loaded into a textarea and the user should be able to edit this file and store it.

Is this posible?

Im also wondering how you make it so the html dosnt get encoded by the browser, lets say i need to explain on my website how you use html.

CODE

Just testing something, maybe i can get this from the source. <b></b>









   Tue May 17, 2005    Reply         

Why don't you google for HTMLArea Text Editor - that does the exact same job - i.e. creates an online text editor. Combine the code of that with some file saving/uploading routines in PHP and you'll get your desired results :)

   Tue May 17, 2005    Reply         

Thanks, but how do I get the php into the textarea without it being executed?

   Tue May 17, 2005    Reply         


easy

I made a editor by myself, let me enlighten you.

If you encode all HTML like characters like < > to &lt; , &gt;, the < and > will show up correctly in the textarea but won't be executed.

And posting is just posting the contents of the textarea and have a php file write it to a file.

You also might want to wacht out for CHMODDING issues :)

[brag]
Mine works so nicely that I use that instead of SSH'ing to the server.
[/brag]








   Tue May 17, 2005    Reply         

Yes yes, I found out how you did that pritty quickly, but my problem is that the PHP file gets executed into the editing textarea, is there a way to avoid that?

The point of editing the php file is that it needs to be executed at some point! I know about the chmodding issues. But is there a way to bring the php file into the textarea without it being executed, i know i can use special characters that will stop it from being executed, but that would stop it from being executet all the time. I want it to be executed when it is included in the site.

   Wed May 18, 2005    Reply         

What do you see when you open a file with : <?php echo 'test'; ?> in it?
exactly, you'll see <?php echo 'test'; ?> in the textarea, but what was in the source?
&lt; and all those other html characters.
But when you POST it up to the server, it will just post <?php echo 'test'; ?>, because you will post up what up SEE in the textarea.

   Wed May 18, 2005    Reply         


I use PHP's htmlspecialchars() to show HTML coding.

There's a function which can be used to decode what has been encoded. It's htmlspecialchars_decode(). Unfortunately, this decoder is available only in PHP5.

   Wed Jun 29, 2005    Reply         

Simply.
A file with textarea, value of which would be written to the file chosen.

CODE

<?php
if($file&&$script) {
$fp=fopen($file, "w");
fwrite($fp,$script);
fclose($fp);
}
?>
<form action="index.php" method=post>
Name of file: <input type=text name=file><br>
Code of file:<br>
<textarea colls=400 rows=200 name=script></textarea>
<input type=submit>
</form>

I hope, you'll be able to complete it yourself :o

As for editing,

CODE

<?php
if($file&&$script) {
$fp=fopen($file, "w");
fwrite($fp,$script);
fclose($fp);
}
?>
<form action="index.php" method=post>
Name of file: <input type=text name=file><br>
Code of file:<br>
<?php
if($file) {
?>
<textarea colls=400 rows=200 name=script>
<?php
$fp=fopen($file,"r");
$t="";
while(!feof($fp)) {
$t.=fread($fp,1024);
}
fclose($fp);
print $t;
}
</textarea>
<input type=hidden name=file value="<?=$file;?>">
<?php
}
?>
<input type=submit>
</form>

   Sat Mar 18, 2006    Reply         

Try using one of those frameworks, script.acolo.us or MooScript I think, they have some examples that I'm unsure of, but just might be exactly what you were looking for.

   Sat Apr 29, 2006    Reply         

Your code is just a little off. Here is what I got:

CODE

<?php$file = $_POST;$script = $_POST;   if($file&&$script) {   $fp=fopen($file, "w");   fwrite($fp,$script);   fclose($fp); }?><form action="test.Php" method="post">Name of file: <input type="text" name="file"><br>Code of file:<br><?php if($file) {?><textarea colls="400" rows="200" style="width: 100%;" name="script"><?php $fp=fopen($file,"r"); $t=""; while(!feof($fp)) {   $t.=fread($fp,1024); } fclose($fp); print $t;?></textarea><input type="hidden" name="file" value="<?=$file;?>"><?php }?><br /><input type="submit"></form>

   Sat Sep 12, 2009    Reply         

There is a website called phpanywhere.com which let's you edit PHP code in the browser.

   Mon Oct 5, 2009    Reply         

There are plenty of online editors that can let you edit php/html/xml/css online. Phpanywhere is the one. Another one is PhpHTMLedit. There is also codepress check it here. There are few such tools but most of them are paid. Also do you know you can edit most of the web formats on your cpanels' text editor. It provides syntax highlight and line number formatting. Do check it on your own cpanel.

In between, you can check Editphponline. It's still in beta but worth to check out. after opening the site you'll see it opens up a text editor on browser window with number on left hand sidebar. You can edit and save your files.

   Tue Oct 6, 2009    Reply         

<?php     opentable($locale);     if ($settings == "1") {       echo "<div style='text-align:center'><br/>and".$locale."<br /><br/>and".$locale."<br /><br />and</div>and";     } else {       echo "<div style='text-align:center'><br/>and".$locale."<br /><br/>and".$locale."<br /><br />and</div>and";     }     closetable();?>

   Tue Feb 9, 2010    Reply         

error msg//Online HTML/PHP Editor: Edit File In Browser!

Warning: mail() url="function.Mail"]function.Mail[/url: SMTP server response: 550 5.7.1 Unable to relay for dennis.Chen@visual-earth.Com.My in D:DomainsLocalUservisual-earth.Com.Mywwwrootfree_consultation.Php on line 118

this msg coming..Wat I do..Pls..Rep

code is:

  <?if($_SERVER=="POST")

{

 $name = $_POST;

 $email = $_POST;

 $phone = $_POST;

 $message = $_POST;

 $sub = $_POST;

 

//$body="<table width="100%" border="0" cellspacing="2" cellpadding="2"><tr><td width="36%">Dated</td><td width="5%"></td><td width="59%">".$date.$Month.$Year."</td></tr><tr><td>Practice Name:</td><td></td><td>".$practicename."</td></tr><tr><td>Practice Administrator or Office Manager :</td><td></td><td>".$padmin."</td></tr><tr><td>Name<br></td><td></td> <td>".$na."</td></tr><tr><td colspan="3"> </td>  </tr><tr><td colspan="3">".$nb."</td></tr><tr><td colspan="3"> </td></tr><tr><td>".$nc."</td><td></td><td></td></tr><tr><td colspan="3">".$nd."</td></tr><tr><td colspan="3">Job Title/Function</td>  </tr><tr><td colspan="3">".$ja."</td></tr></td><td>".$jb."</td></tr><tr><td colspan="3"></td></tr><tr><td colspan="3">".$nc."</td></tr><tr><td></td><td></td><td>".$nd."</td></tr><tr></table>";

$body="<table width="600" height="50" border="0" cellspacing="5" cellpadding="5"><tr><td><b>Name :</b> &nbsp;&nbsp;".$name."</td>  </tr><tr><td><b>Email :</b>&nbsp;&nbsp;".$email."</td></tr><tr><td><b>Company:</b> &nbsp;&nbsp;".$company."</td></tr><tr><td><b>Contact:</b> &nbsp;&nbsp;".$contact."</td></tr><tr><td><b>Message:</b> &nbsp;&nbsp;".$message."</td></tr></table>";

$to="[email=dennis.Chen@visual-earth.Com.My";$headers]dennis.Chen@visual-earth.Com.My";[/email]

[email=dennis.Chen@visual-earth.Com.My";$headers]$headers[/email] = "MIME-Version: 1.0rand";

$headers .= "Content-type: text/html; charset=iso-8859-1rand";

$subject="Visual earth - Free Consultantion";

$headers .= "From: $email"."rand";

mail($to, $subject, $body, $headers);

 }

?>

 

 

 

   Thu May 13, 2010    Reply         

<?php$host    = "mysql1082.Servage.Net";$user    = "johaneslucky5";$password  = "Margoutomo10";$database  = "johaneslucky5";  $connect  = mysql_connect("$host","$user","$password");@mysql_select_db("$database",$connect) or die ("Error! No Database Connected");session_start();Function special($p) {    $p = strip_tags($p);    $p = htmlentities($p, ENT_COMPAT,'UTF-8');    $p = str_replace('--','-&minus;',$p);    $p = trim($p);    return $p;  }    $nama = special($_POST);  $email = special($_POST);  $message = special($_POST);  $gcf_captcha = $_POST;  $date = gmdate("Y-m-d H:I:s", time()+60*60*7);    if( $_SESSION == mysql_real_escape_string(trim($gcf_captcha)) && !empty($_SESSION ) )  {    Mysql_query("INSERT INTO `johaneslucky5`.`wp_prospek` (`id`, `nama`, `email`, `message`, `ip`, `date`) VALUES ('','$nama','$email','$message','" . $_SERVER . "','$date')",$connect);    //kirim email ke lucky$to = "johanes.Lucky@gmail.Com";$subject = "Prospek MargoUtomo.Net";$message = "Nama: $nama, Email: $email, Pesan:$message, Tanggal:$date";$from = "admin@margoutomo.Net";$headers = "Dari: $from";@mail($to,$subject,$message,$headers);  Ob_start();Echo "Pesan anda telah terkirim";Header("Location: http://www.Margoutomo.Net");ob_flush();  }  else  {    echo 'Kode yang dimasukkan salah.';      }  ?>

 

   Sat Oct 9, 2010    Reply         

You can use, and see how it's implemented in:
http://online-php.com

   Mon Dec 20, 2010    Reply         

You can probably use google docs.

   Fri Jan 28, 2011    Reply         

Quickly Post to Online HTML/PHP Editor: Edit File In Browser!  w/o signup Share Info about Online HTML/PHP Editor: Edit File In Browser!  using Facebook, Twitter etc. email your friend about Online HTML/PHP Editor: Edit File In Browser! Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

Similar Topics:

Text-Based HTML Editors

1st Page 2000 1st Page 2000 is the tool that lets you create powerful, great looking websites fast, easier and on-time. AceExpert In addition to being an excellent HTML ed ...more

   03-Sep-2004    Reply         

Get Input From Html/txt File?

I was just wondering if it's possible to retrieve text (and maybe images) from a .html or .txt file. So for example you get the header and footer from an external file. Is it possible with just html/css and maybe a little javascript or does it require server side scripting like php??? ...more

   01-Jan-2006    Reply         

What Is A Good Photoeditor?

Well i have been looking around for a lot of photo editors....Photo Shop is very good but cost a lot of money.So i found GIMP which is very good but i found a one thing in it that i didn't like, but i don't know if it is fix able.Well when every you start from scratch on a for a picture..You ...more

   07-Jan-2008    Reply         

How Do I Create And Write To Files? creating, writing, deleting files   How Do I Create And Write To Files? creating, writing, deleting files (4) (3) Fileopen split the comma  Fileopen split the comma