
Thursday, January 10, 2013
Airline app

Game

Science app

Wednesday, January 9, 2013
Website image is not shown in Facebook share
Error
Your website image is not shown when sharing on Facebook
Solution
Don't retry on facebook news feed since it is cached
#1
Try to invalidate the cache, check my previous article
http://karim-ouda.blogspot.com/2011/10/how-to-refresh-url-entries-in-facebook.html
#2
Add facebook meta-tags in your page "head", and try again
<meta property="og:url" content="YOUR_STUFF" />
<meta property="og:site_name" content="YOUR_STUFF" />
<meta property="og:type" content="website" />
<meta property="og:title" content="YOUR_STUFF" />
<meta property="og:description" content="YOUR_STUFF" />
<meta property="og:image" content="THE_IMAGE_TO_BE_SHOWN">
NOTE: facebook has some requirements in images, first make sure it is more than 200x200 in dimension
#3
If all the above didn't work, you will need to do some debugging
Go to this link ( facebook debugger) and past your site link, and check the errors, warning, and all the great information of how facebook sees your webiste
https://developers.facebook.com/tools/debug
#4
Also check server logs
"HEAD /images/close-icon.png HTTP/1.1" 206 337 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)"
Note: HTTP 206 response code is ok, it is part of multiple partial downloads of the image
Your website image is not shown when sharing on Facebook
Solution
Don't retry on facebook news feed since it is cached
#1
Try to invalidate the cache, check my previous article
http://karim-ouda.blogspot.com/2011/10/how-to-refresh-url-entries-in-facebook.html
#2
Add facebook meta-tags in your page "head", and try again
<meta property="og:url" content="YOUR_STUFF" />
<meta property="og:site_name" content="YOUR_STUFF" />
<meta property="og:type" content="website" />
<meta property="og:title" content="YOUR_STUFF" />
<meta property="og:description" content="YOUR_STUFF" />
<meta property="og:image" content="THE_IMAGE_TO_BE_SHOWN">
NOTE: facebook has some requirements in images, first make sure it is more than 200x200 in dimension
#3
If all the above didn't work, you will need to do some debugging
Go to this link ( facebook debugger) and past your site link, and check the errors, warning, and all the great information of how facebook sees your webiste
https://developers.facebook.com/tools/debug
#4
Also check server logs
"HEAD /images/close-icon.png HTTP/1.1" 206 337 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)"
Note: HTTP 206 response code is ok, it is part of multiple partial downloads of the image
Tuesday, January 8, 2013
Empty $_SESSION after PHP redirect using GET or CURL (not browser)
Error
Empty $_SESSION after PHP redirect between 2 scripts, the first script is called using GET or CURL (not browser)
Steps
1- Call "script1" using GET or CURL
2- "Script1" starts/fills session X, does some logic, redirect to "Script2"
3- In "Script2", print_r($_SESSION) is empty
Solution
I found that the SESSION in "Script2" is a NEW session, let's call it:Session Y , since Session X was not transferred in HTTP header in the redirect
So it seems that the SESSION information transfer in headers was being done by the browser and it is not done by GET or CURL command line,
So we need to do it instead
Step 1:
In Script #1, change the redirection to be
header("Location:$targetPage?".SID);
SID is a constant containing the following
PHPSESSID=oilq46ge4e2f76774qcg8gi3d1
Step 2:
In script #2, start the script with the following
session_id($_GET['PHPSESSID']);
session_start();
So you are telling the script to load Script1's session
That's it
Final note
You may have a different issue too, check this post
http://karim-ouda.blogspot.com/2012/04/php-session-empty-after-header.html
Keywords
Redirect PHP command line new $_SESSION GET session_id start_session browser PHPSESSID cookie CURL Set-Cookie HTTP header
Empty $_SESSION after PHP redirect between 2 scripts, the first script is called using GET or CURL (not browser)
Steps
1- Call "script1" using GET or CURL
2- "Script1" starts/fills session X, does some logic, redirect to "Script2"
3- In "Script2", print_r($_SESSION) is empty
Solution
I found that the SESSION in "Script2" is a NEW session, let's call it:Session Y , since Session X was not transferred in HTTP header in the redirect
So it seems that the SESSION information transfer in headers was being done by the browser and it is not done by GET or CURL command line,
So we need to do it instead
Step 1:
In Script #1, change the redirection to be
header("Location:$targetPage?".SID);
SID is a constant containing the following
PHPSESSID=oilq46ge4e2f76774qcg8gi3d1
Step 2:
In script #2, start the script with the following
session_id($_GET['PHPSESSID']);
session_start();
So you are telling the script to load Script1's session
That's it
Final note
You may have a different issue too, check this post
http://karim-ouda.blogspot.com/2012/04/php-session-empty-after-header.html
Keywords
Redirect PHP command line new $_SESSION GET session_id start_session browser PHPSESSID cookie CURL Set-Cookie HTTP header
Wednesday, January 2, 2013
Disney World app

File recovery app

Subscribe to:
Posts (Atom)