Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. You have css determining whether the div is hidden or displayed. When your script first sends the page (before user interaction) use your php to set those divs to all be "display:none;". Then when the user clicks on a list item and triggers your script to run again and to process a part of the code applying to that div, have your php change the display setting of that one div to 'display:block;'. Now when your script sends the output to the client that one div will be visible while all the others will still be set to 'none'.
  2. You've spent hours googling for a solution? Did you happen to try looking up the function definition in the PHP manual? Depending upon what you mean by "returning far too much data", you can control that amount with this function's arguments. But of course - how do you determine how much data you DO want returned? Is it a constant all the time? Is it only the beginning or nearly at the end? Or is it bytes 100 - 299? It appears you are going to be reading urls - can you be sure that the contents of that url doesn't change or are you going to be using logic to do searches or pattern matches to locate the specific data you want? Really a complex issue, but controlling how much data is returned is definitely simple and up to you.
  3. No I dont' follow your terminology at all. You mentioned tabs and submits but then you tell me that your 'tabs' are really the items in an unordered list. So how do you have submits that "send you back to the first tab"? You don't get sent back to a list - you get sent back to a page and what you see and where you are located (focused?) is determined by you usually. If you want certain divs displayed and hidden you need to set up some vars in their styles that control that so you can set them while handling the submit and then when you send that page back the settings will be as you wish. does my terminology make sense?
  4. So now I am totally confused. You have a list containing links that will achieve something and you want to "return" to the just clicked item? Aren't they all basically together on the page as it is?
  5. I have never used the tab features of browsers preferring to have separate windows when necessary. That said, I wonder how changing the order of the build of each page/tab would affect the outcome of a refresh? Perhaps sending the just-used tab/page back first would make that the active tab?
  6. To control the data in each row. Interesting choice of words. I'm guessing you want to display the data from your db for a specific user. Then you wish to allow the user to approve or deny a row at will. Do you envision this process being done at the server and then having the screen refreshed with the data changed according to the process that occurred? Very confusing to look at an anchor with no href - what is it supposed to do? I have done this in the past by making the data of each row a separate form with a hidden field (?) containing the key of the row and then having two buttons that submit the form with a script that responds to handle the button clicked. Then the screen is refreshed.
  7. Where is your current code so we can show you what needs to be done?
  8. Look at your quotes. You need to learn to use single and double quotes or else learn how to escape them. And - if you're a newbie where did you learn how to write this OOP code already? You can't write a clean string but you are using classes/objects?
  9. Assuming that the layout of the csv files is constant, what's the problem? Open up the new and the old file; read a line from each and compare them. Or - if the file order can't be guaranteed - read the records and store them each in an array using the product id (or something) as the array index. Then loop thru the old one and try and find the same record in the new one and handle it.
  10. This makes no sense. How about explaining in plain English?
  11. Do you plan on learning how to program without reading a single manual or educational resource ever?
  12. I gave you all kinds of corrections to be made. Just do it?
  13. No. Maybe you should start with a more reliable learning process..... Copying other's code serves no useful purpose at your stage of this game. Now that I know that you are not even attempting to write code, I'll depart. Good luck
  14. You have many problems with this code as Gizmola says. See my notes. <!DOCTYPE html> <html> <head> <title>Your own do-while</title> <link type='text/css' rel='stylesheet' href='style.css'/> </head> <body> <?php //write your do-while loop below $rollcount = 0 do // you have no condition on this do loop. INFINITE LOOP { $roll = rand(1,6); $rollcount++; if($roll = 1) // BAD IF COMPARISON - SHOULD USE == HERE { echo " <div class=\"coin\">1</div>"; } if($roll = 2); // BAD STATMENT - IT ENDS HERE AND SERVES NO PURPOSE { echo "<div class=\"coin\">2</div>"; } if($roll = 3); // SAME { echo "<div class=\"coin\">3</div>"; } if($roll = 4); // SAME { echo "<div class=\"coin\">4</div>"; } if($roll = 5); // SAME { echo "<div class=\"coin\">5</div>"; } if($roll = 6); // SAME { echo "<div class=\"coin\">6</div>"; } } // PLUS - YOU REALLY SHOULD LEARN HOW TO USE SINGLE AND DOUBLE QUOTES TO MAKE // YOUR TYPING EASIER // THIS ELSE IS OUTSIDE OF YOU 'DO' LOOP ??? else if($roll = 3); // SAME { echo "<p>There {$verb} {$rollcount} {$last}!</p>"; } // THIS WHILE IS A NEW LOOP while($roll); // SAME { $verb = "were"; $last = "rolls"; if($rollcount = 1); // SAME { $verb = "was"; $last = "roll" } } ?> </body> </html> You have some logic errors as well but you have enough to work on for now.
  15. Please use code tags to post your code.
  16. 1 - please use the proper code tags when posting code on a forum. On this one it is the word 'code' in square brackets with a closing tag of "/code" in brackets also. 2 - very bad form to develop code with functions buried in the middle of main stream (or any other code for that matter) code. Place them away from the rest of your code 3 - Why do you suppress the result of the call to mail()? How can you even possibly follow a suppressed statement with a message of success??? I had wished that you posted the code where you tried to send both emails in one call. That was your last complaint and that was I asked to see.
  17. Use your cleverness to take that array and build the necessary strings to create the proper query statement, instead of just building a (decidedly incorrect) query statement that did the wrong thing. Instead of a single column and a single value, build strings that represent what you need.
  18. What is the trouble?
  19. So - now that we're past that - can you post the code you last tried along with the contents of the vars used to send the mail? You went wrong somewhere if you had to resort to calling the mail() function twice.
  20. Well said mac_gyver!!
  21. Since you can't read English - or are afraid of manuals - you probably did screw it up. Either show us the code you tried (with an echo of the values used) or don't bother the people here with your attitude anymore. You made one of the most respected members here ignore you - that's quite an accomplishment for a newcomer. Says a lot about you
  22. The $_POST array is created when you submit a form whose method is set to POST. The script mentioned by the same form's action attribute gets control and receives the elements of that form in the POST array. Your script is doing something with that data and then you want to save some subset of that data I presume so that you can use it later after another form is sent out and returns with new POST data. In order to save data you can : 1 - save fields as type='hidden' on the second form so that you will receive them again 2 - save the data from the POST fields in a session var. You can save them individually or as items within an array To save vars as session vars you simply say "$_SESSION['varname'] = (whatever var/value you have to save)". If the var you want to save is an array then the SESSION var will be an array. Session vars will last as long as the current session lasts. If you are not yet using sessions, you should read up on them in the manual, but simply put - if you start each script with "session_start()" you will open the session and have access to whatever you have previously saved in that session.
  23. Unless an element exists on the form that triggered THIS script on submit, you will not have an element named 'service' in your post array. Perhaps you want to save the data from that previous page in a session array rather than a post array.
  24. As I surmised from my look at the code - your form doesn't have an element named service in it. Look at your entire form's html and be sure that you have that element to solve this error. I see an element in your last post named service, but it is not an array as you seem to expect since you use the count() function on it.
  25. I'd rather see line 91
×
×
  • 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.