Source codes, small scripts...

Started on the old forum in June 2006 · view the original in the archive · old links redirect here

124 replies · 52,842 views · started 20 years ago · 1 min read

24 participants
CLINT #21

SOURCE CODE VIEWER

<?

header("Content-Type: text/vnd.wap.wml");

echo '<?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">

<wml>
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card title="Source Code Viewer">

<do type="prev" label="Back"><prev/></do>';
print "

";

if ($url == "") {
echo "ENTER URL:
<input type=\"text\" name=\"url\" maxlength=\"999\" emptyok=\"false\" value=\"http://\"/>
<anchor>[GO]<go href=\"$PHP_SELF?url=$url\" method=\"post\"><postfield name=\"url\" value=\"$(url)\"/></go></anchor>";
}

if ($url == "$url") {
$udata=@file_get_contents("$url");

$udata = str_replace("$","$$",$udata);
$udata = str_replace("&","&",$udata);
$udata = str_replace("'","'",$udata);
$udata = str_replace("<","<",$udata);
$udata = str_replace(">",">",$udata);
$udata = str_replace("\"",""",$udata);
$udata = str_replace("-","*",$udata);

print "$udata
";
}

print "
<a href=\"http://LandOfWap.net\">(c) LandOfwap.net</a></p>
</card>
</wml>";

?>
kiss Senior · 294 posts #23

I THINK IT THE MOUST USEFUL REDIRECTOR SCRIPT

<? /* Si scripta includine i index.php ar koki kita faila turesite apsauga nuo visokiu source ir mozilla */ 
$apsauga=1; if($apsauga==1){ $browser=$_SERVER['HTTP_USER_AGENT']; $pos=strpos($browser,'/'); if($pos!=0) 
{
$browser2=substr($browser,0,$pos);
} 
$words = explode("WinWAP", $browser); 
$kik= count($words); if($kik>=2)
{ $stop=1; }
$words = explode("WapSilon", $browser); 
$kik= count($words); if($kik>=2)
{ $stop=1; } 
$words = explode("cURL PHP", $browser); 
$kik= count($words); if($kik>=2)
{ $stop=1; } 
$words = explode("Mozilla", $browser); 
$kik=count($words); if($kik>=2)
{ $stop=1; }
$words = explode("Opera", $browser); 
$kik= count($words); if($kik>=2)
{ $stop=1; }
$words = explode("portalmmm", $browser); $kik= count($words); if($kik>=2)
{ $stop=1; } 
$words = explode("ReqwirelessWeb", $browser); $kik= count($words); if($kik>=2)
{ $stop=1; } 
$words = explode("lwp-trivial",$browser); 
$kik= count($words);
if($kik>=2)
{ $stop=1; } 
$words = explode("Nokia-WAPToolkit", $browser); 
$kik= count($words); if($kik>=2)
{ $stop=1; } if(!$browser)
{ $stop=1; } if($browser="")
{ $stop=1; } if($stop==1) { $wmlredirect = "http://hifi-project.net";

header("Location: ".$wmlredirect); exit; } }  ?>

www.inbuzunar.mobi -Your mobile portal pocket

GumSlone Administrator Principal · 1,690 posts #24

WEB/WAP Redirection script

if (strpos(strtolower($_SERVER["HTTP_ACCEPT"]), "text/vnd.wap.wml") !== false ||
strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "text/html") !== false) $wml_device = true;
else $wml_device = false;

if($wml_device == false)header ('Location: http://wapforum.org.uk/');
if($wml_device == true)header ('Location: http://2wap.net/');

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

wapkralj Developer · 237 posts #25

one from mobiilichat

<?PHP

// A file to redirect users based on their browsers.

$htmlredirect = "home.html";
$wmlredirect = "home.wml";**if(strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.WML") > 0) {$br = "WML";}
else {
$browser=substr(trim($HTTP_USER_AGENT),0,4);
if($browser=="Noki" || // Nokia phones and emulators
$browser=="Eric" || // Ericsson WAP phones and emulators
$browser=="SAMS" || // Samsung
$browser=="Sony" || // SonyEricsson
$browser=="WapI" || // Ericsson WapIDE 2.0
$browser=="MC21" || // Ericsson MC218
$browser=="AUR " || // Ericsson R320
$browser=="R380" || // Ericsson R380
$browser=="UP.B" || // UP.Browser
$browser=="WinW" || // WinWAP browser
$browser=="UPG1" || // UP.SDK 4.0
$browser=="upsi" || // another kind of UP.Browser ??
$browser=="QWAP" || // unknown QWAPPER browser
$browser=="Jigs" || // unknown JigSaw browser
$browser=="Java" || // unknown Java based browser
$browser=="Alca" || // unknown Alcatel-BE3 browser (UP based?)
$browser=="MITS" || // unknown Mitsubishi browser
$browser=="MOT-" || // unknown browser (UP based?)
$browser=="My S" || // unknown Ericsson devkit browser ?
$browser=="WAPJ" || // Virtual WAPJAG [url]www.wapjag.de[/url]
$browser=="fetc" || // fetchpage.cgi Perl script from [url]www.wapcab.de[/url]
$browser=="Klon" || // Klondike WapBrowser
$browser=="ALAV" || // yet another unknown UP based browser ?
$browser=="Oper" || // Opera
$browser=="Wapa") // another unknown browser ("Wapalyzer"?)
{$br = "WML";}
else {$br = "HTML";
}}
if($br == "WML") {
header("302 Moved Temporarily");
header("Location: ".$wmlredirect);
exit;}
else 
{header("302 Moved Temporarily");
header("Location: ".$htmlredirect);
exit;}

?>
abhisar #26

---------------------------CODE----------------------------------- REDIRECTION SCRIPT

<?

$htmlredirect = "http://abhisar.6te.net/xforum";
$wmlredirect = "http://abhisar.6te.net";

if(strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.WML") > 0)
{
header("Location: ".$wmlredirect);

}
else
{
header("Location: ".$htmlredirect);
exit;
}
?>

kiss Senior · 294 posts #27

COOL SCRIPT TIMER

<?php

function
get_microtime()
{
list($usec, $sec) = explode(" ", microtime());

return ((double)$usec+(double)$sec);
}
$start = get_microtime();

//Toliau failo turinys

$end = get_microtime();
$native = round((float)(($end - $start) * 1000), 2);

echo "SCRIPT LOAD: $native ms";

?>

YEAR COUNTDOWN

<?php $diena=date("z"); $liko=365-$diena; echo"[b]DAYS LEFT:[/b][size="1"] $liko[/size]"; ?>

www.inbuzunar.mobi -Your mobile portal pocket

hardstyle Developer · 154 posts #28

this one works, u forgot a space after the echo kiss

<?php $diena=date("z"); $liko=365-$diena; echo "DAYS LEFT: $liko"; ?>

or jst put this anywhere

$diena=date("z"); $liko=365-$diena; 
echo "
$liko days left till new years!";

8th wonder of the world

kiss Senior · 294 posts #29

GOOD SOURCE VIEWER

<?php 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">
<wml>
<card id="index" title="SOURCE VIEWER">
<p align="left">'; $_GET['id']; if($id == "") { echo"ENTER URL:
<input type=\"text\" name=\"url\" maxlength=\"999\" emptyok=\"false\" value=\"http://\"/>
"; echo"<anchor>|get|<go href=\"index.php?id=result\" method=\"post\"><postfield name=\"url\" value=\"$(url)\"/></go></anchor>
----------
"; }   if($id =="result") { echo "SOURCE RESULT OF:
<a href=\"$url\">$url</a>
"; echo "
"; $url = $_POST['url']; $ff= @htmlspecialchars(file_get_contents($url)); if(!$ff) { echo"SITE NOT IN ACTION!!!
"; } if(ereg("http://",$url)) { echo"$ff"; } else { echo"SOURCE FAILED!!!";  } } echo "<a href=\"http://hifi-project.net/rating/?cid=1\"><img src=\"http://hifi-project.net/rating/count.php?id=1\" alt=\"w@p rating\"/></a>
<a href=\"http://hifi-project.net/index.php\">|home|</a>";
?>
</p>
</card>
</wml>

www.inbuzunar.mobi -Your mobile portal pocket

wapkralj Developer · 237 posts #30

Here is the php code for xex collors, it shows color and the hex code

<html>
<head>
<title>Websafe Colors</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#000000">
<?php
$hex = array("00", "33", "66", "99", "CC", "FF");
echo "<h1><font color='#FFFFFF'>Web Safe Color Chart</font></h1><hr>";
echo "<table border='0'>";
for ($r=0; $r<count($hex); $r++){ //the red colors loop
  for ($g=0; $g<count($hex); $g++){ //the green colors loop
    echo "<tr>"; //Define a row for the six blue colors
    for ($b=0; $b<count($hex); $b++){ //iterate through the six blue colors
      $color = $hex[$r].$hex[$g].$hex[$b];
      //At this point we decide what font color to use 
      if ( $hex[$r] <= "99" && $hex[$g] <= "99" && $hex[$b] <= "99"){

        // Use a white font if the color is going to be fairly dark
        echo "<td width='100' bgcolor='#".$col."'><font color='#FFFFFF'> ".$col." </font></td>";
      } else {
        // Use a black font on the lighter colors
        echo "<td width='100' bgcolor='#".$col."'><font color='#000000'> ".$col." </font></td>";
      } 
    } //End of b-blue innermost loop
    echo "</tr>\n\r"; // close row after writing six color cells
  } //End of g-green loop
} //End of r-red outermost loop
?> 
</body>
</html>
wapkralj Developer · 237 posts #31

Wap Useronline

Sql tables

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:

<?
$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.

<? include("useronline.php"); ?>
Guest #32

========================================= Wap Vote Script

Wap Vote Script Code

vote.php

<?
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

<?
$otv1 = "Excellent";
$otv2 = "Good";
$otv3 = "Average";
$otv4 = "Poor";
$otv5 = "Very Poor";
?>

vote.dat

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

<?
<?
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

<?
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

<?
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 ><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....

Guest #33
<?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; 
?>
Guest #34

Curs Valutar BNR

<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($fila, 4096); 
} 
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]) > 0 ) $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']), 0, 5).'%'; 

////////// $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'] / 100, 0, 5); $val[$i]['l_nou']= substr($val[$i]['l_nou'] / 100, 0, 5); 
} 
$val[$i]['l_nou'] = substr((str_replace('.', ',', $val[$i]['l_nou'])), 0, 5); 
}; 
/* 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>
kiss Senior · 294 posts #35

email atachament

<?
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

kiss Senior · 294 posts #36

or maybe wants that query tools

<?
#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
© kiss <?php echo date('Y');?></font></p>

www.inbuzunar.mobi -Your mobile portal pocket

GumSlone Administrator Principal · 1,690 posts #37

Search file in the directory function:

<?
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

External image (may be gone)

GumSlone Administrator Principal · 1,690 posts #38

Image resizer code, resizes images to max height / width

<?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, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Output
imagejpeg($image_p, null, 100);
?>

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

GumSlone Administrator Principal · 1,690 posts #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.

<?php header('Content-type: application/vnd.wap.xhtml+xml'); ?>
<?php echo '<?xml version="1.0"?' . '>'; ?>
<!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['filename'];

if ($_FILES['myFile']['error'] == UPLOAD_ERR_OK){
  $fileName = $_FILES['myFile']['name'];
?>

[b]Uploaded File Info:[/b]

Content type: <?php echo $_FILES['myFile']['type']; ?>

Field name: myFile

File name: <?php echo $fileName; ?>

File size: <?php echo $_FILES['myFile']['size']; ?>

<?php
  /* Save the uploaded file if its size is greater than 0. */
  if ($_FILES['myFile']['size'] > 0){
    if ($optionalFileName == "")
      $fileName = basename($fileName);
    else
      $fileName = $optionalFileName;

    $dirName = '/file_uploads/';

    if (move_uploaded_file($_FILES['myFile']['tmp_name'], $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

External image (may be gone)

subzero Super moderator Fellow · 3,954 posts #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

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); 

?>

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... _______…

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close