How to url encode

0 komentar
<?php
$startDate = '2009/2/20';
$clientID = '1005';

$daturl = urlencode("/report/all_conversions.php?date=".$startDate."&clientid=".$clientID);
?>

<script type="text/javascript" src="/report/ofc/js/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF(
  "/report/ofc/open-flash-chart.swf", "all_conversions_report", "950", "150",
  "9.0.0", "expressInstall.swf",
  {"data-file":"<?php echo $daturl; ?>"}
  );
</script>

<div id="all_conversions_report"></div>

Validate Email Form Check

0 komentar

<html>
<head>
<script type="text/javascript">
function validateForm()
{
var x=document.forms["myForm"]["email"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  {
  alert("Not a valid e-mail address");
  return false;
  }
}
</script>
</head>

<body>
<form name="myForm" action="demo_form.asp" onsubmit="return validateForm();" method="post">
Email: <input type="text" name="email">
<input type="submit" value="Submit">
</form>
</body>

</html>

Script to Force Download Image

0 komentar
<?php
$file 
= 'monkey.gif';

if (
file_exists($file)) {
    
header('Content-Description: File Transfer');
    
header('Content-Type: application/octet-stream');
    
header('Content-Disposition: attachment; filename='.basename($file));
    
header('Content-Transfer-Encoding: binary');
    
header('Expires: 0');
    
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    
header('Pragma: public');
    
header('Content-Length: ' . filesize($file));
    
ob_clean();
    
flush();
    
readfile($file);
    exit;
}
?>
The above example will output something similar to:
Open / Save dialogue

Script to close webpage windows using click

0 komentar
If this link clicked, the windows open will be closed
<a href="javascript:window.close()">Close</a>


Closing a Frameset Window from a Link Click
<a href="javascript:top.window.close()">Close</a>

Css property that i dont know yesterday

0 komentar

To adjust the line distance between any line text : line-height: 1.4em;

How to reset CSS ver. 1

0 komentar
By default css has many padding on its syntax, so when you have any <p> syntax, they will create many padding on your html project.


This is not at <p> syntax only, others syntax must be calibration to get better interface. so this is the Css resetter:
/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
 
Put this code on your top of css document. have a nice design making. 

How to add Shadow on Text property using css3

0 komentar
if your design have any text shadow decoration, and you want to convert it into html and css3. Use this code to add these effect font border or font shadow.


the code:
#element{
  text-shadow: 0 0 2px #000; /* horizontal-offset vertical-offset 'blur' colour */
  -moz-text-shadow: 0 0 2px #000;
  -webkit-text-shadow: 0 0 2px #000;
}