welcome to Beerwin's Blog !

This blog has been started because there are many things that cannot be placed on the main site, but they are such good things, that they cannot be omitted. See them here.

PlainHTML modularity

Filed Under (General) by beerwin on 08-07-2008

Tagged Under : , ,

After the release of PlainHTML 5.5, there will be lesser program releases, except, of course, updates that need PlainHTML to be reinstalled. Since PlainHTML, from version 5.5 relies on modularity, and code inserting tools will be installed via extensions.

PlainHTML tutorial Part 1

Filed Under (General) by beerwin on 04-07-2008

Tagged Under : , ,

Many people searched for some kind of PlainHTML tutorials, so here it is.

HTML code presented here is XHTML 1.0 . This tutorial may require a minimal HTML knowledge. PlainHTML uses the caret and selection as reference point for inserting tags from the Tag Palette.

Getting started


Start PlainHTML, click File -> New… and select HTML document icon. A new empty document will be created for you.

Tag palette

Fig. 1. The Tag Palette

Now, on the tag palette, select the HTML tag, and click on the HTML Skeleton Code button [alternatively: Hold the Crtl and Alt keys and hit the H key].

Fig. 2: The HTML Skeleton Code tool

This will show you a window with basic HTML body properties, such as title, colors, background-image, etc. Fill in the desired fields, and click OK. The empty structure of the HTML document is created.

Now, it’s time to add some text: Select the Format tab on the Tag palette and click on the button, and adjust it’s properties (alignment and class - the later is for CSS), and click OK. You will get an empty <p></p> tag in the cursor position. Move the cursor between the “><” characters and type or paste your text. If you pasted the text, all formatting will be cleared. My text is “The quick brown fox jumps over the lazy dog. This will be a link. I should insert an image after this.“. You may break this text apart if it is too long. So,

Move the caret to the point where you want to break the line, hold the Shift key and hit the Enter key.
This will break the line in the code and insert a line break tag (<br />).

Now, we want to change the font of a part of our text: Select a part of your text, click on the Format Tab, and select the font ( ) tool [Alternative: Ctrl+T]. Set the Font face to monospace and font style to bold. set it’s color and size. The selected text will be enclosed in formatting tags with parameters set.

Fig. 3.: The Tag Inspector in action

Now, let’s change the color you set before. Hold the control key and click inside the formatting <font ... tag. The lower part of the Tag Inspector bar (it is located on the left side of the window) is now filled with parameters and values. Select the color parameter. See Fig. 3.
The color parameter becomes editable and a palette button appears on it’s right end. Click on it and pick another color. You can also change it by typing a new color value and pressing Enter. Don’t care about the double quotes, as the program handles them well (if one or both of them are missing, the program inserts them automatically).

Inserting or creating a link

The steps are the same, only difference is, that if you want to “linkify” a text, just select it before th following steps. If you want to insert a link, just move the caret in to position. and follow the next steps.

1. Select the HTML tab

2.Click on the Hyperlink ( ) tool

3. If the “Link title” field type your text (this will be the link text)

4. In the “File” field type the URL or file name you wich to link to (you can browse for files with the folder button)

5. Select the target (_blank stands for new window, the other three things are for frameset environment)

6. In the “Relative to” field select “Not related (external)”

7. Click OK

Inserting an image

1. Move the caret where you wish to insert your image.

2. Select Insert Tab, and click on the Insert Image ( ) button.

3. Browse for the image, set dimensions, alternative text, alignment, border and click OK

Conclusion

When you finished it, your code may look like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<html>
  <head>
    <title>
      PlainHTML tutorial materials
    </title>
    <meta name="generator" content="Beerwin's PlainHTML" />
    <meta name="author" content="Replace this to your name" />
  </head>
  <body>
     The quick <b><font face="Monospace" size="2" color="#944922">brown</font></b> fox jumps over the lazy dog.<br />
     <a href="http://www.beerwin.com" target="_blank" >This will be a link</a>.
     I should insert an image after this.
     <img src="Y:\Ervin\blog\phtut\img.jpg" border="0" alt="this is an image" />
  </body>
</html>

And the page should look like this:

Connecting to a MySQL database with PHP

Filed Under (PHP) by beerwin on 04-05-2008

Tagged Under : ,

In this tutorial, i will tell, how to connect to an existing MySQL database with an existing username and password.

For the first, we need the database and the credentials for it. If you are using a free web hosting service with PHP and MySQL support, you already have this information.

If you have a web server installed with PHP and MySQL, you have to create a database and a username. Since this is not part of this tutorial i will talk about it in another post.

Now, it’s time to get connected. We will create the db.inc.php file:

1
2
3
4
5
6
7
8
9
10
11
12
13
//database connection file// for first, we need to set database name, host, username and password for our connection. Modify them corresponding to your data.

$dbhost
=“localhost”;
$dbusername
=”your_username”;
$dbpassword
=“yourpassword”;
$db
=“your_db”;

//If you filled in your data, it’s time to make the connection. Don’t modify anything below this line

$connector = mysql_connect($dbhost, $dbusername, $password) or die(Could not connect to MySQL!);

$db = mysql_select_db($db, $connector) or die(“Couldn’t select database.”);

Beerwin’s blog

Filed Under (General) by beerwin on 04-05-2008

Tagged Under : , ,

You will get HTML, CSS, PHP and some Javascript tutorials, Things about PlainHTML developement (We will watch under the hood).

Subscribe to Rss Feed : Rss