Tag Archives: php5
Why does the Facebook PHP SDK logouturl not actually log the user out?
I am using the Facebook PHP sdk, and after the user logs in, I show a link for the logout URL using $facebook->getLogoutUrl().
But when the user clicks on that link, it seems to go to Facebook and redirect right… Continue lendo
PHP cabeçalho() redirecionar mostra brevemente URI de idade antes de redirecionar para o novo
Agora mesmo, I am using a custom PHP solution to force WWW to be appended to my script URLs, since I am using WordPress’ .htaccess rules to “clean up” index.php. The force WWW .htaccess rules are not compatible with WordPress’… Continue lendo
How can you get the replaced text with preg_replace?
I am using the preg_replace function in PHP and am trying to replace urls that users submit with bit.ly shortened links:
$comment = preg_replace( '/(http|ftp)+(s)?:(//)((w|.)+)(/)?(S+)?/i', '', $strText );
…
This will show only the comment and “wipe out” the url. O Continue lendo
Cannot display XML ,error at the end of document
Este é meu código
<?php
$allBots = require_once 'botsPath.php';
$method = $_SERVER['REQUEST_METHOD'];
$request = explode("/", substr(@$_SERVER['PATH_INFO'], 1));
//var_dump($allBots);die;
$botName = array_shift($request);
$res = '';
$botJid = '';
$returnMessageTo = '';
if(isset($allBots[$botName])){
require_once $allBots[$botName]['path'];
$botObject = new $allBots[$botName]['class'];
$botJid = $allBots[$botName]['jid'];
…
Como impedir que dados de banco de dados de quebrar uma página HTML?
I know that when taking data from a form and putting it into a MySQL database that the data should be escaped using mysql_real_escape_string() to prevent SQL injections. My question is a little different.
I am pulling data from a… Continue lendo
how to stop receiving duplicate mail?
When a user press submit button I received 7 copies duplicate mail in my administrator email box. How can I receive only one mail. aqui está o meu código.
$MyCoupon = 0;
$cResult=mysql_query("select * from codes WHERE status='active'");
while($cRow = mysql_fetch_assoc($cResult)){
…
PHP – Não carregar o XML inválido em documento DOM
I have an xml file with a header like the following:
<!ENTITY nbsp " "><!-- no-break space = non-breaking space,
U+00A0 ISOnum -->
<!ENTITY iexcl "¡"><!-- inverted exclamation mark, U+00A1 ISOnum -->
<!ENTITY cent "¢"><!-- cent sign, U+00A2 ISOnum -->
<!ENTITY …
Only do the insert if rows are not there
Hello i have a simple sql select and insert which this site helped me otu with but now i need to make it so that it only does the insert for the rows which are not there. So if the… Continue lendo
PHP file transfer conversion, fsockopen to curl
I want to convert the following code to use curl instead of fsockopen
<?php
set_time_limit(1600);
error_reporting(0);
$line = file_get_contents("php://input");
$encryptEnable = substr($line,0,1);
$line = substr($line,1);
if($encryptEnable=="Y"){
$line = deccrypt_string($line); }
$hostport = substr($line,0,61);
$bodyData = substr($line,61);
$line ='';
$host = …
grep with -f like in PHP
Is there such function in PHP which does grep -f filename in unix/linux systems..
If there is non, what PHP functions/tools would help much in creating a costumize method/function for this. Obrigado!… Continue lendo





