[ SPEL ] Wat zit er onder CTRL+V?
Forumregels
Dit forum is voor alle zinnige gesprekken buiten phpBB om. Discussies en gesprekken over interessante onderwerpen.
Een nieuw onderwerp moet..:
Dit forum is voor alle zinnige gesprekken buiten phpBB om. Discussies en gesprekken over interessante onderwerpen.
Een nieuw onderwerp moet..:
- uiteraard voldoen aan de algemene voorwaarden
- niet passen in de gewone supportfora
- interessante zijn voor het overgrote deel van onze gebruikers
- een neutrale of positieve ondertoon hebben
- anders zijn dan bestaande onderwerpen
rn
E=mc²
aan/uit
aan/uit
- Bas
- Berichten: 2741
- Lid geworden op: 02 dec 2003, 17:38
- Locatie: Omgeving Goslar (Duitsland)
- Contacteer:
<Script Runat="Server">
Sub Button_Click( s As Object, e As EventArgs)
Dim objMortgage As New MortgageCalculatorService
lblMonthlyPayment.Text = objMortgage.CalculatePayment(P.Text, D.Text, I.Text, T.Text)
End Sub
</Script>
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<html>
<head>
<title>Mortgage Calculator Test</title>
</head>
<body>
<form Runat="server">
Principal: <asp:Textbox ID="P" Runat="server" /><br>
Down Payment: <asp:Textbox ID="D" Runat="server" /><br>
Interest: <asp:Textbox ID="I" Runat="server" /><br>
Term: <asp:Textbox ID="T" Runat="server" /><br>
<asp:Button Text="Calculate" onClick="Button_Click" Runat="server"/>
<hr>
<asp:label ID="lblMonthlyPayment" Runat="server" />
</form>
</body>
</html>
Sub Button_Click( s As Object, e As EventArgs)
Dim objMortgage As New MortgageCalculatorService
lblMonthlyPayment.Text = objMortgage.CalculatePayment(P.Text, D.Text, I.Text, T.Text)
End Sub
</Script>
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<html>
<head>
<title>Mortgage Calculator Test</title>
</head>
<body>
<form Runat="server">
Principal: <asp:Textbox ID="P" Runat="server" /><br>
Down Payment: <asp:Textbox ID="D" Runat="server" /><br>
Interest: <asp:Textbox ID="I" Runat="server" /><br>
Term: <asp:Textbox ID="T" Runat="server" /><br>
<asp:Button Text="Calculate" onClick="Button_Click" Runat="server"/>
<hr>
<asp:label ID="lblMonthlyPayment" Runat="server" />
</form>
</body>
</html>
.Bas Hosting, gratis hosting met FTP, PHP en MySQL | viennaCMS, simpel flexibel open source CMS
Hoe ban je tegenwoordig? 'Deny' bij alle rechten!
Hoe ban je tegenwoordig? 'Deny' bij alle rechten!
//maak een Form en een Class Module aan
//maak een Form en een Class Module aan
// Form1 (Form)
// zet dit boven aan de (code) van het form
Private ontop As New cm
// click 2 keer op het form en zet het volgende er in
Set ontop = New cm
ontop.normaal hWnd
// maak een knop (bv : cmd1)
ontop.voorgrond hWnd
// maak nog een knop (bv : cmd2)
ontop.normaal hWnd
// maak een Class Module aan (bv : cm)
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Public Sub normaal(hWnd As Long)
SetWindowPos hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub
Public Sub voorgrond(hWnd As Long)
SetWindowPos hWnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub
// Form1 (Form)
// zet dit boven aan de (code) van het form
Private ontop As New cm
// click 2 keer op het form en zet het volgende er in
Set ontop = New cm
ontop.normaal hWnd
// maak een knop (bv : cmd1)
ontop.voorgrond hWnd
// maak nog een knop (bv : cmd2)
ontop.normaal hWnd
// maak een Class Module aan (bv : cm)
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Public Sub normaal(hWnd As Long)
SetWindowPos hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub
Public Sub voorgrond(hWnd As Long)
SetWindowPos hWnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub
//
//
// Part of bot MOD: This function checks whether the user agent or ip is
// listed as a bot and returns true otherwise false.
//
function is_robot()
{
global $db, $HTTP_SERVER_VARS, $table_prefix;
// define bots table - for the users who are to lazy to edit constants.php hehehe!
define('BOTS_TABLE', $table_prefix . "bots");
// get required user data
$user_ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$user_agent = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
// get bot table data
$sql = "SELECT bot_agent, bot_ip, bot_id, bot_visits, last_visit, bot_pages, bot_name
FROM " . BOTS_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain bot data.', '', __LINE__, __FILE__, $sql);
}
// loop through bots table
while ($row = $db->sql_fetchrow($result))
{
// clear vars
$agent_match = 0;
$ip_match = 0;
// check for user agent match
foreach (explode('|', $row['bot_agent']) as $bot_agent)
{
if ($row['bot_agent'] && $bot_agent != '' && preg_match('#' . preg_quote($bot_agent, '#') . '#i', $user_agent)) $agent_match = 1;
}
// check for ip match
foreach (explode('|', $row['bot_ip']) as $bot_ip)
{
if ($row['bot_ip'] && $bot_ip != '' && strpos($user_ip, $bot_ip) === 0)
{
$ip_match = 1;
break;
}
}
// if both ip and agent matched update table and return true
if ($agent_match == 1 && $ip_match == 1)
{
// get time - seconds from epoch
$today = time();
$last_visits = explode('|', $row['last_visit']);
// if half an hour has passed since last visit
if (($today - (($last_visits[0] == '') ? 0 : $last_visits[0])) > 2700)
{
for ($i = ((4 > sizeof($last_visits)) ? sizeof($last_visits) : 4); $i >= 0; $i--)
{
if ($last_visits[$i-1] != '') $last_visits[$i] = $last_visits[$i-1];
}
// increment the new visit counter
$row['bot_visits']++;
// clear prior indexed pages
$row['bot_pages'] = 1;
} else {
// add to indexed pages
$row['bot_pages']++;
}
$last_visits[0] = $today;
// compress it all together
$last_visit = implode("|", $last_visits);
// update table
$sql = "UPDATE " . BOTS_TABLE . "
SET last_visit='$last_visit', bot_visits='" . $row['bot_visits'] . "', bot_pages='" . $row['bot_pages'] . "'
WHERE bot_id = " . $row['bot_id'];
if ( !($result2 = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t update data in bots table.', '', __LINE__, __FILE__, $sql);
}
return $row['bot_name'];
}
else
{
if ($agent_match == 1 || $ip_match == 1)
{
// get data from table
$sql = "SELECT pending_" . ((!$agent_match) ? 'agent' : 'ip') . "
FROM " . BOTS_TABLE . "
WHERE bot_id = " . $row['bot_id'];
if ( !($result2 = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain bot data.', '', __LINE__, __FILE__, $sql);
}
$row2 = $db->sql_fetchrow($result2);
// add ip/agent to the list
$pending_array = (( $row2['pending_' . ((!$agent_match) ? 'agent' : 'ip')] ) ? explode('|', $row2['pending_' . ((!$agent_match) ? 'agent' : 'ip')]) : array());
$found = 0;
if ( sizeof($pending_array) )
{
for ($loop = 0; $loop < count($pending_array); $loop+=2)
{
if ($pending_array[$loop] == ((!$agent_match) ? $user_agent : $user_ip)) $found = 1;
}
}
if ($found == 0)
{
$pending_array[] = ((!$agent_match) ? str_replace("|", "|", $user_agent) : $user_ip);
$pending_array[] = ((!$agent_match) ? $user_ip : str_replace("|", "|", $user_agent));
}
$pending = implode("|", $pending_array);
// update table
$sql = "UPDATE " . BOTS_TABLE . "
SET pending_" . ((!$agent_match) ? 'agent' : 'ip') . "='$pending'
WHERE bot_id = " . $row['bot_id'];
if ( !($result2 = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t update data in bots table.', '', __LINE__, __FILE__, $sql);
}
}
}
}
return 0;
}
// Part of bot MOD: This function checks whether the user agent or ip is
// listed as a bot and returns true otherwise false.
//
function is_robot()
{
global $db, $HTTP_SERVER_VARS, $table_prefix;
// define bots table - for the users who are to lazy to edit constants.php hehehe!
define('BOTS_TABLE', $table_prefix . "bots");
// get required user data
$user_ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$user_agent = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
// get bot table data
$sql = "SELECT bot_agent, bot_ip, bot_id, bot_visits, last_visit, bot_pages, bot_name
FROM " . BOTS_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain bot data.', '', __LINE__, __FILE__, $sql);
}
// loop through bots table
while ($row = $db->sql_fetchrow($result))
{
// clear vars
$agent_match = 0;
$ip_match = 0;
// check for user agent match
foreach (explode('|', $row['bot_agent']) as $bot_agent)
{
if ($row['bot_agent'] && $bot_agent != '' && preg_match('#' . preg_quote($bot_agent, '#') . '#i', $user_agent)) $agent_match = 1;
}
// check for ip match
foreach (explode('|', $row['bot_ip']) as $bot_ip)
{
if ($row['bot_ip'] && $bot_ip != '' && strpos($user_ip, $bot_ip) === 0)
{
$ip_match = 1;
break;
}
}
// if both ip and agent matched update table and return true
if ($agent_match == 1 && $ip_match == 1)
{
// get time - seconds from epoch
$today = time();
$last_visits = explode('|', $row['last_visit']);
// if half an hour has passed since last visit
if (($today - (($last_visits[0] == '') ? 0 : $last_visits[0])) > 2700)
{
for ($i = ((4 > sizeof($last_visits)) ? sizeof($last_visits) : 4); $i >= 0; $i--)
{
if ($last_visits[$i-1] != '') $last_visits[$i] = $last_visits[$i-1];
}
// increment the new visit counter
$row['bot_visits']++;
// clear prior indexed pages
$row['bot_pages'] = 1;
} else {
// add to indexed pages
$row['bot_pages']++;
}
$last_visits[0] = $today;
// compress it all together
$last_visit = implode("|", $last_visits);
// update table
$sql = "UPDATE " . BOTS_TABLE . "
SET last_visit='$last_visit', bot_visits='" . $row['bot_visits'] . "', bot_pages='" . $row['bot_pages'] . "'
WHERE bot_id = " . $row['bot_id'];
if ( !($result2 = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t update data in bots table.', '', __LINE__, __FILE__, $sql);
}
return $row['bot_name'];
}
else
{
if ($agent_match == 1 || $ip_match == 1)
{
// get data from table
$sql = "SELECT pending_" . ((!$agent_match) ? 'agent' : 'ip') . "
FROM " . BOTS_TABLE . "
WHERE bot_id = " . $row['bot_id'];
if ( !($result2 = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain bot data.', '', __LINE__, __FILE__, $sql);
}
$row2 = $db->sql_fetchrow($result2);
// add ip/agent to the list
$pending_array = (( $row2['pending_' . ((!$agent_match) ? 'agent' : 'ip')] ) ? explode('|', $row2['pending_' . ((!$agent_match) ? 'agent' : 'ip')]) : array());
$found = 0;
if ( sizeof($pending_array) )
{
for ($loop = 0; $loop < count($pending_array); $loop+=2)
{
if ($pending_array[$loop] == ((!$agent_match) ? $user_agent : $user_ip)) $found = 1;
}
}
if ($found == 0)
{
$pending_array[] = ((!$agent_match) ? str_replace("|", "|", $user_agent) : $user_ip);
$pending_array[] = ((!$agent_match) ? $user_ip : str_replace("|", "|", $user_agent));
}
$pending = implode("|", $pending_array);
// update table
$sql = "UPDATE " . BOTS_TABLE . "
SET pending_" . ((!$agent_match) ? 'agent' : 'ip') . "='$pending'
WHERE bot_id = " . $row['bot_id'];
if ( !($result2 = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t update data in bots table.', '', __LINE__, __FILE__, $sql);
}
}
}
}
return 0;
}
-
- Berichten: 75
- Lid geworden op: 13 feb 2003, 21:51
- Locatie: Hasselt
- Contacteer:
- Bas
- Berichten: 2741
- Lid geworden op: 02 dec 2003, 17:38
- Locatie: Omgeving Goslar (Duitsland)
- Contacteer:
.................
.Bas Hosting, gratis hosting met FTP, PHP en MySQL | viennaCMS, simpel flexibel open source CMS
Hoe ban je tegenwoordig? 'Deny' bij alle rechten!
Hoe ban je tegenwoordig? 'Deny' bij alle rechten!