I am building a facebook like button , in the href tag i want to keep my own custom url stored in php variable. But the like button doesn't shows with it. Any solution
CODE
<?php echo '<fb:like href=" '.$urlToLink.' " width="450" layout="box_count" show_faces="false" send="false"></fb:like>'; ?>
$urlToLink has somethig like this-> "http://localhost/website/view.php?asdpfimi34mmksd"
Put the URL in the debugger and check it for Errors/Warnings: https://developers.facebook.com/tools/debug
Also, try the URL in the Plugin generator: https://developers.facebook.com/docs/reference/plugins/like/ - and see if it gets rendered correctly.
And i hope you´re not serious with "localhost", because that will not work, of course. Facebook does not have access to your localhost, and the URL you provide has to be accessible in public, without any user login.
Related
In Codeigniter, I have a database containing a link of a site.
Each item(event) has a link to the event page.
Site
But instead of going to the desired site, it just adds the link to the existing url like this: http://web.site.local/index.php/evenementen/www.referedsite.com
when checking the html code it shows the following:
Site
Does anyone know how to make it go to www.referedsite.com instead of making it add this to the existing link?
You need to put HTTP://
Site
In codeignitor you can use
echo anchor('', 'Site');
// Prints: Site
Read CI Anchor
try
Site
I'm trying to build a custom top toolbar which an iframe below it.
Something similar to this:
http://themes.goodlayers.com/?theme=greenearth
I plan one using it on a blog, so i will be making posts linking to other sites. My question is what do i need to make a custom url function that so i just add it in front of the other site's url so that it shows up in an iframe.
For example:
I want to link to google in an iframe with my top toolbar above.
Is there a script that allows me to use a url like this:
http://www.mywebsite.com/frame.php?http://www.google.com/
Thanks for your time!
Iframes are always bad. Don't do it.
That said, with PHP, you can do this:
<iframe src="<? echo $_SERVER['QUERY_STRING'] ?>" />
You can also do something like mywebsite.com?url=google.com, and use $_GET['url'] instead.
Eg url: http://mywebsite.com/index.php?iframe=http://www.google.ro
PHP:
<?php
if ($_GET['iframe']) {
echo"<iframe src='".$_GET['iframe']"' width='200px' height='150px'>";
} ?>
I hope this will help you!
Am using facebook share code, but dont know how to customize the url part so that user who is on that url page should be shared instead of default url.
My current code is like
<a onclick="window.open('http://www.facebook.com/sharer/sharer.php/?
u=mycarhelpline.com', 'newWindow', 'width=600, height=400'); return false;"
href="http://www.facebook.com/sharer/sharer.php/?u=mycarhelpline.com" target="_blank"
rel="nofollow">
I need to customize the line
?u=mycarhelpline.com
with a php code that so that url which is been accessed by the user should come in share window instead of default home page.
(Know that Share option is deprecated, but sharing works for me - look for help to customize the code of sharing url
Thanks
Edited
Hi have put in revised code, i know am doing some error - pl help n suggest for rectification
<?php
$server_name = 'mycarhelpline.com';
$current_path = $_SERVER['REQUEST_URI'];
$sharerpath = 'http://www.facebook.com/sharer/sharer.php/?u='.$server_name .'/'.$current_path;
?>
<a onclick="window.open('http://www.facebook.com/sharer/sharer.php/?u='.$sharerpath', 'newWindow', 'width=600, height=400'); return false;"
href="http://www.facebook.com/sharer/sharer.php/?u='.$sharerpath''" target="_blank"
rel="nofollow"><img src="/templates/mycar_home/images/facebook.png" alt="Share on Facebook" /></a>
Now when i put ?> after tag, its showing server error and is not displaying page and when put before http://www.facebook.com/sharer/sharer.php/?u='.$sharerpath
If I understand correctly, you want the share plugin to simply share the current page the user is on. For this you will have to customize the plugin. Every time you place the share code on your page, you'll have to specify what page the user is on.
You can use parameters within the $_SERVER variable for this. You already know the server name, then you have the REQUEST_URI which is the URI which was given in order to access this page. So if you combine them you should reach a final URL for each page.
$server_name = 'mycarhelpline.com';
$current_path = $_SERVER['REQUEST_URI'];
$sharerPath = 'http://www.facebook.com/sharer/sharer.php/?u='.$server_name .'/'.$current_path;
References -
$_SERVER
I'm trying to give the users of my website the option to externally embed an html5 player , and in order to do that I thought of putting a value in the iframe's src by reading it from the parent page, then passing it as a variable in the php file which will be shown to the user.
Let's say that
$value_from_parent_page = "song1"
and parent page contains copy-able code for the users
<iframe src="http://example.com/load.php?embed='$value_from_parent_page'" ></iframe>
The load.php contains
<?php
$val = $_GET['embed'];
echo "<audio src='"$val".mp3'></audio>";
?>
The result has to be like
<audio src='song1.mp3'></audio>
Is it possible to work like that and is the code valid? (i apologise I don't have access to normal computer to test).
Thanks in advance.
This should work, and is valid, now the issue of using an iframe would be well, make sure that it is an iframe you need as there are probably better ways of going about this, but in your scenario i would say this is the best way to do it and valid for best cross platform support.
Hello I am trying to figure out how to make it so when someone clicks a link on my search results it will open in a new window and in the new window have an iframe that displays the url. I am not sure how to go about doing this. I have
$row['url']
that displays the url for each result to use.
To be more specific I am trying to do what filestube does. I like the feature a lot and would like to use something like it on my site. Here is an example url to show you want I mean http://www.filestube.com/5a4c10249bd9fce003e9/go.html
when the link is clicked on filestube it will open a page like this. I have seen lots of sites do this but filestube is what pops in my head right now. Can anyone provide me with a code example or try to explain how to do this? thanks.
You need to redirect to a URL inside of your application, example my_url.php and post to it in parameters the URL you want to show. Than in that script, load an iFrame with that URL.
Example of my_url.php?url=http://www.google.ca:
<div>You Header</div>
<iframe src="<?php $_GET['url']"></iframe>
<div>Your Footer</div>
The link should point to another PHP page. Something like this.
http://www.google.com
In your open-link.php, write your iframe code.
<iframe src="<?=$_GET['url']?>"></iframe>
Assuming you have PHP file named external.php
Make that PHP file accept a $_GET parameter.
Pass the URL as a param
Use that URL to point the iframe in that PHP file to whatever URL is passed