/    Sign up×
Community /Pin to ProfileBookmark

How to make code to read meta tags from URL?

I have to read meta tags from server URL. How to read them if I post in form URL and it will read all meta tags and its values and store them in TXT file and/or in MySQL table?

Need help

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiDec 10.2008 — Are you sure you mean meta tags? Or do you mean query string, as in:

someurl.com?var1=foo&var2=bar

If the latter then you can have your form submit using the get method and then access the values using the $_GET array:

[code=php]
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="get">
<input type="text" name="var1" value="foo" />
<input type="text" name="var2" value="bar" />
<input type="submit" value="Go" />
</form>

<pre>
<?php if (isset($_GET)) print_r($_GET) ?>
</pre>

outputs:
Array(
var1 => foo
var2 => bar
)
[/code]
Copy linkTweet thisAlerts:
@toplisekauthorDec 10.2008 — I mean meta tags like:

<meta name="Description" content="" />

<meta name="Keywords" content="" />
Copy linkTweet thisAlerts:
@MindzaiDec 10.2008 — Ok, so I'm not sure what you mean by read them from URL? Or do you mean you want to enter a URL and have the script return all meta tags found in the source code at that URL?
Copy linkTweet thisAlerts:
@toplisekauthorDec 10.2008 — Do you mean you want to enter a URL and have the script return all meta tags found in the source code at that URL?[/QUOTE]

Exactly. It is connected also to encoding that it will be stored also correct encoding.
×

Success!

Help @toplisek spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...