I have a php file in my server (say www.example.com/up/up.php). If i access that file through the url, my site says no page found. but i want to call that php file using url parameter. I want to call that file to a download file using url access( say www.example.com/up/up.php?f=207).
can someone help me how to do this. as usual i searched fr few days for my problem and came here when i totally cornered.

my up.php contains the following code

<?php /* Template Name: Upload */ ?>


<?php
  $app_id = "12345678901234567890";
  $app_secret = "12345678901234567890";
  $post_login_url = "www.mysite.com";
  $album_id = "7777";
  $photo_url = "URL";
  $photo_caption = "cool pics";

  $code = $_REQUEST["code"];

  //Obtain the access_token with publish_stream permission 
  if (!$code){ 
    $dialog_url= "http://www.facebook.com/dialog/oauth?"
      . "client_id=" .  $app_id
      . "&redirect_uri=" . urlencode( $post_login_url)
      .  "&scope=publish_stream";
    echo("<script>top.location.href="" . $dialog_url
      . ""</script>");
  } else {
    $token_url="https://graph.facebook.com/oauth/access_token?"
      . "client_id=" . $app_id
      . "&client_secret=" . $app_secret
      . "&redirect_uri=" . urlencode( $post_login_url)
      . "&code=" . $code;
    $response = file_get_contents($token_url);
    $params = null;
    parse_str($response, $params);
    $access_token = $params['access_token'];

    // POST to Graph API endpoint to upload photos
    $graph_url= "https://graph.facebook.com/" 
      . $album_id . "/photos?"
      . "url=" . urlencode($photo_url)
      . "&message=" . urlencode($photo_caption)
      . "&method=POST"
      . "&access_token=" .$access_token;

    echo '<html><body>';
    echo file_get_contents($graph_url);
    echo '</body></html>';
  }
?>

I should pass a value to the url by using link

3 s
3

What you can do is this:

Put up.php in your active theme’s folder, and put this line at the top of your up.php file:

<?php /* Template Name: Up */ ?>

Create a page called Up in your WordPress Dashboard, then on the right side of the edit page screen, set the Template to ‘Up’.

Depending on what you are doing with this file, you may need to add more code to make it completely secure, but this should at least solve the problem of you being able to access/use that file.

Read the relevant WordPress Codex page for more information:

http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

Leave a Reply

Your email address will not be published. Required fields are marked *