Question about how to display the browser label as the article title-php Tutorial

Source: Internet
Author: User
A company news management system displays the title of a browser label. after publishing news, each page displays a website name. I want to modify the title of each article after making a piece of news. This is also suitable for other tools.
Thank you.
This is the connection address http: // 192.168.0.253: 8088/business/index. php? M = index & a = actionClass & actype = content & fid = 2 & cid = 2 it is determined by cid = X to open an article.

This is the template source code for displaying the article
 
 <? Php echo $ SITETITLE;?>// Modify the title of the displayed article here
 

  • {$ Rs. title}
Company article management system

{$ Rs. title}

Edit {$ rs. aut}/{$ rs. time | date = "Y-m-d ",###}

{$ Rs. content}




This is what I did when I opened an article.


Reply to discussion (solution)

Then, in the php background, query the article title in the database through cid = 2 and assign a value to $ SITETITLE to upload it to the page.

Put this in {$ rs. title} Location

Put this in {$ rs. title} . You have already tried it.

Then, in the php background, query the article title in the database through cid = 2 and assign a value to $ SITETITLE to upload it to the page.

How can I query the cid number opened on the current webpage?


Then, in the php background, query the article title in the database through cid = 2 and assign a value to $ SITETITLE to upload it to the page.

How can I query the cid number opened on the current webpage?
Didn't you open it through the link? Http: // 192.168.0.253: 8088/business/index. php? M = index & a = actionClass & actype = content & fid = 2 & cid = 2?
$ Cid = $ _ GET ['CID'];

You are talking about a way to get the cid, and a way to use substr
$ Model = new Model ();
$ Model-> query ("select nr_name from ai_content where id = $ _ GET ['CID']");

The corresponding title cannot be called up.

I also hope to give some advice. The data ai_centent id corresponds to the title to be displayed in the cid corresponding to rn_name

This is developed through thinkphp. I also hope to give some advice. Thank you.



Then, in the php background, query the article title in the database through cid = 2 and assign a value to $ SITETITLE to upload it to the page.

How can I query the cid number opened on the current webpage?
Didn't you open it through the link? Http: // 192.168.0.253: 8088/business/index. php? M = index & a = actionClass & actype = content & fid = 2 & cid = 2?
$ Cid = $ _ GET ['CID'];

Thinkphp I have never used it. you can see how you call other databases.

$ Rs. title is actually $ rs ['title']
So<? Php echo $ rs ['title'];?>
If not, your code does not follow the normal TP framework process ..
In fact, there is also a stupid way to respond to emergencies.
It is to use JQUERY to retrieve the title instead of the content in the title.
$ (Function (){
$ ('Title'). text ($ ('h3 '). text ());
})

$ Rs. title is actually $ rs ['title']
So<? Php echo $ rs ['title'];?>
If not, your code does not follow the normal TP framework process ..
In fact, there is also a stupid way to respond to emergencies.
It is to use JQUERY to retrieve the title instead of the content in the title.
$ (Function (){
$ ('Title'). text ($ ('h3 '). text ());
})

I finished reading thinkphp development documents last night and this morning. I studied it. Indeed, this does not follow the normal framework too much. The source code has not been found.
It is feasible to try your second method. Thank you !!

Today, I used the most stupid method and the simplest method to solve the problem. now, this code can get the title, content, publisher, and release time of the article, so why don't I use this code to get the title ?!!

{$ Rs. title}

Edit {$ rs. aut}/{$ rs. time | date = "Y-m-d ",###}

{$ Rs. content}


I tried this code and obtained the title of the article. However, I do not know whether the successor will affect other production functions or performance. I still need to test it.
<view id="rs" cid='$cid'> {$rs.title}</view>


Thank you for your help.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.