Undefine Index: password

Hello !
I have book "Adobe Dreamweaver CS5 with PHP - Training from the source" by Daivid Powers. It contains CD with the files I should use and work with.
I followed the instructions and I created pages about logining , inserting records, user listing etc..
The problem is when I try to update records!
I have a user_list.php which shows a list of users and next to every record there are two buttons (EDIT and DELETE).
When I press the "EDIT" button is supposed to take me in a page where all the data of the selected user will be filled in except the password..
It DOES that BUT it gives me a Notice: Undefined index: password in D:\EasyPHP\www\phpcs5\lesson06\workfiles\update_user.php on line 46
This is what I have in lines 42-47
42: if(isset($_POST['password']) && empty($_POST['password'])){
43:   
44:    $_POST['password'] = $row_getUser['password'];
45: } else {
46:     $_POST['password'] = sha1($_POST['password']);
47: }
Obviously I am totaly newbie in PHP so it is hard for me not just to solve it but even where to start looking..
A little googling told me that _POST['password'] does not exist ( it is not submitted or something) but I do not know what to do..
The book cd contains a directory called "completed" where is supposed that in there, are the files on their final look!
Unfortunately these files return  the same "Notice".
OS: Windows 7 pro
EasyPHP 5.3.5.0
Apache/2.2.17 (Win32)
PHP/5.3.5
MySQL: 5.1.54
Should I post the code of the files?
Thank you!

Ok then!
There are two files, the user_list.php and the update_user.php.
When you load user_list.php it shows a list of users and next to each user there are 2 links, the "edit" and "delete".
When you press the "EDIT" it gets you to the update_user.php and it loads in the input fields the "First Name" , "Family name" and "Username".
There is one correction for sure that should apply in update_user.php. In the recordset are currently selected the columns user_id, first_name, family_name and username. In the book's corrections page mentions that "password" column should be selected as well.
As said before the problem is that anytime I try to EDIT a user it returns me an error " Notice: Undefined index: password in D:\EasyPHP\www\phpcs5\lesson06\workfiles\update_user.php on line 46"
This is what I have in lines 42-47
42: if(isset($_POST['password']) && empty($_POST['password'])){
43:   
44:    $_POST['password'] = $row_getUser['password'];
45: } else {
46:     $_POST['password'] = sha1($_POST['password']);
47: }
The code of those files is taken from the Completed directory from the cd and are like this..
user_list.php
<?php require_once('Connections/cs5read.php'); ?>
<?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;
$maxRows_getUsers = 10;
$pageNum_getUsers = 0;
if (isset($_GET['pageNum_getUsers'])) {
  $pageNum_getUsers = $_GET['pageNum_getUsers'];
$startRow_getUsers = $pageNum_getUsers * $maxRows_getUsers;
mysql_select_db($database_cs5read, $cs5read);
$query_getUsers = "SELECT user_id, first_name, family_name, username FROM users ORDER BY family_name ASC";
$query_limit_getUsers = sprintf("%s LIMIT %d, %d", $query_getUsers, $startRow_getUsers, $maxRows_getUsers);
$getUsers = mysql_query($query_limit_getUsers, $cs5read) or die(mysql_error());
$row_getUsers = mysql_fetch_assoc($getUsers);
if (isset($_GET['totalRows_getUsers'])) {
  $totalRows_getUsers = $_GET['totalRows_getUsers'];
} else {
  $all_getUsers = mysql_query($query_getUsers);
  $totalRows_getUsers = mysql_num_rows($all_getUsers);
$totalPages_getUsers = ceil($totalRows_getUsers/$maxRows_getUsers)-1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Registered Users</title>
<link href="../../styles/users.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Registered Users</h1>
<table>
  <tr>
    <th scope="col">Real name</th>
    <th scope="col">Username</th>
    <th scope="col"> </th>
    <th scope="col"> </th>
  </tr>
  <?php do { ?>
    <tr>
      <td><?php echo $row_getUsers['first_name']; ?> <?php echo $row_getUsers['family_name']; ?></td>
      <td><?php echo $row_getUsers['username']; ?></td>
      <td><a href="update_user.php?user_id=<?php echo $row_getUsers['user_id']; ?>">EDIT</a></td>
      <td><a href="delete_user.php?user_id=<?php echo $row_getUsers['user_id']; ?>">DELETE</a></td>
    </tr>
    <?php } while ($row_getUsers = mysql_fetch_assoc($getUsers)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($getUsers);
?>
update_user.php
<?php require_once('Connections/cs5write.php'); ?>
<?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;
$colname_getUser = "-1";
if (isset($_GET['user_id'])) {
  $colname_getUser = $_GET['user_id'];
mysql_select_db($database_cs5write, $cs5write);
$query_getUser = sprintf("SELECT user_id, first_name, family_name, username FROM users WHERE user_id = %s", GetSQLValueString($colname_getUser, "int"));
$getUser = mysql_query($query_getUser, $cs5write) or die(mysql_error());
$row_getUser = mysql_fetch_assoc($getUser);
$totalRows_getUser = mysql_num_rows($getUser);
if (isset($_POST['password']) && empty($_POST['password'])) {
  $_POST['password'] = $row_getUser['password'];
} else {
  $_POST['password'] = sha1($_POST['password']);
$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 users SET first_name=%s, family_name=%s, username=%s, password=%s WHERE user_id=%s",
                       GetSQLValueString($_POST['first_name'], "text"),
                       GetSQLValueString($_POST['surname'], "text"),
                       GetSQLValueString($_POST['username'], "text"),
                       GetSQLValueString($_POST['password'], "text"),
                       GetSQLValueString($_POST['user_id'], "int"));
  mysql_select_db($database_cs5write, $cs5write);
  $Result1 = mysql_query($updateSQL, $cs5write) or die(mysql_error());
  $updateGoTo = "user_list.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $_SERVER['QUERY_STRING'];
  header(sprintf("Location: %s", $updateGoTo));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Update user details</title>
<link href="../../styles/users.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Update User Record</h1>
<form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
  <fieldset>
    <legend>Leave password blank if no change</legend>
    <p>
      <label for="first_name">First name:</label>
      <input name="first_name" type="text" id="first_name" value="<?php echo $row_getUser['first_name']; ?>" />
    </p>
    <p>
      <label for="surname">Family name:</label>
      <input name="surname" type="text" id="surname" value="<?php echo $row_getUser['family_name']; ?>" />
    </p>
    <p>
      <label for="username">Username:</label>
      <input name="username" type="text" id="username" value="<?php echo $row_getUser['username']; ?>" />
    </p>
    <p>
      <label for="password">Password:</label>
      <input type="password" name="password" id="password" />
    </p>
    <p>
      <label for="conf_password">Confirm password:</label>
      <input type="password" name="conf_password" id="conf_password" />
    </p>
    <p>
      <input type="submit" name="add_user" id="add_user" value="Update" />
      <input name="user_id" type="hidden" id="user_id" value="<?php echo $row_getUser['user_id']; ?>" />
    </p>
  </fieldset>
  <input type="hidden" name="MM_update" value="form1" />
</form>
</body>
</html>
<?php
mysql_free_result($getUser);
?>
Thank you!

Similar Messages

  • Anyone use Flex with php for file upload? PHP Notice:  Undefined index:  Filedata

    My code works. It uploads the file and inputs the file name into a database, but I can't shake this php notice. I think php is looking for multipart/form-data from the HTML form tag.
    <form action="upload.php"  enctype="multipart/form-data"/>
    But I am using flex. The multipart/form-data info is sent as the second default argument of the upload() function. Does anyone have experience with this? Thanks.
    PHP Notice:  Undefined index:  Filedata
    $filename = $_FILES['Filedata']['name'];
    public function selectHandler(event:Event):void {
                    request = new URLRequest(UPLOAD_DIR);
                    try {
                        fileRef.upload(request);
                        textarea1.text = "Uploading " + fileRef.name + "...";
                    catch (error:Error) {
                        trace("Unable to upload file.");
                        textarea1.text += "\nUnable to upload file.";

    Hi, Thanks for your reply !
    Im not getting any errors Flex side, as i say i get a alert message saying the file has been uploaded so . .
    I am using a Wamp server on a windows machine, how do i check the file permissions on both the folder and the php file ?
    Also how do i debug a php file ?
    ANy help would be thankful !

  • Undefined index error in checkbox update form

    Hi!
    i have a problem with my update form
    Notice:  Undefined index: accepte_oiseaux in C:\wamp\www\weziwezo\voiturier\mod_vehicule.php on line 96
    Notice:  Undefined index: accepte_chien in C:\wamp\www\weziwezo\voiturier\mod_vehicule.php on line 97
    i need to display checkbox checked  if "checked=\"checked\"";} = 1
    here is my code
    </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">Accepte oiseaux:</td>
           <td><input type="checkbox" name="accepte_oiseaux" value="" <?php if (!(strcmp($row_rsRecupAuto['accepte_oiseaux'],1))) {echo "checked=\"checked\"";} ?> /></td>
           </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right">Accepte chiens:</td>
           <td><input type="checkbox" name="accepte_chien" value="" <?php if (!(strcmp($row_rsRecupAuto['accepte_chien'],1))) {echo "checked=\"checked\"";} ?> /></td>
           </tr>
         <tr valign="baseline">
           <td nowrap="nowrap" align="right"> </td>
           <td><input type="submit" value="Mettre &agrave; jour l'enregistrement" /></td>
           </tr>
    thank you for your help

    It is a Notice, saying that $row_rsRecupAuto array has no "accepte_oiseaux" element in it.
    Simpler terms: there is no $row_rsRecupAuto["accepte_oiseaux"],
    which might be important or unimportant in your case.
    Where is $row_rsRecupAuto coming from? If from a database, check if you are pulling the correct fields.
    PHP notices are not fatal errors, and can be ignored if necessary and if your code works as expected.
    You can suppress notices by altering the php.ini or just put this code at the top of the page:
    <?php
    error_reporting(E_ALL ^E_NOTICE);
    ?>

  • Indexing Hashed Password

    Hi All
    We have a requirement to index SHA encrypted passwords in our LDAP user database. My next question is that we will be authenticating users using JNDI connecting to LDAP. I am wondering if anyone has tried this.
    Thanks

    Why do you need to index passwords? Will you be doing searches like
    (userPassword={SSHA}jakls09asd0asd89===)
    Seems strange, but you should be able to create an index for userPassword to index the hashed values. Just use the usual method for creating an index for an attribute.

  • Error when inserting into table - Undefined Variable

    DB = Oracle 10.2.0.1
    WEBSERV = Apache 2.0.55
    LANG = PHP5
    I have created (or more accurately, copied) a php script to insert data into one of my database tables when I press submit. The code is as follows (my connect string works fine and its included in the dbutils.php file):
    <?php
    if($submit == "submit"){
    include "dbutils.php";
      $query = "insert into users values (seq_user_usr_id.NEXTVAL, '$usr_name')";
      $cursor = OCIParse ($db_conn, $query);
      if ($cursor == false){
        echo OCIError($cursor)."<BR>";
        exit;
      $result = OCIExecute ($cursor);
      if ($result == false){
        echo OCIError($cursor)."<BR>";
        exit;
      OCICommit ($db_conn);
      OCILogoff ($db_conn);
    else{
       echo '
        <html><body>
        <form method="post" action="index.php">
    <table width="400" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>Please enter a username:</td>
        <td><input type="text" name="usr_name"></input><br></td>
    </tr>
    <tr>
        <td><input type="submit" name="button" value="Submit"></input></td>
    </tr>
    </table>
        </form>
        </body></html>
    ?></p>I am getting the following error regarding an undefined variable:
    [Fri Jan 20 13:11:22 2006] [error] [client 127.0.0.1] PHP Notice: Undefined variable: submit in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\mywebsite\\test.php on line 3
    Where would I declare this variable? It is just a check to see if the submit button is pressed as far as I can see. Any help would be greatfully appreciated.
    W8

    I have changed the code to this:
    <?php
    if($submit == "submit"){
    include "dbutils.php";
    $usr_name = $_POST['usr_name'];
    $query = "insert into users (column1, column2) values (seq_user_usr_id.NEXTVAL, '$usr_name')";
    $cursor = OCIParse ($db_conn, $query);
    if ($cursor == false){
    echo OCIError($cursor)."
    exit;
    $result = OCIExecute ($cursor);
    if ($result == false){
    echo OCIError($cursor)."
    exit;
    OCICommit ($db_conn);
    OCILogoff ($db_conn);
    else{
    $submit = $_POST['submit'];
    echo '
    <html><body>
    <form method="post" action="index.php">
    <table width="400" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>Please enter a username:</td>
    <td><input type="text" name="usr_name"></input>
    </td>
    </tr>
    <tr>
    <td><input type="submit" name="submit" value="submit"></input></td>
    </tr>
    </table>
    </form>
    </body></html>
    ?>And now I am getting the following error:
    [Mon Jan 23 13:45:32 2006] [error] [client 127.0.0.1] PHP Notice:  Undefined index:  submit in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\mywebsite\\test2.php on line 24Does anyone have any ideas?
    I am struggling to find an example to work from to get this working. If anyone can point me to any literature that will explain the code so that I can work this out for myself that would also be a great help.

  • Dreamweaver 8 bindings - to MySQL, error code 500

    Hello!
    Well, I've spent five days searching online forums, and a few
    posts come close to my problem, but not getting any clues to a
    solution. I hope one of the resident experts or members could shed
    some light...
    Windows XP
    Dreamweaver 8.0.2 (just upgraded - same problem)
    - Used setup-v1.17-apache-2.2.2-win32.exe for setup - from
    devside.net PHP 5.2.0-dev MySQL 4.1.7 (installed new after package.
    Have two instances of mysql on my system - one active, one in
    manual-inactive)
    - All was going well until trying to establish bindings in
    Dreamweaver. PHP is up and running. MySQL loaded, and database
    connection fine. Bindings gets the error... "HTTP Error Code 500
    Internal Server Error"
    Just getting back to it... Again, thank you for your help!
    Dreamweaver 8 has support for PHP 5. Version I'm using is
    5.2.0. MX specifies versions 4.x and above are required. I'll have
    to research if the support cuts off at 5.0.
    My Connections file: conn_newland.php (I'm following the book
    tutorial):
    <?php
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_conn_newland = "localhost";
    $database_conn_newland = "newland_tours";
    $username_conn_newland = "root";
    $password_conn_newland = "";
    $conn_newland = mysql_pconnect($hostname_conn_newland,
    $username_conn_newland, $password_conn_newland) or
    die(mysql_error());
    $Recordset1 = mysql_query("SHOW variables", $Connection1);
    echo "<table border=1 width=100%>";
    while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)) {
    echo
    "<tr><td>".$row_Recordset1['Variable_name']."</td><td>".$row_Recordset1['Value']."</td></ tr>";
    echo "</table>";
    ?>
    Recordset parameters I entered in bindings:
    Name: rs_journal
    Connection: conn_newland
    Table: tbl_journal
    Columns: Selected - journalID, journal_entry
    Filter: none
    Sort: journalID Descending
    Clicking Test gives: "HTTP Error Code 500 Internal Server
    Error"
    By the way, the reason I didn't specify a password in "root'
    is that I had a problem before that I didn't know enough to
    overcome, so had to reinstall MySQL. However, the same error occurs
    if I specify another user name and password (previously set up).
    7:30 pm -
    Adding to this post...
    I found the following at
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16515.
    However, it appears it may be referring only to Dreamweaver MX 2004
    on Mac OS X. I have Dreamweaver 8 on Windows XP:
    Verify that the connection scripts are up on the server
    This section is related to the section above. In a web
    browser, browse to the URL prefix you have defined in the Testing
    Server category of the site definition and add
    /_mmServerScripts/MMHTTPDB.php. For example:
    http:/myserver/mysite/_mmServerScripts/MMHTTPDB.php. If things are
    working correctly, you should see something like the following text
    returned in the web browser:
    Notice: Undefined index: Type in
    c:\inetpub\wwwroot\mysite\_mmServerScripts\MMHTTPDB.php on line 13
    Notice: Undefined variable: oConn in
    c:\inetpub\wwwroot\mysite\_mmServerScripts\MMHTTPDB.php on line 20
    When I go to the file above, this is the message I receive
    (only thing that appears):
    The files from the _mmServerScripts folder are for the server
    model PHP-MySQL. You try to connect to a database using a different
    server model . Please remove this folder outside the Dreamweaver
    environment on both local and testing machines and try again.\n
    Is there a hint here of what the problem is? I need some help
    in possible interpretations.
    Previous attempts made to solve:
    - re-installed MySQL with mysql-5.0.24-win32.zip in
    recommended directory (outside the www directory). I now have two
    instances of MySQL on my local server - one set to automatic
    loading and the other manual (switched off)
    - one post suggested problem might be with ODBC - installed
    SQL ODBC with mysql-connector-odbc-3.51.12-win32.msi. However, I
    don't have a clue as to whether it's connected to anything...
    - successfully connected to SQL database through root without
    password and specific logon and password. No difference.
    - other posts suggest problem could reside in php.ini,
    htaccess, my.ini (SQL). I know where to find them, but don't have
    an understanding of what parameters to shift, if any. One post
    suggested a port problem, and I did see a port problem, presently
    set to 3306.
    From what I've been able to gather, this has been recognized
    as an issue before, but there doesn't seem to be any documentation
    online (or at least what I've been able to find) dealing with this.
    And any mention of the problem that I've seen references
    Dreamweaver MX, not 8, although I don't think the version
    difference is a significant issue.
    This error must be relatively rare, or I'd see more out there
    about it. Still, I hope that at least one of the community experts
    may have come across it.
    Will be waiting with bated breath -- at least for a few
    days...
    Thanks!
    Joe

    Hello,
    I have also had the same error - namely that whilst I could connect via ftp, upload/download files, and view database tables, any attempt to view of modify recordsets resulted in error 500.
    Having checked other potential causes (e.g. selection/non-selection use of passive FTP setting, enabling of php, etc.), on the back of posts here I contacted my host and asked if if could relate to mod security, as further investigation revealed that the issue only occurred on sites where mod security had not been disabled (I don't like to disable mod security for obvious reasons - and I'm told you can't do that site by site with apache2 anyway).
    After a few false starts, the problem was resolved - with the following response from my host: "The false positives were being generated by "/_mmServerScripts/MMHTTPDB.php" and that is what we've worked around in the rules. As such, any domain on [servername] using that script in the same way shouldn't generate a false-positive moving forward."
    So it seems the answer (assuming your on an apache server of course) may be to modify the rules to allow full access for MMHTTPDB.php.
    I hope that is of help to some.

  • How do i filter recordsets using session variable???  Please help this is driving me mad...!!

    I am having the same problem as user "Gabe the animator" in a post sent in 2007.
    "my recordset that drives a dynamic table won't filter results based on a session variable. I know session variables are working because I have the session variable echo on the page (dragged-n-dropped my session variable from the Bindings panel to my page), and that works fine. So why can't I filter my recordset with the same session variable???"
    here is the code:
    <?php require_once('Connections/mockconn.php'); ?>
    <?php
    session_start();
    ?>
    <?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;
    if(!session_id()){
    session_start();
    $colname_info = "-1";
    if (isset($_SESSION['email'])) {
      $colname_info = $_SESSION['email'];
    mysql_select_db($database_mockconn, $mockconn);
    $query_info = sprintf("SELECT name, last_name, email, password FROM registration WHERE email = %s", GetSQLValueString($colname_info, "text"));
    $info = mysql_query($query_info, $mockconn) or die(mysql_error());
    $row_info = mysql_fetch_assoc($info);
    $totalRows_info = mysql_num_rows($info);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>home</title>
    </head>
    <body>
    <div id="info">hello <?php echo $row_info['']; ?></div>
    <?php
    if (isset($_SESSION['email'])) {
              echo 'your email: '.' '. $_SESSION['email'] .' '.'good job';}
                        ?>
    </body>
    </html>
    PLEASE PLEASE HELP.... I have been at this for day's...
    how do I get the record set to filter based on the value of the session variable

    Sorry I forgot to mension the error I am getting?
    ( ! ) Notice: Undefined index: in C:\wamp\www\mock\home.php on line 59
    Call Stack
    Time
    Memory
    Function
    Location
    1
    0.0093
    389024
    {main}( )
    ..\home.php:0
    Why is this error coming up?

  • Sha1()

    I understand to make the sha1() encrypts, but how do you decrypt?
    From the example of w3school the following.
    <?php
    $str = 'Hello';
    echo sha1($str);
    ?>
    The output of the code above will be:
    f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0
    How do you decrypt it back from the actually string of "Hello".
    Thank you.

    I am still getting an error in my display page.
    Here is the code on the display page as follows:
    <?php require_once('../Connections/conPHPSamples.php'); ?>
    <?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;
    $colname_getUserList = "-1";
    if (isset($_GET['userid'])) {
      $colname_getUserList = $_GET['userid'];
    mysql_select_db($database_conPHPSamples, $conPHPSamples);
    $query_getUserList = sprintf("SELECT userid, username, AES_DECRYPT('pwd', 'pimpmyride') AS pwd FROM useracct WHERE userid = %s ORDER BY username ASC", GetSQLValueString($colname_getUserList, "text"));
    $getUserList = mysql_query($query_getUserList, $conPHPSamples) or die(mysql_error());
    $row_getUserList = mysql_fetch_assoc($getUserList);
    $totalRows_getUserList = mysql_num_rows($getUserList);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Update Users</title>
    </head>
    <body>
    <h2>Update Users</h2>
    <p><a href="index.php">Back to index</a><a href="register.php"></a></p>
    <p>UserID: <?php echo $row_getUserList['userid']; ?></p>
    <p>Username: <?php echo $row_getUserList['username']; ?></p>
    <p>Password: <?php echo $row_getUserList["AES_DECRYPT('pwd', 'pimpmyride')"]; ?></p>
    </body>
    </html>
    <?php
    mysql_free_result($getUserList);
    ?>
    In my MySQL this what I have listed.
    My output on my display page is as follows.
    UserID: 687d872e34a62bf0a81fa21a9205a4dd
    Username: hello
    Password: Notice:  Undefined index:  AES_DECRYPT('pwd', 'pimpmyride') in
    C:\vhosts\myPHPSamples\passwordEncryption\update.php on line
    56
    I can't figure out what I am doing wrong.  Even if I omit <?php echo $row_getUserList["AES_DECRYPT('pwd', 'pimpmyride')"]; ?> and replace it with <?php echo $row_getUserList['pwd']; ?> it does not display anything for password.

  • Access to Folio Producer APIs

    Introduction to Folio Author Plugin for WordPress | Adobe Developer Connection
    Adobe API Key and Secret, DPS Login and Password
    If you are a DPS Enterprise–licensed publisher you can contact your Adobe representative to request a unique Folio Producer API Key and Secret. By enabling the Folio Author module to directly connect to the Folio Producer APIs, publishers can maintain a sync status with all article content published through WordPress. Publishing through the Folio Producer APIs will streamline the WordPress folio publishing workflow by uploading the article content directly to Folio Producer. You will also need to enter the login for the DPS account you wish to publish to, along with the corresponding password.
    My company use DPS Enterprise. I Can't contact Adobe representative. How to get API Key and secret ? Can anyone help me ? Thanks.

    OK . now I have a dps key and secret .
    I installed it in xampp , when trying to send them to the cloud DPS , this error appears .
    ========================================================================================
    Something went wrong
    Looks like something didn't go as expected. Here's the technical response:
    Notice: Undefined index: ticket in/Applications/XAMPP/xamppfiles/htdocs/wpdps/wp-content/plugins/folio-author-plugin-for-wor dpress/libs/folio-producer-api/app/DPSFolioProducer/Config.php on line 94
    {"code":0,"message":"
    general<\/div>Could not get folio metadata<\/div>"} 
    ========================================================================================
    Thanks

  • Convert long to varchar2

    Hi there,
    I am looking for a convertion, long to varchar2, in a sql statement.
    If I run the following query :
    select data_default from user_tab_columns
    It works fine in sql developper but when I execute it in my PHP code it returns:
    Notice: Undefined index: DATA_DEFAULT in /opt/lampp/htdocs/datamodel/index.php on line 64
    This issue is due in the case where the columns has null.
    So I try with the NVL function:
    select nvl(data_default, 'null') from user_tab_columns
    ORA-00932: inconsistent datatypes: expected LONG got CHAR
    I found on internet some people are using the substr function but it did not working for me.
    select substr(data_default, 1, 2000) from user_tab_columns
    ORA-00932: inconsistent datatypes: expected NUMBER got LONG
    Any one has an idea ?
    Regards !

    See this thread as well you can get an exaple user function
    ORA-00932: inconsistent datatypes
    G.

  • Will someone help me open a cisco swf file

    I am trying to open a cisco swf file on my xp computer.I initially downloaded "IrFanView" which was a program internet explorer told me to download so I could open it. I downloaded the aforementioned program and when I try to open the file I get on the bottom of screen "unidentified error" then a popup box that sais "Internet Explorer can't open this file". Then I try to open it with Google Chrome and I don't get the popup but still the "unidentified error" at the bottom of the screen. I have heard that adobe flash will open it but here is the tricky part. In my add/remove programs it shows I have adobe flash 11 active x. However, when I right click on the file and click on "open with" the only adobe product that shows is Adobe Reader.I'm thinking if I could get the path to adobe flash then I might have the answer. Is my thinking along the right path or not. Lastly, can someone help me find the path to adobe flash 11 or help me to open this swf file.

    Ned,
    I tried opening it via Internet Explorer and got this error message:
    Invalid character
    index.js       Line: 1
    Invalid Character
    swfobject.js  Line:1
    Object expected
    index.html    Line:18
    'SWFObject' is undefined
    index.html
    code:0
    URI: file:///C:CISCO_CCNA/Exploration1_English/theme/index.html      Line: 51
                                                                                                          Char:1
    What does all of that above mean?

  • Error testing locally; works fine on remote server

    I was about to post that I'd hit an error when trying to
    create a
    conditional region in DW 8 with ASP, CF & PHP: Training
    from the Source.
    Rather than paste the non-PHP code, I uploaded the page to my
    remote server.
    When I browsed to the link, the error wasn't there.
    I inserted the code for the conditional region just before
    the opening
    <form> tag, as the book instructed (Lesson 6).
    <?
    if ($_GET['error'] == "notnumeric")
    echo "<p>*** Error! One or more fields was left blank
    or contained a
    non-numeric character.</p>";
    ?>
    When I preview locally, the page appears correctly, but with
    the following
    message before the form:
    Notice: Undefined index: error in C:\Program Files\Apache
    Group\Apache2\htdocs\newland\Lesson06\Start\newland-php\tourprice.php
    on
    line 27
    Line 27 is where the "if" statement starts.
    On my remote server, everything works as it should:
    http://www.feathertheweb.com/newland/Lesson06/Start/newland-php/tourprice.php
    Any help is appreciated.
    Thanks,
    Heather

    So, I changed the code you had provided and that worked. Now,
    I've tested
    the form and when I click "submit," I get this:
    Notice: Undefined index: nmChildren in C:\Program
    Files\Apache
    Group\Apache2\htdocs\newland\Lesson06\Start\newland-php\tourprice_processor.php
    on line 2
    Warning: Cannot modify header information - headers already
    sent by (output
    started at C:\Program Files\Apache
    Group\Apache2\htdocs\newland\Lesson06\Start\newland-php\tourprice_processor.php:2)
    in C:\Program Files\Apache
    Group\Apache2\htdocs\newland\Lesson06\Start\newland-php\tourprice_processor.php
    on line 4
    I'm guessing it's related to the change I made in
    tourprice.php. I tried to
    figure out what needed to be changed in
    tourprice_processor.php based on
    that change, but I'm still pretty new at this and really
    wasn't sure.
    Below is the code from tourprice_processor.php:
    <?php
    if (is_numeric($_POST['numAdults']) == false or
    is_numeric($_POST['nmChildren']) == false)
    header("Location: tourprice.php?error=notnumeric");
    exit;
    ?>
    <?php
    $numAdult = $_POST['numAdults'];
    $numChild = $_POST['numChildren'];
    $basePrice = $_POST['tourName'];
    $tourPrice = ($numAdult * $basePrice) + ($numChild *
    $basePrice);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <title>Newland Tours: Tour Price
    Calculator</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <link href="css/newland.css" rel="stylesheet"
    type="text/css" /></head>
    <body>
    <a href="#top"><img src="images/spacer.gif"
    alt="Skip to main page content"
    width="1" height="1" border="0" align="left" /></a>
    <table width="750" border="0" cellpadding="3"
    cellspacing="0">
    <tr>
    <td><img src="images/banner_left.gif" width="451"
    height="68" alt="Newland
    Tours Banner, Left." /></td>
    <td width="280"><img src="images/banner_right.jpg"
    width="276" height="68"
    alt="Newland Tour Banner, Right." /></td>
    </tr>
    <tr>
    <td><img src="images/navbar.gif" name="navbar"
    width="450" height="20"
    border="0" usemap="#navbarMap" alt="Navigation Bar."
    /></td>
    <td><img name="copyright_bar"
    src="images/copyright_bar.gif" width="272"
    height="20" border="0" alt="Copyright 2006 Newland Tours."
    /></td>
    </tr>
    <tr>
    <td colspan="2">
    <h1><br />
    <a name="top" id="top"></a>Tour Price
    Calculator</h1>
    <p>The estimated cost of your tour is
    <strong><?php echo
    '$'.number_format($tourPrice, 2);
    ?></strong>.</p>
    <p>Prices include hotel, accommodation, and travel
    expenses during the
    tour. They
    do not include airfare to the starting
    destination.</p>
    <p><a href="tourprice.php">Calculate</a>
    another tour.</p>
    <p><a href="contact.php">Contact</a> one
    of our qualified agents.</p>
    </td>
    </tr>
    </table>
    <br />
    <map name="navbarMap" id="navbarMap">
    <area shape="rect" coords="1,0,62,20" href="index.php"
    alt="Home" />
    <area shape="rect" coords="71,0,117,20" href="about.php"
    alt="About" />
    <area shape="rect" coords="129,0,196,20" href="tours.php"
    alt="Find Tours"
    />
    <area shape="rect" coords="209,0,311,20"
    href="profiles.php" alt="Country
    Profiles" />
    <area shape="rect" coords="327,0,434,20"
    href="contact.php" alt="Contact An
    Agent" />
    </map>
    </body>
    </html>
    Heather
    "David Powers" <[email protected]> wrote in message
    news:[email protected]...
    > Heather wrote:
    >> I inserted the code for the conditional region just
    before the opening
    >> <form> tag, as the book instructed (Lesson 6).
    >>
    >> <?
    >> if ($_GET['error'] == "notnumeric")
    >>
    >> When I preview locally, the page appears correctly,
    but with the
    >> following message before the form:
    >>
    >> Notice: Undefined index: error in C:\Program
    Files\Apache
    >
    > It's badly written code. It should be
    >
    > if (isset($_GET['error']) && $_GET['error'] ==
    "notnumeric")
    >
    >> On my remote server, everything works as it should:
    >
    > That's because your remote server has been configured to
    suppress PHP
    > notices.
    >
    > PHP notices alert you to non-fatal mistakes in coding. A
    lot of people
    > just ignore them, but it's a sloppy habit to get into,
    because it can lay
    > your scripts open to attack. Before testing the value of
    a variable, you
    > should always use isset() to check that the variable has
    been defined in
    > the first place.
    >
    >
    http://www.php.net/manual/en/function.isset.php
    >
    > --
    > David Powers
    > Author, "Foundation PHP for Dreamweaver 8" (friends of
    ED)
    > Author, "Foundation PHP 5 for Flash" (friends of ED)
    >
    http://foundationphp.com/

  • TS3276 Difficulties using Stationary in Mail: Cannot save to send separately to multiple email addresses or groups. Some recipients do not see the whole email- bottom is cut off. Anyone else wrestling with this?

    Using Stationary in Mail:
    How can you save to resend to additional emails or groups? When you hit SAVE where is it saved to? SAVE AS is not an option.
    I have received complaints that only Half the message was received. Is Stationary not compatible with all mail programs or operating systems?

    O.K. I typed:
    pear upgrade --alldeps pear
    and this is what I got:
    downloading PEAR-1.4.9.tgz ...
    Starting to download PEAR-1.4.9.tgz (283,443 bytes)
    ..........................................................done: 283,443 bytes
    upgrade ok: channel://pear.php.net/PEAR-1.4.9
    PEAR: Optional feature webinstaller available (PEAR's web-based installer)
    PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
    PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
    To install use "pear install PEAR#featurename"
    I wasn't sure if it actually upgraded it or not so I typed:
    pear info PEAR
    and I get:
    Could not get contents of package "/usr/local/php5/bin/pear". Invalid tgz file.
    If I type:
    pear list-upgrades
    I get the same results:
    Notice: Undefined index: release_state in Remote.php on line 371
    Available Upgrades (stable):
    ============================
    Package Local Remote Size
    HTML_Table 1.6.1 (stable) 1.7.0 (stable) 13.7kB
    Mail 1.1.9 (stable) 1.1.10 (stable) 16.5kB
    PEAR Array () 1.4.9 (stable) 277kB
    What does the Array() mean anyways? Moving on, then I typed:
    sudo pear upgrade --alldeps Mail
    and it upgraded successfully. Now the code is working and I am sending email again! Thank you so much for your help in leading me to the solution (--alldeps). If you find out how to get the error reporting to work again let me know, and I will do the same if I figure it out.
      Mac OS X (10.4.6)  

  • My itunes Feeds are not updating

    My itunes feeds are not updating. One stopped updating a couple weeks ago, while another one is approaching a month without an update. Anyone have any ideas on what is going on? Anything i can do to resolve this issue? Any help is appreciated. thank you.
    https://itunes.apple.com/us/podcast/g-t-show-podcasts/id532987947?mt=2
    https://itunes.apple.com/us/podcast/g-and-t-show/id689638265?mt=2

    The feed for the first podcast you list is at
    http://feeds.feedburner.com/gandtshow/RAcB
    There is a line at the very top of the feed which reads
    Notice: Undefined index: feed_redirect_url in /hermes/bosnaweb03a/b2043/ipw.certifiedpcdoctor2/public_html/GandTshow/wp-conte nt/plugins/powerpress/powerpress.php on line 1377
    Its presence renders the feed unreadable; when subscribing it shows up blank, and the iTunes Store is showing a cached version from the last time it could read the feed.
    The feed for the second podcast is at
    http://www.gandtshow.com/?feed=podcast2
    There appear to be no errors in this feed, but it is showing up empty when subscribing. It did take a long time to load in Firefox, so it's possible that it may be timing out in iTunes and the Store.

  • Error on Production Server when php service is called.

    The web application runs fine on my development machine but on the production server it gives me the following error and no responce when a phpservice is called.
    error:
    Send failed
    Channel.Connect.Failed error NetConnection.Call.BadVersion: : url:
    'http://ipaddress/Project/public/gateway.php'
    Network Monitor:
    Development Machine:
    Windows 7
    MySQL 5.5.16
    Zend Framework 1.10
    Production Machine:
    Ubuntu 11.10
    MySQL 5.1.58
    Zend Framework 1.11
    I followed the following steps to deploy the application on production server;
    1. created identical database with same credentials on the production server
    2. confirmed that my php service works on the server by manually navigating to the php file and printing the data retrieved on the page
    3. modified the paths in amf_config.ini to reflect production server
    [zend]
    webroot = "/var/www"
    zend_path ="/usr/local/zend/share/ZendFramework/library"
    library ="/var/www/Project/library"
    services ="/var/www/Project/services"
    [zendamf]
    amf.production = true
    amf.directories[]=Project/services
    4. initialized the class by adding
    // Initialization customization goes here
    _serviceControl.endpoint = "http://ipaddress/Project/public/gateway.php";
    in the .as file for the php service
    I have also found from my zend server logs that when my php service is called its throws the following error:
    PHP Notice:  Undefined index: HTTPS in /usr/local/zend/share/ZendFramework/library/Zend/Amf/Response/Http.php on line 59
    I doubt that there is anything wrong in the deployment process but please do let me know if you could think of something i might have missed.
    The other thing im wondering is the php notice if it were to be caused due to different Zend Framework versions!
    Kindly advice

    EGJ Steens has post a fix at http://forums.adobe.com/message/4097998#4097998#4097998/Using Flash Builder
    Zend framework 1.11 added an extra function in the Http.php file (which was mentioned in the post) and was fixed as follows
    protected function isIeOverSsl()
            $_SERVER['HTTPS'] = 'off';  //Adding this line fixed the issue
            $ssl = $_SERVER['HTTPS'];
            if (!$ssl || ($ssl == 'off')) {
                // IIS reports "off", whereas other browsers simply don't populate
                return false;
            $ua  = $_SERVER['HTTP_USER_AGENT'];
            if (!preg_match('/; MSIE \d+\.\d+;/', $ua)) {
                // Not MicroSoft Internet Explorer
                return false;
            return true;
    My concern is if i wish to secure my application with ssl using HTTPS will this prevent me from doing so.
    Any Pointers Anybody?

Maybe you are looking for