facebook canvas page not showing any data - php

I tried to create one canvas page on facebook
here is the config:
and for test I havent added any code in index php, i have just added:
index.php
<?php
echo "welcome to canvas";
?>
but on facebook page its not showing any data, please help to fix this

Thanks to Raptor, so bad mistakes here is that needs https url for canvas.

Related

Twitter button not showing URL to Tweet

I'm trying to implement a 'Tweet' button on my wordpress site and am having an issue where the URL doesn't show in the tweet.
It shows the hashtag and the account but not the URL.
My code is as follows:
Tweet
If i don't use the data-url then it just inserts the base domain name and not the full URL.
Any ideas?
Have you tried the code on the twitter page instead? Have a look at the twitter API here.
You are missing javascript code.
You probably got your code from HERE
For sharing a link, the javascript code is
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
Just add this code after your anchor tag.
I had the following code:
Tweet
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
But that didn't work, so I tried a simplified version:
Tweet<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
And this one worked just fine. Just keep in mind that the username has to be somehow integrated in your theme settings, if it's not, you can change:
<?php echo of_get_option( 'ac_twitter_username' ); ?>
For your twitter username.
I hope this works, It took me a while to find this more generic approach. I don't fully know what I'm doing, so if anyone sees an issue with this approach, please let me know. So far, it works great.
Thanks!

Allow switch from mobile site to full site with jquery

I have done some digging out here and am still a little unsure how to accomplish this. Here is the scenario:
I have a full HTML site that calls the following PHP code:
<?php
require_once('inc/mobile_device_detect.php');
mobile_device_detect(true,true,true,true,true,true,true,'mobile/',false);
?>
<!DOCTYPE html>
<html lang="en">
<head>blah blah</head>
etc...
The mobile_device_detect.php is a small library from http://detectmobilebrowsers.mobi/
So when I go to the full site from my mobile phone, the redirect happens perfectly. Next, on the mobile/index.html I have the following redirect code for those users that are wanting to see the full site (I should also mention that this mobile site uses jquery-mobile):
<img src="images/icons/world.png" width="32" height="32" alt="Full Site" class="ui-li-icon">Full Site
When I click this link, I am resent back to the mobile page. I know this is happening because the redirect script is being fired again. I have tested this by visiting the mobile site with a desktop client and the redirect occurs perfectly.
Any ideas how I can remedy this for mobile users wanting to see the 'full site'?
You can append a query param on your href like href="../index.html?full=true" in your main page check that full param is not present.
<?php
if (!isset($_GET['full'])) {
require_once('inc/mobile_device_detect.php');
mobile_device_detect(true,true,true,true,true,true,true,'mobile/',false);
}
?>

Issue with formulating a url php / html

I am trying to formulate a link to another page in my directory. It can either be done in the php code or the html. However for some strange reason, and only on this page, everytime i generate a url to a new page, the url generated is the page i am on + the url i want to go to.
For example, if i am on mysite.php and formulate a link to go to purchase.php then the generated url is mysite.php/purchase.php
Does anyone know why this might be?
<h1>Success</h1>
Link text
<?php
...
...
?>
this is essentially all i have with an echo saying hi! . What happens is, if i am currently on home.php the above url becomes path/home.php/page.php
You should create url for /purchase.php instead of purchase.php.
You can read more about what's the difference in here.

WordPress not recognizing simple Javascript file

Okay, so I've uploaded this super simple HTML page here:
http://medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html
It's utilizing LinkedIn's "Sign In" API. View the source. It's two lines of code. Nothing.
BUT
I created a home.php file in my child theme directory, and pasted this:
<?php require(CHILD_DIR.'/test.html'); ?>
This means that if you view the source at http://www.medicaldevicesgroup.net/, it's EXACTLY the same as the source at http://medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html. The only difference is that the home page is in WordPress, and the other URL isn't.
The home page script, however, doesn't work. WHY???? Help! Thanks.
The reason is because the LinkedIn API that you are using is for http://medicaldevicesgroup.net and not http://www.medicaldevicesgroup.net. Notice the "www" in 2nd URL. You need to change your URL in the LinkedIn API.
To see what I mean try going to http://www.medicaldevicesgroup.net/wp-content/themes/medicaldevicesgroup/test.html and it will not work there too.

php open dynamic link in new window with iframe

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

Categories