Jump to content

sunfighter

Members
  • Posts

    579
  • Joined

  • Last visited

    Never

Everything posted by sunfighter

  1. bozeman I hope you can understand what I am doing here. Good luck When you do your query and populate your table you are going to have something like this "while($row = mysql_fetch_row($result))" to loop throught the table rows. I am just using a for loop. The thing here is you will need to declare $i equal to 1 before your while statement and have $i++; as the last line in that loop. This is needed to keep the row IDs separate. Understand ? The for loop I use does two rows BUT puts the same values in the <td>s. The button will show you how the javascript does the increase and decreases that you wanted> The code: <!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" xml:lang="en" lang="en"> <head> <title>New document</title> <meta name="generator" content="TSW WebCoder 2010" /> <script type="text/javascript"> function alter(colo) { document.getElementById('inv'+colo).innerHTML = ((document.getElementById('inv'+colo).innerHTML)*1 - (document.getElementById('pay'+colo).innerHTML)*1); document.getElementById('amt'+colo).innerHTML = ((document.getElementById('amt'+colo).innerHTML)*1 + (document.getElementById('pay'+colo).innerHTML)*1); } </script> </head> <body> <table border="1" id="payments"> <tr> <td style="background-color:blue;color:white;">Total Invoiced</td> <td style="background-color:blue;color:white;">Total Payments</td> <td style="background-color:blue;color:white;">Payment</td> <td style="background-color:blue;color:white;">Pay Now</td> </tr> <?php for($i = 1; $i < 3; $i++) { $str = <<<ROWS <tr> <td id="inv$i">29349.73</td> <td id="amt$i">26216.93</td> <td id="pay$i">2000.20</td> <td><input type="button" value="Pay Now" onclick="alter('$i');" /></td> </tr> ROWS; echo $str; } ?> </table> </body> </html> Good luck understanding. It does give you a simple solution to your problem and I Hope will steer you to javascript instead of jquery.
  2. You don't need AJAX for this javascript will do nicely. Don't use check boxes, use a button with an onclick feature. You also need to have the payment amount associated with the row. and ID's for the Total and the Payments. Do you need code?
  3. Two thoughts on this. First: Since you are going to condition the room_rate string to stop database injection, you might as well add the commission at that time. So add it before insertion. Second: Your commission could change, room_rates may also, so use two columns; one with the room_rate and the other room_rate + commission.
  4. The code you posted has some errors and will not exicute on my wamp. Line 24 : }else{ throws an error. I don't think it belongs here because you have the same thing on line 28. Next error I get is that the last } line 60 does not belong there. And line 25 : $searchwords = addslashes(htmlspecialchars($_POST['swords'])); has the word swords as being passed to this code, but you are defining it in the form just above Line 15. ============================================================================== As for your question you need a column (maybe a couple) in the user table that defines what you want to display for that user.
  5. Your menu is calling droplist.php (the file that generates the menu) with the GET method, but you have no php code that reads the $_GET return.
  6. It is obvious that the site your updating is not the site your viewing. Make sure Dreamweaver cs5 is opening up the correct files and that Chrome has the correct address.
  7. Your doing this in php which is on the server. Can't be controlled via a browser button. (yeah AJAX I know). Do this in javascript. add a string that the button can control it's value. Have the loop check this string at the end of each loop and if set to death value break; out of loop.
  8. <!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" xml:lang="en" lang="en"> <head> <title>New document</title> <meta name="generator" content="TSW WebCoder 2010" /> <script type="text/javascript"> // script.js handle the form submit event on form (below) entitled form.html function prepareEventHandlers() { document.getElementById("form3").onsubmit = function() { if ((document.getElementById("func_0").checked == true) || (document.getElementById("func_1").checked == true)) { document.getElementById("errorMessage").innerHTML = "radio button is good to good"; // to STOP the form from submitting //return true; // uncomment this line to have submit working return false; // remove line when using in the real world } else { // reset and allow the form to submit document.getElementById("errorMessage").innerHTML = "Please select one button!"; return false; } }; } // when the document loads window.onload = function() { prepareEventHandlers(); }; </script> </head> <body> <form action="includes/validate.php" method="post" name="form3" id="form3"> <input type="radio" name="func" value="work" id="func_0" /> <input type="radio" name="func" value="nonwork" id="func_1" /> <span id="errorMessage"></span> <input type="submit" name="submit3" id="submit3" class="rcorners" value="next>" tabindex="15" /></td> </form> </body> </html>
  9. Is this correct: You ONE string that's 612 characters long. you want to look at the first 153 characters in that string and find all the euro characters. And you claim that takes up 2 character spaces of the string. How do you figure? I use &#8364; for a euro symbol in php and that's more than two characters. What characters are you looking for in the first 153 characters of the string?
  10. The first thing to do is put the 'pieceofFenceVertical.png' on the site. next "left and right of newsblock" you have nothing labeled newsblock. Where do you want the image?
  11. Your doing your query outside of your while loop and trying to get the query information inside the loop. You will only get one line as you know. How to do it: <?php //open database $connect = mysql_connect("******","username","password") or die("Not connected"); mysql_select_db("collegebooxboox") or die("could not log in"); require ('./inc/DB_connect.php'); $query = "SELECT * FROM boox ORDER BY date DESC"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)){ $link = $row['link']; $username = $row['username']; $messsage = $row['messsage']; $date = $row['date']; echo $link, '<br>'; // This you replace with your table echo $username, '<br>'; echo $messsage, '<br>'; echo $date, '<br>'; echo '=====================================<br>'; // a seperater } ?>
  12. Some gray areas here. But when you do this: echo "<form>"; echo "<input type=\"submit\" name=\"Submit2\"> echo "</form>"; This is your form. It has nothing in it. and your <form> tag does not have the action to submit this form to. Maybe insert the info above the form into the form. PS. echo "<input type=\"submit\" name=\"Submit2\"> needs an ending "
  13. This line: while($row1 = mysql_fetch_assoc($cat)) $cat not defined
  14. I left the boarder info in so you could see how div were arranged. <html> <head> <style type="text/css"> #wwrapper { position: relative; left: 150px; //border: blue solid 1px; height: 210px; width: 600px; } #overall { width: 395px; height: 200px; border: green solid 1px; display:block; float:right; } #inner, #inner2, #inner3, #inner4 { position:relative; float:left; margin-left: 5px; //border: red solid 1px; height: 150px; width: 90px; } </style> </head> <body> <div id="wwrapper" style="text-align:left;"> <div id="overall"> <div id="inner"> Sun<br> <img src="http://www.google.com/ig/images/weather/mostly_sunny.gif" alt=""><br> High: 61<br>Low: 49<br>Mostly Sunny </div> <div id="inner2"> Mon<br> <img src="http://www.google.com/ig/images/weather/rain.gif" alt=""><br> High: 56<br>Low: 49<br>Rain </div> <div id="inner3"> Tue<br> <img src="http://www.google.com/ig/images/weather/rain.gif" alt=""><br> High: 56<br>Low: 47<br>Rain </div> <div id="inner4"> Wed<br> <img src="http://www.google.com/ig/images/weather/chance_of_rain.gif" alt=""><br> High: 58<br>Low: 45<br>Chance of Showers </div> </div> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </div> </body> </html>
  15. You never said what trouble you were having. I ran your script and the only thing I get is 'about.html' not found. Is about.html in the same folder as this program? Does the program write to the screen? The only two thing that might cause the redirect to not work.
  16. Here what I did: to container_12 I add 100% width => <div class="container_12" style="width:100%"> And replace all this <div class="grid_3"> <div id="rss"> <form action="login.php" method="post"> <span>Log In</span> <input name="username" type="text" maxlength="15"/> <input name="password" type="password" /> </form> </div><!--rss--> </div><!--grid_3--> With this: <div class="grid_3" style="width: 300px;"> <div style="float:left; width: 210px;"> <form action="login.php" method="post"> <span style="float:left;">Log In</span> <input name="username" type="text" maxlength="15" style="float:right;"> <span style="clear:both; float:left;">Password</span> <input name="password" type="password" style="float:right;"> </form> </div> <div id="rss" style="float:right; width: 40px;"></div> </div><!--grid_3--> You are going to figure out where the RSS goes and maybe change the color, but it should align the login pass and the feed for ya.
  17. Use the tag above to post your code = the #.
  18. php runs on the SERVER and runs prior to the web page creation. javascript runs on the user side in the browser that displays the web page. php can pass variables to js, but js can't pass then to php UNLESS you use AJAX. Whole other thing to study.
  19. Gradients do not work in IE9 or less.
  20. I do not see any reason for this behavior. Everything you display is relative to it's main container <div id ="ezContainer"> and that is centered inside of the browser page. Your == How can your page be wider? This is all controlled by your browser FF and that should be the same size wither displaying a local file or one from the internet. Maybe your environment on your computer displays in FF differently that true FF via the internet. Maybe your zoom is set wrong. Hit ctrl-zero to reset that and check internet again.
  21. Are you using %s in you mark up? You should post some code. HTML and CSS
  22. Before going any father you should validate your code http://validator.w3.org/. Your site has 78 Errors, 106 warning(s). Sites that have errors normally don't show well in multiple browsers.
  23. Enclose news_status in quotes And Enclose news_id in quotes <form id="list_update" action="status_update.php" method="post" name="list_update"> <select name="newnstatus" size="1"> <option <?php if($row['news_status'] == ""){print("selected");} ?> selected="selected" value="">Status...</option> <option <?php if($row['news_status'] == "on") { print("selected"); } ?> value="on">On</option> <option <?php if($row['news_status'] == "off") { print("selected"); } ?> value="off">Off</option> <option <?php if($row['news_status'] == "deleted") { print("selected"); } ?> value="deleted">Delete</option> </select> <input type="hidden" name="nstatus" value="<?php echo $row['news_status']; ?>" /><!-- !! Enclose news_status in quotes !!--> <input type="hidden" name="news_id" value="<?php echo $row['news_id']; ?>" /><!-- !! Enclose news_id in quotes !!--> <input type="submit" name="update" value="update" /> </form>
  24. OK. I didn't return it to ALL the corect settings. After all I practiced on my database. lol Change FROM customers to FROM listings After all were working with only one table.
  25. Here another solution in php. <?php // Given these $needle = '(Gå till'; $curve = ')'; $string = 'Hello, You big (Gå till lotsa Bad and love) bad wonderful girl.'; $string = implode(' ', explode(substr($string, strpos($string, $needle), strpos($string, $curve)-strpos($string, $needle)+1), $string)); echo $string; ?> Will give you. Hello, You big bad wonderful girl.
×
×
  • 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.