get content of notepad and post on html and also edit it - php

is there a way to get a content of an html page or notepad, then display in on my html page to edit and save, where the edits will be permanent and also allow me to view the content like an individual page or in my desktop. using php or javascript?
or to simply put it embed a notepad on my page where i could edit it anywhere i am.

You can open and edit text documents in a browser, using stuff like:
ACE editor;
Tiny MCE.
The idea is that you open desired file via php [file_get_contents], put its raw data into a <textarea> and enhance it with aforementioned plugins.
Then once you submit your edit, you store new raw data into file.

you can use php fopen function and read the content of the file and load it in texteditor and using fwrite function save the content

You sound like you're wanting a personal wiki; wiki engines are built to be user-editable online (and permanently saved after you edit). A personal wiki is just a wiki that only one user uses or has access to.
If you have a server and don't mind having to be online to edit your notes, any wiki software (like MediaWiki). If you want your notes to go with you, even offline, try TiddlyWiki, a one-page wiki built in javascript so it's all one HTML file.

Related

Is it good or bad practice to use an iFrame to insert a large amount of local content into a Lightbox?

I am creating an enquiry form which opens in a Fancybox pop-up but a little unsure as to how to correctly insert the content.
The form has a very large number of fields, so I think it would probably be best to have the code in a separate file, making it easier to read and be edited in the future, if the need ever arose.
I am aware I could create a separate file and include it into the page via PHP or SSI but wanted to get an opinion from others as to what the best way of getting the content in would be. I am veering away from changing the page which has the link to the form to .php (which is currently .shtml), as the website I'm working on is very old and doesn't have any PHP pages in it but does use SSI for the navigation and header sections (all pages in the site are .shtml).
Should I use SSI, an iFrame or just embed the code directly in the master page and forget keeping the form separate?
I look forward to your suggestions.

Making screenshot of the website with changes made by user

Is it possible to take a screenshot of the visible part of the website directly as it is seen by user (rendered by by the browser), including any changes made by user (e.g. moved divs, text typed in forms etc.)?
So you open a website, where you can make changes to its content. And there's a button (on the website of course), when you click it, the actual visible part of the website with all the changes you made is saved as an image and for example there goes a popup window where you can type in an email to send this image to, or something like that. Javascript, php, html5 or anything else? Old browsers and ie doesn't matter.
I've searched a lot for the answer, read lots of related articles, but I couldn't find the solution, cause what I need is not the script that would re-render the page like html2canvas, but capture the actual content displayed on the screen.
Any ideas and comments are much appreciated!
This is something that can be extremely tricky.
Essentially your only option of doing this in browser with no extensions or such is to try rendering HTML into the <canvas> tag.
There are several projects which do that, most reliable choices are noted in this SO question's answers: Render HTML in Canvas/WebGL
Note that none of the projects are 100% accurate, but a canvas can be rendered into an image and thus could be saved or emailed by the user like you asked.

Find the PHP/HTML file containing DIV container shown in FireBug

I'm editing an existing template in Joomla and I need to change the menu icons text. In Joomla Administrator, I cannot find the place where I can do this. So, in FireBug I found DIV container that I was searching for. But if I change the text in FireBug, my changes are obviously not saved. Now very basic question is: how can I know the name of PHP or HTML file, where this DIV container is located? Or how can I save my changes?
FireBug will only change web browsers content, it will not affect files on the server. If you know DIV's id you can search for files with this string on the server. To save changes - edit file and save - but on the server.
I use TestWrangler app (I'm on a mac) - open blank TW, click on Search, browse to target a folder to search through. I always search through a copy of my website folders on my hard drive rather than live site files. Search for the text string you're wanting to find which file contains it. Give TW a few seconds or more and it will tell you exactly which file contains the string.
http://www.barebones.com/products/textwrangler/
When you right click on an HTML element and select "Inspect with firebug", on the right hand side of the firebug screen you will see the styles applied to that element, and where it says the line number, if you just hover your mouse over it it will show you the exact location of the file.
Use a file search tool, it is included in most IDE's, if your editor doesn't have such a feature try a file grep tools like wingrep (http://www.wingrep.com/)
I just thought I'd share this as a possible 'answer' as well.
there is a joomla extension that enables you to search through your source code within joomla itself.
Here is the link:
http://extensions.joomla.org/extensions/miscellaneous/development/22858
I'm sure it will come in handy instead of going through the hassle of a complex setup on localhost.

Drupal PHP Content Warns of Virus

I have a Drupal site with a page that contains a PHP form. The php form connects to a database and posts the content there and it also has some javascript statements.
The problems:
If I edit the drupal node and copy out the PHP and try to save to a document on my computer it warns of a virus.
If I open to edit the drupal node and try to save again (EVEN THO NO CHANGE IS MADE) the form no longer shows up and nothing shows up where it should be in the drupal page.
What could be causing this, poorly written PHP? I'm sure there's no virus.
I'm not sure how to reply directly to your question, so I'm putting it in an answer.
If I open to edit the drupal node and try to save again (EVEN THO NO CHANGE IS MADE) the form no longer shows up and nothing shows up where it should be in the drupal page.
It is possible that you are not saving in PHP format, or do not have access to. The default formats are usually Plain Text, Filtered HTML, or Full HTML and it is discouraged to give inline PHP code processing privileges to users. So for the second part of your question, I'd check that.

I want to extract and parse text and files from a site, translate the extracted text and then post it to another website

I want to extract text and files from a dll-files.com.
The text will be the name and description. The files will be of .dll format.
I want to translate the text and description into Swedish and then post the text and dll files onto a phpBB forum.
Please suggest any solution to this.
You could check google's translate API, they usually do a decent job.
As for getting the data from dll-files.com, you could ask them for an API of some sorts, or attempt to scrape it.
There are several HTML-parsing libraries out there, all you have to do is get the content of the right element. However, make sure you dont violate http://dll-files.com's terms.
http://code.google.com/apis/language/
It sounds like you want to parse the HTML contents of relevant pages on dll-files.com, so that the description of the DLL is available in Swedish, and so that you can provide a direct link, rather than redirecting to an English page. Is that what you meant?
If so, the solution you are looking for may have already been answered on this site, at the following link:
Open webpage and parse it using JavaScript

Categories