Zurück   Flashforum > Flash > Stuff

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 01-10-2006, 15:28   #1 (permalink)
Banned
 
Benutzerbild von ballaballa
 
Registriert seit: Sep 2006
Beiträge: 793
[stuff] Dyn Dns

tach auch ..
aus gegebenem anlass (langeweile, ausserdem komm ich gerad eh net weiter)

hab ich mir ein kleines teil gebastelt was es mir ermöglicht in verbindung mit einem freehoster eine weiterleitung mit der immer aktuellen ip auf meinen lokalen apache zuhaue herzustellen.

mit anderen worten nix anderes als DYN-DNS

das ganze läuft über php und erfordert keine datenbank...
sicherheit....? hmmm ja könnt man implementieren.. ich brauchse nich wer sie braucht kannse ja gern implementieren...

das ganze besteht aus 3 php dateien, 1 txt datei und 1 fla

die php die die ip speichert (savehostaddress.php)
PHP-Code:
 <?php
// get the IP from the server envoirement
$ip getenv("REMOTE_ADDR");

//set the filename
$filename 'hostaddress.txt';

//check if file is writeable
if (is_writable($filename)) {
    
//check if file could be opened
   
if (!$handle fopen($filename"w")) {
         echo 
"false";
         exit;
   }
   
//if file couldent be written return false and exit
   
if (!fwrite($handle$ip)) {
       echo 
"false";
       exit;
   }
    
//else return true
   
echo "true";
   
//close file
   
fclose($handle);
} else {
    
//if file is not writeable return false
   
echo "false";
}
?>
die datei die dann eure seite wiedergibt(iframe) oder wahlweise weiterleitet..(index.php)
PHP-Code:
<?php
include 'conf_inc.php';
// reads the file wherin the hostname has been saved
$filename "hostaddress.txt";
$handle fopen ($filename"r");
$contents fread ($handlefilesize ($filename));
fclose ($handle);
// start writig the document
echo "\n".'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"';
echo 
"\n".'       "http://www.w3.org/TR/html4/loose.dtd">';
echo 
"\n".'<html>';
echo 
"\n".'<head>';
echo 
"\n".'<title>'.$doctitle.'</title>';

echo 
"\n".'<!-- DOC-INFO -->';
//-----------<DOC-INFO>----------
//documenttype and site informations
echo "\n".'<meta http-equiv="content-type" content="'.$contenttype.'">';
echo 
"\n".'<meta http-equiv="language" content="'.$lang.'">';
echo 
"\n".'<meta name="generator" content="routing machine by ogow">';
echo 
"\n".'<meta name="date" content="'.$lastupload.'">';
//-----------</DOC-INFO>----------

echo "\n".'<!-- ABOUT YOU -->';
//-----------<ABOUT_YOU>----------
echo "\n".'<meta name="author" content="'.$author.'">';
echo 
"\n".'<meta name="publisher" content="@-web">';
echo 
"\n".'<link rev="made" content="'.$lastupload.'">';
//-----------</ABOUT_YOU>----------

echo "\n".'<!-- REROUTE  -->';
//-----------<IF REROUTE>----------
//the put throug
if ($reroute == true){
echo 
"\n".'<meta http-equiv="refresh" content="2; URL=http://'.$contents.'">';
};
//-----------</IF REROUTE>----------

echo "\n".'<!-- SEO -->';
//-----------<SEO>----------
//pls describe your site correct
echo "\n".'<meta name="description" content="'.$description.'">';

//and add keaywords so the searchengine finds your site
echo "\n".'<meta name="keywords" content="'.$keywords.'">';

//site topic
echo "\n".'<meta name="page-topic" Content="'.$topic.'">';

//tell the searchengine what kind of site you offer
echo "\n".'<meta name="page-type" content="'.$pagetype.'">';

//tell it for what ppl its made
echo "\n".'<meta name="audience" Content="'.$audience.'">';

//tell the searchengine to also folow your links
echo "\n".'<meta name="robots" content="'.$robots.'">';

//chache means here not the users chache it means the searchengine chache!!!
if ($robotscache == false){
echo 
"\n".'<meta name="robots" content="noarchive">';
};
    
//tell the searchengine to come back in about "XX days"
echo "\n".'<meta name="revisit-after" content="'.$days.' days">';

//and tell it when this content will be old
echo "\n".'<META HTTP-EQUIV="expires" CONTENT="'.$expires.'">';
//-----------</SEO>----------

echo "\n".'<!-- USERCACHE -->';
//-----------<USERCACHE>----------
//we dont want old site to be displayed on the users site
echo "\n".'<meta http-equiv="pragma" content="no-cache">';
echo 
"\n".'<meta http-equiv="expires" content="0">';
echo 
"\n".'<meta http-equiv="cache-control" content="no-cache">';
//-----------</USERCACHE>----------
echo "\n".'</head>';


echo 
"\n".'<body topmargin="0" leftmargin="0">';
echo 
"\n".'<!-- IFRAME -->';
//-----------<IF IFRAME>----------
if ($doiframe == true){
echo 
"\n".'<iframe height="100%" width="100%" border="0" frameborder="0" src="http://'.$contents.'"/>';
echo 
"\n".'<a href = "http//'.$contents.'">http://'.$contents.'</a>';
echo 
"\n".'</iframe>';
};
//-----------</IF IFRAME>----------


echo "\n".'<!-- WORDLIST -->';
//-----------<WORDLIST>----------
//here you can add some more words that highers your chance that your site will be found
echo "\n".'<!-- ';
echo 
"\n".'word1, word2, word3';
echo 
"\n".' -->';
//-----------<WORDLIST>----------

echo "\n".'</body>';
echo 
"\n".'</html>';

?>

die config datei (conf_inc.php)

PHP-Code:
<?php
$doctitle 
"your title";
$contenttype "text/html; charset=iso-8859-1";
$lang "de";
$lastupload "2006-09-30T11:49:37+00:00";
$author "your name";
$email "mailto:nospam@at-web.de";
$description "come in and visite us";
$keywords "design, adobe, flash";
$topic "we design your style";
$pagetype "internet, webdesign";
$audience "young and old";
$robots "index,follow";
$robotscache true;
$days "30";
$expires "Wed, 26 Feb 1997 08:21:57 GMT";
$doiframe false;
$reroute true;
?>
die textdatei (hostaddress.txt) sollte leer sein! und nach dem hochladen sollte man der datei mittels chmod ein 777 verpassen

dann bleibt noch die flash datei... bei der lass ich euch freie hand hier ein beispiel wie es aussehen könnet (noch ne buttonkomponente auf die bühne die man "submit_button" nennt und schon gehts

PHP-Code:
var submitListener:Object = new Object();
submitListener.click = function(evt:Object) {
    var 
result_lv:LoadVars = new LoadVars();
    
result_lv.onLoad = function(success:Boolean) {
        
trace(result_lv)
        if (
success) {
        var 
output result_lv.toString();
            
output == "%20true=&onLoad=%5Btype%20Function%5D" trace("updated") : trace("error");
        } else {
            
result_ta.text "Error connecting to server.";
        }
    };
    var 
send_lv:LoadVars = new LoadVars();
    
result_lv.load("http://odb.110mb.com/display/savehostaddress.php"result_lv"POST");
};
submit_button.addEventListener("click"submitListener); 
viel spass dann mal damit

edit ... ahja ne anleitung...

öhm die 3 php dateien nebst txt datei hochladen und der txt datei chmod 777 verpassen das flash hab ich persöhnlich anders gestaltet es sstartet mit windows mit läuft als projetor unsichtbar im hintergrund und aktualisiert alle 5 mins die ip... aber euch alles vor zu machen wär ja langweilig...

also conf_inc.php noch anpassen und flash selber basteln wobei nichmal ein flash nötig iss ein einfaches aufrufen der seite setzt die ip

Geändert von ballaballa (01-10-2006 um 15:41 Uhr)
ballaballa ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 19:22 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele