Jump to content

kevy

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kevy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, Just wanted to get your opinions on what type of shopping cart package I should use for my mysql/php site, also built with dreamweaver.. Any info would help..
  2. style="width: 100px" did the trick.. thank you!
  3. Hi, I made some drop down menus and want to make them wider.. simply inserting width="100" doesn't work.. any idea how I can make this menu longer in width? Thanks. <select wdg:subtype="DependentDropdown" name="select1" id="select1" wdg:type="widget" wdg:recordset="Recordset4" wdg:displayfield="SubName" wdg:valuefield="SubId" wdg:fkey="CatId" wdg:triggerobject="select"> </select>
  4. thank you lol can't believe i didn't see that
  5. Hi, Somethings wrong with this line of code.. any idea what? I'm directing the variable "recordID" to the "deletethree.php" page using the "ItemNum" column in the field.. <a href="deletethree.php?recordID=<?php echo $row_ recordset1 ['ItemNum']; ?>">Delete</a>
  6. Hi, Somethings wrong with this line of code.. any idea what? I'm directing the variable "recordID" to the "deletethree.php" page using the "ItemNum" column in the field.. <a href="deletethree.php?recordID=<?php echo $row_ recordset1 ['ItemNum']; ?>">Delete</a>
  7. problem solved, simply moved images to the main directory.. obviously i need to add the path myself..
  8. I apologize ahead of time for the length of this code.. Why is it that when input type = file, it doesn't upload the full path to the database field? Also, I'm using dreamweaver, which explains the length of the code and the possible confusion. <?php require_once('../Connections/antiques.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $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; } } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO itemdetails (`CatId`, `SubId`, `SubName`, `ItemNum`, `Date`, `ItemName`, `Description`, `Condition`, `Provenance`, `Authenticity`, `SellingPrice`, `Image1`, `Image2`, `Image3`) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['CatId'], "int"), GetSQLValueString($_POST['SubId'], "int"), GetSQLValueString($_POST['SubName'], "text"), GetSQLValueString($_POST['ItemNum'], "int"), GetSQLValueString($_POST['Date'], "text"), GetSQLValueString($_POST['ItemName'], "text"), GetSQLValueString($_POST['Description'], "text"), GetSQLValueString($_POST['Condition'], "text"), GetSQLValueString($_POST['Provenance'], "text"), GetSQLValueString($_POST['Authenticity'], "text"), GetSQLValueString($_POST['SellingPrice'], "int"), GetSQLValueString($_POST['Image1'], "text"), GetSQLValueString($_POST['Image2'], "text"), GetSQLValueString($_POST['Image3'], "text")); mysql_select_db($database_antiques, $antiques); $Result1 = mysql_query($insertSQL, $antiques) or die(mysql_error()); $insertGoTo = "index.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?><!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>Untitled Document</title> </head> <body> <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1"> <table align="center"> <tr valign="baseline"> <td nowrap="nowrap" align="right">CatId:</td> <td><select name="CatId"> <option value="1" <?php if (!(strcmp(1, ""))) {echo "SELECTED";} ?>>Furniture</option> <option value="2" <?php if (!(strcmp(2, ""))) {echo "SELECTED";} ?>>Housewares</option> <option value="3" <?php if (!(strcmp(3, ""))) {echo "SELECTED";} ?>>Jewelry</option> </select> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">SubId:</td> <td><select name="SubId"> <option value="1" <?php if (!(strcmp(1, ""))) {echo "SELECTED";} ?>>Tables</option> <option value="2" <?php if (!(strcmp(2, ""))) {echo "SELECTED";} ?>>Chairs</option> <option value="3" <?php if (!(strcmp(3, ""))) {echo "SELECTED";} ?>>Silverware</option> <option value="4" <?php if (!(strcmp(4, ""))) {echo "SELECTED";} ?>>Lamps</option> <option value="5" <?php if (!(strcmp(5, ""))) {echo "SELECTED";} ?>>Necklaces</option> <option value="6" <?php if (!(strcmp(6, ""))) {echo "SELECTED";} ?>>Bracelets</option> </select> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">SubName:</td> <td><select name="SubName"> <option value="Tables" <?php if (!(strcmp("Tables", ""))) {echo "SELECTED";} ?>>Tables</option> <option value="Chairs" <?php if (!(strcmp("Chairs", ""))) {echo "SELECTED";} ?>>Chairs</option> <option value="Silverware" <?php if (!(strcmp("Silverware", ""))) {echo "SELECTED";} ?>>Silverware</option> <option value="Lamps" <?php if (!(strcmp("Lamps", ""))) {echo "SELECTED";} ?>>Lamps</option> <option value="Necklaces" <?php if (!(strcmp("Necklaces", ""))) {echo "SELECTED";} ?>>Necklaces</option> <option value="Bracelets" <?php if (!(strcmp("Bracelets", ""))) {echo "SELECTED";} ?>>Bracelets</option> </select> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Date:</td> <td><input type="text" name="Date" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">ItemName:</td> <td><input type="text" name="ItemName" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right" valign="top">Description:</td> <td><textarea name="Description" cols="50" rows="5"></textarea> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right" valign="top">Condition:</td> <td><textarea name="Condition" cols="50" rows="5"></textarea> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right" valign="top">Provenance:</td> <td><textarea name="Provenance" cols="50" rows="5"></textarea> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right" valign="top">Authenticity:</td> <td><textarea name="Authenticity" cols="50" rows="5"></textarea> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">SellingPrice:</td> <td><input type="text" name="SellingPrice" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Image1:</td> <td><input type="file" name="Image1" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Image2:</td> <td><input type="file" name="Image2" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Image3:</td> <td><input type="file" name="Image3" value="" size="32" /></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td><input type="submit" value="Insert record" /></td> </tr> </table> <input type="hidden" name="ItemNum" value="" /> <input type="hidden" name="MM_insert" value="form1" /> </form> <p> </p> <p> </p> <p> </p> </body> </html>
  9. Hi, My php form, using a "file" input, seems to only store the image name in the database. I thought that by changing the file type, it would upload the full filename, however I don't know which file type to use other than "text". When I display the table data, if the intended file was localhost\antiques\images\image1.jpg all that will show is the text "image1". So hopefully when this problem of uploading the full filepath is corrected, will the images begin to show? Thanks!
  10. Got it to work. Thanks for the help everybody. This is what worked: <?php do { ?> <tr> <?PHP if ($row_Recordset1['SubId'] != $Selection) continue; ?> <td><?php echo $row_Recordset1['SubId']; ?></td> <td><?php echo $row_Recordset1['CatId']; ?></td> <td><?php echo $row_Recordset1['SubName']; ?></td> </tr> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> </table>
  11. I tried but can't get it to run error free and display results.. Feel like writing out what you suggest?
  12. I entered the code you suggested, and get the error "Parse error: syntax error, unexpected ')' in C:\xampp\htdocs\antiques\form_processor.php on line 53" This is the line <?php foreach($row = mysql_fetch_array($result)) : ?> Any idea what's wrong?
  13. What's wrong with this code? <?php for ($row_Recordset1['SubId'] = $Test); do { ?> <tr> <td><?php echo $row_Recordset1['SubId']; ?></td> <td><?php echo $row_Recordset1['CatId']; ?></td> <td><?php echo $row_Recordset1['SubName']; ?></td> </tr> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
  14. I want my table to only list the fields that have the same SubId as the one chosen in the dropdown menu by the user. Lets call this variable $Test. How can I only show the fields in this table where SubId = $Test? Maybe a foreach loop? Somebody care to help? <table border="1" cellpadding="0" cellspacing="0"> <tr> <td>SubId</td> <td>CatId</td> <td>SubName</td> </tr> <?php do { ?> <tr> <td><?php echo $row_Recordset1['SubId']; ?></td> <td><?php echo $row_Recordset1['CatId']; ?></td> <td><?php echo $row_Recordset1['SubName']; ?></td> </tr> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> </table>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.