close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Disappearing Insert on Registration page

Thread began 12/09/2010 3:35 pm by bjgarner241692 | Last modified 12/10/2010 10:59 am by bjgarner241692 | 2075 views | 6 replies

bjgarner241692

Profile Page:

php:
<?php

if (!isset($_SESSION)) {
  
session_start();
}
?>
<?php 
require_once('Connections/conn.php'); ?>
<?php 
require_once( "WA_SecurityAssist/Helper_PHP.php" ); 
if (!
WA_Auth_RulePasses("Logged in to students")){
    
WA_Auth_RestrictAccess("students_EmailPW.php");
}

if (!
function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}
?>
<?php
$editFormAction 
$_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}

?>
<?php
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "WAATKUpdateForm")) {
  
$updateSQL sprintf("UPDATE students SET lastname=%s, firstname=%s, pwd=%s WHERE stID=%s",
                       
GetSQLValueString($_POST['lastname'], "text"), GetSQLValueString($_POST['firstname'], "text"), GetSQLValueString($_POST['pwd'], "text"), GetSQLValueString($_POST['stID'], "text"));

  
mysql_select_db($database_conn$conn);
  
$Result1 mysql_query($updateSQL$conn) or die(mysql_error());

  
$updateGoTo "students_Profile.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$updateGoTo .= (strpos($updateGoTo'?')) ? "&" "?";
    
$updateGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$updateGoTo));
}
?>
<?php
$ParamstID_WAATKstudents 
"-1";
if (isset(
$_SESSION['stID'])) {
  
$ParamstID_WAATKstudents = (get_magic_quotes_gpc()) ? $_SESSION['stID'] : addslashes($_SESSION['stID']);
}
mysql_select_db($database_conn$conn);
$query_WAATKstudents sprintf("SELECT * FROM students WHERE stID = %s"$ParamstID_WAATKstudents);
$WAATKstudents mysql_query($query_WAATKstudents$conn) or die(mysql_error());
$row_WAATKstudents mysql_fetch_assoc($WAATKstudents);
$totalRows_WAATKstudents mysql_num_rows($WAATKstudents);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Profile</title>
<link href="WA_SecurityAssist/styles/Refined_Pacifica.css" rel="stylesheet" type="text/css" />
<link href="WA_SecurityAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
</head>

<body>


<div id="UpdateContainer" class="WAATK">
  <?php if ($totalRows_WAATKstudents 0) { // Show if recordset not empty ?>
    <form  action="<?php echo $editFormAction?>" method="post" name="WAATKUpdateForm" id="WAATKUpdateForm">
      <h1>Profile</h1>
      <table class="WAATKDataTable" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <th>lastname:</th>
          <td><input type="text" class="WAATKTextField" name="lastname" id="lastname" value="<?php echo(str_replace('"''&quot;'$row_WAATKstudents['lastname'])); ?>" size="32" /></td>
        </tr>
        <tr>
          <th>firstname:</th>
          <td><input type="text" class="WAATKTextField" name="firstname" id="firstname" value="<?php echo(str_replace('"''&quot;'$row_WAATKstudents['firstname'])); ?>" size="32" /></td>
        </tr>
        <tr>
          <th>email:</th>
          <td><?php echo(str_replace('"''&quot;'$row_WAATKstudents['email'])); ?></td>
        </tr>
        <tr>
          <th>pwd:</th>
          <td><input type="text" class="WAATKTextField" name="pwd" id="pwd" value="<?php echo(str_replace('"''&quot;'$row_WAATKstudents['pwd'])); ?>" size="32" /></td>
        </tr>
      </table>
      <div class="WAATKButtonRow">
        <input type="image" hspace="0" vspace="0" border="0" name="Update" id="Update" value="Update" alt="Update"  src="WA_SecurityAssist/images/Pacifica/Refined_update.gif"  />
        <input name="stID" type="hidden" id="WAATKUpdateRecordID" value="<?php echo(rawurlencode($row_WAATKstudents['stID'])); ?>">
        <input type="hidden" name="MM_update" value="WAATKUpdateForm">
      </div>
    </form>
  <?php // Show if recordset not empty ?>
  <?php if ($totalRows_WAATKstudents == 0) { // Show if recordset empty ?>
    <div>No record found.</div>
  <?php // Show if recordset empty ?>
</div>
</body>
</html>
<?php
mysql_free_result
($WAATKstudents);
?>



All code is straight fromt he wizard with the exception that I removed the extra conn string from the profile page. That's pretty common with these behaviours. Strings are inserted pretty much every time you edit a behaviour.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...