Tag Archives: php
Using PHP to Add Facebook Open Graph Read Action
I’m trying to get Facebook to publish a read action using PHP. I’ve coded it totally wrong and need a little help:
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if …
Error in query, what is Resource id #9?
I have following code..
$query = "SELECT quote, author FROM quotes ORDER BY id DESC";
$resut = mysql_query($query, $connection) or die(mysql_error());
echo $result; //for debuggin purpose
while($result_set = mysql_fetch_array($result)) {
echo '<div class="pullquote">';
echo $result_set['quote'];
echo ' - ';
echo …
SSH Connection to Amazon EC2 Instance Via PHP
Trying to connect to an Amazon EC2 instance using a .pem file, PHP, and phpseclib.
I have tried what’s mentioned in this post:
ssh access to ec2 from php
However, I keep getting “Error 111. Connection refused in…”
When I… Continue reading
Insert user value into messages table where user division = division.divisionid
Can anyone shed any light on how I insert a table entry in my messages table for each user.ID where the users.MM_Division = division.divisionid
I want to include the user ID value in the messages.messagesuserid
I think I need a… Continue reading
PHP MySQL session_set_save_handler race condition
I have written a simple session_set_save_handler using a MySQL innoDB table as the storage backend. MySQL is 5.5.
Code looks like so (very simplified, but hopefully illustrates the flow of code), I am using RedBean ORM for interacting with the… Continue reading
php get mysql result not as array, but as text
I want to get text result like:
+----+-------+----------------------------------+----+
| id | login | pwd | su |
+----+-------+----------------------------------+----+
| 1 | root | c4ca4238a0b923820dcc509a6f75849b | 1 |
+----+-------+----------------------------------+----+
1 row in set (0.00 sec)
…
in PHP (string).
Example in php: Continue reading
For a review website, which language?
I am thinking of building a review website and i was thinking about using php. What language would be good for a website like ratemyprofessor? would ruby be better?… Continue reading
Sending a POST request without submitting an HTML form
I am wondering, is it possible to send an HTTP POST in PHP without using an HTML form. Can this be done internally using PHP? If not, maybe using JavaScript or jQuery?… Continue reading
How to keep the Chinese or other foreign language as they are instead of converting them into codes?
DOMDocument seems to convert Chinese characters into codes, for instance,
你的乱发 will become ä½ çš„ä¹±å‘
How can I keep the Chinese or other foreign language as they are instead of converting them into codes?
Below is my simple test,
$dom …
How to encode output buffers in json -php
I’m trying to encode an the result of an output buffer in json, but I’m not getting the correct result:
My code:
$n=ob_get_flush();
$arr = array('base64' => $n);
echo json_encode($arr);
The result:
xyz{"base64":null}
The hoped result:
{"base64":xyz}
…
Any help would Continue reading





