Changeset 171
- Timestamp:
- 02/24/05 15:09:46 (20 years ago)
- Location:
- branches/new-search-20050223
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new-search-20050223/cgi-bin/main.cgi
r167 r171 123 123 # Search term entered. Display matches. 124 124 # We should really sanitize $webvar{input}, no? 125 viewBy($webvar{searchfor}, $webvar{input}); 125 # need to munge up data for $webvar{searchfor}, rather than breaking things here. 126 my $searchfor; 127 # Chew up leading and trailing whitespace 128 $webvar{input} =~ s/^\s+//; 129 $webvar{input} =~ s/\s+$//; 130 if ($webvar{input} =~ /^(\d{1,3}\.){3}\d{1,3}\/\d{1,3}$/) { 131 # "Perfect" IP subnet match 132 $searchfor = "ipblock"; 133 } elsif ($webvar{input} =~ /^(\d{1,3}\.){3}\d{1,3}$/) { 134 # "Perfect" IP address match (shows containing block) 135 $searchfor = "ipblock"; 136 } elsif ($webvar{input} =~ /^(\d{1,3}\.){2}\d{1,3}(\.\d{1,3}?)?/) { 137 # Partial IP match 138 $searchfor = "ipblock"; 139 } elsif ($webvar{input} =~ /^\d+$/) { 140 # All-digits, new custID 141 $searchfor = "cust"; 142 } else { 143 # Anything else. 144 $searchfor = "desc"; 145 } 146 viewBy($searchfor, $webvar{input}); 126 147 } 127 148 } -
branches/new-search-20050223/header.inc
r87 r171 41 41 <td width=10></td> 42 42 <form method="POST" action="/ip/cgi-bin/main.cgi"> 43 <td> Search:43 <td>Quick Search: 44 44 <input type="text" name="input" size="20" maxlength="50" class="regular"> 45 <input type=radio name="searchfor" value="ipblock">IP/IP block46 <input type=radio name="searchfor" value="desc" checked=yes>Description47 <input type=radio name="searchfor" value="cust">Customer ID48 45 <input type=hidden name=page value="1"> 49 46 <input type=hidden name=action value="search">
Note:
See TracChangeset
for help on using the changeset viewer.