Local Tech Repair: Website

Pages

Showing posts with label Website. Show all posts
Showing posts with label Website. Show all posts

Sunday, March 29, 2026

AdNauseam: The Ad Blocker That Fights Back

In a web built on tracking, profiling, and behavioral data, most privacy tools play defense—blocking ads, limiting trackers, and trying to stay invisible. AdNauseam takes a far more aggressive stance. It doesn’t just avoid the system—it actively disrupts it.

Monday, September 16, 2013

Website Analytics

I must say we have a geeky community here. It is always interesting to look at analytics and see what type of people look at the site.

Sunday, June 30, 2013

Best way to get Visitors to your Website

So what is the best way to get visitors to your side?  This is the question every company asks about it self.

Friday, May 11, 2012

How to Start Earning Money Online

Earning money online is a complicated process. With out knowing what is out there and what you should and should not do as a beginner can be very complicated. I will go though some of the things that I have learned and hope that others will point out some things that they have learned.

Sunday, April 29, 2012

SEO Your Website and More

Search Engine Optimization is an important process for any professional website. In this post I will explain why Search Engine Optimization is key to your business success and also how to improve upon it.

Wednesday, November 16, 2011

Formatting Your Blog Articles - Part 1

Formatting is a very important thing when it comes to blogging and well any other type of writing. Not only does formatting help your viewers see important headlines, quotes, and many other things. Search engine bots look for different HTML tags and CSS to determine topics and how to index your posts.


Part 1 HTML

Us header commands or bold commands


<h1> text </h1>
<h2> text </h2>
<b> text </b>


Output

text

text

text


These give the viewer eye catching titles for your posts and also give bots titles for it instead of having to guess at what is and whats not.

use things like code tags so that you can format your posts. for instance if you want your code to always be your quotes to look like our code does on our blog you can just use this code in your css.


code {background: #F3EFC3 url(http://img403.imageshack.us/img403/6029/backgroundcode.png) 0 7px;
background-image: url(http://img403.imageshack.us/img403/6029/backgroundcode.png);
background-repeat-x: initial;
background-repeat-y: initial;
background-attachment: initial;
background-position-x: 0px;
background-position-y: 7px;
background-origin: initial;
background-clip: initial;
background-color: #F3EFC3;
overflow-x: auto;
display: block;
width: 95%;
padding: 2% 2.5%;
padding-top: 2%;
padding-right: 2.5%;
padding-bottom: 2%;
padding-left: 2.5%;
margin: 30px 0;
margin-top: 30px;
margin-right: 0px;
margin-bottom: 30px;
margin-left: 0px;
clear: both;
color: #585535;
font-size: 85%;
line-height: 140%;
border: solid 1px #E8E3B8;
border-top-style: solid;
border-right-style: solid;
border-left-style: solid;
border-top-width: 1px;
border-right-width: 1px;
border-left-width: 1px;
border-top-color: #E8E3B8;
border-right-color: #E8E3B8;
border-left-color: #E8E3B8;
border-bottom: solid 1px #D9D4A8;
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color: #D9D4A8;
-moz-border-radius: 15px;
border-radius: 15px;
}


for linking text so that your user does not loss you remember to add target="_blank" to your links so that the link they click will open in a new tab.

<a href="http://localtechrepair.blogspot.com" target="_blank">local tech repair</a>

will come out like this
local tech repair

if your wanting your paragraphs to auto intent so that you don't have to do it your self when writing you can make sure that they always do it with css.


p
{
text-indent:50px;
}

This will make sure that it is always indented at ever new paragraph granted that there be a p tag

Well I hope you liked this first part of this post hope you read the next coming soon.

Local Tech Repair Admin

Saturday, July 23, 2011

Google Search Image with an image

Google recently updated their google image search so that you can now use an image on your computer or a link to an image to search for more of that image or related images. This can be very helpful if your looking for more images of different sizes if you have a small image or looking for more related images to that exact image.

For example if you had a picture of a church of england but you did not know what it was you could search for it.
Church
This helps find a nice new images or larger ones and can even give you a name.

Though along with this nice new feature comes privacy concerns as always with any new nice improvement anything can be used for good or bad. This is a great tool for any stalker out there he can use a picture he has to try to search for more of who ever he is stalking and see if he can find more sites where that person is members of. This is also good for hackers.

Though if you want to try it out your self you can just go to the following link.
http://www.google.com/imghp?hl=en&tab=wi
click on the camera and then paste the url or upload the image.

from there it will give you a search result for the image.

Hope this helps you with your searches.
Local Tech Repair Admin

Saturday, July 16, 2011

Is Facebook Chat Right or Wrong Direction

Facebook Chat used to be a simple chat program that took up very little of the screen making the content that you wanted to see visible with out having many things in the way besides their ads...

Though now facebook has decided to make it a large % of the screen. Is the primary reason why people go on facebook to chat? If so this may be the right direction for facebook to go trying to turn facebook in to a chat room between friends. Though in at-least my eyes it is worse than it used to be I personally liked having filters for my facebook chat being able to minimize different groups of friends and only seeing the friends that I talk to a lot online I don't need to see every high school or college friend on my right side of the screen.

This move makes Facebook more cluttered in my opinion and it makes it continuing on the same road that myspace went. This move could be because they are worried that places like Google+ may steal their audience because of the nice features that google+ has in chat and in simplicity. Though Facebook made it harder to get ride of the chat than it was before. They made it show all friends and not just the ones online which makes it very big and annoying. I really don't care about someone that is not online right now for me to talk to. I rather see people that are online even if I don't talk to them as much as the people that are offline.

With Facebooks continue movement backwards in their development making their site worse than better is one of the main reasons why I personally am moving away from Facebook for more simple and clean places like google+ which gives me much more control over my privacy and information.

Thanks for reading,
Local Tech Repair Admin

Saturday, June 18, 2011

Wordpress Auto Update Twitter and Facebook Page's Wall

When it comes to news sites and blogs getting people to know that you write something or getting people following you is very important for business and website. If you use Wordpress for your blog software and are wondering how to set it up to automatically update your Facebook page lets your users know that there is new information for them to read and hopefully make you some money enjoying your content.

Some things that you will need is Facebook page or Twitter or both, the address to you Wordpress feed location for example http://commonsensepolitics.co.cc/feed/atom/, and a twitterfeed.com account this is what pushes the updates to your Facebook and twitter account.

with these things you should be easily able to setup your Wordpress website/blog to automatically update your facebook pages and/or Twitter wall.

Thanks,
local tech repair admin

more useful links:
Auto Update Blogger to your twitter - twitterfeed
Auto update blogger to facebook page or wall

Auto Update Blogger to Facebook Page or Wall

I recently wanted to start a facebook page for my blog to get more of a social networking advantage to my website that I found hard to do by my self. So I started to look for ways to get my facebook page to auto update when ever I have a new post on my blog. I don't want to have to manually go to all my other sites to have it automatically publish that I recently created a new article.

So after a little searching it was not hard to figure out how to add blogspot posts to your facebook wall as long as you know a few things. First thing you will need is a facebook account and page which you probably already have if your reading this. The second is you will need to know the address of your feed for your blogspot account. For instance for this blog we use atom feed to set up the auto feed to facebook.

example:
http://localtechrepair.blogspot.com/atom.xml

Every blog on blogspot or blogger has this atom feed already enabled so you will be able to easily use this.

The next thing you will need is to sign up for a free account on twitterfeed.com they have an easy interface to set up your wall posts.

once you login step one will give the feed a name (aka name of your blog "local tech repair" for this blog) then you will need to add your feed address (the second thing you needed to have)

then in step 2 you will want to click on facebook and connect it to your facebook profile. You need to accept the application request and once you have connected your facebook you need to make sure that you select your page or wall depending on where you want it to push updates.

then you are done. one thing to note is that twitterfeed.com only pushes new posts every 30 mins I do not know how it handles more than one update per 30 min time period.


hope this helps,
local tech repair admin

Auto Update Blogger to your twitter - twitterfeed

I very recently started a twitter account which is my first ever twitter account for local tech repair. I was looking for a easy way to update my twitter with posts from my blogger with out having me having to manually add the each new post to the twitter wall.

So after a little searching it was not hard to figure out how to add blogspot posts to your twitter wall as long as you know a few things. First thing you will need is a twitter account which you probably already have if your reading this. The second is you will need to know the address of your feed for your blogspot account. For instance for this blog we use atom feed to set up the auto feed to twitter.

example:
http://localtechrepair.blogspot.com/atom.xml

Every blog on blogspot or blogger has this atom feed already enabled so you will be able to easily use this.

The next thing you will need is to sign up for a free account on twitterfeed.com they have an easy interface to set up your wall posts.

once you login step one will give the feed a name (aka name of your blog "local tech repair" for this blog) then you will need to add your feed address (the second thing you needed to have)

in step 2 you will need to click on twitter and then connect the account to your twitter account.

Now that you have done this your feed should be liked to your twitter account. The only way to test if it works is by creating a new post on your blog and wait for it to show up on your wall. This happened almost immediately for me but ya.

hope this helps,
local tech repair admin


*update*
There is also another way if you do not want to use twitterfeed.com
if you go to your settings and then go to feedburner then you can also have it push automatically from there to your twitter.
under feedburner got to publicize then go to socialize and connect it to your twitter account this effectively does the exact same as above but automatically when a new post not ever 30 mins as twitterfeed.com does.

Friday, June 3, 2011

Google Custom Search Engine Blogger Not working

For Those that use google blogger or google blogspot for their blog like this site does. When your in google adsense and want to add a custom search engine (CSE) to help customers find the information that they are looking for easier a custom search engine is a nice way to go. Though if you found out how I have that the search engine will not index the site or the custom search engine results.

So if you want to know how to fix this problem it is really simple but time consuming fix if you have many different posts. When adsense asks for "Specify a list of websites to search, one URL per line. You will be able to edit this list and add more sites later" you will need to add each. if you just add your website name for instance for this website http://localtechrepair.blogspot.com it will only pull the results from the Home page and not the actual posts on the site. To get it to work you will need to add each post that you right in a new line in that box on adsense. This will allow your users to search the whole website instead of just the home page of the website.

This is not a nice fix to the custom search engine not working but it does work.

If anyone knows of any good custom search engines that are like Google's CSE then I and the rest of the readers would love to know about them any how well they work.

I hope this helps,
Local Tech Repair admin

*Update*

it looks like you can use variables in your site name. so instead of using just
http://localtechrepair.blogspot.com

you want to put it in like
http://localtechrepair.blogspot.com/*

this should bring up all the resulting pages. this frees you from manually inputing each articles link

Sunday, May 22, 2011

Website Security

Recently today I was searching my email address on google to see what information there is out there about me and what not. This is a good practice to do to keep track of what you have out on the internet. But I ran across a website that I had bought from before that had a large chunk of their client emails and some staff emails out in the open.

I was horrified that the company (a tech company) was not taking my privacy to the utmost respect and had a what I consider a major security hole. Granted that the only information out there was email addresses but the problem is that if I was a black hat (evil hacker) and wanted to just see out of the thousand emails that I could do to get some fun information from them.

There are many different kinds of approaches a black hat could take in what they wanted to do with the information. There are many different social engineering attacks they could do. For instance sense they had internal emails of staff it opened up the attacker of impersonating one of the coworkers in an attack to infect a workers computer with a trojan so that the hacker could get access to the internal network and from there do a lot greater damage.

The black hat could use the other emails to send out personalized emails to the customers trying to get them to login to a fake site or use some form of XSS to help him gather usernames and passwords and from there maybe even more information like addresses and credit card information. Maybe the black hat is impersonating the company and their website and offering a free mp3 player coupon for being a loyal customer of the company. All you need to do is update your information and pay for shipping and handling (to get credit card).

There are 2 lessons that we can learn from this.

1. check what information is out there on the internet and always double check the addresses that people send you over email.

2. If your a website never let the public see anything more than they have to see. everything else needs to be protected.


Hope you check your stuff on google.
local tech repair admin




Saturday, May 14, 2011

How to Prevent Viruses on Windows

Getting viruses on your computer can be costly in both time and if you get them professionally removed then it may cost you a bunch of money. To keep from having to waste all that time and money and keep your computer healthy and your private data safe it is better to prevent your self from getting viruses in the first place.


The first thing you will need is to make sure that there is not already any viruses or worms on your computer to start with. If your starting with a new computer is always the best.

so step one would be installing firefox, chrome, opera, or another web browser other than windows IE. If you must use IE then make sure it is updated to the newest version which right now is version 9.

the second thing is to get a good anti virus installed on your computer and always download the anti virus software from their venders website not anywhere else.
for a list of anti virus software you will want to visit.
http://www.av-test.org/certifications.php

AV test test different anti virus software against many different known viruses out there and sees how many false positives and false negatives that each vender has and also test usability and how well they repair if the computer does get infected. Going of their rating is a good way to compare anti virus software.

if you like to read reviews and compare different anti viruses to each other you may want to check out the following website.
http://www.av-comparatives.org/en/comparativesreviews

These websites are great starts to finding the best anti virus software that fits your needs.


The third step that you will want to take is to make sure you have a good anti malware program. I would personally suggest getting spybot S&D and malware bytes.


Fourth thing you will need to do is not use P2P programs like limewire, frostwire, or bittorrent. If you must use them then read comments on your bit torrent site to make sure that other users are not noticing that the files do not contain viruses. If a video asks you to install a codec to run the video do not install the codec as it is most likely a virus. For all the codec that you will ever need please download http://www.cccp-project.net/ as it will have all the codec that will ever be on any torrent site. And if the video still asks you to install a codec from a site then try to find a different torrent with the same video as the one you got was not good.

don't download random games online or get "free" ringtons as a lot of the time these things contain viruses. A good site to download random thing from is http://download.com

And always keep your computer up to date. Turn on Windows auto Update.

Thanks for reading,
Local Tech Repair Admin


*update*
also check out the link below for updated certifications on anti virus programs for the best that fits you
http://www.av-test.org/certifications

Monday, April 4, 2011

Browser Stats for Local Tech Repair

For those wondering what our browsers stats have been sense we started this blog. I will show you some of the numbers on which browsers visit the site the most.

here is a small list of some of the browsers and their percentages:

  1. Firefox 41.26%
  2. Chome 32.11%
  3. Internet Explorer 13.31%
  4. Safari 11.68%
  5. Opera 1.00%
  6. Mozilla Compatible Agent .33%
  7. Konqueror .17%
  8. RockMelt .17%
the interesting thing is that rockmelt spends the most time on average on the site. then comes chrome and then firefox.
it seems that the more techy the browser the longer you stay on the site.

figured some of the folks that read this blog would like to know or be interested in seeing some of the numbers.

hope you have a wonderful day


-local tech repair

Wednesday, March 23, 2011

Adsense vs infolinks

So this blog does not get much in the form of revenue but just a little comparison that I was running on which of these 2 bring in money and which at a higher rate. so if your interested in a small blogs rate difference between the infolinks in text double underline links revenue vs the adsense revenue then read on.


So far i been running both of these ad revenue products side by side on this blog which does not get a huge amount of visitors and does have a fairly large bounce rate but for those that actually read the blog I will be removing the infolinks. here is a little bit why.

i have had in the past month 4 clicks on the infolinks (yes i know that is not much) which brings in a revenue of only $.04 total.
to compare with adsense I have in this month only 1 click (which is even less) but the difference is that the revenue for adsense 1 click was $.66 which by far out ways the infolinks.

so from just an earnings perspective adsense makes more sense.

visual perspective. the more and more I think about the difference between adsense and infolinks the more I start regretting ever putting on infolinks. To me infolinks method of getting clicks is by trying to trick the user into clicking on a link thinking it was something useful that the author posted there. I believe this takes away from the readability and the credibility of the article that the user reads. This is my second reason for not using Infolinks.

Adsense on the other hand gives you much control where to place the ads and what type of ads you do place. from this perspective i do not see the adsense taking away from the page and i try to place the ads in ways that they only ad to the site and not just be the very first thing you see. like an ad in the banner on the top of the page.

Another thing is the reports that infolinks gives you. The lack of info compared to adsense just made me want to use adsense even more. adsense's layout gave me much more options to figure out where exactly the clicks where coming from and it also integrates in with google analytics which is very nice because you can see where on the page the click actually happened and on what pages.

with all these things I believe that adsense by google is by far better than infolinks.

I hope this helps you make a better informed choice about what advertising unit to use on your own site.

your friendly,
local tech repair admin

Tuesday, February 1, 2011

Amazon Astore - aka Local Tech Repairs Store

For those that do not know already what an Astore is from amazon is. the Astore is a store that you are able to have on your site that functions much like the ads on your site but you get to pick what is in your store and how it should look and function.
For instance we here at Local Tech Repair use the Astore to list different books, computers, and kindle stuff.  The beautiful thing about the store is that you do not have to have any of the merchandise.  Everything in the store is sold buy amazon and who ever sells on amazon it and you get a % of the sale. 

Positives:
  • you don't have to have and warehouse. 
  • you don't have to ship anything
  • it does not cost you anything to run. 
  • you get the amazing amazon experience with out really doing anything
Negatives:
  • the default size is kinda small and can take editing of css
  • not as nice as shopping on amazon
Over all it give your visitors something else to do on your site. If you like to try out the store head on over to the store at the top of the page.  Just another thing that amazon give you to help earn more money. 

for those that want to know what my store template was here is it is:

Global

/* PAGE STYLE */
body {
margin:24px;
padding:0px;
background:#020202;
color:#F7EBEB;
min-width:748px;
font-family:'Verdana', sans-serif;
font-size:9pt;
font-weight:500;
line-height:12pt;
text-decoration: none;
}
table {
font-family:'Verdana', sans-serif;
font-size:9pt;
}
form {
margin:0px;
}
a {
color: #FDFB04;
text-decoration: underline;
}
a img{ border:none;}
hr {
border:0;
width:100%;
color:#146EB4;
background-color:#146EB4;
height:1px;
width:100%;
margin:6px 0px 12px 0px;
}
#wrap {
width:748px;
}
#rule {
height:1px;
background-color:#F7EBEB;
width:100%;
margin:6px 0px 12px 0px;
}
h2 {
font-size:16px;
font-weight:bold;
margin:0px;
padding:0px;
}
h3 {
font-size:14px;
font-weight:bold;
margin:0px;
padding:0px;
}

/* MAIN PAGE AREA */
#mainwrap {
float:right;
}
#main {
width:530px;
margin-bottom:19px;
overflow:hidden;
}
div#header {
background:#146EB4;
padding:6px 24px 4px;
margin:0;
vertical-align:middle;
}
a#mainheadertitle {
padding:0px;
font-family:'Georgia', serif;
font-size:24pt;
font-weight:normal;
line-height:1.5em;
color:#FFFFFF;
margin:0px;
text-align:left;
vertical-align:middle;
text-decoration:none;
}
a#mainheadertitle:hover {
text-decoration:underline;
}
td#mainheaderlogo {
padding:5px;
}
img#mainlogo {
padding-right:5px;
}
div#mainsubheader {
background:#2F2323;
padding:10px 24px;
vertical-align:middle;
}
div#contentsubheader {
width:482px;
overflow:hidden;
}
div#subheaderlinks {
float:right;
text-align:right;
}
div#subheadertitle {
font-size:12pt;
font-weight:bold;
}
div#contenterror {
background:#322525;
padding:14px 24px;
}
span.currentpage {
font-weight:bold;
}

span.error {
font-weight:bold;
}

/* SIDEBAR */
#sidebar {
float:left;
width:200px;
overflow:hidden;
}
#sidebar ul {
margin-bottom:0;
}
#sidebar h3, #sidebar p {
padding:0 10px;
}

/* GENERAL SIDEBAR WIDGET STYLES */
ul#widget,ul.widget li.widget {
margin:0;
padding:0;
list-style:none;
}
li.widget {
float:left;
width:200px;
margin-bottom:19px;
}
ul#widget div {
background:#322525;
}
ul#widget h3 {
font-family:'Verdana', sans-serif;
font-size: 10pt;
font-weight: bold;
color:#FFFFFF;
margin:0px;
padding:6px 15px 4px;
text-align:left;
background:#146EB4;
}
ul#widget p {
font-family:'Verdana', sans-serif;
font-size: 9pt;
font-weight: normal;
color:#F7EBEB;
margin:0px;
padding: 10px 15px 20px;
}

/* SEARCHBROWSE WIDGET */
div#searchbrowse {
padding:14px;
}
div#searchbrowse div.indent {
padding: 5px 0px 5px 15px;
}
select.searchwidget {
width:173px;
margin-bottom:6px;
}
input#searchwidgetkeywords {
width:134px;
}
span#SearchAtAmazon {
font-size: 8pt;
}
div#browsetitle {
font-weight:bold;
padding-bottom:7px;
}
span.selectedcategory {
font-weight:bold;
}

/* LISTMANIA WIDGET */
div.listwidget {
padding-bottom:16px;
}
ul.listmania {
margin:0px;
padding:0px;
list-style:none;
}
ul.listmania li {
margin:0px;
padding:5px;
padding-left:10px;
list-style:none;
text-align:center;
}
ul.listmania li.clsOdd,li.listimages {
background-color:#342626;
}
ul.listmania li.clsEven {
background-color:#322525;
}

img.listimage {
display:block;
margin-left:auto;
margin-right:auto;
}

/* PRODUCTS WIDGETS */
div.productwidget {
padding:0px;
padding-bottom:16px;
}
div.productwidget .price {
font-weight:bold;
}
table.sidebarproducts {
font-family:'Verdana', sans-serif;
font-size:9pt;
width:200px;
}
table.sidebarproducts td {
padding:5px;
}
table.sidebarproducts td.image {
vertical-align:top;
width:75px;
}
table.sidebarproducts td.text {
vertical-align:middle;
width:115px;
}
table.sidebarproducts span.listtitle {
font-weight:bold;
}
div.privacylink {
padding: 2px 5px;
font-size:7pt;
text-align:center;
}

/* FOOTER */
div#footer {
width:530px;
margin-bottom:28px;
color:#146EB4;
border-top:1px solid #146EB4;
}
div#footer p {
padding:5px;
margin:0;
}
div#leftfoot {
float:left;
width:430px;
}
div#rightfoot {
float:right;
width:100px;
text-align:right;
}

/* WISHLIST WIDGET */
div#wishlist_page_link
{
padding:7px 5px 5px;
}

/*Associate Provided CSS*/
#wrap {
width:1100px;
}
#main {
width:880px;
margin-bottom:19px;
overflow:hidden;
}
div#footer {
width:880px;
margin-bottom:28px;
color:#0B0E60;
border-top:1px solid #0B0E60;
}
div#rightfoot {
float:right;
width:100px;
text-align:center;
}
div#contentsubheader {
width:650px;
overflow:hidden;
}



Category Page

div#featuredProducts {
background:#322525;
padding:14px 24px;
}
div#featuredProducts .price {
font-weight:bold;
}
table.products {
width:482px;
font-family:'Verdana', sans-serif;
font-size:9pt;
}
table.products td {
width:33%;
padding:5px;
}
table.products tr.pagination {
text-align:center;
}
table.products tr.imagerow td {
vertical-align:bottom;
}
table.products tr.textrow td {
vertical-align:top;
padding-bottom:20px;
}

/*Associate Provided CSS*/
table.products {
width:852px;
font-family:'Verdana', sans-serif;
font-size:9pt;
}


Making Money off your Website

So one of the main questions is how do i make money off my website or blog. there are many different type of methods to monetize your website. one the large web advertisers is google adsense. Google pays for your per click that your receive.  Google has different type ads that you can put on your site. they have search ads which allow the person to search the web from your site and you get money if they click on ads in the search. they have content ads that can be targeted to specific content that you want to show. and they have feed ads.  some of these ads you may notice look like the ads  under this post, to the right and left of this post. these ads pay different amounts of money depending on what ad is displaying and how much demand there is for that type of category.  Though these ads a lot of time are blocked by programs like adblock plus so this can reduce the revenue that your receive from your website.  these programs our out there because website administrators sometimes go crazy in the amount of ads they put on their website or just how annoying the ads become on their site.
One thing i think of ads is that they are supposed to add something to your site not take away from it. if the first thing you saw on a website was a large banner ad would you want to continue looking down the page? I wouldn't that or i would just remove the ads on the whole page. it is good to have ads on a page as it helps keep the website running many times with out asking for donations from their users.

But Google adsense is not the only type of ads out there. I personally like Amazon Associates.
Amazon has become very nice in how they do ads. they offer even more types of ads than google does. Though Amazon uses a different type of revenue method, they don't pay per click.  Amazon pays per turn around in store. so if a visitor clicks on one of amazon ads you don't get paid till they buy something.  You may think that this is not as good because you have to wait for someone to buy something before you see any money from that visitor. yes that is one problem though amazon allows you to very much target your audience. for instance if you look at the bottom of this post you will see ads on topics of making money off a website. these i specifically put there and selected each one. this gives you a incredible control over your.
example lets say you where talking about a magazine and you happened to like Website Magazine December 2009. your visitors will be able to see the text with out being interrupted but if they are more interested in that book, game, video, magazine, etc. then they can click on it with out it interrupting their reading.  this is a very non intrusive way of advertising.

if you want to know more about this or more about specifically adsense or amazon then let me know in comments. if you want further reading on how to monetize your website here are some books.
  

Saturday, January 29, 2011

Checking form submit with php

so one thing that took me a while to figure out is how to have php check the form submissions in the same page but only if the form was submitted. another thing was if something was wrong being able to have php give default values that where already submitted if there was a problem. so better than me talking let me show you code.

but let me explain what this form is in the first place. this is a medical history form for dogs. this shows when their last medical test for certain things where done on.
---------form.php-------------------
<?
include ("header.php");
include "../connect.php";
?>
<td class="left_content"><div align="center"><strong>Here are some Use full links</strong></div><br />
<?include ("../leftside.php");?>




</td>
<td class="body_content"><strong><h4 id="title"> Medical Record </h4></strong>
<?php
if ($_POST['submit'] == "Update") { // this checks to see if the submitted form name is Update
$name = $_POST['pName'];
$DHLPP = $_POST["DHLPP"];
$Rabies = $_POST["Rabies"];
$Bordatella = $_POST["Bordatella"];
$heartworm = $_POST["heartworm"];
$worming= $_POST["worming"];
$flea= $_POST["flea"];
$Fixed= $_POST["Fixed"];
$pinHips= $_POST["pinHips"];
$OFA= $_POST["OFA"];
$Eye= $_POST["Eye"];
$wellness= $_POST["wellness"];
$sql = "SELECT * FROM Medical where dogName = '$name'";
$results=mysql_query($sql) or die (mysql_error());
$row= mysql_fetch_array($results);
$numrow = mysql_num_rows($results);
while ($row= mysql_fetch_array($results)){
$id = $row['ID'];
}
if ($numrow == 1) {
$sql = "UPDATE Medical SET dogName = '$name', DHLPP = '$DHLPP', Rabies = '$Rabies',
Bordatella = '$Bordatella', heartworm = '$heartworm', worming = '$worming',
flea = '$flea', Fixed = '$Fixed', pinHips = '$pinHips', OFA = '$OFA', Eye = '$Eye',
wellness = '$wellness'
WHERE dogName = '$name'";
$result = mysql_query($sql) or die (mysql_error());
if ($result) { echo "updated"; }
$date = date('Y-m-d');
$sql="INSERT INTO MedicalHistory (dogName, DHLPP, Rabies, Bordatella, heartworm, worming, flea, Fixed, pinHips, OFA, Eye, wellness, dateadd)
VALUES ('$name','$DHLPP','$Rabies','$Bordatella','$heartworm','$worming','$flea','$Fixed','$pinHips','$OFA','$Eye','$wellness','$date')";
$result = mysql_query($sql) or die (mysql_error());
} else {
$name = $_POST['pName'];
$DHLPP = $_POST["DHLPP"];
$Rabies = $_POST["Rabies"];
$Bordatella = $_POST["Bordatella"];
$heartworm = $_POST["heartworm"];
$worming= $_POST["worming"];
$flea= $_POST["flea"];
$Fixed= $_POST["Fixed"];
$pinHips= $_POST["pinHips"];
$OFA= $_POST["OFA"];
$Eye= $_POST["Eye"];
$wellness= $_POST["wellness"];
$sql="INSERT INTO Medical (dogName, DHLPP, Rabies, Bordatella, heartworm, worming, flea, Fixed, pinHips, OFA, Eye, wellness)
VALUES ('$name','$DHLPP','$Rabies','$Bordatella','$heartworm','$worming','$flea','$Fixed','$pinHips','$OFA','$Eye','$wellness')";
$result = mysql_query($sql) or die (mysql_error());
if ($result) { echo "inserted"; }

$date = date('Y-m-d');
$sql="INSERT INTO MedicalHistory (dogName, DHLPP, Rabies, Bordatella, heartworm, worming, flea, Fixed, pinHips, OFA, Eye, wellness, dateadd)
VALUES ('$name','$DHLPP','$Rabies','$Bordatella','$heartworm','$worming','$flea','$Fixed','$pinHips','$OFA','$Eye','$wellness','$date')";
$result = mysql_query($sql) or die (mysql_error());

}

} else {if ($_POST['submit'] == "Delete Dog") {
$name = $_POST['pName'];

$sql = "DELETE FROM Medical WHERE dogName = '$name'";
$result = mysql_query($sql) or die (mysql_error());
if ($result) {echo "Deleted Dog";}
}
}
$name = $_POST['pName'];
$sql = "SELECT * FROM Medical where dogName = '$name'";
$results=mysql_query($sql) or die (mysql_error());

$row= mysql_fetch_array($results);

$DHLPP = $row["DHLPP"];
$Rabies = $row["Rabies"];
$Bordatella = $row["Bordatella"];
$heartworm = $row["heartworm"];
$worming= $row["worming"];
$flea= $row["flea"];
$Fixed= $row["Fixed"];
$pinHips= $row["pinHips"];
$OFA= $row["OFA"];
$Eye= $row["Eye"];
$wellness= $row["wellness"];

?>
<form method="POST" action="">
<?php
$query = "SELECT * FROM Dogs";
$arr = mysql_query($query);


echo "<select name='pName'>";
echo "<option value=" . $name . ">" . $name . "</option>";
while ($row = mysql_fetch_array($arr)) {
$title = $row["Name"];

if ($title != $name) {
echo "<option value=" . $title . ">" . $title . "</option>";
}
}
echo "</select>";
?>
<br />
<input type="submit" value="Change Dogs">
</form>

<form method="POST" action="">
<table>
<tr>
<td colspan="2">
<input type="hidden" name="pName" value="<?php print $name; ?>"/>

</td>
</tr>
<tr>
<td>DHLPP</td>
<td><input type="date" name="DHLPP" value="<?php if ($DHLPP != "0000-00-00"){print $DHLPP; } ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
<tr>
<td>Rabies</td>
<td><input type="date" name="Rabies" value="<?php if ($Rabies != "0000-00-00"){print $Rabies;} ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
<tr>
<td>Bordatella</td>
<td><input type="date" name="Bordatella" value="<?php if ($Bordatella != "0000-00-00"){ print $Bordatella;} ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
<tr>
<td>heartworm</td>
<td><input type="date" name="heartworm" value="<?php if ($heartworm != "0000-00-00"){ print $heartworm;} ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
<tr>
<td>worming</td>
<td><input type="date" name="worming" value="<?php if ($worming != "0000-00-00"){ print $worming;} ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
<tr>
<td>flea</td>
<td><input type="date" name="flea" value="<?php if ($flea != "0000-00-00"){ print $flea;} ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
<tr>
<td>Fixed</td>
<td><input type="date" name ="Fixed" value="<?php if ($Fixed != "0000-00-00"){ print $Fixed; } ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
<tr>
<td>pinHips</td>
<td><input type="date" name="pinHips" value="<?php if ($pinHips != "0000-00-00"){ print $pinHips;} ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
<tr>
<td>OFA</td>
<td><input type="date" name="OFA" value="<?php if ($OFA != "0000-00-00"){ print $OFA;} ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
<tr>
<td>Eye</td>
<td><input type="date" name="Eye" value="<?php if ($Eye != "0000-00-00"){ print $Eye; } ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
<tr>
<td>Wellness</td>
<td><input type="date" name="wellness" value="<?php if ($wellness != "0000-00-00"){ print $wellness;} ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="submit" value="Update" />
<input type="submit" name="submit" value="Delete Dog" />
</td>
</tr>
</table>
</form>




<?php

$ip = $_SERVER['REMOTE_ADDR'];
$username = $_COOKIE['Username'];
$date = date('Y-m-d H:i:s');
$sql = "insert into loginHistory (ip, username, datetime) VALUES ('$ip','$username','$date')";
$result=mysql_query($sql);
?>

</td>
<?
include ("../footer.php");
?>
---------------------------------


let me explain this in more detail

when a form is either submitted or not it will run this
<tr>
<td>Wellness</td>
<td><input type="date" name="wellness" value="<?php if ($wellness != "0000-00-00"){ print $wellness;} ?>" />(Ex: YYYY-MM-DD)</td>
</tr>
this is date input type which is a standard coming in html5 that makes sure that before someone submits a form it makes sure that it is a date. though if the browser is not html5 compatible then it will treat it like a text input.
the php in this is checking if the variable $wellness does not not equal 0000-00-00 which is a default input in a mysql database for a date type if the input is blank.

so basicly if it equals anything but 0000-00-00 it will print the variable $wellness in the value. so if $wellness = 2010-01-01 then the input in html will look more like
      <td><input type="date" name="wellness" value="2010-01-01" />(Ex: YYYY-MM-DD)</td>

if your wanting to check each input then you can with in the
if ($_POST['submit'] == "Update") {
you can have separate if statements for each input

so if i wanted to check if the date was exactly 10 characters long then i would run a if statment like this

if (strlen($wellness) != 10 ) {
throw some kind of error
}

the possibilities are endless this is just one thing i have done when i was trying to make my input form more dynamic and not having to have multiple pages.

also if your using a GET statement you can do the same thing. the key is that the input needs to have a name of submit and the value can be checked that way.

i hope you enjoyed this little php and html from local tech repair
if you have comments or other ideas i would love to hear them.
thanks for reading,
josh (Local Tech Repair)

Wednesday, January 26, 2011

keep track of who access your site.

if you have a login based site and your wanting to keep track of who logs in and where they are login in from. here is a simple script that helps you do this.
you can also use this for users to be able to see where they have logged in from so they know if someone else is login in using their name.

------------script--------
<?php
include "../connect.php";   //brings in connection information
$ip = $_SERVER['REMOTE_ADDR'];  // grabs the users IP address
$username = $_COOKIE['Username'];  // checks for the username probably be smarter to use a session so the cookie does not get deleted
$date = date('Y-m-d H:i:s');  // grabes the server time
$sql = "insert into loginHistory (ip, username, datetime) VALUES ('$ip','$username','$date')"; // insert query
$result=mysql_query($sql); // finally inserts it.
?>
-------------------------------


from here if you wanted you display it in different manners how ever you want to.

for instance below you could do...


--------------script2------------------
include ("../connect.php");
// Build SQL Query
$sql = 'SELECT * FROM `loginHistory` ORDER BY `id` DESC LIMIT 0, 20 ';
$numresults=mysql_query($sql);
$count = 1 + $s ;
print " <table border='1' cellspacing='3' cellpadding='2'>";
// now you can display the results returned
print "<tr><td>Count</td><td>IP Address</td><td>User</td><td>Date and Time</td></tr>";
while ($row= mysql_fetch_array($numresults)) {
$title = $row["IP"];
$title2 = $row["username"];
$title3 = $row["datetime"];
print "<tr><td>";
echo "$count";
print "</td><td>";
echo "$title";
print "</td><td>";
echo " $title2" ;
print "</td><td>";
echo " $title3" ;
print "</td></tr>";
$count++ ;
}
print "</table>";

?>
--------------------------------------------------------
what this does is create a table and then fill it with a count, ip address, username, and date time that they last checked the page.

warning if you have a lot of members this script can put a lot of stress on your system because this will log each time the user loads a page or what ever page you put this on... if you put this on the login you will not have that problem though. it will only log once.