Advertisement

07.23.2008 at 06:48PM PDT, ID: 23590775
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.7

Update record in php/mySQL

Asked by jws2bay in Macromedia Dreamweaver

I am working with php/mySQL servers.  I have a page which I have fields to match the contents of a record in my table.  I want to allow the user to edit the contents and update the record.  I have used a session var. to setup the record, and this works fine.  When I attempt to submit the form and update the record it seems to bounce back to the same page.  I  work in dreamweaver, but this site doesn't allow me to use the dreamweaver tools, so I have been trying to hand code the page. I have attached my current code.
I am also sending out emails when the page is submitted.

 Any help is appreciated.
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
 
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE Contractors SET First_Name=%s, Last_Name=%s, Company=%s, Street=%s, Street_2=%s, City=%s, State_or_Province=%s, Postal_Code=%s, Country=%s, Email_Address=%s, Phone=%s, Fax=%s, License_Number=%s, License_State=%s, Area_of_Expertise=%s, Area_Codes_Supported=%s, Referrals_Requested=%s, Show_Information=%s, WHERE Username=%s",
                       GetSQLValueString($_POST['First_Name'], "text"),
                       GetSQLValueString($_POST['Last_Name'], "text"),
                       GetSQLValueString($_POST['Company'], "text"),
                       GetSQLValueString($_POST['Street'], "text"),
                       GetSQLValueString($_POST['Street_2'], "text"),
                       GetSQLValueString($_POST['City'], "text"),
                       GetSQLValueString($_POST['State'], "text"),
                       GetSQLValueString($_POST['Postal_Code'], "text"),
                       GetSQLValueString($_POST['Country'], "text"),
                       GetSQLValueString($_POST['Email'], "text"),
                       GetSQLValueString($_POST['Phone'], "text"),
                       GetSQLValueString($_POST['Fax'], "text"),
                       GetSQLValueString($_POST['License_no'], "text"),
                       GetSQLValueString($_POST['License_state'], "text"),
                       GetSQLValueString($_POST['Expertise'], "text"),
                       GetSQLValueString($_POST['Area_Codes'], "text"),
                       GetSQLValueString(isset($_POST['Referals']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Show_information']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString($_POST['username'], "text"));
 
  mysql_select_db($database_squirrelcart, $squirrelcart);
  $Result1 = mysql_query($insertSQL, $squirrelcart) or die(mysql_error());
 
  $updateGoTo = "WL1_Reg_Post_Update.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $updateGoTo));
}
 
?>
 
 
<?php
mysql_select_db($database_squirrelcart, $squirrelcart);
$query_State = "SELECT * FROM States";
$State = mysql_query($query_State, $squirrelcart) or die(mysql_error());
$row_State = mysql_fetch_assoc($State);
$totalRows_State = mysql_num_rows($State);
 
$colname_Contractor = "-1";
if (isset($_SESSION['MM_Username'])) {
  $colname_Contractor = $_SESSION['MM_Username'];
}
mysql_select_db($database_squirrelcart, $squirrelcart);
$query_Contractor = sprintf("SELECT * FROM Contractors WHERE username = %s", GetSQLValueString($colname_Contractor, "text"));
$Contractor = mysql_query($query_Contractor, $squirrelcart) or die(mysql_error());
$row_Contractor = mysql_fetch_assoc($Contractor);
$totalRows_Contractor = mysql_num_rows($Contractor);
?>
 
<?php require_once("WA_Universal_Email/Mail_PHP.php"); ?>
<?php require_once("WA_Universal_Email/MailFormatting_PHP.php"); ?>
<?php
if ((($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos($_SERVER["HTTP_REFERER"], $_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]) > 0) && isset($_POST)))     {
  //WA Universal Email object="Mail"
  //Send Loop Once Per Entry
  $RecipientEmail = "".((isset($_POST["Email"]))?$_POST["Email"]:"")  ."";include("WA_Universal_Email/WAUE_WL1_Reg_New_User3_1.php");
  $RecipientEmail = "jerry@eshowerdoor.com";include("WA_Universal_Email/WAUE_WL1_Reg_New_User3_1.php");
}
?>
[+][-]07.23.2008 at 11:31PM PDT, ID: 22076509

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 07:54AM PDT, ID: 22079831

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 10:42AM PDT, ID: 22081623

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.24.2008 at 12:14PM PDT, ID: 22082513

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 12:21PM PDT, ID: 22082580

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 01:12PM PDT, ID: 22083074

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 01:53PM PDT, ID: 22083423

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Macromedia Dreamweaver
Sign Up Now!
Solution Provided By: jason1178
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.24.2008 at 02:46PM PDT, ID: 22083859

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 02:56PM PDT, ID: 22083954

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 03:16PM PDT, ID: 22084113

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 09:29AM PDT, ID: 22090060

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 10:34AM PDT, ID: 22090660

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 11:30AM PDT, ID: 22091133

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080924-EE-VQP-39 / EE_QW_2_20070628