PHP code in Backpage

by 4 replies
6
Hi there,

I'm trying to bypass the character limit in Backpage as I have seen others do, without the use of iframes as they are not allowed.

I came across this description of limiting the displayed characters from your text and I can't figure out how to use it with my own text. Here is what the website I found it on said:


<?php

$position=14; // Define how many characters you want to display.

$message="You are now joining over 2000 current";

// Find what is the last character.
$post = substr($message,$position,1);


// In this step, if the last character is not " "(space) run this code.
// Find until we found that last character is " "(space)
// by $position+1 (14+1=15, 15+1=16 until we found " "(space) that mean character no.20)
if($post !=" "){

while($post !=" "){
$i=1;
$position=$position+$i;
$message="You are now joining over 2000 current";
$post = substr($message,$position,1);
}
}


$post = substr($message,0,$position);

// Display your message
echo $post;
echo "...";


More importantly, would this even work in Backpage?

Thank you!
#programming #backpage #code #php
  • You can't run PHP code in a Backpage ad description -- it would be a serious security hole if you could!

    If Backpage has a character limit for their ads, then you should respect that. If you don't like their terms, don't use their site.
    • [ 1 ] Thanks
  • There are some ads running php code, I havent investigated fully, but I have viewed
    Source and have seen it embedded...
    • [1] reply
    • What you saw was probably an attempt of including PHP code inside an ad. A hacking attempt, if you will.
      If it was successful, you wouldn't be able to see the actual PHP code, only its output.
  • Hello nadiahedonistic,

    <?php

    $position=14; // Define how many characters you want to display.

    $message="You are now joining over 2000 current";

    $post = substr($message,$position,1);
    if($post !=" "){
    $i=1;
    while($post !=" "){
    $position=$position+$i;
    $message=$message;
    $post = substr($message,$position,1);
    }
    }

    $post = substr($message,0,$position);


    echo $post;


    Try This code

Next Topics on Trending Feed