Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default HELP DUMMY

    Hi, i have created a record update form, that takes information from my
    database (mysql) and then updates the form. I have been trying to ammend this
    by changing one of the fields into a file upload thingy. I have edited most of
    the information but keep receiving an error that says:

    Warning: Cannot modify header information - headers already sent by (output
    started at
    /home/ftpserver/www/homepage/student/cmpbhugh/index/addmember1.php:2) in
    /home/ftpserver/www/homepage/student/cmpbhugh/index/addmember1.php on line 52

    Here is my code:

    <?php require_once('Connections/mysql.php'); ?>
    <?php
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
    $theNotDefinedValue = "")
    {
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
    }

    $editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
    if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
    $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
    }

    if ((isset($HTTP_POST_VARS["MM_update"])) && ($HTTP_POST_VARS["MM_update"] ==
    "form1")) {
    $updateSQL = sprintf("UPDATE artistmembers SET email=%s, membername=%s,
    memberpicture=%s, membertext=%s, memberposition=%s WHERE membernameid=%s",
    GetSQLValueString($HTTP_POST_VARS['email'], "text"),
    GetSQLValueString($HTTP_POST_VARS['membername'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['file'], "int"),
    GetSQLValueString($HTTP_POST_VARS['membertext'], "int"),
    GetSQLValueString($HTTP_POST_VARS['memberposition'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['membernameid'],
    "int"),
    GetSQLValueString($HTTP_POST_VARS['memberpicture'], "text"));


    mysql_select_db($database_mysql, $mysql);
    $Result1 = mysql_query($updateSQL, $mysql) or die(mysql_error());

    $updateGoTo = "bandsection.php";
    if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
    }
    this is line 52............ header(sprintf("Location: %s", $updateGoTo));
    }

    $colname_loadmember = "1";
    if (isset($HTTP_GET_VARS['membernameid'])) {
    $colname_loadmember = (get_magic_quotes_gpc()) ?
    $HTTP_GET_VARS['membernameid'] : addslashes($HTTP_GET_VARS['membernameid']);
    }
    mysql_select_db($database_mysql, $mysql);
    $query_loadmember = sprintf("SELECT * FROM artistmembers WHERE membernameid =
    %s", $colname_loadmember);
    $loadmember = mysql_query($query_loadmember, $mysql) or die(mysql_error());
    $row_loadmember = mysql_fetch_assoc($loadmember);
    $totalRows_loadmember = mysql_num_rows($loadmember);
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <!-- DW6 -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable --><link rel="stylesheet" href="3col_leftNav.css"
    type="text/css">
    <style type="text/css">
    <!--
    .style1 {color: #FFFFFF}
    .style8 {font-size: 10px}
    .style9 {font-size: 12px}
    -->
    </style>
    <!-- TemplateParam name="Headline1" type="boolean" value="true" -->
    <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
    </head>
    <body>
    <div id="masthead">
    <h1 id="siteName">Soundstage</h1>
    <div id="globalNav">
    <a href="register.html">register</a> | <a href="login.html">login</a> | <a
    href="logout.html">logout</a> | <a href="#">basket</a> |
    <a href="#">checkout</a> |
    </div>
    <h2 class="style1" id="pageName">reviews...</h2>
    <div id="breadCrumb">
    <a href="#">breadcrumb</a> / <a href="#">breadcrumb</a> / <a
    href="#">breadcrumb</a> /
    </div>
    </div>
    <div id="navBar">
    <div id="search">
    <form action="#">
    <label>search</label>
    <input name="searchFor" type="text" size="10">
    <input name="goButton" type="submit" value="go">
    </form>
    </div>
    <div id="sectionLinks">
    <h3>Section Links</h3>
    <ul>
    <li><a href="index.html">Home</a></li>
    <li><a href="artists.html">Artists</a></li>
    <li><a href="genre.html">Genre</a></li>
    <li><a href="city.html">City</a></li>
    <li><a href="reviews.html">Reviews</a></li>
    <li><a href="#">Section Link</a></li>
    </ul>
    </div>
    <div class="relatedLinks">
    <h3>Related Link Category</h3>
    <ul>
    <li><a href="#">Related Link</a></li>
    <li><a href="#">Related Link</a></li>
    <li><a href="#">Related Link</a></li>
    <li><a href="#">Related Link</a></li>
    <li><a href="#">Related Link</a></li>
    <li><a href="#">Related Link</a></li>
    </ul>
    </div>
    <div class="relatedLinks">
    <h3>Related Link Category</h3>
    <ul>
    <li><a href="#">Related Link</a></li>
    <li><a href="#">Related Link</a></li>
    <li><a href="#">Related Link</a></li>
    <li><a href="#">Related Link</a></li>
    <li><a href="#">Related Link</a></li>
    <li><a href="#">Related Link</a></li>
    </ul>
    </div>
    </div>
    <!--end navBar div -->
    <div id="headlines">
    <h3>Artist of the week:</h3>
    <p>&nbsp;
    </p>
    <div id="advert">
    <img src="" alt="" width="107" height="66"> Ad copy ad copy ad copy. Ad
    copy ad copy.
    </div>
    </div>
    <!--end headlines -->
    <div id="content"> </div>

    <!--end content -->

    <div align="left">

    <?
    $uploaddir = '//ftpserver/www/bla/bla/bla;
    $uploadfile = $uploaddir . basename($_FILES['pictureupload']['name']);

    echo '<pre>';
    if (move_uploaded_file($_FILES['pictureupload']['tmp_name'], $uploadfile)) {
    echo "File is valid, and was successfully uploaded.\n";
    } else {
    echo "Possible file upload attack!\n";
    }

    echo 'Here is some more debugging info:';
    print_r($_FILES);

    print "</pre>";

    ?>

    <form action="<?php echo $editFormAction; ?>" method="post"
    enctype="multipart/form-data" name="form1">
    <table align="center">
    <tr valign="baseline">
    <td nowrap align="right">Membername:</td>
    <td><input type="text" name="membername" value="<?php echo
    $row_loadmember['membername']; ?>" size="32"></td>
    </tr>
    <tr valign="baseline">
    <td nowrap align="right">Memberpicture:</td>
    <td><input name="pictureupload" type="file" value="<?php echo
    $row_loadmember['memberpicture']; ?>"></td>
    </tr>
    <tr valign="baseline">
    <td nowrap align="right">Membertext:</td>
    <td><input type="text" name="membertext" value="<?php echo
    $row_loadmember['membertext']; ?>" size="32"></td>
    </tr>
    <tr valign="baseline">
    <td nowrap align="right">Memberposition:</td>
    <td><input type="text" name="memberposition" value="<?php echo
    $row_loadmember['memberposition']; ?>" size="32"></td>
    </tr>
    <tr valign="baseline">
    <td nowrap align="right">&nbsp;</td>
    <td><input type="submit" value="Update Record"></td>
    </tr>
    </table>
    <input type="hidden" name="email" value="<?php echo
    $row_loadmember['email']; ?>">
    <input type="hidden" name="membernameid" value="<?php echo
    $row_loadmember['membernameid']; ?>">
    <input type="hidden" name="MM_update" value="form1">
    <input type="hidden" name="membernameid" value="<?php echo
    $row_loadmember['membernameid']; ?>">
    </form>
    <p>&nbsp;</p>
    </div>
    <div id="siteInfo">
    <img src="" width="44" height="22"> <a href="#">About Us</a> | <a
    href="#">Site
    Map</a> | <a href="#">Privacy Policy</a> | <a href="#">Contact Us</a> |
    &copy;2003
    Company Name
    </div>
    <br>
    </body>
    </html>
    <?php
    mysql_free_result($loadmember);
    ?>

    can anybody help?

    Bethan


    bethan81 Guest

  2. Similar Questions and Discussions

    1. Dummy window
      I am currently using Adobe Indesign 1.5 on a Windows 2000 professional machine. Memory has never been an issue and do not assume that is the case...
    2. Freehand dummy please help
      Well.....i just got freehand and i can draw like a madman........but i have one stupid question....is there an eraser tool??? and if so where the...
    3. Dummy Windows
      I'm using InDesign version 1.5.2 and have noticed dummy windows popping up in the program tool bar. If I have to InDesign files open, I can't toggle...
    4. Dummy text
      Hi all, Does anyone know of an extension or some method of inserting dummy text when doing page layouts in FWMX. What I'm looking for is a command...
    5. Insert Dummy Records
      David, Thanks for the reply. Maybe I should have elaborated. The reason I need these records is so I can produce a report that when these...
  3. #2

    Default Re: HELP DUMMY

    It looks like after this line

    <?php require_once('Connections/mysql.php'); ?>

    there is a white space, remove it

    Felix1 Guest

  4. #3

    Default Re: HELP DUMMY

    i cant believe thats all it was, thank you so much!!!
    bethan81 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139