Jump to content

TinyI

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by TinyI

  1. Hi, generally, as a rule, always make sure you filter any input, and escape any output. That rules out many problems you'll have security wise. Have regexes to look at things which are trying to break your SQLs such as sleeps or 'ORS' or 'UNIONS' etc. There is a distro of linux called Kali which is a pen-testing distro. It has tools ready installed. Obviously, your testing will only be as good as your knowledge of the tools to test it with. Please note, I personally haven't tried this myself, but had it recommended. Good luck.
  2. Look at the developers' guide on paypal's site. This gives you all the help you'd need to do this.
  3. Hi, There may be something deeper within your code that is causing the double/triple frames that needs to be refactored as that code which you have there its pretty standard and should work fine. Have a look for other causes in php. Possibly even looking at how each page's HTML is generated as that seems to be the true root cause.
  4. Hey, this means you have something like parenthesis or curly braces not closed in your file. It's just a case of going through whenever something is opened and making sure it's closed. It shouldn't take you too long to find, go through it a few lines at a time, where you made your changes.
  5. Hey, that generally means you could have a syntax or a fatal error. Have you turned error_reporting on? If you can post your code here, I can have a quick look and see if I can spot the problem for you.
  6. Two things you can try; Replace that echo with exit(header("location:http://www.urlofsitegoeshere.com")); or if that gives you an "headers already sent" error, then use $string = '<script type="text/javascript">'; $string .= 'window.location = "'http://www.urlgoeshere.../whereWeGo/'"'; $string .= '</script>'; echo $string;
  7. I think the email your sending out is what is possibly causing the "headers already sent" error. The other thing you could try is redirecting via javascript. Not as nice/easy, but it works. $string = '<script type="text/javascript">'; $string .= 'window.location = "'http://www.urlgoeshere.../whereWeGo/'"'; $string .= '</script>'; I've never really worked with captchas, so bringing the code local and doing some tests might be a lil annoying - but if you want me to try it out, I can if you help me set up the basic page of this.
  8. The $_REQUEST is actually a combination of $_GET and $_POST. I was always taught to use $_REQUEST instead. You saw how the url was passed into the page? Well it works just from that. It takes the id from the url. By the way, please, please, please make sure to run filters on that string. As of PHP5, we have filter functions. So use the filter functions for integers and when you've cleaned & validated it, then let it touch the database. If you need any more help, let me know. I can go through it with you.
  9. Hey, a few things I want to point out to you. Your password check is happening a bit too late. By that point, you've locked the table and that exit you have in your code will stop your code dead in its tracks, meaning the release will never happen and so you're a bit stuck! Rare that it will happen, but when it does, you'll be scratching your head for hours. Other thing I suggest is at the very least, change your functions to the MySQLi ones. MySQL functions are deprecated now so save yourself from headache. I'd personally say use something like PDO, as for a text-based game, it could be quite prone to attacks from wannabe hackers trying to learn something (talking from experience). As far as your scripts are concerned though, it seems fine. I would personally use a MySQL transaction as a bit of protection just in case something does mess up somewhere along the way for reason X,Y,Z, you can just do a rollback and throw an exception which notifies you. Better to be paranoid than having bad data.
  10. Hey, I'm assuming you mean when your user has logged in or click on a link, you want it to take them to their own specific member page? For the url, you'd need something like $url = 'member_page.php?member_id=${member_id}' Then, on the page, you'd need a $_REQUEST['member_id'] to grab that id and load their specific page. Hope this helps. If you need any clarification or if I assumed incorrectly, let me know.
  11. my bad! forgot the quotes! exit(header('location:http://www.google.com')); that should work. I've tested that just now on some code. Regards, TinyI
  12. I would use exit(header(location:http://pageurlgoeshere));
  13. Hey, inside your while loop, you need two switch statements to determine the colour. They will be pretty identical so I'll give you an example for you to change. // get colour from value switch($value) { case 0: // value goes after the case. so where I've put 0. You could even put words (make sure they're quoted). $colour = red; break; // after doing what you need to do in a case, always add a break. There are a few times where you won't, but you generally will. case 1: $colour = blue; break; default: // anything not covered above can be caught in the default $colour = black; break; } Hopefully this helps? If you need me to explain, just ask
  14. Hey, a few problems. Mostly, you're not closing tags. If you look around the <table> tag you have, you'll see that you opened up <tr>, but haven't closed it. Another problem - the php code you have running is outside of all the HTML - which is fine for processing any data from a form, but when you want to get data to display, you should always run the PHP first and write the php after, adding in PHP excerpts here and there. If you need me to go any further into this, message me and I'll go through it with you
  15. Hey, if you create the db object in your "main class", you could then just inject these into classes which need them when you initialize the object. I don't see why timestamps wouldn't be as accurate; don't these work depending on when the actual statement was ran?
  16. Hey, In your foreach, your pathinfo is still looking at $file instead of $SongPath, meaning you're still looking at the array rather than a string. Change your foreach to foreach($file AS $filename) { $SongPath = pathinfo($filename); }Then it should work as expected. Note that you don't need to change the whole foreach, you could just change pathinfo($file) to pathinfo($SongPath). I suggested changing the foreach just to name your variables a bit better. Why are you looping through it just to get a path and not doing any other code inside the foreach? You know that you'll only ever get the last element in the array? Unless that's your intended behaviour, you should look at maybe using something like pathinfo($file[0]) instead of foreaching if you only ever want the first one.
  17. Hey, You need to put that line inside the foreach you have so it becomes $ThisFileInfo = $getID3->analyze($Song);and remember to put that into the foreach. After you shuffle and look at $songs[0], chances are that's not actually the first one anymore. The best way to test what's actually happening is do a print_r on $songs before you shuffle, then after and put an exit in. That way, you can see if 0 is working in the way of looking at the first one or if it goes off somewhere else.
  18. Hey, I've just had a look in your settings_table.php file and at the select box code you have. Line 12: <option value="<php echo $line['table_number'];?>"> <?php echo $line['main_theme'];?> </option> After value=", you're missing the ? before php. So your value bit should be value="<?php ... instead of value="<php. Hope this helps and fixes you problem? If not, let me know.
  19. Vim for me. I started out using notepad++ (hated it). Moved to JEdit (loved it; but there was so much missing that I could probably have written plugins for in Java, but didn't have the time). Moved from JEdit to Eclipse (I initially loved Eclipse, but over time I've started to really just... want to write code and not be hampered by annoying IDE stuff and the bloat and everything just got on my nerves). The reason why I use vim is because of it's customisability. I was sat with a developer who used vim a long while back and was surprised at how many plugins they'd written themselves, and how easy it was to write a plugin too. Now I keep my vim folder under source control and have exactly the same vim wherever I go. I also never have to use a mouse again! CLI + Vim =
  20. Hi all, So, as you can see, I do php and comedy (skills lacking in the latter). I have been doing php for just under 2 years now; started a job doing IT Support, place had web developers, found my way onto that team within a month after throwing 2 phones out of the same window. My skills are pretty limited thanks to the code I've been exposed to (legacy system written procedurally with more and more added to the pot. Nothing was tested automatically, some files were over 14000 lines long with nobody daring to put it on a diet!) but I am looking to expand. I guess I really got into code when I attended the PHP NW 2013 conference (anybody who was there; I was the short round asian guy who always wore a black leather jacket and black "raiders" hat) and kind of had my eyes opened up to the real world of PHP. A little after that, I took the keynote's advice and left my job! hah. Outside of code, I game (like... most other people I've met), I watch quite a lot of wrestling (NWA/TNA PPVs and current TNA, ECW, WWF attitude era) and use lots of parenthesis. So yeah, thats TinyI(nsanity) in a nutshell. Thanks for reading (if you did read all the above, although I wouldn't blame anybody who dropped a "TL;DR" on this).
×
×
  • 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.