Jump to content

MuseiKaze

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Everything posted by MuseiKaze

  1. In your Apache configurations remove "Indexes" from "Options Indexes FollowSymLinks", you can also set a .htaccess file to do this.
  2. I tend to use VPS servers for my hosting, less than $10 a month and u can fit multiple sites on them.
  3. Hey guys. Ive been working on a setup page which will install a few things and I've been having some problems with this function I created. It seems to print out under the <body> tag up the top even though I have it in a print statement inside a <div> tag. All of the text shows up where its ment to but the asterix's dont want to appear there. This is the function, its just ment to put an asterix where the password is. function asterix($pass){ $asterix = 0; $length = strlen($pass); while ($asterix < $length){ print '*'; $asterix++; } } I wont type the whole print statement cause its fairly big, but its pretty much like this. print '<div class="setup"><table><tr><td>Password: ' . asterix($_SESSION['password']) . '</td></tr></table></div>'; What am I missing that would cause it to not print in the right place? Thanks heaps
  4. After a bit of messing around I found a solution that lets me check every 1% by rounding down the percent to 0 decimal places and storing $percent in $interval if percent isnt equal to interval. Seems to work fine. Would still be interested to know if theres a function or other method that can use to do this though. $getpercent = (100 / $total) * $i; $percent = round($getpercent, 0); if ($percent != $interval) { $interval = $percent; print "$percent%"; }
  5. Hiya, im having a bit of trouble finding a solution to a problem im having. I have a program ive written and it prints out a percentage everytime it checks an item, but I need to reduce the amount of times it prints to the page because its causing some lag due to the number of items. Im using this to find the percentage completed $getpercent = (100 / $total) * $i; $percent = round($getpercent, 2); Is there any way I can use a statement to find out if the percentage is at an interval of say 5. So it would only print out at 5%,10%,15% etc.. Hope that makes sense. Thanks heaps
  6. I believe in linux you can use the chkconfig command to automatically start a service when it boots up.
  7. Thanks heaps. I just took that little section from another thread as an example.
  8. Sorry I wasnt sure what section to post this in. But Ive been looking all around and I havnt been able to find anything about this on tutorial sites and typing it in google produces no results. But I was just wondering what " -> " this is called and what it does? Eg "$params->Data = $texttofax . $finalitems;" I know its probably a simple question but I cant find a thing on it. Thanks.
  9. Hey guys, just though id introduce myself since I plan on staying a regular on this forum. Im 25, I come from a networking/security background, I am fluent with HTML and CSS, but the most programming id ever done was smaller batch/bash/vbs scripts for networks. Until just over 6 months ago when I decided I wanted to learn PHP. I enjoyed learning PHP so much that now Im doing paid work for friends and acquaintances. I plan on learning perl and C as well as PHP when I get enough time, so that I can gain programming experience in different languages. So PHP is for a better lack of words my introduction to programming. I have worked on several websites from forums, to stores and companies that host servers. I also run my own Australian Counter Strike gaming community with over 1000 members. Im in my final year of college now and im almost fully MCSE, CCNA and security+ certified and also going for my CEH and CISSP (Once I have enough work experience) certifications later on. Im also planning on doing a masters degree in information system security shortly after college so that I can work in the security field. I hope to learn alot from these forums and to perhaps eventually be able to provide others with help in learning PHP. Thanks
  10. Just tested it out this morning. Had to fix a few minor things to make it loop for each term but it worked out great. Thanks heaps.
  11. Thanks for your reply, ive tried both methods for counting the array, but they either only search for the first keyword in the array $search[0] or produce no results. Its really got me confused, I know its probably something small, but I just cant figure out what.
  12. Hello everyone, Im just wondering if someone could help me with another issue im having. Im still learning PHP and I have been for a few months now, but every now and then I get stuck on small things. I hope to become a regular here, but I know I cannot contribute much at the moment while im still learning. Hopefully once I know more I will try to contribute more. Anyways to my problem im having at the moment, im trying to search for a keyword, the keywords are stored in an array and also the strings that im searching through are exploded into an array for each line (each product is on a seperate line). Heres the main portion of the code which I need help with. $contents = /* csv file which is being read */ $arr = explode("\n",$contents); $search = array ( "ACCESS POINT", "AUDIO EQUIPMENT", "WEB CAMERA" ); $result = "results.csv"; $fh = fopen($result, 'wa') or die("can't open file"); if ($search) { $i = 0; $line = 1; while ($i <= count($search)) { if (strpos($arr[$line], $search[$i]) > 0) { $write = $arr[$line]; fwrite($fh, $write); } $line++; $i++; } } Ive altered it a bit to make it shorter but the part of it works when I have $search as a single keyword, however when I add the list of keywords into an array and count up using $search[$i] and $i++, it doesnt seem to search through the list of keywords for each line im searching through. Any help or advice would be appriciated. Thanks
  13. Hi there, im writing part of a code to replace certain parts of a string in a csv file. For example: I want something like this Product Name|Product ID|Price to look like this Product Name","Product ID","Price Ive tried using preg_replace and ereg_replace but I cant seem to get either of them to work. $replace = preg_replace("#|#","\",\"", $content); This is what I have so far, but this just adds "," between each letter. Could someone please explain the correct way which I can do this? Thanks heaps
  14. I dont have anything currently for the user list section currently, I did some experimenting with adding the usernames to a text file each time someone logs in and then deleting that username when they log out, but that didnt really turn out well =P Im still all new to php, so sorry if i dont explain myself heaps well. But I was thinking something like this could be used but im not sure how to store and split each $username = $_POST['username']; into an array. index.php <form action="chat.php" method="post"> <input name="username" type="text" size="25" maxlength="20"> <input value="Login" type="submit"></form> chat.php <?php session_start(); $username = $_POST['username']; $users = array('username[0]','username[1]','username[2]'); $_SESSION['users'] = $users; ?> users.php print $users;
  15. Hi there. Im pretty new to php and this forum, but I was just wondering if I could get some help with part of a chat room that im writing. Basically I have a form where users enter their usernames then I want to put each username into an array and use with a session onto another page where all the users can be echoed as a list. Is this possible? Thanks =)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.