|
Hi,
I am using the following code to publish a post to Facebook using PHP. I only have one problem left... I want to know how can I obtain an access-token for my page before publishing the post as access-tokens are not permanent.
<?php
class PublishOnFacebook
{
function status_update($status_text)
{
require_once("facebook/facebook.php");
$config = array();
$config['pageId'] = 'xxxxxxxxxx';
$config['appId'] = 'yyyyyyyyyy';
$config['secret'] = 'zzzzzzzzzzzzz';
$config['fileUpload'] = false;
$fb = new Facebook($config);
$params = array(
"access_token" => $config['appId'] . "|" . $config['secret'],
"message" => $status_text,
"link" => "http://www.pontikis.net/blog/auto_post_on_facebook_with_php",
"picture" => "http://i.imgur.com/lHkOsiH.png",
"name" => "How to Auto Post on Facebook with PHP",
"caption" => "www.pontikis.net",
"description" => "Automatically post on Facebook with PHP using Facebook PHP SDK. How to create a Facebook app. Obtain and extend Facebook access tokens. Cron automation."
);
try
{
$ret = $fb->api('/xxxxxxxxxx/feed', 'POST', $params);
echo 'Successfully posted to Facebook';
}
catch(Exception $e)
{
echo $e->getMessage();
}
}
}
?>
Technology News @ www.JassimRahma.com
|
|
|
|
|
Why not ask at Facebook[^]?
Veni, vidi, abiit domum
|
|
|
|
|
Hi
I'm having a weird situation here.
I'm trying create a PDO object, like this:
$dbh = new PDO('mysql:host='.$hostname.';dbname='.$dbname,$username, $password);
I have rewriting ON in my .htaccess file. when I try to run the script using a URL that will trigger a rewrite rule, it shows me the following error:
Fatal error: Class 'PDO' not found
I have a exception rewrite rule for a directory where the script is, named PHP, like this:
RewriteRule ^(php)($|/) - [L]
if I run the scripting directly from the directory, it runs normally with no erros.
I don't know why this is happening. any clues?
Thank you
|
|
|
|
|
just adding some info:
the problem can be seen in the following URLs
the rewrited one (where the problem occur)
www.qualocep.com/dbc/
and the direct file, when it works
www.qualocep.com/php/dbc.php
I put a phpinfo() the to show more info about the server.
|
|
|
|
|
Solve it.
There was an empty php.ini in the public_html, I deleted it, and it worked.
thank u all
|
|
|
|
|
Hi,
I am using arabic web font and it's working perfect on Chrome and Safari but not in IE?
@font-face {font-family: "Kufi"; src: url('font/DroidKufi-Regular.ttf') ;}
How can I fix it please?
Thanks
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
Hi,
I have a PHP page with cboindustry <select> item. I am doing the following to check if <select> has an entry then it will run the stored procedures:
if ($_POST['cboIndustry'])
{
foreach ( $_POST['cboIndustry'] as $key => $value )
{
$mysql_query = $mysql_connection->prepare('CALL sp_add_new_company_industry(:param_member_guid, :param_company_guid, :param_company_industry, :param_created_ip_address)');
$mysql_query->bindParam(':param_member_guid', $_SESSION["xoompage_member_guid"], PDO::PARAM_STR);
$mysql_query->bindParam(':param_company_guid', $company_guid, PDO::PARAM_STR);
$mysql_query->bindParam(':param_company_industry', $value, PDO::PARAM_STR);
$mysql_query->bindParam(':param_created_ip_address', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR);
$mysql_query->execute();
}
}
but I am getting the following error:
PDO Exception Caught. Error with the database:
SQL Query: Code: HY000 Error: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'param_company_industry' at row 1SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'param_company_industry' at row 1
here is my var_dump of the cboIndustry:
array(1) { [0]=> string(0) "" }
and here is the html:
<tr>
<td valign="middle">Industry</td>
<td valign="middle">:</td>
<td valign="middle">
<div id="container">
<select id="cboIndustry" name="cboIndustry[]" style="width: 80%" <?php if (!$_GET["id"]) { ?>required<?php } ?>>
<option value="" selected>[Industry..]</option>
<?php
$mysql_command = "CALL sp_populate_industry()";
$mysql_query = $mysql_connection->prepare($mysql_command);
$mysql_query->execute();
while($mysql_row = $mysql_query->fetch())
{
?>
<option value="<?php echo $mysql_row['industry_id']; ?>"><?php echo $mysql_row['industry_name']; ?></option>
<?php } ?>
</select>
<button id="btnAddIndustry" type="button" style="width:150px">Add More</button>
</div>
</td>
</tr>
Technology News @ www.JassimRahma.com
|
|
|
|
|
According your error the problem is that $value is not numeric (empty)...
|
|
|
|
|
I am trying to add html5 video tag element in my website, video is working fine in FIREFOX , CHROME , IE11 but it is not working in safari, opera.
Code i have used is
<video loop="loop" autoplay="autoplay" preload="none">
<source src="video/video1.mp4" type="video/mp4"></source>
</video>
More over i tried with html5easy editor tool to convert to get .ogg format still i am facing the same problem.
Thanks
modified 10-Jan-14 1:58am.
|
|
|
|
|
|
Hi,
I changed my wodrpress URL manually and after then i saved and loged out from admin panel . now i can't login to my wordpress Admin page after changing The URL 's and whenever i want to log in it redirects to other page that i changed in URL . now i can't login to Admin page to correct URL's . what should i do to solve this problem .
Thanks so much ,
D.riazi
|
|
|
|
|
Contact Wordpress and ask for help.
Veni, vidi, abiit domum
|
|
|
|
|
I don't have any access to server and database .
Is there any other solution for solving this issue ?
D.riazi
|
|
|
|
|
please help me to solve this problem .
It's very important for me as soon as possible to find a better solution to solve this issue .I must log in admin panel to improve my site .
D.riazi
|
|
|
|
|
When was the last time you managed and backed-up the WordPress MySQL database? Assuming you have a back-up (you DO have a back-up don't you?) ... Perhaps you can restore it to the last back-up state - that's the back-up prior to you changes you (incorrectly?) made, AFTER backing-up the presently existing database. The description of the database is ... http://codex.wordpress.org/Database_Description[^] and ... https://wpbits.wordpress.com/2007/08/08/a-look-inside-the-wordpress-database/[^]
You say you don't have access to the server and database ... WELL go and ask the creator of that solution for access details and any DB back-ups.
Your web host logon would not have changed. So access and manage that database via that web host logon.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Hi ,
Unfortunately , i do not have any access to server and my database .
Is there any other solution for solving this issue ?
Thanks ,
D.riazi
|
|
|
|
|
So you want us to help you hack into a WordPress site that you don't have access to?
Yeah, that's not going to happen.
If you own the site, contact WordPress. If you don't own the site, then you can't access it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You could try and grovel to the web hosting organization, but I seriously doubt any success (you know ... Security and authenticity etc). Alternately, thump (metaphorically speaking) the owner of that website until he/she/they give you access details to the web hosting organization and hopefully a recent db back-up. AND understand the importance of backing-up a database.
Otherwise, you are up a creek without a paddle. And you can perform no work until they do supply that info!
A general word of advice, "Don't change anything unless you can undo such changes without breaking the thing!"
Sorry
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Thanks for your advice ,
D.riazi
|
|
|
|
|
if there is free open source script like that
[^]
please give me link
|
|
|
|
|
|
Hi,
I am using the following url for my website admin:
http://www.mywebsite.com/site.admin
I would like to know how can prevent search engines from indexing the above url and anything under that folder e.g. site.admin/new.php, site.admin/edit.php, etc?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
Hi,
I am using the following code to check if the $company_region is empty of NULL in the database but it's not working:
<?php if (!isset($company_region) || !empty($company_region) || !is_null($company_region)) { ?>
<tr>
<td align="left" valign="top" style="width: 100px;">State / City</td>
<td align="center" valign="top" style="width: 20px;">:</td>
<td align="left" valign="top"><?php echo $company_region; ?></td>
</tr>
<?php } ?>
I tried all the combinations but I am still getting the row show on the page with a blank State/City! The value in the database is NULL when I run the stored procedure on the database itself.
What can I do?
Thanks
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|