Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by AyKay47

  1. does your table display the layout that you expect it to? I have doubts about the structure, however to find the average this should work for you.. if (isset($_POST['btn_submit'])) { $number_of_rows = $_POST['number_of_rows']; echo "<table cellpadding='10' cellspacing='10' border='1'"; echo "<tr>"; for($ii = 0; $ii < $number_of_rows; $ii++) { echo "<tr>"; for ($i=0; $i<$number_of_rows; $i++) { $my_no = mt_rand(1, 100); if (($my_no%2==0)&&($my_no%3==0)) { $color="#FF00FF"; } else if ($my_no%2==0) { $color="#0000FF"; } else if ($my_no%3==0) { $color="#FF0000"; } else { $color ="#FFFFFF"; } echo "<td style=\"background: {$color};\">$my_no</td>"; } $total += $my_no; echo "</tr>"; } echo "</table>"; $average = ($total/$number_of_rows); print $average; }
  2. can you show us the code for this
  3. what if the h1 tag is to be positioned in the middle or right? I wouldn't recommend using float, although it would work if the text is to be on the left
  4. yes as the poster before me said, look into using mysql_real_escape_string before inserting data into your db table
  5. you can use the nowrap attribute or do something like h1 { display: inline; }
  6. well it really depends on what you are trying to do here, pictures only really get to be so big.. I would make the max file size a little bigger then you are expecting, probably no larger then around 4 MB for an image, depending on whether or not you are allowing gif's etc...and as long as you are only allowing pictures to be uploaded and not videos, via data sanitizing/filtering, as long as you know that the user is only allowed to upload images, you can sleep at night with a higher max file size. What you don't want to have happen is set the max too low, disabling a user to upload a larger image...
  7. okay, good explanation, makes sense...thanks thorpe
  8. okay in your else block let's place some debugging in there to pin the issue to the move_uploaded_file function else { $newname = $id . ".jpg"; if(!move_uploaded_file($_FILES['file']['tmp_name'], "inventory_images/$nawname")) print "Cannot move {$_FILES['file']['name']}";
  9. if this is not working, there would be errors in your error.log, however you mispelled you $newname variable $place_file = move_uploaded_file( $_FILES['file']['tmp_name'], "inventory_images/$newname"); //you had is spelled $nawname, not $newname
  10. you want the fadeToggle() function then
  11. when a duration is provided in the toggle() funciton, it becomes an animation method which affects height and width...here's some interesting reading on the subject.. http://api.jquery.com/toggle/
  12. hey guys, quick question that I was wondering about...why does phpfreaks have an AJAX section ,but not a jquery section? I find that jquery questions are typically asked here more than AJAX questions are..
  13. the only thing that I notice is that you aren't ending you code line <script type="text/javascript"> $(document).ready(function() { $('#personal').click(function() { $('#personalContent').toggle(1000); // place a ; on the end here }); }); other thatn that, I really don't see anything that would be causing this
  14. your insert syntax is not correct anyway... heres the correct syntax to use http://dev.mysql.com/doc/refman/5.5/en/insert.html in order to get more than one echo here. you will need to place them inside of the foreach loop.. foreach($_POST['Times'] AS $start_time){ if($start_time == "07:00:00"){ $end_time = "10:00:00"; } else if($start_time == "10:00:00"){ $end_time = "13:00:00"; } else if($start_time == "13:00:00"){ $end_time = "16:00:00"; } else if($start_time == "16:00:00"){ $end_time = "19:00:00"; } $sql = "DELETE * FROM aarbookts_booking_bookings_slots WHERE booking_id=$booking_id"; $sql1 = "INSERT INTO aarbookts_booking_bookings_slots SET start_time='$start_time',end_time='$end_time',booking_date='$booking_date' WHERE booking_id=$booking_id"; echo $sql; echo $sql1; } //end foreach } //end IF
  15. Alright so that isn't an issue here, on the blank page, what does a "view source" in the browser show?
  16. what that function does is, when called, submits the 3 forms that are specified in the function scope.. function submitForms() { this.document.form1.submit(); this.document.form2.submit(); this.document.form3.submit(); } you would replace, form1, form2, form3 with the names of your forms... so if you had a form like so.. <form name="test_form" action="#" > the function would be function submitForms() { document.test_form.submit(); // add as many as you want really } then you can make a button that will call the function to submit all of the forms.. <button onlclick="submitForms()">Submit</button>
  17. hope you didn't forget the ending parenthesis like i did should be header("Location: index.php?msg=$msg"); to check if short tags are enabled, insert this in your code somewhere print "short_tags=" . ini_get("short_open_tag");
  18. glad it worked, should be a backslash not a forward slash
  19. seems like you forgot to include session_start() at the top of the page, but to answer your question directed towards me, a print($_SESSION); will print all of the keys and values that are stored in the session array at the time of calling the print_r
  20. you will need JavaScript, i posted a useful link in one of my previous posts
  21. isn't that what you are doing here? if(empty($_GET['code'])){ header('Location: http://website.com/entercode.php?p=empty'); //they didn't enter a code, or they came directly to this page } else { //look up the code in the database, see if it's invalid or already used } btw, the isset() is not needed if you are checking for it being empty
  22. so you don't receive any errors? do you ave short tags enabled in your php.ini, you use them here <? $menuitem=4; $submenuitem=1; include("menu.php"); ?> 3. don't reaqlly need to concatenate your header, this will work. header("Location: index.php?msg=$msg";
×
×
  • 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.