PHP tutorials | XML tutorials | HTML tutorials

Tutorials for PHP, HTML and XML

Silverlite WP theme

Silverlite

Here you can see live Silverlite WP theme

Price: 20€

Contact form

contact-form

Version of this contact form in white color.
Version of this contact form in black color.
Version of this contact form in red color.

Price: 7€

(more…)

Change input field HTML

I this tutorial i will show how to change defult style of <input> field.

The input field will look like this:

search

Here is the code for this input field

<input type=”text”  name=”search” size=”10″ maxlength=”14″style=”width:106px; height:22px; border-style: hidden;
border-width: 0px;
color: none;
font-family:Comic Sans MS;
padding: 5px 5px 0 5px;
font-size:8pt;
background-color:none;
background-image: url(http://dobrote.si/images/ozadje/search.gif);
background-repeat:no-repeat;”‘>

(more…)

Create XML from Mysql table and write to file

Hello, is this tutorial i will show how to create XML from MySql table.

First we need connection to DB and table. How to do this you cen read here.

Here is the code for connection. The table name is “users”. The content of table is:

id user pass
1 admin admin
2 john john

The code for connection:

First we make connection.

$connection = mysql_connect(”localhost”, “username”, “password”) or die(’Could not connect: ‘ . mysql_error());

(more…)

Connect to mySql with PHP and print Table

This tutorial wil show how to connect to mysql DB and print table.

First we need variable for connection. The variable will be $connection

We need function:

mysql connect(”localhost”,”username”,”"password)

Next step is to store connection to variable, so we can used it later in the script.

$connection = mysql_connect(”localhost”,”username”,”passwor”);

If the connection fails we use die() function.

die(’Could not connect: ‘ . mysql_error());

Now i will show how to connect to table in database. The table will be user. Table look like this:

id user pass
1 admin admin
2 john john

(more…)

Don’t allow to copy text from pages

Here is the tutorial that will show you how to prevent your visitors to copy text from your page.

It si very simple.

To prevent copy you need to add this line to css file:

.dontCopy{
-moz-user-select:none;
}

Now to prevent copy text just define class “dontCopy” in html.

<div class=”dontCopy”>

This text can’t be copied

</div>

This works on Firefox.

For IE you need to add in <div> onselectstart=”return false”

<div onselectstart=”return false”>

This text can’t be copied

</div>

Read XML with PHP

Hello, this tutorial will show how to read XML files with PHP

First we need XML file. I will create XML file with name test.xml. XML looks like this:

<?xml version=”1.0″ encoding=”ISO-8859-1″?>
<contact>
<email>E-mail</email>
<name>Name</name>
<message>Message</message>
</contact>

Now we need php function to load XML file. This function is simplexml_load_file() .

We need one variable. I will call it $xml .

The next step is to load xml in this variable.

(more…)