Search results

  1. marshian

    Redirect when sql server fails

    This is how I do it. I've created a separate file to connect to the mysql database, so on any page I want to connect to the server I just include that script (in my case "conf/mysql_connect.php"). The error page is "error/database.php". As long as you use this script before any output it's...
  2. marshian

    SQL injection?

    Hmm, ok, but that still leaves ` ; and #, and those are only examples, there's more where that came from. But indeed, single quotes are important. But then, returning to the original question, it's again easy to abuse it: magic quotes doesn't do it SQL-style. If you use a magic-quoted string in...
  3. marshian

    SQL injection?

    http://be2.php.net/magic_quotes @Twinkie: Using magic quotes can cause a problem in some contexts. You might want to store data as it is given, not with quotes escaped. Therefore, it's possible the programmer unescapes toe quotes in order to use them, rendering magic quotes a waste of time...
  4. marshian

    PHP and leading zeroes mindtrick

    PHP doesn't dislike leading zeroes, leading zeroes mean something =P I have a test for you, try the following script before you read on: <?php header("Content-type: text/plain"); $one = 001; $eight = 010; echo $one * $eight; ?> Do you know now? ----------------------- A leading zero means the...
  5. marshian

    .SWF Video Upload System

    You need a standard upload form to upload swf files (Google php file upload), and combine it with some other php to view/search/edit/list the videos. Nothing really difficult. Notice though that there is a maximum upload limit, usually 2 MB. If a user would want to upload a file larger than...
  6. marshian

    SQL injection?

    Yes, that code cannot create a query with any values different than legit ones. Very good :) Make sure your search function is as safe as this one and you'll be sql-injection-free.
  7. marshian

    php include - above root directory

    I lol'd :p If you want to "secure" a script, don't put it in public_html at all, you can put it even higher than that. (eg. make a directory nonpublic_html) As vishal2 (finally) noticed in the end, you can use absolute paths ("/home/username/public_html/script.php" for example), or perhaps...
  8. marshian

    SQL injection?

    I tried a couple of possible exploits, but I don't think any of them worked (however, I could be wrong too). What you should pay attention for sql injections to is every variable that goes in your query. For example with the order by: if $_GET["o"] is not equal to "asc" or "desc", don't use the...
  9. marshian

    Unclickable Links

    Both problematic elements are already positioned relative ;p
  10. marshian

    Unclickable Links

    The "Announcement" div is in front of the "OtherAnnouncements" one. Therefore, you're actually clicking the wrong element. Give "OtherAnnouncements" a z-index of 2 and "Announcement" a z-index of 1 and it works.
  11. marshian

    Javascript/DHTML help

    It has to do with variables being global or not, but that's not exactly very readable, nor useful... I *think* something like this should work: var foo; function one(bar) { foo = bar; } function two() { alert(foo); } Notice the "var foo" in the global scope, and no "var foo" definitions...
  12. marshian

    Javascript/DHTML help

    About function bold(): Check out this page: http://www.w3schools.com/Css/pr_font_weight.asp Instead of font-weight, it should be fontWeight. Secondly, getElementByClass doesn't exist. There is no actual function build-in to do this afaik, but you can write one yourself quite easily. You can...
  13. marshian

    javascript redirect to main page if subpage called directly

    If you only need the JS redirect to get search engines to index those pages, it might be a good idea to make those pages valid as well. Search engines usually aren't very smart and just follow the html tree in order to index a page. My suggestion would be, if !isset($_GET['IwasCalledFromMain']...
  14. marshian

    javascript redirect to main page if subpage called directly

    You can use header("Location: http://yourdomain.com/main.php");to redirect people from one page to another. If you only want that to happen when $_GET["page"] is set, do this: if(isset($_GET["page"])) { header("Location: http://yourdomain.com/main.php"); } I wouldn't say any JavaScript...
  15. marshian

    Problem with menubar when viewed in IE

    Actually I'm using Firefox on Linux. No problem using Chromium. Slightly sticking out using Opera too.
  16. marshian

    Problem with menubar when viewed in IE

    Could you get us some screenshots? Some people (including me) don't have it, or don't want to do the effort of changing OS to use it :p And by the way, the search text field sticks out a lot on the right side.
  17. marshian

    Applet loads but is hidden in Firefox

    Ooh, I didn't realise he already fixed it x) Adding body :nth-child(2) { position: absolute; } Moved a couple of elements, causing a few graphical glitches to appear in the game area, but the applet remains visible at all times.
  18. marshian

    Html Editing

    You could try the Firebug add-on for Firefox.
  19. marshian

    Applet loads but is hidden in Firefox

    I have a problem with your problem. The problem is, I don't have the problem! Using Firefox 3.5.6 on Ubuntu 9.10, the applet displays just fine. That makes it obvious it's a browser bug, and specific to your version or operating system. If I were you I'd file a bug report with Mozilla, in order...
  20. marshian

    Preload background image

    Why on earth would you want to do that? I'll give you two possible solutions: 1. If you have an "enter" page, you could trigger loading the background image there. Code usable to "preload" an image on another page could be as follows: <img src="my_image.jpg" style="display: none;"> 2. Create a...
Top