Search Results

Search found 2852 results on 115 pages for 'kevin strong'.

Page 6/115 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • PHP/MySQL allowing current user to edit there account information

    - by user1837896
    i have created 2 pages update.php edit.php we start on edit.php so here is edit.php's script <?php session_start(); $id = $_SESSION["id"]; $username = $_POST["username"]; $fname = $_POST["fname"]; $password = $_POST["password"]; $email = $_POST["email"]; mysql_connect('mysql13.000webhost.com', 'a2670376_Users', 'Password') or die(mysql_error()); echo "MySQL Connection Established! <br>"; mysql_select_db("a2670376_Pass") or die(mysql_error()); echo "Database Found! <br>"; $query = "UPDATE members SET username = '$username', fname = '$fname', password = '$password' WHERE id = '$id'"; $res = mysql_query($query); if ($res) echo "<p>Record Updated<p>"; else echo "Problem updating record. MySQL Error: " . mysql_error(); ?> <form action="update.php" method="post"> <input type="hidden" name="id" value="<?=$id;?>"> ScreenName:<br> <input type='text' name='username' id='username' maxlength='25' style='width:247px' name="username" value="<?=$username;?>"/><br> FullName:<br> <input type='text' name='fname' id='fname' maxlength='20' style='width:248px' name="ud_img" value="<?=$fname;?>"/><br> Email:<br> <input type='text' name='email' id='email' maxlength='50' style='width:250px' name="ud_img" value="<?=$email;?>"/><br> Password:<br> <input type='text' name='password' id='password' maxlength='25' style='width:251px' value="<?=$password;?>"/><br> <input type="Submit"> </form> now here is the update.php page where i am having the MAJOR problem <?php session_start(); mysql_connect('mysql13.000webhost.com', 'a2670376_Users', 'Password') or die(mysql_error()); mysql_select_db("a2670376_Pass") or die(mysql_error()); $id = (int)$_SESSION["id"]; $username = mysql_real_escape_string($_POST["username"]); $fname = mysql_real_escape_string($_POST["fname"]); $email = mysql_real_escape_string($_POST["email"]); $password = mysql_real_escape_string($_POST["password"]); $query="UPDATE members SET username = '$username', fname = '$fname', email = '$email', password = '$password' WHERE id='$id'"; mysql_query($query)or die(mysql_error()); if(mysql_affected_rows()>=1){ echo "<p>($id) Record Updated<p>"; }else{ echo "<p>($id) Not Updated<p>"; } ?> now on edit.php i fill out the form to edit the account "test" while i am logged into it now once the form if filled out i click on |Submit!| button and it takes me to update.php and it returns this (0) Not Updated (0) <= id of user logged in Not Updated <= MySql Error from mysql_query($query)or die(mysql_error()); if(mysql_affected_rows()>=1){ i want it to update the user logged in and if i am not mistaken in this script it says $id = (int)$_SESSION["id"]; witch updates the user with the id of the person who is logged in but it isnt updating its saying that no tables were effected if it helps heres my MySql Database picture just click here http://i50.tinypic.com/21juqfq.png if this could possibly be any help to find the solution i have 2 more files delete.php and delete_ac.php they have can remove users from my sql database and they show the user id and it works there are no bugs in this script at all PLEASE DO NOT MAKE SUGGESTIONS FOR THE SCRIPTS BELOW delete.php first <?php $host="mysql13.000webhost.com"; // Host name $username="a2670376_Users"; // Mysql username $password="PASSWORD"; // Mysql password $db_name="a2670376_Pass"; // Database name $tbl_name="members"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // select record from mysql $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); ?> <table border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td colspan="8" style="bgcolor: #FFFFFF"><strong><img src="http://i47.tinypic.com/u6ihk.png" height="30" widht="30">Delete data in mysql</strong> </td> </tr> <tr> <td align="center" bgcolor="#FFFFFF"><strong>Id</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>UserName</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>FullName</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Password</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Email</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Date</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Ip</strong></td> <td align="center" bgcolor="#FFFFFF">&nbsp;</td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td bgcolor="#FFFFFF"><? echo $rows['id']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['username']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['fname']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['password']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['email']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['date']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['ip']; ?></td> <td bgcolor="#FFFFFF"><a href="delete_ac.php?id=<? echo $rows['id']; ?>">delete</a></td> </tr> <?php // close while loop } ?> </table> <?php // close connection; sql_close(); ?> and now delete_ac.php <table width="500" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td colspan="8" bgcolor="#FFFFFF"><strong><img src="http://t2.gstatic.com/images? q=tbn:ANd9GcS_kwpNSSt3UuBHxq5zhkJQAlPnaXyePaw07R652f4StmvIQAAf6g" height="30" widht="30">Removal Of Account</strong> </td> </tr> <tr> <td align="center" bgcolor="#FFFFFF"> <?php $host="mysql13.000webhost.com"; // Host name $username="a2670376_Users"; // Mysql username $password="javascript00"; // Mysql password $db_name="a2670376_Pass"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // get value of id that sent from address bar $id=$_GET['id']; // Delete data in mysql from row that has this id $sql="DELETE FROM $tbl_name WHERE id='$id'"; $result=mysql_query($sql); // if successfully deleted if($result){ echo "Deleted Successfully"; echo "<BR>"; echo "<a href='delete.php'>Back to main page</a>"; } else { echo "ERROR"; } ?> <?php // close connection mysql_close(); ?> </td> </tr> </table>

    Read the article

  • CSS background images not showing in IE?

    - by Kevin
    In IE8 and below, I'm doing this <ul class="dependants_list" style="border-bottom: dashed 1px #53a1dc"> <li class="dependants_summary"> <strong>Name:</strong> De Silva, Angelina<br /> <strong>Gender:</strong> Female<br /> <strong>Date of birth:</strong> 7/3/2009<br /> </li> <form action="/Dependant/Delete/11413" method="get"><input class="delete btn" id="Delete_this_Profile" name="Delete_this_Profile" type="submit" value="Delete this Profile" /> </form><form action="/Dependant/Edit/11413" method="get"><input class="edit btn" id="Modify_this_Profile" name="Modify_this_Profile" type="submit" value="Modify this Profile" /> </form><br /><hr style="display:none" /> and the CSS for it is: .dependants_summary { overflow: hidden; margin-bottom: 10px; padding-right: 0px; padding-left: 85px; padding-top: 5px; padding-bottom: 5px; width: 430px; float: left; font: 120% Arial, Helvetica, sans-serif; } .dependants_list { padding: 0; } .dependants_list li:nth-child(odd) { background: #fff url("../images/dependant_male.png") no-repeat scroll 8px 9px; } .dependants_list li:nth-child(even) { background: #c9e3f4 url("../images/dependant_male.png") no-repeat scroll 8px 9px; } The images are not being shown in IE, but they are in ffox and chrome

    Read the article

  • Simple show/hide jQuery troubles

    - by Banderdash
    Okay, I feel like a bit of a 800 pound gorilla trying to thread a needle when it comes to jQuery. I need a script that will preform a simple show/hide (preferably with a nice sliding in and out) on a list. My markup looks like this: <div id="themes"> <h2>Research Themes</h2> <ul> <li class="tier_1"><a href="">Learn about our approach to the <strong>environment</strong></a> <ul class="tier_2 hide"> <li><a href=""><em>How we are tying this all together</em></a></li> <li><a href=""><strong>Project:</strong> Solor Powered Biofactories</a></li> <li><a href=""><strong>Project:</strong> Cleaning Water with Nature</a></li> <li><a href=""><strong>Project:</strong> Higher Efficiency Solar Technology</a></li> </ul> </li> <li class="tier_1"><a href="">Learn about our approach to <strong>human health</strong></a> <ul class="tier_2 hide"> <li><a href="">Project name numero uno goes here</a></li> <li><a href="">Project name numero dos goes here</a></li> <li><a href="">Project name numero tres goes here</a></li> </ul> </li> <li class="tier_1"><a href="">Learn about our approach to <strong>national defense</strong></a> <ul class="tier_2 hide"> <li><a href="">Project name numero uno goes here</a></li> <li><a href="">Project name numero dos goes here</a></li> <li><a href="">Project name numero tres goes here</a></li> </ul> </li> </ul> </div><!-- // end themes --> You can see that each nested ul has a class of "tier_2" and "hide". Ideally when the li they are nested within ("li.tier_1") is clicked it's child ul will have the hide class removed and the li's contained within will slideout, but at the same time should check all the other ul.tier_2's and be sure they get a hide class--so only one theme can be expanded at a time. I set up a sandbox to try some things: http://jsbin.com/odete/3 My JS looks like this: $(function(){ $(".tier_1 a").each(function(i,o){ $(this).click(function(e){ e.preventDefault(); $(this).addClass("show").siblings("ul").removeClass("show"); $("ul.tier_2:eq("+i+")").show().siblings("ul.tier_2").hide(); }); }); }); Totally a dumb way to do this, I am sure. But I based it off another script and it does work "a little bit" as you can see in the sandbox. If one of you mean hands at jQuery might be so inclined to take a peek I'd be very grateful. If you could also advise on how to have the transitions slideIn and Out that would also be fantastic!

    Read the article

  • jQuery Hover functions

    - by Banderdash
    Thus far you guys have been wildly helpful with me getting this little ditty working just so. I have one further request: This markup: <div id="themes"> <h2>Research Themes</h2> <ul> <li class="tier_1"><a class="enviro" href="">Learn about our approach to the <strong>environment</strong></a> <ul class="tier_2 hide"> <li><a href=""><em>How we are tying this all together</em></a></li> <li><a href="off.html"><strong>Project:</strong> Solor Powered Biofactories</a></li> <li><a href=""><strong>Project:</strong> Cleaning Water with Nature</a></li> <li><a href=""><strong>Project:</strong> Higher Efficiency Solar Technology</a></li> </ul> </li> <li class="tier_1"><a class="health" href="">Learn about our approach to <strong>human health</strong></a> <ul class="tier_2 hide"> <li><a href="">Project name numero uno goes here</a></li> <li><a href="">Project name numero dos goes here</a></li> <li><a href="">Project name numero tres goes here</a></li> </ul> </li> <li class="tier_1"><a class="defense" href="">Learn about our approach to <strong>national defense</strong></a> <ul class="tier_2 hide"> <li><a href="">Project name numero uno goes here</a></li> <li><a href="">Project name numero dos goes here</a></li> <li><a href="">Project name numero tres goes here</a></li> </ul> </li> </ul> </div><!-- // end themes --> And this jQuery: $(function(){ $(".tier_1 > a").hover(function() { var currentList = jQuery(this).parents('li').find('.tier_2'); $(currentList).slideToggle(); jQuery(this).parents('ul').find('.tier_2').not(currentList).slideUp(); return false; }); }); Create this nifty 'themes' slider you can see working on the right column of this page: http://clients.pixelbleed.net/biodesign/ I have two problems with it...The hover retracts the slideUp/down when you hit one of the links under a tier_2 ul. I'd like it to remain slideout as someone hovers the nested li's. So the slide should only happen on hover for the tier_1 elements. Also I would like, on hover to add an "active" class to the a element on the tier_1 links. So [a class="enviro"..] would, on hover, become [a class="enviro active"]. This is then removed when one of the other tier_1 items is hovered. This way the pretty color icon can stay visible while someone looks at the nested elements. Not even sure all that is possible with hover, but I figured if anyone would know a way it would be here.

    Read the article

  • Hover function for accordion

    - by Banderdash
    Thus far you guys have been wildly helpful with me getting this little ditty working just so. I have one further request: This markup: <div id="themes"> <h2>Research Themes</h2> <ul> <li class="tier_1"><a class="enviro" href="">Learn about our approach to the <strong>environment</strong></a> <ul class="tier_2 hide"> <li><a href=""><em>How we are tying this all together</em></a></li> <li><a href="off.html"><strong>Project:</strong> Solor Powered Biofactories</a></li> <li><a href=""><strong>Project:</strong> Cleaning Water with Nature</a></li> <li><a href=""><strong>Project:</strong> Higher Efficiency Solar Technology</a></li> </ul> </li> <li class="tier_1"><a class="health" href="">Learn about our approach to <strong>human health</strong></a> <ul class="tier_2 hide"> <li><a href="">Project name numero uno goes here</a></li> <li><a href="">Project name numero dos goes here</a></li> <li><a href="">Project name numero tres goes here</a></li> </ul> </li> <li class="tier_1"><a class="defense" href="">Learn about our approach to <strong>national defense</strong></a> <ul class="tier_2 hide"> <li><a href="">Project name numero uno goes here</a></li> <li><a href="">Project name numero dos goes here</a></li> <li><a href="">Project name numero tres goes here</a></li> </ul> </li> </ul> </div><!-- // end themes --> And this jQuery: $(function(){ $(".tier_1 > a").hover(function() { var currentList = jQuery(this).parents('li').find('.tier_2'); $(currentList).slideToggle(); jQuery(this).parents('ul').find('.tier_2').not(currentList).slideUp(); return false; }); }); Create this nifty 'themes' slider you can see working on the right column of this page: http://clients.pixelbleed.net/biodesign/ I have two problems with it...The hover retracts the slideUp/down when you hit one of the links under a tier_2 ul. I'd like it to remain slideout as someone hovers the nested li's. So the slide should only happen on hover for the tier_1 elements. Also I would like, on hover to add an "active" class to the a element on the tier_1 links. So [a class="enviro"..] would, on hover, become [a class="enviro active"]. This is then removed when one of the other tier_1 items is hovered. This way the pretty color icon can stay visible while someone looks at the nested elements. Not even sure all that is possible with hover, but I figured if anyone would know a way it would be here.

    Read the article

  • Why am I getting a " instance has no attribute '__getitem__' " error?

    - by Kevin Yusko
    Here's the code: class BinaryTree: def __init__(self,rootObj): self.key = rootObj self.left = None self.right = None root = [self.key, self.left, self.right] def getRootVal(root): return root[0] def setRootVal(newVal): root[0] = newVal def getLeftChild(root): return root[1] def getRightChild(root): return root[2] def insertLeft(self,newNode): if self.left == None: self.left = BinaryTree(newNode) else: t = BinaryTree(newNode) t.left = self.left self.left = t def insertRight(self,newNode): if self.right == None: self.right = BinaryTree(newNode) else: t = BinaryTree(newNode) t.right = self.right self.right = t def buildParseTree(fpexp): fplist = fpexp.split() pStack = Stack() eTree = BinaryTree('') pStack.push(eTree) currentTree = eTree for i in fplist: if i == '(': currentTree.insertLeft('') pStack.push(currentTree) currentTree = currentTree.getLeftChild() elif i not in '+-*/)': currentTree.setRootVal(eval(i)) parent = pStack.pop() currentTree = parent elif i in '+-*/': currentTree.setRootVal(i) currentTree.insertRight('') pStack.push(currentTree) currentTree = currentTree.getRightChild() elif i == ')': currentTree = pStack.pop() else: print "error: I don't recognize " + i return eTree def postorder(tree): if tree != None: postorder(tree.getLeftChild()) postorder(tree.getRightChild()) print tree.getRootVal() def preorder(self): print self.key if self.left: self.left.preorder() if self.right: self.right.preorder() def inorder(tree): if tree != None: inorder(tree.getLeftChild()) print tree.getRootVal() inorder(tree.getRightChild()) class Stack: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self): return self.items[len(self.items)-1] def size(self): return len(self.items) def main(): parseData = raw_input( "Please enter the problem you wished parsed.(NOTE: problem must have parenthesis to seperate each binary grouping and must be spaced out.) " ) tree = buildParseTree(parseData) print( "The post order is: ", + postorder(tree)) print( "The post order is: ", + postorder(tree)) print( "The post order is: ", + preorder(tree)) print( "The post order is: ", + inorder(tree)) main() And here is the error: Please enter the problem you wished parsed.(NOTE: problem must have parenthesis to seperate each binary grouping and must be spaced out.) ( 1 + 2 ) Traceback (most recent call last): File "C:\Users\Kevin\Desktop\Python Stuff\Assignment 11\parseTree.py", line 108, in main() File "C:\Users\Kevin\Desktop\Python Stuff\Assignment 11\parseTree.py", line 102, in main tree = buildParseTree(parseData) File "C:\Users\Kevin\Desktop\Python Stuff\Assignment 11\parseTree.py", line 46, in buildParseTree currentTree = currentTree.getLeftChild() File "C:\Users\Kevin\Desktop\Python Stuff\Assignment 11\parseTree.py", line 15, in getLeftChild return root[1] AttributeError: BinaryTree instance has no attribute '__getitem__'

    Read the article

  • Blank Mail from PHP application

    - by brettlwilliams
    Problem: Blank email from PHP web application. Confirmed: App works in Linux, has various problems in Windows server environment. Blank emails are the last remaining problem. PHP Version 5.2.6 on the server I'm a librarian implementing a PHP based web application to help students complete their assignments.I have installed this application before on a Linux based free web host and had no problems. Email is controlled by two files, email_functions.php and email.php. While email can be sent, all that is sent is a blank email. My IT department is an ASP only shop, so I can get little to no help there. I also cannot install additional libraries like PHPmail or Swiftmailer. You can see a functional copy at http://rpc.elm4you.org/ You can also download a copy from Sourceforge from the link there. Thanks in advance for any insight into this! email_functions.php <?php /********************************************************** Function: build_multipart_headers Author: Michael Berkowski Last Modified: September 2007 *********************************************************** Purpose: Creates email headers for a message of type multipart/mime This will include a plain text part and HTML. **********************************************************/ function build_multipart_headers($boundary_rand) { global $EMAIL_FROM_DISPLAY_NAME, $EMAIL_FROM_ADDRESS, $CALC_PATH, $CALC_TITLE, $SERVER_NAME; // Using \n instead of \r\n because qmail doubles up the \r and screws everything up! $crlf = "\n"; $message_date = date("r"); // Construct headers for multipart/mixed MIME email. It will have a plain text and HTML part $headers = "X-Calc-Name: $CALC_TITLE" . $crlf; $headers .= "X-Calc-Url: http://{$SERVER_NAME}/{$CALC_PATH}" . $crlf; $headers .= "MIME-Version: 1.0" . $crlf; $headers .= "Content-type: multipart/alternative;" . $crlf; $headers .= " boundary=__$boundary_rand" . $crlf; $headers .= "From: $EMAIL_FROM_DISPLAY_NAME <$EMAIL_FROM_ADDRESS>" . $crlf; $headers .= "Sender: $EMAIL_FROM_DISPLAY_NAME <$EMAIL_FROM_ADDRESS>" . $crlf; $headers .= "Reply-to: $EMAIL_FROM_DISPLAY_NAME <$EMAIL_FROM_ADDRESS>" . $crlf; $headers .= "Return-Path: $EMAIL_FROM_DISPLAY_NAME <$EMAIL_FROM_ADDRESS>" . $crlf; $headers .= "Date: $message_date" . $crlf; $headers .= "Message-Id: $boundary_rand@$SERVER_NAME" . $crlf; return $headers; } /********************************************************** Function: build_multipart_body Author: Michael Berkowski Last Modified: September 2007 *********************************************************** Purpose: Builds the email body content to go with the headers from build_multipart_headers() **********************************************************/ function build_multipart_body($plain_text_message, $html_message, $boundary_rand) { //$crlf = "\r\n"; $crlf = "\n"; $boundary = "__" . $boundary_rand; // Begin constructing the MIME multipart message $multipart_message = "This is a multipart message in MIME format." . $crlf . $crlf; $multipart_message .= "--{$boundary}{$crlf}Content-type: text/plain; charset=\"us-ascii\"{$crlf}Content-Transfer-Encoding: 7bit{$crlf}{$crlf}"; $multipart_message .= $plain_text_message . $crlf . $crlf; $multipart_message .= "--{$boundary}{$crlf}Content-type: text/html; charset=\"iso-8859-1\"{$crlf}Content-Transfer-Encoding: 7bit{$crlf}{$crlf}"; $multipart_message .= $html_message . $crlf . $crlf; $multipart_message .= "--{$boundary}--$crlf$crlf"; return $multipart_message; } /********************************************************** Function: build_step_email_body_text Author: Michael Berkowski Last Modified: September 2007 *********************************************************** Purpose: Returns a plain text version of the email body to be used for individually sent step reminders **********************************************************/ function build_step_email_body_text($stepnum, $arr_instructions, $dates, $query_string, $teacher_info ,$name, $class, $project_id) { global $CALC_PATH, $CALC_TITLE, $SERVER_NAME; $step_email_body =<<<BODY $CALC_TITLE Step $stepnum: {$arr_instructions["step$stepnum"]["title"]} Name: $name Class: $class BODY; $step_email_body .= build_text_single_step($stepnum, $arr_instructions, $dates, $query_string, $teacher_info); $step_email_body .= "\n\n"; $step_email_body .=<<<FOOTER The $CALC_TITLE offers suggestions, but be sure to check with your teacher to find out the best working schedule for your assignment! If you would like to stop receiving further reminders for this project, click the link below: http://$SERVER_NAME/$CALC_PATH/deleteproject.php?proj=$project_id FOOTER; // Wrap text to 78 chars per line // Convert any remaining HTML <br /> to \r\n // Strip out any remaining HTML tags. $step_email_body = strip_tags(linebreaks_html2text(wordwrap($step_email_body, 78, "\n"))); return $step_email_body; } /********************************************************** Function: build_step_email_body_html Author: Michael Berkowski Last Modified: September 2007 *********************************************************** Purpose: Same as above, but with HTML **********************************************************/ function build_step_email_body_html($stepnum, $arr_instructions, $dates, $query_string, $teacher_info, $name, $class, $project_id) { global $CALC_PATH, $CALC_TITLE, $SERVER_NAME; $styles = build_html_styles(); $step_email_body =<<<BODY <html> <head> <title> $CALC_TITLE </title> $styles </head> <body> <h1> $CALC_TITLE Schedule </h1> <strong>Name:</strong> $name <br /> <strong>Class:</strong> $class <br /> BODY; $step_email_body .= build_html_single_step($stepnum, $arr_instructions, $dates, $query_string, $teacher_info); $step_email_body .=<<<FOOTER <p> The $CALC_TITLE offers suggestions, but be sure to check with your teacher to find out the best working schedule for your assignment! </p> <p> If you would like to stop receiving further reminders for this project, <a href="http://{$SERVER_NAME}/$CALC_PATH/deleteproject.php?proj=$project_id">click this link.</a> </p> </body> </html> FOOTER; return $step_email_body; } /********************************************************** Function: build_html_styles Author: Michael Berkowski Last Modified: September 2007 *********************************************************** Purpose: Just returns a string of <style /> for the HTML message body **********************************************************/ function build_html_styles() { $styles =<<<STYLES <style type="text/css"> body { font-family: Arial, sans-serif; font-size: 85%; } h1 { font-size: 120%; } table { border: none; } tr { vertical-align: top; } img { display: none; } hr { border: 0; } </style> STYLES; return $styles; } /********************************************************** Function: linebreaks_html2text Author: Michael Berkowski Last Modified: October 2007 *********************************************************** Purpose: Convert <br /> html tags to \n line breaks **********************************************************/ function linebreaks_html2text($in_string) { $out_string = ""; $arr_br = array("<br>", "<br />", "<br/>"); $out_string = str_replace($arr_br, "\n", $in_string); return $out_string; } ?> email.php <?php require_once("include/config.php"); require_once("include/instructions.php"); require_once("dbase/dbfunctions.php"); require_once("include/email_functions.php"); ini_set("sendmail_from", "[email protected]"); ini_set("SMTP", "mail.qatar.net.qa"); // Verify that the email has not already been sent by checking for a cookie // whose value is generated each time the form is loaded freshly. if (!(isset($_COOKIE['rpc_transid']) && $_COOKIE['rpc_transid'] == $_POST['transid'])) { // Setup some preliminary variables for email. // The scanning of $_POST['email']already took place when this file was included... $to = $_POST['email']; $subject = $EMAIL_SUBJECT; $boundary_rand = md5(rand()); $mail_type = ""; switch ($_POST['reminder-type']) { case "progressive": $arr_dbase_dates = array(); $conn = rpc_connect(); if (!$conn) { $mail_success = FALSE; $mail_status_message = "Could not register address!"; break; } // Sanitize all the data that will be inserted into table... // We need to remove "CONTENT-TYPE:" from name/class to defang them. // Additionall, we can't allow any line-breaks in those fields to avoid // hacks to email headers. $ins_name = mysql_real_escape_string($name); $ins_name = eregi_replace("CONTENT-TYPE", "...Content_Type...", $ins_name); $ins_name = str_replace("\n", "", $ins_name); $ins_class = mysql_real_escape_string($class); $ins_class = eregi_replace("CONTENT-TYPE", "...Content_Type...", $ins_class); $ins_class = str_replace("\n", "", $ins_class); $ins_email = mysql_real_escape_string($email); $ins_teacher_info = $teacher_info ? "YES" : "NO"; switch ($format) { case "Slides": $ins_format = "SLIDES"; break; case "Video": $ins_format = "VIDEO"; break; case "Essay": default: $ins_format = "ESSAY"; break; } // The transid from the previous form will be used as a project identifier // Steps will be grouped by project identifier. $ins_project_id = mysql_real_escape_string($_POST['transid'] . md5(rand())); $arr_dbase_dates = dbase_dates($dates); $arr_past_dates = array(); // Iterate over the dates array and build a SQL statement for each one. $insert_success = TRUE; // $min_reminder_date = date("Ymd", mktime(0,0,0,date("m"),date("d")+$EMAIL_REMINDER_DAYS_AHEAD,date("Y"))); for ($date_index = 0; $date_index < sizeof($arr_dbase_dates); $date_index++) { // Make sure we're using the right keys... $ins_date_index = $date_index + 1; // The insert will only happen if the date of the event is in the future. // For dates today and earlier, no insert. // For dates today or after the reminder deadline, we'll send the email immediately after the inserts. if ($arr_dbase_dates[$date_index] > (int)$min_reminder_date) { $qry =<<<QRY INSERT INTO email_queue ( NOTIFICATION_ID, PROJECT_ID, EMAIL, NAME, CLASS, FORMAT, TEACHER_INFO, STEP, MESSAGE_DATE ) VALUES ( NULL, '$ins_project_id', '$ins_email', '$ins_name', '$ins_class', '$ins_format', '$ins_teacher_info', $ins_date_index, /*step number*/ {$arr_dbase_dates[$date_index]} /* Date in the integer format yyyymmdd */ ) QRY; // Attempt to do the insert... $result = mysql_query($qry); // If even one insert fails, bail out. if (!$result) { $mail_success = FALSE; $mail_status_message = "Could not register address!"; break; } } // For dates today or earlier, store the steps=>dates in an array so the mails can // be sent immediately. else { $arr_past_dates[$ins_date_index] = $arr_dbase_dates[$date_index]; } } // Close the connection resources. mysql_close($conn); // SEND OUT THE EMAILS THAT HAVE TO GO IMMEDIATELY... // This should only be step 1, but who knows... //var_dump($arr_past_dates); for ($stepnum=1; $stepnum<=sizeof($arr_past_dates); $stepnum++) { $email_teacher_info = ($teacher_info && $EMAIL_TEACHER_REMINDERS) ? TRUE : FALSE; $boundary = md5(rand()); $plain_text_body = build_step_email_body_text($stepnum, $arr_instructions, $dates, $query_string, $email_teacher_info ,$name, $class, $ins_project_id); $html_body = build_step_email_body_html($stepnum, $arr_instructions, $dates, $query_string, $email_teacher_info ,$name, $class, $ins_project_id); $multipart_headers = build_multipart_headers($boundary); $multipart_body = build_multipart_body($plain_text_body, $html_body, $boundary); mail($to, $subject . ": Step " . $stepnum, $multipart_body, $multipart_headers, "[email protected]"); } // Set appropriate flags and messages $mail_success = TRUE; $mail_status_message = "Email address registered!"; $mail_type = "progressive"; set_mail_success_cookie(); break; // Default to a single email message. case "single": default: // We don't want to send images in the message, so strip them out of the existing structure. // This big ugly regex strips the whole table cell containing the image out of the table. // Must find a better solution... //$email_table_html = eregi_replace("<td class=\"stepImageContainer\" width=\"161px\">[\s\r\n\t]*<img class=\"stepImage\" src=\"images/[_a-zA-Z0-9]*\.gif\" alt=\"Step [1-9]{1} logo\" />[\s\r\n\t]*</td>", "\n", $table_html); // Show more descriptive text based on the value of $format switch ($format) { case "Video": $format_display = "Video"; break; case "Slides": $format_display = "Presentation with electronic slides"; break; case "Essay": default: $format_display = "Essay"; break; } $days = (int)$days; $html_message = ""; $styles = build_html_styles(); $html_message =<<<HTMLMESSAGE <html> <head> <title> $CALC_TITLE </title> $styles </head> <body> <h1> $CALC_TITLE Schedule </h1> <strong>Name:</strong> $name <br /> <strong>Class:</strong> $class <br /> <strong>Email:</strong> $email <br /> <strong>Assignment type:</strong> $format_display <br /><br /> <strong>Starting on:</strong> $date1 <br /> <strong>Assignment due:</strong> $date2 <br /> <strong>You have $days days to finish.</strong><br /> <hr /> $email_table_html </body> </html> HTMLMESSAGE; // Create the plain text version of the message... $plain_text_message = strip_tags(linebreaks_html2text(build_text_all_steps($arr_instructions, $dates, $query_string, $teacher_info))); // Add the title, since it doesn't get built in by build_text_all_steps... $plain_text_message = $CALC_TITLE . " Schedule\n\n" . $plain_text_message; $plain_text_message = wordwrap($plain_text_message, 78, "\n"); $multipart_headers = build_multipart_headers($boundary_rand); $multipart_message = build_multipart_body($plain_text_message, $html_message, $boundary_rand); $mail_success = FALSE; if (mail($to, $subject, $multipart_message, $multipart_headers, "[email protected]")) { $mail_success = TRUE; $mail_status_message = "Email sent!"; $mail_type = "single"; set_mail_success_cookie(); } else { $mail_success = FALSE; $mail_status_message = "Could not send email!"; } break; } } function set_mail_success_cookie() { // Prevent the mail from being resent on page reload. Set a timestamp cookie. // Expires in 24 hours. setcookie("rpc_transid", $_POST['transid'], time() + 86400); } ?>

    Read the article

  • As a PHP developer thinking of making Perl a secondary strong suit, what do I need to know?

    - by Hexagon Theory
    I consider myself quite fluent in PHP and am rather familiar with nearly all of the important aspects and uses, as well as its pratfalls. This in mind, I think the major problem in taking on Perl is going to be with the syntax. Aside from this (a minor hindrance, really, as I'm rather sold on the fact that Perl's is far more readable), what are some key differences you think I should make myself aware of prior to taking on the language?

    Read the article

  • How to make CSS/HTML prototyping faster for engineers without strong CSS skills?

    - by rdeshpande
    I've been developing Ruby on Rails applications for some time, and have often found help to develop generate the templates of HTML with accompanying CSS. However, I'd like to make an attempt at doing this myself. Initial experiments leave me feeling like my process is really slow. I'm writing all my Rails code in VIM, which, with accompanying aliases to run the test suite, is pretty fast for me. However, the back-and-forth between browser/VIM to see new changes seems cumbersome - I'm guessing finding an editor with an embedded browser that constantly sees new changes is ideal for this (any suggestions?) So far I've experimented with Blueprint, which at the onset seems like it will save me a ton of time. However, what other tools have helped you do the PSD-HTML/CSS conversion as fast as you can?

    Read the article

  • Can a conforming C# compiler optimize away a local (but unused) variable if it is the only strong re

    - by stakx
    The title says it all, but let me explain: void Case_1() { var weakRef = new WeakReference(new object()); GC.Collect(); // <-- doesn't have to be an explicit call; just assume that // garbage collection would occur at this point. if (weakRef.IsAlive) ... } In this code example, I obviously have to plan for the possibility that the new'ed object is reclaimed by the garbage collector; therefore the if statement. (Note that I'm using weakRef for the sole purpose of checking if the new'ed object is still around.) void Case_2() { var unusedLocalVar = new object(); var weakRef = new WeakReference(unusedLocalVar); GC.Collect(); // <-- doesn't have to be an explicit call; just assume that // garbage collection would occur at this point. Debug.Assert(weakReferenceToUseless.IsAlive); } The main change in this code example from the previous one is that the new'ed object is strongly referenced by a local variable (unusedLocalVar). However, this variable is never used again after the weak reference (weakRef) has been created. Question: Is a conforming C# compiler allowed to optimize the first two lines of Case_2 into those of Case_1 if it sees that unusedLocalVar is only used in one place, namely as an argument to the WeakReference constructor? i.e. is there any possibility that the assertion in Case_2 could ever fail?

    Read the article

  • Is SQLlite strong enough to use as wordpress database ?

    - by justjoe
    i'm just curious. so i ask this particular question about SQLite. I haven't use this type of database extensively. but care to explain what is the basic different between SQLite and Mysql ? The reason behind all of this is i just want to know whether it possible to use it to store wordpress data and act as a database ?

    Read the article

  • How to go about signing text in a verifiable way from within ruby in a simple yet strong & portable

    - by roja
    Guys, I have been looking for a portable method to digitally sign arbitrary text which can be placed in a document and distributed while maintaining its verifiable origin. Here is an example: a = 'some text' a.sign(<private key>) # => <some signature in ASCII format> The contents of a can now be distributed freely. If a receiver wants to check the validity of said text they can do the following: b = 'some text' b.valid(<public key>, <signature supplied with text>) # => true/false Is there any library out there that already offers this kind of functionality? Ruby standard library contains SHA hashing code so at lest there is a portable way to perform the hashing but from that point I am struggling to find anything which fits purpose. Kind Regards, Roja

    Read the article

  • is there any easy way to auto generated code like this?

    - by Kevin Yang
    i have a file which will be used across many app projects. the only difference of these files is the webserice referrence name. code like this: public void Test(){ Kevin.ServiceReference1.Service1Client client = new Kevin.ServiceReference1.Service1Client(); // do something.... } like code above, the 'Kevin.ServiceReference1' will be replace by specified app project namespace. so, according to DRY(dont repeat yourself), i shouldn't just copy the file to many projects and rename the specified part manually. is there any way i can easily replace some parts of my template file to something related to the project?

    Read the article

  • Limiting regex match

    - by DMIL
    Say I have this HTML fragment <td width="25%" style="text-align:right;" > <span style="font-family: Arial; font-size: 12px;"> <strong>Regular price:</strong></span> </td> <td width="25%" style="text-align:center;" > <span style="font-family: Arial; font-size: 12px;> <strong>11,100.00 USD</strong></span> </td> <td width="25%" style="text-align:right;" > <span style="font-family: Arial; font-size: 12px;"> <strong>Web price:</strong></span> </td> <td width="25%" style="text-align:center;" > <span style="font-family: Arial; font-size: 12px;> <strong>9,100.00 USD</strong></span> </td> How would I get the first amount (11,100.00) using regex? I tried /Regular price.+(\d[^\s]+)\sUSD/is but it's not working, it's returning '00'. Obviously I'm a newbie at regex and I'm hoping to get by without picking up a book. And I HAVE to use regex to parse this HTML because that particular site was designed by someone who doesn't know about classes or IDs.

    Read the article

  • Pass data from one form to another on a seperate page

    - by Micanio
    I am building a price/distance calculator with Google Maps API and am trying to pass the info from the calculator to a booking form on a separate page. My first form has 2 submit buttons - one to make the calculation, and one to submit the relevant data to the booking form. I'm stuck trying to make the 2nd button work. Once the API calculation has been made, I get 4 values - From, To, Cost, Distance. I am trying to pass the From, To and Cost values into my booking form by clicking the second button. But I can;t seem to get it to work. I've tried POST and GET but I think I may have been doing something wrong with both. Any help is appreciated. Code for API form: <script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAwCUxKrPl8_9WadET5dc4KxTqOwVK5HCwTKtW27PjzpqojXnJORQ2kUsdCksByD4hzcGXiOxvn6C4cw&sensor=true"></script> <script type="text/javascript"> var geocoder = null; var location1 = null; var location2 = null; var gDir = null; var directions = null; var total = 0; function roundNumber(num, dec) { var result = Math.floor(num*Math.pow(10 ,dec))/Math.pow(10,dec); return result; } function from(form) { address1=form.start.options[form.start.selectedIndex].value form.address1.value=address1 form.address1.focus() } function to(form) { address2=form.end.options[form.end.selectedIndex].value form.address2.value=address2 form.address2.focus() } function initialize() { var map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(54.019066,-1.381531),9); map.setMapType(G_NORMAL_MAP); geocoder = new GClientGeocoder(); gDir = new GDirections(map); GEvent.addListener(gDir, "load", function() { var drivingDistanceMiles = gDir.getDistance().meters / 1609.344; var drivingDistanceKilometers = gDir.getDistance().meters / 1000; var miles = drivingDistanceMiles.toFixed(0); //var cost = (((miles - 1) * 1.9) + 3.6).toFixed(2); var meters = gDir.getDistance().meters.toFixed(1); if(miles < 70){ var cost = miles *1.75; } if(miles >70){ var cost = miles *1.2; } document.getElementById('from').innerHTML = '<strong>From: </strong>' + location1.address; document.getElementById('to').innerHTML = '<strong>To: </strong>' + location2.address; document.getElementById('cost').innerHTML = '<span class="fare"><strong>Estimated Taxi FARE:</strong>' + ' £' + cost.toFixed(2) + '</span>'; document.getElementById('miles').innerHTML = '<strong>Distance: </strong>' + miles + ' Miles'; }); } function showLocation() // start of possible values for address not recognized on google search // values for address1 { if (document.forms[0].address1.value == "heathrow" || document.forms[0].address1.value == "Heathrow" || document.forms[0].address1.value == "heathrow airport" || document.forms[0].address1.value == "Heathrow Airport" || document.forms[0].address1.value == "London Heathrow" || document.forms[0].address1.value =="london heathrow" ) { (document.forms[0].address1.value = "Heathrow Airport"); } if (document.forms[0].address2.value == "heathrow" || document.forms[0].address2.value == "Heathrow" || document.forms[0].address2.value == "heathrow airport" || document.forms[0].address2.value == "Heathrow Airport" || document.forms[0].address2.value == "London Heathrow" || document.forms[0].address2.value =="london heathrow" ) { (document.forms[0].address2.value = "Heathrow Airport"); } geocoder.getLocations(document.forms[0].address1.value + document.forms[0].uk.value || document.forms[0].start.value + document.forms[0].uk.value, function (response) { if (!response || response.Status.code != 200) { alert("Sorry, we were unable to find the first address"); } else { location1 = {lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0], address: response.Placemark[0].address}; geocoder.getLocations(document.forms[0].address2.value + document.forms[0].uk.value, function (response) { if (!response || response.Status.code != 200) { alert("Sorry, we were unable to find the second address"); } else { location2 = {lat: response.Placemark[0].Point.coordinates[1], lon: response.Placemark[0].Point.coordinates[0], address: response.Placemark[0].address}; gDir.load('from: ' + location1.address + ' to: ' + location2.address); } }); } }); } </script> <style> #quote { font-family: Georgia, "Times New Roman", Times, serif; } </style> </head> <body style="background-color: rgb(255, 255, 255);" onUnload="GUnload()" onLoad="initialize()"> <div id="sidebar"> <!--MAPS--> <div id="calc_top"></div> <div id="calc_body"> <div id="calc_inside"> <span style="font-size: 16px; font-weight: bold;">Get A Quote Now</span> <p class="disclaimer">Fares can be calculated using either Area, Exact Address or Postcode, when entering address please include both road name and area i.e. <em>Harrogate Road, Ripon</em>. You can also select a pickup point and destination from the dropdown boxes. </p> <form onSubmit="showLocation(); return false;" action="#" id="booking_form"> <p> <select onChange="from(this.form)" name="start"> <option selected="selected">Select a Pickup Point</option> <option value="Leeds Bradford Airport">Leeds Bradford Airport</option> <option value="Manchester Airport">Manchester Airport</option> <option value="Teesside International Airport">Teeside Airport</option> <option value="Liverpool John Lennon Airport">Liverpool Airport</option> <option value="East Midlands Airport">East Midlands Airport</option> <option value="Heathrow International Airport">Heathrow Airport</option> <option value="Gatwick Airport">Gatwick Airport</option> <option value="Stanstead Airport">Stanstead Airport</option> <option value="Luton International Airport">Luton Airport</option> </select> </p> <p> <input type="text" value="From" name="address1"><br> <p> <select onChange="to(this.form)" name="end"> <option selected="selected">Select a Destination</option> <option value="Leeds Bradford Airport">Leeds Bradford Airport</option> <option value="Manchester Airport">Manchester Airport</option> <option value="Teesside International Airport">Teeside Airport</option> <option value="Liverpool John Lennon Airport">Liverpool Airport</option> <option value="East Midlands Airport">East Midlands Airport</option> <option value="Heathrow International Airport">Heathrow Airport</option> <option value="Gatwick Airport">Gatwick Airport</option> <option value="Stanstead Airport">Stanstead Airport</option> <option value="Luton International Airport">Luton Airport</option> </select> </p> <input type="text" value="To" name="address2"><br> <input type="hidden" value=" uk" name="uk"> <br> <input type="submit" value="Get Quote"> <input type="button" value="Reset" onClick="resetpage()"><br /><br /> <input type="submit" id="CBSubmit" value="Confirm and Book" action=""/> </p> </form> <p id="from"><strong>From:</strong></p> <p id="to"><strong>To:</strong></p> <p id="miles"><strong>Distance: </strong></p> <p id="cost"><span class="fare"><strong>Estimated Taxi FARE:</strong></span></p> <p id="results"></p> <div class="style4" style="width: 500px; height: 500px; position: relative; background-color: rgb(229, 227, 223);" id="map_canvas"></div> </div> </div> Code for Booking Form: <form method="post" action="contactengine.php" id="contact_form"> <p> <label for="Name" id="Name">Name:</label> <input type="text" name="Name" /> <label for="Email" id="Email">Email:</label> <input type="text" name="Email" /> <label for="tel" id="tel">Tel No:</label> <input type="text" name="tel" /><br /><br /> <label for="from" id="from">Pickup Point:</label> <input type="text" name="from" value="" /><br /><br /> <label for="to" id="to">Destination:</label> <input type="text" name="to" value=""/><br /> <label for="passengers" id="passengers">No. of passengers</label> <input type="text" name="passengers" /><br /><br /> <label for="quote" id="quote">Price of journey:</label> <input type="text" name="quote" value="" /><br /><br /> <label for="Message" id="Message">Any other info:</label> <textarea name="Message" rows="20" cols="40"></textarea> <br /> Are you an account holder?<br /> <label for="account" id="yes" /> Yes:</label> <input type="radio" class="radio" value="yes" name="account"> <label for="account" id="yes" /> No:</label> <input type="radio" class="radio" value="no" name="account"> </p> <small>Non-account holders will have to pay a £5 booking fee when confirming thier booking</small> <input type="submit" name="submit" value="Submit" class="submit-button" /> </p> </form> Thanks in advance

    Read the article

  • Get value of selected field from a dropdown list

    - by 47
    I have this class in my model: class ServiceCharge(models.Model): name = models.CharField(max_length=30) amount = models.PositiveIntegerField() extends_membership = models.BooleanField(default=False) def __unicode__(self): return str(self.name) What I want to have is in the form for charging users a service charge, when a charge is selected from the dropdown menu, the two values for amount and extends_membership are updated on the form depending on the selected charge. My forms.py: class vModelChoiceField(forms.ModelChoiceField): def label_from_instance(self, obj): return "%s" % obj.name class PayServiceChargeForm(PaymentsForm): service_charge = vModelChoiceField(queryset=ServiceCharge.objects.all(), empty_label=" ") class Meta(PaymentsForm.Meta): exclude = ('member', 'payment_type', 'transacted_by', 'description') Then the form template: <table border="0"> <tr> <td><strong>{% trans "Service Charge" %}</strong></td> <td>{{ form.service_charge }}</td> <td><strong>{% trans "Extends Membership" %}</strong></td> <td>{{ form.extends_membership }}</td> </tr> <tr> <td valign="top"><strong>{% trans "Expiry Date" %}</strong></td> <td valign="top">{{ form.expiry_date }}</td> <td valign="top"><strong>{% trans "Amount" %}</strong></td> <td>{{ form.amount }}</td> </tr> </table> I was trying out some jQuery but I got stuck after getting the currently selected charge: <script type="text/javascript"> $(document).ready(function(){ $("#id_service_charge").change(onSelectChange); }); function onSelectChange(){ var selected = $("#id_service_charge option:selected"); var output = ""; if(selected.val() != 0){ charge = selected.val(); .... (update values) .... } } </script>

    Read the article

  • client website compromised, found a strange .php file. any ideas?

    - by Kevin Strong
    I do support work for a web development company and I found a suspicious file today on the website of one of our clients called "hope.php" which contained several eval(gzuncompress(base64_decode('....'))) commands (which on a site like this, usually indicates that they've been hacked). Searching for the compromised site on google, we got a bunch of results which link to hope.php with various query strings that seem to generate different groups of seo terms like so: (the second result from the top is legitimate, all the rest are not) Here is the source of "hope.php": http://pastebin.com/7Ss4NjfA And here is the decoded version I got by replacing the eval()s with echo(): http://pastebin.com/m31Ys7q5 Any ideas where this came from or what it is doing? I've of course already removed the file from the server, but I've never seen code like this so I'm rather curious as to its origin. Where could I go to find more info about something like this?

    Read the article

  • How to populate a drop down list in Spring MVC

    - by GigaPr
    Hi, would like to populate a drop down list on a jsp page i have my page that looks like <form:form method="POST" action="addRss.htm" commandName="addNewRss" cssClass="addUserForm"> <div class="floatL"> <div class="padding5"> <div class="fieldContainer"> <strong>Title:</strong>&nbsp; </div> <form:errors path="title" cssClass="error"/> <form:input path="title" cssClass="textArea" /> </div> <div class="padding5"> <div class="fieldContainer"> <strong>Description:</strong>&nbsp; </div> <form:errors path="description" cssClass="error"/> <form:input path="description" cssClass="textArea" /> </div> <div class="padding5"> <div class="fieldContainer"> <strong>Language:</strong>&nbsp; </div> <form:errors path="language" cssClass="error"/> <form:select path="language" cssClass="textArea" /> </div> </div> <div class="floatR"> <div class="padding5"> <div class="fieldContainer"> <strong>Link:</strong>&nbsp; </div> <form:errors path="link" cssClass="error"/> <form:input path="link" cssClass="textArea" /> </div> <div class="padding5"> <div class="fieldContainer"> <strong>Url:</strong>&nbsp; </div> <form:errors path="url" cssClass="error"/> <form:input path="url" cssClass="textArea" /> </div> <div class="padding5"> <div class="fieldContainer"> <strong>Url</strong>&nbsp; </div> <form:errors path="url" cssClass="error"/> <form:input path="url" cssClass="textArea" /> </div> </div> <input type="submit" class="floatR" value="Add New Rss"> </form:form> and my controller public class AddRssController extends BaseController { private static final String[] LANGUAGES = { "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VA", "VT", "WA", "WV", "WI", "WY" }; public AddRssController() { setCommandClass(RSS.class); setCommandName("addNewRss"); } @Override protected Object formBackingObject(HttpServletRequest request) throws Exception { RSS rantForm = (RSS) super.formBackingObject(request); // rantForm.setVehicle(new Vehicle()); return rantForm; } @Override protected Map referenceData(HttpServletRequest request) throws Exception { Map referenceData = new HashMap(); referenceData.put("language", LANGUAGES); return referenceData; } @Override protected ModelAndView onSubmit(Object command, BindException bindException) throws Exception { RSS rss = (RSS) command; rssServiceImplementation.add(rss); return new ModelAndView(getSuccessView()); } } and my BaseController public class BaseController extends SimpleFormController implements Controller { public UserServiceImplementation userServiceImplementation; public UserServiceImplementation getUserServiceImplementation() { return userServiceImplementation; } public void setUserServiceImplementation(UserServiceImplementation userServiceImplementation) { this.userServiceImplementation = userServiceImplementation; } public RssServiceImplementation rssServiceImplementation; public RssServiceImplementation getRssServiceImplementation() { return rssServiceImplementation; } public void setRssServiceImplementation(RssServiceImplementation rssServiceImplementation) { this.rssServiceImplementation = rssServiceImplementation; } } But it doesn t work Any suggestion?

    Read the article

  • How to check if an SQL query executed without error in ASP?

    - by Sam
    Here's my code: if Request.Form("authorize") <> "" and request.form("delete") <> "true" then post_ids = Request.form("authorize") ids = split(post_ids, ",") For i = LBound(ids) to UBound(ids) sql = "update tbl_comments set authorized = 'true' where comment_id = " & ids(i) pageDB.execute(sql) Next message = "<div id=""succeed""><strong>Updated</strong>: Your comments have been approved.</div>" end if Instead of just setting "message" to the success message i'd like to do something along the lines of... if(pageDB.execute(sql) was succesful) then message = "<div id=""succeed""><strong>Updated</strong>: Your comments have been approved.</div>" else message = "<div id=""error""><strong>Error</strong>: Your comments have not been approved.</div>" end if

    Read the article

  • VirtualHosts Stopped Working

    - by Kevin C.
    I'm working on a website and have WAMP setup for local testing. Usually I set up virtual hosts using httpd-vhosts + the hosts file without a hitch. All of a sudden, my virtual hosts are no longer working. I know that it's pointing to Apache because I get a '403 Forbidden' error, but that's about it. All of my previously working virtual hosts no longer work as well. Anybody know what's going on? httpd-vhosts.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot "C:\Documents and Settings\kevin\Desktop\websites\fusion" ServerName ebrochures ErrorLog "logs/your_own-error.log" CustomLog "logs/your_own-access.log" common <directory "C:\Documents and Settings\kevin\Desktop\websites\fusion"> Options Indexes FollowSymLinks AllowOverride all Order Deny,Allow Deny from all Allow from 127.0.0.1 </directory> hosts file: 127.0.0.1 fusion And yes, I am including the virtual hosts file in my httpd.conf file: # Virtual hosts Include conf/extra/httpd-vhosts.conf

    Read the article

  • Installing a DLL to Global assembly cache (GAC)

    - by DAXShekhar
    Install you DLL assembly by using the ‘gacutil.exe’, before installing the DLL ensure it has a strong name, to assign a strong name refer to the link Assigning a DLL strong name .   1) open the Command prompt, and navigate to the folder of gacutil. 2) To install a DLL assembly gacutil /I "C:\[PathToBinDirectoryInVSProject]\gac.dll" 3) To uninstall gacutil /U  “Name_of_The_DLL”

    Read the article

  • Analyst Firm Gives Oracle Highest Rating for Local Government CRM

    - by michael.seback
    Gartner, Inc. has given Oracle a rating of "Strong Positive," the highest possible ranking, in its report "MarketScope for Local Government CRM Products." The report compares the offerings of nine providers of CRM commercial off-the-shelf software for local government agencies. Gartner notes that a provider receiving a Strong Positive ranking must be a "provider of strategic products, services or solutions..." and recommends that "customers continue with planned investments and potential customers consider this vendor a strong choice for strategic investments." "Local governments today face tough challenges as they are tasked with reducing costs while at the same time providing citizens with services and information more quickly and efficiently than ever before. Oracle is pleased to be recognized by Gartner with a Strong Positive rating in its 'MarketScope for Local Government CRM Products' report, as we believe it reflects our commitment to helping our public sector customers meet these challenges today and in the future," said Mark Johnson, senior vice president, Oracle Public Sector. Read the highlights.

    Read the article

  • Mysql query does not update row [closed]

    - by Gerculy Robert
    // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // get value of id that sent from address bar /*$id=$_GET['$usrid'];*/ // Retrieve data from database $sql="SELECT * FROM user WHERE id='$usrid'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); ?> <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <form name="form1" method="post" action="update.php"> <td> <table width="100%" border="0" cellspacing="1" cellpadding="0"> <tr> <td>&nbsp;</td> <td colspan="3"><strong>Update site info</strong> </td> </tr> <tr> <td align="center">&nbsp;</td> <td align="center">&nbsp;</td> <td align="center">&nbsp;</td> <td align="center">&nbsp;</td> </tr> <tr> <td align="center">&nbsp;</td> <td align="center"><strong>User Name</strong></td> <td align="center"><strong>Site url</strong></td> <td align="center"><strong>Url banner</strong></td> </tr> <tr> <td>&nbsp;</td> <td align="center"> <input name="username" type="text" id="username" value="<? echo $rows['username']; ?>"> </td> <td align="center"> <input name="siteurl" type="text" id="siteurl" value="<? echo $rows['siteurl']; ?>" size="40"> </td> <td> <input name="urlbanner" type="text" id="urlbanner" value="<? echo $rows['urlbanner']; ?>" size="40"> </td> </tr> <tr> <td>&nbsp;</td> <td> <input name="id" type="hidden" id="id" value="<? echo $rows['id']; ?>"> </td> <td align="center"> <input type="submit" name="Submit" value="Submit"> </td> <td>&nbsp;</td> </tr> </table> </td> </form> </tr> </table> <?php // close connection mysql_close(); ?> // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // update data in mysql database $sql="update user SET siteurl='$siteurl', username='$username', urlbanner='$urlbanner' WHERE id=$usrid"; $result=mysql_query($sql); // if successfully updated. if($result){ echo "Successful"; echo "<BR>"; echo "<a href='edit.php'>View result</a>"; } else { echo "ERROR"; } Hello, I have this two pages wich should update 3 rows. The problem is it does not update all , only 2 . I tried over 1 hour to find the problem but nothing. The row , siteurl, is not being updated at all . The table is : varchar(255) Database and session is ok. Any idea ? It's just a simple update code , should work fine :(

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >