automatically resize iframe height depending on content
You can use this javascript function to resize the height of your iframe depending on the size of your parent page.
-
<script language="JavaScript">
-
function iFrameHeight() {
-
if(document.getElementById && !(document.all)) {
-
h = document.getElementById('main').contentDocument.body.scrollHeight;
-
document.getElementById('main').style.height = h + 100;
-
}
-
else if(document.all) {
-
h = document.frames('main').document.body.scrollHeight;
-
document.all.main.style.height = h + 100;
-
}
-
}
-
</script>
Popularity: 35% [?]
how to manage feeds between a pda and a computer
| I have been searching for an RSS Reader that integratis with my PDA(Pocket PC).Finally i found RSS Popper wich integrates with MS Outlook.The feeds can be browsed as emails.A benefit from RSS Popper is that you even can fetch the webpage when the RSS feed only offers partial feeds. |
But the main reason why i use RSS popper is that it can synchronize messages with my PDA over Active sync.
Popularity: 3% [?]
getting your own .htaccess code in combination with wordpress
Just a quick not on mod_rewrite & wordpress.
If you want to write your own .htaccess code in combination with wordpress you have to put it above the default wordpress code.
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^arolabs\.com$ [NC]
RewriteRule ^(.*)$ http://www.arolabs.com/$1 [R=301,L]
</ifmodule>
# BEGIN WordPress
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifmodule>
# END WordPress
Popularity: 3% [?]
download a file from an ftp server to your webserver
I have several niche price comparison sites where i need to update my productlist on a regular basis. When a merchant delivers his datafeed from his webserver(http://domain.com/feed.csv) you can use php's filecopy function.
Other merchants only offer an option to fetch there datafeed from an FTP server(ie shareasale merchants). This is where the code below offers the perfect solution.
-
$ftp_server = "ftp.domain.com";
-
$ftp_user_name = "";
-
$ftp_user_pass = "";
-
-
$local_file = "download.txt"; //local path
-
$server_file = '/del/todo.txt';//path on ftp server
-
-
$conn_id = ftp_connect($ftp_server);
-
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
-
ftp_pasv($conn_id, TRUE);//set passive mode
-
-
if ((!$conn_id) || (!$login_result)) {
-
echo "An error occured while connecting to $ftp_server with user: $ftp_user_name.<br />";
-
exit;
-
} else {
-
echo "Connected to $ftp_server successfully with user: $ftp_user_name.<br />";
-
}
-
-
$download = ftp_get($conn_id, $local_file , $server_file , FTP_ASCII);//the file download
-
-
if (!$download) {
-
echo "An error occured while downloading the file";
-
} else {
-
echo "Download completed succesfully";
-
}
-
-
ftp_close($conn_id);
You only whant to use the passive mode when you get an "illegal port command" error.
-
ftp_pasv($conn_id, TRUE);//set passive mode
Popularity: 2% [?]



