<?php
$f = $_GET['fileName'];
$m = $_GET['mimeType'];
header(“Content-type: $m”);
header(“Content-disposition: attachment; filename=$f”);
readfile(“$f”);
?>
<?php
$f = $_GET['fileName'];
$m = $_GET['mimeType'];
header("Content-type: $m");
header("Content-disposition: attachment; filename=$f");
readfile("$f");
?>
Use:
http://jameswomack.com/deep-thoughts/a/download.php?fileName=Bubble-Calvalry.ogg&mimeType=application/ogg
Posted on June 7th, 2010 in Web design | No Comments »
function ajaxFunction(formID,resultID)
{
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
{
document.getElementById(resultID).innerHTML=xmlhttp.responseText;
}
}
var params = new Array();
var cleaned = new Array();
var elems = document.getElementById(formID).elements;
var j = 0;
for(var i in elems){
if(elems[i].name != '' && elems[i].name != undefined && elems[i].name != 'item' && elems[i].name != 'namedItem'){
cleaned[j] = elems[i];
j++;
}
}
for(var i in cleaned){
params += cleaned[i].name+"="+cleaned[i].value+'&';
}
xmlhttp.open(document.getElementById(formID).method,document.getElementById(formID).action,true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.send(params);
}
You pass the function the ID of your form and the ID of the element that you want to hold the response from your server-side script. This script will automatically use the method and action from your opening form tag.
Posted on November 3rd, 2009 Tags: ajax, client-side, custom, form, JavaScript, php, san diego, server-side, without a framework
in Web design | Comments Off

A custom developed PHP/MySQL/CSS/xHTML/JavaScript/Flash website for Temecula Valley Tennis. Including Testimonials, photo gallery, about page, contact form, slideshow and more. This website has a content management system (CMS) that allows the client to edit their own content.
Posted on November 1st, 2009 Tags: cms, joomla, mysql, php, temecula, tennis
in Web design | Comments Off
I found one of my designs has been hotlinked on a rabidly right-wing forum.

Hotlinked No. 1
Posted on October 24th, 2009 in Uncategorized | Comments Off
Posted on October 24th, 2009 in Uncategorized | Comments Off
Posted on October 12th, 2009 Tags: logo design, political
in Uncategorized | Comments Off
Coded in PHP/MySQL, this website allows anyone to approve or disapprove of twitter tweets without having to login. To view and rate my tweets, you would go to http://jameswomack.com/tweetworthy/james_womack

Let's give tweets what they deserve
Posted on October 11th, 2009 Tags: approve, disapprove, dislike, like, rating, tweets, tweetworthy, twitter
in Web design | Comments Off