Jump to content

searls03

Members
  • Posts

    907
  • Joined

  • Last visited

Everything posted by searls03

  1. here is what it looks like: <!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> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".delete").validate({ debug: false, submitHandler: function(form) { // do other stuff for a valid form $.post('delete.php', $(".delete").serialize(), function(data) { $("#price").load("index.php #price"); }); } }); }); </script> <script type="text/javascript"> $(document).ready(function(){ $(".myform1").validate({ debug: false, submitHandler: function(form) { // do other stuff for a valid form $.post('process.php', $(".myform1").serialize(), function(data) { $("#price").load("index.php #price"); }); } }); }); </script> <script type="text/javascript"> $(document).ready(function(){ $(".myform2").validate({ debug: false, submitHandler: function(form) { // do other stuff for a valid form $.post('process.php', $(".myform2").serialize(), function(data) { $("#price").load("index.php #price"); }); } }); }); </script> <style type="text/css"> <!-- body { font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif; background: #42413C; margin: 0; padding: 0; color: #000; } /* ~~ Element/tag selectors ~~ */ ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */ padding: 0; margin: 0; } h1, h2, h3, h4, h5, h6, p { margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */ padding-right: 15px; padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */ } a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */ border: none; } /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */ a:link { color: #42413C; text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */ } a:visited { color: #6E6C64; text-decoration: underline; } a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */ text-decoration: none; } /* ~~ this fixed width container surrounds the other divs ~~ */ .container { width: 960px; background: #FFF; margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout */ } /* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */ .header { background: #ADB96E; } /* ~~ This is the layout information. ~~ 1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design. */ .content { padding: 10px 0; } /* ~~ The footer ~~ */ .footer { padding: 10px 0; background: #CCC49F; } /* ~~ miscellaneous float/clear classes ~~ */ .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */ float: right; margin-left: 8px; } .fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */ float: left; margin-right: 8px; } .clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */ clear:both; height:0; font-size: 1px; line-height: 0px; } #price { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */ position:fixed; right:0px; height:80%; width:30%; border: thick solid #000; background-color: #FFF; top:0px; bottom:50px; overflow: auto; } #total { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */ position:fixed; right:0px; height:50px; width:30%; border: thick solid #000; background-color: #FFF; bottom:-50px; top:80% } --> </style> </head> <body> <div class="container"> <div class="header"><a href="#"><img src="" alt="Insert Logo Here" name="Insert_logo" width="180" height="90" id="Insert_logo" style="background: #C6D580; display:block;" /></a> <!-- end .header --></div> <div class="content"> <div id="price"> <br /> </div> <div id="total"><br /> </div> <form name="myform1" class="myform1" method="POST" action=""> <input type="hidden" name="hiddenField" class="" value="Test 1" /> <input type="submit" name="submit" class="submit" value="Test 1" style="background-color:lightgreen; height:50px; width:100px;"> </form> <form name="myform2" class="myform2" method="POST" action=""> <input type="hidden" name="hiddenField" class="" value="Test 2" /> <input type="submit" name="submit" class="submit" value="Test 2" style="background-color:lightgreen; height:50px; width:100px;"> </form> <p> </p> <p> </p> <p> </p> <p> </p> <!-- end .content --></div> <div class="footer"> <p>Footer</p> <!-- end .footer --></div> <!-- end .container --></div> </body> </html> it also is only submitting data to my price row......not the product row......I think this is part of problem.......
  2. nothing....that is the result.....nothing is submitting properly, the form is submitting, but without any values added to database, because they are not submitting.
  3. I got it working by putting the code in a loop and then using an id with the form name......now the problem I am having is $price submitting properly.... <?php // Query member data from the database and ready it for display $sql = mysql_query("SELECT * FROM products"); while($row = mysql_fetch_array($sql)){ $product = $row["product"]; $id =$row["id"]; $price =$row["price"]; ?> <form name="myform<?php echo $id; ?>" class="myform<?php echo $id; ?>" method="POST" action=""> <input type="hidden" name="product" class="product" value="<?php echo $product; ?>" /> <input type="text" name="price" class="price" value="<?php echo $price; ?>" /> <input type="submit" name="submit" class="submit" value="<?php echo $product; ?>" style="background-color:lightgreen; height:50px; width:100px;"> </form> <?php } ?> <?php include_once("connect.php"); ?> <?php $product=$_POST['product']; $price=$_POST['price']; $sql = "INSERT INTO cart (price, product) VALUES('$price', '$product')"; $rs = mysql_query($sql) or die ("Problem with the query: $sql<br>" . mysql_error()); echo $sql(); ?>
  4. but don't they need to be the same for it to submit right? could you post some sample code?
  5. I'm pretty sure it is a lack of association with each other...
  6. but they are all still submitting the same regardless.....
  7. my fault...the last loop, not the first.....
  8. <form name="myform" class="myform" method="POST" action=""><input type="hidden" name="hiddenField" class="hiddenField" value="<?php echo $product; ?>" /> <input type="submit" name="submit" value="<?php echo $product; ?>" style="background-color:lightgreen; height:50px; width:100px;"> </form> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".myform").validate({ debug: false, submitHandler: function(form) { // do other stuff for a valid form $.post('process.php', $(".myform").serialize(), function(data) { $("#price").load("index.php #price"); $('#results').html(data); }); } }); }); </script> now both work, but they are both submitting the same value???? please help.
  9. ok, here is some code: <?php // Query member data from the database and ready it for display $sql = mysql_query("SELECT * FROM products"); while($row = mysql_fetch_array($sql)){ $product = $row["product"]; ?> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#myform").validate({ debug: false, submitHandler: function(form) { // do other stuff for a valid form $.post('process.php', $("#myform").serialize(), function(data) { $("#price").load("index.php #price"); $('#results').html(data); }); } }); }); </script> <form name="myform" id="myform" method="POST" action=""> <input type="hidden" name="hiddenField" id="hiddenField" value="<?php echo $product; ?>" /> <input type="submit" name="submit" value="Submit" style="background-color:lightgreen; height:50px; width:100px;"> </form> <?php } ?> and here is process.php <?php include_once("/connect.php"); ?> <?php $price=$_POST['hiddenField']; $sql = "INSERT INTO cart (price) VALUES('$price')"; $rs = mysql_query($sql) or die ("Problem with the query: $sql<br>" . mysql_error()); echo mysql_error(); ?> . what is happening is it is supposed to be submitting form without page reload.......but only the first one in the loop does it. I want all of them to do it. can anyone help me do this properly.
  10. OK, so what I need to know how to do, is make a form that will submit data to a database, but without page refresh, and the page then what was submitted get's placed into a cookie, and then displays on a window on the side which is essentially what my receipt would look like. I need it to do this without refreshing or changing pages. can anyone help? I don't have any code yet.
  11. I need to know if anyone has seen a code that can convert a webpage to a pdf via php. I have googled this and it always comes up with websites that do this already. I need it directly on my site. any help is appreciated
  12. I would like to be able to do this directly from my website though, not using an external program. that way anyone of the people that send out newsletters from my site will be able to do this.
  13. What would some of these specific ones be? I don't think I want one that is a plugin for another program
  14. has anybody seen a "drag and drop" php pdf maker? I would like a page to open that I can upload images into, move the images around, add text, modify the text, and all the positions and modifications of everything stay when downloaded? oh and it has to be able to be downloaded.
  15. how do I write a statement using a greater than and less than if($soandso >=4 && <=6) {} how would I do something like this?
  16. ok, so how would I insert a link to remove a photo from this code: <?php include("connect_to_mysql_1.php"); $query = "SELECT link, id FROM products where page123=$page ORDER BY listorder ASC "; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $link = stripslashes($row['link']); $id = stripslashes($row['id']); ?> <li id="arrayorder_<?php echo $id ?>"> <img src="<?php echo $link; ?>" width="300" height="250"/> <div class="clear"></div> </li> <?php } ?> </ul> the images are able to move around but I need to know a way to keep photos with their own delete link. I am thinking of someway using listorder and the page123 to do it. could anybody help. I can't really think of a good way to describe the issue...
  17. how would I also make the next/previous buttons, and also make it so that only 10 numbers will be displayed at a time, but no ".....#" so like when it is on page 5, that is when the numbers will start moving so on page 5 it is 234567891011, 6 is 3456789101112. etc
  18. but how would I do this with the range function that I wrote?
  19. Ok, I am using range, but how do I make it display as a link? currently, nothing shows.... <?php $sql = ("SELECT MIN(page123) AS first, MAX(page123) AS last FROM products"); $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ $page1=$row['first']; $page2=$row['last']; } foreach (range($page1, $page2) as $number) { ?> <a href=."<?php $number; ?>".></a> <?php } ?>
  20. sorry, I just found out how to do it, and you answered exactly what I asked, but not wanted. I didn't want it to display 1-3 for example, but rather 1 2 3. sorry, again that was my fault. how would I do this?
  21. is that a query code? how do I implement it. here is some code: <?php $sql = mysql_query("SELECT MIN(page123) AS first, MAX(page123) AS last FROM products"); while($row = mysql_fetch_array($sql)){ $page = $row['page123']; echo $page; } ?>
  22. the only thought I have is if you have the year, month, and day in different columns, you could make it so that if the number is 0, use php to make it so that it is then changed into a number higher that what is possible. that is the only thought I really have on this.
  23. but how will it look on your site? will there be three columns on your site, one for each? like column one is ordered by year, second by month, third by day?
  24. searls03

    cart

    one way, I wouldn't suggest doing, but could be done is set one session at the beginning, such as a random number session, ie a session that is a random number. then whenever an item is added to the cart, it is put into a database with the number to store the proper items. then when they check out, you could just clear all the rows that have that session. again, one way, but not my most recommended way.
  25. how are they displayed if all of them were filled? by year, month, or day?
×
×
  • 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.