add other link when on device or desktop - html

I have to make an email.
When you open the email on a device all the links has to refer to the m.website.be, but on a desktop it has to refer to the website.be
Is there a way to do this, and that works in every mailclient ?
thanks in advance

You cannot make it, some email clients even don't understand HTML.
The only way I know is to make it on a server side when your client tries to open the website.
When he comes from the desktop - redirect to the desktop.
When mobile - redirect to mobile.
Everything is easy.

If doing a redirect on the actual site itself is not a possibility then the only way I can think of is by applying CSS media queries and hiding the m.website.com link for desktop and hiding the non m.website.com link for mobiles. You may run into issues here where some clients dont pick up on the media query.

If you really really really wanted to do the trick, you could do something like this with mime/multipart messages and alternative contents (i.e. writing the content to each alternative with different URL). However, even in that case you should be able to control which alternative the receivers email client opens. Some mobile clients might always open text/plain.
Since the solution will not fully meet your needs, I will not go into details. If you want to know more, read the rfc:s related to mime/multipart email content.
I recommend you leave it to your reader by writing the email like this:
"If in mobile device open m.website.be, on a desktop, please use website.be." or even better, use the server side redirect that most websites do anyway.

Related

social network share links not working on desktop (fb://... whatsapp://...)

When I use this kind of links
fb://sharer.php?u=...
whatsapp://send/?text=...
They work perfect on mobile devices, because the related application is opening (facebook or whatsapp) and ready to share the URL.
But when the links are clicked from a desktop computer, as the applications don't exist there, they are failing and returning an error page.
I would like to solve it using an elegant solution, for example, changing the links:
fb://sharer.php?u=...
Into:
https://www.facebook.com/sharer.php...
Which should work in desktop computers...
But to do that I would need a good way to determine which kind of device is visiting my website.
Is there a popular/working way to determine the visitor device? How would you fix it?

Responsive, Adaptive. A method of serving up 2 or 3 websites

I'm new to dealing with responsive website design but from what I have dabbled with its showing some great results.
I was wandering if some responsive experts can give some advice on serving alternative websites based on a mediaqueries for certain devices
Scenario A : If person a is using a desktop computer, serve this website to that device (HTML page 1)
B) If person is using a tablet, then serve mobile website. (HTML 2)
But I will go further to say, Can you use this sort of method to deal out completely different html pages? eg mobilehtmlpage.html desktop.html if that makes sense?
Thanks for your help!
You'll need to check to see what the "Web User Agent" is set to. This is basically the name of the browser.
You can do this in PHP like this: http://php.net/manual/en/function.get-browser.php
Here's a list of User Agents: http://www.useragentstring.com/pages/useragentstring.php
Once you check the User Agent, you'll be able to redirect the user based on this information (for example - subdomains: mobile.mysite.com and www.mysite.com). A lot of websites do this.
OR You could make a website that looks good regardless of the width of the browser, meaning you wouldn't need to redirect the user or know the user agent. This is my preferred method!

Faking website integration

I am working on a prototype for a project that is somewhat similar to the facebook's "like" button. Basically it's an embeddable piece of code that can integrated with any website.
I am looking for a way to fake this integration for a demo. Basically I want to show a familiar web page (like http://www.cnn.com) with my code already embedded. Since I obviously can't do the actual integration right now, I need some way of faking it.
The only thing I can think about is to use http://www.httrack.com/ to download the page I want, and then change it locally. The problem with this is that it is clear that the page is hosted locally and not on www.cnn.com.
Is there a better technique for doing this?
If you use Firefox browser, you can use Greasemoneky and with JavaScripts, embedd your content inside that page. You can eaven add events, that will open some popup windows, etc. to show action of such a script.
That is easy approach, there are ton's of examples in their forum, and good documentation, how to use it.
You can write your own userscript (i.e. greasemonkey) to modify the page on the fly.
Even though I think it's a bad idea to do this (not sure if stackoverflow allows to ask such questions), but what you can do is edit the hosts file (if you're on windows) and add a line
127.0.0.1 www.cnn.com
it means that when you visit the website cnn it will display the domain name in the browser but it will use your localhost server to display the content.

How to hide precious HTML from user eyes?

I am thinking to create an website that generates HTML through a wizard.Finally, I want to make the users to buy the generated HTML source if they like what they see.
But I don't want to let the users to steal the HTML, CSS and JS that I use to create the effect they want.
I want a technique which is immune to Firebug and Right Click -> View Page Source.
Any thoughts ?
edit: I remember something about iframes or frameset, but I'm not sure how to fool the browser and Firebug to execute the code without updating their capability of showing that source code. A popup is also a possible solution.
edit 2: html hosted in silverlight ? will you use it ?
The best thing you can do is to just obfuscate your code. Trying to hide the source is not going to work (for ex: if you disable right click-> view source that doesn't stop them from using the menu or saving the page or using a shortcut key or writing an app to stream the http request into a file and open that, etc).
Firstly, depending on what you are doing you can have the HTML code loaded through JS after the page load (AJAX).
As far as your JS goes:
Free Obfuscator
Not Free Obfuscator
In the end though, there is no stopping someone who really wants to get that source. Even obfuscated code can be rebuilt (though it's hell on wheels painful depending on how good the obfuscator is).
To really protect the sample HTML from prying eyes, you'd need to render it on the server-side and only pass image data to the client. If you want the user to be able to interact with the sample as if it were a normal Web page, you'll also need to send their pointer and keyboard inputs to the server and update the displayed image when necessary. At that point, though, you're basically making an HTTP-based version of VNC. This is definitely possible, but I don't think it will be easy, and I doubt there are any existing software packages to let you do this. If I were you, I'd rethink my business model a bit.
Sending XSL-templated XML to the browser may be enough fool some, and it will work more or less the same in many modern browsers including IE6 (maybe even 5.5).
But really, trying to hide the HTML code isn't going to work if anyone halfway serious wants to get it.
I am thinking to create an website that generates HTML through a wizard.
Finally, I want to make the users to buy the generated HTML source if they like what they see.
If this is what you need you might consider the possibility of creating a preview of the page as an image, and provide the download of the source only after the user agreed and paid. There is no magic way to let a browser display a code that you can't see.
You can make a video, showing the functionality and upload the same, which may help users to view / feel it.

Displaying the website's content (html) through the specific browser - is it possible to realize?

I'm interested is there a possibility that could allow to display website's content or to say exactly an HTML through a specific browser installed on the web server?
I mean something like a module for a web server may be, that can display the website's content through the built-in browser, ignoring the clients browser?
If this possibility really exists, so I don't need to adopt my HTML to different browsers.
No, there isn't any web server module that takes control over the client's computer.
Depending on your situation I suppose you could replace the HTML page with Flash, Silverlight or a Java applet if that would make things easier.
Well, you could make some pdfs or images if you really want a specific rendering, but it's really not a website anymore at that point. You could also beg your users to use a particular browser, but they'll probably ignore you. The world spends (wastes) gazillions of dollars on good, standards-compliant HTML and CSS for a reason.
How about a browser in a Java applet?