|
add url submit form October 20, 2011 10:35PM |
Registered: 1 year ago Posts: 8 |
|
Re: add url submit form December 25, 2011 07:04AM |
Registered: 1 year ago Posts: 10 |
<?php
///////////////////////////////////////////////////
// start of php header
///////////////////////////////////////////////////
session_start();
$include_dir = "./include";
$template_dir = "./templates/";
$settings_dir = "./settings";
$language_dir = "./languages";
include("$settings_dir/conf.php"
;
include("$include_dir/commonfuncs.php"
;
require_once("$language_dir/en-language.php"
;
require_once("$include_dir/searchfuncs.php"
;
require_once("$include_dir/categoryfuncs.php"
;
require_once("$settings_dir/database.php"
;
include ("$template_dir/$template/header.html"
;
include ("$language_dir/$language-language.php"
;
//require_once("$template_dir/$template/addurl.html"
;
include("$template_dir/$template/footer.html"
;
/////////////////////////////////////////////////////
// end of php header
// start of php body
/////////////////////////////////////////////////////
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[www.w3.org];
<html xmlns="[www.w3.org]; xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Sphider administrator tools</title>
<link rel="stylesheet" href="admin.css" type="text/css" />
</head>
<body>
<?php
// did the user press the add url button
if(isset($_POST['addurl']))
{
// DO THE TUNING CODE MATCH
if ($_POST['validate'] == $_SESSION['mystring'])
{
// make sure the url is not empty
if ($_POST['url'] != '')
{
global $mysql_table_prefix;
// get the values of the other text box
$short_desc = addslashes($_POST['short_desc']);
$title = addslashes($_POST['title']);
$compurl=parse_url("".$_POST['url']);
if ($compurl['path']=='')
$url = $_POST['url']."/";
$result = mysql_query("select site_ID from ".$mysql_table_prefix."sites where url='$url'"
;
echo mysql_error();
$rows = mysql_numrows($result);
if ($rows==0 )
{
mysql_query("INSERT INTO ".$mysql_table_prefix."sites (url, title, short_desc) VALUES ('$url', '$title', '$short_desc')"
;
echo mysql_error();
$result = mysql_query("select site_ID from ".$mysql_table_prefix."sites where url='$url'"
;
echo mysql_error();
$row = mysql_fetch_row($result);
$site_id = $row[0];
$result=mysql_query("select category_id from ".$mysql_table_prefix."categories"
;
echo mysql_error();
while ($row=mysql_fetch_row($result))
{
$cat_id=$row[0];
if ($cat[$cat_id]=='on')
{
mysql_query("INSERT INTO ".$mysql_table_prefix."site_category (site_id, category_id) values ('$site_id', '$cat_id')"
;
echo mysql_error();
}
}
If (!mysql_error())
{
$message = "<br/><center><b><font color=red>Thank you, You Site has been added</font></b></center>" ;
}
else
{
$message = mysql_error();
}
}
else
{
$message = "<center><b>Site already in database</b></center>";
}
echo $message;
}
else
{
echo "You must enter a valid url, press your back button and try again";
}
}
}
?>
<!--addurl form-->
<div ID="notes"><center>
<h4>Share your place on the net with us.</h4>
<p style="font-size: medium">
We add and update new sites to our index each time we crawl the web, and we invite you to submit your URL here.<br>
We do not add all submitted URLs to our index, and we cannot make any predictions or guarantees about when or if they will appear.</p>
<p style="font-size: medium">
Please enter your full URL, including the prefix. For example: <code>[http://www.example.com]</code>.<br>
You may also add a title or description of the content of your page.<br>
These are used only for our information and do not affect how your page is indexed or used by us.</p>
<p style="font-size: medium">
<b>Please note</b>: Only the top-level page from a host is necessary; you do not need to submit each individual page.</p>
</center>
</div>
<br/>
<div id="addurlctrl" align="center"><center><table>
<form action="addurl.php" method="post">
<input type="hidden" name="f" value="1">
<input type="hidden" name="af" value="2">
<tr><td><b>URL:</b></td><td align ="right"></td><td><input type="text" name="url" size="60" value ="["><];
<tr><td><b>Title:</b></td><td></td><td> <input type="text" name="title" size="60"></td></tr>
<tr><td><b>Short description:</b></td><td></td><td><textarea name="short_desc" cols="45" rows="3" wrap="virtual"></textarea></td></tr>
<tr><td>Category:</td><td></td><td>
<?php walk_through_cats(0, 0, '');?></td></tr>
<tr>
<td></td>
<td></td>
<td><p style="font-size: small">To help us distinguish between sites submitted by individuals and<br>
those automatically entered by software robots, please type the numbers<br>
shown here into the box below.</p>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td><img src="verify.php" height="60"></td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="text" name="validate" size="20" MAXLENGTH="10"></td>
</tr>
<tr>
<td></td>
<td></td>
<tr><td></td><td></td><td><input type="submit" id="submit" value="Add" name="addurl"></td></tr></form></table></center></div>
<!--end form-->
<?php
function walk_through_cats($parent, $lev, $site_id) {
global $mysql_table_prefix;
$space = "";
for ($x = 0; $x < $lev; $x++)
$space .= " ";
$query = "SELECT * FROM ".$mysql_table_prefix."categories WHERE parent_num=$parent ORDER BY category";
$result = mysql_query($query);
echo mysql_error();
if (mysql_num_rows($result) <> '')
while ($row = mysql_fetch_array($result)) {
$id = $row['category_id'];
$cat = $row['category'];
$state = '';
if ($site_id <> '') {
$result2 = mysql_query("select * from ".$mysql_table_prefix."site_category where site_id=$site_id and category_id=$id"
;
echo mysql_error();
$rows = mysql_num_rows($result2);
if ($rows > 0)
$state = "checked";
}
print $space . "<input type=checkbox name=cat[$id] $state>" . $cat . "<br/>\n";
;
walk_through_cats($id, $lev + 1, $site_id);
}
}
//////////////////////////////////////////////////////
// end of php body
///////////////////////////////////////////////////////
?>
</body>
</html>
<?php
//////////////////////////////////////////////////////////////////////////
// START OF HEADER
//////////////////////////////////////////////////////////////////////////
/*
Name: Guillaume Swolfs
Date: May 9 2006
File: verify.php
Description: THIS PAGE CREATE THE VERIFY TEXT AND IMAGE FOR THE REGISTER PAGE
Copyright(c) 2006 by Guillaume Swolfs, All Rights Reserved.
Any rights not expressly granted herein are reserved.
Illegal tampering or redistribution of these files is illegal
*/
header("Content-type: image/png"
;
//////////////////////////////////////////////////////////////////////////
// END OF HEADER
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// START OF DOCUMENT
//////////////////////////////////////////////////////////////////////////
session_start();
$myfirstimage = ImageCreateTrueColor(200, 60);
$img_width = imagesx($myfirstimage);
$img_height = imagesy($myfirstimage);
$purple = ImageColorAllocate($myfirstimage, 255, 0, 255);
$white = ImageColorAllocate($myfirstimage, 255, 255, 255);
$black = imagecolorallocate($myfirstimage, 0, 0, 0);
$red = imagecolorallocatealpha($myfirstimage, 255, 0, 0, 75);
$green = imagecolorallocatealpha($myfirstimage, 0, 255, 0, 75);
$blue = imagecolorallocatealpha($myfirstimage, 0, 0, 255, 75);
//$lightblue = imagecolorallocatealpha($myfirstimage, 0, 0, 50, 255);
$grey = imagecolorallocatealpha($myfirstimage, 0, 102, 102, 102);
ImageFill($myfirstimage, 0, 0, $purple);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $green);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $blue);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $red);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $white);
//imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $lightblue);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $grey);
imagefilledrectangle($myfirstimage, 0, 0, $img_width, 0, $white);
imagefilledrectangle($myfirstimage, $img_width - 1, 0, $img_width - 1, $img_height - 1, $black);
imagefilledrectangle($myfirstimage, 0, 0, 0, $img_height - 1, $black);
imagefilledrectangle($myfirstimage, 0, $img_height - 1, $img_width, $img_height - 1, $black);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $green);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $blue);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $red);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $white);
//imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $lightblue);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $grey);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $green);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $blue);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $red);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $white);
//imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $lightblue);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $grey);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $green);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $blue);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $red);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $white);
//imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $lightblue);
imagefilledellipse($myfirstimage, ceil(rand(5,$img_width - 5)), ceil(rand(0,$img_height)), 30, 30, $grey);
$mystring = substr(rand(), 0, 6);
$_SESSION['mystring'] = Setstring();
imageString($myfirstimage, 5, 20, 30, $_SESSION['mystring'], $black);
ImagePNG($myfirstimage);
imagedestroy($myfirstimage); // Flush Image
function Setstring()
{
$mystring = substr(rand(), 0, 6);
return $mystring;
}
//////////////////////////////////////////////////////////////////////////
// END OF DOCUMENT
//////////////////////////////////////////////////////////////////////////
?>
Just copy and paste the code into a new file each. NotePad++ is the best to use for this. Name them appropriately and place them in the "root" of the Sphider directory. Putting a link into whatever page you want for the add url submission page and such is entirely up to you. Hope this helps everyone out there who has been trying to get this to work for them. By the way, where the smiles are you need to place a "(" in the other direction, or SHIFT KEY+ 0.|
Re: add url submit form December 25, 2011 10:00AM |
Moderator Registered: 5 years ago Posts: 361 |
|
Re: add url submit form January 29, 2012 12:19PM |
Registered: 1 year ago Posts: 10 |

|
Re: add url submit form February 01, 2012 07:40AM |
Registered: 1 year ago Posts: 10 |
<?php
///////////////////////////////////////////////////
// start of php header
///////////////////////////////////////////////////
//Modified by: Memyidesu aka: The White Rabbit
session_start();
$include_dir = "./include";
$template_dir = "./templates/";
$settings_dir = "./settings";
$language_dir = "./languages";
include("$settings_dir/conf.php"
;
include("$include_dir/commonfuncs.php"
;
extract (getHttpVars());
require_once("$settings_dir/database.php"
;
include ("$language_dir/$language-language.php"
;
include("$template_dir/$template/header.html"
;
/////////////////////////////////////////////////////
// end of php header
/////////////////////////////////////////////////////
?>
<?php
/////////////////////////////////////////////////////
// start of php body
////////////////////////////////////////////////////
// did the user press the add url button
if(isset($_POST['addurl']))
{
// DO THE TUNING CODE MATCH
if ($_POST['validate'] == $_SESSION['mystring'])
{
// make sure the url is not empty
if ($_POST['url'] != '')
{
global $mysql_table_prefix;
// get the values of the other text box
$short_desc = addslashes($_POST['short_desc']);
$title = addslashes($_POST['title']);
$compurl=parse_url("".$_POST['url']);
if ($compurl['path']=='')
$url = $_POST['url']."/";
$result = mysql_query("select site_ID from ".$mysql_table_prefix."sites where url='$url'"
;
echo mysql_error();
$rows = mysql_numrows($result);
if ($rows==0 ) {
mysql_query("INSERT INTO ".$mysql_table_prefix."sites (url, title, short_desc) VALUES ('$url', '$title', '$short_desc')"
;
echo mysql_error();
$result = mysql_query("select site_ID from ".$mysql_table_prefix."sites where url='$url'"
;
echo mysql_error();
$row = mysql_fetch_row($result);
$site_id = $row[0];
$result=mysql_query("select category_id from ".$mysql_table_prefix."categories"
;
echo mysql_error();
while ($row=mysql_fetch_row($result)) {
$cat_id=$row[0];
if ($cat[$cat_id]=='on') {
mysql_query("INSERT INTO ".$mysql_table_prefix."site_category (site_id, category_id) values ('$site_id', '$cat_id')"
;
echo mysql_error();
}
}
If (!mysql_error()) {
$message = "<br/><center><b><font color=red>Thank you, You Site has been added</font></b></center>" ;
} else {
$message = mysql_error();
}
} else {
$message = "<center><b>Site already in database</b></center>";
}
echo $message;
}
else
{
echo "You must enter a valid url, press your back button and try again";
}
}
}
?>
<!--addurl form-->
<center><h1>Add your website to SEO Spider</h1></center>
<div ID="notes"><center>
<h4>Share your place on the net with us.</h4>
<p style="font-size: medium">
We add and update new sites to our index each time we crawl the web, and we invite you to submit your URL here.<br>
We do not add all submitted URLs to our index, and we cannot make any predictions or guarantees about when or if they will appear.</p>
<p style="font-size: medium">
Please enter your full URL, including the prefix. For example: <code>[http://www.example.com]</code>.<br>
You may also add a title or description of the content of your page.<br>
These are used only for our information and do not affect how your page is indexed or used by us.</p>
<p style="font-size: medium">
<b>Please note</b>: Only the top-level page from a host is necessary; you do not need to submit each individual page.</p>
</center>
</div>
<br/>
<div id="addurlctrl" align="center"><center><table>
<form action="addurl.php" method="post">
<input type="hidden" name="f" value="1">
<input type="hidden" name="af" value="2">
<tr><td><b>URL:</b></td><td align ="right"></td><td><input type="text" name="url" size="60" value ="["><];
<tr><td><b>Title:</b></td><td></td><td> <input type="text" name="title" size="60"></td></tr>
<tr><td><b>Short description:</b></td><td></td><td><textarea name="short_desc" cols="45" rows="3" wrap="virtual"></textarea></td></tr>
<tr><td>Category:</td><td></td><td>
<?php walk_through_cats(0, 0, '');?></td></tr>
<tr>
<td></td>
<td></td>
<td><p style="font-size: small">To help us distinguish between sites submitted by individuals and<br>
those automatically entered by software robots, please type the numbers<br>
shown here into the box below.</p>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td><img src="verify.php" height="60"></td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="text" name="validate" size="20" MAXLENGTH="10"></td>
</tr>
<tr>
<td></td>
<td></td>
<tr><td></td><td></td><td><input type="submit" id="submit" value="Add" name="addurl"></td></tr></form></table></center></div>
<!--end form-->
<?php
function walk_through_cats($parent, $lev, $site_id) {
global $mysql_table_prefix;
$space = "";
for ($x = 0; $x < $lev; $x++)
$space .= " ";
$query = "SELECT * FROM ".$mysql_table_prefix."categories WHERE parent_num=$parent ORDER BY category";
$result = mysql_query($query);
echo mysql_error();
if (mysql_num_rows($result) <> '')
while ($row = mysql_fetch_array($result)) {
$id = $row['category_id'];
$cat = $row['category'];
$state = '';
if ($site_id <> '') {
$result2 = mysql_query("select * from ".$mysql_table_prefix."site_category where site_id=$site_id and category_id=$id"
;
echo mysql_error();
$rows = mysql_num_rows($result2);
if ($rows > 0)
$state = "checked";
}
print $space . "<input type=checkbox name=cat[$id] $state>" . $cat . "<br/>\n";
;
walk_through_cats($id, $lev + 1, $site_id);
}
}
//////////////////////////////////////////////////////
// end of php body
///////////////////////////////////////////////////////
?>
<?php include("$template_dir/$template/footer.html"
; ?>