Register your Site With 15 Search engines in one go....


The following code helps you register with 15 Search Engines by filling one form. The program uses the "GET" and "POST" methods. In the event of an error connecting to any of the search engines, a message indicating the same is displayed on the screen. A confirmation of registration is available in a set of files generated by the program. The files are named as per the URL's of the respective Search Engines and can be viewed using any Web Browser. The user interface was devoloped in VC++ 4.0 using the MFC classes and calling Winsock Ver 1.1 functions.

To compile the code create a project in VC++ 4.0 ,copy the following files into the project directory. Insert all the .cpp .rc files into your project workspace and compile usingMFC in the shared DLL Mode
Also don't forget to include the file Wsock32.lib

DownLoad the Source Code .


stdafx.h

#define VC_EXTRALEAN		
#include <afxwin.h>         
#include <afxext.h>       
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>			
#endif 
stdafx.cpp : source file that includes just the standard includes

#include "stdafx.h"
addurl.h : main header file for the ADDURL application

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h"       
class CAddurlApp : public CWinApp
{
public:
	virtual BOOL InitInstance();
        DECLARE_MESSAGE_MAP()
};
addurl.cpp : Defines the class behaviors for the application.

#include "stdafx.h"
#include "addurl.h"

#include "MainFrm.h"
#include "addurlDoc.h"
#include "addurlView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

BEGIN_MESSAGE_MAP(CAddurlApp, CWinApp)
END_MESSAGE_MAP()

CAddurlApp theApp;

BOOL CAddurlApp::InitInstance()
{
#ifdef _AFXDLL
	Enable3dControls();			
#else
	Enable3dControlsStatic();	
#endif

	LoadStdProfileSettings();  

	CSingleDocTemplate* pDocTemplate;
	pDocTemplate = new CSingleDocTemplate(
		IDR_MAINFRAME,
		RUNTIME_CLASS(CAddurlDoc),
		RUNTIME_CLASS(CMainFrame),  
		RUNTIME_CLASS(CAddurlView));
	AddDocTemplate(pDocTemplate);
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;
		return TRUE;
}
MainFrm.h : interface of the CMainFrame class

class CMainFrame : public CFrameWnd
{
protected: 
	CMainFrame();
	DECLARE_DYNCREATE(CMainFrame)

protected:
	CSplitterWnd m_wndSplitter;
public:
	virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void ActivateFrame(int nCmdShow = -1);
public:
	virtual ~CMainFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif
  
protected: 
	CStatusBar  m_wndStatusBar;
protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDialog1();
	DECLARE_MESSAGE_MAP()
};
MainFrm.cpp : implementation of the CMainFrame class

#include "stdafx.h"
#include "addurl.h"
#include "MainFrm.h"
#include "AUDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
	ON_WM_CREATE()
	ON_COMMAND(IDD_DIALOG1, OnDialog1)
END_MESSAGE_MAP()

static UINT indicators[] =
{
	ID_SEPARATOR,           
	ID_INDICATOR_CAPS,
	ID_INDICATOR_NUM,
	ID_INDICATOR_SCRL,
};
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	return 0;
}
BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT ,
	CCreateContext* pContext)
{
	return m_wndSplitter.Create( this,
		2, 2,                 
		CSize( 10, 10 ),      
		pContext );
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{

	return CFrameWnd::PreCreateWindow(cs);
}
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
	CFrameWnd::AssertValid();
}

void CMainFrame::Dump(CDumpContext& dc) const
{
	CFrameWnd::Dump(dc);
}

#endif 
void CMainFrame::OnDialog1() 
{
	CAUDialog d;
	d.DoModal();
}
void CMainFrame::ActivateFrame(int nCmdShow) 
{
	nCmdShow=SW_SHOWMAXIMIZED;
	CFrameWnd::ActivateFrame(nCmdShow);
}
addurlDoc.h : interface of the CAddurlDoc class

class CAddurlDoc : public CDocument
{
protected: 
	CAddurlDoc();
	DECLARE_DYNCREATE(CAddurlDoc)

public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
public:
	virtual ~CAddurlDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	DECLARE_MESSAGE_MAP()
};
addurlDoc.cpp : implementation of the CAddurlDoc class

#include "stdafx.h"
#include "addurl.h"

#include "addurlDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

IMPLEMENT_DYNCREATE(CAddurlDoc, CDocument)

BEGIN_MESSAGE_MAP(CAddurlDoc, CDocument)
END_MESSAGE_MAP()
BOOL CAddurlDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;
	return TRUE;
}
#ifdef _DEBUG
void CAddurlDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CAddurlDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif 
Addurl.RC The R.C. File

#include "resource.h"
#include "afxres.h"
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

// Menu
IDR_MAINFRAME MENU PRELOAD DISCARDABLE 
BEGIN
    POPUP "&Site"
    BEGIN
        MENUITEM "&Add URL",                    ID_SITE_ADDURL
        MENUITEM SEPARATOR
        MENUITEM "E&xit",                       ID_APP_EXIT
    END
END

// Dialog
IDD_DIALOG1 DIALOG DISCARDABLE  0, 0, 352, 210
STYLE DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "Add URL - Please Fill This Form Completely"
FONT 8, "MS Sans Serif"
BEGIN
    LTEXT           "Enter URL",IDC_STATIC,0,5,19,15
    EDITTEXT        IDC_URL,45,4,90,14,ES_AUTOHSCROLL
    LTEXT           "Enter E-Mail",IDC_STATIC,0,30,19,15,NOT WS_GROUP
    EDITTEXT        IDC_EMAIL,45,30,90,14,ES_AUTOHSCROLL
    LTEXT           "Password ",IDC_STATIC,0,55,36,8
    EDITTEXT        IDC_PASSWORD,45,50,90,14,ES_PASSWORD | ES_AUTOHSCROLL
    LTEXT           "Keyword",IDC_STATIC,0,70,40,15
    EDITTEXT        IDC_KEYWORD,45,70,90,15,ES_AUTOHSCROLL
    LTEXT           "Title",IDC_STATIC,0,90,35,10
    EDITTEXT        IDC_TITLE,45,90,90,14,ES_AUTOHSCROLL
    LTEXT           "Language",IDC_STATIC,0,110,33,8
    EDITTEXT        IDC_LANGUAGE,45,107,90,14,ES_AUTOHSCROLL
    LTEXT           "Comments",IDC_STATIC,0,145,35,20,NOT WS_GROUP
    EDITTEXT        IDC_COMMENT,45,130,90,65,ES_MULTILINE | ES_AUTOVSCROLL | 
                    ES_WANTRETURN
    LTEXT           "Name ",IDC_STATIC,185,5,22,8
    EDITTEXT        IDC_NAME,230,5,92,14,ES_AUTOHSCROLL
    LTEXT           "Address",IDC_STATIC,185,42,26,8
    EDITTEXT        IDC_ADDRESS,230,25,92,30,ES_MULTILINE | ES_AUTOVSCROLL | 
                    ES_WANTRETURN
    LTEXT           "City",IDC_STATIC,185,65,12,8
    EDITTEXT        IDC_CITY,230,60,92,15,ES_AUTOHSCROLL
    LTEXT           "State",IDC_STATIC,185,90,18,8
    EDITTEXT        IDC_STATE,230,80,92,14,ES_AUTOHSCROLL
    LTEXT           "Country",IDC_STATIC,185,106,25,8
    EDITTEXT        IDC_COUNTRY,230,101,92,14,ES_AUTOHSCROLL
    LTEXT           "Zip",IDC_STATIC,185,122,11,8
    EDITTEXT        IDC_ZIP,230,116,92,14,ES_AUTOHSCROLL
    LTEXT           "Phone",IDC_STATIC,185,138,22,8
    EDITTEXT        IDC_PHONE,230,131,92,14,ES_AUTOHSCROLL
    LTEXT           "Fax",IDC_STATIC,185,151,12,8
    EDITTEXT        IDC_FAX,230,147,92,14,ES_AUTOHSCROLL
    PUSHBUTTON      "OK",IDC_OK,230,185,50,14
    PUSHBUTTON      "Cancel",IDC_CANCEL,290,185,50,14
END

// DESIGNINFO
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE 
BEGIN
    IDD_DIALOG1, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 345
        TOPMARGIN, 4
        BOTTOMMARGIN, 203
    END
END
#endif    

STRINGTABLE PRELOAD DISCARDABLE 
BEGIN
    IDR_MAINFRAME           "AddUrl"
END

STRINGTABLE PRELOAD DISCARDABLE 
BEGIN
    AFX_IDS_APP_TITLE       "addurl"
    AFX_IDS_IDLEMESSAGE     "Ready"
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_INDICATOR_EXT        "EXT"
    ID_INDICATOR_CAPS       "CAP"
    ID_INDICATOR_NUM        "NUM"
    ID_INDICATOR_SCRL       "SCRL"
    ID_INDICATOR_OVR        "OVR"
    ID_INDICATOR_REC        "REC"
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_APP_EXIT             "Quit the application; prompts to save documents\nExit"
    ID_SITE_ADDURL          "Registers your URL"
END

STRINGTABLE DISCARDABLE 
BEGIN
    AFX_IDS_SCSIZE          "Change the window size"
    AFX_IDS_SCMOVE          "Change the window position"
    AFX_IDS_SCMINIMIZE      "Reduce the window to an icon"
    AFX_IDS_SCMAXIMIZE      "Enlarge the window to full size"
    AFX_IDS_SCNEXTWINDOW    "Switch to the next document window"
    AFX_IDS_SCPREVWINDOW    "Switch to the previous document window"
    AFX_IDS_SCCLOSE         "Close the active window and prompts to save the documents"
END
#endif
Resource.h The Resource Header
#define IDR_MAINFRAME                   128
#define IDR_ADDURLTYPE                  129
#define IDD_DIALOG1                     130
#define IDC_URL                         1000
#define IDC_EMAIL                       1001
#define IDC_COMMENT                     1002
#define IDC_OK                          1003
#define IDC_PASSWORD                    1005
#define IDC_NAME                        1006
#define IDC_CITY                        1007
#define IDC_COUNTRY                     1010
#define IDC_STATE                       1011
#define IDC_ZIP                         1012
#define IDC_PHONE                       1013
#define IDC_FAX                         1014
#define IDC_ADDRESS                     1015
#define IDC_KEYWORD                     1016
#define IDC_TITLE                       1017
#define IDC_LANGUAGE                    1018
#define IDC_CANCEL                      1019
#define ID_SITE_ADDURL                  32774

#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS                     1
#define _APS_NEXT_RESOURCE_VALUE        137
#define _APS_NEXT_COMMAND_VALUE         32775
#define _APS_NEXT_CONTROL_VALUE         1020
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif
AddUrlDialog.h : The Dialog header file

class CAUDialog : public CDialog
{
public:
	CAUDialog(CWnd* pParent = NULL);   // standard constructor
	enum { IDD = IDD_DIALOG1 };
	CString	m_Comment;
	CString	m_Email;
	CString	m_URL;
	CString	m_Address;
	CString	m_City;
	CString	m_Country;
	CString	m_Fax;
	CString	m_Keyword;
	CString	m_Name;
	CString	m_Password;
	CString	m_Phone;
	CString	m_State;
	CString	m_Title;
	CString	m_Zip;
    CString m_Language;
protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
protected:
	void OnClickedOk();
	void OnClickedCancel();
	DECLARE_MESSAGE_MAP()
};
AddUrlDialog.cpp : Your Dialog file

#include "stdafx.h"
#include "AddurlDoc.h"
#include "AddurlView.h"
#include "addurl.h"
#include "AddUrlDialog.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

CAUDialog::CAUDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CAUDialog::IDD, pParent)
{
	m_Comment = _T("");
	m_Email = _T("");
	m_URL = _T("http://");
	m_Address = _T("");
	m_City = _T("");
	m_Country = _T("");
	m_Fax = _T("");
	m_Keyword = _T("");
	m_Name = _T("");
	m_Password = _T("");
	m_Phone = _T("");
	m_State = _T("");
	m_Title = _T("");
	m_Zip = _T("");
	m_Language = _T("English");
}

void CAUDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
 	DDX_Text(pDX, IDC_COMMENT, m_Comment);
	DDX_Text(pDX, IDC_EMAIL, m_Email);
	DDX_Text(pDX, IDC_URL, m_URL);
	DDX_Text(pDX, IDC_ADDRESS, m_Address);
	DDX_Text(pDX, IDC_CITY, m_City);
	DDX_Text(pDX, IDC_COUNTRY, m_Country);
	DDX_Text(pDX, IDC_FAX, m_Fax);
	DDX_Text(pDX, IDC_KEYWORD, m_Keyword);
	DDX_Text(pDX, IDC_NAME, m_Name);
	DDX_Text(pDX, IDC_PASSWORD, m_Password);
	DDX_Text(pDX, IDC_PHONE, m_Phone);
	DDX_Text(pDX, IDC_STATE, m_State);
	DDX_Text(pDX, IDC_TITLE, m_Title);
	DDX_Text(pDX, IDC_ZIP, m_Zip);
	DDX_Text(pDX, IDC_LANGUAGE, m_Language);
}

BEGIN_MESSAGE_MAP(CAUDialog, CDialog)
	ON_BN_CLICKED(IDC_OK, OnClickedOk)
	ON_BN_CLICKED(IDC_CANCEL, OnClickedCancel)
END_MESSAGE_MAP()

void CAUDialog::OnClickedCancel() 
{
	CDialog::OnCancel();
}

void CAUDialog::OnClickedOk() 
{
 	CDialog::OnOK();
};
addurlView.h : interface of the CAddurlView class

class CAddurlView : public CScrollView
{
protected: 
	CAddurlView();
	DECLARE_DYNCREATE(CAddurlView)
public:
	CAddurlDoc* GetDocument();
public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();
public:
	virtual ~CAddurlView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	//{{AFX_MSG(CAddurlView)
	afx_msg void OnSiteAddurl();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in addurlView.cpp
inline CAddurlDoc* CAddurlView::GetDocument()
   { return (CAddurlDoc*)m_pDocument; }
#endif
addurlView.cpp : implementation of the CAddurlView class

#include "stdafx.h"
#include "addurl.h"
#include "AUDialog.h"
#include "addurlDoc.h"
#include "addurlView.h"
#include <winsock.h>
#include <stdio.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
char BUF1[15][5],BUF2[15][100],TT[15][100];
int i,y;
CString Register(CString,CString,CString,CString);

IMPLEMENT_DYNCREATE(CAddurlView, CScrollView)

BEGIN_MESSAGE_MAP(CAddurlView, CScrollView)
	ON_COMMAND(ID_SITE_ADDURL, OnSiteAddurl)
END_MESSAGE_MAP()

CAddurlView::CAddurlView()
{
}

CAddurlView::~CAddurlView()
{
}

BOOL CAddurlView::PreCreateWindow(CREATESTRUCT& cs)
{
	return CScrollView::PreCreateWindow(cs);
}

void CAddurlView::OnDraw(CDC* pDC)
{
    int l=0,j=0;
   CAddurlDoc* pDoc = GetDocument();
   ASSERT_VALID(pDoc);
   if(y==0)
   { j+=20;
     pDC->SetTextColor(RGB(255,0,0));
	 pDC-> TextOut(250,j+=20,"MASTER  ADDURL ");
	 pDC->SetTextColor(RGB(255,0,255));
	 j+=40;
	 pDC-> TextOut(50,j+=20,"Hello Friends! Thank you for trying out our program.This program was developed at");
	 pDC-> TextOut(5,j+=20,"Vijay Mukhi's Computer Institute  ");
	 pDC-> TextOut(5,j+=20,"This program will help you to Register your Site to 15 Search Engines at one go.");
	 pDC-> TextOut(5,j+=20," ");
		 j+=20;
	 pDC-> TextOut(50,j+=20,"All you have to do is click on the Menu item SITE and then on ADDURl and you");
	 pDC-> TextOut(5,j+=20,"will get a Form.Please fill in this form completely and check for any mistakes before ");
	 pDC-> TextOut(5,j+=20,"clicking on OK for successful Registration .");
	 j+=60;
   }
   else
   {   
	   for(l=0;l<=14;l++)
           {
		    j+=20;
            pDC-> TextOut(0,j,"                                                                                                       ");
	        pDC-> TextOut(400,j,"                                                                                                       ");
			}
  j=0;
  for(l=0;l<=14;l++)
  {
	j+=20;
   	pDC-> TextOut(2,j,BUF1[l]);
    pDC-> TextOut(30,j,TT[l]);
  	pDC-> TextOut(300,j,BUF2[l]);
  } 
  }

    pDC->SetTextColor(RGB(0,0,255));
	pDC-> TextOut(10,j+=20,"A confirmation of registration is available in a set of files generated by the program. The files");
	pDC-> TextOut(3,j+=20, " are named as per the URL's of the respective Search Engines and can be viewed using any ");
	pDC-> TextOut(3,j+=20, "Web Browser.The files are stored in the current directory."); 
   
}

#ifdef _DEBUG
void CAddurlView::AssertValid() const
{
	CScrollView::AssertValid();
}
void CAddurlView::Dump(CDumpContext& dc) const
{
	CScrollView::Dump(dc);
}
CAddurlDoc* CAddurlView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAddurlDoc)));
	return (CAddurlDoc*)m_pDocument;
}
#endif //_DEBUG

void CAddurlView::OnSiteAddurl() 
{
	CAUDialog diag;
	int x = diag.DoModal();
	if (x==IDCANCEL) 
	{
	return;
	}

 	CAddurlDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	
	CString HostName,Method,Action,Statement;
	CString	Errorlist="Due to some technical reasons there was a failure to register with below\r\nmentioned Search Engine(s)\r\n ";
		
	//***   Search Engines registered by GET method  follow :	
	          
                           //1>** AltaVista                  
HostName = "add-url.altavista.digital.com";
Method = "GET ";
Action ="/cgi-bin/newurl";

Statement="?q=";
Statement+= diag.m_URL;	

Errorlist+=Register(HostName, Method, Action, Statement);

Invalidate(0);
UpdateWindow();
		    
						  //2>** DisInformation
HostName = "www.disinfo.com";
Method = "GET ";
Action = "/GEN/GEN_submitted.html";

Statement = "?Title=";
Statement += diag.m_Title;
Statement +="&URL=";
Statement += diag.m_URL;
Statement +="&realname=";
Statement += diag.m_Name;
Statement +="&email=";
Statement += diag.m_Email;
Statement +="&suggest=";
Statement += diag.m_Keyword;
Statement += "&body=";
Statement += diag.m_Comment;

Errorlist+=Register(HostName, Method, Action, Statement);

Invalidate(0);
UpdateWindow();

			              //3>**  HOTBOT.COM
HostName = "www.hotbot.com";
Method = "GET ";
Action = "/lite/addurl.html/IU0BMTo1B60EA46C24354B38F4E4021360F7A9FF";

Statement = "?_v=1.0&newurl=";
Statement+= diag.m_URL;
Statement+="&email=";
Statement+= diag.m_Email;
Statement+="&send=Send";

Errorlist+=Register(HostName, Method, Action, Statement);
   
Invalidate(0);
UpdateWindow();
			  
						//4>***  LYCOS.COM           
HostName ="www.lycos.com";
Method= "GET ";
Action = "/cgi-bin/spider_now.pl";

Statement="?query=";
Statement+= diag.m_URL;

Errorlist+=Register(HostName, Method, Action, Statement);
   
Invalidate(0);
UpdateWindow();

			          //5>**  The URL Tree
HostName = "www.iea.com";
Method = "GET ";
Action = "/cgi-bin.peterd/t_submit2.pl";

Statement = "?title=";
Statement += diag.m_URL;

Errorlist+=Register(HostName, Method, Action, Statement);
   
Invalidate(0);
UpdateWindow();

//***********   Search Engines registered by POST method  follow :

CString temp;
int len;    
char buf[10];

		              //1>***** MCKINLEY.COM   
HostName ="www.mckinley.com";
Method= "POST ";
Action = "/addsite.cgi";
      
Statement = " HTTP/1.0\r\n";
Statement += "User-Agent: Mozilla/3.0b5a (Win95;I)\r\n";
Statement += "Accept: */*\r\n";
Statement += "Content-type: application/x-www-form-urlencoded\r\n";          

temp="Umbrella=";
temp+="Internet";
temp+="&Keyword_1=";
temp+=diag.m_Keyword;
temp+="&URL_http=";
temp+=diag.m_URL;	 
temp+="&URL_Mailto=";
temp+=diag.m_Email;
temp+="&Contact_email=";       
temp+=diag.m_Email;
temp+="&Description=";
temp+=diag.m_Comment;
temp+="&phone=";
temp+=diag.m_Phone;
temp+="&Keyword_2=";
temp+=diag.m_Keyword;
temp+="&Keyword_3=";
temp+=diag.m_Keyword;
temp+="&Keyword_4=";
temp+=diag.m_Keyword;
temp+="&Audience_1=";
temp+="&Audience_2=";
temp+="&Audience_3=";
temp+="&Audience_4=";
temp+="&URL_news=";
temp+="&Commerc_NotComm=N";
temp+="&Moderated_NotModerated=N";
temp+="&Cost_NoCost=N";
temp+="&Language=";
temp+=diag.m_Language;
temp+="&Access=Internet";
temp+="&Producer=";
temp+="&Producer_Address=";
temp+="&Phys_locale=";
temp+="&Contact=";
temp+="\r\n";

len=strlen(temp);
itoa(len,buf,10);

Statement+= "Content-length: ";
Statement+= buf;
Statement+= "\r\n\r\n";
Statement+= temp;	
      
Errorlist+=Register(HostName, Method, Action, Statement);
   
Invalidate(0);
UpdateWindow();

				          //2>***    MOJOE.COM
HostName="www.webcom.com";
Method="POST ";
Action="/cgi-bin/form";
        
Statement = " HTTP/1.0\r\n";
Statement += "User-Agent: Mozilla/3.0b5a (Win95;I)\r\n";
Statement += "Accept: */*\r\n";
Statement += "Content-type: application/x-www-form-urlencoded\r\n";          

temp="TITLE=";
temp+=diag.m_Title;
temp+="&URL=";
temp+=diag.m_URL;
temp+="&Keywords=";
temp+=diag.m_Keyword;		
temp+="&Java=";      
temp+="yes";         
temp+="&VRML=";      
temp+="no";          
temp+="&JavaScript=";
temp+="no";          
temp+="&Anim89aGif=";        
temp+="yes";            
temp+="&Push_Pull=";        
temp+="no";              
temp+="&Director_Movie=";
temp+="no";              
temp+="&video=";            
temp+="no";                
temp+="&Chat=";           
temp+="no";               
temp+="&Database_Connectivity=";
temp+="no";               
temp+="&Audio=";           
temp+="no";               
		
temp+="&Comments=";
temp+=diag.m_Comment;
temp+="&Email=";
temp+=diag.m_Email;
temp+="&Name=";
temp+=diag.m_Name;
temp+="&Contact=";          
temp+="yes";                
temp+="&form_name=add";
temp+="userid=mojoe";        
temp+="\r\n";
      
len=strlen(temp);
itoa(len,buf,10);

Statement += "Content-length: ";
Statement += buf;
Statement += "\r\n\r\n";
Statement += temp;	
      
Errorlist+=Register(HostName, Method, Action, Statement);
   
Invalidate(0);
UpdateWindow();
				
	

                //3>***** NETMALL.COM   

HostName="www.netmall.com";
Method="POST "; 
Action="/cgi-bin/netmall";
        
Statement = " HTTP/1.0\r\n";
Statement += "User-Agent: Mozilla/3.0b5a (Win95;I)\r\n";
Statement += "Accept: */*\r\n";
Statement += "Content-type: application/x-www-form-urlencoded\r\n";          
               
temp+="NPASSWORD=";
temp+=diag.m_Password;
temp+="&NPASSWORD2=";
temp+=diag.m_Password;
temp+="&NAME=";
temp+=diag.m_Name;
temp+="&ADDRESS1";
temp+=diag.m_Address;
temp+="&ADDRESS2";
temp+=diag.m_Address;
temp+="&CITY";
temp+=diag.m_City;
temp+="&STATE";
temp+=diag.m_State;
temp+="&ZIP";
temp+=diag.m_Zip;
temp+="&COUNTRY";
temp+=diag.m_Country;
temp+="&PHONE=";		
temp+=diag.m_Phone;
temp+="&FAX=";
temp+=diag.m_Fax;
temp+="&EMAIL=";
temp+=diag.m_Email;
temp+="&URL=";
temp+=diag.m_URL;
temp+="&KEYWORDS=";
temp+=diag.m_Keyword;
temp+="&DESCRIPTION=";
temp+=diag.m_Comment;
temp+="&HIDDENF=";
temp+="\r\n";

len=strlen(temp);
itoa(len,buf,10);

Statement += "Content-length: ";
Statement += buf;
Statement += "\r\n\r\n";
Statement += temp;	
        
Errorlist+=Register(HostName, Method, Action, Statement);
   
Invalidate(0);
UpdateWindow();
			


          //4>*****    PAGEHOST.COM

HostName="www.pagehost.com";
Method="POST ";
Action="/AtoZ/mailform.cgi";
    
Statement = " HTTP/1.0\r\n";
Statement += "User-Agent: Mozilla/3.0b5a (Win95;I)\r\n";
Statement += "Accept: */*\r\n";
Statement += "Content-type: application/x-www-form-urlencoded\r\n";          

temp= "realname=";
temp+=diag.m_Name;
temp+="&email="; 
temp+=diag.m_Email;
temp+="&URL=";
temp+=diag.m_URL;
temp+="&TITLE=";      
temp+=diag.m_Title;         
temp+="&DESCRIPTION=";  
temp+=diag.m_Comment;         
temp+="&BAD_CATEGORIES=";
temp+="YES";             
temp+="&NOTES=";           
temp+=diag.m_Comment;           
temp+="&recipient=atoz.submit@pagehost.com";
temp+="&subject=URL Submission";
temp+="&redirect=http://www.pagehost.com/AtoZ/thx.html";
temp+="\r\n";
      
len=strlen(temp);
itoa(len,buf,10);

Statement += "Content-length: ";
Statement += buf;
Statement += "\r\n\r\n";
Statement += temp;	
      
Errorlist+=Register(HostName, Method, Action, Statement);
   
Invalidate(0);
UpdateWindow();
				


	           // 5>*****  SEARCH.NL  

HostName = "www.search.nl";
Method = "POST ";
Action = "/cgi-bin/addurl";

Statement = " HTTP/1.0\r\n";
Statement += "User-Agent: Mozilla/3.0b5a (Win95;I)\r\n";
Statement += "Accept: */*\r\n";
Statement += "Content-type: application/x-www-form-urlencoded\r\n";          

temp = "url=";
temp += diag.m_URL;
temp += "&description=";
temp +=diag.m_Comment;
temp +="&organisation=";
temp +="";
temp +="&function=";
temp +="";
temp +="&address=";
temp +=diag.m_Address;
temp +="&city=";
temp +=diag.m_City;
temp +="&postcode=";
temp +=diag.m_Zip;
temp += "&realname=";
temp +=diag.m_Name;
temp +="&emailaddress="; 
temp +=diag.m_Email;
temp +="\r\n";

len = strlen(temp);    
itoa(len,buf,10);

Statement += "Content-length: ";
Statement += buf;
Statement += "\r\n\r\n";
Statement += temp;	

Errorlist+=Register(HostName, Method, Action, Statement);
   
Invalidate(0);
UpdateWindow();

        
	
		// 6>*** Excite.com

HostName = "www.excite.com";
Method = "POST ";
Action = "/cgi/info.cgi";

Statement = " HTTP/1.0\r\n";
Statement += "User-Agent: Mozilla/3.0b5a (Win95;I)\r\n";
Statement += "Accept: */*\r\n";     //ENCTYPE multipart/form-data
Statement += "Content-type: application/x-www-form-urlencoded\r\n";          

temp = "url=";
temp += diag.m_URL;
temp += "&MessageType=addsite&path=http://www.excite.com/&look=excite&Action=Send\r\n";

len = strlen(temp);    
itoa(len,buf,10);

Statement += "Content-length: ";
Statement += buf;
Statement += "\r\n\r\n";
Statement += temp;	

Errorlist+=Register(HostName, Method, Action, Statement);    	//***** 
   
Invalidate(0);
UpdateWindow();



	//7>***** YELLOWWEB.COM   

HostName="www.yellowwweb.com";
Method="POST ";  
Action="/cgi-bin/wrtfre.pl";
        
Statement = " HTTP/1.0\r\n";
Statement += "User-Agent: Mozilla/3.0b5a (Win95;I)\r\n";
Statement += "Accept: */*\r\n";
Statement += "Content-type: application/x-www-form-urlencoded\r\n";          
	
temp="YLWBCAT=";
temp+=diag.m_Keyword;
temp+="&YLWBEMAIL=";
temp+=diag.m_Email;
temp+="&YLWBURL=";
temp+=diag.m_URL;
temp+="&YLWBNAME=";
temp+=diag.m_Name;
temp+="&YLWBADDR=";
temp+=diag.m_Address;
temp+="&YLWBCITY=";
temp+=diag.m_City;
temp+="&YLWBSTATE=";
temp+=diag.m_State;
temp+="&YLWBZIP=";
temp+=diag.m_Zip;
temp+="&YLWBPHONE=";
temp+=diag.m_Phone;
temp+="&YLWBFAX=";
temp+=diag.m_Fax;
temp+="&YLWBTOLL=";                  
temp+="&YLWBBOTHER=";                
temp+="&YLWBSLOGAN=";
temp+=diag.m_Comment;
temp+="&REFER=qeweret";             
temp+="\r\n";
      
len=strlen(temp);
itoa(len,buf,10);

Statement += "Content-length: ";
Statement += buf;
Statement += "\r\n\r\n";
Statement += temp;	
      
Errorlist+=Register(HostName, Method, Action, Statement);
   
Invalidate(0);
UpdateWindow();
			
						//8>*****  GALAXY.COM	
HostName="galaxy.tradewave.com";
Method="POST "; 
Action="//cgi-bin/mailin?Other+annotatepage"; 
        
Statement = " HTTP/1.0\r\n";
Statement += "User-Agent: Mozilla/3.0b5a (Win95;I)\r\n";
Statement += "Accept: */*\r\n";
Statement += "Content-type: application/x-www-form-urlencoded\r\n";          

temp="Address=";
temp+=diag.m_Address;
temp+="&Title=";
temp=diag.m_Title;
temp+="&URL=";
temp+=diag.m_URL;
temp+="&Language=";
temp+=diag.m_Language;           
temp+="&Startdate=";
temp+="a";                    
temp+="&Enddate=";
temp+="a";                    
temp+="&Type=";
temp+="Software";             
temp+="&Topic=";
temp+="Engineering-and-Technology";
temp+="&Street=";
temp+="a";                        
temp+="&City=";
temp+=diag.m_City;
temp+="&State=";
temp+=diag.m_State;
temp+="&Country=";
temp+=diag.m_Country;
temp+="&Zip=";
temp+=diag.m_Zip;
temp+="&Comment=";
temp+=diag.m_Comment;
temp+="\r\n";
      
len=strlen(temp);
itoa(len,buf,10);

Statement += "Content-length: ";
Statement += buf;
Statement += "\r\n\r\n";
Statement += temp;	
      
Errorlist+=Register(HostName, Method, Action, Statement);
   
Invalidate(0);
UpdateWindow();
				
							//9>******	INFOHIWAY.COM
HostName="www.infohiway.com";
Method="POST ";  
Action="/docs/addlist.cgi";
    
Statement = " HTTP/1.0\r\n";
Statement += "User-Agent: Mozilla/3.0b5a (Win95;I)\r\n";
Statement += "Accept: */*\r\n";
Statement += "Content-type: application/x-www-form-urlencoded\r\n";          
               	
temp="name=";
temp+=diag.m_Name;
temp+="&email=";
temp+=diag.m_Email;
temp+="&url=";
temp+=diag.m_URL;
temp+="&pname=";
temp+="a";          
temp+="&desc=";
temp+=diag.m_Comment;
temp+="&keyw=";
temp+=diag.m_Keyword;
temp+="&city=";
temp+=diag.m_City;
temp+="&state=";
temp+=diag.m_State;
temp+="&country=";
temp+=diag.m_Country;
temp+="&wr=w";
temp+="&alert=been%20there%20done%20that";
temp+="\r\n";
      
len=strlen(temp);
itoa(len,buf,10);

Statement += "Content-length: ";
Statement += buf;
Statement += "\r\n\r\n";
Statement += temp;	
      
Errorlist+=Register(HostName, Method, Action, Statement);
   
Invalidate(0);
UpdateWindow();	
	
							//10>****** WWW worm. 	
HostName = "wwww.cs.colorado.edu";
Method = "POST ";
Action = "/cgi-bin/wwwwadd";

Statement = " HTTP/1.0\r\n";
Statement += "User-Agent: Mozilla/3.0b5a (Win95;I)\r\n";
Statement += "Accept: */*\r\n";
Statement += "Content-type: application/x-www-form-urlencoded\r\n";          

temp = "URL=";
temp += diag.m_URL;
temp += "&HYP=";
temp += diag.m_Comment;
temp += "\r\n";

len = strlen(temp);    
itoa(len,buf,10);

Statement += "Content-length: ";
Statement += buf;
Statement += "\r\n\r\n";
Statement += temp;	

Errorlist+=Register(HostName, Method, Action, Statement);
CFile *ErrorStatusFile;
ErrorStatusFile = new CFile;
ErrorStatusFile->Open("ErrorStatusFile.txt", CFile::modeCreate|
					  CFile::modeNoTruncate|
					  CFile::modeWrite);
ErrorStatusFile->Write(Errorlist, strlen(Errorlist));
ErrorStatusFile->Close();
   
Invalidate(0);
UpdateWindow();
CString lastmsg = "All over.\n";
lastmsg += "Check out the HTML files for  Search Engines\r\n in the current directory using any browser\n";
MessageBox(lastmsg,"Add URL");
}

CString Register(CString HostName, CString Method,CString Action, CString Statement)
{	y=1;
	memset(TT[i],'\0',sizeof(TT[i]));
	memset(BUF2[i],'\0',sizeof(BUF2[i]));
	memset(BUF1[i],'\0',sizeof(BUF1[i]));
	WSADATA ws;
	SOCKET s;
	struct hostent *h;
	struct sockaddr_in A;
    CString e="";
	char Headers[] = " HTTP /1.0\r\n""User-Agent:AuthClient\r\n""Accept:*/*\r\n";
    
	char bb[1000], R[5000]; long g,d,f;
	int ii, k=0;
     	char buf[20];
		FILE* fp1;
		sprintf(buf,"%s.htm",HostName);
		fp1 = fopen(buf,"w");

		g = WSAStartup(0x101, &ws);
		s = socket(AF_INET, SOCK_STREAM, 0);
		if(s==SOCKET_ERROR) 
		{	
			e+=HostName;
			e+="...error in Socket\r\n";
		    sprintf(BUF2[i],"....Not Registered");
			i++;
			fclose(fp1);
			return e;
		}
		else
		{  
		 sprintf(BUF1[i],"%d",i+1); 
		 sprintf(TT[i],"connecting .... %s",HostName);
		}
		
		A.sin_family = PF_INET;
		A.sin_port = htons(80);
		h = gethostbyname(HostName); 
		
		if(h==NULL) 
		{
			  e+=HostName;
			  e+="...error in gethostbyname\r\n";
		      sprintf(BUF2[i],"....Not Registered");
			  i++;
			  fclose(fp1);
			  return e;
		}
	
		A.sin_addr.s_addr = *((unsigned long *)h->h_addr);
		
		d = connect(s,(struct sockaddr *)&A, sizeof(A));
		if (d!=0)
		{
			e+=HostName;
			e+="...error in connect\r\n";
			sprintf(BUF2[i],"....Not Registered");
			i++;
			fclose(fp1);
			return e;
	    }
		
		strcpy(bb, Method); 
      	strcat(bb, Action); 
		strcat(bb, Statement);
		strcat(bb, Headers);
		strcat(bb,"\r\n");
		
		f = send(s, bb, strlen(bb), 0);
        if (f==SOCKET_ERROR) 
		{
			e+=HostName;
			e+="...error in send\r\n";
			sprintf(BUF2[i],"....Not Registered");
			i++;
			fclose(fp1);
			return e;
		}
		
		ii = 1;
		int jj=0;
			
		while (ii!=0) 
		{
		      memset(R,'\0',sizeof(R));
		      if ((ii = recv(s,R,sizeof(R),0)) == SOCKET_ERROR) 
			  {
			    e += HostName;
				e += "error in recv\r\n";
		        sprintf(BUF2[i],"....Not Registered"); 
				i++;
				fclose(fp1);
				return e;
		      }
		
		      fputs(R,fp1);
			
	          if(jj==0)
			  {
				if( strstr(R,"HTTP/1.0 302 ") != NULL)
				{  
					fputs("\r\n<H3>Please visit the given URL to check the engine's response</H3>",fp1);
				}
			  jj=1;
		      }
		}
		fclose(fp1);		
		f = closesocket(s);
		if (f == SOCKET_ERROR) 
		{
			    e += HostName;
				e += "error in closesocket\r\n";
			    sprintf(BUF2[i],"....Not Registered");
				i++;
				return e;
		}
    	i++;
return e;
}

void CAddurlView::OnInitialUpdate() 
{
	CScrollView::OnInitialUpdate();
	CSize sizeTotal(1000,1500);
	CSize sizePage(sizeTotal.cx/2,sizeTotal.cy/2);
	CSize sizeLine(sizeTotal.cx/50,sizeTotal.cy/50);
	SetScrollSizes(MM_TEXT, sizeTotal,sizePage,sizeLine);
}

This code can be made more comprehensive by utilising the registry string of a new Engine in the same code .

To download the zipfile click here addurl.zip The zip file contains the Source Code and the Application.



Contributions :
                M N Dharamraj
                Carl Fernandes
                Imran Khan
                Shirish Dharnidharka
                Sanjay Thakur
                Arghya Banerjee
                Jignesh Patel


If you have any suggestions, comments, ideas, cracked code, feedback, feel free to get in touch with us.

Move back to the Vijay Mukhi's Technology Cornucopia Page to learn more about the other new Internet Technologies.


Vijay Mukhi's Computer Institute
VMCI, B-13, Everest Building, Tardeo, Bombay 400 034, India
E-mail:vmukhi@giasbm01.vsnl.net.in Tel : 91-22-496 4335 /6/7/8/9 Fax : 91-22-307 28 59
http://www.vijaymukhi.com