Inserting a variable in a link


Posted on 16th Feb 2014 07:03 pm by admin

I have this code that I want to insert for my own variable but I have no idea how. This is what I want to insert:

Code: <?php echo $my_twitter_username; ?>
Into this code:

Code: <?php
[i]function twittercount () { // I added this myself, not sure if I should, but if not there line below does not work
global $my_twitter_username; // Im sure this is needed or the call in will not work.[/i]
$tw = get_option("twitterfollowerscount");
if ($tw['lastcheck'] < ( mktime() - 3600 ) )
{
$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name=[u][b]WANT TO INSERT HERE[/b][/u]');
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) {
$tw['count'] = $match[1];
}
$tw['lastcheck'] = mktime();
update_option("twitterfollowerscount",$tw);
}
echo $tw['count'];
}
?>

No comments posted yet

Your Answer:

Login to answer
347 Like 24 Dislike
Previous forums Next forums
Other forums

mail()
Hi all. I have a problem with emails. I am trying to set up a mail system where customers can subscr

PEAR Email Attachment w/ $gpg
I have no issues with this code if I take out the attachement section and include the info in the em

please help me in this update statment
hi every one

if I have table and this data in it

id name
10

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

Checking if field is empty AND using !is_numeric
Hi lads,

Need to be able to display an error message (using isset?) that says "Cant lea

Is it a good practice to store user info. in sessions?
I am making a user class for my script which stores all the user information in sessions. It takes u

how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are tw

Results from Db outputted twice
Hey guys.. for come reason my data is outputted twise shown in the image below and i cant figure out

Anti Spam Code
Ok where do i start? Probably by telling you I have very little working knowledge of PHP and that I

Transform value 0 in no and 1 in yes help needed
Hello,
I have this in the table: "value" type int 0 to represent false and 1 to represe

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash