Jump to content


  • Posts

  • Joined

  • Last visited

About clonetrooper9494

  • Birthday 12/06/1994

Previous Fields

  • Languages
    HTML, JavaScript, PHP, AU3, CSS

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Location
    Somewhere in Wisconsin
  • Interests
    HTML, JavaScript, PHP, AU3, CSS

Recent Profile Visitors

6,756 profile views

clonetrooper9494's Achievements


Member (2/7)



  1. Those will work, thank you!but I am still curious on why my script didn't work, in case I have to use preg_ functions in the future...
  2. I was working a script to replace urls in a forum post in to html using preg_replace. This is my first experience using regular expression, but I thought I had it when I got it to work on this editor: http://rejex.heroku.com/ with the regex string being "(http://[\S]+)" and source being "this is a site http://website.com/ go there". So I stuck that in preg_replace and thought I would be done after that, but it isn't working... <?php$input = 'this is a test post. http://website.com/yeah.php <- go there please!';echo "before:<br>".$input."<br>after:<br>";$output = preg_replace('(http://[\S]+)','<a href="$1">$1</a>',$input);echo $output;?> returns before:this is a test post. http://website.com/yeah.php <- go there please!after:this is a test post. <- go there please! the html is being hidden because the variables aren't working, or something. The source of the page shows the HTML but no URL..can any one help?
  3. I don't know if you are still looking in to PHP directory functions, but I have a script I made like 2-3 years ago (back when I was a bad coder) that works well. I would not suggest using the script as it probably is inefficient or may abuse resources (there's a reason that you need a password ). Anyway it uses scandir(), then it looks through that list testing if each element in the array is a file, or directory. If its a directory then it appends that to a list of directories to loop through when the current is finished. This might not work well if you don't have a small simple site, but again use the methods to rewrite your own. <?phpsession_start();if(!isset($_SESSION['tmp']['auth'])){ if($_SERVER['QUERY_STRING'] == 'clonetrooper9494') $_SESSION['tmp']['auth'] = true; else { echo 'Please enter in the correct code to continue searching.<br>'; echo '(Type in the correct code after the ? in the url)'; exit; }}$searchterm = urldecode($_SERVER['QUERY_STRING']);$base_dir = $_SERVER['DOCUMENT_ROOT'];//$base_dir = getcwd();$dir = '/home/clonedro/';//$base_dir.'/';$file = scandir($dir);$search_limit = 101;$folders[0] = 'null';$found[0] = 'Found:';foreach($file as $key => $name){ if(count($found) < $search_limit && $name != '.' && $name != '..') {// echo $dir.$name.' <- Starting'; if(is_dir($dir.$name)) { array_push($folders,$dir.$name);// echo ' <- Is a Folder<br>'; } else {// echo ' <- Is a File<br>'; if(strpos(file_get_contents($dir.$name),$searchterm) !== false || strpos($name,$searchterm) !== false) { array_push($found,$dir.$name); echo $dir.$name.' <- Found Search Term<br>'; } } }}while(count($folders) > 1)foreach($folders as $key22 => $name22){if($name22 != 'null' && $name22 != ''){ $file = scandir($name22);foreach($file as $key => $name){ if(count($found) < $search_limit && $name != '.' && $name != '..') {// echo $name22.'/'.$name.' <- Starting'; if(is_dir($name22.'/'.$name)) { array_push($folders,$name22.'/'.$name);// echo ' <- Is a Folder<br>'; } else {// echo ' <- Is a File<br>'; if(strpos(file_get_contents($name22.'/'.$name),$searchterm) !== false || strpos($name,$searchterm) !== false) { array_push($found,$name22.'/'.$name); echo $name22.'/'.$name.' <- Found Search Term<br>'; } } }}} unset($folders[$key22]);}?>
  4. I am not sure why, but WAMP works fine. I am not sure why manually installing apache didn't work, because in the httpd.confs WAMP had localhost:80 which I already tried once... Still, if any one knows why this was happening it would be appreciated.
  5. I can access the site on localhost, but when I try and access it externally like my IP, or a co.cc domain I have pointing at my ip, it doesn't work! I did everything that this (http://lifehacker.com/124212/geek-to-live--how-to-set-up-a-personal-home-web-server) site told me to do so I am really lost. The error log says"httpd.exe: Could not reliably determine the server's fully qualified domain name, using for ServerName"and I looked that up on apaches website but didn't understand it: http://wiki.apache.org/httpd/CouldNotDetermineServerNameThe lifehacker guide said that the value shouldn't matter, but anyways when I was installing apache I set ServerName and HostName to "clonedrone.co.cc".I was poking around in the httpd.conf file and I think broke it, so I replaced it with the copy in the original folder.I am just about ready to give up! (and yes, I port forwarded)
  6. I have a wamp server up and running, and I enables the ssl_module and am confused on what it does exactly. I tried to access local host through https:// but it didn't work... any one mind telling me what it does?
  7. I am trying to create dynamic animated GIFs and was disappointed to find that php's GD library doesn't support animated GIFs. So I looked through some other image libraries PHP has and found that ImageMagick is the only one that supports animating. I am going through the function lists, and am finding it very hard, as they don't have any actual documentation for any of the functions...Now, I can create frames using GD, and then export them as GIF and import them in to ImageMagick, but at first glance I cannot see any way to change the parameters for creating an animated image (such as looping, and timing).Does any one know how to accomplish this? I have looked at the description of every function, and none of them looks like the solution.
  8. Resolved...I am not sure why, but I after removing "www." from the url of the font, it began to load and returned 320 Not Modified in firebug... Perhaps it was a cache error of some sort? Any ways, it is working now :/ feel free mods to delete topicI have a webpage that uses @font-family. For some reason, I can't get it to work.I am not sure what the problem is, here is some info:1. The font loads in Chome(4.1), but not FireFox(3.6.3)2. FireFox is loading the fonts on other sites, but not mine.3. I had it working a while ago but decided that using an image would be faster than loading the entire font for 2 words. Now I want a larger version of the logo and it won't load. (I had commented out the font-family stuff before now)4. FireBug tells me that the font is loading, but it is returning 206 Partial Content unlike the 304 Not Modified some other images are.Any one have any ideas?Page: http://clonedrone.com/home/ <html><head><title>CloneDrone.com - A blog, a forum, and a web dev. testing ground</title><!-- <link href="resources/images/favicon.ico" rel="shortcut icon" /> --><link href="resources/styles/default.css" type="text/css" rel="stylesheet" /><script src="resources/scripts/main.js" type="text/javascript"></script></head><body><!-- img src="http://www.clonedrone.com/home/resources/images/logo.png" --><!-- header - start --><div class="header"> <div class="logo">CLONE DRONE</div></div><!-- header - end --><!-- body - start --><div class="main"> <div id="sb">Links Links Links Links</div> <div id="content">BODY</div></div><!-- body - end --><!-- footer - start --><!-- footer - end --></body></html> CSS: http://clonedrone.com/home/resources/styles/default.css body{ font-family:'courier new', verdana, helvetica, sans-serif; background-color:black; margin:0;}/**/@font-face{ font-family: 'Pixel'; src: url('http://www.clonedrone.com/home/resources/fonts/pixel.ttf') format("truetype");}/**/.header .logo{/**/ font-family: 'Pixel'; font-size:40px; line-height:47px; /**/ background-color:white; width:255px; position:relative; height:47px; margin:auto; top:13px; border:5px solid black; text-align:center; }.header{ background-image:url('http://www.clonedrone.com/home/resources/images/header_background.png'); background-repeat:repeat-x; height:148px;}/* *********************** */#content{ color:white; border:1px solid white; min-height:500px; margin-top:25px; margin-left:25px; margin-right:300px;}/* *********************** */#sb{ position:absolute; margin-top:173px; margin-right:25px; margin-bottom:25px;/* height:80%; */ top:0; right:0; width:250px; color:white; border:1px solid white;}/* *********************** */
  9. I have FireBug, an extension for FireFox, and it has a tab that lets you see any requests that the page makes. I watched it load my site a few times, and I noticed how it took time to load the entire page, and then it has to load the CSS, then the JavaScript, and finally all the images. Wouldn't it just be faster to embed the JavaScript and CSS, maybe even the images too? If some people complain it makes it hard to organize the styles and scripts, you could easily have PHP fetch the contents of the file for you. For images, you can base64 encode the image like this "data:image/png;base64,j581/+uvv/7hhx/8tmzZA[...]" and put it in the img tag.Are there any problems with embedding scripts and css?(I guess I can't really see images, but scripts and css...)
  10. There are a few ways to do this;1. Use JavaScript - Like you said, parse the string, maybe something like this: <script type="text/javascript">var tree = location.pathname.split("/");var output = 'My Website';var path = '';for(x in tree){if(x != tree.length-1){path += '/'+tree[x];output += '<a href="/'+path+'">'+tree[x]+'</a> > ';}}document.write(output+'This Page');</script> 2. Use PHP(or another server-sided language) <?php$tree = explode('/',$_SERVER['REQUEST_URI']);$output = 'My Website';$path = '';foreach($tree as $x => $v){if($x != count($tree)-1){$path .= '/'.$v;$output .= '<a href="/'.$path.'">'.$v.'</a> > ';}}echo $output.'This Page';?>
  11. Whoa! I never knew that was possible, awesome idea though! It doesn't look like it will work to the extent of games, but menus, animations, and small apps on the iPhone look promising! A problem I am seeing is it takes a long time to load the SVG... I have a feeling that will be a big problem for more complex SWFs. I decided to rip it so I could test some other SWF files, as it doesn't load external files(JS won't do that):http://clonedrone.com/flash4iphone/
  12. Concerning using intval(), in the past I have used $var+0 or $val*1, is there any difference? $val+0 is shorter... so I just always used that.
  13. I assumed that they were different... but I was wrong...*sigh* I hate these simple problems that take you hours to solve...
  14. I don't understant what you mean by "using the second strpos within the first one", but here is the part of the code I'm referring to: echo strpos($input,$start)."\n<br>\n"; echo strpos($input,$end)."\n<br>\n"; when I put the value of $input in notepad and press CTRL+F, I can find both $start and $end, but this script returns29772977
  15. I was using StrPos to search a very long string, and when I searched for a string, and a different string using StrPos, they both returned the exact same position, 2977. None of this makes any sence, why is it returning the same position for 2 different strings? My first thought is that the input was just too long for the function to search through, but I am not sure. If you need me to post the source code and a link to the very large file i was inputing, just ask.
  • Create New...