Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. Are you connected to a database before using this function?
  2. I guess should close the meta tag too. <?php ob_start(); include('./robots_keywords.php'); $content=ob_get_clean(); print "<meta name=\"keywords\" content=\"$content\" />"; ?>
  3. new page with guest rights was created http://beckerfamily1.com/testing/index.php?id=27 Page Error Sorry this page is no longer avalible. If you feel you have reached this page in error please contact the website administrator at webmaster-at-beckerfamily1.com
  4. Use this instead. <?php $server_page = filter_var("http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'], FILTER_SANITIZE_STRING); echo $server_page."<br />"; $current_page = end(explode("/", $server_page)); if($current_page == "index.php") { echo "this"; } else { echo "that"; } ?>
  5. <?php $current_page = basename($_SERVER['REQUEST_URI']); if (strpos($current_page, "?") !== false){ $current_page = reset(explode("?", $current_page)); } if($current_page == "index.php") { echo "this"; } else { echo "that"; } ?>
  6. As far as I could tell was pretty secure. Able to use any email to register, but then couldn't activate or login because it was some bs email. I already had this message from trying random GET requests and feared being banned. The URL has been modified! Your IP Address: 74.97.81.93 has been recorded.
  7. You say they change in the database so the query works. Most likely is just your browser cache, page cache, or query cache. Restart the server and clear your browser cache too.
  8. Flashed Face Distortion Effect Watch the video, do fullscreen and stare at the + cool, and scary at the same, is amazing how the brain and eyes interpret information. Is no trickery there, are just normal images. Reminds me of the thatcher effect http://en.wikipedia.org/wiki/Thatcher_effect
  9. I could do 2 different parsed urls, one for main url and then one for in the loop for self links, and not being a function. Let me know if can't get it, i'll rewrite it.
  10. Yeah if running in a loop it would. So either paste the parse function on top of your page or place the parse function in a file and include it. parsed.php function getparsedHost($new_parse_url) { $parsedUrl = parse_url(trim($new_parse_url)); return trim($parsedUrl['host'] ? $parsedUrl['host'] : array_shift(explode('/', $parsedUrl['path'], 2))); } can just write the function above same file and do both functions as an include file get-feeds.php <?php //require_once("path/to/parsed.php") function getparsedHost($new_parse_url) { $parsedUrl = parse_url(trim($new_parse_url)); return trim($parsedUrl['host'] ? $parsedUrl['host'] : array_shift(explode('/', $parsedUrl['path'], 2))); } function locateFeedUrl($url){ if(!empty($url) || $url != ""){ $url = str_ireplace("https://", "http://", trim($url)); if (substr($url, 0, 4) != "http"){ $url = "http://$url"; } //$url = "http://".getparsedHost($url);//uncomment this line if want the main sites feeds for any link $html = @file_get_contents($url); if(!$html){ echo "$url not found"; } else { if (preg_match_all('#<link[^>]+type=\s*(?:"|)(application/rss\+xml|application/atom\+xml|text/xml)[^>]*>#is', $html, $matches)) { if(!$matches){ echo "no feeds located"; } else { foreach ($matches[0] as $match) { if (preg_match('#href=\s*(?:"|)([^"\s>]+)#i', $match, $rssUrl)) { if (substr($rssUrl[1],0,1) == "/" || substr($rssUrl[1],0,2) == "./" || substr($rssUrl[1],0,3) == "../" || substr($rssUrl[1],0,4) == ".../"){ $rssUrl[1] = str_replace(array("./","../",".../"), "/", $rssUrl[1]); $rssUrl[1] = "http://".getparsedHost($url).$rssUrl[1]; } $feed_link = trim($rssUrl[1]); echo "<a href ='$feed_link'>$feed_link</a><br />"; } } } } } } else { echo "insert a valid url"; } } $website = "http://phpfreaks.com"; echo locateFeedUrl($website); ?>
  11. It seems to work for me, I also added some stuff to it. <?php function locateFeedUrl($url){ function getparsedHost($new_parse_url) { $parsedUrl = parse_url(trim($new_parse_url)); return trim($parsedUrl['host'] ? $parsedUrl['host'] : array_shift(explode('/', $parsedUrl['path'], 2))); } if(!empty($url) || $url != ""){ $url = str_ireplace("https://", "http://", trim($url)); if (substr($url, 0, 4) != "http"){ $url = "http://$url"; } $url = "http://".getparsedHost($url);//uncomment this line if want the main sites feeds for any link $html = @file_get_contents($url); if(!$html){ echo "$url not found"; } else { if (preg_match_all('#<link[^>]+type=\s*(?:"|)(application/rss\+xml|application/atom\+xml|text/xml)[^>]*>#is', $html, $matches)) { if(!$matches){ echo "no feeds located"; } else { foreach ($matches[0] as $match) { if (preg_match('#href=\s*(?:"|)([^"\s>]+)#i', $match, $rssUrl)) { if (substr($rssUrl[1],0,1) == "/" || substr($rssUrl[1],0,2) == "./" || substr($rssUrl[1],0,3) == "../" || substr($rssUrl[1],0,4) == ".../"){ $rssUrl[1] = str_replace(array("./","../",".../"), "/", $rssUrl[1]); $rssUrl[1] = "http://".getparsedHost($url).$rssUrl[1]; } $feed_link = trim($rssUrl[1]); echo "<a href ='$feed_link'>$feed_link</a><br />"; } } } } } } else { echo "insert a valid url"; } } $website = "http://stackoverflow.com/questions/6637275/insert-long-code-into-php-table-td"; echo locateFeedUrl($website); ?>
  12. the problem is they use self links, I added some corrections by using the parsed url of the site as well. <?php function locateFeedUrl($url){ function getparsedHost($new_parse_url) { $parsedUrl = parse_url(trim($new_parse_url)); return trim($parsedUrl['host'] ? $parsedUrl['host'] : array_shift(explode('/', $parsedUrl['path'], 2))); } $html = @file_get_contents($url); if (preg_match_all('#<link[^>]+type=\s*(?:"|)(application/rss\+xml|application/atom\+xml|text/xml)[^>]*>#is', $html, $matches)) { foreach ($matches[0] as $match) { if (preg_match('#href=\s*(?:"|)([^"\s>]+)#i', $match, $rssUrl)) { if (substr($rssUrl[1],0,1) == "/" || substr($rssUrl[1],0,2) == "./" || substr($rssUrl[1],0,3) == "../" || substr($rssUrl[1],0,4) == ".../"){ $rssUrl[1] = str_replace(array("./","../",".../"), "/", $rssUrl[1]); $rssUrl[1] = "http://".getparsedHost($url).$rssUrl[1]; } $feed_link = trim($rssUrl[1]); echo "<a href ='$feed_link'>$feed_link</a><br />"; } } } } $website = "http://en.wikipedia.org/wiki/Main_Page"; echo locateFeedUrl($website); ?>
  13. have a sample url with this feed?
  14. "Got Code?"
  15. http://php.net/manual/en/function.unlink.php You are going to have to do a SELECT query first to find the images name and location then can do the DELETE query and unlink()
  16. An iframe is a totally different page and will not retain the iframes parent pages information. You will have to do the script on the iframes source page for username. Can you not include() this?
  17. I figure can use DISTINCT in your query http://dev.mysql.com/doc/refman/5.6/en/distinct-optimization.html If that doesn't do it for you use array_unique() on the results. http://php.net/manual/en/function.array-unique.php
  18. $_SERVER['PHP_SELF'] is not good to use as this can leave an xss attack open htmlentities($_SERVER['PHP_SELF']) can avoid attacks but looks ugly filter the variable filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING); it's best to just input the forms name or leave it blank It's also important to sanitize the POST,GET,REQUEST,SERVER and so on values, never trust user input. Before any mysql statement should sanitize them http://php.net/manual/en/function.mysql-real-escape-string.php If it always a number, make sure they use a number http://www.php.net/manual/en/function.is-numeric.php
  19. <?php $current_page = basename($_SERVER['REQUEST_URI']); if (strpos($current_page, "?") !== false){ $current_page = reset(explode("?", $current_page)); } echo $current_page; ?>
  20. For linux you use a virtual frame buffer (Xvfb). Be aware linux has file limitations so need to come up with a slick filesystem. http://www.boutell.com/webthumb/ http://cutycapt.sourceforge.net/ http://iecapt.sourceforge.net/ You can save urls into lists and use this. http://www.softpedia.com/get/Multimedia/Graphic/Graphic-Capture/WebShot.shtml I personally use a windows machine and use firefox with a plugin http://pearlcrescent.com/products/pagesaver/ exec() firefox with a url and the plugin does the rest Trust me when I say I've explored many options, I feel windows/firefox/pagesaver is the best way. install adblock, noscript, stop redirects IE crashes too much, allows many scripts and ads. my friend made http://wimg.ca/ is based on linux and uses firefox Maybe can contact him and he may sell also help you get this running, he's a busy person. hover one of the example links. http://wimg.ca/test I think it's very cool.
  21. <?php $array = array(1,2,4,5,6,8,10,12,15,73,99,102,1901,1915,1922,1923,1926,1942,1943,1944,1980,1981,1983,1999,2001,2002,2003,2011); foreach ($array as $temp_string) { $string_length = strlen(trim($temp_string)); if($string_length <= 3){ $array1[] = trim($temp_string); } else { $array2[] = trim($temp_string); } } echo "Array 1 <br />"; //$array1 = array_reverse($array1); rsort($array1); foreach($array1 as $value1){ echo $value1."<br />"; } echo "Array 2 <br />"; //$array2 = array_reverse($array2); rsort($array2); foreach($array2 as $value2){ echo $value2."<br />"; } ?>
  22. something like this? if($admin != "yes"){ echo "redirect or show message"; } else { while(code here){ echo "code"; } }
  23. You seem nice enough and willing to make this work, so I'll help you out. a simple way to discover feeds for a url <?php function locateFeedUrl($url){ $html = @file_get_contents($url);//i know i supressed the error with @, this is something to improve upon if (preg_match_all('#<link[^>]+type=\s*(?:"|)(application/rss\+xml|application/atom\+xml|text/xml)[^>]*>#is', $html, $matches)) { foreach ($matches[0] as $match) { if (preg_match('#href=\s*(?:"|)([^"\s>]+)#i', $match, $rssUrl)) { $feed_link = trim($rssUrl[1]); echo "<a href ='$feed_link'>$feed_link</a><br />"; } } } } $website = "http://shang-liang.com/blog/"; echo locateFeedUrl($website); //more echo locateFeedUrl('http://phpfreaks.com'); echo locateFeedUrl('http://www.feedforall.com'); ?> Results: http://shang-liang.com/blog/feed/ http://shang-liang.com/blog/feed/rss/ http://shang-liang.com/blog/feed/atom/ http://feeds.feedburner.com/phpfreaks http://feeds.feedburner.com/phpfreaks/tutorials http://feeds.feedburner.com/phpfreaks/blog http://www.feedforall.com/blog-feed.xml http://www.feedforall.com/knowledgebase.php http://www.feedforall.com/press-article-feed.xml http://www.feedforall.com/rss-video-tutorials.xml it would better to use curl, try to follow redirects,do https as http, check website url input as well if a valid url pattern you could even parse the url from any links you find for the main sites feeds Is there just 3 feed types? if is more add them in the regex pattern so my idea for you is this... crawl google or bing for websites related to what you want, then use this to find their feeds
  24. That's a good question. It's supposed to be like this. feed:photography or photography contains:.xml but those don't seem to work
  25. forgot a double quote $xml = simplexml_load_file("../inc/xml/style.xml");
×
×
  • 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.