Jump to content

mtoynbee

Members
  • Posts

    111
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling
  • Location
    Hythe, SE England

mtoynbee's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a delete trigger but I want to email me the username field value that has been deleted. Is this possible - if so how? Sample code: CREATE TRIGGER delUsers ON db_users AFTER DELETE AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; EXECUTE MSDB.dbo.sp_send_dbmail @profile_name = 'Mail Profile 1' , @recipients = 'me@email.co.uk' , @copy_recipients = '' , @blind_copy_recipients = '' , @SUBJECT = 'User Deleted' , @body = 'User Deleted' , @body_format = 'HTML' , @importance = 'Normal' , @sensitivity = 'Normal' END GO
  2. http://www.html-faq.com/htmlframes/?framesareevil
  3. Was trying to keep it as close to the original script as possible. However I would actually use my selectbox function... if (!function_exists('SelectBox')) { function SelectBox($name,$class,$vars,$labels,$js=false,$alphabetise=false,$status=false,$selected_value=false,$dont_title_case=false,$return_as_variable=false) { if ($selected_value) { $selected_value = ereg_replace("\(","\\(",$selected_value); $selected_value = ereg_replace("\)","\\)",$selected_value); $selected_value = ereg_replace("\?","\\?",$selected_value); if (!eregi("\^|",$vars)) { $remove_bars = true; } $vars = "|".$vars."|"; $vars = ereg_replace("\|".$selected_value."\|", "\|".$selected_value."*\|", $vars); if (substr($vars, -1) == "|" && !$remove_bars) { $vars = substr($vars,1,-1); } if (substr($vars, -1) == "|" && $remove_bars) { $vars = substr($vars,0,-1); } $vars = stripslashes($vars); unset($selected_value); if ($remove_bars) { $vars = substr ($vars,1); } } if (eregi("\(Blanks\)",$labels)) { $rearrange_array = true; } $class = explode ("|",$class); $vars = explode ("|",$vars); $labels = explode ("|",$labels); if ($alphabetise) { if ($rearrange_array) { $labels = array_slice($labels, 0, count($labels) - 2); $vars = array_slice($vars, 0, count($vars) - 2); array_multisort($labels, SORT_ASC, SORT_STRING, $vars, SORT_NUMERIC, SORT_DESC); array_push($labels, "(Blanks)", "(NonBlanks)"); array_push($vars, "(Blanks)", "(NonBlanks)"); } else { array_multisort($labels, SORT_ASC, SORT_STRING, $vars, SORT_NUMERIC, SORT_DESC); } } if ($js == "redirect_blank") { $js = "window.open(this.form.$name.options[this.form.$name.selectedIndex].value);"; } if ($js == "redirect") { $js = "location=this.form.$name.options[this.form.$name.selectedIndex].value;"; } if ($js) { if (!eregi("^onfocus",$js) && !eregi("^onblur",$js) && !eregi("^onclick",$js) && !eregi("^onmouseover",$js)) { $js = " onchange=\"$js\""; } } $returned_sb = "<select name=\"$name\" id=\"$name\" class=\"$class[0]\"$js $status>"; for ($i=0;$i<count($labels);$i++) { if ($class[1] && $i > 0) { $class[0] = $class[1]; } if (eregi("\*",$vars[$i])) { $vars[$i] = ereg_replace ("\*", "", $vars[$i]); $labels[$i] = ereg_replace ("\*", "", $labels[$i]); $returned_sb.= "<option class=\"$class[0]\" value=\"".trim($vars[$i])."\" selected=\"selected\">".strtotitle(trim($labels[$i]),$dont_title_case)."</option>"; } else { $returned_sb.= "<option class=\"$class[0]\" value=\"".trim($vars[$i])."\">".strtotitle(trim($labels[$i]),$dont_title_case)."</option>"; } } $returned_sb.= "</select>"; if ($return_as_variable == true) { return $returned_sb; } else { echo $returned_sb; } } }
  4. This is a good solution for what you are doing: <?php echo "<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">"; echo "Month: <select name=\"month\" id=\"month\">"; $topValue = isset($_POST['month'])?intval($_POST['month']):"Select"; echo "<option value=\"please pick\" >".$topValue."</option>"; echo "<option value=\"1\">1</option>"; echo "<option value=\"2\">2</option>"; echo "<option value=\"3\">3</option>"; echo "<option value=\"4\">4</option>"; echo "<option value=\"5\">5</option>"; echo "<option value=\"6\">6</option>"; echo "<option value=\"7\">7</option>"; echo "<option value=\"8\">8</option>"; echo "<option value=\"9\">9</option>"; echo "<option value=\"10\">10</option>"; echo "<option value=\"11\">11</option>"; echo "<option value=\"12\">12</option>"; echo "</select>";
  5. Need single quotes around date in sql query $query = mysql_query("SELECT * FROM `mp3links` WHERE `foundtime` < '".$day_old."' AND `scraped` != '0' ORDER BY `foundtime` DESC") or die(mysql_error());
  6. You need to add: error_reporting(E_ALL); So you can determine the error and which line. However I think it is the syntax: print"<b>Last name:</b>{$_POST['lname']} <br>"; Should be: print"<b>Last name:</b>".$_POST['lname']."<br>"; And the same for fname...
  7. It could be dodgy - I have seem some encrypted JS which can run nasty ActiveX programmes on your PC. It looks a lot like this code.
  8. echo $query = "insert into $table (event_name, venue_name, streetaddress1, streetaddress2, town, event_description, event_date, event_time) values ('" .$_SESSION['evname']. "', '".$_SESSION['venuename']."', '".$_SESSION['addr1']."', '".$_SESSION['addr2']."', '".$_SESSION['town']."', '".$_SESSION['content']."', '".$_SESSION['fulldate']."', '".$_SESSION['time']."',)"; $insert = mysql_query($query) or die("Could not insert data because ".mysql_error());
  9. The loop should start with 1 - sorry see code below - have tested and works <script> function countTotal() // Note no variables { var total = 0; var fieldName; for(i=1;i<19;i++) { fieldName = 'total_shot_'+i; if (!isNaN(Number(document.getElementById(fieldName).value))) { total=total+Number(document.getElementById(fieldName).value); } } document.getElementById("total").value = total; } </script> <input class="gameData" name="total_shot_1" type="text" id="total_shot_1" size="2" maxlength="2" onChange="javascript:countTotal();"> <input class="gameData" name="total_shot_2" type="text" id="total_shot_2" size="2" maxlength="2" onChange="javascript:countTotal();"> <input class="gameData" name="total_shot_3" type="text" id="total_shot_3" size="2" maxlength="2" onChange="javascript:countTotal();"> <input class="gameData" name="total_shot_4" type="text" id="total_shot_4" size="2" maxlength="2" onChange="javascript:countTotal();"> etc up to 18 <input class="gameData" name="total" type="text" id="total" size="2" maxlength="2" value="0">
  10. function countTotal() // Note no variables { var total = 0; var fieldName; for(i=0;i<19;i++) { fieldName = 'total_shot_'+i; if (!isNaN(Number(document.getElementById(fieldName).value))) { total=total+Number(document.getElementById(fieldName).value); } } document.getElementById("total").value = total; }
  11. SELECT COUNT(*) AS player_count FROM players WHERE prison >= 1
  12. echo "<td><div align='center'><a href=\"mailto:" . $row['email'] . "\">" . $row['email'] . "</a></td>";
  13. There is a much simpler way of doing it than that - but is easier to explain when I can refer to parts of the original code - please post it.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.