Search
Left Quote    I have not failed. I've just found 10,000 ways that won't work.
- Thomas Alva Edison    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: Repost: Help! Comments Script!
  This user is offline  gamernaveen
  Subject: "Repost: Help! Comments Script!" Posted: @ 9:48 am on Mar 31 2008   
Member #: 647
Rank: User - (2)
Since: 03/30/08
Posts: 2

My partner came up with this code.
Couldnt fix it. Anyway please correct all possible errors and when "<? exit();?>&qu ot; or any such php / html code is submitted , the script doesnt show the "invalid chars" error but goes to homepage.

Here is the code:
comBlog.veg (veg is renamed php extension)

Code:

<?php
session_start() ;
include("c onf.veg");
/*As this script includes location headers , we dont want header errors. Thus off logging.*/
//assume we connected to the db
/* END OF CONNECTING */
include(". ./admod/embedad .veg");
include(". ./externaltools /stringsv1.php& quot;);
include(". ./externaltools /bbcode_parserv 1.php"); include(". ./login/loginmo d.veg");
$loggeduser=$_S ESSION['logged' ];
$blog=$_GET['bl og_xSCLIENT_Bro wser'];
$initpage=$_GET ['xDisp_sid'];< br /> $mode=$_GET['AD DBLOG'];
$comment=strip_ tags($_POST['co mment']);
function errorq($error,$ flood)
{
echo"
<!DOCTYPE html PUBLIC '-//WAPFORUM//D TD XHTML Mobile 1.0//EN' 'http://www.wap forum.org/DTD/x html-mobile10.d td'>
<html>
<head>
<meta http-equiv='Cac he-Control' content='min-ag e:0'/>
<title>Bl og</title> ;
<link href='../../res ources/main.css ' rel='stylesheet ' type='text/css' />
</head> <body>
<div class='main'> ;
<div class='ad'>< br /> "; echo retAd(); echo "
</div>
<div class='logo'> ;
<img src='../../reso urces/smalllogo .PNG' alt='Vegetarian Cooking' height='46' width='110'/> ;
</div>
<div class='boldgree n'>
<img src='./icons/bl og.gif' height='16' width='16'/> The Blog<br/>
</div>
<div class='hr'>< br /> &nbsp;
</div>
<div class='boldgree n'>"; if($flood==1){e cho "
<img src='./icons/fl ood.gif' height='16' width='16'/> -Flood Control:<br/ >";
}else{echo" ;<img src='./icons/bu g.png' height='16' width='16'/> -Oops!<br/&g t;";}
echo"
<div class='nav1'> ;";
if(!empty($erro r))
{ echo $error;} else
{echo "
We'v just run over by a bug!<br/>
Just give us some time to fix it.<br/>< br /> Sorry for the inconvenience .<br/>
Go to <a href='http://ve getariancooking .mobi/'>[Hom e]</a> to return.<br/& gt;";
}
echo "
</div>< ;/div>
<div class='hr'>< br /> &nbsp;
</div>
<div class='nav1'> ;<img src='./icons/ar row2-left.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi/modules/b log/'>[Back] </a><b r/>
";footerme nu(); echo"<i mage src='./icons/ho me.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi'>[Home ]</a>< br/>
Some Rights Reserved<br/ >
Copyright (c) 2008
</div>< ;/div></b ody></htm l>";
}
if($blog==NULL| |empty($blog)){
errorq("Yo u have tried to access a<br/>
location which isnt supposed<br/ >
to be directly accessed.<br />
Go back and use provided links.<br/&g t;");exit( );}
if($mode==" ;TRUE")
{
if(!islogged()) {errorq("Y ou have not logged in.<br/>Y ou must login before<br/&g t;you can add comments.<br />
<img src='http://veg etariancooking. mobi/modules/lo gin/icons/key.g if' height='16' width='16'/>
<a href='http://ve getariancooking .mobi/modules/l ogin/'>[Logi n]</a>< ;br/>
<img src='http://veg etariancooking. mobi/modules/si gnup/icons/btn- plus.gif' height='16' width='16'/>
<a href='http://ve getariancooking .mobi/modules/s ignup/'>[Sig nup]</a>& quot;);exit();}
echo "
<!DOCTYPE html PUBLIC '-//WAPFORUM//D TD XHTML Mobile 1.0//EN' 'http://www.wap forum.org/DTD/x html-mobile10.d td'>
<html>
<head>
<meta http-equiv='Cac he-Control' content='min-ag e:0'/>
<title>Bl og</title> ;
<link href='../../res ources/main.css ' rel='stylesheet ' type='text/css' />
</head> <body>
<div class='main'> ;
<div class='ad'>< br /> ";echo retAd(); echo"
</div>
<div class='logo'> ;
<img src='../../reso urces/smalllogo .PNG' alt='Vegetarian Cooking' height='46' width='110'/> ;
</div>
<div class='boldgree n'>
<img src='./icons/bl og.gif' height='16' width='16'/> The Blog<br/>
</div>
<div class='hr'>& amp;nbsp;</d iv>
<div class='basicomm entform'>
<form name='basic' action='./comBl og.veg?blog_xSC LIENT_Browser=$ blog&amp;AD DBLOG=TRUE.SAVE '
method='POST'&g t;
*Add Comment:<br/ >
(Max 99 chars)<br/&g t;
<input type='text' name='comment' maxlength='99'/ ><br/>
<input type='submit' name='submitcom ment' value=' Save '/></form >
*Mandatory<b r/>
<img src='./icons/fo rmatting.gif' height='16' width='16'/>
<a href='./comBlog .veg?blog_xSCLI ENT_Browser=$bl og&amp;ADDB LOG=FORMATTING' >[Formatting ]</a>< br/><img src='./icons/ad vanced.gif' height='16' width='16'/>
<a href='./comBlog .veg?blog_xSCLI ENT_Browser=$bl og&amp;ADDB LOG=TRUE.ADV'&g t;[Advanced HTML]</a> <br/>
</div>
<div class='hr'>< br /> &nbsp;
</div>
<img src='./icons/ar row2-left.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi/modules/b log/comBlog.veg ?blog_xSCLIENT_ Browser=$blog'& gt;[Back]</a >
<div class='hr'>& amp;nbsp;</a ><div class='nav1'> ;
Some Rights Reserved<br/ >
Copyright (c) 2008
</div>< ;/div>
</body> </html>&q uot;;
exit();
}
if($mode==" ;TRUE.ADV" )
{
if(!islogged()) {errorq("Y ou have not logged in.<br/>Y ou must login before<br/&g t;you can add comments.<br />
<img src='http://veg etariancooking. mobi/modules/lo gin/icons/key.g if' height='16' width='16'/>
<a href='http://ve getariancooking .mobi/modules/l ogin/'>[Logi n]</a>< ;br/>
<img src='http://veg etariancooking. mobi/modules/si gnup/icons/btn- plus.gif' height='16' width='16'/>
<a href='http://ve getariancooking .mobi/modules/s ignup/'>[Sig nup]</a>& quot;);exit();}
echo "
<!DOCTYPE html PUBLIC '-//WAPFORUM//D TD XHTML Mobile 1.0//EN' 'http://www.wap forum.org/DTD/x html-mobile10.d td'>
<html>
<head>
<meta http-equiv='Cac he-Control' content='min-ag e:0'/>
<title>Bl og</title> ;
<link href='../../res ources/main.css ' rel='stylesheet ' type='text/css' />
</head> <body>
<div class='main'> ;
<div class='ad'>< br /> ";echo retAd(); echo"
</div>
<div class='logo'> ;
<img src='../../reso urces/smalllogo .PNG' alt='Vegetarian Cooking' height='46' width='110'/> ;
</div>
<div class='boldgree n'>
<img src='./icons/bl og.gif' height='16' width='16'/> The Blog<br/>
</div>
<div class='hr'>& amp;nbsp;</d iv>
<div class='advanced commentform'> ;
<form name='basic' action='./comBl og.veg?blog_xSC LIENT_Browser=$ blog&amp;AD DBLOG=TRUE.ADV. SAVE'
method='POST'&g t;
*Add Comment:<br/ >
(Max 99 chars)<br/&g t;
<textarea name='comment' rows='3' cols='12' maxlength='99'& gt;</textare a><br/> ;
<input type='submit' name='submitcom ment' value=' Save '/></form >
*Mandatory<b r/>
<img src='./icons/fo rmatting.gif' height='16' width='16'/>
<a href='./comBlog .veg?blog_xSCLI ENT_Browser=$bl og&amp;ADDB LOG=FORMATTING. ADV'>[Format ting]</a> <br/>< img src='./icons/ba sic.gif' height='16' width='16'/>
<a href='./comBlog .veg?blog_xSCLI ENT_Browser=$bl og&amp;ADDB LOG=TRUE'>[B asic HTML]</a> <br/>
</div>
<div class='hr'>< br /> &nbsp;
</div>
<img src='./icons/ar row2-left.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi/modules/b log/comBlog.veg ?blog_xSCLIENT_ Browser=$blog'& gt;[Back]</a >
<div class='hr'>& amp;nbsp;</a ><div class='nav1'> ;
Some Rights Reserved<br/ >
Copyright (c) 2008
</div>< ;/div>
</body> </html>&q uot;;
exit();
}
if($mode==" ;FORMATTING&quo t;||$mode==&quo t;FORMATTING.AD V")
{
if(!islogged()) {errorq("Y ou have not logged in.<br/>Y ou must login before<br/&g t;you can add comments.<br />
<img src='http://veg etariancooking. mobi/modules/lo gin/icons/key.g if' height='16' width='16'/>
<a href='http://ve getariancooking .mobi/modules/l ogin/'>[Logi n]</a>< ;br/>
<img src='http://veg etariancooking. mobi/modules/si gnup/icons/btn- plus.gif' height='16' width='16'/>
<a href='http://ve getariancooking .mobi/modules/s ignup/'>[Sig nup]</a>& quot;);exit();}
echo "
<!DOCTYPE html PUBLIC '-//WAPFORUM//D TD XHTML Mobile 1.0//EN' 'http://www.wap forum.org/DTD/x html-mobile10.d td'>
<html>
<head>
<meta http-equiv='Cac he-Control' content='min-ag e:0'/>
<title>Bl og</title> ;
<link href='../../res ources/main.css ' rel='stylesheet ' type='text/css' />
</head> <body>
<div class='main'> ;
<div class='ad'>< br /> ";echo retAd(); echo"
</div>
<div class='logo'> ;
<img src='../../reso urces/smalllogo .PNG' alt='Vegetarian Cooking' height='46' width='110'/> ;
</div>
<div class='boldgree n'>
<img src='./icons/bl og.gif' height='16' width='16'/> The Blog<br/>
</div>
<div class='hr'>& amp;nbsp;</d iv>
<div class='boldgree n'>
<img src='./icons/fo rmatting.gif' height='16' width='16'/> Formatting</ div>
<font color='#669966' >&#187;T ext formatting:< /font><br />Bold:[B] <b>- Text -</b> [EB]<br/> Italic:[I]<i >- Text -</i>[EI] <br/>
Underline:[U]&l t;u>- Text -</u>[EU] <br/>
<font color='#669966' >&#187;F ont Colors:</fon t><br/> ;[C=BLUE]<fo nt color='blue'> ;- Text -</font>[ EC]<br/>< br /> <font color='#669966' >&#187;S mileys:</fon t><br/> ;:) , ;) , :D , :P , :(<br/> <div class='hr'>< br /> &nbsp;
</div>&qu ot;;
if($mode==" ;FORMATTING&quo t;){echo "
<img src='./icons/ar row2-left.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi/modules/b log/comBlog.veg ?blog_xSCLIENT_ Browser=$blog&a mp;amp;ADDBLOG= TRUE'>[Back] </a>" ;;
}if($mode==&quo t;FORMATTING.AD V"){echo "
<img src='./icons/ar row2-left.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi/modules/b log/comBlog.veg ?blog_xSCLIENT_ Browser=$blog&a mp;amp;ADDBLOG= TRUE.ADV'>[B ack]</a>& quot;;
}echo "
<div class='hr'>& amp;nbsp;</a ><div class='nav1'> ;
Some Rights Reserved<br/ >
Copyright (c) 2008
</div>< ;/div>
</body> </html>&q uot;;
exit();
}
if($mode==" ;TRUE.SAVE" ;||$mode==" ;TRUE.ADV.SAVE& quot;)
{
$comments=strip _tags($comments );
echo $comments;
if(!islogged()) {errorq("Y ou have not logged in.<br/>Y ou must login before<br/&g t;you can add comments.<br />
<img src='http://veg etariancooking. mobi/modules/lo gin/icons/key.g if' height='16' width='16'/>
<a href='http://ve getariancooking .mobi/modules/l ogin/'>[Logi n]</a>< ;br/>
<img src='http://veg etariancooking. mobi/modules/si gnup/icons/btn- plus.gif' height='16' width='16'/>
<a href='http://ve getariancooking .mobi/modules/s ignup/'>[Sig nup]</a>& quot;);exit();}
$res=mysql_quer y("SELECT * FROM adminsettings WHERE 1") or die(mysql_error ());
$bench=mysql_fe tch_array($res) or die(mysql_error ());
$floodcontrol=$ bench['blog_com ments_flood'];< br /> $intervalsec=$b ench['blog_comm ents_flood_inte rval'];
if($floodcontro l==NULL||empty( $floodcontrol)) {$floodcontrol= "Yes" ;}
if($intervalsec ==NULL||empty($ intervalsec)){$ intervalsec=30; /*default*/}
if($floodcontro l=="Yes&qu ot;)
{
$ip=getenv(&quo t;REMOTE_ADDR&q uot;);
//try to prevent multiple posts and flooding...
$c = "SELECT * from `tastes_comment s` WHERE ip ='$ip'"; $c2 = mysql_query($c) ;
while($c3 = mysql_fetch_obj ect($c2)) {
$difference = time() - $c3->time; if($difference < $intervalsec){< br /> $queue=$interva lsec-$differenc e; die(errorq(&quo t;You have already commented. <br/>To comment more, please wait.<br/> ;</div>Qu eue time : $queue seconds<div class='nav1'> ;
Have a big opinion?<br/ >pls contact the blogger.", 1));}
} //end while
}
if($comment==NU LL||empty($comm ent)||$comment= =""|| check_splchars_ comment($commen t)||strlen($com ment)>99||st rlen($comment)& lt;3)
{
if(check_splcha rs_comment($com ment)){$errorpa d="Only A-Z,a-z,0-9 chars allowed";}
if(strlen($comm ent)>99){$er rorpad="Co mment is too long.(Max 99 chars)<br/&g t;Msg/Email your comment to admin.";}< br /> if(strlen($comm ent)<3){$err orpad="Com ment is too low.(Max 3 chars)";}< br /> if($comment==NU LL||empty($comm ent)||$comment= =""){ $errorpad=" ;Type in a comment";}
if($mode==" ;TRUE.SAVE.ADV& quot;){
echo "
<!DOCTYPE html PUBLIC '-//WAPFORUM//D TD XHTML Mobile 1.0//EN' 'http://www.wap forum.org/DTD/x html-mobile10.d td'>
<html>
<head>
<meta http-equiv='Cac he-Control' content='min-ag e:0'/>
<title>Bl og</title> ;
<link href='../../res ources/main.css ' rel='stylesheet ' type='text/css' />
</head> <body>
<div class='main'> ;
<div class='ad'>< br /> ";echo retAd(); echo"
</div>
<div class='logo'> ;
<img src='../../reso urces/smalllogo .PNG' alt='Vegetarian Cooking' height='46' width='110'/> ;
</div>
<div class='boldgree n'>
<img src='./icons/bl og.gif' height='16' width='16'/> The Blog<br/>
</div>
<div class='hr'>& amp;nbsp;</d iv>
<div class='advanced ommentform'>
<form name='basic' action='./comBl og.veg?blog_xSC LIENT_Browser=$ blog&amp;AD DBLOG=TRUE.ADV. SAVE'
method='POST'&g t;
<div class='boldgree n'>$errorpad </div>
*Add Comment:<br/ >
<textarea name='comment' rows='3' cols='12' maxlength='99'& gt;</textare a><br/> ;
<input type='submit' name='submitcom ment' value=' Save '/></form >
*Mandatory<b r/>
<img src='./icons/fo rmatting.gif' height='16' width='16'/>
<a href='./comBlog .veg?blog_xSCLI ENT_Browser=$bl og&amp;ADDB LOG=FORMATTING. ADV'>[Format ting]</a> <br/>< img src='./icons/ba sic.gif' height='16' width='16'/>
<a href='./comBlog .veg?blog_xSCLI ENT_Browser=$bl og&amp;ADDB LOG=TRUE'>[B asic HTML]</a> <br/>
</div>
<div class='hr'>< br /> &nbsp;
</div>
<img src='./icons/ar row2-left.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi/modules/b log/comBlog.veg ?blog_xSCLIENT_ Browser=$blog'& gt;[Back]</a >
<div class='hr'>& amp;nbsp;</a ><div class='nav1'> ;
Some Rights Reserved<br/ >
Copyright (c) 2008
</div>< ;/div>
</body> </html>&q uot;;
exit();}else{ echo "
<!DOCTYPE html PUBLIC '-//WAPFORUM//D TD XHTML Mobile 1.0//EN' 'http://www.wap forum.org/DTD/x html-mobile10.d td'>
<html>
<head>
<meta http-equiv='Cac he-Control' content='min-ag e:0'/>
<title>Bl og</title> ;
<link href='../../res ources/main.css ' rel='stylesheet ' type='text/css' />
</head> <body>
<div class='main'> ;
<div class='ad'>< br /> ";echo retAd(); echo"
</div>
<div class='logo'> ;
<img src='../../reso urces/smalllogo .PNG' alt='Vegetarian Cooking' height='46' width='110'/> ;
</div>
<div class='boldgree n'>
<img src='./icons/bl og.gif' height='16' width='16'/> The Blog<br/>
</div>
<div class='hr'>& amp;nbsp;</d iv>
<div class='basicomm entform'>
<form name='basic' action='./comBl og.veg?blog_xSC LIENT_Browser=$ blog&amp;AD DBLOG=TRUE.SAVE '
method='POST'&g t;<div class='boldgree n'>$errorpad </div>
*Add Comment:<br/ >
(Max 99 chars)<br/&g t;
<input type='text' name='comment' maxlength='99'/ ><br/>
<input type='submit' name='submitcom ment' value=' Save '/></form >
*Mandatory<b r/>
<img src='./icons/fo rmatting.gif' height='16' width='16'/>
<a href='./comBlog .veg?blog_xSCLI ENT_Browser=$bl og&amp;ADDB LOG=FORMATTING' >[Formatting ]</a>< br/><img src='./icons/ad vanced.gif' height='16' width='16'/>
<a href='./comBlog .veg?blog_xSCLI ENT_Browser=$bl og&amp;ADDB LOG=TRUE.ADV'&g t;[Advanced HTML]</a> <br/>
</div>
<div class='hr'>< br /> &nbsp;
</div>
<img src='./icons/ar row2-left.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi/modules/b log/comBlog.veg ?blog_xSCLIENT_ Browser=$blog'& gt;[Back]</a >
<div class='hr'>& amp;nbsp;</a ><div class='nav1'> ;
Some Rights Reserved<br/ >
Copyright (c) 2008
</div>< ;/div>
</body> </html>&q uot;;exit();} }
$comment=string bbcodemasala($c omment);
$comment=bbcode _to_xhtml($comm ent);
$dateadd=date(' D : F , y');
$ip=getenv(&quo t;REMOTE_ADDR&q uot;);
$user=$_SESSION ['logged'];
$nowtime=time() ;
$qadd="INS ERT INTO tastes_comments (user, date, type, body, ip,res_id,time) VALUES ('".mysql_ real_escape_str ing($user).&quo t;', '".mysql_r eal_escape_stri ng($dateadd).&q uot;',
'blog','". mysql_real_esca pe_string($comm ent)."','& quot;.mysql_rea l_escape_string ($ip)."',' ".mysql_re al_escape_strin g($blog)." ',$nowtime)&quo t;;
mysql_query($qa dd) or die(mysql_error ());
header("Lo cation:http://v egetariancookin g.mobi/modules/ blog/comBlog.ve g?blog_xSCLIENT _Browser=$blog& quot;);
exit();
}
if($mode!==&quo t;TRUE.ADD" ;||$mode!==&quo t;TRUE.ADV.SAVE "||$mode!= ="TRUE.SAV E"||$mode! =="TRUE.AD V"||
$mode!=="F ORMATTING" ||$mode!==" ;FORMATTING.ADV "){
if(islogged()){ $addcomment=&qu ot;<img src='./icons/ad dcomment.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi/modules/b log/comBlog.veg ?
blog_xSCLIENT_B rowser=$blog&am p;amp;ADDBLOG=T RUE'>[Add Comment]</a& gt;<br/>& quot;;}
if($blog==NULL) {errorq("Y ou have tried to access a<br/>
location which isnt supposed<br/ >
to be directly accessed.<br />
Go back and use provided links.<br/&g t;");
exit();}
if(islogged()) {
$usr=$SESSION[' logged'];
}
if(empty($initp age)||!is_numer ic($initpage)|| $initpage<1) {$initpage=1;}
//Recieve admin settings
$adminset= mysql_query(&qu ot;SELECT * FROM `adminsettings` WHERE 1") or die(mysql_error ());
$adminsetrow= mysql_fetch_arr ay($adminset) or die(mysql_error ());
$limit=$adminse trow['blog_comm ents_limit']; $order=$adminse trow['blog_comm ents_order']; $access=$admins etrow['blog_com ments'];
if($access==&qu ot;No"){er rorq('The Administrater has disabled<br/ >the comment feature for blogs.');exit() ;}
if($limit==NULL ){$limit=4;}if( $order==NULL||e mpty($order)){$ order="DES C";}
$uinfo = mysql_query(&qu ot;SELECT * FROM `blog` WHERE id='".mysq l_real_escape_s tring($blog).&q uot;'") or die(mysql_error ());
//see if the blogs exist
$checkblogs = @mysql_num_rows ($uinfo);
//if user name not found in database error
if($checkblogs == '0')
{
errorq("Yo u have tried to access a<br/>
location which isnt supposed<br/ >
to be directly accessed.<br />
Go back and use provided links.<br/&g t;");
exit();
}
$start=($initpa ge-1)*$limit; $pageno=$initpa ge;
$q="SELECT * FROM `tastes_comment s` WHERE type='blog' AND res_id='". mysql_real_esca pe_string($blog )."' ORDER BY user $order LIMIT $start,$limit&q uot;;
$resourceq=mysq l_query($q) or die(mysql_error ());
$checkcomments = @mysql_num_rows ($resourceq); $resourcer=mysq l_query("S ELECT * FROM `tastes_comment s` WHERE type='blog' AND res_id='". mysql_real_esca pe_string($blog )."'" );
$totalcomments= @mysql_num_rows ($resourcer); $totalpages = ceil($totalcomm ents/$limit); if($totalpages& gt;$totalcommen ts)
{$totalpages=&q uot;some"; }
if($totalpages= =$totalcomments &&$limi t>1)
{$totalpages=&q uot;some"; }
if($totalpages= =0){$totalpages ="1"; }

if(is_numeric($ pageno)){$pagen ocode="$pa geno of $totalpages Pages";} else{$pagenocod e="$pageno page of $totalpages&quo t;;}
$next=$initpage +1;
$prev=$initpage -1;
$nextcode=" ;<a href='http://ve getariancooking .mobi/modules/b log/comBlog.veg ?blog_xSCLIENT_ Browser=$blog&a mp;amp;xDisp_si d=$next'>&am p;#187;Next |</a>&quo t;;
$prevcode=" ;<a href='http://ve getariancooking .mobi/modules/b log/comBlog.veg ?blog_xSCLIENT_ Browser=$blog&a mp;amp;xDisp_si d=$prev'> &#171;Prev& lt;/a>" ;
if($prev<1){ $prevcode=" ;";}
$pagecode=$next code.$prevcode;
$pagenocode=str _replace(" 1 of 1 Pages",&qu ot;1 of 1 page",$pag enocode);

//if user name not found in database error
if($checkcommen ts == '0')
{
echo"
<!DOCTYPE html PUBLIC '-//WAPFORUM//D TD XHTML Mobile 1.0//EN' 'http://www.wap forum.org/DTD/x html-mobile10.d td'>
<html>
<head>
<meta http-equiv='Cac he-Control' content='min-ag e:0'/>
<title>Bl og</title> ;
<link href='../../res ources/main.css ' rel='stylesheet ' type='text/css' />
</head> <body>
<div class='main'> ;
<div class='ad'>< br /> "; echo retAd(); echo"
</div>
<div class='logo'> ;
<img src='../../reso urces/smalllogo .PNG' alt='Vegetarian Cooking' height='46' width='110'/> ;
</div>
<div class='boldgree n'>
<img src='./icons/bl og.gif' height='16' width='16'/> The Blog<br/>
</div>
<div class='results' >";
echo "Page $initpage" ;echo"
</div>
<div class='nav1'> ; There are no comments in this page.</div&g t;";
if($prevcode!== ''){
echo"
<div class='results' style='color:wh ite;'>$prevc ode</div> ";}
else{echo "<div class='hr'>& amp;nbsp;</d iv>";}e cho"
<div class='nav1'> ;$addcomment< ;img src='./icons/ar row2-left.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi/modules/b log/showBlog.ve g?
blog_xSCLIENT_B rowser=$blog'&g t;[Back]</a& gt;<br/>& lt;div class='hr'>& amp;nbsp;</d iv>
";footerme nu(); echo"<i mg src='./icons/ho me.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi'>[Home ]</a>< br/>
Some Rights Reserved<br/ >
Copyright (c) 2008
</div>< ;/div>
</body> </html>&q uot;;
exit();
}
if($checkblogs! =='0'&& $checkusers!==' 0'&&$ac cess!=='NO')
{
echo"
<!DOCTYPE html PUBLIC '-//WAPFORUM//D TD XHTML Mobile 1.0//EN' 'http://www.wap forum.org/DTD/x html-mobile10.d td'>
<html>
<head>
<meta http-equiv='Cac he-Control' content='min-ag e:0'/>
<title>Bl og</title> ;
<link href='../../res ources/main.css ' rel='stylesheet ' type='text/css' />
</head> <body>
<div class='main'> ;
<div class='ad'>< br /> "; echo retAd(); echo"
</div>
<div class='logo'> ;
<img src='../../reso urces/smalllogo .PNG' alt='Vegetarian Cooking' height='46' width='110'/> ;
</div>
<div class='boldgree n'>
<img src='./icons/bl og.gif' height='16' width='16'/> The Blog<br/>
</div>
<div class='results' >
$pagenocode
</div>&qu ot;;if($totalco mments>1){ec ho "$totalcom ments Comments"; }else{echo "$totalcom ments Comment";} echo "<br/&g t;
";
while($row=@mys ql_fetch_array( $resourceq))
{
$count++;
$user=$row['use r'];
$date=$row['dat e'];
$last=$row['las tmodified'];
$comment=$row[' body'];
if($count>99 ){$count=" *";}
$blogbody=wordw rap($blogbody,2 5,"<br/ >");
if($checkcommen ts<$limit){$ limit=$checkcom ments;}
if(strlen($comm ent)>100)
{
$comment=substr ($blogbody,0,99 );
$comment.=" ;.(stripped)&qu ot;;
}
if($count==$lim it)
{
echo "&#187 ;$count.<a href='http://ve getariancooking .mobi/modules/p rofiles/showPro file.veg?user=$ user'>$user& lt;/a><br />$date<b r/>
$comment<div class='results' style='color:wh ite;'>$pagec ode</div> ";
}else{
echo "&#187 ;$count.<a href='http://ve getariancooking .mobi/modules/p rofiles/showPro file.veg?user=$ user'>$user& lt;/a><br />$date<b r/>
$comment<div class='hr'>& amp;nbsp;</d iv>";}< br /> }
echo "<div class='nav1'> ;$addcomment< ;img src='./icons/ar row2-left.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi/modules/b log/showBlog.ve g?
blog_xSCLIENT_B rowser=$blog'&g t;[Back]</a& gt;<br/>& lt;div class='hr'>& amp;nbsp;</d iv>
";footerme nu(); echo"<i mg src='./icons/ho me.gif' height='16' width='16'/> <a href='http://ve getariancooking .mobi'>[Home ]</a>< br/>
Some Rights Reserved<br/ >
Copyright (c) 2008
</div>< ;/div>
</body> </html>&q uot;;
}
else
{
mysql_error();< br /> }
}
?>



stringsv1.veg
Code:

<?
function isvalid_email($ email) {
if (!ereg("^[ ^@]{1,64}@[^@]{ 1,255}$", $email)) {
return 0;
}
$email_array = explode("@ ", $email);
$local_array = explode(". ", $email_array[0] );
for ($i = 0; $i < sizeof($local_a rray); $i++) {
if (!ereg("^( ([A-Za-z0-9!#$% &'*+/=?^_`{ |}~-][A-Za-z0-9 !#$%&'*+/=? ^_`{|}~\.-]{0,6 3})|(\"[^( \\|\")]{0, 62}\"))$&q uot;, $local_array[$i ])) {
return 0;
}
}
if (!ereg("^\ [?[0-9\.]+\]?$& quot;, $email_array[1] )) {
$domain_array = explode(". ", $email_array[1] );
if (sizeof($domain _array) < 2) {
return 0;
}
for ($i = 0; $i < sizeof($domain_ array); $i++) {
if (!ereg("^( ([A-Za-z0-9][A- Za-z0-9-]{0,61} [A-Za-z0-9])|([ A-Za-z0-9]+))$& quot;, $domain_array[$ i])) {
return 0;
}
}
}
return 1;
}
function cleanspecial($t ext)
{
//$text=strtolo wer($text);
$code_entities_ match = array(' ',' ','--','&qu ot;','!','@','# ','$','%','^',' &','*','(', ')','_','+','{' ,'}','|',':','& quot;','<',' >','?','[',' ]','\\',';',&qu ot;'",',', '.','/','*','+' ,'~','`','=','- ');
$code_entities_ replace = array(' ',' ','','','','',' ','','','','',' ','','','','',' ','','','','',' ','','','','',' ','');
$text = str_replace($co de_entities_mat ch, $code_entities_ replace, $text);
return $text;
}
function stringbbcodemas ala($resource2)
{
$code_entities_ match = array(' ',' ','--','&qu ot;','!','','#' ,'$','%','^','& amp;','*','(',' )','_','+','{', '}','|',':','&q uot;','<','& gt;','?','','', '\\',';'," '",',','.' ,'','*','+','~' ,'`','=','-');
$code_entities_ replace = array(' ',' ','','','','',' ','','','','',' ','','','','',' ','','','','',' ','','','','',' ','');
$resource2 = str_replace($co de_entities_mat ch, $code_entities_ replace, $resource2);
$resource2=adds lashes($resourc e2); //Add slashes
$resource2=stri p_tags($resourc e2); //remove html - php tags
return $resource2;
}

function check_splchars_ comment($resour ceq)
{
if(preg_match(' /^[0-9a-z_]+$/i ', $resourceq)){ return 1;
}
else
{return 0;}}

function uniquecode()
{
//creates a unique ID with a random number as a prefix
$c = uniqid (rand (),true);
//this md5 encrypts the username from above, so its ready to be stored in your database
$md5c = md5($c);
return $md5c;
}
?>



Please help guys this is urgent.
Thanks so much.


    Viewed: 4,484 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Repost: Help! Comments Script!" Posted: @ 12:39 am on Apr 03 2008    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

I dont think your post is too clear on what the problem is exactly. What should it do, and what is it doing instead?




-bs0d | AllSyntax.com

    Viewed: 4,414 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register








"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank