Source codes, small scripts...

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Wap Useronline

    Sql tables

    Code:
    CREATE TABLE useronline (
      timestamp int(15) DEFAULT '0' NOT NULL,
      ip varchar(40) NOT NULL,
      file varchar(100) NOT NULL,
      PRIMARY KEY (timestamp),
      KEY ip (ip),
      KEY file (file)
    );
    Script code:

    PHP Code:
    <?
    $server                 = "localhost";
    $db_user                = "root";
    $db_pass                = "";
    $database               = "online";

    $timeoutseconds         = 1000;
    $timestamp=time();
    $timeout=$timestamp-$timeoutseconds;
    mysql_connect($server, $db_user, $db_pass) or die ("Useronline Database CONNECT Error");
    mysql_db_query($database, "INSERT INTO useronline VALUES ('$timestamp','$REMOTE_ADDR','$PHP_SELF')") or die("Useronline Database INSERT Error");
    mysql_db_query($database, "DELETE FROM useronline WHERE timestamp<$timeout") or die("Useronline Database DELETE Error");
    $result=mysql_db_query($database, "SELECT DISTINCT ip FROM useronline WHERE file='$PHP_SELF'") or die("Useronline Database SELECT Error");
    $user  =mysql_num_rows($result);
    mysql_close();
    if ($user==1) {
           echo"online: $user user";
           }
           else
           {
           echo"online: $user users";}


    ?>
    include it to your page eg.

    PHP Code:
    <? include("useronline.php"); ?>

    Comment


      #32
      =========================================
      Wap Vote Script
      =========================================

      Wap Vote Script Code

      vote.php
      Code:
      <?
      session_start("$REMOTE_ADDR");
      header("Content-type:text/vnd.wap.wml;charset=utf-8");
      require ("svote.php");
      print "<?xml version=\"1.0\" encoding=\"utf-8\"?>
      <!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
      if(empty($vote) && empty($result)) {
      print "<wml><card title=\"How's This Site\">
      
      <small>Submit Your Votes Here !
      Hows This Site ?
      </small><select name=\"vote\" title=\"vote\">
      <option value=\"1\">$otv1</option>
      <option value=\"2\">$otv2</option>
      <option value=\"3\">$otv3</option>
      <option value=\"4\">$otv4</option>
      <option value=\"5\">$otv5</option>
      </select>
      <small>
      + <anchor>Vote
      <go href=\"vote.php\" method=\"post\">
      <postfield name=\"vote\" value=\"$(vote)\"/>
      </go>
      </anchor>+
      + <anchor>View Votes
      <go href=\"vote.php\" method=\"post\">
      <postfield name=\"result\" value=\"$(vote)\"/>
      </go> 
      </anchor>+
      
      ?<anchor>Back<prev/></anchor>
      ? GAGGU
      </small></p>
      </card>
      </wml>";
      }
      
      if(!empty($vote)) {
      if(@$vote == "") {
      print "<wml><card title=\Your Vote\">
      
      <small>You Are Not Voted !
      ? GAGGU</small></p></card></wml>";
      }
      if(empty($_SESSION)) {
      $_SESSION['username'] = $vote;
      if($vote == "1") {
      $file = fopen("vote.dat", "r+");
      $data = file("vote.dat");
      list($ot1,$ot2,$ot3,$ot4,$ot5) = explode("|", $data[0]);
      $ot1++;
      $zapis = "$ot1|$ot2|$ot3|$ot4|$ot5";
      $summa = $ot1+$ot2+$ot3+$ot4+$ot5;
      if($file) {
      fputs($file, $zapis);
      }
      print "<wml><card title=\"Your Vote\">
      
      <small>Thanks For Your Vote ! Total Votes Are = $summa
      
      Votes List
      
      $otv1 - $ot1 Votes
      
      $otv2 - $ot2 Votes
      
      $otv3 - $ot3 Votes
      
      $otv4 - $ot4 Votes
      
      $otv5 - $ot5 Votes
      
      
      ?<anchor>Back<prev/></anchor>
      ? GAGGU</small></p></card></wml>";
      }
      if($vote == "2") {
      $file = fopen("vote.dat", "r+");
      $data = file("vote.dat");
      list($ot1,$ot2,$ot3,$ot4,$ot5) = explode("|", $data[0]);
      $ot2++;
      $zapis = "$ot1|$ot2|$ot3|$ot4|$ot5";
      $summa = $ot1+$ot2+$ot3+$ot4+$ot5;
      if($file) {
      fputs($file, $zapis);
      }
      print "<wml><card title=\"Your Vote\">
      
      <small>Thanks For Your Vote ! Total Votes Are = $summa
      
      Votes List
      
      $otv1 - $ot1 Votes
      
      $otv2 - $ot2 Votes
      
      $otv3 - $ot3 Votes
      
      $otv4 - $ot4 Votes
      
      $otv5 - $ot5 Votes
      
      
      ?<anchor>Back<prev/></anchor>
      ? GAGGU</small></p></card></wml>";
      }
      if($vote == "3") {
      $file = fopen("vote.dat", "r+");
      $data = file("vote.dat");
      list($ot1,$ot2,$ot3,$ot4,$ot5) = explode("|", $data[0]);
      $ot3++;
      $zapis = "$ot1|$ot2|$ot3|$ot4|$ot5";
      $summa = $ot1+$ot2+$ot3+$ot4+$ot5;
      if($file) {
      fputs($file, $zapis);
      }
      print "<wml><card title=\"Your Vote\">
      
      <small>Thanks For Your Vote ! Total Votes Are = $summa
      
      Votes List
      
      $otv1 - $ot1 Votes
      
      $otv2 - $ot2 Votes
      
      $otv3 - $ot3 Votes
      
      $otv4 - $ot4 Votes
      
      $otv5 - $ot5 Votes
      
      
      ?<anchor>Back<prev/></anchor>
      ? GAGGU</small></p></card></wml>";
      }
      if($vote == "4") {
      $file = fopen("vote.dat", "r+");
      $data = file("vote.dat");
      list($ot1,$ot2,$ot3,$ot4,$ot5) = explode("|", $data[0]);
      $ot4++;
      $zapis = "$ot1|$ot2|$ot3|$ot4|$ot5";
      $summa = $ot1+$ot2+$ot3+$ot4+$ot5;
      if($file) {
      fputs($file, $zapis);
      }
      print "<wml><card title=\"Your Vote\">
      
      <small>Thanks For Your Vote ! Total Votes Are = $summa
      
      Votes List
      
      $otv1 - $ot1 Votes
      
      $otv2 - $ot2 Votes
      
      $otv3 - $ot3 Votes
      
      $otv4 - $ot4 Votes
      
      $otv5 - $ot5 Votes
      
      
      ?<anchor>Back<prev/></anchor>
      ? GAGGU</small></p></card></wml>";
      }
      if($vote == "5") {
      $file = fopen("vote.dat", "r+");
      $data = file("vote.dat");
      list($ot1,$ot2,$ot3,$ot4,$ot5) = explode("|", $data[0]);
      $ot5++;
      $zapis = "$ot1|$ot2|$ot3|$ot4|$ot5";
      $summa = $ot1+$ot2+$ot3+$ot4+$ot5;
      if($file) {
      fputs($file, $zapis);
      }
      print "<wml><card title=\"Your Vote\">
      
      <small>Thanks For Your Vote ! Total Votes Are = $summa
      
      Votes List
      
      $otv1 - $ot1 Votes
      
      $otv2 - $ot2 Votes
      
      $otv3 - $ot3 Votes
      
      $otv4 - $ot4 Votes
      
      $otv5 - $ot5 Votes
      
      
      ?<anchor>Back<prev/></anchor>
      ? GAGGU</small></p></card></wml>";
      }
      } else {
      print "<wml><card title=\"Already Voted\">
      
      <small>You Are Already Voted !</small></p></card></wml>";
      }
      }
      if(!empty($result)) {
      $file = fopen("vote.dat", "r");
      $data = file("vote.dat");
      list($ot1,$ot2,$ot3,$ot4,$ot5) = explode("|", $data[0]);
      $summa = $ot1+$ot2+$ot3+$ot4+$ot5;
      print "<wml><card title=\"View Votes\">
      
      <small>Total Votes Are = $summa
      
      Votes List
      
      $otv1 - $ot1 Votes
      
      $otv2 - $ot2 Votes
      
      $otv3 - $ot3 Votes
      
      $otv4 - $ot4 Votes
      
      $otv5 - $ot5 Votes
      
      
      <anchor>Back<prev/></anchor>
      GAGGU</small></p></card></wml>";
      svote.php
      Code:
      <?
      $otv1 = "Excellent";
      $otv2 = "Good";
      $otv3 = "Average";
      $otv4 = "Poor";
      $otv5 = "Very Poor";
      ?>
      vote.dat
      Code:
      0|0|0|0|0
      if nt working chmod vote.dat into 777....

      =========================================
      wap email scripts
      =========================================

      Enjoy Some EMail Sender PHP Codes Here...

      This Is For Send Email To Admin..

      emailadmin.php
      Code:
      <?
      <?
      header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
      echo"<?xml version=\"1.0\"?>"; ?>
      <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
                  "http://www.wapforum.org/DTD/wml_1.1.xml">
      <?
      $TimeZone="12.49"; 
      $time = time() + ($TimeZone * 60 * 60)
      ?>
      <wml>            
      <?
      $wap_title="Your Site"; // Your Sites Name
      $to = "you@your.com"; // Your Email Address
      $time = "".date("D,d-F-Y g:i a", $time)."";
      if ($pass == "")
      {
          $title="Contact $wap_title";
          }
      else 
      {    
          $title="Thank You";
          $msg .= "From: $name\n\nEmail: $email\n\nMessage: $message\n\nUser Browser: $HTTP_USER_AGENT\n\nUser Ip: $REMOTE_ADDR\n\nTime: $time ";
          $subject = "WAP Contect\n";
          $mailheaders = "From: $name<$email> \n";
          $mailheaders .= "Reply-To: $name<$email>\n\n";
          mail($to, $subject, $msg, $mailheaders);    
          print("<card id=\"thanks\" title= \"$title\" >");
          print("<p align=\"center\">Thank You $name,
      Your E-Mail Has Been Sent To ADMIN.</p>");
              print (" <p align=\"center\"><a href=\"contect.php\">CONTINUE</a></p>");
          print("</card>"); 
       }      
      ?>
      <card id="contact" title="CONTECT ADMIN">
      <p align="center">SEND A E-MAIL TO ADMIN !
      
      YOUR NAME:
       
      <input title="name" name="name"/>
      
      YOUR EMAIL:
      
      <input title="email" name="email"/>
      
      MESSAGE:
      
      <input title="message" name="message"/>
      
      <anchor>SEND NOW
      <go method="post" href="<? echo "$PHP_SELF"; ?>">
      <postfield name="name" value="$name"/>
      <postfield name="email" value="$email"/>
      <postfield name="message" value="$message"/>
      <postfield name="pass" value="1"/>
      </go>
      </anchor>
      <br/>
      
      ? GaGGu
      
      </p>
      </card>
      </wml>
      useful for send error report

      report.php
      Code:
      <?
      header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
      echo"<?xml version=\"1.0\"?>"; ?>
      <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
                  "http://www.wapforum.org/DTD/wml_1.1.xml">
      <?
      $TimeZone="12.49"; 
      $time = time() + ($TimeZone * 60 * 60)
      ?>
      <wml>            
      <?
      $wap_title="ERROR REPORT"; 
      $to = "you@your.com"; 
      $time = "".date("D,d-F-Y g:i a", $time)."";
      if ($pass == "")
      {
          $title="$wap_title";
          }
      else 
      {    
          $title="Thank You";
          $msg .= "From: $name\n\nEmail: $email\n\nError Section: $sel\n\nDescription: $message\n\nUser Browser: $HTTP_USER_AGENT\n\nUser Ip: $REMOTE_ADDR\n\nTime: $time ";
          $subject = "Error Report\n";
          $mailheaders = "From: $name<$email>\n";
          $mailheaders .= "Reply-To: $name<$email>\n\n";
          mail($to, $subject, $msg, $mailheaders);    
          print("<card id=\"thanks\" title= \"$title\" >");
          print("<p align=\"center\">Thank You $name,
      Your Error Report Has Been Sent To Admin.</p>");
              print (" <p align=\"center\">? <a href=\"emailadmin.php\">CONTINUE</a></p>");
          print("</card>"); 
       }      
      ?>
      <card id="contact" title="<? echo $title ?>">
      <p align="center">SEND ANY ERROR REPORT TO ADMIN !
      
      </p>
      
      <p align="center">
      
      WHERE YOU GET ERROR HERE!
      
      
      <select name="sel">
      
      <option value="GestBook">GUEST BOOK</option>
      
      <option value="Live Chat">DREAM CHAT</option>
      
      <option value="Send Mail">SEND EMAIL</option>
      
      <option value="Check Mails">CHECK EMAILS</option>
      
      <option value="Services">SREVICES</option>
      
      <option value="File Uploder">UPLOAD FILES</option>
      
      <option value="Wap Masters">WAP MASTERS</option>
      
      <option value="Domain">WHOIS DOMAIN</option>
      
      <option value="Hungman">PLAY HANGMAN</option>
      
      <option value="Admin Contact">CONTACT ADMIN</option>
      
      <option value="Other">OTHER</option>
      
      </select>
      
      
      Please Enter Your Name:
       
      <input title="name" name="name"/>
      
      Please Enter Your Email:
      
      (It's important that we keep your contact, in case we need more information and to let you know after we fix the problem)
      
      <input title="email" name="email"/>
      
      Describe exactly what happen,Which Error You Get:
      
      <input title="message" name="message"/>
      
      <anchor>SEND NOW
      <go method="post" href="<? echo "$PHP_SELF"; ?>">
      <postfield name="sel" value="$sel"/>
      <postfield name="name" value="$name"/>
      <postfield name="email" value="$email"/>
      <postfield name="message" value="$message"/>
      <postfield name="pass" value="1"/>
      </go>
      </anchor>
      
      
      
      ? GaGGu
      
      </p>
      </card>
      </wml>
      free email sender

      mail.php
      Code:
      <?
      header("Content-type: text/vnd.wap.wml");
      $timeadjust = "+45000";
      $adj = ($timeadjust*120);
      $tn = date("H:i:s",time() + $adj);
      $date = date("l, d F Y h:i a",time() + $timeadjust);
      echo '<?xml version="1.0"?>
      <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
      <wml>
      <card id="id1" title="Email Sender">
      <p align="left">';
      if($send){
      if(preg_match("([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})",$to)&&preg_match("([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})",$from)){
      $body  = htmlspecialchars($body);
      $gesendet =  mail("$to", "$subject", "$body
      
      FREE SEND EMAIL SERVICE
      ---------------------------------------------------
      This mail is Wirelessly sent by a:
      $HTTP_USER_AGENT $REMOTE_ADDR at: $date
      through [url]http://you.com[/url]...
      ---------------------------------------------------
      Please note that you.com has no control over the
      contents of this message.
      ---------------------------------------------------", "From: $from");
      if($gesendet)print "Email has been sent to $to
      ";
      else print "Error, email not send!
      ";
      }else{print "Wrong adresses in From:/To: fields!
      ";}
      }
      print 'New Message.
      
      From:
      
      <input name="from" title="from" type="text" value="@"/>
      
      To:
      
      <input name="to" title="to" type="text" value="@"/>
      
      Subject:
      
      <input name="subject" title="subject" type="text" value="(no subject)"/>
      
      Mailbody:
      
      <input name="body" title="text" type="text" value=""/>
      
      <anchor>Send &gt;<go href="'.$_SERVER["PHP_SELF"].'?send=1" method="post">
      <postfield name="from" value="$(from)"/>
      <postfield name="to" value="$(to)"/>
      <postfield name="subject" value="$(subject)"/>
      <postfield name="body" value="$(body)"/>
      </go></anchor>';
      print '
      ---
      #&169; GaGGu
      </p>
      </card>
      </wml>';
      ?>
      MORE SOON......

      more scripts soon....

      Comment


        #33
        PHP Code:
        <?p4hp 
        // aici se cere variabila pentru browser 
        $browser = $_SERVER["HTTP_USER_AGENT"]; 
        // aici se actualizeaza variabila de timp 
        $timp = time(); 
        // variabila pentru IP-ul pe care il aveti 
        $ip = getenv("REMOTE_ADDR"); 
        // variabila pentru hostname 
        $ip_name = gethostbyaddr($ip); 
        // afisarea informatiilor 
        echo "Browser si so: ".$browser. 
        "data si ora: ".gmdate 
        ("d.m.Y - H:i:s",$timp). 
        "
        ip: ".$ip." 
        host: ".$ip_name; 
        ?>

        Comment


          #34
          Curs Valutar BNR
          PHP Code:
          <html> 
          <head> 
          <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1250"> 
          </head> 
          <body> 
          <?php 
          // Curs Valutar BNR 
          // -> (denumire, cod international, valoare in lei vechi, valoare in lei noi, 
          // semn crestere / scadere valoare, variatia fata de ziua precedenta - in procente). 
          // Autor:(c)MITZU 
          // Scriptul poate fii utilizat fara permisiunea autorului. :D

          $fila fopen("http://www.bnro.ro/Ro/Info/curs_ext.asp","rb"); 
          $pagina ''
          while (!
          feof($fila)) 

          $pagina .= fread($fila4096); 

          fclose($fila); 

          $tmp_ explode('- lei vechi -'$pagina); 
          $tmp_ explode('- lei noi -'$tmp_[1]); 
          $semn '<TR><TD>'
          $val strip_tags(str_replace(' class="bold"'''$tmp_[0]), $semn); 
          $val str_replace('<TR>'''explode('</TR>'$val)); array_shift($val); array_pop($val); 
          for(
          $i=0$i count($val); $i++) 

          $val[$i] = str_replace('</TD>'''explode('<TD>'$val[$i])); 
          $n[$i] = trim($val[$i][1]); 

          $val[$i][5] = str_replace(' ''.'$val[$i][5]); 
          $val[$i][6] = str_replace(' ''.'$val[$i][6]); 

          if((
          $val[$i][6] - $val[$i][5]) > $semn '+'
          if((
          $val[$i][6] - $val[$i][5]) < 0$semn '-'
          if((
          $val[$i][6] - $val[$i][5]) == 0$semn ''

          $val[$i]['cod'] = $n[$i]; 
          $val[$i]['nume'] = $val[$i][0]; 
          $val[$i]['val'] = $val[$i][6]; 
          $val[$i]['var'] = ($val[$i][5] - $val[$i][6]) / $val[$i][6]*100

          $val[$i]['var'] = $semn.''.substr(abs($val[$i]['var']), 05).'%'

          ////////// $val[$i]['l_nou'] = Valoarea in LEI NOI. 

          $val[$i]['l_nou'] = str_replace('.'''$val[$i]['val']) / 10000
          if(
          $n[$i]=='100JPY'

          $n[$i]='JPY'$val[$i]['nume'] = 'Yen Japonez'$val[$i]['cod'] = 'JPY'$val[$i]['val'] = substr($val[$i]['val'] / 10005); $val[$i]['l_nou']= substr($val[$i]['l_nou'] / 10005); 

          $val[$i]['l_nou'] = substr((str_replace('.'','$val[$i]['l_nou'])), 05); 
          }; 
          /* pentru serverele PHP 4.x urmatorul loop echivaleaza functia array_combine() din PHP 5.x */ 
          for ($k 0$nr array_values($n), $vall array_values($val), $cnt sizeOf($nr); $k $cnt$k++) 
          $valuta[$nr[$k]] = $vall[$k]; // $valuta - variabila pentru tabele personalizate. 
          /* daca exista server PHP 5.x in locul expresiei de mai sus se poate folosi $valuta = array_combine($n, $val); 
          ---------- EXEMPLE : 
          1. Personalizat - Valutele se pot plasa in orice ordine 
          - $valuta['USD']['val'] = valoarea valutei pentru ziua in curs. 
          - $valuta['USD']['cod'] = codul International al valutei. 
          - $valuta['USD']['nume']= numele valutei. 
          - $valuta['USD']['var']= variatia valutei fata de ziua precedenta - (diferenta in procente) 
          */ 
          echo '<table border="1" cellspacing="0" cellpadding="4">'
          echo 
          '<tr bgcolor="#E3E8F2"><td>Denumire Valuta</td><td> Cod Valuta </td><td>Valoare - Lei Vechi</td><td>Valoare - Lei Noi</td><td>Variatia fata de ziua precedenta</td></tr>'
          echo 
          '<tr><td>'.$valuta['JPY']['nume'].'</td><td>'.$valuta['JPY']['cod'].'</td><td>'.$valuta['JPY']['val'].'</td><td>'.$valuta['JPY']['l_nou'].'</td><td>'.$valuta['JPY']['var'].'</td></tr>'
          echo 
          '<tr><td>'.$valuta['EUR']['nume'].'</td><td>'.$valuta['EUR']['cod'].'</td><td>'.$valuta['EUR']['val'].'</td><td>'.$valuta['EUR']['l_nou'].'</td><td>'.$valuta['EUR']['var'].'</td></tr>'
          echo 
          '</table>'
          /* 
          2. Simplu - Toate Valutele afisate in pagina BNR afisate in ordinea din pagina de referinta. 
          */ 
          echo '<table border="1" cellspacing="0" cellpadding="4">'
          echo 
          '<tr bgcolor="#E3E8F2"><td>Denumire </td><td> COD </td><td>Lei Vechi</td><td>Lei Noi</td><td>Variatia</td></tr>'
          for(
          $i=0$i<count($val); $i++) 

          echo 
          '<tr><td>'.$val[$i]['nume'].'</td><td>'.$val[$i]['cod'].'</td><td>'.$val[$i]['val'].'</td><td>'.$val[$i]['l_nou'].'</td><td>'.$val[$i]['var'].'</td></tr>'

          echo 
          '</table>'
          ?> 
          </body> 
          </html>

          Comment


            #35
            email atachament
            PHP Code:
            <?
            header("Content-type: text/vnd.wap.wml");
            echo '<?xml version="1.0"?>
            <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> ';
            echo '<wml>
            <card id="id1" title="EMAIL SENDER 2">
            <p align="left">';
            $udata = explode("/",$file);
            $udata = array_reverse($udata);
            if (eregi("\.& #40;mid|gif|bmp|mid|midi|3gp|mp3|wav|mpn|nth|mpc|jar|jad|jpeg|jpg|sis|mmf|amr|th
            |png|wbmp|zip|rar)$",$udata[0])||$file=""){
            if(copy("$file", "upload/$udata[0]")&&$send){
            if(preg_match("([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})",$to)&&preg_match("([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})",$from)){
            $body=strip_tags($body);
            $body = stripslashes($body);
            $body**= htmlspecialchars($body);

            $file_name = $udata[0];
            $boundary = strtoupper(md5(uniqid(time())));
            $mail_header**= "From:Test <$from>\n";
            $mail_header .= "MIME-Version: 1.0";
            $mail_header .= "\nContent-Type: multipart/mixed; boundary=$boundary";
            $mail_header .= "\n\nThis is a multi-part message in MIME format**--**Dies ist eine mehrteilige Nachricht im MIME-Format";
            $mail_header .= "\n--$boundary";
            $mail_header .= "\nContent-Type: text/plain";
            $mail_header .= "\nContent-Transfer-Encoding: 8bit";
            $mail_header .= "\n\n$body

            --------------------
            INFO: this mail is wirelessly sent by:\nBROWSER: $HTTP_USER_AGENT\nNET IP: $REMOTE_ADDR\nWSITE: [url=http://hifi-project.net.net/email2]http://hifi-project.net.net/email2[/url] atachament sender service.
            --------------------
            NOTE: [url=http://hifi-project.net]http://hifi-project.net[/url] has no control over the
            contents of this message so use safely.
            -------------------- ";
            $file_content = fread(fopen("upload/$udata[0]","r"),filesize("upload/$udata[0]"));
            $file_content = chunk_split(base64_encode($file_content));
            $mail_header .= "\n--$boundary";
            $mail_header .= "\nContent-Type: application/octetstream; name=\"$file_name\"";
            $mail_header .= "\nContent-Transfer-Encoding: base64";
            $mail_header .= "\nContent-Disposition: attachment; filename=\"$file_name\"";
            $mail_header .= "\n\n$file_content";
            $mail_header .= "\n--$boundary--";
            $gesendet =**mail("$to", "$subject", "$body

            --------------------
            INFO: this mail is wirelessly sent by:\nBROWSER: $HTTP_USER_AGENT\nNET IP: $REMOTE_ADDR\nWSITE: [url=http://hifi-project.net/email2]http://hifi-project.net/email2[/url] atachament sender service.
            --------------------
            NOTE: [url=http://hifi-project.net]http://hifi-project.net[/url] has no control over the
            contents of this message so use safely.
            --------------------- ", $mail_header);
            if($gesendet)print "congratulations your message has been sent succesfully to $to.
            ";
            else print "we find an error,so your message has not been send.
            ";
            }else{print "wrong adresses in FROM/BUDDY fields.
            ";}
            }
            }
            print '
            FROM ME:<input name="from" title="from" type="text" value="@"/>

            TO BUDDY:<input name="to" title="to" type="text" value="@"/>

            SUBJECT:<input name="subject" title="subject" type="text" value="(no subject)"/>

            MESSAGE:<input name="body" title="message" type="text" value=""/>

            ATACHMENT url:<input name="file" title="atachment url" type="text" value="http://"/>
            ';
            print '
            <anchor>send<go href="'.$_SERVER["PHP_SELF"].'?send=1" method="post">
            <postfield name="from" value="$(from)"/>
            <postfield name="to" value="$(to)"/>
            <postfield name="subject" value="$(subject)"/>
            <postfield name="body" value="$(body)"/>
            <postfield name="file" value="$(file)"/>
            </go></anchor>
            ';
            print '(EXAMPLE: [url]http://www.wsite.com/yourfile[/url] gif,jpg,jpeg,png,wbmp,mid,midi,amr,mmf,wav,mp3,nth,thm,mpc,jar,jad,3gp,sis,zip/rar.)

            </p>
            </card>
            </wml>';
            ?>
            www.inbuzunar.mobi - Your mobile portal pocket

            Comment


              #36
              or maybe wants that query tools
              PHP Code:
              <?
              #Until I rewrite my scripts, this will suffice for compatibility
              if(phpversion() >= "4.2.0"){
                 extract($_POST);
                 extract($_GET);
                 extract($_SERVER);
                 extract($_ENV);
              }

              ?>
              <html>
              <head>
              <title>QUERY TOOLS</title>
              <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
              <script>
              function m(el) {
                if (el.defaultValue==el.value) el.value = ""
              }
              </script>
              </head>

              <body bgcolor="#FFFFFF">
              <div align="center"> 
                <h2>WEB/NETWORK INFO</h2>
                <form method="post" action="<? echo $PHP_SELF; ?>">
                  <table width="60%" border="0" cellspacing="0" cellpadding="1">
                    <tr bgcolor="#9999FF"> 
                      <td width="50%" bgcolor="#6666FF"><font size="2" face="Verdana,
              Arial, Helvetica, sans-serif" color="#FFFFFF">[b]Host 
                        Information [/b]</font><font size="1" color="#6666ff">NQT20030507 
              </font></td>
                      <td bgcolor="#6666FF"><font size="2" face="Verdana, Arial,
              Helvetica, sans-serif" color="#FFFFFF">[b]Host 
                        Connectivity[/b]</font></td>
                    </tr>
                    <tr valign="top" bgcolor="#CCCCFF"> 
                      <td> 
                        

              <font size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                          <input type="radio" name="queryType" value="lookup">
                          Resolve/Reverse Lookup

                          <input type="radio" name="queryType" value="dig">
                          Get DNS Records

                          <input type="radio" name="queryType" value="wwwhois">
                          Whois (Web)

                          <input type="radio" name="queryType" value="arin">
                          Whois (IP owner)</font></p>
                      </td>
                      <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> 
                        <input type="radio" name="queryType" value="checkp">
                        Check port: 
                        <input
              type="text" name="portNum" size="5" maxlength="5" value="80">
                        

                        <input type="radio" name="queryType" value="p">
                        Ping host

                        <input type="radio" name="queryType" value="tr">
                        Traceroute to host

                        <input type="radio" name="queryType" value="all" checked>
                        Do it all</font></td>
                    </tr>
                    
                    </table>
                <table width="60%" border="0" cellspacing="0" cellpadding="1"><tr
              bgcolor="#9999FF"> 
                      <td colspan="2">
                        <div align="center">
                          <input type="text" name="target" 
              value="Enter host or IP" onFocus="m(this)">
                          <input type="submit" name="Submit" value="Do It">
                        </div>
                      </td>
                    </tr>
                  </table>
                </form>
              </div>
              <?

              #Global kludge for new gethostbyaddr() behavior in PHP 4.1x
              $ntarget = "";

              #Some functions

              function message($msg){
              echo "<font face=\"verdana,arial\" size=2>$msg</font>";
              flush();
              }

              function lookup($target){
              global $ntarget;
              $msg = "$target resolved to ";
              if( eregi("[a-zA-Z]", $target) )
                $ntarget = gethostbyname($target);
              else
                $ntarget = gethostbyaddr($target);
              $msg .= $ntarget;
              message($msg);
              }

              function dig($target){
              global $ntarget;
              message("

              [b]DNS Query Results:[/b]<blockquote>");
              #$target = gethostbyaddr($target);
              #if (! eregi("[a-zA-Z]", ($target = gethostbyaddr($target))) )
              if( (!eregi("[a-zA-Z]", $target) && (!eregi("[a-zA-Z]", $ntarget))))
                $msg .= "Can't do a DNS query without a hostname.";
              else{
                if(!eregi("[a-zA-Z]", $target)) $target = $ntarget;
                if (! $msg .= trim(nl2br(`dig any '$target'`))) #bugfix
                  $msg .= "The [i]dig[/i] command is not working on your system.";
                }
              #TODO: Clean up output, remove;;'s and DiG headers
              $msg .= "</blockquote></p>";
              message($msg);
              }

              function wwwhois($target){
              global $ntarget;
              $server = "whois.crsnic.net";
              message("

              [b]WWWhois Results:[/b]<blockquote>");
              #Determine which WHOIS server to use for the supplied TLD
              if((eregi("\.com\$|\.net\$|\.edu\$", $target)) || (eregi("\.com\$|\.net\$|\.edu\$", $ntarget)))
                $server = "whois.crsnic.net";
              else if((eregi("\.info\$", $target)) || (eregi("\.info\$", $ntarget)))
                $server = "whois.afilias.net";
              else if((eregi("\.org\$", $target)) || (eregi("\.org\$", $ntarget)))
                $server = "whois.corenic.net";
              else if((eregi("\.name\$", $target)) || (eregi("\.name\$", $ntarget)))
                $server = "whois.nic.name";
              else if((eregi("\.biz\$", $target)) || (eregi("\.biz\$", $ntarget)))
                $server = "whois.nic.biz";
              else if((eregi("\.us\$", $target)) || (eregi("\.us\$", $ntarget)))
                $server = "whois.nic.us";
              else if((eregi("\.cc\$", $target)) || (eregi("\.cc\$", $ntarget)))
                $server = "whois.enicregistrar.com";
              else if((eregi("\.ws\$", $target)) || (eregi("\.ws\$", $ntarget)))
                $server = "whois.nic.ws";
              else if((eregi("\.it\$", $target)) || (eregi("\.it\$", $ntarget)))
                $server = "whois.nic.it";
              else{
                $msg .= "I only support .com, .net, .org, .edu, .info, .name, .us, .cc, .ws, and .biz.</blockquote>";
                message($msg);
                return;
              }

              message("Connecting to $server...

              ");
              if (! $sock = fsockopen($server, 43, $num, $error, 10)){
                unset($sock);
                $msg .= "Timed-out connecting to $server (port 43)";
              }
              else{
                fputs($sock, "$target\n");
                while (!feof($sock))
                  $buffer .= fgets($sock, 10240); 
              }
               fclose($sock);
               if(! eregi("Whois Server:", $buffer)){
                 if(eregi("no match", $buffer))
                   message("NOT FOUND: No match for $target
              ");
                 else
                   message("Ambiguous query, multiple matches for $target:
              ");
               }
               else{
                 $buffer = split("\n", $buffer);
                 for ($i=0; $i<sizeof($buffer); $i++){
                   if (eregi("Whois Server:", $buffer[$i]))
                     $buffer = $buffer[$i];
                 }
                 $nextServer = substr($buffer, 17, (strlen($buffer)-17));
                 $nextServer = str_replace("1:Whois Server:", "", trim(rtrim($nextServer)));
                 $buffer = "";
                 message("Deferred to specific whois server: $nextServer...

              ");
                 if(! $sock = fsockopen($nextServer, 43, $num, $error, 10)){
                   unset($sock);
                   $msg .= "Timed-out connecting to $nextServer (port 43)";
                 }
                 else{
                   fputs($sock, "$target\n");
                   while (!feof($sock))
                     $buffer .= fgets($sock, 10240);
                   fclose($sock);
                 }
              }
              $msg .= nl2br($buffer);
              $msg .= "</blockquote></p>";
              message($msg);
              }

              function arin($target){
              $server = "whois.arin.net";
              message("

              [b]IP Whois Results:[/b]<blockquote>");
              if (!$target = gethostbyname($target))
                $msg .= "Can't IP Whois without an IP address.";
              else{
                message("Connecting to $server...

              ");
                if (! $sock = fsockopen($server, 43, $num, $error, 20)){
                  unset($sock);
                  $msg .= "Timed-out connecting to $server (port 43)";
                  }
                else{
                  fputs($sock, "$target\n");
                  while (!feof($sock))
                    $buffer .= fgets($sock, 10240); 
                  fclose($sock);
                  }
                 if (eregi("RIPE.NET", $buffer))
                   $nextServer = "whois.ripe.net";
                 else if (eregi("whois.apnic.net", $buffer))
                   $nextServer = "whois.apnic.net";
                 else if (eregi("nic.ad.jp", $buffer)){
                   $nextServer = "whois.nic.ad.jp";
                   #/e suppresses Japanese character output from JPNIC
                   $extra = "/e";
                   }
                 else if (eregi("whois.registro.br", $buffer))
                   $nextServer = "whois.registro.br";
                 if($nextServer){
                   $buffer = "";
                   message("Deferred to specific whois server: $nextServer...

              ");
                   if(! $sock = fsockopen($nextServer, 43, $num, $error, 10)){
                     unset($sock);
                     $msg .= "Timed-out connecting to $nextServer (port 43)";
                     }
                   else{
                     fputs($sock, "$target$extra\n");
                     while (!feof($sock))
                       $buffer .= fgets($sock, 10240);
                     fclose($sock);
                     }
                   }
                $buffer = str_replace(" ", "", $buffer);
                $msg .= nl2br($buffer);
                }
              $msg .= "</blockquote></p>";
              message($msg);
              }

              function checkp($target,$portNum){
              message("

              [b]Checking Port $portNum[/b]...<blockquote>");
              if (! $sock = fsockopen($target, $portNum, $num, $error, 5))
                $msg .= "Port $portNum does not appear to be open.";
              else{
                $msg .= "Port $portNum is open and accepting connections.";
                fclose($sock);
                }
              $msg .= "</blockquote></p>";
              message($msg);
              }

              function p($target){
              message("

              [b]Ping Results:[/b]<blockquote>");
              if (! $msg .= trim(nl2br(`ping -c5 '$target'`))) #bugfix
                $msg .= "Ping failed. Host may not be active.";
              $msg .= "</blockquote></p>";
              message($msg);
              }

              function tr($target){
              message("

              [b]Traceroute Results:[/b]<blockquote>");
              if (! $msg .= trim(nl2br(`/usr/sbin/traceroute '$target'`))) #bugfix
                $msg .= "Traceroute failed. Host may not be active.";
              $msg .= "</blockquote></p>";
              message($msg);
              }


              #If the form has been posted, process the query, otherwise there's 
              #nothing to do yet

              if(!$queryType)
                exit;

              #Make sure the target appears valid

              if( (!$target) || (!preg_match("/^[\w\d\.\-]+\.[\w\d]{1,4}$/i",$target)) ){ #bugfix
                message("Error: You did not specify a valid target host or IP.");
                exit;
                }

              #Figure out which tasks to perform, and do them

              if( ($queryType=="all") || ($queryType=="lookup") )
                lookup($target);
              if( ($queryType=="all") || ($queryType=="dig") )
                dig($target);
              if( ($queryType=="all") || ($queryType=="wwwhois") )
                wwwhois($target);
              if( ($queryType=="all") || ($queryType=="arin") )
                arin($target);
              if( ($queryType=="all") || ($queryType=="checkp") )
                checkp($target,$portNum);
              if( ($queryType=="all") || ($queryType=="p") )
                p($target);
              if( ($queryType=="all") || ($queryType=="tr") )
                tr($target);

              ?>

              <hr>
              <p align="right"><font face="verdana,arial" size=1 color="#ffffff">NQT20050219 <font color="#cccccc">hifi-project.net
              &copy; kiss <?php echo date('Y');?></font></p>
              www.inbuzunar.mobi - Your mobile portal pocket

              Comment


                #37
                Search file in the directory function:

                PHP Code:
                <?
                function search($target, $directory){

                   if(is_dir($directory)){
                       $direc = opendir($directory);
                       while(false !== ($file = readdir($direc))){

                           if($file !="." && $file != ".."){

                               if(is_file($directory."/".$file)){
                                   if(preg_match("/$target/i", $file)){
                                                           echo "<a href=\"$directory/$file\">$file</a>
                ";
                                                       }
                               }else if(is_dir($directory."/".$file)){
                                   search($target,$directory."/".$file);

                               }

                           }
                       }
                       closedir($direc);
                   }

                   return;
                }
                ?>
                Advertise your mobile site for FREE with AdTwirl

                Comment


                  #38
                  Image resizer code, resizes images to max height / width
                  PHP Code:
                  <?php
                  // The file
                  $filename 'test.jpg';

                  // Set a maximum height and width
                  $width 200;
                  $height 200;

                  // Content type
                  header('Content-type: image/jpeg');

                  // Get new dimensions
                  list($width_orig$height_orig) = getimagesize($filename);

                  $ratio_orig $width_orig/$height_orig;

                  if (
                  $width/$height $ratio_orig) {
                     
                  $width $height*$ratio_orig;
                  } else {
                     
                  $height $width/$ratio_orig;
                  }

                  // Resample
                  $image_p imagecreatetruecolor($width$height);
                  $image imagecreatefromjpeg($filename);
                  imagecopyresampled($image_p$image0000$width$height$width_orig$height_orig);

                  // Output
                  imagejpeg($image_pnull100);
                  ?>
                  Advertise your mobile site for FREE with AdTwirl

                  Comment


                    #39
                    Example PHP File Upload Script

                    Below shows a PHP file upload script that is written to handle the form data submitted from the earlier XHTML MP document. The PHP script prints out the information obtained from the HTTP request and saves the uploaded file to the "/file_uploads" directory of the WAP server.

                    Code:
                    <?php header(&#39;Content-type: application/vnd.wap.xhtml+xml&#39;); ?>
                    <?php echo &#39;<?xml version="1.0"?&#39; . &#39;>&#39;; ?>
                    <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
                    
                    <html xmlns="http://www.w3.org/1999/xhtml">
                      <head>
                        <title>File Upload Example</title>
                      </head>
                    
                      <body>
                        <h1>Data Received at the Server</h1>
                        <hr/>
                        
                    
                    
                    
                    <?php
                    foreach ($_POST as $key => $value){
                    ?>
                    
                    [b]Name-value Pair Info:[/b]
                    
                    Field name: <?php echo $key; ?>
                    
                    Field value: <?php echo $value; ?>
                    
                    
                    
                    <?php
                    }
                    
                    $optionalFileName = $_POST[&#39;filename&#39;];
                    
                    if ($_FILES[&#39;myFile&#39;][&#39;error&#39;] == UPLOAD_ERR_OK){
                      $fileName = $_FILES[&#39;myFile&#39;][&#39;name&#39;];
                    ?>
                    
                    [b]Uploaded File Info:[/b]
                    
                    Content type: <?php echo $_FILES[&#39;myFile&#39;][&#39;type&#39;]; ?>
                    
                    Field name: myFile
                    
                    File name: <?php echo $fileName; ?>
                    
                    File size: <?php echo $_FILES[&#39;myFile&#39;][&#39;size&#39;]; ?>
                    
                    
                    
                    <?php
                      /* Save the uploaded file if its size is greater than 0. */
                      if ($_FILES[&#39;myFile&#39;][&#39;size&#39;] > 0){
                        if ($optionalFileName == "")
                          $fileName = basename($fileName);
                        else
                          $fileName = $optionalFileName;
                    
                        $dirName = &#39;/file_uploads/&#39;;
                    
                        if (move_uploaded_file($_FILES[&#39;myFile&#39;][&#39;tmp_name&#39;], $dirName . $fileName)){
                    ?>
                    
                    [b]The uploaded file has been saved successfully.[/b]
                    
                    <?php
                        }
                        else{
                    ?>
                    
                    [b]An error occurred when we tried to save the uploaded file.[/b]
                    
                    <?php
                        }
                      }
                    }
                    ?>
                    
                        </p>
                      </body>
                    </html>
                    script from : http://www.developershome.com/wap/wapUploa...d.asp?page=php5
                    Advertise your mobile site for FREE with AdTwirl

                    Comment


                      #40
                      function spammers mail if you have a web site that sends email there you go

                      soon making lavalair function so users dont get hit

                      Code:
                      function is_email_valid($email) { 
                      if(eregi("^([_a-z0-9-]+)(\.[_a-z0-9-]+)@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) return TRUE; 
                      else return FALSE; 
                      } 
                      ?> 
                       <?php 
                      if (is_email_valid($email)){ 
                       $mailok = ""; 
                      }else{ 
                       $mailok = "Unfortunately Your E-Mail is [b]Not A Valid Address[/b], Please Use Your Browsers Back Button And Re-Complete The Form"; 
                       } 
                      
                      echo "Thank you [b]$_POST[name][/b], for your message! $mailok</p>"; 
                      echo "E-mail Address Entered Was: [b]$_POST[email][/b]</p>"; 
                      echo "Shop Name: [b]$_POST[shop][/b]"; 
                      echo "Street Address: [b]$_POST[street][/b]"; 
                      echo "Suburb: [b]$_POST[suburb][/b]"; 
                      echo "State: [b]$_POST[state][/b]"; 
                      echo "PostCode: [b]$_POST[pcode][/b]"; 
                      echo "Country: [b]$_POST[country][/b]";
                      
                      echo "ABN: [b]$_POST[abn][/b]"; 
                      //start building the mail string 
                      $msg  = "Name: $_POST[name]\n"; 
                      $msg .= "E-Mail: $_POST[email]\n"; 
                      $msg .= "Shop Name: $_POST[shop]\n"; 
                      $msg .= "Street: $_POST[street]\n"; 
                      $msg .= "Suburb: $_POST[suburb]\n"; 
                      $msg .= "State: $_POST[state]\n"; 
                      $msg .= "Post Code: $_POST[pcode]\n"; 
                      $msg .= "Country: $_POST[country]\n"; 
                      $msg .= "ABN: $_POST[abn]\n"; 
                      //set up the mail 
                      $recipient = "support@oz-au.net"; 
                      $subject = "New Registration Request From oz-au.net"; 
                      $mailheaders = "From: My Web Site <www.oz-au.net> \n"; 
                      $mailheaders .= "Reply-To: $_POST[email]"; 
                      
                      //send the mail 
                      mail($recipient, $subject, $msg, $mailheaders); 
                      
                      ?>
                      Last edited by subzero; 20.04.09, 11:59.
                      Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                      Visit: WapMasterz Coming Back Soon!
                      _______
                      SCRIPTS FOR SALE BY SUBZERO
                      Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                      FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                      _______
                      Info & Tips
                      php.net
                      w3schools.com

                      Comment


                        #41
                        randomize banners

                        <script language="JavaScript">
                        <!--
                        function adArray() {
                        for (i=0; i*2<adArray.arguments.length; i++) {
                        this[i] = new Object();
                        this[i].src = adArray.arguments[i*2];
                        this[i].href = adArray.arguments[i*2+1];
                        }
                        this.length = i;
                        }
                        function getAdNum() {
                        dat = new Date();
                        dat = (dat.getTime()+"").charAt(;
                        if (dat.length == 1)
                        ad_num = dat%ads.length;
                        else
                        ad_num = 0;
                        return ad_num;
                        }


                        var ads = new adArray(
                        "http://www.simpleplan-il.com/ps/pro-sky.jpg","http://www.simpleplan-il.com",
                        "http://www.simpleplan-il.com/templates/AA.gif","http://www.simpleplan-il.com",
                        "http://www.simpleplan-il.com/templates/ab.gif","http://www.simpleplan-il.com");

                        var ad_num = getAdNum(); // don&#39;t change this line

                        document.write(&#39;&#39;
                        +&#39;The script by&#39;
                        +&#39;Alon Askalsky
                        &#39;
                        +&#39;<A HREF="&#39;+ads[ad_num].href+&#39;">[img]&#39;+ads[ad_num].src+&#39;[/img]&#39;);

                        // ****** YOU NEED NOT MODIFY ANYTHING THAT IS NOT IN BETWEEN THESE TWO COMMENTS ****

                        link_num = document.links.length-1;

                        function rotateSponsor() {
                        if (document.images) {
                        ad_num = (ad_num+1)%ads.length;
                        document.js_ad.src = ads[ad_num].src;
                        document.links[link_num].href = ads[ad_num].href;
                        setTimeout("rotateSponsor()",45000);
                        }
                        }
                        setTimeout("rotateSponsor()",45000);

                        // -->
                        </script>

                        Comment


                          #42
                          Function to get the real ip, eg if someony is using proxy server.

                          PHP Code:
                          function getRemoteInfo () {
                              
                          $proxy="";
                              
                          $IP "";
                              if (isSet(
                          $_SERVER)) {
                                  if (isSet(
                          $_SERVER["HTTP_X_FORWARDED_FOR"])) {
                                      
                          $IP $_SERVER["HTTP_X_FORWARDED_FOR"];
                                      
                          $proxy  $_SERVER["REMOTE_ADDR"];
                                  } elseif (isSet(
                          $_SERVER["HTTP_CLIENT_IP"])) {
                                      
                          $IP $_SERVER["HTTP_CLIENT_IP"];
                                  } else {
                                      
                          $IP $_SERVER["REMOTE_ADDR"];
                                  }
                              } else {
                                  if ( 
                          getenv'HTTP_X_FORWARDED_FOR' ) ) {
                                      
                          $IP getenv'HTTP_X_FORWARDED_FOR' );
                                      
                          $proxy getenv'REMOTE_ADDR' );
                                  } elseif ( 
                          getenv'HTTP_CLIENT_IP' ) ) {
                                      
                          $IP getenv'HTTP_CLIENT_IP' );
                                  } else {
                                      
                          $IP getenv'REMOTE_ADDR' );
                                  }
                              }
                              if (
                          strstr($IP',')) {
                                  
                          $ips explode(','$IP);
                                  
                          $IP $ips[0];
                              }
                              
                          $RemoteInfo[0]=$IP;
                              
                          $RemoteInfo[1]=@GetHostByAddr($IP);
                              
                          $RemoteInfo[2]=$proxy;
                              return 
                          $RemoteInfo;

                          from http://de3.php.net/gethostbyaddr
                          Advertise your mobile site for FREE with AdTwirl

                          Comment


                            #43
                            If you use the explode user agent to get the mobile phone model, you will find out that on most new nokia phones you will get Mozilla instaed of NokiaN95 etc, here is a small function which helps to get the phone model from useragent.

                            PHP Code:
                            function mobile_phone($_mob_ua)
                            {
                                  
                            $_position=strpos($_mob_ua,"Nokia");
                                   if(
                            $_position)$_mob_ua substr($_mob_ua$_position,25);
                                   else 
                            $_mob_ua=$_mob_ua;
                                  
                            $phone explode ('/'$_mob_ua); 
                                  return 
                            $phone[0];

                            usage :
                            Code:
                            echo 'Best for '.mobile_phone($_SERVER['HTTP_USER_AGENT']).'
                            ';
                            Advertise your mobile site for FREE with AdTwirl

                            Comment


                              #44
                              none of shown source code viewers work, so i create my own, here it is,
                              Code:
                              <?include("header.php");?>
                              <?
                              if(isset($_GET['go']) && $_GET['go'] == 'view')
                              ** {
                              ?>
                              
                              <wml>
                              <card id="rezultat" title="Source Viewer">
                              <p align="center">
                              
                              Source Sajta: [url="$(url)"]$(url)[/url]
                              
                              
                              
                              
                              <? $url = $_POST['url']; $ff= @htmlspecialchars(file_get_contents($url)); if(!$ff) {?>
                              
                              Greska: Sajt ne postoji!
                              
                              <anchor><prev/>Nazad</anchor>
                              -----
                              
                              
                              
                              <?} if(ereg("http://",$url)) { echo"$ff"; } else { ?>
                              
                              Greska: Adresa sajta nije validna!
                              
                              <anchor><prev/>Nazad</anchor>
                              
                              
                              
                              <? } ?>
                              
                              
                              
                              
                              -----
                              
                              <anchor><prev/>Nazad</anchor>
                              
                              [url="http://coding-talk.com/f14/?go=main"]Glavna[/url]
                              
                              
                              </p>
                              </card>
                              </wml>
                              <?
                              exit;
                              }
                              ?>
                              
                              <wml>
                              <card id="index" title="Source Viewer">
                              <p align="center">
                              
                              
                              Unesite URL:
                              
                              
                              <input type="text" name="url" maxlength="30" emptyok="false" value="http://"/>
                              
                              <anchor>Ok<go href="<?echo $PHP_SELF;?>?go=view" method="post">
                              <postfield name="url" value="$(url)"/></go></anchor>
                              
                              
                              
                              -----
                              
                              [url="http://coding-talk.com/f14/?go=main"]Glavna[/url]
                              
                              </p>
                              </card></wml>
                              it is good looking script and it works 100%, on every hosting...
                              o yes, here is the header.php
                              Code:
                              <?
                              
                              header("Content-type: text/vnd.wap.wml");
                              header("Cache-control: no-store,no-cache,must-revalidate");
                              print '<?xml version="1.0" encoding="utf-8"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">';
                              
                              ?>

                              Comment


                                #45
                                generate a random password, eg if you want to send it by email to a user:

                                PHP Code:
                                $password substr(preg_replace('/\W/'''md5(rand())), 08); 
                                Advertise your mobile site for FREE with AdTwirl

                                Comment

                                Working...
                                X