Home  >  Article  >  Operation and Maintenance  >  How to make the website automatically update every day

How to make the website automatically update every day

PHPz
PHPzforward
2023-05-17 08:34:2211633browse

Many webmaster friends who have just started to build websites will feel the same way. Daily website updates are indeed very cumbersome. If you want to increase the weight of your website, you must make sure that the website is updated every day, and you cannot update several days of articles at once, because in the eyes of search engines, these are still published on the same day and have no impact on the weight of the website. Is there any way to make the website update automatically?

We all know the importance of frequent updates to a website. Search engines like fresh content. If your website is not updated for a long time, your ranking will drop, or it will be deleted. Okay, without further ado, let’s introduce the idea of ​​automatic website update.

1. Old sites

The old sites mentioned here not only refer to websites that have been established for a long time. Such sites not only have a certain weight, but also have a certain amount of traffic. The automatic Updates allow users to create content in ways to achieve automatic updates, such as forums, guestbooks, etc. So what to do with most new sites?

Second, new site

The new site here is usually launched not long ago and has no weight or traffic. Here is an idea. As shown in the figure below, take (http://www.xg51.net) as an example:

How to make the website automatically update every day

The method to achieve automatic update is to add a visitor information to the website, including The user’s access time (also including any search engine spider), IP address, operating system, browser information, etc. This information is not repeated. The website will automatically update information as long as there is a user access, thereby achieving rolling updates. Using this method, many new sites

have improved their weight and ranking in a short period of time.

Now post the code to obtain visitor information (ASP version):

1. The following code writes visitor information into 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.oldSet")

SQL = "Select * from [Online] where ip = '" & getip & "'"

## rsonline.open sql, conn, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 3

If rsonline.eof then

rsonline.addnew

rsonline("browser")=Request.ServerVariables("HTTP_USER_AGENT")

rsonline( "ip")=Getip

                                                                  out out ‐ off ‐ ‐ ‐                   ‐ ‐ ‐               rsonline("startTime")=now()

                                  ’'s ‐ rsonline(''s'' out's being ‐ rsonline's's's's's‐‐‐‐ rsonline("dates")=Date ()

rsonline.update

rsonline.close

End if

function usersysinfo(info,getinfo)

if instr( info,";")>0 then

        dim usersys

        usersys=split(info,";")

                                              ‐          ‐                                                                                                                                         in   in  

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

Use usersysinfo = Usersys (2)

End if

Else

## iF GetInfo = 1 then

## Usersysysinfo = "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 increase the increase. To the web page

Visitor information:

    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&"
  • ID:"&id&" | Access time:"×&" | IP:"&ip&" | Operating system:"&chang (usersysinfo(rs("browser"),2),20)&" | Browser:"&usersysinfo(rs("browser"),1)&"
  • "& vbcrlf

    rs.movenext

    Next

    Response.write suiji

    rs.close

    Set rs=nothing%>

Code description: Create a new table named online, and create the following fields:

browser field: used to record visitor client information, Such as browser, operating system, etc.

ip field: record the user’s ip address.

startTime field: record the time of access.

lailu field: Record the source, that is, which URL it comes from.

dates field: record date.

In addition, the usersysinfo function is used to read browser field information.

The above is the detailed content of How to make the website automatically update every day. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete
Previous article:How to use calc() in CSS3Next article:How to use calc() in CSS3