Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. You are missing a closing single quote on your href= before you issue the closing double quote to concatenate the $row value.
  2. I think the problem is bad html. <p> tag does not precede the <body> tag (that I know of. The first td tag contains two select tags and a div and an input tag - an awful lot of stuff in one table element for some reason. I think having the div in the middle of the form creates problems sometimes. I know it's confounded me in the past.
  3. I think the best way is to get the poster to stop doing it! That said - I think you have to parse the text of the page and do your own thing to count start tags and end tags and skip the end tags when they outnumber the starts.
  4. If I understand you, you want to modify your "menu" as a results of some user interaction with your page. This and perhaps some database content involvement as well. If so - this sounds like an ajax thing wherein you make your call to the server, get the response and output that response to the html div or element that contains your menu. Does that sound right?
  5. I assume that you are using the next and prev buttons as 'submit' buttons. So - hide the next/prev ids in hidden input fields in the form with the buttons and retrieve them when you process the button. No?
  6. The easy way Is to read up on "heredocs" in the php manual.
  7. Hope you're still doing your homework and not waiting for someone to earn your grade for you. You have a lot of reading to do in order to learn some stuff. There are millions of examples out there in google-land on how to do this. You don't need this forum (yet).
  8. If you want people to read your code and understand, try doing some normalization to it. Remove the styles and use css. Format the rest of the text to make it more presentable. It looks like it was generated for you and probably even you doesn't know what it does (or does not) do. Then you might get someone (like me?) to read thru it and help.
  9. why can't you "order" the query results so that you don't have to do this jumping back and forth?
  10. Have you ever programmed before??
  11. Do you have error checking turned on? I'd be surprised if line 6 doesn't throw a warning or something. Anyway - line 6 is trying to typecast a simple variable as an array and assign it (as an array?) to a var called $test. But then the next iteration is going to do the exact same thing with the next row, so basically you'll end up with the last row's value in the var $test. Perhaps you should turn on error checking when you are developing. And as an answer to your woes, try doing this: $test[] = $row5['name']; This will give you an array have the contents of each 'name' field in it.
  12. This sounds like a lack of understanding of database structure and normalized data. Add a table to hold this employment history - you will have multiple records for each employee. Be sure to have a common field between the Employee table and the EmpHist table so that you can link them together in your queries. As for processing the input form that has your html table on it, each column's <input> tag will have a name attribute on it such as 'name="ename[]"' and 'name="ecountry[]"' and 'name="efrom"' in the html and your php code will retrieve this data as an array - $ename = $_POST['ename'] which would create a php array called $ename. Do this for each input element name and then loop thru them all to collect each complete row of employment data and post each to your database.
  13. Are you talking about having a table produced by html show up on your page correctly (an html problem) OR showing the contents of a database table show up in your script or on the screen via some php output function?? Can't help if you can't explain.
  14. To elaborate on the previous response: Yes - you can make your user aware that there were no results found, although it is not 'technically' an error. It may be a user (input) error in that the item sought was not found in the table, but it is not truly an error. You should always check the results of a query for an error usually done with: if (!$preparation->execute()) { (show some error message here) ( handle the failure) } else { if ($preparation->num_rows ==0) { (handle no rows here) (handle the failure) } // continue on here if query was good and results were found .... .... After validating the query ran, you can then check if there were any results. Hope this helps.
  15. I don't see the point of using a 2nd window to show the input while it's still on the old window. If your concern is not losing the input data after you have processed it (in case of an input error), your php code can very easily just return the original screen with the input and any needed error messages displayed. Personally - I would find an application to be a bit klutzy if I had to look at an intermediate screen in order to use it. Plus - popup windows like yours are generally frowned upon.
  16. either you are in way over your head or you're trying to do something you should not be doing. Sounds fishy to me.
  17. Pretty general and vague question. What kind of slide show are you looking to do? (And that is itself a pretty vague question.) And as the previous responder said - you are probably looking in the wrong place. This kind of thing works better with a client presenting the images rather than php going back to the host each time.And have you tried searching google for a sample - there's probably a thousand out there.
  18. have you run a phpinfo to see what the current settings are? Or - you could just specify your require_once as: ("/php/required.php") btw - storing your php scripts within the web tree (public_html) is not a good idea IMO. They should be above 'public_html' to keep them away from prying eyes.
  19. So - you say you are reading the data successfully, but you can't post it in your database. So - rather than expect us to look at a whole lot of code, why not just post the part that is trying to post your database? Show the query you are using, Better yet - show us the error message you get from running the insert query.
  20. Are there different version of JS that treat my subject function differently?? I've read some posts that suggest it is true, but how does one get the desired result in those browsers that don't do as expected? I have a js function that sends a URI to a separate PHP script to run in the background and return a result that I then update my client's screen with. All my testing works just fine on IE9/10 as well as my ipad's Safari. But - my background php script (which sends me an email whenever it runs) is showing me an "undefined" value for a piece of data sent to it from the client which has been run thru this function.
  21. Once again - stupid typos !!**!! Was missing a quote on my name attrib for the dest field, causing function failure no matter what I tried.
  22. I am trying to copy some input values from one form to another using the onclick event of my submit button. The submit button in the "receiving" form looks like: onclick="return copyChoice(this.form)" and my function to do this looks like: function copyChoice(frm) { var evt_val=''; var cb_plyr_sel_val =''; // inputs are 'evt' and 'cb_plyr_sel' if (document.getElementById('cb_plyr_sel').checked) { cb_plyr_sel_val = document.getElementById('cb_plyr_sel').value; } evt_val = document.getElementById("evt").value; // now copy the values to the hidden ones in this form ??? alert("values copyied?"); return True; } My problem is in the ??? area where I am trying to place the two values I've captured into the frm object that I have from the submit button. I have tried a couple of ways like this: frm.evt = evt_val; // where evt is the 'name' of the input in this form (frm) AND: var formid = frm.id; document.getElementById(formid).evt = evt_val;    and neither of them worked. I know this since my alert at the end never arrives. So - given a form object, how do I reference the <input> tags within that form? The examples I've found (and tried to use here) don't seem to be working for me.
  23. Never use jslint before - what a pia! Except for "spacing" errors and jslint's preferred location of curly braces, my script seems ok. Here it is - something that worked before but now doesn't. I have added some 'alert' statements to help ensure it is working (even tho it doesn't). OH - and that's another thing jslint didn't like - it wanted me to declare 'alert'. Didn't know one had to do that var rtnbtn_used = false; function changeAction(btn) { alert("in x changeaction with " + btn); if (btn === 'btn') { rtnbtn_used = true; return true; } else { if (!rtnbtn_used) { alert("newwin"); document.getElementById("thisform").target = "newwin"; rtnbtn_used = false; return true; } else { document.getElementById("thisform").target = "_self"; return true; } } } Basically - I call this function with an onclick from my 'return' button in my screen as well as from my onsubmit event of my form. If the return has been hit and will do a submit, the onclick sets a switch which when my form calls this function will trigger a normal return to the same window. But if a different button has been clicked to trigger submission, the lack of the "rtnbtn" switch being 'true' will cause the target be set to open a new window. I use this on my windows that are going to build a pdf for display and I don't want to replace the current window since the user can then simply close the pdf window and generate another pdf. If I just used the single window, then a return (back) from the pdf displayed would send them back a screen too far in my appl. making it tedious to use the pdf generator repeatedly.
  24. You certainly are a newbie. Your html is not setup properly at all. Try looking at a book and learn the structure of an html page and you'll quickly see why your js is not working. Also you are missing other important tags. (quick answer - scripts must go in the head section of an html page along with css)
×
×
  • 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.