
iGuest
Members-
Content Count
72,093 -
Joined
-
Last visited
-
Days Won
5
Everything posted by iGuest
-
I have written a script to detect if the mime-type application/xhtml+xml is supported in browsers, yet some browsers that do support this mime-type have to be tested manually so I was wondering whether there was a better method. Something I would rather do is intercept the browser before it decides to download the page instead, is this possible? Here's the script I wrote, which detects strings from the User Agent, it's just a small snippet of it: <?php// function to test for application/xhtml+xml mime-type supportfunction CheckXHTML(){ // For Robots, Spiders, Validators and other User Agents without displaying any mime-type if(!isset($_SERVER['HTTP_ACCEPT'])) return TRUE; // For Browsers that show the mime-type supported elseif(strpos(strtolower($_SERVER['HTTP_ACCEPT']), 'xhtml+xml')) // Browsers that support it here: Amaya, Epiphany, Firefox, Galeon, Opera return TRUE; // Created an array incase more browsers need to be added. $UA = array('konqueror'); // Browsers that were tested and found to support it but fails the above: Konqueror foreach($UA as $value) { if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), $value)) return TRUE; } // Those User Agents that fail the above return FALSE; // Browsers that do not support it: IE, Lynx} if(CheckXHTML()) echo 'Supported';else // Shows information about the User Agent if not supported. echo 'Not Supported<br />'.$_SERVER['HTTP_ACCEPT'].'<br />'.$_SERVER['HTTP_USER_AGENT'];?> The main reason for doing this, is because when creating pages in XHTML 1.1, we also have to make sure the header('Content: application/xhtml+xml; charset=utf-8'); is sent, but some browsers do not support this, so far only IE is my concern, but it can still render it using text/html, which is not the correct way to handle this, but as long as the document is still conforming to HTML 4.01 or XHTML 1.0 it should be safe to use text/html and still have the page displayed correctly by that browser, but sending text/html for browsers that support the XHTML mime-type will have slight problems. Is there a better method than above? Especially if we can intercept the browser before it wants to download the file. e.g. If the browser doesn't support application/xhtml+xml like IE, they would display the download box to download the page, once downloaded and opened, you'd see it's just the XHTML code which can be displayed in IE by giving it an html extension and opening it with IE. Here's a test page you could test out, which does not use the detection method but is strictly an XHTML 1.1 document, I also added some other things to the header so that the document would be handled better if cached, quite handy to have. <?php // Send XHTML mime-type header('Content-Type: application/xhtml+xml; charset=utf-8'); // Send Last-Modified, ETag and Expires header, never set for dynamic scripts header('Last-Modified: '.gmdate('D, d M Y H:i:s T',getlastmod())); header('ETag: "'.dechex(getmyinode()).'-'.dechex(filesize($_SERVER['SCRIPT_FILENAME'])).'-'.dechex(getlastmod()).'"'); // Expires: time() + days_till_expiration * hours_in_a_day * minutes_in_an_hour * seconds_in_a_minute header('Expires: '.gmdate('D, d M Y H:i:s T',time()+ 1 * 24 * 60 * 60)); // XML preprocessing string, split in case short_tags are enabled. echo '<'.'?xml version="1.0" encoding="utf-8"?'.'>'."\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://forums.xisto.com/no_longer_exists/; <html xmlns="http://www.w3.org/1999/xhtml/; xml:lang="en"> <head> <title>XHTML 1.1 Test Page</title> </head> <body> <p> This is just a test. If your browser displays this and does not ask for this page to be downloaded, your browser supports <acronym title="eXtensible HyperText Markup Language">XHTML</acronym>. </p> </body> </html> That's it, cheers, MC
-
'Print results Console.WriteLine("Total Numbers: " & TotalNumbers) Console.WriteLine("Sum of scores: " & Sum) Console.WriteLine("Average of scores: " & Sum / TotalNumbers) Console.WriteLine("") Console.WriteLine("Press return to continue...") Console.ReadLine() Alright that really helped me out. Somehow when I tried to do that like &Sum/ TotalNumbers, I got build errors. What I didn't check was my Dim. I got Sum mixed with Add. Don't know why I called it Add so that messed me up. I didn't notice it because I think I was going crazy trying to figure out what things did like console.writeline and etc. So I fixed it up, and checked all my other codes, and I was suprised mine was like yours, just excluding those minor build errors and less commenting on mine. I'm shy on commenting, but getting better. Also, on my code, I added a few extra lines as you can see. That way when -1 is entered, it'll freeze on the results. I gotta say this. YOU HELPED ME BIG TIME !! Thanks so much M^E . I'm just beginning my first semister as a college student doing this, and console applications was just random to me. Feels like a GUI, but coding is slightly different, and enough to make me ask for help. So yeah, THANKS !!
-
I'm stressing out here >_< I'm like so new to vb and console applications. I'm trying to make a calculator in console applications that can keep adding when i type numbers in until i type '-1' AFter that -1 it would:give me the total number of entered(+1 each time a number is added), total scores combined, and an average of total scores/total numbers entered.Sad thing is, I'm much better on GUI I made one in GUI so easily, I guess console is that different.I can get the average, but the scores and total numbers won't go sometimes.
-
Major Website Mistakes Improve your site
iGuest replied to BigmanB's topic in Websites and Web Designing
Well Done Tutorial! And followed up with a bunch of great suggestions.I'm just visiting fromthe Xisto dot com Forums and I'll be posting a link to this page immediately. There are loads of members over at the Trap that will benefit from this information.Thanks for letting me visit, I will be back... -
This is a very good site, you must have spent a lot of time on it. However, I think it's weird that you have the news in two places, and don't much information about it in either place. IMO you should just use that box to put the whole thing from the latest news topic you posted. The teamspeak thing on the left was an amazing idea
-
Ipods Are Overrated seriously, they are
iGuest replied to Shooting Star Haven's topic in Science and Technology
I agree that the IPod is very overrated. Not only does it cost a lot to buy one, but getting the music normally by pay isn't such a good idea. If that's the only way to get the music then I rather just get it the other way. I currently use my Playstation Portable to play my music on the go. It's a big thing compared to the IPod, but at least I can do more for what the cost of this music player can do. Though they are releasing IPods that can do more than play music, the price on those aren't worth it. Playing series or shows is good and all, but it will be redundant after playing it just a few times.I'll stick to my PSP, at least that has more things to do, PLUS MORE !! -
Anyone Into Afi (a Fire Inside) ?
iGuest replied to Perfect_Chaos21392's topic in General Discussion
AFI is alright.My friend, however, is obsessed. -
Although I'm a Playstation 2 fanatic, I'll have to go with Halo here. Grand Theft Auto lost most of its unique-ness after Vice City came out. After Vice city, most of the game were just the same with a few add-ons and barely any graphical changes. Halo changed drastically from 1 to 2 in a matter of time. The game was amazing and I don't even own an X Box. If Grand Theft Auto 5 can do something that can revolutionize the world like how GTA 3 and 4 did, then I think there's a chance that the game can over come Halo 3. If the game is just the same with a few add ons and graphic changes to fit the PS3, then Halo 3 will win in the long run and leave GTA behind. Just my 2 cents...
-
Don't even get an apple product if you're going to do anything vigorous or active. I'm in Iraq right now, and there's a bunch of guys whose Ipod's don't work right because of dust or running alot. And I don't mean they're smashing the thing on the ground, it just doesn't work well in outside environments. Try a Creative Zen Micro (5GB). The guys who have it here have no problem with it.
-
E-mail Time Capsules Message yourself 20 years from now
iGuest replied to Sarah81's topic in Websites and Web Designing
That is a pretty cool idea, but I don't think I could do it. I'd get depressed becaused in 20 years, I'll be 47 and I'll start feeling old and wishing I was young again. Or worse, I might not even be around!! -
Wow that is amazing! (for a second then i wondered i would look like at 102 and scared myself!!) lol my great aunt lived until 97, she was born in 1900 and died in 1997. It really does make you wonder how they do it, and what it would be like living for so long and seeing so many things!
-
Tips For Slim Health And Long Life Dos and Donts of Healthy life.
iGuest replied to OpaQue's topic in General Discussion
I recently heard that the kids of today are more likely to die before their parents because of unhealthyness, obeasity etc. I think It is important to maintain a healthy weight.Im not saying the world should be all skinny , not at all, im just saying that as long as you are in your target weight range and eat healthy (yes you can still have the odd junk) the generations to come will also benefit from it. Losing weight and exercising isnt that hard, Just by changing a few things you can lose some lbs for example 1lb of fat is 3500 so.. if you cut swap that burger for a healthy sandwitch you've near enough cut back on those 500 calories for the day meaning in 1 week you will lose 1lb if you cut 500calories a day just by making simple eating changed and swapping foods. As for exercise walking is a brilliant way to start off and it also builds up your stamina and is great for your heart. If you dont like workouts and gyms, you can always have a game of tennis or go swimming or pretend you 5 again and run around the woods doing silly things.People are serious about losing weight and getting in shape and it is a very important subject...but remeber we only live once.... LETS MAKE IT FUN!!!!!Hope everyone is good and smiley take care guys! -
Hello, I just signed up today and i would like to introduce myself im GraceAnyways I hope everyone is doing good and all be smiley and happy. I look forward to being part of this forum.Have a good day everyone!grace
-
Nba Live 2005 Have anyone played this game before?
iGuest replied to ffx2net's topic in Computer Gaming
i am more an more disappointed every year when i try new EA Nba live. I think that this game lost something. You can hardly play it without game pad. Because on keyboard you have to press to much butons in sequence. Bad -
This is one of top game for me. It has everything. Good story, grapfic effects, music. i destoied 3 game pads for second part of Prince. And if you play it for few hours per day you totally fall in. :)you can find pc version on almost every torrnet tracker. So search a little on torrentspy and piratebay if you don't have any other tracker on your list.
-
Ipods Are Overrated seriously, they are
iGuest replied to Shooting Star Haven's topic in Science and Technology
i totally agree with that. Think that Apple has great advertising service and naive(ok most of them are) people buy everything what they see on tv or somewhere else. if i speak for me, i had never listened music for 40GB, so i don't know why i should buy iPod. -
My computer graphic card is Ati radeon 8500Le. It is about 4 years old(would be happy if it will work another four ). I don't play games much, so there is no need to buy new one. Quake 3 and call of duty works without problems for now.
-
Hl2 Halo2 Doom3? which one do you think is the best?
iGuest replied to Killer008r's topic in Computer Gaming
i would go for Half life 2. Cause only HF2 worked well on my computer and has a lot of action. I have some graphic problems with doom3. So i don't like it very much. -
I did't play them much but my top 5 would be1.Call of duty2.Call of duty: UO3.Quake 34.Call of duty 25.Half life 2New games have to much disturbing effects for me and every year you need new computer if you want to play them.
-
sure. you can find a lot of old games here. underground-gamer.com/ is one of the torrent site for old games. But you can always search on piratebay or torrentspy.
-
ok i will try to do my best. So let's the party begin
-
Firewalls Anti-virus, Anti-Spyvware and firewalls
iGuest replied to jonassen-tjader's topic in Software
did anybody try agnitum outpost firewall? -
i would propose you Nod32 (fast and small) and adaware for antispyware
-
i would go for kaspersky which has quality virus scan, but is't slow on full system scan. Narton eats to much RAM and it's not realy reliable.
-
i use nod32 and adaware. firewall is in router