Jump to content

merylvingien

Members
  • Posts

    267
  • Joined

  • Last visited

Everything posted by merylvingien

  1. Thanks folks, i will have a play about with it
  2. Hi folks, i have implemented a search page on my site which works ok, but it only returns results for searches which are matched identically. For example, if i search for "rubber ducky in bath" it will only return a result where that exact phrase is present within the database. I am wondering if there is a way of loosening this up a bit, so if i searched "bath" it will return the same result? The code i have is this: if (isset($_GET['search'])) { $searchTerms = trim($_GET['search']); $searchTerms = strip_tags($searchTerms); // remove any html/javascript. if (strlen($searchTerms) < 3) { $error[] = "Search terms must be longer than 3 characters."; }else { $searchTermDB = mysql_real_escape_string($searchTerms); // prevent sql injection. } // If there are no errors, lets get the search going. if (count($error) < 1) { $searchSQL = "SELECT stitle, varia, sbody FROM simp_search WHERE `sbody` LIKE '%{$searchTermDB}%' OR `varia` LIKE '%{$searchTermDB}%' OR `stitle` LIKE '%{$searchTermDB}%' ORDER BY `stitle`";
  3. Yea, your probably right! It is a waist of time. But! LOL
  4. The issue of capturing the guys doing it isnt a problem, i can do that easily. Finding some really cruel and wicked way of paying them back is! I think the e bomb idea is probably the way to go. Maybe open up 1000 internet e and 1000 firefox browser windows on their pc's would send the message that i want. LOL Is there a way to remotely format someones hard drive?
  5. I get half a dozen emails from the same morons each day, they are manually entering the text into a php form which is captcha protected! I have never replied and just about fed up with them. I have blacklisted the current email addresses that they are using at the moment, then redirected them to wikipedia's page on spam email, which has stopped them for the moment, but in the words of arnie "they will be back" I was thinking about a e bomb, but does anyone have any other even better ideas to really piss these guys off? A simple redirect doesnt really do them justice They are advertising seo services, i am page one, number one for my topic, just to show how clever these idjiots are!
  6. Yes, as scampbell has indicated. $msg = nl2br($msg);
  7. If you want the original message to appear withing the text box that you write the reply, try this: <textarea name=\"?\" rows=? cols=?>$msg</textarea> Obviously fill in the question marks. However, it would probably be better to show the original message above the reply text box, maybe just put a border around it and different background colour to highlight it.
  8. $simple_search = array( '/\[url\](.*?)\[\/url\]/is', ); $simple_replace = array( '<a href="$1" target="_blank" title="$1">$1</a>', ); $post = preg_replace ($simple_search, $simple_replace, $post); echo "$post";
  9. Thanks for your help teamatomic All working!
  10. I am so close i can taste it LOL $homepage = file_get_contents("$url1"); $mylink = 'http://www.mysite.com'; $pos = strpos($homepage, $mylink); $endlink = substr($homepage,($pos + strlen($mylink)),200); # Get HTML after URL $begininglink = substr($homepage,($pos - strlen($mylink) - 100),200); # Get HTML before URL $completelink = array($begininglink, $endlink); if(in_array('rel="nofollow"',$completelink)) {echo "nofollow found";} else {echo "link is clean <br>";} print_r($completelink); Ive gone about it slightly differently from teamatomic's suggestion, only becuase i am not clued up on arrays too much. This code is echoing out the the link and code before the link and after, i have a page that i am looking at with a nofollow tag but its still showing link is clean, when it should be saying nofollow found! Someone must be able to see the fault here!
  11. teamatomic I am having real trouble trying to implement your code, i must be really thick! It seems to come back "link is clean" no matter what is on the destination page.
  12. Thanks for the reply, most of my members sites are small self built 4-5 page sites, some of them are more proffesionaly designed, but i would hazard a guess that 99% of them are not using a cms. They are basicly just trying to get round my system for a free link without having to give one back. I will have a play with your suggestion and see if i can intergrate that into what i have now and put pay to thier antics! At the very least it will give them another 6 months of head scratching and try new ways of getting around my code LOL
  13. I have a link checking system which simply checks to see if my site has a inbound link from a members site, if it all checks out ok an outbound link is shown on the members page on my site. Its amazing the lengths people will go to to try and cheat the system and get round it, one of the reasons i have automated it. However, one or two members are adding a no follow tag to the inbound links and i am a bit stuck on how to check for this. My working code as it is now: $url1= "http://{$row2['url']}"; $url2 = "http://{$row2['weblink']}"; preg_match('@^(?:http://)?([^/]+)@i', "$url1", $matches); $host = $matches[1]; $sampleurl1 = "{$matches[0]}"; preg_match('@^(?:http://)?([^/]+)@i', "$url2", $matches2); $host2 = $matches2[1]; $sampleurl2 = "{$matches2[0]}"; if (empty ($row2['weblink'])) {$link = "";} else if ($sampleurl1 == $sampleurl2) { $homepage = file_get_contents("$url1"); $mylink = 'http://www.mysite.com'; $pos = strpos($homepage, $mylink); if ($pos === false) { $link = ""; } else { $link = "<p>{$row2['fname']} has a web site which can be found here <br><a title='{$row2['linktitle']}'href='http://{$row2['weblink']}'>{$row2['linktitle']}</a></p><br>"; } } Would appreciate some thoughts, as most of you guys actually know what your talking about lol
  14. You know ive been playing with this for hours, never realised that could be the problem. Many thanks for the solution
  15. Hi folks, i am trying to automate a link checking system, basicly if a page is accessed, php checks a site to see if a link is present, if so then it displays a link on the page. Here is the code i have so far: if (empty ($row['weblink'])) {$link = "";} else if (!empty ($row['url'])) { $url1= "{$row['url']}"; $homepage = file_get_contents('$url1'); $mylink = 'http://www.mysite.com'; $pos = strpos($homepage, $mylink); if ($pos === false) { $link = ""; } else { $link = "<p>{$row['fname']} has a web site which can be found here <br><a href='http://{$row['weblink']}'>{$row['linktitle']}</a></p><br>"; } } echo "$link"; sommit aint right, as its not echoing the right output when the correct link is present Any thoughts?
  16. Hi Fellas, i am using a pretty well known contact form script from the web and have used it many times before, but on one particular site i am getting a header already sent error message come up and wondered if you guys can see the problem. <?php // ----------------------------------------- // The Web Help .com // ----------------------------------------- // remember to replace you@email.com with your own email address lower in this code. // load the variables form address bar $name = $_POST["name"]; $contact = $_POST['contact']; $message = $_POST["message"]; $verif_box = $_REQUEST["verif_box"]; // remove the backslashes that normally appears when entering " or ' $name = stripslashes($name); $message = stripslashes($message); $from = stripslashes($from); // check to see if verificaton code was correct if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){ // if verification code was correct send the message and show this page mail("someone@somesite.com", ' contact form via web ', "\n $name just filled in the contact us form at somesite \n Their email address is: $contact \n Their message is: $message " , "From: $contact" ); // delete the cookie so it cannot sent again by refreshing this page setcookie('tntcon',''); } else { // if verification code was incorrect then return to contact page and show error //problem line header("Location:".$_SERVER['HTTP_REFERER']."?subject=$subject&from=$from&message=$message&wrong_code=true"); exit; //end of problem line } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Your message has been sent.</title> </head> rest of page <body> <div id="shadow"> <div id="pagewrapper"> <div id="header"> etc etc The code highlighted in red is the offending beast... Error message is: PHP Warning: Header may not contain more than a single header, new line detected. in /home/**/**/quickmailer.php on line 31
  17. Hi Fellas, i rewrote some urls ages ago and the rewritten urls are hard coded into a database, lots of them. I have had to change some things about and those rewritten urls are no longer active and need to be rewritten or redirected back to the originals, all very confusing i know. Anyway, is it possible to redirect a url in this way? redirect 301 /folder-name/$1 http://www.mysite.com/folder-name.php?variable=$1 I have tried this and NO! But i am sure you guys will know a way, and i am useless (worse than useless at writing htaccess) Any help would be appreciated as always!
  18. Are you guys serious??? Microsoft still have a web browser? Whoed have thunk it? You gotta give em full credits for persistance... Last time i used microsofts browser i was running windows 95, now who can remember that barrel of laughs?
  19. I think its something to do with the fact that the domain name isnt pointing at the server right now. Ive tested this on another site which is live and used the server link and no rewrites will work on that either. I didnt realise that it would only work when the full domain name is used! Or am i incorrect in thinking this?
  20. Sorry i should have marked this as resolved. I ended up solving it like this $title=$_POST['title']; $title= trim($title); $sql = "SELECT * FROM blog WHERE title='$title'"; $result = mysql_query($sql, $con) or trigger_error("SQL", E_USER_ERROR); $row = @mysql_fetch_array($result); $urltitle= $row['title']; if (empty($urltitle)) { echo "yes"; } else { echo "no"; } ?> Its probably an arse about face way of doing it, as most of my code is like that lol
  21. Please forgive me, i have been away too long and forgot some stuff lol I am trying to get this ajax/php thing working for a page, where its supposed to check the database to see if a title has already been used, if so it returns a message telling them so. But i am having difficulty with this part: $sql = "SELECT * FROM blog"; $result = mysql_query($sql, $con) or trigger_error("SQL", E_USER_ERROR); $row = @mysql_fetch_array($result); $urltitle= "{$row['title']}"; $title=$_POST['title']; if (in_array($title, $urltitle)) { //title is not availble echo "no"; } else { //title is available echo "yes"; } I have a mistake there somewhere and i am sure its to do with the array from the database, as when i try this out it comes back with everything ok message when it shouldnt. I have always been bloody useless with arrays anyway. Can anyone see an obvious mistake here?
  22. Hi fellas, what the am i doing wrong here lol Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteRule ^articles/([a-z0-9]+)/?$ articles.php?urltitle=$1 [NC,L] if i am correct which i obviously am not that should write a url to www.somesite.com/articles/some-text-here Can anyone help me out here cause it aint working lol
  23. Shame, i respected Daniel0's posts and comments. He always talked sense and provided useful information.
  24. Hi guys and gals, i am thinking of a redesign for my site as i have run into some duplicate content issues that are difficult to overcome. As it stands at the moment i have around 3000 pages wich are in essence postcode locations. Each signup (its a free site) can take 12 pages (this is where the duplicate content comes into play) and they can advertise their skills on each of these 12 pages (same advert so duplicate content) The way the site works is: some one comes along and enters the first part of thier postcode, and they are taken to the page relevant to that postcode. I am thinking of a redesign where each advertiser would only have one page (i can remove the old 3000 pages from google) with all the various postcodes that they cover, thus no duplicate content. At the moment, the url structure is the get method, so someone types in postcode "ss10" the url will look like foldername.php?postcode=ss10&postcodesearch=Submit The database is two tables, one for the postcode names with the details of areas etc and the second table is for the signups and thier details. I was thinking along the lines of someone types in ss10, this queries the postcode table and finds the user id then extracts the info from both tables to build just one page will all the data on it. However, i will end up with the same amount of postcode pages doing it this way. Can anyone think of a way where it can produce a single url for any of the 12 postcodes per signup? I can then narrow the pages down to something like a total of 250 pages!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.