PHP Novice Help: How to get the title value of the hyperlink?

Source: Internet
Author: User
This post was last edited by Ilelex on 2013-10-31 10:07:11

PHP Get link text

Title.

such as a hyperlink:

Hyperlink Title 9

Use $_get[' title ' to get "hypelinktitle", how do I get "hyperlink title 8" and "Hyperlink header 9"?

I hope the shrimp can give a hint on this hyperlink, thank you!


Reply to discussion (solution)

Transfer via JS

Hyperlink Title 9


var _h = $ (' hplink '). html ();

And then what? Beginner PHP, can look at the details of the ha.

Transfer via JS
Hyperlink Title 9


var _h = $ (' hplink '). html ();

And then what? Beginner PHP, can look at the details of the ha.

$ (' #hplink '). html ();

$ (' #hplink '). attr (' title ');


Transfer via JS
Hyperlink Title 9


var _h = $ (' hplink '). html ();

And then what? Beginner PHP, can look at the details of the ha.

Testhtml



Transfer via JS
Hyperlink Title 9


var _h = $ (' hplink '). html ();

And then what? Beginner PHP, can look at the details of the ha.

Testhtml


Thank you. And thanks to Fire53.

Get this I will ah, now the question is, how can I transfer this value back to PHP?
To achieve the role is, click on this link, PHP background based on this link to read the relevant article from the database.
Everything else is done, and now it's bad to pass the hypertext you get to PHP.
The link is in the form
Hyperlink Title 8



Transfer via JS
Hyperlink Title 9


var _h = $ (' hplink '). html ();

And then what? Beginner PHP, can look at the details of the ha.

Testhtml


This onclick + rel form, Baidu Spider can normally get links and crawl over it?

Send back to PHP?

$ (' #hplink '). attr (' title ');

Thank you, how to pass this value to PHP? Hope to be more detailed, thank you!

Send back to PHP?
Moderator of the big, yes.
To achieve the role is, click on this link, PHP background based on this link to read the article from the database related articles. Spiders have to be able to climb.

JS gets it, then it can be sent back via get or post ...


Just put it right behind the question mark.
http://www.example.com/?title=HypeLinkTitle__ Hyperlink title 8__ hyperlink title 9__ Hyperlink Title 100
Get and then explode separate

$title _list = Explode ("__", $_get[' title ');
echo $title _list[0];
echo $title _list[1];
echo $title _list[100];


Send back to PHP?
Moderator of the big, yes.
To achieve the role is, click on this link, PHP background based on this link to read the article from the database related articles. Spiders have to be able to climb.

Are you going to take the article on the fly?
Using AJAX to pass parameters to the background processing, the success method to return the contents of the article displayed on the page. So the spider is not caught.

JS gets it, then it can be sent back via get or post ...
It should be this way, can you give a hint of the code for this link?

Are you going to take the article on the fly?
Using AJAX to pass parameters to the background processing, the success method to return the contents of the article displayed on the page. So the spider is not caught.
Spiders can't catch a spider's useless. Thank you

Just put it right behind the question mark.
http://www.example.com/?title=HypeLinkTitle__ Hyperlink title 8__ hyperlink title 9__ Hyperlink Title 100
Get and then explode separate

$title _list = Explode ("__", $_get[' title ');
echo $title _list[0];
echo $title _list[1];
echo $title _list[100];



Send back to PHP?
Moderator of the big, yes.
To achieve the role is, click on this link, PHP background based on this link to read the article from the database related articles. Spiders have to be able to climb.
This method is possible, but the problem is that the form of the link is now dead. Thank you

PHP can not live HTML page element value, only through $_get,$_post and so on to get the value of the form element.

This can only be transmitted through a third party.

You can first put this document in the text box, and then through the $ (". Tag class") to obtain, you can also use the JS method to determine the hidden and display of the line, why do not have to do what HYPERLINK "

You can first put this document in the text box, and then through the $ (". Tag class") to obtain, you can also use the JS method to determine the hidden and display of the line, why do not have to do what HYPERLINK "
is a web program, do not make links spider bad, thank you!

PHP can not live HTML page element value, only through $_get,$_post and so on to get the value of the form element.

This can only be transmitted through a third party.
Well, thank you. What if two of them were spilled?


PHP can not live HTML page element value, only through $_get,$_post and so on to get the value of the form element.

This can only be transmitted through a third party.
Well, thank you. What if two of them were spilled?

Pour and pour? Php?

I thought about it, and I answered it wrong.

HTML, you can use curl to crawl back with regular match
PHP words can be used fopen, remove the extra characters (space-line and so on), and then the regular match.

Don't try to realize your idea, or press the upstairs

All of a sudden put in the DOM, with JS to switch the DOM display and hide it, so that spiders can be caught

Don't try to realize your idea, or press the upstairs

All of a sudden put in the DOM, with JS to switch the DOM display and hide it, so that spiders can be caught
Well, thank you.

  • 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.