Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by mickeymouse

  1. The third section of code below gave me some results (some amounts) but these were incomplete so I coded the first (TEMP) section to list my rows for debugging purposes. When I did that, the results in my third section all changed to 0 amounts. So, for further debugging purposes, I coded section 2. Section 1 listed my rows but section 2 did not list any rows - only the "LIST2" & "END2". I don't understand why, I get 0 amounts nor why section 2 wont list. (I don't think I have coding errors). //TEMP SECTION 1 -------------------------- print("List1<br>"); $rowcnt=$AffectedRows; $myResults=$Results; while ($rowa = mysql_fetch_row($myResults)) {print("$rowa[0] / $rowa[1] / $rowa[2] / $rowa[3] / $rowa[4] / $rowa[5] / $rowa[6] / $rowa[7] / $rowa[8]<br>");} print("END1<BR>"); //TEMP=========================== //TEMP SECTION 2 -------------------------- print("LIST2<br>"); $rowcntx=$AffectedRows; $myResults=$Results; while ($rowx = mysql_fetch_row($myResults)) {print("$rowx[0] / $rowx[1] / $rowx[2] / $rowx[3] / $rowx[4] / $rowx[5] / $rowx[6] / $rowx[7] / $rowx[8]<br>");} print("END2<BR>"); //TEMP=========================== SECTION 3---------- for ($loop=1;$loop<($AffectedRows+1);$loop++) {while ($row = mysql_fetch_row($Results)) {if($row[8]=="b") {$BBal[$row[4]] = ($BBal[$row[4]] - $row[3]); $BBal[$row[5]] = ($BBal[$row[5]] + $row[3]);} else{$Bal[$row[4]] = ($Bal[$row[4]] - $row[3]); $Bal[$row[5]] = ($Bal[$row[5]] + $row[3]);}}} ...print results...
  2. Upon loading, the code works. My form area get highlighted with yellow. In the second case, Java goes through the code but my area does not get highlighted. I also tried calling myload function but that also didn't work - maybe not doing it the right way. <style type='text/css'> .start-here {background-color: yellow;} </style> <script type='text/javascript'> //======================================= function myload() //This code does it's job of highlighting my form starting at field 'all' {var c = document.ReportsForm.all; c.focus(); c.parentNode.className = 'start-here'; c.onblur = function() {this.parentNode.className = '';} } //====================================== function formcheck(myform) {if (all.checked || .checked || liab.checked || inc.checked || exp.checked){;} else {alert('A Type of Account must be selected.'); //This alert takes place. var c = document.ReportsForm.all; // this code has no results c.focus(); // " c.parentNode.className = 'start-here'; // " c.onblur = function() // " {this.parentNode.className = '';} // " alert('TEST IF REACHED'); //This alert takes place. return false } } //=============================================== function formcheck(myform) {if (all.checked || .checked || liab.checked || inc.checked || exp.checked){;} else {alert('A Type of Account must be selected.'); //This alert takes place. window.myload() //This did not result in highlighting. return false } }
  3. byyr contains 20. If I add 1, I get 201 (wrong result). (See first set of code below) If I multiply by 5, I get 100 (correct result). (See second set of code below) If I multiply by 1, I get 100 (correct result). According to documentation, a + in Java Script is addition. I have spent over 2 hrs trying to figure out what was wrong with my (more complicated) coding. Please, please, tell me why addition doesn't work. function mytab(byyr,bymo,mo,fld,to) {with (byyr, bymo, mo, fld, to) var x = byyr.value var y = x + 1; alert(y);} function mytab(byyr,bymo,mo,fld,to) {with (byyr, bymo, mo, fld, to) var x = byyr.value; var y = x * 5; alert(y);}
  4. Is it possible to style the "alert", I.e., make the message RED and /or make the message font size 14 or the text bold?
  5. Thanks. I made the corrections and all is OK now. However, if frame="box" is obsolete, how do I get a box?
  6. I've corrected the error(s) and put everything as Table attributes and so I get the correct results except for the width - it doesn't work. I just can't understand why not and can't see anything wrong with my attribute spec. I use the same thing in other pages and it works fine. <table cellpadding='10' cellspacing='0' frame='box' width='40%' border='1px'; border-color='Blue' background-color='lavendure' align='center'> P.S. All the best to you in 2020!
  7. I'm using the following according to dsonesuk advice and it works fine.. To pass the parameter: function ancester(myparam) {if(myparam==''){return false;} location.href='FT_Search2.php?param='+myparam;return false; window.open(location.href); return false;} To get the parameter: {$reqref=$_GET['param'];} Thanks for the help!
  8. I'm not getting a frame and I'm not getting a width of 40% but a very large width wider than my screen. Why? <table style='cellpadding:10; cellspacing:0; align:center; width:40%; frame:box; border:1; bordercolor:Blue'; background-color:lavendure' > Same thing with <table cellpadding:10; cellspacing:0; align:center; width:40%; frame:box; border:1; bordercolor:Blue; background-color:lavendure >
  9. It's not a case of "just thinking". There is a decision making via the "if" statement so I don't see why there shouldn't be a facility to go to a new page based on the decision. One should be able to do "anything" without human intervention. However, it seems that is not possible with website programming - something I consider a deficiency. Nonetheless, thanks for your help!
  10. How do I open a new page (replacing the current one) in inline code, i.e. without the need to click something? e.g., if(x=y) open new page else{continue....
  11. mickeymouse

    Baffling CSS

    I just can't understand what's going on. At the bottom of this post is my results - which doesn't follow at all the CSS and I have no idea where the blue bordered incorrect sized box comes from. I did the Inspect Element thing but can't see any answers in there. Would much appreciate your help. Here is a sample code of my page followed by the code of my HA_StyleA.css file. <?php session_start(); print(" <html lang=\"en\"> <head><title>Index</title></head> <link rel=\"stylesheet\" href=\"HA_StyleA.css\" type=\"text/css\" /> <script language=JavaScript> </script><noscript>Your browser does not support JavaScript!</noscript><body> "); //========================================================================================================== print(" <form name=\"Company\" action=\"HA_LogInCheck.php\" method=\"POST\" onsubmit=\"return formcheck(Company)\"> <br><br><br><center> <p class='onea'> <br> <font size=3 Color=\"Crimson\"><b> This is my test data.<br> The quick brown fox jumped over the lazy dog's back.<font Color=\"blue\"> Mary had a little lamb and was the doctor upset!<br> </b><font color=\"black\"> The quick brown fox jumped over the lazy dog's back. <br><br> </p> </body></html>"); ?> //Following is my HA_StyleA.css file code: .onea {max-width: 80%; border-style: solid; border-width: 2px; border-color: transparent; padding-left: 5px; padding-right: 5px; text-align: left}
  12. I have date 2019-02-01 and I need to subtract x days from it. I believe I first need to convert my date to timestamp, subtract my x days, and convert back to my date format. If that's correct, how do I convert to timestamp? (Just can't find it in documentation.) Tks
  13. It takes 18/20 seconds to execute this code when I click my Submit Button- much much too long. Why? Also, why does it not pass focus to my "Submit" button upon completion? function formcheck(myform) {with (myform) if (yy.value.length!=2){alert('Year must be 2 digits.');yy.select();return false;} if (mm.value.length!=2){alert('Month must be 2 digits.');mm.select();return false;} if (dd.value.length!=2){alert('Day must be 2 digits.');dd.select();return false;} if (dd.value<'01' || dd.value>'31'){alert('Invalid Day.');dd.select();return false;} if (mm.value<'01' || mm.value>'12'){alert('Invalid Month.');mm.select();return false;} if (yy.value<'01' || yy.value>'99'){alert('Invalid Year.');yy.select();return false;} if (((mm.value == '04' || mm.value == '06' || mm.value == '09' || mm.value == '11') && dd.value > '30') || mm.value == '02' && dd.value > '29'){alert('Invalid Day for Month or visa versa.');dd.select();return false;} alert{'Finished');return false;}}}}}} <-------- Temporary in order to time the process. else{sub.focus;return true;}}}}}} <-------- Normal code to pass focus to "Submit" button BUT doesn't work! <form name=\"DateSetting\" action=\"HA_DateSet.php\" method=\"post\" onsubmit=\"return formcheck(DateSetting)\"> YY <input style='text-align:center;width:30' name='yy' id='yy' required MaxLength=2 onkeyup='mytab(yy,mm)'> &#160;MM <input style='text-align:center;width:30' name='mm' id='mm' required MaxLength=2 onkeyup='mytab(mm,dd)'> &#160;DD <input style='text-align:center;width:30' name='dd' id='dd' required MaxLength=2 onkeyup='mytab(dd,sub)'>
  14. The link you gave me is not at all clear. It only gives an example instead of explaining/teaching. However, I came up with the following and it works: <style> @media print {.noprint {display: none !important;}} </style> <input type=\"button\" value='Print' class='noprint' onclick='myprint()'> function myprint() {window.print();} Thanks for your help.
  15. How do we prevent Buttons from printing when printing a page? I thought it should something like putting class='noprint' in the button code but that doesn't work. Tks
  16. mickeymouse

    Baffling CSS

    I have a link for a css file but I don't have a css file. Yet my has <p class='five'> (see code below) I'm baffled as to where does my browser get the box, with borders and background color as follows: Also, if I include the css file with the p.five defined with a smaller box, the result is still the same as above. (see my css file attached - perhaps I haven't defined it correctly.) ... <link rel='stylesheet' href='HA_StyleA.css' type='text/css' /> ... print(" <form name='Reg' > <br><br><br><br><font size=4 color='maroon'><b><center> <p class='five'> Select the desired function<br> from the above menu items. <br></font> </b></p> HA_StyleA - Copy.css
  17. Can I have an input tag with no borders?
  18. OK. I found the problem. One of my field parameters for selection did not contain the correct info and the Affected Rows = 0 was indeed correct. It is now working (and Affected Rows is giving me the correct count). Regrets for taking up your time. Thank you.
  19. Very well but 1) How do I test the COUNT? 2) I tried $MyRowCount=mysql_num_rows(); (according to SQL Documentation) and I get 0 rows read, yet the DB has some 1000 rows. 3) Ignoring the counting aspect, I list the rows read with following code but there are no rows. So the real question besides the counting is "Why is it not reading the rows?" while ($row = mysql_fetch_row($Results)) print("...….. Tks
  20. Thank you dsonesuk. It works perfectly (all the time when we do it right) I'd like to give you points but don't know how. Can't see anything on the page that would allow me.
  21. I'm getting 0 in $AffectedRows and get my resulting message "There are no transactions..." Yet, I have many records in my "transactions" DB file. I Can't understand, can't see any errors in my code. I don't get any DB errors nor any other errors. The same code (for other DB files) works fine. $link = mysql_connect($host, $username, $password); if (!$link){die('Not connected : ' . mysql_error());} $db_selected = mysql_select_db($database, $link); if (!$db_selected){die ('Can\'t use ' .$database .':'. mysql_error());} $query = "SELECT * FROM `transactions` "; $Results = mysql_query($query, $link) or die ('Error = '. mysql_error()); $AffectedRows = mysql_affected_rows($link); if($AffectedRows < 1) {print("There are no transactions ……..
  22. I understand that to pass a paramater from one page to another from a call in a function I must have "?param=myparam" following my page id. e.g. function ancesterF(myparam) {location.href='mypage1.php? param=myparam';return false; window.open(location.href); return false;} and to pick-up the paramater in the called page, I need to use: $getmyparam=$_GET['param']; However, it doesn't work. The resulting pick-up is "myparam" instead of the value of "myparam" which is "10006" Does anyone know how to pick-up the value passed? I can't find anything about this in PHP documentation. Many thanks
  23. I tried that but I end up with the value of my $getmyparam being equal to "myparam" instead of the value passed which in my test case is "10006" In my calling function, I confirm the value of "myparam" and it is "10006". CALLING CODE: function ancesterF(myparam) {alert(myparam); <----------------------------------------------------------------------------------This confirms the value "10006" location.href='FT_Search2.php?param=myparam';return false; window.open(location.href); return false;} RECIEVING CODE: $getmyparam =$_GET['param']; print("getmyparam"); <------------------------------- Result = "myparam" not "10006"
  24. Thank you dsonesuk. I should also have asked you how do I capture the param in my called page.
  • Create New...