homepage Welcome to WebmasterWorld Guest from 54.211.213.10
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque & physics

Webmaster General Forum

    
Finding Form Code
Can't remember where I posted autoresponder subscription forms
calvinmicklefinger




msg:4144472
 8:03 pm on May 31, 2010 (gmt 0)

I have a gazillion web pages and a half-zillion autoresponder series with forms spread all over a bunch of websites.

I would like to organize and systemitize my autoresponders, deleting the ones I want to abandon, and revamping the ones that are producing.

Since I was stoopid and didn't use tracking tags efficiently, I don't know which page has which form where subscribers sign up for which newsletter.

Is there a way to do an online search for the form "action" that will allow me to identify the pages where the forms are and at least reduce my meanderings to something sizable?

I can't find a google search operator or term that works.

Any help will be appreciated.

Kirk

 

MichaelBluejay




msg:4144874
 1:34 pm on Jun 1, 2010 (gmt 0)

You're right, you can't use a search engine to search for <html> code. (At least none that I know of.) You'll need to write a script (e.g., Perl or PHP) to search through the files on your server.

calvinmicklefinger




msg:4144908
 2:13 pm on Jun 1, 2010 (gmt 0)

Thanks Michael,

Yep. Spent yesterday downloading most of the websites and am going to use a text string search app to go through the files and identify the location for me. Then do the changes and learn a big lesson. LOL.

Thanks again,
Kirk

MichaelBluejay




msg:4145437
 6:11 am on Jun 2, 2010 (gmt 0)

You don't have to download the files, you can run a script directly on your server. Here's a Perl script I use (in a password-protected directory).

#!/usr/bin/perl 

print "Content-type:text/html\n\n";

$textToFind = "<form";
undef $\;
use File::Find;
find(\&processFiles, "/home/user/example.com/");

sub processFiles {
$filename= "$File::Find::name";
if ($filename =~/\.(html|txt|php|cgi|pl)$/) {
open (FILE, "<$filename");
$file = <FILE>;
close (FILE);

if ($file =~/\Q$textToFind\E/si) { print "$filename<BR>"; last;}
}
}


Just create a file called something like "find.pl", put the above code into it, set the file's permissions to 755 with chmod, and then run it from a web browser (e.g., http://example.com/find.pl).

Google "chmod 755" if you don't know about file permissions.

calvinmicklefinger




msg:4145602
 11:53 am on Jun 2, 2010 (gmt 0)

Thanks Michael,

I isn't an coder, so I couldn't have thunk of that ... especially in Perl! PHP I can halfway read, but Perl and Regex is like being a "Stranger in a strange land" to me.

Thanks again.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved