Jump to content

rcorlew

Members
  • Posts

    307
  • Joined

  • Last visited

    Never

Everything posted by rcorlew

  1. I would have to echo Mark's comments, header image needs a little tweaking, but as long as you don't overdue all the content per-page ratio, I think you should have a solid site!
  2. I think that I have the site done and ready for launch. I want to make sure that all is well before we go live and there are not any errors on it. <a href="http://www.corlewland.com/church">Here</a> is the link. Let me know of any errors please and thank you.
  3. Well I just can't win for loosing can I?? It is hard to test on php5 and then deploy on php 4, since there are many sanitizing functions built into 5 and do not exist on 4.
  4. Thanks for all the help!! I will set my 404 page, I've just been a lil' lazy. I am working on the final page template now, so it should be up this weekend!
  5. Ok try those links up there again, I don't understand why it stopped IE but not Firefox
  6. I cannot get them to do that now, how is that possible???? Interesting, it only does it on my Firefox, not IE!!
  7. You need an output string even if you don't use it. Here is the code for you to use: <?php //-------REVERSE UTF8 STRING FUNCTION------------------ function utf8_strrev($str){ preg_match_all('/./us', $str, $ar); return join('',array_reverse($ar[0])); } //------END REVERSE UTF8 STRING FUNCTION--------------- //-------------------------------------IMAGE_READY FUNCTION------------------------------------------------------------- function image_ready($string) { //hebrew character pattern $hepattern[] = "&#1511;"; $hepattern[] = "&#1512;"; $hepattern[] = "&#1488;"; $hepattern[] = "&#1496;"; $hepattern[] = "&#1493;"; $hepattern[] = "&#1503;"; $hepattern[] = "&#1501;"; $hepattern[] = "&#1508;"; $hepattern[] = "&#1513;"; $hepattern[] = "&#1491;"; $hepattern[] = "&#1490;"; $hepattern[] = "&#1499;"; $hepattern[] = "&#1506;"; $hepattern[] = "&#1497;"; $hepattern[] = "&#1495;"; $hepattern[] = "&#1500;"; $hepattern[] = "&#1498;"; $hepattern[] = "&#1507;"; $hepattern[] = "&#1494;"; $hepattern[] = "&#1505;"; $hepattern[] = "&#1489;"; $hepattern[] = "&#1492;"; $hepattern[] = "&#1504;"; $hepattern[] = "&#1502;"; $hepattern[] = "&#1510;"; $hepattern[] = "&#1514;"; $hepattern[] = "&#1509;"; //$stringarray = preg_split("/[\s,]+/", $string); $stringarray = explode(" ", $string); foreach ($stringarray as $key => $value) { $word = $value; //new stuff below if ((preg_match($hepattern, $useless, $word)) == TRUE) { // new -- added output string $useless $newarray[] = utf8_strrev($word); //nothing new } //all old stuff below else { $newarray[] = $word; } //end foreach statement } $imagestring = implode(" ", $newarray); //end function } //----------------------------------------END IMAGE_READY FUNCTION----------------------------------------------------------- $string = "this is english, &#1495;&#1491;&#1513;&#1497;&#1501; &#1511;&#1489;&#1510;&#1497;&#1501;"; image_ready($string); ?>
  8. I don't know if this is the best way, here is what I am using at the moment to stop most of it, <?php $num_m = preg_match("[href|</A>|</a>|<]", $_SERVER['QUERY_STRING'], $z1, PREG_OFFSET_CAPTURE); if($num_m >= 1){ exit(); } ?> //Rest of page in new <?php ?> brackets I will keep adding stuff to the match as it besomes clear, but I think that should catch most of it.
  9. I think that I fixed that, give it another try, I never thought of that, thanks for the heads up.
  10. I used the sql dump from php bible.org, and of course linked back to it with saying that is where I got the sql db from. I coded it all myself though. The calendar was one of the biggest things to get done, also are the prayer requests, and the part you cannot see is a cpanel I coded from scratch to give full control of the site. I am glad to hear that it did not break, just to make it more interesting try fiddling around with the prayer request part, using cusswords and stuff, I think that I banned the big ones, but I cannot say for sure. I tried blocking xss, whatever that actually is(I stripped everything out and banned most characters) I hope that is good enough.
  11. That's really quite a system you have there, I would only recomend rewriting the whole thing all over again just to make sure you remeber how. Just kidding, it took a minute to figure out how to get around, but once I overcame that it was very intuitive.
  12. Here is the link, it is set to go live soon, please let me know of any errors. http://www.corlewland.com/church Thanks.
  13. I use a 'user_level' to do things like that. Set the session/cookie variables to store user_level along with all the other stuff you need to pass along. the code would look something like this assuming you use sql you can just add another column to your user table that would set user level. user_level1 = admin user_level2 = helper user_level3 = user <?php if($user_level == 1) { //This would be the top admin area include"admin.php"; } if($user_level == 2) { //This could be a helper type area include"helper.php"; } if($user_level == 3) { //This would be a regular user area include"user.php"; } ?>
  14. It is a tinint column, it returns only the first result, the result can be different based on the first number in the string, is there something like CHAR() or smething I can try
  15. Okay, I am having problems with querying my db by multiple id(s). To clarify more, I am trying to match the id of each row to an array that has been formatted into a string seperated by commas. Here is my code to see if anyone can help. <?php $str = "1,2,3,4"; $query = "SELECT * FROM table WHERE p_id = IN($str)"; ?>
  16. I have been working on just the same thing for the last day with some success until I stopped handling words as absolute array values since people could change capitalization within words and the like. So here is what I made, it is pretty simple but it catches all variants. I assume you have mySql and know how to connect. <?php //Set up string to have all your variables to be parsed seperated only by a regular space no commas $p_string = "$pa $pb $pc $pd"; //Split all posted words into single words to compare against bannned words $a11 = preg_split("/[\s,]+/", $p_string, -1, PREG_SPLIT_NO_EMPTY); foreach($a11 as $z21); $con = mysql_connect($HOST, $USER, $PASS); if (!$con) { die("Error connecting to MySQL database!"); } mysql_select_db($NAME, $con); //Here I query the 'table' for the 'column' $query = mysql_query("SELECT * FROM badwords WHERE cussword LIKE '%$z21%'"); $num_rows = mysql_num_rows($query); if ($num_rows >= "1") { $message = "<h3 align='center'>This is a place for communicating, please rethink what you are submitting and try again</h3>"; //Here I unset all variables to fail the next validation and make them fill the form out again unset($pa, $pb, $pc, $pd); } ?> I know that the a11 and z21 looks weird but I was having intermittent problems with using such sort variable names so I just added 1. The real functionality of this comes from the sql query 'LIKE' wich will match words without being case sinsitive.
  17. I goofed, I was on my way to work when I realized what you should do, here goes one last time, <?php $myFile = "fbddata.lbn"; $fh = fopen($myFile, 'r'); $contents = fread($fh, filesize($myFile)); $clean = rtrim($contents); //or if it is another return that you may are aware of try this whith whatever html code the break is //$clean = rtrim($contents, "<br />"); echo "<a href=\"www.mysite.com/Lavishphpfreak/$clean/ilovephp.php\">LINK</a>";
  18. have you tried ltrim() yet. You can also try rtrim(), just sub it for ltrim() Something like this: <?php $file = include"fbddata.lbn"; $str = "$file"; $clean = ltrim($str, "<br />"); //or if it is another return that you may not be aware of try this $clean = ltrim($str); echo "<a href=\"www.mysite.com/Lavishphpfreak/$clean/ilovephp.php\">LINK</a>"; ?>
  19. not exactly sure what you mean, "backlinks" what would the prupose of the script be anyway?
  20. have you tried escaping the end of your php include like this <a herf="www.mysite.com/Lavishphpfreak/<?php include("fbddata.lbn" ?>\/ilovephp.php>LINK[/url] php will add white space if endings are not escaped properly
  21. The script works like a charm, I was just wondering if anyone had a dirrernt method they use. I banned myself and 'bammo' it worked!
  22. I was wondering if anyone else has had a problem with people spamming their message boards or at least trying to, It was frustrating me for quite some time so I worked on a way to ban certain ip segments from my site. I am not really concerned with banning those who I want to see my site since the ip blocks are from small countries in the middle east, I know that the spammers are probably proxying to my site through unsecured proxy servers, but banning the ip(s) from those servers should work since theya are always using the same set. The code is pretty simple, and here it is. If there is a better way please let me know. <?php <?php include "my sql server connection here"; $poster1 = $_SERVER['REMOTE_ADDR']; $str = $poster1; $arr = explode (".", $str); $result = mysql_query("select * from banned",$sqlserver); while($row = mysql_fetch_array($result)){ $block = "$row[blocked]"; $match = explode (".", $block); } if($match[0] == $arr[0]){ echo " <html> <head> <meta http-equiv='Content-Language' content='en-us'> <meta http-equiv='Content-Type' content='text/html; charset=windows-1252'> <meta http-equiv=\"refresh\" content=\"10;url=http://www.google.com\"> <title>Maintainence Underway</title> </head> <body text='#FFFFFF' bgcolor='#000000' onLoad=\"javascript:window.opener='x';window.close();\"> <h1><font color='#FF0000'>Site down temporarily.</font></h1> <p><font face='Arial Black'><b>Actually you have been banned from this website, <br/ > so go spam someone else and leave me alone.</b></font></p> </body> </html> "; die(); } The rest of the site will continue to load down here The code is the first thing that comes in the header, so you cannot directly call a page without this, and notice I have set the page to self close without any prompts and if that does not work then the page redirects them to Google.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.