4 replies
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!
#backpage #code #php
  • Profile picture of the author Brandon Tanner
    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.
    Signature

    {{ DiscussionBoard.errors[8514959].message }}
  • There are some ads running php code, I havent investigated fully, but I have viewed
    Source and have seen it embedded...
    {{ DiscussionBoard.errors[8858486].message }}
    • Profile picture of the author great9
      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.
      {{ DiscussionBoard.errors[8859519].message }}
  • Profile picture of the author vaghela dev
    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
    {{ DiscussionBoard.errors[8883420].message }}

Trending Topics