-
Posts
131 -
Joined
-
Last visited
Never
About Claude 🤖
- Birthday 10/01/1981
Profile Information
-
Gender
Male
-
Location
Belgium
Claude 🤖's Achievements

Regular Member (3/5)
0
Reputation
-
Hello, I need to parse some html for validation. Not an entire html page but something like a "string" of html tags, don't know how to say it correct in english. Basically, I have this to parse (for example): <object width="100%" height="81"> <param value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F12483908" name="movie"> <param value="always" name="allowscriptaccess"> <embed width="100%" height="81" type="application/x-shockwave-flash" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F12483908" allowscriptaccess="always"> </object> I know it's possible in php, but don't know which function there is for this? Anyone? Thanks!
-
Hello, i'm trying to replace a br tag. I have this as code for the moment: var br = document.getElementsByName("br"); br.parentNode.replaceChild(document.createElement("p"), br); but I get this error: "br.parentNode is undefined" Someone knows what I'm doing wrong here? Thanks!
-
Hello, I have to make a JS script that will create the standard popup window for downloading a file (we all know that popup ). The popup window that will propose the download is already done, but now, is there a way to have a callback when the user actually clicks on OK? Thanks!
-
Hello, I'm working on a regular expression for a window.open() javascript function. This is what the string can have: This is what I already have for the check: window.open\(\'(\s)*((ht|f)tp(s?)://)[\p{L}\p{N}]+[~\p{L}\p{N}\p{Zs}\-_\.@#$%&;:,\?=/\+!]*(\s)*\'\,\''\,\''\);return false; This works for window.open('http://www.google.com','','');return false; But not yet for the other parameters, someone can help me further with this? Thanks!
-
I did some searching on Google and came up with: http://([\w-]+\.)+[\w-]+(/[\w- ./]*)+\.(?:gif|jpg|jpeg|png|bmp|GIF|JPEG|JPG|PNG|BMP|Gif|Jpg|Jpeg|Png|Bmp) Changed it to: this.src='http://([\w-]+\.)+[\w-]+(/[\w- ./]*)+\.(?:gif|jpg|jpeg|png|bmp|GIF|JPEG|JPG|PNG|BMP|Gif|Jpg|Jpeg|Png|Bmp)'; But it's not working Any ideas?
-
Well it should first start with a this.src=' the rest will be an url of an image that can have any extension, like in the url. Thanks.
-
Hello, I don't have much experience with regular expressions so bear with me . I need a regex for an onmouseover function in an image tag. the content will be something like this: Anyone knows? thanks!
-
Hi, I have in my DB a column with a timestamp as definition. Now I would like to have only the month and year of that column for further use in a form. How can I achieve that? Thanks!
-
Hi, I have a function that resides in a class, this function deletes a file in a specific folder. This works, the file is deleted but I get the warning that he can't find the file in the folder. So here's the error: And here's the code: Delete function: function remove_mp3_file(){ $target_path = dirname(__FILE__)."/player/songs/"; unlink($target_path.$this->filename); } function that calls the remove function: function remove_xml_item(){ //$this->open_xml_playlist(); $xml = new DOMDocument('1.0', 'UTF-8'); $xml->preserveWhiteSpace = false; $file = dirname(__FILE__)."/player/music.xml"; $xml->load($file); $xpath = new DOMXPath($xml); $query = '//song[title="'.htmlentities($this->title).'" and artist = "'.htmlentities($this->artist).'" ]'; $entries = $xpath->query( $query ); foreach( $entries as $entry ){ $entry->parentNode->removeChild($entry); } $savefile = $xml->save($file); $remove_file = $this->remove_mp3_file(); if( (!$savefile) && (!$remove_file) ){ return false; }elseif( ($savefile) && ($remove_file) ){ return true; } } First I thought that it was I set a variable that calls the delete function and then I use a if statement for this, but it wasn't that. Anyone an idea? Thanks!
-
XML create a tag element with attribute and give it a value.
Miko replied to Miko's topic in PHP Coding Help
Great! Thanks, it's working -
Hello, I have made a PHP script that will feed an existing XML file. The file stores song details like, title, name of singer etc ... Now the file structure is like this for the moment: <?xml version="1.0" encoding="UTF-8"?> <music> <song> <title>Without me</title> <artist>Eminem</artist> <url>songs/coreIssues.mp3</url> <image>img/den.jpg</image> <discspeed>11</discspeed> </song></music> But I need it to be: <?xml version="1.0" encoding="UTF-8"?> <music> <song mainTitle="Eminem - Without me"> <title>Without me</title> <artist>Eminem</artist> <url>songs/coreIssues.mp3</url> <image>img/den.jpg</image> <discspeed>11</discspeed> </song></music> I need it to be like that so if I want to delete a song from the list I just check for the element which will have a unique mainTitle and then delete that element with all it's details. Now, I've searched on Google for some solutions but didn't find any yet. Anyone here knows how to do this? Thanks!
-
Okay, it's working, thanks mate!
-
ow yeah, .. why didn't I think of that ... thanks
-
Hi, I can't believe after more then a year I'm stuck with the simplest upload script. Here's my code: <?php if( isset($_POST['upload']) ){ $uploaddir = "uploads/"; $uploadfile = $uploaddir.$_FILES['fileupload']['name']; if( move_uploaded_file($_FILES['fileupload']['tmp_name'], $uploadfile) ){ echo "Upload OK!"; }else{ echo "Upload FAILED!!!"; } }else{ ?> <form action="<?php $_SERVER['PHP_SELF'] ?>" name="upload" method="post"> <input type="file" name="fileupload" /> <input type="submit" name="upload" value="upload" /> </form> <?php } ?> this is the simplest php upload script that you can find, though the least secure one (it's for a local pc project). When I try to upload any file it gets to my else statement. Anyone an idea why? I don't see it Thanks!
-
never mind, I've entered the wrong filename ... D'oh!