Jump to content

jaymc

Members
  • Posts

    1,521
  • Joined

  • Last visited

    Never

Everything posted by jaymc

  1. I use array_map on an array after doing that, using join() no longer works Im pretty sure its because the position of the array is at the end I tried to use reset() on the array but that did not work. Any ideas?
  2. I can apply validation easily by using array_map on $_POST and $_GET
  3. That was just an example, its not used for age
  4. Hmm, is there another option to do this altogether as htmlentities() will need to be added numerous times on over 500 pages....
  5. Yeh I was thinking that, however I have an issue with that too! If someone wanted to put this as there name I <3 cheese And the char limit in the database is 11 chars... after the < is converted to entity it will display as < Hence, I <3 cheese will not fit in the database Thats the only issue I have with entities, any more ideas?
  6. Ok, I found out how there where doing it.. Its odd they where getting cookie details as document.cookie etc will only return there cookie for the website they are on Hence.. they must have been injecting code on my website for it to execute www.website.com/page.php?username=john&age=<script url=www.external.com/java.js></script> Then on my page if I had echo $_GET['username'].$_GET['age'] There code was injected and executed! Ive got around this using strip_tags to kill all HTML and Java code etc.. Is this strong enough?
  7. How can I stop cookie spoofing? As in... using PHP's setcookie I set cookies to remember a users login.. However, for instance putting this into the address bar javascript:alert(document.cookie) reveals the cookie for the website they are on If someone uses http://tinyurl.com and sets up some code as demonstrated above, its not hard for them to get their cookie details and in turn login as them as they have their cookie info! How can I protect my self from this?
  8. Ok, I will put faith in the database Cheers
  9. yeh, but still, it accumulates 100,000's rows it doesnt make sense to me to have to query that table every time you flick between a page It will just hammer it Im talking about optimising here.. not standard ways for small bespoke applications
  10. the messages table has 500,000 rows of data, even with index.. if its getting hammered by 1000s of users id rather find another way..
  11. When someone sends someone else a message I want to flash a box saying new message However, I dont want to query the database every page refresh, I called SESSIONs on every page so it makes sense to manipulate them.. I need it this way
  12. You cant use those functions to read the raw php session file.. it contains etc bits Does anyone know of a function to perform this action
  13. session_decode doesnt appear to work. Checked into it and appears to be because of the use of a pipe | of which my session files have
  14. I need a function that can unserialize the contents of a session file so I can manually alter a value Then, I need to save the file This cant involve any session_start() etc as I dont want to over write the real session I would prefer to do it all raw Cheers
  15. jaymc

    float div

    Im creating my own google suggest however a bit stuck with css! To simplify, I have a div in the middle of a page Inside this div is a textbox. I want to float another div under this textbox starting from the 0 x cord of the textbox The floating div must over lap anything underneath. I dont want it to add to the overall height of the master div How can I do this?
  16. Can you actually just link it to se google lookups Im not talking about it quering my own database, I want a search box on my website to display relivent suggestions using googles "Google Suggest" system Any idea how?
  17. Im using youtube api to embed searches within my side A cool feature I want is when a user starts typing their search in the box, a list appears below it with suggestions Any idea how to achieve this?
  18. I have a birthdate field in my database which is stored as a unix timestamp Whats the best way in mysql to pull out all birthdays within the next 7 days Thanks!
  19. In javascript you cant call css elements with a dash e.g. background-color in javascript is backgroundColor I need to know what they are for a:link a:visited a:hover Thanks!
  20. I have 3x 10kRPM SCSI disks in a RAID 5 array I also have 1xSATA 7200RPM Can anyone think of why hdparm -tT on both drives results in the SATA drive being faster for buffered and cached reads?
  21. # EXPLAIN # id select_type table type possible_keys key key_len ref rows Extra # 1 SIMPLE c const PRIMARY,covering PRIMARY 27 const 1 USING temporary; USING filesort # 1 SIMPLE m const username_2 username_2 22 const 1 # 1 SIMPLE hc ALL PRIMARY NULL NULL NULL 19 # 1 SIMPLE t ref PRIMARY,category_id category_id 4 db_name.hc.id 121 # 1 SIMPLE p ref PRIMARY,category_id category_id 4 db_name.t.id 13 USING WHERE # 1 SIMPLE hs const PRIMARY PRIMARY 27 const 1 # 1 SIMPLE pt eq_ref PRIMARY PRIMARY 4 db_name.p.id 1
×
×
  • 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.