Believe that many have just done site webmaster friends have such feelings, the daily update site is really too tiring. Want to improve the weight of their website to do the site every day to update, and can not be all of a few days to update the article, because this in the search engine seems to be released the same day, the weight of the site does not have any role, there is no way to make the site automatically update it?
Everyone knows the importance of regular updates to the site, search engines like fresh content, if your station is not updated for a long time, light is ranked down, the weight is K. Well, gossip less, the following describes the next site Automatic update ideas.
One, the old station
Here said the old station is not only refers to the construction station time Long website, this kind of station not only has the certain weight, the website also has certain traffic, this kind of station automatic update may let the user create the content the method to realize the automatic update, like the forum, the message book and so on. What about the majority of new stations?
Second, the new station
Here the new station is generally on-line soon, no weight and no traffic. Here is a way of thinking. Take (http://www.xg51.net) as an example, look at this picture:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/58/E5/wKiom1S_yqPQTikQAAFcAHe_1ak955.jpg "title=" QQ picture 20150121223328.png "alt=" Wkiom1s_yqpqtikqaafcahe_1ak955.jpg "/>
It implements the automatic Update method is to add a visitor information for the site, including the user's access time (also including any search engine spiders), IP address, operating system, browser information and so on. This information is not duplicated. As long as a user visits the site, this information is automatically updated, which enables the Web site to be updated. With this method, many new stations
Both weights and rankings have been improved in a short time.
Now post the code to get the Visitor Information (ASP version):
1, the following code writes the guest information to the database.
Dim Lailuurl
If Request.ServerVariables ("Http_referer") <> "then
Lailuurl=request.servervariables ("Http_referer")
Else
Lailuurl= "Enter directly from the address bar"
End If
Getip=request.servervariables ("REMOTE_ADDR")
Set rsonline = Server. CreateObject ("Adodb.recordset")
Sql= "SELECT * from [online] where ip= '" &Getip& "'"
Rsonline. Open sql,conn,1,3
If Rsonline.eof Then
Rsonline.addnew
Rsonline ("browser") =request.servervariables ("Http_user_agent")
Rsonline ("IP") =getip
Rsonline ("StartTime") =now ()
Rsonline ("Lailu") =lailuurl
Rsonline ("dates") =date ()
Rsonline.update
Rsonline.close
End if
function Usersysinfo (info,getinfo)
If InStr (Info, ";") >0 Then
Dim Usersys
Usersys=split (Info, ";")
If UBound (Usersys) >=2 Then
Usersys (1) =replace (Usersys (1), "MSIE", "Internet Explorer")
Usersys (2) =replace (Usersys (2), ")", "")
Usersys (2) =replace (Usersys (2), "NT 5.2", "2003")
Usersys (2) =replace (Usersys (2), "NT 5.1", "XP")
Usersys (2) =replace (Usersys (2), "NT 5.0", "2000")
Usersys (2) =replace (Usersys (2), "NT 6.1", "7")
Usersys (2) =replace (Usersys (2), "9x", "Me")
Usersys (1) = Trim (Usersys (1))
Usersys (2) = Trim (Usersys (2))
If Getinfo=1 Then
Usersysinfo=usersys (1)
Else
Usersysinfo=usersys (2)
End If
Else
If Getinfo=1 Then
Usersysinfo= "Unknown"
Else
Usersysinfo= "Unknown"
End If
End If
Else
If Getinfo=1 Then
Usersysinfo= "Unknown"
Else
Usersysinfo= "Unknown"
End If
End If
End Function
2. Read the information and add it to the Web page
<strong> Visitor Information:</strong>
<ul>
<%set Rs=server. CreateObject ("Adodb.recordset")
Sql= "SELECT * FROM [ONLINE1] ORDER by id DESC"
Rs.Open sql,conn,1,1
For I=1 to 5
If Rs.eof then Exit for
ID=RS ("id")
Times=formatdate (RS ("StartTime"), 1)
Ip=rs ("IP")
suiji=suiji& "<li>id:" &id& "| Access time: "x&" | IP: "&ip&" | Operating system: "&chang (Usersysinfo (" RS ("browser"), 2) & "| Browse
Device: "&usersysinfo (RS (" browser "), 1) &" </li> "& vbCrLf
Rs.movenext
Next
Response.Write Suiji
Rs.close
Set rs=nothing%>
</ul>
Code Description: Create a new table named online and create the following fields, respectively:
Browser field: Used to record guest client information, such as browser, operating system, etc.
IP field: Logs the user's IP address.
StartTime field: Record the time of the visit.
Lailu field: Records the route, that is, from which URL.
Dates field: Record date.
In addition usersysinfo This function is used to read the browser field information.
[Experience sharing] how to make your site automatically updated daily