Archive

Posts Tagged ‘iframe’

Cflayout

November 13, 2009 ppshein Leave a comment

I didn’t notice cflayout tag is just like DIV before. It’s not much different between cflayout and DIV. Sometimes, it just like iframe. But, we should know this tag will be useful for future. Here is example for cflayout.

 

<html>
<head>
<script type=”text/javascript” charset=’utf-8′>
function CF_RunContent(src){
setTimeout(function(){document.getElementById(‘Center’).innerHTML = src;},5);
}
</script>
</head>
<body>
<a href=”#” onclick=”ColdFusion.navigate(‘mybio.cfm’,'Center’);”>Bio</a>
<cflayout type=”border” name=”layoutborder”>
<cflayoutarea name=”Center” position=”top” style=”width:500px;height:200px” maxSize=”200″>
Welcome
</cflayoutarea>
</cflayout>

</body>
</html>

Multiple File Upload with iFrame

June 2, 2009 ppshein Leave a comment

Our GM assign me to do multiple file upload program. At that time, I was supposed to implement with Ajax. But, one of my friends told me that Ajax cannot handle completely if clients upload serveral files. That’s why I have an idea to implement this program with iFrame.

Index.php

<iframe src=”upload.php” style=”width:260px;height:100px;” frameborder=”0″></iframe><br />
<iframe src=”upload.php” style=”width:260px;height:25px;” frameborder=”0″></iframe><br />
<iframe src=”upload.php” style=”width:260px;height:25px;” frameborder=”0″></iframe><br />

Upload.php

<script type=”text/javascript”>
function startUpload(){
if (document.getElementById(‘message’) != undefined) {
document.getElementById(‘message’).style.display = ‘none’;
}
document.getElementById(‘process’).style.display = ‘block’;
document.getElementById(‘uploadfile’).style.visibility = ‘hidden’;
return true;
}
</script>

<form method=”post” name=”uploadform” enctype=”multipart/form-data”>
<div style=”text-align:center;”>
<?php
if ($_FILES){
if ($_FILES['file']['error'] > 0) {
echo “<p id=’message’ style=’display:block;’>Fout code: “.$_FILES['file']['error'].”
(<a href=’http://php.net/manual/nl/features.file-upload.errors.php’ target=’_blank’>php-error</a>)</p>”;
}
move_uploaded_file($_FILES['file']['tmp_name'],
“upload/” . $_FILES['file']['name']);
echo “<p id=’message’ style=’display:block;’>Upload!</p>”;
}
}
?>
<p id=”process” style=”display:none;”>
Uploaden…<br/>
<img src=”loader.gif” alt=”loading” />
</p>
<input type=”file” name=”file” id=”uploadfile” onchange=”startUpload();document.uploadform.submit();” />
</div>
</form>

It’s simple, isn’t it?

Categories: Javascript, php Tags: , , , ,