text:
Hello all,I was experimenting with http content negotiation and I was having some issues. When I run an if-statement that prints if it supports it or not (I am checking for svg support)Here is the code:
<!Doctype html>
<html lang="en">
<meta charset="utf-8" />
<title>Content Negotiation</title>
if (stristr($_SERVER["HTTP_ACCEPT"], "image/xml+svg")) {
echo "I support SVG as a css background-image!";
echo "I don't support SVG as a css background-image!";
But, here is my problem: browsers that do support svg images/documents as a background image via css, are saying that they do not accept this header :mad::(
And I doubled check this by explicitly defining an svg image/document as a background-image of the body and they accepted the image, but not the header...?For example, in chrome, it supports the explicit definition, but not the above code.
Here is a live example
Am I looking for the support of the wrong mime type? That might be why its not accepting the header because the header I am checking for isn't the right one (for support for svg images as a background-image)?
Does anyone have any ideas on why this isn't working. Am I writing the condition in the if-statement right or is it something else?
I hope to hear from you soon and Please let me know if you have any Questions, Comments, Concerns, or Solutions please let me know
Thanks in Advance & Best Regards,Team 1504
You should review the HTTP headers the browser is sending when requesting your page. Firefox for example, its content Accept header is context sensitive. When requesting and HTML page it sends: "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8" while requesting an image: "image/png,image/*;q=0.8,/;q=0.5" This is on Firefox 7, Windows 7, default settings.
wait, how do I figure that out ?
And wouldn't the syntax be browser-specific then? MeaningI would have to do an if statement for each browser based on what it, specifically sends?
And then if so, would firefox 7's syntax be this:
<?php if (stristr($SERVER["HTTPACCEPT"], "image/png,image/*;q=0.8,/;q=0.5")) { echo "I support png"; } else{ echo "I don't support png"; }?>
You might have to do SVG detection via javascript, rather than PHP.
Example: http://stackoverflow.com/questions/654112/how-do-you-detect-support-for-vml-or-svg-in-a-browser
I would seriously prefer to not do it in js, because then there is the possibility of js being turned off.
Especially if there is a way to do it in a language that can not be disabled.
And especially, if the code in the PHP makes sense and should work...
Apologies if I am being stubborn, but I will resort to that if necessary. But for now, at least, I want to learn why the php code is not working.
Its not working because Chrome is not sending "image/xml+svg" in the Accept header. Nothing in PHP can change that.
Furthermore, my previous reply I was telling you to use the whole string. The Accept header has a special format which can be reviewed here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Okay, now I am leaning towards the js path as much as I dont want to...But I still have some questions :Apologies for being a noob, but now I am wondering why the hell doesn't chrome accept or send that header?Isn't image/svg+xml the official header?
Does anyone know if any browsers accept / send for this header?
Since we already know chrome doesn't accept /send for this header, what header does chrome accept /send send for SVG?So that I can check for SVG support in chrome, right?
And lastly, how do I found out what header a/any browser accepts or sends for in terms of SVG
Thank you all again!
Hmm I thought of an idea and before I try it, I want to run it by you guys.Please let me know if you have any comments or suggestions on it
What if I changed the header for .svg files in the .htacess file in the root of my server. Would that allow and tell chrome, and other browsers to send for and accept said header when looking for .svg files?
Meaning in apache, I don't have the syntax on me, but if I set the header to image/svg+xml for .svg files, then wouldn't that make the browser look for / send / accept that explicitly mentioned header?
I tried adding the following to my .htacess file hoping that it would allow the browsers to know what MIME type = svg
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
so that when I ask if they accept the header with that MIME-type, they say so if they accept it and no if they do not.
But it still yielded the same results: echoing that they do not support svg, even though I have manually tested and confirmed that certain browsers do :(:(:(:(:(:(:(:(:confused::confused::confused::confused::confused:
I also just found out that it is possible to do content negotiation. As Wikipedia does it to serve svg if supported.
Actually, your code isn't testing for support, but for HTTP_ACCEPT headers, hence the difference between your echo message and the actual results.
AFAIK, there is no way to "force" any browser to send any HTTP headers let alone specific ones. Either they do or they don't.
But, there's a good possibilty you can work something out.
I guess the first thing to do is to find out what they are sending. The first and easiest step would be a simple PHP page with something like
if ( isset($_SERVER["HTTP_ACCEPT"]) )
echo $_SERVER["HTTP_ACCEPT"];
echo 'no HTTP ACCEPT header';
Then it becomes more work.
To test if they send the headers with the request for the CSS file, you could add a line to your htaccess file redirecting requests for "headertest.css" to "headertest.php" - if - the headers don't get lost during the redirect, you could then have the value emailed to you or logged to a database.
Then try the same technique with "headertest.svg".
Yeah, I found that out after trying it. I was skeptical, but quite hopeful that it would somehow end my quest. But, it didn't.
Oh okay. I thought that by testing for HTTP_ACCEPT headers, it was implying / indirectly testing for support.So the difference between the echo message and the actual results in browsers that support svg was due to the fact that there were no HTTP_ACCEPT headers to test. Thats why it resorted to the else. Is that right, or did I mess it up ?
Because after checking what support they have, one / we would have to interpret the results.
But then, here is where it gets really confusing for me:
To test if they send the headers with the request for the CSS file, you could add a line to your htaccess file redirecting requests for "headertest.css" to "headertest.php" - if - the headers don't get lost during the redirect, you could then have the value emailed to you or logged to a database.*
I do not know if you would be willing to explain it differently because I am confused. But first can I give my understanding or what I thought you were saying and then you can see if I understood it correctly?
I understood it as...1.) It becomes more work to interpret the results and check what HTTP_ACCEPT headers they are sending. And then react accordingly.2) So first: If we see if the browser is correctly interpreting the link to a stylesheet** by sending an HTTP_ACCEPT request for it.3.) Then, If it is sending for it, then use some syntax in the .htaccess file to redirect that request to a php file4.) A PHP file that has code like what I posted in my first post. Which, checks if supports svg and if so provides styling with an svg image. Or if not, then styling with another format of widely-supported image (PNG, JPG, GIF)
*Having any lost requests emailed to be or logged in a db is just error checking. Which may happen due to all the detours and redirects, right?
**A stylesheet that just has styling to place the svg image / png image. Because it was all of the page's styling, once t figure out what type of image it should return, it would echo styling just for that image and not that whole original stylesheetWhat do you think? Did I get it? :lol:
Again, Thank you ever so kindly— seriously.
With all Regards, Gratitude, and Respect,Team 1504
function supportsSvg() {
return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")
Then go about replacing bitmap images with SVG images if thats what you need. Or have Javascript save it to a cookie then access it with PHP on new page loads.
thank you. im going to play around with it. like before Mittineague's post, I was experimenting with Force Flow's technique.
But since wikipedia does it with php, it must then be possible with php.
Apologies for my reluctancy in regards to using JS, but i prefer to use it as little as possible. And when there are no other options. I don't mean to be rude at all, I am quite grateful for the solutions, but there is a reason why I posted this in the PHP forum.
Now, since I have been looking and asking around, and not much is turning up in terms of a PHP solution, I have started working the js solutions.But, at the last moment, I read that wikipedia does it in PHP successfully.
It is as if PHP HTTP Content Negotiation is taunting me!:lol:
EDIT: I am sincerley sorry if I sounded rude in this post. I really can't express how thankful I am for all of yours help.
What Wikipedia does it probably by sniffing the User Agent string which is bad.
im a noob at this stuff, if you haven't already figured out already, what is sniffing the User Agent string / what does it do?And how is it / how can it be bad? Is it unreliable?
Honestly, not only do I want to solve this problem, but I also wan to learn a lot from it
I found another thread with the similar issue at codingforums.com, here
It seems like they encountered the same problem. That browsers that should or do support svg say they do not. And that is because the svg mime-type does not show or is a part of the HTTP_ACCEPT header.
The OP there seemed to accept that it was not possible that way,so he/she alluded to resorting to something else. But, that was about 5 years ago.
And it seems like there should be a solution by now.
I will attempt to contact him / her, but in the meantime, can anyone answer my questions regarding user agent string sniffing and why it is bad?
It is what was used in the old days, akin to the wild west to determine if a user was on IE or Netscape and deliver specific content to one or the other.
I guess you kind of understood, but the email/db is not for error checking. It's only so you can find out what headers are sent with what HTTP request.
Every file is called via an HTTP request, so as nice as it would be for a browser to send everything with the page request, I imagine they might send different for the page, the CSS file, and the SVG image. And most likely every browser does things their own way. Doesn't make things easy, but it doesn't mean it's impossible.
If you try adding
RewriteRule /?svgtest.svg$ /svgtest.php [L]
to your htaccess file and have svgtest.php something like
$ubject = 'SVG Header test';
$message = 'Accept Header: ' . $_SERVER["HTTP_ACCEPT"];
$to = '[your email address here]';
$headers = "MIME-Version: 1.0 \\r\
" ;
$headers .= "Content-Type: text/plain \\r\
$headers .= "From: <[email@example.com here]> \\r\
mail($to, $subject, $message, $headers);
Don't try this in a page that's already up or you might get a flood of emails, put it in a page only you know about.
Hmm okay, makes sense. Instead of looking for browsers that are supposed to support something, looking for that support.
So now I added the server config to my .htacess file. The only other thing there are mime-types.
Here is my entire .htacess file:RewriteRule /?svgtest.svg$ /svgTest.php [L]
# ----------------------------------------------------------------------
# Proper MIME type for all files
# ----------------------------------------------------------------------
AddType application/javascript js
# Audio
AddType audio/ogg oga ogg
AddType audio/mp4 m4a
# Video
AddType video/ogg ogv
AddType video/mp4 mp4 m4v
AddType video/webm webm
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
# Webfonts
AddType application/vnd.ms-fontobject eot
AddType application/x-font-ttf ttf ttc
AddType font/opentype otf
AddType application/x-font-woff woff
# Assorted types
AddType image/x-icon ico
AddType image/webp webp
AddType text/cache-manifest appcache manifest
AddType text/x-component htc
AddType application/x-chrome-extension crx
AddType application/x-xpinstall xpi
AddType application/octet-stream safariextz
AddType text/x-vcard vcf
And then I created the file svgTest.php and it contains only the following:
$subject = 'SVG Header test';
$message = 'Accept Header: ' . $_SERVER["HTTP_ACCEPT"];
$to = '[****@gmail.com]';
$headers = "MIME-Version: 1.0 \\r\
" ;
$headers .= "Content-Type: text/plain \\r\
$headers .= "From: <[****@gmail.com]> \\r\
mail($to, $subject, $message, $headers);
#Note, the to email is that same as the from-header email. Was I supposed to do this? I assumed explicitylt assigning it to my email because there is no form to give it the actual sender's email.
Now, If I know my apache / .htaccess well enough, the code you told me to put in the .htacess sends the user to svgTest.php when they visit svgtest.svg, right?
But my question is why do that? The user is never going to visit the svg, it will be loaded as a svg css background-image. Also why redirect the user to a file that emails me especially if that original file will never be visited?I don't understand / what is the point of sending me the email?
After reading your, Mittineague 's, post again, I see the point of the email is to learn what headers are sent.
But from then on, what do I do? Or in better context, am I supposed to compare the HTTP_ACCEPT header for svg to the data the e-mail set e. Thus, seeing if it is one of the headers a browser accepts and if so, then serve an svg image?
Regards,Team 1504
P.S. Here is a link to the svgtest.


text:
Confirmed on the BT5 VM.
just as the title says
I think this is a backtrack 5 KDE4 64bit bug? ncrack + BT4R2 worked just fine. talking with others on #backtrack-linux on freenode this isn't a problem with GNOME.
/usr/local/share/ncrack/ncrack-servicesCode:# ncrack -v --user mysql 192.168.xx.xxx:22 Starting Ncrack 0.3ALPHA ( http://ncrack.org ) at 2011-05-13 02:30 MDT Invalid service module: ssh QUITTING!
shows that ssh on port 22 is there ::
-fnord0Code:ssh 22/tcp
Last edited by fnord0; 05-13-2011 at 01:00 PM.
'see the fnords!'
Confirmed on the BT5 VM.
now, while the above is a bug... I figure I might as well throw in the request for ncrack RDP, VNC and SMB capabilities, as those do not work either (RDP specifically would be great!).
in the meantime I just grabbed ncrack from svn and compiled it myself, yet I look forward to official support from the backtrack repo.
thanks for everything ya'all do! hopefully this get's read and acted upon, if you (backtrack dev team) would like, I'd be more then happy to post this request in the "Tools Request" forum....
Last edited by fnord0; 05-22-2011 at 03:50 PM.
'see the fnords!'
I was unable to duplicate this error. BT5 KDE 64-bit VM with Windows 7 host OS. (target IP address masked for obvious reasons)
root@bt:~# ncrack -v --user mysql xx.xx.xx.xx:22
Starting Ncrack 0.3ALPHA ( http://ncrack.org ) at 2011-05-23 08:56 EDT
ssh://xx.xx.xx.xx:22 finished.
Ncrack done: 1 service scanned in 6.00 seconds.
Probes sent: 1 | timed-out: 1 | prematurely-closed: 0
Ncrack finished.
Will hack for bandwidth!
Updated with upgrade #14.
apt-get update
apt-get upgrade
apt-get update
apt-get install ncrack
The best information security training, period.
Same error here on gnome 32 but only when attacking locally
If I attack my external ip the attack works fine...Code:ncrack -vv --user root 192.168.0.9:22 Starting Ncrack 0.3ALPHA ( http://ncrack.org ) at 2011-05-26 07:32 PDT Invalid service module: ssh QUITTING!
Notice it doesn't crack anything but that's only because the service isn't forwarded to begin with.Code:ncrack -vv --user root 188.8.131.52:22 Starting Ncrack 0.3ALPHA ( http://ncrack.org ) at 2011-05-26 07:38 PDT ssh://xx.xx.xx.xx:22 finished. Ncrack done: 1 service scanned in 3.00 seconds. Probes sent: 1 | timed-out: 1 | prematurely-closed: 0 Ncrack finished.
u backtrack devs are on top o' things, this is great! ncrack + ssh is working perfect now in BT5 KDE64 - also seeing that SMB, RDP and VNC are available. gotta love it! thanks x1000 muts
'see the fnords!'

subset: commoncrawl


text:
It would begin in April, when the stiff winds first mellowed into a breeze and blue sky first began pushing breaches in the cloud banks. I'd be in class, trying to focus while some tenured mummy droned charmlessly on, when all of a sudden, through the window would slip the essence of springtime. One caress [Read More…]
Adventures in Acedia
February 5, 2014 by Leave a Comment


text:
I'll be waiting for jailbreak iOS 6 too before I get 5. And I'll order factory unlocked. No contract. Better deals out there now. Difference saved between phone at retail versus contract reduced price, on monthly bill with company like StraightTalk will pay for itself in 13 months.
Also remember you can get phone same day as preorder people if you go to AT&T/Verizon/Sprint stores - never any lines on day 1. Apple stores have lines for standalone stores. Shorter lines in mall stores. But everyone can get iPhone 5 on 9/21, preorder or in store.
Wish I could get one my contract is up but can't upgrade or I will lose my unlimited data they told me I have to buy the phone at full price 650 is fckn ridiculous so I guess I'm screwed
So are the phones shipping out on the 21st? Wonder if they will ship out earlier like last year.
Don't know if I wanna take that chance humm wait til the 21st to find a phone in store. Or pre order now. Are the phones shipping out on the 21st? Or will they arrive to your home by then?
So if their is no exploit there will be no jailbreak?
Im skipping out on this one this time. After having iphone since 2007 this was a let down for me, so im going to try out an S3 instead. Maybe iPhone 6....
Read above. On 21st - preorder will arrive at homes (unless problems with FedEx which DID happen to MANY with the 4S) - AND in all stores on 21st. No worries of any kind about ample suppy. White phones run out first - but Apple Store near Philly didn't run out of any 4S version on Day 1 last year.Don't know if I wanna take that chance humm wait til the 21st to find a phone in store. Or pre order now. Are the phones shipping out on the 21st? Or will they arrive to your home by then?
There is NO exploit for iOS 6 or A6 devices - and won't be for quite some time. I predict maybe Christmas. So you'll be livin' without a jailbreak for quite some time. :-(.. That's one big reason I'm not switching yet. All people with iPhone 4 always have a bootrom exploit that will let them jailbreak any iOS. So people with iPhone 4 and iOS6 can jailbreak with Redsnow immediately. 4S tethered jailbreak of iOS6 will likely be out before iP5 jailbreak. But that's just a guess.So if their is no exploit there will be no jailbreak?
If you're crazy like me....reserving an iPhone and picking it up early on the day (21st) isn't all that bad. Did that with the 3GS and the 4 and it was a breeze. Waiting in line for about 1.5 hours and I was out of there with my phone, even made it to work on time.
heres some info for at&t customers and people who wants to buy them off contract and unlocked:
"To give prices for these different upgrade levels:
Full upgrade eligibility: $199, 299, 399. (already fullfilled there upgrade date)
Partial upgrade eligibility: $449, 549, 649. (Close to their upgrade date)
No upgrade eligibility (and unlocked iPhone 5/without contract): $649, 749, 849."


text:
Rejuvenating Interiors
With Barbour on your team, you follow in the footsteps of many of the most demanding retail, corporate and commercial brands in the UK. Rest assured, when you work with Barbour the task of enhancing your own reputation is in safe, skilled hands.
Maximise the value of your next fit out: fit in a call today to Norrie Barbour on 0141 429 3999.


text:
Has anyone been lucky enough to receive an rPi and try this out. I should be getting mine in the next couple of months, and it might be a nice mobile toolkit to have, or just a quirky toy.
MODS PLEASE DELETE -- Duplicate thread
Last edited by bertscookie; 05-01-2012 at 09:00 AM.


text:
Virus infections can be extremely damaging to your computer and personal data. If you suspect your laptop or desktop of having a virus, you should get it checked out right away. Viruses can cause all sorts of problems, including slowing down your computer, causing it to crash frequently, and making it impossible to connect to the internet and browse the web. There are many other problems caused by viruses as well. There are ways to protect yourself however, and a good anti virus software program is a must. Make sure to keep all your virus definitions up to date and scan regularly to prevent infections. Don't click on links you don't recognize and don't open attachments or links from emails you receive. If you suspect you have a virus, we can remove it and find any other instances of spyware or adware. Then we'll remove it and show you how to stay protected so it won't happen again.
There is nothing as aggravating as getting your computer attacked by a virus. All manners of viruses, spyware, and adware can cause a myriad of problems to your machine. Some common effects of these maladies include difficulty booting up, loss of files, and the inability to connect to the internet. Many viruses hijack your computer and then download other programs off the world wide web. These include other executable files which may record bank information, passwords, and any other information typed into your computer. For these reasons, it is imperative to eliminate viruses immediately when they are first suspected; otherwise you may find your computer becoming more and more unresponsive.