topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday April 12, 2024, 1:48 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - kevstero [ switch to compact view ]

Pages: [1]
1
Developer's Corner / shopping cart for php/mysql
« on: July 14, 2008, 06:54 PM »
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
Developer's Corner / making drop down menu wider
« on: July 13, 2008, 12:24 PM »
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>

3
Developer's Corner / unexpected T_STRING
« on: July 12, 2008, 10:56 PM »
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>

4
Developer's Corner / images dont display when posted with form
« on: July 04, 2008, 05:56 PM »
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!

5
Developer's Corner / Use a foreach loop maybe?
« on: June 27, 2008, 10:32 PM »
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>

6
Post New Requests Here / IDEA: dynamic drop down menu
« on: June 26, 2008, 01:45 PM »
Hi. Here's my problem.

I have two tables. One is a main category table and the other is a subcategory table.

The main category table has the fields (catID and catName)

The Subcategory table has the fields (catId, SubId and SubName)

The two are related via the catId field..

I can't figure out how to dynamically load the second drop down menu from the choice made in the first drop down menu.. If anybody can point out whats wrong or develop something similar, it would be nice... Thanks.


<?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;
}
}

mysql_select_db($database_antiques, $antiques);
$query_Recordset1 = "SELECT * FROM itemmastercategory";
$Recordset1 = mysql_query($query_Recordset1, $antiques) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

mysql_select_db($database_antiques, $antiques);
$query_Recordset2 = "SELECT * FROM itemmastercategory";
$Recordset2 = mysql_query($query_Recordset2, $antiques) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...ml1-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 id="form1" name="form1" method="post" action="">
<label>
<select name="select" id="select">
<option value="">Choose Antique Category</option>
<?php
do {
?>
<option value="<?php echo $row_Recordset1['CatId']?>"><?php echo $row_Recordset1['CatName']?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
</select>
</label>
<label>
<select name="select2" id="select2">
<option value="">Choose Antique Sub Category</option>
<?php
do {
?><option value="<?php echo $row_Recordset2['SubId']?>"><?php echo $row_Recordset2['SubName']?></option>
<?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
$rows = mysql_num_rows($Recordset2);
if($rows > 0) {
mysql_data_seek($Recordset2, 0);
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
}
?>
</select>
</label>
</form>
</body>
</html>
<?php
mysql_free_result($Recordset1);

mysql_free_result($Recordset2);
?>

7
Developer's Corner / Dreamweaver, dynamic drop down menu
« on: June 24, 2008, 10:30 PM »
Hi. Here's my problem.

I have two tables. One is a main category table and the other is a subcategory table.

The main category table has the fields (catID and catName)

The Subcategory table has the fields (catId, SubId and SubName)

The two are related via the catId field..

I can't figure out how to dynamically load the second drop down menu from the choice made in the first drop down menu.. If anybody can point out whats wrong, it would be nice Thanks.




<?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;
}
}

mysql_select_db($database_antiques, $antiques);
$query_Recordset1 = "SELECT items.ItemId, items.BuyingPrice, items.SellingPrice FROM items";
$Recordset1 = mysql_query($query_Recordset1, $antiques) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...ml1-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>
<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <label></label>
  <select name="choosemenu" id="choosemenu" title="<?php echo $_POST['ChooseMenu']; ?>" onchange="MM_jumpMenu('parent',this,0)">
    <option value="">Choose Antique Type</option>
    <?php
do { 
?>
    <option value="<?php echo $row_Recordset1['ItemId']?>"><?php echo $row_Recordset1['ItemId']?></option>
    <?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
  $rows = mysql_num_rows($Recordset1);
  if($rows > 0) {
      mysql_data_seek($Recordset1, 0);
     $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  }
?>
          </select>
  <label>
  <input type="submit" name="Submit" id="Submit" value="Submit" />
</label>
</form>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

Pages: [1]