Welcome! Log In Create A New Profile


URL Filter for Add a url page

Posted by memyidesu 
URL Filter for Add a url page
September 03, 2012 11:02AM
Yo Peeps,

I finally figured out a decent way to filter some of the garbage from the Add a URL page. This should be added into the code of the 'addurl.php' page just below this line:
if ($compurl['path']=='') {
                $url = $_POST['url']."/";

Then you put this in:
//Parse the URL for fakes
			if ($url == "/"winking smiley{
				die ("<center><p><font color=red>A URL contains more than ONE character.</font></p></center>"winking smiley;
			} else if (substr($url,0,7) != "http://"winking smiley{
				die ("<center><p><font color=red>READ THE INSTRUCTIONS!!! You need to include the prefix 'http://'.</font></p></center>"winking smiley;
			} else if (substr($url,0,8) == "http:///"winking smiley{
				die ("<center><p><font color=red>Nice try. That is not a URL.</font></p></center>"winking smiley;
			} else if (substr($url,-6) == "[/url]"winking smiley {
				die ("<center><p><font color=red>This is not a forum, DIP****!!!</font></p></center>"winking smiley;
			} else if (substr($url,-3,1) != "."winking smiley {
				if (substr($url,-4,1) != "."winking smiley {
					if (substr($url,-5,1) != "."winking smiley {
						if (substr($url,-6,1) !="."winking smiley {
							die ("<center><p><font color=red>READ THE INSTRUCTIONS!!! TOP LEVEL DOMAINS ONLY!!!</font></p></center>"winking smiley;

Feel free to change the text to your liking.
P.S. Remeber that where you see the smiles you need SHIFT + 0
P.P.S. Edited because I founf a little better way to do it.

[url=http://www.memyidesusoftware.com]Memyidesu Software[/url]
[url=http://www.machinecore.info]XMachinecor3X Spider[/url]

Edited 3 time(s). Last edit at 09/03/2012 11:30AM by memyidesu.
Re: URL Filter for Add a url page
September 04, 2012 12:03AM
Yo Peeps,

I've been told, and see, that the code is not showing properly besides the smiles. Here is a link to another post I made that shows the code properly: http://www.seochatboard.com/viewtopic.php?f=27&t=412


[url=http://www.memyidesusoftware.com]Memyidesu Software[/url]
[url=http://www.machinecore.info]XMachinecor3X Spider[/url]
Re: URL Filter for Add a url page
January 10, 2014 09:12AM
<%@ page language="java" contentType="text/html; charset=utf-8"
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<b><font size=20 color="red">图书类型信息</font>
<s:form action="typeaction" method="post">
<s:textfield name="booktype.tno" label="类型编号" />
<s:textfield name="booktype.tname" label="类型名字" />
<s:submit value="提交" /> <s:reset value="重置"/>
</html> [url=http://lol.vipmmobank.com/]elo boost[/url]
Sorry, only registered users may post in this forum.

Click here to login