Jump to content

kicken

Gurus
  • Content Count

    3,793
  • Joined

  • Last visited

  • Days Won

    108

kicken last won the day on July 30

kicken had the most liked content!

Community Reputation

551 Excellent

3 Followers

About kicken

  • Rank
    Wiser? Not exactly.

Contact Methods

  • Website URL
    http://aoeex.com/

Profile Information

  • Gender
    Male
  • Location
    Bonita, FL
  • Age
    33

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I generally find the best thing to do is just create your tables and start working. You'll probably make a mistake/forget something in your initial table design but that's fine. You catch it while you're writing the code and then update your database as needed. There's a point at which trying to plan ahead become counter-productive. You spend far too much time trying to anticipate everything you'll need/want and either make things overly complicate or still miss something anyway. So instead just put in the basic stuff you know for sure you'll need and then let the design evolve as you work. I generally don't even bother with indexes outside of the primary key / foreign keys until I have something mostly developed, tested and working. That way I have a better understanding of what my actual queries are rather than trying to guess what they will be early on. Pretty much every mistake can be fixed, some may just take longer or be more complicated than others. Most of your mistakes will probably be minor like "Oh, I should save this too" or "This should go in a different table" or "Maybe I should have an index here". You'd be hard pressed i think to make any mistake that I'd classify as "fatal". Bottom line, don't worry about mistakes and trying to get things right the first time. Spend more time actually working the problem so you know what you need rather than trying to think of everything first. Don't be afraid of re-factoring things later on, possibly multiple times as your understanding of things improves.
  2. You need to compare the values to what was submitted as you generate the options and add the selected attribute to the one they chose. So you'd end up with one of the options looking like: <option value="blah" selected>Blah</option> One method for accomplishing that would be to add a parameter to your getStates() function that indicates which item to select. Then when you call it pass in their post value.
  3. If you use it regularly, you should just wrap it up in a function that you can call. I used a function like this often in my earlier days. function dv(/*...*/){ if (!defined('ENABLE_DEBUG') || !ENABLE_DEBUG){ return; } echo '<pre>'; for ($i = 0, $len = func_num_args(); $i < $len; $i++){ var_dump(func_get_arg($i)); echo "\r\n"; } echo '</pre>'; } Then if I wanted to dump some variables I could just dv($_POST, $_GET); for example. The check for ENABLE_DEBUG is there so that if by chance any calls got left in the code they would do nothing on the production site as I only setup that constant on my development system. These days I just use Xdebug with breakpoints which is much nicer and easier. Xdebug will also change var_dump to be readable without the <pre> tags so such an extra functions isn't really necessary.
  4. Afaik, this is no longer an issue in any modern browser. This was an issue back the the old days, but was only an issue via implicit submit (via Enter in a text field). If you hit enter in a text field to submit the form some browsers would not include the submit button name/value where as others would. I forget which browser did which action. Fun fact, google actually used to detect if the button name was submitted and show a "Tip: You can just hit enter to search" bit on the results page. I believe old IE also had issues with <button> specifically, ignoring the value attribute and passing it's label content instead at times. As such, it was best to give the buttons different names and check for that instead of the values. These days however, there's no problem with just providing several buttons with the same name and different values. The browser will submit the value of the button you clicked on and you can detect that in your script just fine. If your form has other fields, then what happens on the implicit submit is now clearly defined in the spec.
  5. $('#sum').innerText That syntax mixes jQuery and plain Javascript which you cannot do. $('#sum') creates a jQuery object, but .innerText is a DOM property in plain javascript. The jQuery way to read/set the text value of an element is with the .text() method.
  6. To alias a directory you'd generally need something like this at least. Alias /want "C:/The/Directory/You/Want" <Directory "C:/The/Directory/You/Want"> Require all granted </Directory> Depending on what exactly you want you might need some more configuration options inside the <Directory> block, like Options +ExecCGI if you need to run PHP scripts using fast-cgi. $_SERVER['SERVER_ADDR"] represents apache's local address. If you want the address of the client connecting to the server you need $_SERVER['REMOTE_ADDR']. With regard to VPN's, that remote address will be the VPN exit server's public IP. There's no way to get the clients local pre-vpn IP (which is part of the reason people use VPNs these days).
  7. @Niksou, when you're posting code, do so as text not images. Copy your code then use the Code button (<>) in the editor to create a code block and paste your code there. If you don't post it as text, nobody can copy it to a file and test it in order to help you, so they will likely just skip your thread and you'll get no help at all. If you want to change your Add to Cart button to a quantity input then change the <button> tag to an <input> tag of type number. Add your new add to cart button where you want it. After that you'll have to figure out how to update the code that handles your cart to work with the new design. If you have a specific problem you are stuck on then post about it, but a post like "I want to do <some generic thing>" followed by a bunch of code is generally not well received.
  8. https://securitynews.sonicwall.com/xmlpost/thinkphp-remote-code-execution-rce-bug-is-actively-being-exploited/
  9. You could probably just simulate a click on the link to show the popup again. if ($login==='fail'){ echo '<script type="text/javascript"> jQuery(function(){ $(".open-popup").click(); }); </script> '; }
  10. Works just fine for me using those options. First, login and get the session setup. wget --load-cookies jar --save-cookies jar --keep-session-cookies --post-data='user=test&pass=example' https://example.com/login Then run the command to mirror the site. wget --load-cookies jar --save-cookies jar --keep-session-cookies -m https://example.com/ I setup a small script that requires a login session and re-generates the session ID on every page load to test those commands with. Had no problems fetching all the content. Keep in mind that if there are links on the page that trigger a logout, you need to avoid crawling those links or you'll loose your session. That might be the issue your running into. Resolve that using the --reject or --reject-regex option.
  11. Try looking into the --load-cookies, --save-cookies, and --keep-session-cookies options.
  12. You need to have the ID isolated in the html so it's easier to find and work with. Best way to do that is to add it as a data attribute like so echo "<div class='btn btn-primary m-1 tagInArticle' data-id='$pid'>$fn $ln</div>"; Notice I also removed the onclick. Rather than having every button define it's own click handler, you can use jQuery's event delegation to handle it. $('#searchResultsHere').on('click', '.tagInArticle', function tagInArticle(){ var tagButton = $(this); tagButton.appendTo('#taggedInArticleContainer') }); No need to even mess with the ID there now, you can just reference the button directly using this and move it. Now, when searching you just gather up all the IDs from the buttons in #taggedInArticleContainer and submit them with your request. $('#searchForPeopleBox').keyup(function(){ var searchVal = $(this).val() var tagged = $('#taggedInArticleContainer').find('.tagInArticle').map(function(){ return $(this).data('id'); }).get(); $.ajax({ type: 'post', data: {"ajax" : 'one', "val" : searchVal, exclude: tagged}, success: function(resp){ $('#searchResultsHere').html(resp) } }); }); Finally, update your PHP search to account for $_POST['exclude'] when performing a search.
  13. You'll have to do some debugging by var_dumping your values at various points and seeing what they are. Make sure your query is returning the data you think it is. You should also probably be zeroing out all your variables before the loop so they start fresh for each customer. Otherwise your previous customer's data will influence the next customers data.
  14. You don't have any input fields named 'submit', so $_POST['submit'] won't exist. Note: <form> tags are not inputs, giving them a name doesn't make them submit something.
  15. I would be using PDO with Exceptions.
×
×
  • 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.