A Simple PHP Contact Form Script

by Yang Yang on December 10, 2009

Update: Other than using the code outlined on this page, you may also want to download the Kavoir Contact Form script to be readily usable on your website.

It’s also a free one and a rather easy one too. You should be able to do it yourself. To create a working contact form, you need the front end and the back end. The front end presents the contact form to the website user and the back end accepts the data sent from the form by the user and take any necessary actions such as relaying the message to your email.

Visit FormKid.com for hosted free contact form solution.

Front end (HTML)

Simply copy this HTML form and paste it into your web pages where you want it to be, such as on the sidebar so a visitor can send you a contact message on any page.

<form action="/cf.php" method="post">
	<p><label for="input-email">Your Email: </label><br/><input type="text" name="email" id="input-email" size="40"/></p>
	<p><label for="input-message">Your Message: </label><br/><textarea type="text" name="message" id="input-message" rows="10" cols="40"></textarea></p>
	<p><button type="submit" name="submit">Send</button></p>
</form>

You may also want to style this form a little bit to make it look fancier. But make sure you don’t change any of the properties inside the tags such as action=”…” and name=”…”.

Back end (PHP)

Copy and paste these PHP code into a file named cf.php, change youremail@yoursite.com to your own email address that you wish to receive the messages. Put the file at the root directory of your domain so that everyone can access it at http://www.yoursite.com/cf.php.

<?php

if (isset($_GET['success'])) {

	?><p><span style="color:green;">Message successfully sent.</span> Thank you!</p><?php

} else {

	if (!empty($_POST['email']) && !empty($_POST['message'])) {

		$to = 'youremail@yoursite.com'; // your email address, can be @gmail.com, etc.
		$subject = 'Contact from yoursite.com'; // change yoursite.com to your own domain name
		$message = $_POST['message']."\r\n\r\nSender IP: ".$_SERVER["REMOTE_ADDR"];
		$headers = 'From: '.$_POST['email']."\r\n".
					'Reply-To: '.$_POST['email']."\r\n";
		mail($to, $subject, $message, $headers);

		header("Location: /cf.php?success"); // redirects the sender to success page so he or she doesn't accidentally send multiple identical messages

	} else {

		?><p><span style="color:red;">Error detected.</span> Please make sure you have filled all fields. Press back button to go back.</p><?php

	}

}

?>

Should be functioning properly. Thus far this contact form script has been successfully tested on Rackspace Cloud, DreamHost and Linode.

There are a lot more that can be done to create a sophisticated contact form. For starters, you can implement a spam catcher and a file upload control that sends the user uploaded file as attachment to your email. You could also have on-page error detection but that’d need a lot more coding.

{ Comments on this entry are closed }

Rackspace Cloud Promo Code

by Yang Yang on November 30, 2009

Rackspace Cloud Promo or Referral Code: REF-YYVital Update: According to the partners program manager at Rackspace Cloud, Kenard Horsley, who informed me of the decision via email, the promotion of $25 discount for Cloud Sites will be ended on 18th, March (2010). All the promo codes will be annulled by then except for Cloud Servers. If you intend to sign up with them, now is the time. Use the promo code (Code ID=134) to grab the $25 deal before it is gone forever.

Activate Promo Code (ID=134) at RackspaceCloud.com »

As the entrenched leader in cloud hosting, Rackspace Cloud is the cloud products division of Rackspace, the world renowned managed dedicated hosting provider. To make a long story short, cloud hosting is simply multiple servers (a pool of servers) simultaneously hosting for your websites and web applications. It’s the base of SaaS hosting. With the Rackspace Cloud promo code:

(Promo ID=134) click to activate

You can try their Cloud Sites, the managed cloud hosting package for 30 days on unconditional money back policy in addition to an extra $25 discount off the first month (rebate to your credit card).

What are the Cloud benefits?

  1. It handles usage / traffic spikes much better than any other types of hosting can. Because it automatically scales and distribute computing resources on demand on the fly!
  2. It provides failover that no single dedicated server can, drastically reducing the chance of down times by instantly switching to a redundant server in the cloud. Well, actually not that much of a redundant server because that server is part of the cloud all the time. Because each of your sites is hosted simultaneously on a couple of distributed servers, if one server fails or falls off the network grid, the service is still online on the other servers.
  3. It bills you in the manner of utility, thus no mountainous sunk cost ever for businesses to build up information technology infrastructure of their own. Use as much as you need and pay only for what you use.

What are there?

At Rackspace Cloud, they have created 3 distinct product lines, namely Cloud Sites, Cloud Servers and Cloud Files. Each plan has its own scaling model. Aside from their unique online application to manage your account and websites, you know, creating and editing stuff such as databases, email accounts and down line clients, you will also be allocated certain amount of hosting capacity.

With Cloud Sites at the base price $100 per month, you will have:

  1. 50GB disk storage
  2. 500GB monthly transfer
  3. 10,000 cloud computing cycles (roughly equal to the full capacity of a 2.8 GHz modern processor for a month)
  4. 24 x 7 x 365 online live chat and toll free phone support backed by Fanatical Support™
  5. Both Linux (for LAMP projects) and Windows (for .NET projects) platforms are available at your convenience
  6. Cloud clustering: automatic scaling to the highest capacity available
  7. Resource floors: contrary to Amazon EC2 using ceilings to restrict hosting resource usage, Rackspace Cloud guarantees a floor (minimum resource capacity that will always be exclusively available to you) and gives you as much extra resource as possible when you need them most.

Rackspace Cloud promotion code

You can get all these plus $25 discount by using the Rackspace Cloud promo code:

(Promo ID=134) click to activate

Simply enter the code (Promo ID=134) into the Promo or Referral Code box when you are ordering Cloud Sites:

Enter the promo code in the Promo or Referral Code text box

Activate Promo Code (ID=134) at RackspaceCloud.com »

The discount is available to you at the end of the month as a rebate once you pass the 30-day risk free trial threshold – yes, you can cancel any time you want without risking any money at all. Absolutely free trial in the first 30 days.

This referral code also applies for Cloud Servers and gives you $10 discount off the first month.

{ Comments on this entry are closed }

With all the good ones taken, branding the common keywords / keyphrases may be a better approach in this era of web. Below is a list of short but sweet prefixes and suffixes that I have come up with and that you can use to brand the generic keywords to have an available domain name for registration:

#edge
very#
orbit#
#orbit
#scape
#walk
much#
quick#
rapid#
almost#
#hub
#pro
#book
#zilla
#direct
direct#
#wise
smart#
#guide
#kids
#kid
only#
super#
crazy#
#worth
#worthY
#away
#pulse
#hour
#time
#ever
ever#
#now
#web
#den
#world
#spot
#board
#station
#advisor
next#
find#
#plex
#ground
#academy
#school
#library
#desk
#tutor
#city
#park
#shop
#professor
#source
your#
wild#
insane#
#link
#pages
#page
#paradise
#radar
#planet
#space
#sea
#forest
#ocean
all#
#chat
#talk
#workshop
#muse
#brain
#talent
#stop
#site
#expert
#zone
#line
live#
killer#
#truck
#train
#reloaded
#mania
#mart
get#
#cluster
#junk
#yard
#junkyard
#junction
#ready
#mind
#lounge
know#
#bar
#house
kick#
rock#
#club
#chief
#index
#week
#one
one#
#path
search#
#search
#pedia
#spy
#mall
#central
#articles
#pool
#well
well#
#vision
#user
#land
#watch
#mag
#journal
#note
#mill
#factory
dear#
holy#
#depot
#max
max#
#queen
inside#
mighty#
#beat
#sense
#fact
#data
#eden
dot#
#ark
#clip
just#
#scout
#master
a#
b#
c#
d#
e#
f#
g#
h#
i#
j#
k#
l#
m#
n#
o#
p#
q#
r#
s#
t#
u#
v#
w#
x#
y#
z#

Simply copy and paste these into a text editor, then search and replace ‘#’ with the generic keywords you want. Copy and paste the results into the bulk domain search tool to search and register the available ones that look nice and brandable.

More prefixes and suffixes

#house
#central
#point
#home
#place
#garden
#site
#spot
#park
#dome
#bay
#web
#net
#cave
#base
#heaven
#portal
#world
#camp
#network
#county
#street
#city
#alley
#depot
#valley
#now
#resources
#tools
#source
#review
#system
#book
#guide
#talk
#data
#vision
#load
#box
#focus
#beat
#voice
#share
#cafe
#nexus
#zone
#sight
#link
#lab
#insight
#vine
#board
#flow
#signs
#network
#wire
#cast
#ville
#nation
#egg
#cove
#news
#today
#future
#fun
#watch
#story
#fever
#coast
#side
#road
#heat
#bite
#insider
#club
#connect
the#
my#
i#
#me
we#
you#
e#
top#
pro#
best#
super#
ultra#
all#
cyber#
simply#
free#
1st#
first#
meta#
re#
metro#
urban#
head#
hit#
front#
techno#
ever#
rush#
think#
solo#
radio#
vip#
hot#
smart#
#smart
cool#
hot#
fast#
fresh#
sleek#
first#
daily#
sharp#
light#
classic#
fast#
great#
quick#
ubi#
bis#
ad#
ambi#
inter#
liber#
mono#
poli#
tele#
omni#
exo#
extra#
hyper#
hypo#
intro#
proto#
intra#
micro#
macro#
multi#
neo#
iso#
mono#
#io
#virtus
#ego
#vox
ex#
#ex
#ideo
#novo
novo#
#novus
#pax
#rex
#velox
#verus
#vivo
#nova
pico#
nano#
micro#
milli#
kilo#
mega#
giga#
tera#
peta#
aero#
cosmo#
deca#
eco#
geo#
hex#
oxy#
uni#
poly#
#media
#direct
#access
#ez
#easy
#info
#interactive
#biz
#buzz
#bit
#byte
#up
#tech
#on
#out
#pulse
#venture
#trend
#life
#retro
secret#
#secret

Some of them can be used as both prefix and suffix, some of them can be used as only prefix or only suffix.

Commmon 3-letter Words

the#
and#
for#
are#
but#
not#
you#
all#
any#
#can
her#
was#
one#
our#
#out
#day
get#
has#
#him
his#
how#
#man
new#
#now
old#
see#
two#
#way
#who
#boy
did#
its#
let#
put#
say#
she#
#too
use#
#dad
#mom
#act
#bar
#car
#dew
eat#
#far
#gym
hey#
#ink
#jet
#key
#log
mad#
#nap
odd#
#pal
#ram
saw#
#vet
#wed
yap#
#zoo

{ Comments on this entry are closed }

How to change CJ password? (of Commission Junction)

by Yang Yang on November 21, 2009

This question has been asked a thousand times on the web and Commission Junction has apparently decided to make it harder for the affiliate publishers to find out how to change the password of their account.

To change your CJ account password,

  1. Log into the account area or control panel,
  2. Click “Account” of the top menu,
  3. In the “User Settings” fieldset at the bottom of the page, you must have a user that’s the Superuser of the current CJ account, edit this user account by clicking “Edit”,
  4. A small window should pop up, asking the you for the current password to continue,
  5. Enter your current CJ account password and click “OK”,
  6. The subsequent screen should look like this,
    change cj password
  7. Click “Create new” and the password changing fields should appear,
  8. Type in a new password and click “Save”.

Kind of elusive, huh?

{ Comments on this entry are closed }

IE records all bookmarks or favorite web shortcuts in a folder named Favorites, but where does Firefox store all the bookmarks?

Below are a list of very probable locations where Firefox would save your bookmarks by the OS you are using.

  1. Windows 95 (without Desktop Update)
    C:/Windows/Mozilla
  2. Windows 95 (with Desktop Update)/98/Me
    C:/Windows/Application Data/Mozilla
    C:/Windows/Profiles/<Windows login or user name>/Application Data/Mozilla
  3. Windows NT 4.x
    C:/Winnt/Profiles/<Windows login or user name>/Application Data/Mozilla
  4. Windows 2000 and XP
    C:/Documents and Settings/<Windows login or user name>/Application Data/Mozilla
  5. Windows Vista
    C:/Users/<Windows login or user name>/AppData/Roaming/Mozilla
  6. Unix
    ~/.mozilla/
  7. Mac OS X
    ~/Library/Mozilla/
    ~/Library/Application Support/

With Windows systems, make sure you have selected to display all hidden files or some of the folders such as “Application Data” may not show themselves by default. Also you should replace the “<Windows login or user name>” part to your own login name, which in most cases would be “Administrator”.

Take Windows XP + Firefox 2.0.0.20 / Firefox 3.5 for example, my Firefox stores the current bookmarks in the file:

C:\Documents and Settings\Administrator\Application Data\Mozilla\Firefox\Profiles\gsbmusic.default\bookmarks.html

If you have mistakenly deleted a bookmark or all of them, don’t panic. Firefox backs things up pretty well and you can find historical bookmarks backups in this folder:

C:\Documents and Settings\Administrator\Application Data\Mozilla\Firefox\Profiles\gsbmusic.default\bookmarkbackups

Files in this folder are backups of Firefox bookmarks in the past few days. They are text files in JSON format, hard to read manually but you sure can rescue and recover your lost bookmarks in there, just search “http://” using a text editor.

{ Comments on this entry are closed }

Bloated! Simply bloated to a point that’s not geeky any more.

We need to revert to Firefox 2 and this is the download link of Firefox 2 setup executable file, the latest version Firefox 2.0.0.20, for Windows.

http://releases.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.20/win32/en-US/Firefox%20Setup%202.0.0.20.exe

Otherwise, you can view a list of historical releases of Firefox from the Mozilla team.

Not convinced? Let’s do some googling.

  1. intitle:"ie 7 sucks" -  Results 110 of about 1,190 for intitle:"ie 7 sucks". (0.10 seconds)
  2. intitle:"ie 8 sucks" -  Results 110 of about 152 for intitle:"ie 8 sucks". (0.26 seconds)
  3. intitle:"firefox 3 sucks" -  Results 110 of about 11,300 for intitle:"firefox 3 sucks". (0.35 seconds)

Huh?

{ Comments on this entry are closed }

I have a few tips for you:

  1. Stick to simple white design.
  2. Use no more than 4 colors other than grey scale (white, black, grey). Actually 2 would be perfectly enough for text information intensive sites.
  3. Design the site as if it’s a chapter in a print book.
  4. Plan blank areas.
  5. Be goal oriented and GET RID of EVERYTHING that’s not closely contributing to the goal. You achieve perfect by having nothing to peel off instead of the other way around.

{ Comments on this entry are closed }

Jointly Hosted Forum is now open for forum applications. Please follow the steps outlined in this post to get your own forums.

You will own a section of forums dedicated to topics of your choice (must be family-friendly) and be a moderator of the forums and users.

The service is completely free for all, though we reserve the right to suspend any inappropriate forums at our sole discretion. Other than that, forums inactive for more than 3 months may be suspended.

On top of that, enjoy having your discussion board!

Be a moderator and have your own vBulletin forum!

(This free service is only available to members having 100 or more posts.)

Ever want to create and run your own forum boards? Ever want to be a moderator and administer your own forums and users? Let alone on vBulletin™ which is simply the best and most globally recognized forum software out there?

Now anyone can have his or her own section of forums like this! Just follow these 4 steps:

  1. Register an account at Jointly Hosted Forum.
  2. Post around until you have at least 100 posts.
  3. Apply by starting a thread in this board with these information:
    • Your name: full name would be preferrable
    • Username of registration: your account username at JHF that you would like to be the moderator
    • Your website URL: preferrably the one associated with your forums, but it’s totally ok if you don’t have any
    • Forum purpose: what you are going to use the forums for
    • Forum section title: such as “Make A Website” for this one
    • Forum boards: a title as well as a short description for each of them, such as these
  4. To be notified on the thread after we have created the forums and granted moderation privileges to your account.

Note: Forums inactive for 3 months may be suspended, albeit your user account will always be fine.

{ Comments on this entry are closed }

Introducing Kavoir Backyard

by Yang Yang on November 4, 2009

Update: I finally decided to move the whole vbulletin installation over from jointlyhosted.com to kavoir.com. It’s called Kavoir Backyard.

I created a sub-forums section at Jointly Hosted for Kavoir.com, feel free to register an account, it’s here: http://www.jointlyhosted.com/forum/forumdisplay.php?f=4

For now, almost all the boards are dedicated to technical topics (HTML, CSS, JavaScript, PHP, MySQL, etc.) of web development. If you have any questions regarding developing a website, post them there, interested people and I will try to help you as much as we can. Should these forums become popular, we will add more forums that appeal to webmasters.

To reduce spam, we have disabled signature for all new registrations, you will need 15 posts to be able to use signature which will be automatically enabled for you after your exceeding 15 in the number of posts.

Enjoy! 😉

{ Comments on this entry are closed }

vBulletin allows all newly registered users to create and edit signatures by default, which potentially increases the spam in user registrations. Someone would just sign up and put a few spamming backlinks in the signature and leave, without contributing a little bit to the community, probably writing 1 or 2 spamming posts as well. Therefore, allowing signature / signature links does no good to the forum.

To prevent this from happening and encourage users to actively engage in the community, a good approach is to open or enable signature only to those who have had certain amount of posts, say 20; or have passed a certain length of time after registration, say 10 days.

Step 1: Disable signature for “Registered Users”

Go to the AdminCP of your vBulletin, follow the left menu: Usergroups => Usergroup Manager => Edit “Registered Users” by clicking the corresponding “Go” => In the “Signature Permissions” section, select “No” for “Can Use Signatures”. Now all newly registered users will have no signature privileges at all by default.

Step 2: Add a new Usergroup “Acknowledged Users” with signature capabilities

Create a new Usergroup by: Usergroups => Add New Usergroup => Select “Registered Users” for “Create Usergroup Based off of Usergroup” and click “Go” => Name this Usergroup, eg. “Acknowledged Users” => In the “Signature Permissions” section, select “Yes” for “Can Use Signatures”.

Step 3: Set to automatically promote users with over 20 posts from “R” group to “A” group

Now that you have 2 Usergroups with different signature permissions, the last step is to add a promotion strategy that recognizes all users that have 20 posts or more and promotes them from “Registered Users” to “Acknowledged Users”: Usergroups => Promotions => “Add New Promotion” => Select “Registered Users” for “Usergroup”, specify “10” for “Days Registered”, specify “20” for “Posts”, select “Posts” for “Promotion Strategy” and select “Acknowledged Users” for “Move User to Usergroup” => Click “Save”.

Done. Now vBulletin will automatically promote users that have greater than or equal to 20 posts to a new Usergroup that has signature enabled. Other than promoting by posts, you can also promoting users to a privileged group by reputation.

 

=== Notes ===

In Step 3, you can optionally select “Additional Usergroups” for Promotion Type to add an extra group-ship of the superior group to the user rather than exclusively promoting him to it (so that the Acknowledged Users becomes his only group and he’s not a member of the Registered Users any more).

What happens to users with multiple Usergroups on contradictory permissions?

If a user is assigned to multiple Usergroups, ‘Yes‘ permissions always override ‘No‘ permissions unless one of the groups is a Banned group. In that case, permissions of the Banned group rule – ‘No‘ permissions take precedence.

{ Comments on this entry are closed }