Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8592235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:42:26+00:00 2026-06-11T23:42:26+00:00

im having a odd problem os my website, i have a script that records

  • 0

im having a odd problem os my website, i have a script that records all the searchs and insert those search words on database, the problem is that since search engine robots started sneaking around my website, they make my script to produce search keywords like “search keywords////////////////////////////////////////////////”
I want to strip that characteres ( ////////// ) before indexed on mysql.

This is what i have:

$search=htmlspecialchars($_GET['load']); 
$say=mysql_query("SELECT * FROM madvideo WHERE MATCH (baslik) AGAINST ('*$search*' IN BOOLEAN MODE)"); 
$saydim=mysql_num_rows($say);
$count = $saydim;
$page = !empty($_GET["page"]) ? intval($_GET["page"]) : 1;
$s = ($page-1)*$perpage;
$sayfasayisi=ceil($count/$perpage);
if(ayaral("Arananlar-Kaydet")=="1") {
$ekle=cevir($search);
@mysql_query("insert into tag (baslik,tr,tarih) values ('$search','$ekle',now()) "); }

The variable ” $search ” will call the search word, and i dont know whats the strip syntax i have to use to strip that nasty ///////// character.

EDIT: the code that creates the words is this:

$vtitle = str_replace("\r\n\r\n", ' ', $vtitle); 

$words = explode(' ', $vtitle); 

$k = count($words); 
$k3 = ceil($k/3); 

$new = array(); 
for ($i=0; $i<$k; $i+=$k3) { 
    $new[] = join(' ', array_slice($words,$i, $k3)); 
} 
$tag1 = $new[0]; 
$tag2 = $new[1]; 
$tag3 = $new[2];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:42:27+00:00Added an answer on June 11, 2026 at 11:42 pm

    Use MySQL TRIM function to remove from end of the string as follows:

    TRIM(TRAILING '/' FROM <string>)
    
    @mysql_query("insert into tag (baslik,tr,tarih) 
    values (TRIM(TRAILING '/' FROM '$search'),'$ekle',now())")
    

    To trim from both beginning and ending, use following

    TRIM(BOTH '/' FROM <string>)
    
    @mysql_query("insert into tag (baslik,tr,tarih) 
    values (TRIM(BOTH '/' FROM '$search'),'$ekle',now())")
    

    To remove all occurences of the string use REPLACE function as follows:

    REPLACE(<string>, '/', '')
    
    @mysql_query("insert into tag (baslik,tr,tarih) 
    values (REPLACE('$search', '/',''),'$ekle',now())")
    

    Hope it helps…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an odd problem: I have this code that I'm using exactly as-is
I'm having a very odd problem that I can't understand. I have created an
I was having an odd problem that I narrowed down to the following test
I am having a rather odd problem with the Gecko Webbrowser control, I have
We are having an odd problem with .NET Remoting. Basically, we have a server
Having odd problem with mapping tables with code-first EF. I have a parent class
I'm having a somewhat odd problem with Python(2.6.2) that I've come to the conclusion
I am having an odd problem with jQuery 1.5.2 in Chrome. I have code
I'm having a really odd problem that seems very unrelated. I'm trying to use
Im currently having an odd problem. The problem is located at a dutch website

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.