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 rightContinuer la lecture

Tagged , , , | Laisser un commentaire

PHP Header() redirect shows old URI briefly before redirecting to new

Dès maintenant, I am using a custom PHP solution to force WWW to be appended to my script URLs, since I am using WordPress’ .htaccess rules toclean up” index.php. The force WWW .htaccess rules are not compatible with WordPress’Continuer la lecture

Tagged , , , | Laisser un commentaire

Comment pouvez-vous obtenir le texte remplacé avec 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 andwipe outthe url. L' Continuer la lecture

Tagged , , , , | Laisser un commentaire

Cannot display XML ,error at the end of document

Ceci est mon code

<?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'];
    

Continuer la lecture

Tagged , , | Laisser un commentaire

How to stop database data from breaking an HTML page?

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 aContinuer la lecture

Tagged , , | Laisser un commentaire

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. voici mon code de.

$MyCoupon = 0;
$cResult=mysql_query("select * from codes WHERE status='active'");
while($cRow = mysql_fetch_assoc($cResult)){
    

Continuer la lecture

Tagged , | Laisser un commentaire

PHP – Won't load invalid XML into DOM Document

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 

Continuer la lecture

Tagged , , | Laisser un commentaire

Ne faites l'insert si les lignes ne sont pas là

Bonjour, J'ai un simple sql sélectionner et insérer ce site qui m'a aidé avec otu mais maintenant j'ai besoin de faire en sorte qu'il ne fait que l'insert pour les lignes qui ne sont pas là. So if theContinuer la lecture

Tagged , , , | Laisser un commentaire

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 = 

Continuer la lecture

Tagged , , , , | Laisser un commentaire

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. Merci!… Continuer la lecture

Tagged , | Laisser un commentaire
56 pages