Tag Archives: dom

DNS Redirect domain to subdomain [closed]

Questions: I am looking for a way to redirect a domain to its subdomain via DNS a / cname records. Is it possible to have these examples done totally in DNS, I know it can be easily done with .htaccess and PHP. website.com => blog.website.com website.com/hello => blog.website.com/hello www.website.com => blog.website.com www.website.com/hello => blog.website.com/hello Any… Read More »

php domdocument read element inner text

Questions: I’m new to php so please forgive the simple question: How do I extract the text from an element? <span id=”myElement”>Some text I want to read</span> I have this for a start: <?php $data = $dom->getElementById(“myElement”); $html = $dom->saveHTML($data); But then? What is the correct instruction? Answers:

How to use jQuery AJAX for an outside domain?

Questions: I am trying to perform a simple jQuery AJAX attempt using either a .get() or a .post(). If I have a local copy on my server and do: $.get(‘/hash.php’,…,…) I monitor in my console in firebug that the get is done and I get a response. All I change is the URI to an… Read More »

Same domain, different folder PHP session

Questions: I want to set a different session ID depending on what folder a user is in. For example, I have the domain https://example.com which has the folders /app1, /app2, etc. and then multiple files inside each app folder. I would like to set one session ID to be used with all files in app1… Read More »

How to sort a xml file using DOM

Questions: I have a xml file structured like <?xml version=”1.0″?> <library> <book id=”1003″> <title>Jquery MVC</title> <author>Me</author> <price>500</price> </book> <book id=”1001″> <title>Php</title> <author>Me</author> <price>600</price> </book> <book id=”1002″> <title>Where to use IFrame</title> <author>Me</author> <price>300</price> </book> </library> In order to sort this xml according to the book id, after reviewing this method from stackoverflow i coded like this… Read More »