Jump to content

Irate

Members
  • Posts

    354
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Irate

  1. I wouldn't ever validate any input with JavaScript... Any user with adequate knowledge can simply modify your script to allow quite a number of things, mostly things you don't want to appear. Solution. Parse the data server-side after being submitted, escape it properly and check for your words, if you found them, continue displaying them. Otherwise, echo an error message.
  2. Okay, consider this, then. $(function(){ var links = $('a[href^="/file_path/"]').get(), i = 0; for( i; i < links.length; i++ ) { var h = links[i], var t = h.getAttribute("href").replace("/file_path/","/file_open?aFile="); h.setAttribute("href",t); } });
  3. If you have a string containing more than 30 utf characters (you might want to be careful with character counting for special entities, such as the exponential e which's unicode representation consists of two sequences rather than one, which ultimately affects strlen), you can create a copy of the remaining string using substr, then append \n to the string (eventually \r\n for email bodies or whatever), and then concatenate the strings again. Just an idea.
  4. There are some interesting anecdotes on this found on the official manual page here, and it suggests you do not use gethostbyname in productive scripts. Otherwise, check against the first character of the return value. $host = gethostbyname("http://www.google.com");Edit: Code tag messed up.
  5. Revise the first code. String literals are never parsed as arrays. Use explode() to get an array out of a CSV-list.
  6. If you are using MySQL(i) Objects and are firing queries, you need to call mysqli::close() to release the memory it occupied once you are done with the query. That might be a cause of the problem. As for general memory space, I think that PHP has this feature named dynamic memory size, it creates and deletes memory space "on the fly", otherwise the whole principle of untyped variables would not quite work properly.
  7. Also, I want to point this out - there cannot be two documents with the same ID in one document. Your SQL query is also missing delimiting double quotes and a semi-colon at the end of the variable declaration.
  8. Which forum topic are we talking about?
  9. Did a bit of research on Google... try this. <?php ob_start(); include 'filetoinclude.php'; ob_end_clean(); ?> That way, you can prevent the file you're including to output data and still access the script usually.
  10. Use something like this... <?php $url = parse_url("www.domain.com/activate.php?id=7&ActivateCode=xajkdfjeklhwekjfhergh"); $query = $url[query]; $pair_match = explode("&",$query); # print_r($pair_match); $queries = array(); foreach($pair_match as $pair) { $queries[] = explode("=",$pair); } print_r($queries); ?> $queries[0] contains the first match, $queries[0][0] contains the first query, $queries[0][1] the value, and so on.
  11. Do you need to get margin and padding? If so, use clientHeight. Alternatively, try using the jQuery .scrollTop().top property. Just some ideas based on the OP.
  12. I guess I tried using the sqlite3 extension, though I am not sure if I needed to install anything else on my localhost or on my PHP host, seeing as I am very limited with time lately. Would PDO work without installing anything additional?
  13. Yeah, I was in a hurry to get this finished at school, I'll try better next time. However, both my localhost and my online host give me an error for an undefined function call whenever I try to use sqlite_open.
  14. Good, exactly what I was looking for. I will report back here if anything goes wrong. Kudos anyway.
  15. Generally everything, I have the components but I cannot quite properly figure out the format the file is in right now (I didn't write the file), I also never have used SQLite much... I excuse if this sounds a bit... illiterate, but I haven't been able to access the internet properly in the course of the last three days so I couldn't quite look up the documentation for it.
  16. Anywhere, but, have it be specific, into either a CSV or a new table on my XAMPP pMA.
  17. What address are you entering in your URL bar? You should only put in the new, rewritten URL, not the old one.
  18. The topic title says it all - I have a .┬ędb file (the c standing for cards, but that doesn't change the format) including a complex relationship of cards, their names and their associated images. It is written in SQLite 3 dialect, which I happen to have installed on my PC and also can get it working, but I cannot import the file and work it, somehow. How would I work on importing it? Thanks in advance for any support.
  19. Put this inside your .htaccess file. RewriteEngine On # only enter this if this line is not present already RewriteRule ^/works\.php\?(.*?)proj=(.*?)$ /works/$2
  20. He's even mentioning using Client-Side mechanics on another website, so the console is what came to my mind I do not think that it's useful, but it's still a possibility.
  21. Do you want to develop online? If so, your OS does not matter at all, it's probably just conventions you need to come up with - for example, I am using a school Mac right now with a Mac keyboard, and I find it quite unusual to type on it, I remember all they key codes but they're not even displayed on the keyboard. Another thing is the locations of z and y, like, Germany uses qwertz, America uses qwerty, and I always get those two confused when I'm out of country. If you are developing for operating systems like Windows, Linux, Ubuntu or MacOS, then I do actually recommend getting either Ubuntu or Linux, as those have the most support from developers for users (in my opinion, that is). Also, Linux comes along with integrated Perl support, so if you want to use Perl without having to download anything, go for that. In the end, it's all personal choice, and you are subject to your own preferences. I for example am so used to Windows systems that I wouldn't get anything else from Windows desktops.
  22. Technically he could run scripts on his console while visiting the site, which is what I explained in my second-to-last paragraph.
  23. Hm, okay, assuming you have your PHP code adjusted a bit already by adding an additional GET parameter (let's call it "p", for page). for(var i = 1; i <= 4; i++) { $.ajax({ url: "testmash.php?tag=<?php echo $ptag; ?>", data: "tag=<?php echo $ptag; ?>&id=<?php echo $id; ?>&p="+i // carry on with the rest... I'll get to explaining the PHP parts }); }So far the JavaScript (with a little support from PHP), for the PHP side, you need to check the directory of the file by doing something like readdir($dir), then do what you are trying to implement with your PHP right now (I cannot elaborate on what to do right now because you never actually posted your testmash.php, but that's okay - just look up the file functions PHP offers you).
  24. Look for VirtualBox by Oracle, that's the one I use.
×
×
  • 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.