Skip to content

Instantly share code, notes, and snippets.

View christiankn's full-sized avatar

Christian Knappskog christiankn

  • Stockholm, Sweden
View GitHub Profile
@christiankn
christiankn / index.html
Created April 15, 2012 12:54
Bootstrap-styled radio-buttons for JSF 2
<!DOCTYPE html>
<html>
<head>
<title>RadiobuttonsDemo</title>
<link rel="stylesheet" href="radio-buttons.css" type="text/css" />
</head>
<body>
<form>
<table class="toggle-radio-buttons">
<tr>
get "/" do
@name ||= "empty"
end
post "/:name" do
@name = params[:name]
end
$("#submit").click(function() {
var email = $("input#email").val();
var message = $("textarea#content").val();
var dataString = 'email=' + email + '&message=' + message;
$.ajax({
type: "POST",
url: "sendmail.php",
data: dataString,
success: function() {
$('#contact_form').html("<div id='message'></div>");
<?php
$email = "ch_knapp@me.com";//$_REQUEST['email'];
$message = "En liten melding til meg"; //$_REQUEST['message'];
$url = "https://sendgrid.com/api/mail.send.json?api_user=app170069@heroku.com&api_key=568c4ce091724248d8&to=ch_knapp@me.com&subject=Hendvendelse%20fra%20Mac-Gyver&text=" + $message + "&from=post@jafnadhr.no&replyto=" + $email;
$response = http_get($url, array("timeout"=>1), $info);
print_r($info);
?>