Jump to content

djp1988

Members
  • Content count

    539
  • Joined

  • Last visited

Community Reputation

1 Neutral

About djp1988

  • Rank
    Lonely developer
  • Birthday 05/30/1988

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Location
    London, UK

Previous Fields

  • Languages
    JavaScript, PHP, ActionScript, Objective-C, C, MySQL, SQLite
  1. djp1988

    Multiple UL's bullet style

    I have two UL lists one inside another, and the default li style is just rounded black for the first list and hollow black for the second, how can i force the child list to retain solid black dots as their style ?Thanks <ul> <li>item 1</li> <li>item 2 <ul> <li>item 2 a</li> <li>item 2b</li> </ul> </li></ul>
  2. djp1988

    RewriteRule fail

    Hello, I've been playing around with my server and just noticed an older project has stopped working, I've tracked the error down to a line in my .htaccess file. RewriteRule ^info/([0-9]+)/([0-9]+)/([0-9]+)/ getInfo.php?year=$1&month=$2&day=$3 [QSA] This throws a Forbidden error: You don't have permission to access /site/getInfo.php on this server.The curious thing is I tried changing that line to point to a html document, and there were not errors, what in my configuration could be causing this to be wrong for php files and not html files ?
  3. djp1988

    IE floating and clearing

    Hello,I've ran into the most curious of problems.I have a site set up with three floating blocks, one left menu, a right menu, and a center block for the content.The left block and center blocks float left and the right block floats right.the order in html of these blocks is: <div id="left_block"></div><div id="right_block"></div><div id="center_block"></div> What is happening is that clicking a link to a page on the site makes IE 7 display the central block down the page, as if it's clearing the float right. But here's the curious thing, if i click the browsers refresh button, the page reloads and appears correctly. Every time I do that it works, but clicking a link will make it show the central block under the right block, as if maybe it's too large for the available space...Has anyone head of this kind of behavior from IE before?
  4. djp1988

    Stretch height to fill void

    Thanks for the suggestions chaps, what I've found that works well is setting the list to position absolute, and having its top to the combined heights of the above elements, and bottom set to 0, which stretched the height to fill the parents height minus the top elements
  5. djp1988

    Stretch height to fill void

    I have an element with a fixed height. Inside this I have a form, a h3 element and then a ul list.The ul list has the CSS property overflow-y set to scroll. So I have a scroll bar.I would like to make the height of the list to fill up what's left of the height of the parent element. I can't set the height to 100% because it will equal the parent's height, and push out of the parents boundary as I have a form and h3 element above the list.What can I do to make the list stretch only to the available space left in the parent element ?
  6. djp1988

    Resize window

    Hi guys, I'm working on a IM chat system, I've got a page devoted to it, so it's sort of like a pop up but I'm trying to avoid using a pop up window because the user may have a setting blocking pop ups.So what I've done so far is open a new page in a new window and I'm using window.resize(w, h) to resize the window to my desired size.But this as the method states, resizes the window, and so takes into account menu bars/ status bars etc which I cannot account for.So has anyone ran into this problem and have a work around, or should I just revert to a traditional pop up from which I can control these parameters.Your ideas will be interesting,Thanks.
  7. djp1988

    Encoding video

    Hello guys !I need to encode video uploads sent to my server to make them .flvI have been doing research for a few days and haven't found anything of much help, a lot of reading about ffmpeg and it's php extension etc...I even got as far as finding a script that converts videos, but it's using something called flvtool2 which requires Ruby.Is there a PHP only solution to this and if so, or if not, what should I be doing? I've tried all sorts but I'm getting very frustrated now, so hopefully someone can give me hope !Thanks,Daniel
  8. I need to have a pop up window, and I'm going to be doing some stuff in that, and hopefully setting some session variables in php within that window, but when I'm done, I need the main window to refresh to take into account the new session variables, can I do this ?
  9. djp1988

    array_map on objects

    I have an array of objects, each object has an id property. I need to get an object from the array based on the id property.using array_map, I usually do the following: $looking_for_object_id = 3;$ids = array_map(create_function('$a','return $a->id;'),$my_array);$key = array_search($looking_for_object_id, $ids);if($key !== false){$my_obj = $my_array[$key];} How could I simplify this ? I would have prefered doing something like: $my_obj = array_map(create_function('$a','if($the_id == $a->id) return $a;'),$my_array); but obviously I get an error because $the_id is from outside the function
  10. djp1988

    php security

    if you don't use strip_tags then someone one could insert malicious code into your page, for example, someone could add a script tag and import an external javascript file that might gather cookie information from the user.Sometimes you want to allow basic formatting, and let your user feel more advanced if he/she wishes to, so you can allow certain tags for example the following code would strip all tags except the strong and em tags. $txt = strip_tags($input, '<strong><em>'); If by the following quote you meant you want to allow users to type code and for that code to be displayed and not become part of the actual HTML, then you should look at PHP's htmlspecialchars function
  11. djp1988

    PHP DOM

    Ah great thanks, that does the trick.
  12. djp1988

    PHP DOM

    Hi,It seems it is outputting <br /> but in Safari's web inspector is was showing the following:But in the source code if I look at the raw code it show me:But this now prompts another question, I only want the ul node and it's children, why have I got the <?xml version="1.0"?> tag ? Can I just get the ul node from my code ?My code is: if(count($submenu_items) > 0){ $dom = new DOMDocument(); $ul_list = $dom->createElement('ul'); foreach($submenu_items as $b){ $li = $dom->createElement('li'); $a = $dom->createElement('a'); $a->setAttribute('href',$b['link']); $a->appendChild($dom->createTextNode($b['name'])); $li->appendChild($a); $br = $dom->createElement('br'); $li->appendChild($br); $ul_list->appendChild($li); } $dom->appendChild($ul_list); $submenu_markup = $dom->saveXML(); }
  13. djp1988

    PHP DOM

    But I have a br element tag in my DOM, which is empty, when I call saveXML() the output is <br> and not <br /> this is the problem I'm trying to see how I can fix.
  14. djp1988

    PHP DOM

    So to tie things up the comment made in this blog post towards the end of the article concerning self-closing tags is actually nonsense ?http://www.ultramegatech.com/blog/2009/07/...ocument-in-php/
  15. djp1988

    PHP DOM

    I thought DOMDocument produced an entire tree node, I've just realised that my output for it is actually only the fragment I wanted, XMLWriter looks quite good, but I am unsure about all the endElement() calls I need to make, that's becoming similar in a way to manually appending html to a string.I did find a class someone wrote for this exact problem, here's the link to that. http://davidwalsh.name/create-html-element...mlelement-classI think I will just stick to DOMDocument, for a moment I though of DOM-enizing the class on the link and naming that class DOM, that would have felt quite native !One issue I am having with DOMDocument is that it doesn't seem to be applying correct output for self-closing tags. I am trying saveXML() and saveHTML()I find this strange because a blog post I saw specifically said to use saveXML() to get self-closing tags, maybe I'm not getting this because I'm not creating an entire DOM tree of elements ? And therefore the saveXML() method doesn't have any DTD to go on ?
×