FarrisFahad 103 Junior Poster

I want to post Pins using Pinterest API. I have tried to generate code using ChatGPT but it returns an error.

Here is my code so far ...

<?php

$clientId = "xxx"; // Replace with your App ID
$clientSecret = "xxx"; // Replace with your App Secret
$redirectUri = "xxx"; // Must match the one used earlier
$authCode = "xxx"; // Paste the code from the URL

// Pinterest API token endpoint
$tokenUrl = "https://api.pinterest.com/v5/oauth/token";

$postFields = [
    'grant_type' => 'authorization_code',
    'code' => $authCode,
    'redirect_uri' => $redirectUri,
    'continuous_refresh' => true
];

$authHeader = base64_encode("$clientId:$clientSecret");

$ch = curl_init($tokenUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postFields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
   'Content-Type: application/json',
   'Authorization: Basic ' . $authHeader
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);

if ($response === false) {
    die("cURL Error: " . htmlspecialchars($error));
}

$data = json_decode($response, true);

// Error handling for HTTP response
if ($httpCode !== 200) {
    die("Pinterest API Error: HTTP $httpCode - " . htmlspecialchars($response));
}

// Error handling for API response
if (!isset($data['access_token'])) {
    die("Error: Invalid response from Pinterest API. Full response: " . json_encode($data, JSON_PRETTY_PRINT));
}

// Successfully received access token
$accessToken = $data['access_token'];
echo "Access Token: " . htmlspecialchars($accessToken);

?>

Here is the error message I am getting ...

Failed to create pin. Response: {"code":2,"message":"Authentication failed.","status":"failure"}

I tried many things but it always return an error.

Here is the docs page: https://developers.pinterest.com/docs/api/v5/oauth-token

Is there something I am missing?

Any help would be appreciated.

FarrisFahad 103 Junior Poster

Hey, I am trying to connect to Twitter API version 1.0.
I want to post a tweet on Twitter using API.
I don't want to use any libraries because i am trying to learn.
I have written some code with the help of ChatGPT.
I am having issues with the signature.
Here is my PHP function for generating a signature ...

function sign($method, $url, $params, $consumerSecret, $tokenSecret = ''){

  $encodedParams = [];
  foreach($params as $key => $value){
     $encodedParams[rawurlencode($key)] = rawurlencode($value);
  }

  ksort($encodedParams);

  $paramString = http_build_query($encodedParams, '', '&', PHP_QUERY_RFC3986);

  $encodedUrl = rawurlencode($url);
  $encodedParamString = rawurlencode($paramString);
  $signatureBaseString = strtoupper($method) . "&" . $encodedUrl . "&" . $encodedParamString;

  $encodedConsumerSecret = rawurlencode($consumerSecret);
  $encodedTokenSecret = rawurlencode($tokenSecret);
  $signingKey = $encodedConsumerSecret . "&" . $encodedTokenSecret;

  $hash = hash_hmac('sha1', $signatureBaseString, $signingKey, true);

  $signature = base64_encode($hash);

  return $signature;

}

And here is my PHP script ...

<?php

$credentials = array(
   'consumer_key' => 'xxxxxx',
   'consumer_secret' => 'xxxxxx',
   'bearer_token' => 'xxxxxx',
   'token_identifier' => 'xxxxxx',
   'token_secret' => 'xxxxxx'
);

$status = 'Hello World!';

$method = "POST";

$url = "https://api.x.com/1.1/statuses/update.json";

$params = [
   "oauth_consumer_key" => $credentials['consumer_key'],
   "oauth_nonce" => bin2hex(random_bytes(16)),
   "oauth_signature_method" => "HMAC-SHA1",
   "oauth_timestamp" => time(),
   "oauth_token" => $credentials['token_identifier'],
   "oauth_version" => "1.0"
];

$signature = $API->sign($method, $url, $params, $credentials['consumer_secret'], $credentials['token_secret']);

$authHeader = 'OAuth ';

$headerParts = [];

foreach ($params as $key => $value) {
   if (strpos($key, 'oauth_') === 0) {
       $headerParts[] = rawurlencode($key) . '="' . rawurlencode($value) . '"';
   }
}

$authHeader .= implode(', ', $headerParts);

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => http_build_query(['status' => …
FarrisFahad 103 Junior Poster

I am having a problem understanding the following ...

I am an okay web developer. I am not great. But I want to make money from my skills.
Having said that, when I go to websites like Freelancer to search for a project to work on everyone is asking for an exceptional developer and they pay very little. I don't know how are average joey's make it in this business.

What is your take on this?

rproffitt commented: From what I've read from you, you are above average. +17
FarrisFahad 103 Junior Poster

Hey, I know that this discussion is old but I need to know now.
I am new to OOP in PHP. Is it good to call a class within a class? Why or why not?
How should I create an object? I want objects to use other methods from other objects.
Your example is good ...

class A
{
    private $obj; 

    public function __construct()
    {
        $this->obj = new B();
    }
}

class B
{
    private $obj;

    public function __construct()
    {
        $this->obj = new C();
    }
}

class C
{
    private $obj;

    public function __construct()
    {
        $this->obj = new A();
    }
}

$obj = new C();

but I am trying to do the following ...

class A
{
    private $A;
    private $B;
    private $C;

    public function __construct()
    {
        $this->A = new A();
        $this->B = new B();
        $this->C = new C();
    }
}

class B
{
    private $A;
    private $B;
    private $C;

    public function __construct()
    {
        $this->A = new A();
        $this->B = new B();
        $this->C = new C();
    }
}

class C
{
    private $A;
    private $B;
    private $C;

    public function __construct()
    {
        $this->A = new A();
        $this->B = new B();
        $this->C = new C();
    }
}

$A = new A();
$B = new B();
$C = new C();
FarrisFahad 103 Junior Poster

How can I include objects in each other using PHP OOP?

I have 3 classes all classes make use of one another. I am trying to call them on __construct but it's creating an infinite calls to one another. How can I solve this?

FarrisFahad 103 Junior Poster

I want to understand how I can add an SDK to my PHP projects to make APIs calls. I noticed that every software company have an SDK. I also noticed that most SDKs use Composer. I don't know what composer is and do I need to have it for every SDK?

I am also using PHP procedural programming and I noticed that these SDKs use OOP.

Can someone help me make my first API call using an SDK?

FarrisFahad 103 Junior Poster

Hello,

I am somewhat new to APIs. I have integrated PayPal payments successfully. With PayPal, I can send the user to the payment page using an HTML form. Here is an example ...

<!-- PAYPAL -->
<form action="https://www.paypal.com/cgi-bin/webscr" method="POST" name="_cart">
    <input type="hidden" name="cmd" value="_cart" />
    <input type="hidden" name="upload" value="1" />
    <input type="hidden" name="no_shipping" value="1" />
    <input type="hidden" name="business" value="" />
    <input type="hidden" name="currency_code" value="USD" />
    <input type="hidden" name="item_name_1" value="" />
    <input type="hidden" name="amount_1" id="amount" value="1.00" />
    <input type="hidden" name="custom" value="" />
    <input type="hidden" name="return" value="" />
    <input type='hidden' name='notify_url' value="">
    <input type="hidden" name="cancel_return" value="" />
    <input type="submit" class="submit" value="Deposit Money Via PayPal">
</form>
<!-- PAYPAL -->

I want to do the same thing for AirTM. Here is their developer page: https://docs.airtm.com/purchases-payins/create-purchase

I am not sure where to include the Header information.

Can you help?

FarrisFahad 103 Junior Poster

Hello webmasters,

I am currently building a template that I am going to sell on different websites like Codester and CodeGrape.
I want to build a business directory.

Here is what I have come up with ...

  1. users can register and add listings.
  2. admin can create categories for users to select from.
  3. admin can create sub categories if necessary.
  4. users can submit a review for listings ranging from 1 to 5 stars with comments.
  5. users can buy a featured listings for more traffic.
  6. admin can set listings parameters like website url and email address or phone number.

What else should I include?
I am not sure if I am missing something important.
Any suggestions?

FarrisFahad 103 Junior Poster

I want to write an SEO load more button that Google crawls and click on. I have read somewhere in the documents that Google will only click on anchor tags with href value. My current website loads content using a button and I have noticed after changing some, not load more, links Google started to index my website.

Is there a best practice method to do this?
Will it index more pages on my site?

I am not sure if I should post this in SEO or Web Development section :)

FarrisFahad 103 Junior Poster

My best advice is to not focus on backlinks. I see building backlinks as only spamming the web. If you want to have good backlinks just create something awesome and promote it using PPC. You don't need to spend thousands of dollars every day, just $5. I think the majority of us can afford that. Test advertising platforms like Google Ads, Meta, X, Reddit, Pinterest and see which one is better for you.

This is not a short term strategy but a long term. Try it and you will thank me :)

FarrisFahad 103 Junior Poster

I have been working on my site for a long time now and I noticed something different. Back in 2019 when I started a campaign on Google Ads to promote my site the traffic kept going up day after day. Although it was a small increment it was going up nonetheless. Today, may website users are not coming back. I am losing traffic instead. The website is much better than before and I don't know what is wrong. are platforms like Tik-Tok stealing all the traffic?

Have you noticed stuff like this now or in the past?

And what is the normal retention rate for a memes website?

Thank you,
Farris

FarrisFahad 103 Junior Poster

I am trying to create a meme generator similar to imgflip.com
I know javascript but not sure how to implement this.
I want users to be able to move text around the canvas using mousemove event listener.
But I am not sure if they are moving the text on the canvas or are they creating an overlay div then transform the dimension's to canvas?

FarrisFahad 103 Junior Poster

I am trying this but it returns an error ...

$api_endpoint = "https://api.twitter.com/2/tweets";
$authorization = "Authorization: Bearer {$settings['bearer_token']}";

$text = 'Hello World';

$ch = curl_init();

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization));
curl_setopt($ch, CURLOPT_URL, $api_endpoint);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
   'text' => $text
]);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$response = curl_exec($ch);

curl_close($ch);

$result = json_decode($response, true);
print_r($result);

Array ( [title] => Unsupported Authentication [detail] => Authenticating with OAuth 2.0 Application-Only is forbidden for this endpoint. Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context]. [type] => https://api.twitter.com/2/problems/unsupported-authentication [status] => 403 )

Do I need to use consumer key and secret? or access token and secret? How should I use them.
I am sorry but I am new to APIs

FarrisFahad 103 Junior Poster

For people who used both and build websites with both, which one is better? Why?

FarrisFahad 103 Junior Poster

I am trying to create my first successful API request.
I want to post on my twitter account.
I have created the developer account and generated consumer key and secret as well as access token and secret.
I have also obtained the bearer token.

I want to post on Twitter using the 1.1 version API.
I want to do it with no framework or library. Just good old cURL and PHP.

Here is what I have come up with ...

$api_endpoint = "https://api.twitter.com/1.1/statuses/update.json";
$authorization = "Authorization: OAuth oauth_consumer_key=\"{$settings['consumer_key']}\", oauth_consumer_secret=\"{$settings['consumer_secret']}\", oauth_token=\"{$settings['access_token']}\", oauth_token_secret=\"{$settings['access_token_secret']}\"";

$status = 'Hello World';

$ch = curl_init();

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization ));
curl_setopt($ch, CURLOPT_URL, $api_endpoint);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
   'status' => $status
]);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$response = curl_exec($ch);

curl_close($ch);

$result = json_decode($response, true);
print_r($result);

It's returning: Array ( [errors] => Array ( [0] => Array ( [code] => 215 [message] => Bad Authentication data. ) ) )

FarrisFahad 103 Junior Poster

I want to write 1,000 blog posts on my blog. I want to sell ReviewMyLink for $1,000 USD on Flippa and I want to make PicturePunches much better.

Happy new year :)

What about you?

bijutoha commented: Which toolset would you use to write a thousand blogs? +3
FarrisFahad 103 Junior Poster

Do you use Google as a search engine? Are you considering switching to something like Bing or DuckDuckGo?
Do you feel like the search results is no longer helpful? Why?

FarrisFahad 103 Junior Poster

You need to submit your website to Google Search Console and index your pages using the search bar at the top. Just enter your URL and click on request indexing.

FarrisFahad 103 Junior Poster

I have a memes site that users can earn from. I want to make the website easier to use and more fun.
What should I do to make the website better?
Website: PicturePunches

DGPickett commented: It might be good to sort logs by user and see if they had to click a lot to get where they wanted to go. Intuitive is nice but you need to sample! +4
FarrisFahad 103 Junior Poster

YouTube, Facebook and Twitter
Pinterest for some niches.

FarrisFahad 103 Junior Poster

Hi, I am using JS in my website to load more content. I have buttons or input type button as my load more content.
I am worried that Google won't index the content behind the load more button because it's a button and not an anchor tag.

Here is what I am currently using ...

<div class="MORE">
  <button onclick="loadMore(this, '.Memes', 'ex/more.memes.php');">Load More Content</button>
</div>

I believe there is a better way to do it. Can you help?

Also here is my JS ...

function loadMore(elm, content, ajax){

    let id = document.getElementById('id').innerText;
    let section = document.getElementById('section').innerText;
    let subsection = document.getElementById('subsection').innerText;
    let time = document.getElementById('time').innerText;
    let offset = document.querySelectorAll(content).length;

    elm.innerText = "Loading ...";

    let formData = new FormData();
    let xhr = new XMLHttpRequest();

    xhr.onreadystatechange = function(){

        if(this.readyState == 4 && this.status == 200){

            if(this.responseText){

                document.getElementById('append-a').innerHTML += this.responseText;

                impression();

                elm.innerText = "Load More";

            }else{

                elm.innerText = "No More";

            }

        }

    };

    formData.append("id", id);
    formData.append("section", section);
    formData.append("subsection", subsection);
    formData.append("time", time);
    formData.append("offset", offset);

    xhr.open('POST', ajax, true);
    xhr.send(formData);

}
FarrisFahad 103 Junior Poster

GA4 sucks. I think that Google should not migrate to GA4 because UA is just so perfect.
If you are looking for an alternative check this out: https://www.simpleanalytics.com/

FarrisFahad 103 Junior Poster

Yes. But don't do it for backlinks. Do it to get brand awareness.

FarrisFahad 103 Junior Poster

I am trying to learn some basic concepts of JS.
I want to start by moving a box which is inside a box.
Here is the jsFiddle ...

https://jsfiddle.net/FarrisFahad/a1Lqchj8/1/

I want to move the mouse on mousedown, mousemove, and mouseup

FarrisFahad 103 Junior Poster

I have a couple of scripts from the same template but different version. I am using php and mysql. I need to know how to update the mysql database and the script from version 1 to version 2 with a single click.

FarrisFahad 103 Junior Poster

Hello webmasters,

I am trying to create a script using vanilla PHP. I am familiar with the language and I have created a cronjob before, but only using cPanel. I want to create cronjobs using PHP if possible with out the need to go to cPanel.

I am trying to make it easier for users to install the script and make it hassle free.

So how can I run a cronjob using PHP?

FarrisFahad 103 Junior Poster

Can I do this with parked domain? If so, how?

I own both domain names. And yes, I want to mirror the first domain to the second one.

FarrisFahad 103 Junior Poster

Hi Dani, is it possible to do it with htaccess? I found some solutions online but it did not work for me. I am new to htaccess.

FarrisFahad 103 Junior Poster

Hello web developers, I have a small problem and I am not sure if it's doable using just htaccess or should I use php file_get_contents();

I have 2 sites ...

example-1.com and example-2.com

I want the content of example-1.com, whole site, to show on example-2.com.
And if someone visits example-2.com/about-us I want to show content for example-1.com/about-us

How can I do this?

FarrisFahad 103 Junior Poster

Hello Web Developers,

Using CSS what is the best way to expand a div to fit it's content?

I currently use overflow: auto but sometimes the div turns into a scrollable element which disrupts the design.
Can this be done in another way like height: max-content? Are there any other ways of going about this?

FarrisFahad 103 Junior Poster

My site use to work fine. But today for some reason pages with mysqli_num_rows takes a very long time to load. I can visit the page but it takes a long time to load. When it loads there are no errors but the error file in the root directory have the following error:

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given

There is no problem with my internet connection because other pages load fast and do not send reports to the error file. This is my first time encountring this problem.
Here is the code for the error line:

function fetch_rows($sql){

    global $con;

    $q = mysqli_query($con, $sql);
    return mysqli_num_rows($q);

}

I have tested the query on PhpMyAdmin and it works fine. But for some reason it takes time to load. I have even checked if the database has a lot of records, but it doesn't I have also emptied it.

Have any of you ran into the same error. Or understands the problem?

Thanks

FarrisFahad 103 Junior Poster

I have a memes website and I want to drive traffic from social media. I have a Facebook page with 20,000+ fans but when I post I hardly get any traffic.
I also tried Pinterest but most users just bounce off the website, although it can drive a good amount of traffic.
I haven't tried Twitter and Instagram and that is because I am mainly focusing on desktop traffic.

What social network should I condition or recondition to drive traffic? I want to work with one?

digitalstalk commented: use facebook ads with reach option +0
johnlee90 commented: You should try mobile too, +0
paulmisunday commented: Facebook activity and paid advertisement. +0
FarrisFahad 103 Junior Poster

I have found a solution using PHP ...

  1. Redirect the form to a php page as a post method.
  2. Use header location to redirect again to the search page.

Easy and simple ...

<?php

$search = urlencode($_POST['search']);

header('location: ../search/' . $search);
exit;

?>

<form action="php/search.php" method="post">
    <input type="text" name="search" id="Searchx" placeholder="Search Marketplace" />
</form>
FarrisFahad 103 Junior Poster

Thanks! Is there a way to do it with PHP?

FarrisFahad 103 Junior Poster

I have a search form, and I want to change the url from:
https://www.example.com/search?search=term+term
to:
https://www.example.com/search/term+term

I know how to use htaccess, but I don't know how to send user to friendly URL after he submit the form.

Here is my form:

<form action="search" method="get">
    <input type="text" name="search" id="Searchx" placeholder="Search Marketplace" />
</form>
FarrisFahad 103 Junior Poster

Wow. Thank you very much!

FarrisFahad 103 Junior Poster

Hi Dani. I want to get a cut of the transaction and forward the rest to the user. I can create a merchant account, but the problem is in the code.
I haven't done it before. Just a few hints will do. Now I know that I must use JSON with the Payouts API, but is there anything else?

Are there any good toturials for Payouts API?

Thanks

FarrisFahad 103 Junior Poster

Hi Dani. I am building a site similar to eBay and Reddit. And I want my users to receive payments from each other. I like using the IPN because I am familiar with it. If you can help me with HTML I would be greatful.

Hope I answered your question. Plus I love Dani Web :)

FarrisFahad 103 Junior Poster

This is my first time to set up a PayPal masspay. I don't know what variables should I put in my HTML form.

Here is the form:

<form action="https://www.paypal.com/cgi-bin/webscr" method="POST" name="_masspay">
    <input type="hidden" name="cmd" value="_masspay" />
    <input type="hidden" name="receiver_email_1" value="support@example.com" />
    <input type="hidden" name="receiver_email_2" value="paypal@example.com" />
    <input type="hidden" name="mc_currency_1" value="USD" />
    <input type="hidden" name="mc_currency_2" value="USD" />
    <input type="hidden" name="item_name_1" value="item name" /> 
    <input type="hidden" name="item_name_2" value="website fees" /> 
    <input type="hidden" name="amount_1" value="10.00" />
    <input type="hidden" name="amount_2" value="2.00" />
    <input type="hidden" name="custom" value="1" /> 
    <input type="hidden" name="return" value="https://www.example.com/buy/12" /> 
    <input type="hidden" name="cancel_return" value="https://www.example.com/buy/12" /> 
    <button type="submit">Pay With PayPal</button>
</form>

I don't know what I should have in the cmd field. This is my first time creating an HTML IPN form for masspay.

Can anyone help?

FarrisFahad 103 Junior Poster

Hello, I am trying to redirect my website from desktop version to mobile version.

Here is the desktop version example:
http://www.example.com

Here is what I have accomplished:
http://m.example.com

The problem is that some files are stored under the www version and I want them to be shown on the m version like javascript and images.

Any help would be much appreciated.

Here is my code:

RewriteEngine on
RewriteBase /

RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP_HOST} ^example.xyz [NC]
RewriteRule ^(.*)$ http://www.example.xyz/$1 [L,R=301,NC]

RewriteCond %{HTTP_USER_AGENT} android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|opera\ m(ob|in)i|palm(\ os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows\ (ce|phone)|xda|xiino [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a\ wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r\ |s\ )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1\ u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(\ i|ip)|hs\-c|ht(c(\-|\ |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(\ |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(\ |\/)|klon|kpt\ |kwc\-|kyo(c|k)|le(no|xi)|lg(\ g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-|\ |o|v)|zz)|mt(50|p1|v\ )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v\ )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|\ )|webc|whit|wi(g\ |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-) [NC]
RewriteRule ^$ http://m.example.xyz [R,L]

RewriteRule ^(categories|collections|about|contact)$ $1.php [NC,L]

RewriteRule ^picture/([\d]+)$ picture.php?id=$1 [NC,L]
RewriteRule ^category/([-\w]+)$ category.php?category=$1 [NC,L]
RewriteRule ^collection/([-\w]+)$ collection.php?collection=$1 [NC,L]
FarrisFahad 103 Junior Poster

Hello webmasters,

I have a website about memes and I want to update the database each time the user scrolls down.
I have no problem when I make a few requests to the database, but what if I want to do a lot of requests in a large database?
I recently had to refactor my code to exclude some code that is important just for the sake of performance.
Is there any way around it? How does Facebook do it?

FarrisFahad 103 Junior Poster

I just found the solution ...

Just add this to your ajax call:

FB.XFBML.parse(document.getElementById('ShareButtonName'));
FarrisFahad 103 Junior Poster

I have installed Facebook share button on my website but it won't work on new content. It works perfect with content that is loaded with PHP but not content appended by AJAX.
Can anyone help?

FarrisFahad 103 Junior Poster

I have some simple scripts like blogs, forums, and so on. They are not of high quality but I want to sell them.

The problem is that I cannot build a professonal website. But I want to sell my work.

Where can I find a marketplace for such items?

Note that I can't sell with Themeforest because they have a strict moderation.

FarrisFahad 103 Junior Poster

Thanks I will do that :)

FarrisFahad 103 Junior Poster

I just think it's more neat.

FarrisFahad 103 Junior Poster

I want to add a Facebook share button on my website. But I don't want the new window pop up dialog. I want the dialog that opens on the website, just like Facebook has.

I want to accomplish this:

2014-01-21_19_35_19-Feed_and_Share_Dialog.png

Instead of this:

ajXTj.png

Can anyone point to me a resource?

michaelsmith commented: I am looking for this +0
FarrisFahad 103 Junior Poster

I want to learn how to do things myself using jQuery. I am doing it just to learn nothing more.

FarrisFahad 103 Junior Poster

I have another question ...
How do they make part of the image transparent while the rest is darkened?
Are they using HTML5 Canvas? I want to accomplish this effect.

FarrisFahad 103 Junior Poster

Thank you guys for the help :)