Jump to content

mikebyrne

Members
  • Posts

    780
  • Joined

  • Last visited

Everything posted by mikebyrne

  1. Im using <form action="add.php" onsubmit="return valid()" method="post"> <?PHP require_once("adminconnect.php"); $tbl_name="product"; $sql="INSERT INTO $tbl_name(ProductNo, , ProductName, Description, Price,)VALUES('$ProductNo', '$ProductName', '$Description', '$Price',)"; $result = mysql_query($query) or die (mysql_error()); ?> And Im getting "Query was empty" when the page loads
  2. My code now looks like this but it doesnt seem to post anything to the db and gives no errors <form action="add.php" onsubmit="return valid()" method="post"> <?PHP require_once("adminconnect.php"); $tbl_name="product"; $sql="INSERT INTO $tbl_name(ProductNo, , ProductName, Description, Price,)VALUES('$ProductNo', '$ProductName', '$Description', '$Price',)"; ?> <!-- 1px space start --> <div id="containerBg1"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- 1px space finish --> <!-- data top start --> <div id="containerBg3"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data top finish --> <!-- data content start --> <div id="containerBg4"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="padTop1"> <!-- data Left start --> <div class="editLeft"> <!-- picture1 start --> <div class="editLeftBox">PICTURE 1:</div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"><img src="<?php echo $row['Image'];?>" alt="pic1" width="150" height="200" /></div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"> <input type="file" name="uploadfile" class="newsUpFile"> </div> <div class="clr"> <!-- --> </div> <!-- picture1 finish --> <div class="padTop50"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- picture2 start --> <div class="editLeftBox">PICTURE 2:</div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"><img src="<?php echo $row['Image2'];?>" alt="pic1" width="150" height="200" /></div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"> <input type="file" name="uploadfile" class="newsUpFile"> </div> <div class="clr"> <!-- --> </div> <!-- picture2 finish --> </div> <!-- data Left finish --> <!-- data Right start --> <div class="editRight"> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Product No:</div> <div class="editRightForm"> <!--MAKES PRODUCT NO READ ONLY--> <input type="text" class="itemEditForm02" name="ProductNo" value="<?php echo $row['ProductNo'];?>" readonly="readonly" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Product Name:</div> <div class="editRightForm"> <input name="0" type="text" class="itemEditForm02" name="ProductName" value="<?php echo $row['ProductName'];?>" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Description:</div> <div class="editRightForm"> <textarea type="text" class="itemEditForm03" name="something" ><?php echo $row['Description'];?></textarea> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Remarks:</div> <div class="editRightForm"> <input type="text" class="itemEditForm02" name="0" value="" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Price:</div> <div class="editRightForm"> <div class="editItemPrice1">€</div> <div class="editItemPrice2"> <input type="text" class="itemEditForm04" name="0" value="<?php echo $row['Price'];?>" /> </div> <div class="clr"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Sale:</div> <div class="editRightForm"> <div class="editRadioLink1"> <input name="link" type="radio" value="yes" /> </div> <div class="editRadioLink2">Yes</div> <div class="editRadioLink3"> <input name="link" type="radio" value="no" checked="checked" /> </div> <div class="editRadioLink4">No - sale price: € </div> <div class="editRadioLink5"> <input type="text" class="newsEditForm02" name="0" value="0" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Display:</div> <div class="editRightForm"> <div class="editRadio1"> <input name="display" type="radio" value="yes" checked="checked" /> </div> <div class="editRadio2">show</div> <div class="editRadio3"> <input name="display" type="radio" value="no" /> </div> <div class="editRadio4">hide</div> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop75"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <!-- data Right finish --> </div> <div class="clr"> <!-- --> </div> <div class="padTop11"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="dottedIn"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <!-- btn start --> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="btn"> <input id="btnL" type="submit" name="Submit" value="" /> <div id="btnSpace"> <!-- --> </div> <div id="btnR"><img src="../Admin_files/btn_clear.gif" width="73" height="23" /></div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- btn finish --> </div> <div class="clr"> <!-- --> </div> <!-- data content finish --> <!-- data btm start --> <div id="containerBg3"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data btm finish --> </form>
  3. My code looks like this: <?php include('adminconnect.php'); $query = "SELECT ProductName FROM Product; $result = mysql_query($query) or die (mysql_error()); ?> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="55">product</td> <td width="762"> <select name="month"> <option value="">------</option> <?PHP $i=1; while ($row = mysql_fetch_array($query)) { echo "<option value=\"$i\" >".$row['ProductName']."</option>"; $i++; } ?> </select> </td> </tr> </table> But still getting the same error
  4. At present my dropdownlist isnt filling up with the values from my database field I'm just getting the following output on screen include('adminconnect.php'); $query = "SELECT ProductName FROM Product; $result = mysql_query($query) or die (mysql_error()); My code is: <form> <!-- logo start --> <div id="container"> <div class="padTop28"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- logo finish --> <!-- menu start --> <div id="container"> <div id="menu1"> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/start.php" class="black">Order</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_on"><!-- --></div> <div id="menu_text_on"><a href="../admin_files/sales.php" class="black_on">Sales</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/list.php" class="black">Edit item</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/sales.php" class="black">Postage fee</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/adminreg.php" class="black">Add User</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/add.php" class="black">Add Product</a></div> <div id="menu_space1"><!-- --></div> </div> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div id="dotted"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div id="menu2"> <div id="menu_hide"><!-- --></div> <div id="menu_text_off" class="textWhite">order</div> <div id="menu_space1"><!-- --></div> <div id="menu_hide"><!-- --></div> <div id="menu_text_off"><a href="sales.php" class="black">Sales</a></div> <div id="menu_space2"><!-- --></div> <div id="menu_text_on"><a href="sales_search.php" class="black_on">Sales search</a></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <div class="padTop38"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- menu finish --> <!-- top start --> <div id="container"> <div id="line"><!-- --></div> </div> <div class="clr"><!-- --></div> <div id="containerBg1"> <div class="padTop15"><!-- --></div> <div class="clr"><!-- --></div> <div id="titleText">sales search</div> <div class="clr"><!-- --></div> <div class="padTop15"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- top finish --> <!-- 1px space start --> <div id="containerBg1"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- 1px space finish --> <!-- data top start --> <div id="containerBg3"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- data top finish --> <!-- data content start --> <div id="containerBg4"> <!-- data start --> <div class="padTop11"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop1"> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="55">month</td> <td width="762"> <select name="month" class="000"> <option value="">------</option> <option value="2006-06" >2006-06</option> <option value="2006-05" >2006-05</option> <option value="2006-04" >2006-04</option> <option value="2006-03" >2006-03</option> <option value="2006-02" >2006-02</option> <option value="2006-01" >2006-01</option> <option value="2005-12" >2005-12</option> </select> </td> </tr> </table> </div> <div class="clr"><!-- --></div> <div class="padTop11"><!-- --></div> <div class="clr"><!-- --></div> <!-- data finish --> <!-- data start --> <div class="padTop1"> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="55">year</td> <td width="762"> <select name="year" class=""> <option value="">------</option> <option value="2006" >2006</option> <option value="2005" >2005</option> </select> </td> </tr> </table> </div> <!-- data finish --> <!-- line start --> <div class="clr"><!-- --></div> <div class="padTop11"><!-- --></div> <div class="clr"><!-- --></div> <div id="dottedIn"><!-- --></div> <div class="clr"><!-- --></div> <div id="sales_text_and">and / or</div> <div id="dottedIn"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop11"><!-- --></div> <div class="clr"><!-- --></div> <!-- line finish --> <!-- data start --> <div class="padTop1"> include('adminconnect.php'); $query = "SELECT ProductName FROM Product; $result = mysql_query($query) or die (mysql_error()); <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="55">product</td> <td width="762"> <select name="month"> <option value="">------</option> <?PHP $i=1; while ($row = mysql_fetch_array($query)) { echo "<option value=\"$i\" >".$row['ProductName']."</option>"; $i++; } ?> </select> </td> </tr> </table> </div> <div class="clr"><!-- --></div> <div class="padTop11"><!-- --></div> <div class="clr"><!-- --></div> <div id="dottedIn"><!-- --></div> <div class="clr"><!-- --></div> <!-- data finish --> <!-- btn start --> <div class="padTop16"><!-- --></div> <div class="clr"><!-- --></div> <div id="btn"><a href="sales_search_result.php"><img src="../images/btn_search.gif" alt="search" width="73" height="23" border="0" /></a></div> <div class="clr"><!-- --></div> <div class="padTop16"><!-- --></div> <div class="clr"><!-- --></div> <!-- btn finish --> </div> <div class="clr"><!-- --></div> <!-- data content finish --> <!-- data btm start --> <div id="containerBg3"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- data btm finish --> <!-- btm start --> <div id="containerBg1"> <div class="padTop15"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <div id="container"> <div id="line"><!-- --></div> </div> <div class="clr"><!-- --></div> <div class="padTop16"><!-- --></div> <div class="clr"><!-- --></div> <!-- btm finish --> </form>
  5. I'm trying to retrive data from my database and fill the table but all I mange to get is "The users could not be retrieved" and ive no idea where im going wrong my code is <?php # Script - StudentEnrolled.php // This will retrieve all the records from the Student table $page_title = 'View the Current Users'; // Page header echo '<h1 id="mainhead">Registered Users </h1>'; require_once ('mysql_connect.php'); //Connect to database //Make a query $query = "SELECT (Surname, ', ', Name) AS name, DATE FORMAT(Date_Registered, '%M %d, %Y') AS date FROM student_entry_details ORDER BY Date_Registered ASC"; $result = mysql_query ($query); // Run query if ($result) { // If it ran OK , display the records. // Create table echo '<table align="center" cellspacing="0" cellspacing="5"> <tr><td align="left"><b>Name</b></td> <td align="left"><b>Date_Registered</b> <td align="right"><b>CV Info</b> </td></tr>'; //Fetch and print all records. while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { echo '<tr><td align="left">' . $row['name'] . '</td><td align="left">' . $row['date'] . '</td></tr>'; } echo '</table>'; mysql_free_result ($result); //Free up the resources. } else { // If it did not run OK. echo '<p class="error">The users could not be retrieved.</p>'; } mysql_close(); //Close the database connection ?>
  6. I just get include('adminconnect.php'); $query = "SELECT ProductName FROM Product; $result = mysql_query($query) or die (mysql_error()); as output on the page My code is <!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=iso-8859-1" /> <title>Admin Page | sales</title> <link href="../Admin_files/admin.css" rel="stylesheet" type="text/css" /> <script type="text/JavaScript" src="../includes/wrapper.js"></script> </head> <body> <div id="Box"> <div id="logoBox"><a href="http://www.btrax.com/" target="_blank"><img src="../images/logo.gif" width="51" height="125" border="0" /></a></div> <div id="contentBox"> <form> <!-- logo start --> <div id="container"> <div class="padTop28"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- logo finish --> <!-- menu start --> <div id="container"> <div id="menu1"> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/start.php" class="black">Order</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_on"><!-- --></div> <div id="menu_text_on"><a href="../admin_files/sales.php" class="black_on">Sales</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/list.php" class="black">Edit item</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/sales.php" class="black">Postage fee</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/adminreg.php" class="black">Add User</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/add.php" class="black">Add Product</a></div> <div id="menu_space1"><!-- --></div> </div> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div id="dotted"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div id="menu2"> <div id="menu_hide"><!-- --></div> <div id="menu_text_off" class="textWhite">order</div> <div id="menu_space1"><!-- --></div> <div id="menu_hide"><!-- --></div> <div id="menu_text_off"><a href="sales.php" class="black">Sales</a></div> <div id="menu_space2"><!-- --></div> <div id="menu_text_on"><a href="sales_search.php" class="black_on">Sales search</a></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <div class="padTop38"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- menu finish --> <!-- top start --> <div id="container"> <div id="line"><!-- --></div> </div> <div class="clr"><!-- --></div> <div id="containerBg1"> <div class="padTop15"><!-- --></div> <div class="clr"><!-- --></div> <div id="titleText">sales search</div> <div class="clr"><!-- --></div> <div class="padTop15"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- top finish --> <!-- 1px space start --> <div id="containerBg1"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- 1px space finish --> <!-- data top start --> <div id="containerBg3"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- data top finish --> <!-- data content start --> <div id="containerBg4"> <!-- data start --> <div class="padTop11"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop1"> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="55">month</td> <td width="762"> <select name="month" class="000"> <option value="">------</option> <option value="2006-06" >2006-06</option> <option value="2006-05" >2006-05</option> <option value="2006-04" >2006-04</option> <option value="2006-03" >2006-03</option> <option value="2006-02" >2006-02</option> <option value="2006-01" >2006-01</option> <option value="2005-12" >2005-12</option> </select> </td> </tr> </table> </div> <div class="clr"><!-- --></div> <div class="padTop11"><!-- --></div> <div class="clr"><!-- --></div> <!-- data finish --> <!-- data start --> <div class="padTop1"> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="55">year</td> <td width="762"> <select name="year" class=""> <option value="">------</option> <option value="2006" >2006</option> <option value="2005" >2005</option> </select> </td> </tr> </table> </div> <!-- data finish --> <!-- line start --> <div class="clr"><!-- --></div> <div class="padTop11"><!-- --></div> <div class="clr"><!-- --></div> <div id="dottedIn"><!-- --></div> <div class="clr"><!-- --></div> <div id="sales_text_and">and / or</div> <div id="dottedIn"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop11"><!-- --></div> <div class="clr"><!-- --></div> <!-- line finish --> <!-- data start --> <div class="padTop1"> include('adminconnect.php'); $query = "SELECT ProductName FROM Product; $result = mysql_query($query) or die (mysql_error()); <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="55">product</td> <td width="762"> <select name="month"> <option value="">------</option> <?PHP $i=1; while ($row = mysql_fetch_array($query)) { echo "<option value=\"$i\" >".$row['ProductName']."</option>"; $i++; } ?> </select> </td> </tr> </table> </div> <div class="clr"><!-- --></div> <div class="padTop11"><!-- --></div> <div class="clr"><!-- --></div> <div id="dottedIn"><!-- --></div> <div class="clr"><!-- --></div> <!-- data finish --> <!-- btn start --> <div class="padTop16"><!-- --></div> <div class="clr"><!-- --></div> <div id="btn"><a href="sales_search_result.php"><img src="../images/btn_search.gif" alt="search" width="73" height="23" border="0" /></a></div> <div class="clr"><!-- --></div> <div class="padTop16"><!-- --></div> <div class="clr"><!-- --></div> <!-- btn finish --> </div> <div class="clr"><!-- --></div> <!-- data content finish --> <!-- data btm start --> <div id="containerBg3"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- data btm finish --> <!-- btm start --> <div id="containerBg1"> <div class="padTop15"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <div id="container"> <div id="line"><!-- --></div> </div> <div class="clr"><!-- --></div> <div class="padTop16"><!-- --></div> <div class="clr"><!-- --></div> <!-- btm finish --> </form> </div> </div> </body> </html>
  7. Is there a way to have the submit button using <div id="btnL"><img src="../Admin_files/btn_update.gif" width="73" height="23" /></div>??
  8. Im trying to code it around the button <!-- --> </div> <div id="btn"> <div id="btnL"><img src="../Admin_files/btn_update.gif" width="73" height="23" /></div> <div id="btnSpace"> <!-- --> So not sure how to put everything together ie set the form etc
  9. I'll need to connect to the DB from this page too so I'll have to include something like? include('adminconnect.php'); $query = "SELECT ProductName FROM Product; $result = mysql_query($query) or die (mysql_error());
  10. Im trying to autofill at dropdown list with the contents from the field "ProductName" from the products table At present I've manually filled in the options <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="55">product</td> <td width="762"> <select name="month"> <option value="">------</option> <option value="1" >100% btrax - Bollene Saffron</option> <option value="2" >100% btrax - Cassis Plum</option> <option value="3" >btrax cotton blend - Rustique Almond Green</option> <option value="4" >btrax cotton blendr - Border Grill, Earth Green</option> <option value="5" >btrax Black Toast & Marmalade - Black Toast & Marmalade Rectangular Baking Dish</option> <option value="6" >btrax body care - Buckwheat Buffing Soap For Feet</option> </select> </td> </tr> </table>
  11. Im just not sure how to code it around the button I know I should use the following require_once("adminconnect.php"); $tbl_name="product"; $sql="INSERT INTO $tbl_name(ProductNo, , ProductName, Description, Price,)VALUES('$ProductNo', '$ProductName', '$Description', '$Price',)";
  12. I've just created a new page to allow users to input data, press update and the details will go into the database I need help with the php to process this The code I have now is: <form> <!-- top start --> <div id="container"> <div id="line"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div id="containerBg1"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="titleText">EDIT ITEM</div> <div class="clr"> <!-- --> </div> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- top finish --> <!-- data title start --> <div id="containerBg2"> <div class="padTop2"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="titleBox"> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="290" align="left">IMAGE</td> <td width="527">DETAIL</td> </tr> </table> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data title finish --> <!-- 1px space start --> <div id="containerBg1"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- 1px space finish --> <!-- data top start --> <div id="containerBg3"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data top finish --> <!-- data content start --> <div id="containerBg4"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="padTop1"> <!-- data Left start --> <div class="editLeft"> <!-- picture1 start --> <div class="editLeftBox">PICTURE 1:</div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"><img src="<?php echo $row['Image'];?>" alt="pic1" width="150" height="200" /></div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"> <input type="file" name="uploadfile" class="newsUpFile"> </div> <div class="clr"> <!-- --> </div> <!-- picture1 finish --> <div class="padTop50"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- picture2 start --> <div class="editLeftBox">PICTURE 2:</div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"><img src="<?php echo $row['Image2'];?>" alt="pic1" width="150" height="200" /></div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"> <input type="file" name="uploadfile" class="newsUpFile"> </div> <div class="clr"> <!-- --> </div> <!-- picture2 finish --> </div> <!-- data Left finish --> <!-- data Right start --> <div class="editRight"> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Product No:</div> <div class="editRightForm"> <!--MAKES PRODUCT NO READ ONLY--> <input type="text" class="itemEditForm02" name="ProductNo" value="<?php echo $row['ProductNo'];?>" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Product Name:</div> <div class="editRightForm"> <input name="0" type="text" class="itemEditForm02" name="ProductName" value="<?php echo $row['ProductName'];?>" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Description:</div> <div class="editRightForm"> <textarea type="text" class="itemEditForm03" name="something" ><?php echo $row['Description'];?></textarea> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Remarks:</div> <div class="editRightForm"> <input type="text" class="itemEditForm02" name="0" value="" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Price:</div> <div class="editRightForm"> <div class="editItemPrice1">€</div> <div class="editItemPrice2"> <input type="text" class="itemEditForm04" name="0" value="<?php echo $row['Price'];?>" /> </div> <div class="clr"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Sale:</div> <div class="editRightForm"> <div class="editRadioLink1"> <input name="link" type="radio" value="yes" /> </div> <div class="editRadioLink2">Yes</div> <div class="editRadioLink3"> <input name="link" type="radio" value="no" checked="checked" /> </div> <div class="editRadioLink4">No - sale price: € </div> <div class="editRadioLink5"> <input type="text" class="newsEditForm02" name="0" value="0" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Display:</div> <div class="editRightForm"> <div class="editRadio1"> <input name="display" type="radio" value="yes" checked="checked" /> </div> <div class="editRadio2">show</div> <div class="editRadio3"> <input name="display" type="radio" value="no" /> </div> <div class="editRadio4">hide</div> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop75"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <!-- data Right finish --> </div> <div class="clr"> <!-- --> </div> <div class="padTop11"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="dottedIn"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <!-- btn start --> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="btn"> <div id="btnL"><img src="../Admin_files/btn_update.gif" width="73" height="23" /></div> <div id="btnSpace"> <!-- --> </div> <div id="btnR"><img src="../Admin_files/btn_clear.gif" width="73" height="23" /></div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- btn finish --> </div> <div class="clr"> <!-- --> </div> <!-- data content finish --> <!-- data btm start --> <div id="containerBg3"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data btm finish --> </form> </div> <!-- btm start --> <div id="containerBg1"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div id="container"> <div id="line"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- btm finish --> </div> </body> </html>
  13. Ah thanks, I wasnt aware there was readonly. Thanks
  14. Thats fixed it. Cheers!! Although its knocked a line out either side of my container and i cant get it back
  15. It seems like the headings need to be moved to the right
  16. I now have the following code <form> <!-- data title start --> <div id="containerBg2"> <div class="padTop2"><!-- --></div> <div class="clr"><!-- --></div> <div class="titleBox"> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="87"><a href="#">Date</a></td> <td width="43" align="left"><a href="#">Orders</a></td> <td width="118" align="left"><a href="#">Revenue</a></td </tr> </div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- data title finish --> <!-- 1px space start --> <div id="containerBg1"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- 1px space finish --> <!-- data top start --> <div id="containerBg3"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- data top finish --> <!-- data content start --> <div id="containerBg4"> <?php include('adminconnect.php'); $sql = mysql_query("SELECT * FROM sales "); while( $row = mysql_fetch_array($sql) ) { ?> <tr align="left"> <td width="87" align="Center"><?php echo $row['Date'];?></td> <td width="43" align="Center"><?php echo $row['Total Orders'];?></td> <td width="118" align="Center"><?php echo $row['Revenue'];?></td> </tr> <?php } ?> </table> <!-- data btm start --> <div id="containerBg3"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- data btm finish --> <!-- btm start --> <div id="containerBg1"> <div class="padTop15"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <div id="container"> <div id="line"><!-- --></div> </div> <!-- btm finish --> </form> The allignment is getting a little better
  17. No that still doesnt allign the figures under the headings but it does seperate them better
  18. My php output isnt alligned with my tables headings and its driving me mental!!! I've tried everything my code is <form> <!-- data title start --> <div id="containerBg2"> <div class="padTop2"><!-- --></div> <div class="clr"><!-- --></div> <div class="titleBox"> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="87"><a href="#">Date</a></td> <td width="43" align="right"><a href="#">Orders</a></td> <td width="118" align="right"><a href="#">Revenue</a></td> <td width="569"> </td> </tr> </table> </div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- data title finish --> <!-- 1px space start --> <div id="containerBg1"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- 1px space finish --> <!-- data top start --> <div id="containerBg3"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- data top finish --> <!-- data content start --> <div id="containerBg4"> <?php include('adminconnect.php'); $sql = mysql_query("SELECT * FROM sales "); while( $row = mysql_fetch_array($sql) ) { ?> <tr align="left"> <td width="87" align="Left"><?php echo $row['Date'];?></td> <td width="43" align="Left"><?php echo $row['Total Orders'];?></td> <td width="118" align="Left"><?php echo $row['Revenue'];?></td> </tr> <?php } ?> </table> [code] I can mail printscreens if it helps as i can attach here anymore [/code]
  19. I fixed my code using this: <form action="edit.php" onsubmit="return valid()" method="post"> ... <script type="text/javascript"> /*<![CDATA[*/ function valid(){ var rad=document.getElementsByName('something'), i=0, r; while(r=rad[i++]){ if(r.checked){return true} } alert('Please select a radio button option');return false } /*]]>*/ </script>
  20. Sorry im fairly new to php and Im not too sure what the code you provided does and how to apply it to my previous code
  21. I wish to insert modified details from my edit.php page back into my database when the user presses the update button I need the following records to go back into the db ProductName Description Price I presume the sql I need is Insert (the above) INTO Product (Not sure how to phrase it) My complete code is <!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=iso-8859-1" /> <title>e-commerce admin page sample |item</title> <link href="../Admin_files/admin.css" rel="stylesheet" type="text/css" /> <script type="text/JavaScript" src="../Admin_files/wrapper.js"></script> </head> <body> <div id="Box"> <div id="logoBox"><a href="http://www.btrax.com/" target="_blank"><img src="../Admin_files/logo.gif" width="51" height="125" border="0" /></a></div> <div id="contentBox"> <form> <!-- logo start --> <div id="container"> <div class="padTop28"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- logo finish --> <!-- menu start --> <div id="container"> <div id="menu1"> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/start.php" class="black">Order</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/sales.php" class="black">Sales</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_on"><!-- --></div> <div id="menu_text_on"><a href="../admin_files/list.php" class="black_on">Edit item</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../shipping/current.php" class="black">Postage fee</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../shipping/adminreg.php" class="black">Add User</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../shipping/current.php" class="black">Add Product</a></div> <div id="menu_space1"><!-- --></div> </div> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div id="dotted"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div id="menu2"> <div id="menu_hide"><!-- --></div> <div id="menu_text_off"> </div> <div id="menu_space1"><!-- --></div> <div class="clr"><!-- --></div> <!-- --> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- Double Space undernath CD --> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <!-- menu finish --> <!-- top start --> <div id="container"> <div id="line"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div id="containerBg1"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="titleText">EDIT ITEM</div> <div class="clr"> <!-- --> </div> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- top finish --> <!-- data title start --> <div id="containerBg2"> <div class="padTop2"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="titleBox"> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="290" align="left">IMAGE</td> <td width="527">DETAIL</td> </tr> </table> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data title finish --> <!-- 1px space start --> <div id="containerBg1"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- 1px space finish --> <!-- data top start --> <div id="containerBg3"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data top finish --> <!-- data content start --> <?php // let's get some data $name = $_POST["something"]; include('adminconnect.php'); $query = "SELECT * FROM Product WHERE ProductNo='$name' "; $result = mysql_query($query) or die (mysql_error()); while ($row = mysql_fetch_array($result)){ // loop through and display ?> <div id="containerBg4"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="padTop1"> <!-- data Left start --> <div class="editLeft"> <!-- picture1 start --> <div class="editLeftBox">PICTURE 1:</div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"><img src="<?php echo $row['Image'];?>" alt="pic1" width="150" height="200" /></div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"> <input type="file" name="uploadfile" class="newsUpFile"> </div> <div class="clr"> <!-- --> </div> <!-- picture1 finish --> <div class="padTop50"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- picture2 start --> <div class="editLeftBox">PICTURE 2:</div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"><img src="<?php echo $row['Image2'];?>" alt="pic1" width="150" height="200" /></div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"> <input type="file" name="uploadfile" class="newsUpFile"> </div> <div class="clr"> <!-- --> </div> <!-- picture2 finish --> </div> <!-- data Left finish --> <!-- data Right start --> <div class="editRight"> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Product No:</div> <div class="editRightForm"> <input type="text" class="itemEditForm02" name="ProductNo" value="<?php echo $row['ProductNo'];?>" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Product Name:</div> <div class="editRightForm"> <input name="0" type="text" class="itemEditForm02" name="something" value="<?php echo $row['ProductName'];?>" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Description:</div> <div class="editRightForm"> <textarea type="text" class="itemEditForm03" name="something" ><?php echo $row['Description'];?></textarea> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Remarks:</div> <div class="editRightForm"> <input type="text" class="itemEditForm02" name="0" value="" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Price:</div> <div class="editRightForm"> <div class="editItemPrice1">€</div> <div class="editItemPrice2"> <input type="text" class="itemEditForm04" name="0" value="<?php echo $row['Price'];?>" /> </div> <div class="clr"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Sale:</div> <div class="editRightForm"> <div class="editRadioLink1"> <input name="link" type="radio" value="yes" /> </div> <div class="editRadioLink2">Yes</div> <div class="editRadioLink3"> <input name="link" type="radio" value="no" checked="checked" /> </div> <div class="editRadioLink4">No - sale price: € </div> <div class="editRadioLink5"> <input type="text" class="newsEditForm02" name="0" value="0" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Display:</div> <div class="editRightForm"> <div class="editRadio1"> <input name="display" type="radio" value="yes" checked="checked" /> </div> <div class="editRadio2">show</div> <div class="editRadio3"> <input name="display" type="radio" value="no" /> </div> <div class="editRadio4">hide</div> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop75"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <!-- data Right finish --> </div> <div class="clr"> <!-- --> </div> <div class="padTop11"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="dottedIn"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <!-- btn start --> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="btn"> <div id="btnL"><img src="../Admin_files/btn_update.gif" width="73" height="23" /></div> <div id="btnSpace"> <!-- --> </div> <div id="btnR"><img src="../Admin_files/btn_clear.gif" width="73" height="23" /></div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- btn finish --> </div> <div class="clr"> <!-- --> </div> <?php } ?> <!-- data content finish --> <!-- data btm start --> <div id="containerBg3"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data btm finish --> </form> </div> <!-- btm start --> <div id="containerBg1"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div id="container"> <div id="line"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- btm finish --> </div> </body> </html>
  22. Is it possible to use Javascript to prevent a textbox being edited on my edit.php page? <div class="editRightForm"> <input type="text" class="itemEditForm02" name="ProductNo" value="<?php echo $row['ProductNo'];?>" /> </div> The complete code for my page is: <!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=iso-8859-1" /> <title>e-commerce admin page sample |item</title> <link href="../Admin_files/admin.css" rel="stylesheet" type="text/css" /> <script type="text/JavaScript" src="../Admin_files/wrapper.js"></script> </head> <body> <div id="Box"> <div id="logoBox"><a href="http://www.btrax.com/" target="_blank"><img src="../Admin_files/logo.gif" width="51" height="125" border="0" /></a></div> <div id="contentBox"> <form> <!-- logo start --> <div id="container"> <div class="padTop28"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- logo finish --> <!-- menu start --> <div id="container"> <div id="menu1"> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/start.php" class="black">Order</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/sales.php" class="black">Sales</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_on"><!-- --></div> <div id="menu_text_on"><a href="../admin_files/list.php" class="black_on">Edit item</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../shipping/current.php" class="black">Postage fee</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../shipping/adminreg.php" class="black">Add User</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../shipping/current.php" class="black">Add Product</a></div> <div id="menu_space1"><!-- --></div> </div> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div id="dotted"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div id="menu2"> <div id="menu_hide"><!-- --></div> <div id="menu_text_off"> </div> <div id="menu_space1"><!-- --></div> <div class="clr"><!-- --></div> <!-- --> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- Double Space undernath CD --> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <!-- menu finish --> <!-- top start --> <div id="container"> <div id="line"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div id="containerBg1"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="titleText">EDIT ITEM</div> <div class="clr"> <!-- --> </div> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- top finish --> <!-- data title start --> <div id="containerBg2"> <div class="padTop2"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="titleBox"> <table width="850" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td width="33"> </td> <td width="290" align="left">IMAGE</td> <td width="527">DETAIL</td> </tr> </table> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data title finish --> <!-- 1px space start --> <div id="containerBg1"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- 1px space finish --> <!-- data top start --> <div id="containerBg3"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data top finish --> <!-- data content start --> <?php // let's get some data $name = $_POST["something"]; include('adminconnect.php'); $query = "SELECT * FROM Product WHERE ProductNo='$name' "; $result = mysql_query($query) or die (mysql_error()); while ($row = mysql_fetch_array($result)){ // loop through and display ?> <div id="containerBg4"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="padTop1"> <!-- data Left start --> <div class="editLeft"> <!-- picture1 start --> <div class="editLeftBox">PICTURE 1:</div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"><img src="<?php echo $row['Image'];?>" alt="pic1" width="150" height="200" /></div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"> <input type="file" name="uploadfile" class="newsUpFile"> </div> <div class="clr"> <!-- --> </div> <!-- picture1 finish --> <div class="padTop50"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- picture2 start --> <div class="editLeftBox">PICTURE 2:</div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"><img src="<?php echo $row['Image2'];?>" alt="pic1" width="150" height="200" /></div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="editLeftBox"> <input type="file" name="uploadfile" class="newsUpFile"> </div> <div class="clr"> <!-- --> </div> <!-- picture2 finish --> </div> <!-- data Left finish --> <!-- data Right start --> <div class="editRight"> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Product No:</div> <div class="editRightForm"> <input type="text" class="itemEditForm02" name="ProductNo" value="<?php echo $row['ProductNo'];?>" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Product Name:</div> <div class="editRightForm"> <input name="0" type="text" class="itemEditForm02" name="something" value="<?php echo $row['ProductName'];?>" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Description:</div> <div class="editRightForm"> <textarea type="text" class="itemEditForm03" name="something" ><?php echo $row['Description'];?></textarea> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Remarks:</div> <div class="editRightForm"> <input type="text" class="itemEditForm02" name="0" value="" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Price:</div> <div class="editRightForm"> <div class="editItemPrice1">€</div> <div class="editItemPrice2"> <input type="text" class="itemEditForm04" name="0" value="<?php echo $row['Price'];?>" /> </div> <div class="clr"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Sale:</div> <div class="editRightForm"> <div class="editRadioLink1"> <input name="link" type="radio" value="yes" /> </div> <div class="editRadioLink2">Yes</div> <div class="editRadioLink3"> <input name="link" type="radio" value="no" checked="checked" /> </div> <div class="editRadioLink4">No - sale price: € </div> <div class="editRadioLink5"> <input type="text" class="newsEditForm02" name="0" value="0" /> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop3"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- dat start --> <div class="editRightBox"> <div class="editRightText">Display:</div> <div class="editRightForm"> <div class="editRadio1"> <input name="display" type="radio" value="yes" checked="checked" /> </div> <div class="editRadio2">show</div> <div class="editRadio3"> <input name="display" type="radio" value="no" /> </div> <div class="editRadio4">hide</div> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <div class="padTop75"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <!-- data Right finish --> </div> <div class="clr"> <!-- --> </div> <div class="padTop11"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="dottedIn"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- data finish --> <!-- btn start --> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="btn"> <div id="btnL"><img src="../Admin_files/btn_update.gif" width="73" height="23" /></div> <div id="btnSpace"> <!-- --> </div> <div id="btnR"><img src="../Admin_files/btn_clear.gif" width="73" height="23" /></div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- btn finish --> </div> <div class="clr"> <!-- --> </div> <?php } ?> <!-- data content finish --> <!-- data btm start --> <div id="containerBg3"> <div class="padTop1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- data btm finish --> </form> </div> <!-- btm start --> <div id="containerBg1"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div id="container"> <div id="line"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- btm finish --> </div> </body> </html>
  23. <!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=iso-8859-1" /> <title>e-commerce admin page sample | item</title> <link href="../Admin_files/admin.css" rel="stylesheet" type="text/css" /> <script type="text/JavaScript" src="../Admin_files/wrapper.js"></script> </head> <body> <div id="Box"> <div id="logoBox"><a href="http://www.btrax.com/" target="_blank"><img src="../Admin_files/logo.gif" width="51" height="125" border="0" /></a></div> <div id="contentBox"> <!-- logo start --> <div id="container"> <div class="padTop28"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- logo finish --> <!-- menu start --> <div id="container"> <div id="menu1"> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/start.php" class="black">Order</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/sales.php" class="black">Sales</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_on"><!-- --></div> <div id="menu_text_on"><a href="../admin_files/list.php" class="black_on">Edit item</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../shipping/current.php" class="black">Postage fee</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../shipping/adminreg.php" class="black">Add User</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../shipping/current.php" class="black">Add Product</a></div> <div id="menu_space1"><!-- --></div> </div> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div id="dotted"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div id="menu2"> <div id="menu_hide"><!-- --></div> <div id="menu_text_off"> </div> <div id="menu_space1"><!-- --></div> <div class="clr"><!-- --></div> <!-- --> </div> <div id="menu_space1"><!-- --></div> <div id="menu_on"><!-- --></div> <div id="menu_text_on"><a href="../admin_files/list.php" class="black_on">Games</a></div> <div id="menu_space2"> <!-- --> </div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/dvdlist.php" class="black">DVD</a></div> <div id="menu_space2"> <!-- --> </div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/cdlist.php" class="black">CD</a></div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> <!-- Double Space undernath CD --> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="clr"><!-- --></div> <div class="padTop5"><!-- --></div> <div class="clr"><!-- --></div> <!-- menu finish --> <!-- top start --> <div id="container"> <div id="line"><!-- --></div> </div> <div class="clr"><!-- --></div> <div id="containerBg1"> <div class="padTop15"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- top finish --> <!-- 1px space start --> <div id="containerBg1"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- 1px space finish --> <!-- data top start --> <div id="containerBg3"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- data top finish --> <!-- data content start --> <div id="containerBg4"> <!-- data start --> <form action="" onsubmit="return valid(this)"> <table width="800" align="center" border="0" cellspacing="0" cellpadding="0"> <tr align="left"> <td><a href="#">SELECT</a></td> <td><a href="#">PRODCT NO</a></td> <td><a href="#">PRODUCT NAME</a></td> <td><a href="#">STOCK LEVEL</a></td> <td><a href="#">DISPLAY</a></td> <td><a href="#">PRICE</a></td> </tr> <script type="text/javascript"> function valid(f){ var rad=f['something'], i=0, r; while(r=rad[i++]){ if(r.checked){return true} } alert('Please select a radio button option');return false } </script> <?php // let's get some data include('adminconnect.php'); $query = "SELECT ProductNo,ProductName,Stockamount,Display,Price FROM Product WHERE Producttype = 'Game' "; $result = mysql_query($query) or die (mysql_error()); while ($row = mysql_fetch_array($result)){ // loop through and display ?> <tr align="left"> <td><input type="radio" value="<?php echo $row['ProductNo']; ?>" name="something" /></td> <td><a class="black"><?php echo $row['ProductNo'];?></a></td> <td><?php echo $row['ProductName'];?></td> <td><?php echo $row['Stockamount'];?></td> <td><?php echo $row['Display'] ;?></td> <td><?php echo $row['Price'];?></td> </tr> <tr><td colspan="6"><hr /></td><td></tr> <?php } ?> <tr><td><input type="submit" name="submit" value="Edit" /></td></tr> </table> </div> <div class="clr"><!-- --></div> <!-- data content finish --> <!-- data btm start --> <div id="containerBg3"> <div class="padTop1"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <!-- data btm finish --> <!-- btm start --> <div id="containerBg1"> <div class="padTop15"><!-- --></div> <div class="clr"><!-- --></div> </div> <div class="clr"><!-- --></div> <div id="container"> <div id="line"><!-- --></div> </div> <div class="clr"><!-- --></div> <div class="padTop16"><!-- --></div> <div class="clr"><!-- --></div> <!-- btm finish --> </div> </div> </body> </html> This vlidates if the user doesnt click a radio button but if the user does select an option it doesnt post to edit.php
  24. Where should I call it in my code? Im trying to modify the following code into mine <script type="text/javascript"> function valid(f){ var rad=f['something'], i=0, r; while(r=rad[i++]){ if(r.checked){return true} } alert('Please select a radio button option');return false } </script> </head> <body> <form action="" onsubmit="return valid(this)"> <input type="radio" name="something" value="2"> <input type="radio" name="something" value="5"> <input type="radio" name="something" value="3"> <input type="submit" value="Submit"> </form> </body> </html>
  25. Because im a Javascript NOOB and not too sure what im doing!! Whats the best way to handle it?
×
×
  • 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.