Guest Access To Wapdesire Site

Started on the old forum in January 2009 · view the original in the archive · old links redirect here

7 replies · 782 views · started 17 years ago · 1 min read

5 participants
dhruva Junior · 36 posts #1

hello friends , i think its good idea to let the users first access sites features as guest . so please can anyone explain me how to code this . and i accept i am noob , but i am trying to learn . so please can someone code it or explain it . that will be great help from you guys. thanks in advance

looony Developer · 95 posts #4

i coded this for wapdesire so that guest could brows the site for 5 mins after 5 mins it redirected them to a page where they could choose to register or leave ill see if i still have it

External image (may be gone)

if(isset($_SESSION['username'])) { print "everybody is a little loony inside"; } else { print"You should be shot"; }

ozziemale31 Lead · 861 posts #5

ok here is the normal wml code for the script

<?php include("../blocked.php"); include("config.php"); include("core.php"); //session_start(); header("Content-type: text/vnd.wap.wml"); header("Cache-Control: no-store, no-cache, must-revalidate"); echo "<?xml version=\"1.0\"?>";

echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; ?> <wml>

<?php $bcon = connectdb(); if (!$bcon) { echo "<card id=\"main\" title=\"(ERROR!)\">"; echo " "; echo "<img src=\"../images/exit.gif\" alt=\"!\"/> "; echo "**Error! Cannot Connect To Database...** "; echo "This error happens usually when backing up the database, please be patient..."; echo " "; echo "</card>"; echo "</wml>"; exit(); } $brws = explode("/",$HTTP_USER_AGENT); $ubr = $brws[0]; $uip = getip(); $action = $_GET["action"]; $sid = $_GET["sid"]; $page = $_GET["page"]; $who = $_GET["who"]; $uid = getuid_sid($sid); $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'")); $sitename = $sitename[0]; cleardata(); if(isipbanned($uip,$brw)) { if(!isshield(getuid_sid($sid))) { echo "<card id=\"main\" title=\"$sitename\">"; echo " "; echo "<img src=\"../images/notok.gif\" alt=\"x\"/> "; echo "This IP address is blocked "; echo " "; echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over "; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 ")); $remain = $banto[0] - time(); $rmsg = gettimemsg($remain); echo "**Time Left:**$rmsg "; echo " "; echo " "; echo "**Username:** <input name=\"loguid\" format=\"*x\" maxlength=\"20\"/> "; echo "**Password:** <input type=\"password\" name=\"logpwd\" maxlength=\"20\"/> "; echo "<anchor>Login<go href=\"login.php\" method=\"get\">"; echo "<postfield name=\"loguid\" value=\"$(loguid)\"/>"; echo "<postfield name=\"logpwd\" value=\"$(logpwd)\"/>"; echo "</go></anchor>"; echo " Not registered yet? <a href=\"register.php\">Register</a> "; echo "<a href=\"index.php?action=terms&amp;sid=$sid\">Site Rules</a>"; echo " "; echo mobads(); echo " "; $onu = getnumonline(); echo "Members Inside: $onu "; if((strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.XHTML+XML") > 0)||( strpos(strtoupper($HTTP_ACCEPT),"XHTML+XML") > 0)||($ubr=="Mozilla")) {echo " <a href=\"../web/index.php\">Wap 2.0(xhtml) Version</a> ";} echo "**©2006-2007 $sitename**"; echo " "; echo "</card>"; echo "</wml>"; exit(); } } if(($action != "") && ($action!="terms")) { $uid = getuid_sid($sid); if((islogged($sid)==false)||($uid==0)) { echo "<card id=\"main\" title=\"$sitename\">"; echo " "; echo "You are not logged in "; echo "Or Your session has been expired "; echo "<a href=\"index.php\">Login</a>"; echo " "; echo "</card>"; echo "</wml>"; exit(); } } //echo isbanned($uid); if(isbanned($uid)) { echo "<card id=\"main\" title=\"$sitename\">"; echo " "; echo "<img src=\"../images/notok.gif\" alt=\"x\"/> "; echo "**You are Banned** "; $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'")); $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "**Time Left:**$rmsg "; $nick = getnick_uid($banto[2]); echo "**By:**$nick "; echo "**Reason:**$banto[1]"; //echo "<a href=\"index.php\">Login</a>"; echo " "; echo "</card>"; echo "</wml>"; exit(); } $res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'"); ////////////////////////////////////////MAIN PAGE if($action=="main") { addvisitor(); ///////////////////// now for the simple guest access part <?php $bcon = connectdb(); if (!$bcon) { echo "<card id=\"main\" title=\"(ERROR!)\">"; echo " "; echo "<img src=\"../images/exit.gif\" alt=\"!\"/> "; echo "**Error! Cannot Connect To Database...** "; echo "This error happens usually when backing up the database, please be patient..."; echo " "; echo "</card>"; echo "</wml>"; exit(); } $brws = explode("/",$HTTP_USER_AGENT); $ubr = $brws[0]; $uip = getip(); $action = $_GET["action"]; $sid = $_GET["sid"]; $page = $_GET["page"]; $who = $_GET["who"]; $uid = getuid_sid($sid); $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'")); $sitename = $sitename[0]; cleardata(); if(isipbanned($uip,$brw)) { if(!isshield(getuid_sid($sid))) { echo "<card id=\"main\" title=\"$sitename\">"; echo " "; echo "<img src=\"../images/notok.gif\" alt=\"x\"/> "; echo "This IP address is blocked "; echo " "; echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over "; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 ")); $remain = $banto[0] - time(); $rmsg = gettimemsg($remain); echo "**Time Left:**$rmsg "; echo " "; echo " "; echo "**Username:** <input name=\"loguid\" format=\"*x\" maxlength=\"20\"/> "; echo "**Password:** <input type=\"password\" name=\"logpwd\" maxlength=\"20\"/> "; echo "<anchor>Login<go href=\"login.php\" method=\"get\">"; echo "<postfield name=\"loguid\" value=\"$(loguid)\"/>"; echo "<postfield name=\"logpwd\" value=\"$(logpwd)\"/>"; echo "</go></anchor>"; echo " Not registered yet? <a href=\"register.php\">Register</a> "; echo "<a href=\"index.php?action=terms&amp;sid=$sid\">Site Rules</a>"; echo " "; echo mobads(); echo " "; $onu = getnumonline(); echo "Members Inside: $onu "; if((strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.XHTML+XML") > 0)||( strpos(strtoupper($HTTP_ACCEPT),"XHTML+XML") > 0)||($ubr=="Mozilla")) {echo " <a href=\"../web/index.php\">Wap 2.0(xhtml) Version</a> ";} echo "**©2006-2007 $sitename**"; echo " "; echo "</card>"; echo "</wml>"; exit(); } } if(isbanned($uid)) { echo "<card id=\"main\" title=\"$sitename\">"; echo " "; echo "<img src=\"../images/notok.gif\" alt=\"x\"/> "; echo "**You are Banned** "; $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'")); $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "**Time Left:**$rmsg "; $nick = getnick_uid($banto[2]); echo "**By:**$nick "; echo "**Reason:**$banto[1]"; //echo "<a href=\"index.php\">Login</a>"; echo " "; echo "</card>"; echo "</wml>"; exit(); } $res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'"); ////////////////////////////////////////MAIN PAGE if($action=="main") { addvisitor(); //////////////////////////////////////////////////// study that to learn as that will have guest access to all aprts of the script if u put that at the top. as thats how i had guest access working for madfonez ages ago all i did was remove the not logged in part

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

ozziemale31 Lead · 861 posts #6

QUOTE (ozziemale31 @ Jan 22 2009, 02:18 PM) <{POST_SNAPBACK}>

ok here is the normal wml code for the script

<?php include("../blocked.php"); include("config.php"); include("core.php"); //session_start(); header("Content-type: text/vnd.wap.wml"); header("Cache-Control: no-store, no-cache, must-revalidate"); echo "<?xml version=\"1.0\"?>";

echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; ?> <wml>

<?php $bcon = connectdb(); if (!$bcon) { echo "<card id=\"main\" title=\"(ERROR!)\">"; echo " "; echo "<img src=\"../images/exit.gif\" alt=\"!\"/> "; echo "**Error! Cannot Connect To Database...** "; echo "This error happens usually when backing up the database, please be patient..."; echo " "; echo "</card>"; echo "</wml>"; exit(); } $brws = explode("/",$HTTP_USER_AGENT); $ubr = $brws[0]; $uip = getip(); $action = $_GET["action"]; $sid = $_GET["sid"]; $page = $_GET["page"]; $who = $_GET["who"]; $uid = getuid_sid($sid); $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'")); $sitename = $sitename[0]; cleardata(); if(isipbanned($uip,$brw)) { if(!isshield(getuid_sid($sid))) { echo "<card id=\"main\" title=\"$sitename\">"; echo " "; echo "<img src=\"../images/notok.gif\" alt=\"x\"/> "; echo "This IP address is blocked "; echo " "; echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over "; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 ")); $remain = $banto[0] - time(); $rmsg = gettimemsg($remain); echo "**Time Left:**$rmsg "; echo " "; echo " "; echo "**Username:** <input name=\"loguid\" format=\"*x\" maxlength=\"20\"/> "; echo "**Password:** <input type=\"password\" name=\"logpwd\" maxlength=\"20\"/> "; echo "<anchor>Login<go href=\"login.php\" method=\"get\">"; echo "<postfield name=\"loguid\" value=\"$(loguid)\"/>"; echo "<postfield name=\"logpwd\" value=\"$(logpwd)\"/>"; echo "</go></anchor>"; echo " Not registered yet? <a href=\"register.php\">Register</a> "; echo "<a href=\"index.php?action=terms&amp;sid=$sid\">Site Rules</a>"; echo " "; echo mobads(); echo " "; $onu = getnumonline(); echo "Members Inside: $onu "; if((strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.XHTML+XML") > 0)||( strpos(strtoupper($HTTP_ACCEPT),"XHTML+XML") > 0)||($ubr=="Mozilla")) {echo " <a href=\"../web/index.php\">Wap 2.0(xhtml) Version</a> ";} echo "**©2006-2007 $sitename**"; echo " "; echo "</card>"; echo "</wml>"; exit(); } } if(($action != "") && ($action!="terms")) { $uid = getuid_sid($sid); if((islogged($sid)==false)||($uid==0)) { echo "<card id=\"main\" title=\"$sitename\">"; echo " "; echo "You are not logged in "; echo "Or Your session has been expired "; echo "<a href=\"index.php\">Login</a>"; echo " "; echo "</card>"; echo "</wml>"; exit(); } } //echo isbanned($uid); if(isbanned($uid)) { echo "<card id=\"main\" title=\"$sitename\">"; echo " "; echo "<img src=\"../images/notok.gif\" alt=\"x\"/> "; echo "**You are Banned** "; $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'")); $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "**Time Left:**$rmsg "; $nick = getnick_uid($banto[2]); echo "**By:**$nick "; echo "**Reason:**$banto[1]"; //echo "<a href=\"index.php\">Login</a>"; echo " "; echo "</card>"; echo "</wml>"; exit(); } $res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'"); ////////////////////////////////////////MAIN PAGE if($action=="main") { addvisitor(); ///////////////////// now for the simple guest access part <?php $bcon = connectdb(); if (!$bcon) { echo "<card id=\"main\" title=\"(ERROR!)\">"; echo " "; echo "<img src=\"../images/exit.gif\" alt=\"!\"/> "; echo "**Error! Cannot Connect To Database...** "; echo "This error happens usually when backing up the database, please be patient..."; echo " "; echo "</card>"; echo "</wml>"; exit(); } $brws = explode("/",$HTTP_USER_AGENT); $ubr = $brws[0]; $uip = getip(); $action = $_GET["action"]; $sid = $_GET["sid"]; $page = $_GET["page"]; $who = $_GET["who"]; $uid = getuid_sid($sid); $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'")); $sitename = $sitename[0]; cleardata(); if(isipbanned($uip,$brw)) { if(!isshield(getuid_sid($sid))) { echo "<card id=\"main\" title=\"$sitename\">"; echo " "; echo "<img src=\"../images/notok.gif\" alt=\"x\"/> "; echo "This IP address is blocked "; echo " "; echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over "; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 ")); $remain = $banto[0] - time(); $rmsg = gettimemsg($remain); echo "**Time Left:**$rmsg "; echo " "; echo " "; echo "**Username:** <input name=\"loguid\" format=\"*x\" maxlength=\"20\"/> "; echo "**Password:** <input type=\"password\" name=\"logpwd\" maxlength=\"20\"/> "; echo "<anchor>Login<go href=\"login.php\" method=\"get\">"; echo "<postfield name=\"loguid\" value=\"$(loguid)\"/>"; echo "<postfield name=\"logpwd\" value=\"$(logpwd)\"/>"; echo "</go></anchor>"; echo " Not registered yet? <a href=\"register.php\">Register</a> "; echo "<a href=\"index.php?action=terms&amp;sid=$sid\">Site Rules</a>"; echo " "; echo mobads(); echo " "; $onu = getnumonline(); echo "Members Inside: $onu "; if((strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.XHTML+XML") > 0)||( strpos(strtoupper($HTTP_ACCEPT),"XHTML+XML") > 0)||($ubr=="Mozilla")) {echo " <a href=\"../web/index.php\">Wap 2.0(xhtml) Version</a> ";} echo "**©2006-2007 $sitename**"; echo " "; echo "</card>"; echo "</wml>"; exit(); } } if(isbanned($uid)) { echo "<card id=\"main\" title=\"$sitename\">"; echo " "; echo "<img src=\"../images/notok.gif\" alt=\"x\"/> "; echo "**You are Banned** "; $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'")); $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "**Time Left:**$rmsg "; $nick = getnick_uid($banto[2]); echo "**By:**$nick "; echo "**Reason:**$banto[1]"; //echo "<a href=\"index.php\">Login</a>"; echo " "; echo "</card>"; echo "</wml>"; exit(); } $res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'"); ////////////////////////////////////////MAIN PAGE if($action=="main") { addvisitor(); //////////////////////////////////////////////////// study that to learn as that will have guest access to all aprts of the script if u put that at the top. as thats how i had guest access working for madfonez ages ago all i did was remove the not logged in part

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

something else Fellow · 2,296 posts #7

all u gotta do is change this line if(($action != "") && ($action!="terms"))

to something like

if(($action != "") && ($action!="terms")&&($action!="viewtopic"))

AnGELMaE22 Newbie · 4 posts #8

QUOTE (something else @ Jan 22 2009, 03:27 PM) <{POST_SNAPBACK}>

all u gotta do is change this line if(($action != "") && ($action!="terms")) to something like if(($action != "") && ($action!="terms")&&($action!="viewtopic"))

ok thank you ill try dis

Write your reply now; next you create a free account (or sign in) and it is posted right away. 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