Archivo de la etiqueta: 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 rightSigue leyendo

Etiquetado , , , | Deja un comentario

PHP Cabecera() redirigir muestra brevemente URI de edad antes de redirigir a la nueva

Ahora mismo, 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’Sigue leyendo

Etiquetado , , , | Deja un comentario

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 andwipe outthe url. La Sigue leyendo

Etiquetado , , , , | Deja un comentario

Cannot display XML ,error at the end of document

Este es mi 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'];
    

Sigue leyendo

Etiquetado , , | Deja un comentario

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 aSigue leyendo

Etiquetado , , | Deja un comentario

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. Aquí está mi código.

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

Sigue leyendo

Etiquetado , | Deja un comentario

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 

Sigue leyendo

Etiquetado , , | Deja un comentario

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 theSigue leyendo

Etiquetado , , , | Deja un comentario

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 = 

Sigue leyendo

Etiquetado , , , , | Deja un comentario

grep con-f como en 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. Gracias!… Sigue leyendo

Etiquetado , | Deja un comentario
56 páginas