Jump to content

nicob

Members
  • Posts

    40
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nicob's Achievements

Member

Member (2/5)

0

Reputation

  1. I'm trying to understand this. So for all keywords I have to do something like this? RewriteEngine on RewriteBase / RewriteRule ^start\.php\?q=([a-z]+)$ $1.php
  2. How do you mod_rewrite www.website.com/start.php?q=keyword to www.website.com/keyword.php ???
  3. Thank you. @Ken2k7 Some people like to use strange characters in their 'names'. It works ok in the browser, except this problem.
  4. I tried to get the id info from http://www.domain.com/profile.php?id=v-&-cat but I only see the 'v-' The codes I tried <?= htmlentities($_GET['id']) ?> and <?php echo $_GET['id'] ?> Is this normal? And if so, how to fix this? thx!
  5. PHP is indeed better than js. So this topic is solved as there is no other solution. Thx!
  6. By the way. Your code works very well. I added $replace = str_replace(" ", "+", "$_GET[q]"); to replace the spaces. Thx! If it's not possible to manipulate the search form, then this topic is solved.
  7. Thank you for the code, Brian. But I was looking for a manipulation from the search form. By using 'RewriteRule' in htaccess I can visit a search result in this way => http://www.mydomain.com/search/-blabla+blabla-1-1-10-and.html . But when I use the search field I get the old url => http://www.mydomain.com/search/page.php?q=blabla+blabla and I don't want this to show for the users anymore!
  8. With this code I get http://www.mydomain.com/search/page.php?q=blabla+blabla <form method="get" action="search/page.php"> <fieldset> <input type="text" name="q" value="" /> <input type="submit" value="search" /> </fieldset> Now I want this result => http://www.mydomain.com/search/-blabla+blabla-1-1-10-and.html or http://www.mydomain.com/search/-blabla-1-1-10-and.html but I don't know how!
  9. I'm using this script for searching in txt or html files. The problem is that it doesn't always show the complete line. for example I search for 'france'. My test.html contains: http://www.link1.com/ website about france blablabla http://www.link2.com/ website about blabla and people in france blablabla the result I get: http://www.link1.com/ website about france blablabla link2.com/ website about blabla and people in france blablabla So if the keyword is NOT near the beginning of the line it breaks the sentence. So what do I have to modify to get always the complete line?? btw: This script is made by wildteen88 (phpfreaks mod) <?php function keywordSearch(&$keywords) { global $keyword_count; $lines = file('test.html'); $results = array(); $symbols = array('[', ']', '-', '(', ')'); $replace = array('\[', '\]', '\-', '\(', '\)'); // colors for highlighting keywords $colors = array( '#FF0000', // red '#0000FF', // blue '#99CC00', // green '#CCCC00', // yellow '#660066', // purple '#FF0099' // pink ); $i = 0; foreach($lines as $line) { $keyword_found = false; foreach($keywords as $key => $keyword) { if(!isset($keyword_count[$keyword])) { $keyword_count[$keyword] = 0; } $keyword = str_replace($symbols, $replace, $keyword); if(eregi($keyword, $line)) { $keyword_found = true; // remove answer from end of line $line = eregi_replace("\*([a-z0-9 ]+)", '?' , $line); // highlight search keyword $line = eregi_replace("($keyword)", "<span style=\"color: {$colors[$key]}; font-weight: bold;\">\\1</span>", $line); $results[$i] = $line; $keyword_count[$keyword]++; } } if($keyword_found) $i++; } return $results; } function displaySearchResults() { global $keyword_results, $keywords, $keyword_count; $output = '<p>The keywords "<i><b>'. implode('</b></i>", "<i><b>', $keywords) . '</b></i>" found ' . count($keyword_results) . " result(s):\n"; if(is_array($keyword_results) && count($keyword_results) > 0) { $output .= "<ol>\n <li>" . implode("</li>\n <li>", $keyword_results) . "</li>\n</ol>\n"; } echo "<p>$output</p>"; } if(isset($_POST['submit'])) { if(!empty($_POST['keyword'])) { $_POST['keyword'] = str_replace(array("\r\n", "\r", "\n"), "\n", $_POST['keyword']); $keywords = explode("\n", $_POST['keyword']); $keyword_results = keywordSearch($keywords); displaySearchResults(); } else { echo 'Invalid search term'; } } ?>
  10. strange. I'm using this in a script with multiple replacements $rep = preg_replace($listone, $listtwo, $val); I'm using php v5.2.5
  11. I found the solution "/%..%..%../" I really don't understand why preg_replace can't work with %aa or %a1 ??? I've never heard of 'urlencode'. Sounds interesting. Thanks!
  12. I tried "/\%3a\%2f\%2f/", and "/%3a%2f%2f/", but no luck in preg_replace. ( I want to replace this in <a href="http%3a%2f%2fwww.hello.com"> ) Anyone?
  13. I'm trying to scrape pages from the Google search engine using curl. I have read they may block the server ip of my webhost, because of a big number of requests. Is it possible to use a proxy server in curl? And are there other solutions to not get blocked? ???
×
×
  • 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.