donate to charity, donations, charity donation,donate online, online donation,donate money, car insurance, auto insurance,insurance quote,hospital staffing software hospital software, Business,VoIP,solutions,medical practice ,donate, car, charity CALIFORNIA, donate car, charity hospital

career form sent to email php script free


<?php

// if there is post
if (isset($_POST)&& !empty($_POST)){
      
    //if there is an attachment
    if (!empty($_FILES['attachment']['name'])){
        //store some variable
        $file_name = $_FILES['attachment']['name'];
        $temp_name = $_FILES['attachment']['tmp_name'];
        $file_type = $_FILES['attachment']['type'];
              
        //get the extension of the file
        $base = basename($file_name);
        $extension = substr(&$base, strlen($base)-4,strlen($base));
       

Html the Page is divided into Two Parts using Tags


In Html the Page is divided into Two Parts
1.HEAD
2.BODY
Both these Tags are Paired Tags.
Head : Tag Contains only 1 Tag that is Title.
<Title> Title goes here….     </Title>
Body Tag Holds the Rest of the Tags used in HTML

Simple HTML Program.
Just Open Note Pad  and write the code.

<HTML>
<Head>
<Title> My 1st web Page  </Title>
</Head>
<Body>
</Body>
</HTML>

Html


H T M L
Hyper Text:  Online Documents
Markup Language: Enables Web Browser to understand
the Tags.
HTML Editors:
 HTML have no Particular IDE but it uses Notepad Editor,WordPad,
 Word processor And Dos Editor to write the code.
HTML is Spelling Sensitive Language and it runs on every
 Operating System.

TAGS  Or FLAGS:
Html use < Less  Than  and > Greater Than Signs
For writing commands. In  Html there are two types of Tags
1.Paired.
2.Single.
And every Paired Tag Ends with a Slash /
Like :
< HTML >
< /HTML >

History Of Markup Languages


History Of Markup Languages:
Tim Berners Lee
Computer Scientist Gives the concept of
Making connection between simple huge text files or
 D.Base files on the internet.
First markup language was created named SGML
SGML
Standard Generalized Markup Language
Supports Simple text, it don’t support Graphics Features

Searching video Using YouTube API

In my recent project I have to do something like that:
  • Enter a TAG, inside a text box
  • Search in Flickr using the tag.
  • Show the search result inside my page.
  • Search in YouTube using the same tag.
  • Show the search result inside my page.
  • Play the video in my page without redirecting to the YouTube original site.

SECURING PHP & APACHE

Few weeks ago i realized the importance of securing php and apache. But that time i know very little about security issue of php & apache. then i am jumped to google to know about this. then i found several things and i found something very interesting, but very important. here is some brief… and details will be found in the attached document.
PHP related Security assumptions
In case of security assumptions, the following have been added:
  • The PHP configuration should take advantage of built-in security mechanisms
  • PHP scripts must be executed in a chrooted environment
  • The Apache server must reject all requests (GET and POST), which contain HTML tags (possible Cross-Site-Scripting attack) or apostrophe/quotation marks (possible SQL Injection attack)
  • No PHP warning or error messages should be shown to the web application’s regular users

Source Viewer

I was surfing on my phone and a page showed XML parsing failed. I wanted to check what's wrong with the BSE site. Just google for an online source viewer, found a few which didn't appeal to me so I decided to write my own and under two minutes I built my own source viewer and uploaded on my PHP capable server. Here's the darn few line code:

<?php
header("Content-type: text/plain");
$page=$_GET["url"];
$fp = fopen($page, r);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
?>

Scripting in an image with PHP


In this example
Here, I am considering an image file hi.gif which when requested by a user runs PHP code to log the user's details. I assume, you're running Apache and PHP5. If you want a free host for this experiment then x10hosting is for you.

So, lets begin.
1. Open notepad and put the below code inside and save the file as "hi.gif"

<?php
$LogFile="Log.txt";
$Date=date("F j, Y");
$Logging = $_SERVER['HTTP_USER_AGENT']." - ".$_SERVER['REMOTE_ADDR']." - ".$_SERVER['HTTP_REFERER']." - ".$Date;
$Post = fopen("$LogFile","a");
fputs($Post,$Logging);
fclose($Post);
$icon = "../hi.gif";
header("Content-Type: image/jpeg");
$blah=fopen($icon, "rb");
while(!feof($blah)){
$data=fread($blah, 512);
echo $data;
}
?>

Sending multipart MIME mail with inline image

From today morning itself, I'm trying to send a MIME mail with PHP's mail() function that displays an image inline. But, I don't know where the <bleep> I'm making the mistake. The image goes but in G Mail it shows up as an attachment instead of getting displayed inline. Here's my source code:

Some free PHP-MySQL hosts

Want to have a small DB driven web/WAP site??? Here I write about a few selected ones.
FreeHostia
If you want almost hundred percent uptime then this one is surely for you. Although they're low at bandwidth(5GB/month) and space(250MB) but they've excellent uptime and very fast servers. A couple of demerits are that you can't use more than 1.3% of their CPU time per day and another is that file size limit is 500KB. The former implies that if your site uses heavy scripting, lots of modules and non-optimized code and you've lots of visitors then you'll cross the 1.3% limit with ease. Another demerit is that fsockopen, mail etc are disabled. Pros: no ads *grin

File Fetcher in PHP

My net connection is too slow and inconsistent to download large files from a non-resume capable server. So I thought of creating a PHP file fetcher program, that I could upload on a fast PHP capable web server and it would download the file itself within a minute and then I could download from there in many sessions by resuming broken downloads. Here's what I coded:

Log your blog visitors

So, you've got a shiny new blog out there on blogger and getting pretty many hits as well but want to keep a record of all people visiting your blog? Well, I do! Ever noticed the 'lens image with "Logged" written' here in the right panel of this blog? Yes, that my own visitor logger. Although there are lots of third party loggers out there like the Woozily widget but having your own is fun when you call yourself a techno-savvy! Ok, so here I go about it how to do it on your own.
Note: I'm assuming that you know how to use FTP, what is PHP and some other simple stuff etc... If you don't know these and don't understand the post, that means you're a n00b. I'm not going to explain everything in ultimate detail.
First things first
Here we're going to use PHP to track the visitors. So, you need a PHP capable server. Freehostia is cool for this task. Just register an account there.
1. Create an account on freehostia. Setup a subdomain like "mylogs.freehostia.com" or something you wish there.
2. Create the image in mspaint or anything, that you wanna display to the user. Or if you're lazy then use the one from my blog. Name the image something like "img.jpg"
3. Create a PHP file with the following code and name it something like "logger.php":


Display Live Cricket Score on your site

I wanted to display live cricket score on my site, so I pushed the tea cup aside and got down in front of my PC googling for something significant, to find an hour later that the previous hour I spent went in no man's land!!! I got an inspiration here too from the blog comments BBC Backstage. Ok, so I went ahead and decided to pull out the live score data from wap.cricinfo.com. I first tried to pull out their page source into a string using PHP built in function file_get_contents() but apparently it didn't work out because cricinfo server is too nasty to respond to your http GET request if you don't provide the user-agent string. So, I formulated my own http request and then it worked out effectively. Below is the PHP code fully commented for clarity. The code is in aqua and comments in yellow.

nl2br() function in PHP

While working with the RW/LL WAP community script, I noticed a bug(???), better say unexpected behaviour in nl2br() PHP library function. I had a function for processing bbcodes. I added the nl2br() in it to convert all the enter/return presses into the xhtml <br /> tags. But I noticed, in the forum posts all other bbcodes didn't work whenever a call to nl2br() occured due to enter presses. After fiddling with a lot of sequences(which I later found to be illogical on my part) of the processing lines of codes for bbcodes and the nl2br() function, I figured out that the problem is not with my code but PHP's implementation of the nl2br() function. So, with the help of the nl2br() manual comments on php.net I wrote my own nl2br() function as follows:

function nl2br1($text){
$text=str_replace(array("\r\n", "\r", "\n"), "[br/]", $text);
return $text;
}


Well, the above function takes into concern that:
On Windows the enter key press means "\r\n",
On Linux/UNIX/BSD and other UNIX derivatives the enter key press means "\n"
and on a Mac, it is "\r\".
Probably the built in nl2br() in PHP is implemented differently, so the glitch appeared.

PHP MyAdmin Large SQL File Dumping Problem


As I'm a web/WAP developer with PHP as the base scripting language and MySQL as the DBMS, I've to take backups of the DB at rather regular intervals to counter any catastrophic events. I noticed that dumping a large SQL file (say 8-10 MB or more) takes lots of time(around 10-12 mins. or more) through PHP MyAdmin. I used to attribute this to MySQL thinking, it to be slow at parsing the file. One sunny day, I opened task manager before starting the dump process. As I hit the submit button, I saw the processor usage shooting up to 100%. I changed to the "Processes" tab and was surprised to see that mysql process wasn't consuming any CPU power. It was Apache which was clogging up 99% of the CPU power. I tried to End the process but it refused to, and my PC finally crashed.
Taking a lesson from this, I tried an alternative way. I used the MySQL command line interpreter to dump the file and voila!!! The dump finished smoothly in less than 15 seconds!!!! So, that was an Apache bug. Right???
Ok, by the way here is the step by step process to carry out the same.

1. Copy your sql file to a convenient location(say root of C:\) and name it something simple (say sql)
 

2. Now launch command prompt and change to the directory where MySQL is installed. Mine is in 

F:\xampplite\mysql\bin
 

3. Type
mysql -u root

Bug in MySQL Subqueries with IN Operators

While developing an application with MySQL at the backend I happened to write a query containing a subquery with the IN operator. I was surprised to see that the query crashed MySQL daemon on Windows! On Linux, it was taking ages and I had to abort it. After lots of tests I concluded that MySQL has a limited support for subqueries. I browsed their site for help and found out that they were working on it and it will be fixed in the 6th version.


Similarly I also found that Self-Joins have problems too, for tables with large number of entries.
Here are the queries. If you wanna experiment then download the table structure from here

Importing MS Access database into Oracle 10g or MySQL

While working on a data mining project I came across an issue in which I had to dump all the data from an MS Access mdb file into Oracle and MySQL database tables. Actually, to test your implementations of various data mining algorithms you need huge real life data sets, and they are mostly available on the internet in CSV formats or MS Access mdb files. One great place to download such data sets is the Machine Learning repository of University of California. Here is the link: