Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. $con=mysqli_connect("mysqlusername","password","database name","table name"); The above line is not correct. Refer to the manual to get the right syntax.
  2. What do you THINK you have to do?
  3. If those values that you set with the js code are in the form that is being submitted, then they are part of your POST array. What's the problem with that?
  4. No. I just don't know anything about it and didn't realize that was what you were you doing.
  5. The whole idea of htmlspecialchars IS to break the link - any link, any html code - that could break your page or your site if you echo it back out.
  6. While my initial response could have been more detailed, your latest proposed code (after Psycho's wonderful response) is still lacking. You can't run an empty call on the strip_tags result. As my off the cuff answer tried to make clear - run the empty test first as a true response from that answers one half of your question with the least use of resources ie, "is it empty?". Once you determine that it is not empty, then do your other tests to validate it or sanitize it.
  7. It works but if you think about it - if you check for empty first you save a call to strip tags
  8. 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'.
  9. 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.
  10. 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?
  11. 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?
  12. 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?
  13. 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.
  14. Where is your current code so we can show you what needs to be done?
  15. 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?
  16. 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.
  17. This makes no sense. How about explaining in plain English?
  18. Do you plan on learning how to program without reading a single manual or educational resource ever?
  19. I gave you all kinds of corrections to be made. Just do it?
  20. 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
  21. 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.
  22. Please use code tags to post your code.
  23. 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.
  24. 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.
×
×
  • 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.