Jul 3

Finally I managed to connect to the remote database using Oracle Connection Manager, after struggling for almost a week. The requirement requires the Oracle connection and firewalls. A remote Oracle client making a connection to an Oracle database can fail if there is a firewall installed between the client and the server if port redirection is taking place.The firewall will block the connection to the new port when the Oracle client connects to the database  ORA12203 or ORA-12535 or ORA-12564. The client connection failure is due to port redirection from the Database Server‘s operating system. Port redirection requires the client to connect to the database using a different port than originally configured in the configuration files. Actually, it is not difficult if you know but overall took me few days ding dong here and there trial and error where to place the CMAN and wat IP address to use. Many thanks to Prince Amin who show me the Network Structure and advice me to place the CMAN at the Remote Site. I was blur at that time. Two heads is better than One !!!! Prince Amin, I owe you dude…..
Read the rest of this entry »

Jul 3

Sample TKPROF Out from a sample trace file.

call count cpu elapsed disk query current rows
——- —– —— ——- — ——– ——— - — — — — Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 1.20 1.21 0 86091 4 15
——- —– —— ——- — ——– ——— - — — — — total 4 1.20 1.21 0 86091 4 15

1. A high (near 100%) parse count to execute count ratio when the execute count is greater 1 – if ratio is 1, then the query is parsed each and every time its execute and that needs to be corrected. The ratio should approach zero. The ideal is parse count should be 1 and execute count would be higer. If high parse count this indicate the query performing many soft parse.
Read the rest of this entry »

Jul 1

Here is an overview of the mathematical constants in PHP

Constant Exact value Description
M_PI                    3.14159265358979323846          The value of (Pi)
M_E                      2.7182818284590452354             E (Euler number)
M_LOG2E           1.4426950408889634074            log2 e
M_LOG10E        0.43429448190325182765          log10 e
M_LN2                0.69314718055994530942          loge 2
M_LN10              2.30258509299404568402        loge 10
M_PI_2               1.57079632679489661923         pi / 2
M_PI_4               0.78539816339744830962        pi / 4
M_1_PI               0.31830988618379067154         1/pi
M_2_PI               0.63661977236758134308        2/pi
M_2_SQRTPI    1.12837916709551257390         2/sqrt (pi)
M_SQRT2           1.41421356237309504880          sqrt (2)
M_SQRT1_2      0.70710678118654752440        1/sqrt (2)

Until M_PI constants are only available from PHP 4.0.

Jun 30

This tutorial is based on the “send mail with PHP” tutorial is basic and the dispatch to the BCC and CC recipients explain. Furthermore, additional header information such as sender, reply-to address or specifying a destination address for errors when sending mail addressed.

As in the tutorial Basic to read the features expected for at least three parameters. Optionally, you can now, however, two more parameters are added:

mail (recipient, subject, message, header, extended parameter);

Additional Options
The parameters “header” can be a lot of additional information are made. We would like here once the most important additional information present: Read the rest of this entry »

Jun 29

With PHP, you can quickly and easily send emails. Whether contact, newsletters, or simply so. This is the PHP function mail (); available. The following parameters are simple to dispatch an e-mail necessary:

mail (recipient, subject, message);

1. Parameters: The e-mail address or the name + email address

Syntax:

mail@example.com

or

First name last name <mail@example.com> Read the rest of this entry »

Jun 28

Simple Text Counter of clicks on links ver. counts.

First they must deal with eg phpmyadmin a table with the following hierarchy:

mysql> describe counter;
+——-+——————+——+—–+——— +—————-+
| Field | Type | Null | Key | Default | Extra |
+——-+——————+——+—–+——— +—————-+
| Id | int (10) unsigned | | PRI | 0 | auto_increment |
| Url | char (255) | | | | |
| Count | int (11) | | | 0 | |
+——-+——————+——+—–+——— +—————-+
3 rows in set (0.00 sec)
The url field contains the URL that is called. The field count contains the number of clicks on url. Read the rest of this entry »

Jun 27

Here is how you explained with the loading of your PHP page on the server on your Page can spend.

Following PHP code grabs her at the top of the page when the loading is to be measured:

<? php
$ mtime = microtime ();
$ mtime = explode ( “”, $ mtime);
$ mtime = $ mtime [1] + $ mtime [0];
$ time1 = $ mtime;
?> Read the rest of this entry »

Jun 26

For the homepage, there are a few extras, surely belongs in the contact to the most popular. It provides a comfortable contact with the operator of the website and can also apply to other functionalities easily convert.

Here I explain how to use PHP and the function mail () to create a separate form may be. Used to be at least PHP 4, and a mail server, which is however in most hosting services there.

1. Getting Started

At first, we need the HTML based, so the appearance of the form, what the user will see. At first, we need of course a source file that I match the project “contact.php” have mentioned. Then begins the actual Code: this we create a simple text boxes with the <form> day:

<Form action = “contact.php” method = “post”>
Your e-mail address: <br />
<Input type = “text” name = “email” /> <br />
Your message: <br />
<Textarea name = “message” cols = “50″ rows = “5″> </ textarea> </ br>
<Input type = “submit” value = “Submit” />
</ Form>

The first day
<Form action = “contact.php” method = “post”>
is the skeleton of the form that action will be determined which file the data is processed. Here I have logically named “contact.php” is selected, the name of our file. Then, still down method, the way the data are transferred. In PHP there are two options, GET and POST. GET, the public values and stores them in the dynamic URL, so things like index.php? S = 82882 established. However, the POST data is anonymous, and thus a contact for the better version.

Next, we define two fields, the first
<Input type = “text” name = “email” />
is an input field, which we define as text type, so it is writable, then we give him the name “email”. This name is later in the PHP part of relevance. The next day is a textarea tag, basically the same as input type = “text”, but is better suited because it is in the region can define, cols columns and stands for is the width designation, the number of rows rows. When I name “message” is used, because this is the real message will be. Finally, we need a button to the action to start. These take the input type “submit” under value, you have to be marked on the button firmly. At the beginning of the open form tag, we must now include: </ form>

This real structure can be arbitrarily extend important is that the used name-values do not appear twice.

2. PHP in action

Next, we will form with the actual function expand. For that we need in fact only the PHP function mail (), this is defined by the structure of mail ( “recipient address”, “Subject”, “message”, “From:” address “);. Theoretically it would be so rich following code to write to the message given:

<? php
@ Mail ( “deineadresse@abc.de,” “Contact”, $ _POST [ 'message'], “From: $ _POST [email]“);
?>

The code would enter the message that under the variable $ _POST [ 'message'] was defined to the recipients address. As the subject would “contact” to be called and the sender’s address would be the address of the user: $ _POST [email]. The names of the variables have the pattern $ _POST [], because we as a field in the HTML POST method selected. The term within the square brackets is the respective value in the name-tag form, which in our case the values in the
<Textarea>
and
<Input type = “text” />
.

Security

The current problem is that the website operator, even if an e-mail you get, if one or both of these fields left blank. A welcome leak for spammers. For this reason, we use an if-query to test whether the fields are free to use the function! Empty (variable name). This question from whether a value is less than or equal to zero, if none is available, so the e-mail is not sent:

<? php
if (! empty ($ _POST [ 'email']) & &! empty ($ _POST [ 'message'])) (
@ Mail ( “deineadresse@abc.de”, “feedback”, $ _POST [ 'message'], “From: $ _POST [email]“);
)
?>

The if-query begins! Empty ($ _POST [ 'email']) and is & &! (_$[' Empty message ']) expanded. Only then comes the brace and therefore the existing code, thus sending the message. Then after the if-sentence with a further brace closed.

Next, we should ensure that no alien HTML code is typed, not as external files. We use the best function htmlspecialchars ().

<? php
if (! empty ($ _POST [ 'email']) & &! empty ($ _POST [ 'message'])) (
$ email = htmlspecialchars ( “$ _POST [email]“);
@ Mail ( “pdalipi@gmail.com”, “feedback”, $ _POST [ 'message'], “From: $ email”);
)
?>

First we create a new variable $ email, it will use the function htmlspecialchars () is defined, the command worked. In the mail () function so we set the new variable instead of the old one, since they changed the value.

Convenience

On the Web often times it happens that you are somehow verklickt or something wrong. Let’s say you accidentally press the F5 key, then the page reloads and the whole message is gone. Therefore, it is good if you store the values entered. We use the function isset () to query the value and the function echo output to the data. Since this is within the fields to appear, the PHP code into a new definition of value entered values.

<input type = “text” name = “email” value = “<? php
if (isset ($ _POST [ 'email'])) (
echo htmlspecialchars ($ _POST [email] “);
)> “/>
<textarea name = “message” cols = “50″ rows = “5″ value = “<? php
if (isset ($ _POST [ 'message'])) (
echo htmlspecialchars ($ _POST [message] “);
)?> “> </ Textarea>

We now have both a value-tag value is generated in the quotes is now the PHP code, with the function isset () first asks whether a value is contained and then possibly by the function htmlspecialcahrs () from HTML Code-free and echo issues.

3. Tools

The contact would be really ready. To improve, you can, however, one or more additional coding. This leads me to some examples:

Confirmation

Through a simple query if we can spend to the user that his message has been sent, we will modify the existing code around and add another if-set. Here is the original code:

<? php
if (! empty ($ _POST [ 'email']) & &! empty ($ _POST [ 'message'])) (
$ email = htmlspecialchars ( “$ _POST [email]“);
@ Mail ( “pdalipi@gmail.com”, “feedback”, $ _POST [ 'message'], “From: $ email”);
)
?>

Now we set the mail ()-function if another query, the additional spending that the message was sent.

<? php
if (! empty ($ _POST [ 'email']) & &! empty ($ _POST [ 'message'])) (
$ email = htmlspecialchars ( “$ _POST [email]“);
if (@ mail ( “pdalipi@gmail.com”, “feedback”, $ _POST [ 'message'], “From: $ email”)) (echo “The message has been sent”;
) Else (
echo “There was an error”;
)
)
?>

The mail () function is called if-question set, this works, then the text “The message was sent” by echo-output function. If something is not worked, it appears the message “There was an error in the attachment else.

With JavaScript were on these commands, of course, pop-ups that are perhaps more visually hermachen would.

One could query a positive course, a confirmation mail. This one uses the mail () function a second time, but is now the recipient’s address $ _POST [email], and the FROM: address of their own. In addition, you should obviously change the subject and message.

Captcha

For better Spamprotectiontext Captchaabfrage course would also be useful. A detailed description would, however, beyond the scope.

Jun 25

A brief explanation of the script by webmaster IP2Country.

By webmaster are IP2Country tool, you can use IP addresses to country dissolve. That means you enter an IP address and receive as a result of the country from which the IP address originates. As a database, I use the CSV file ip-to-country.csv of ip-to-country.webhosting.info. The PHP script which then evaluates the IP address looks like this: Read the rest of this entry »

Jun 24

On the Internet there are various types of times to indicate the most important.

Time Stamp
A timestamp is a number called the Unix time, these are the last seconds since the start of the Unix Epoch on 1.1.1970 clock to 00:00:00 (GMT). Read the rest of this entry »

« Previous Entries