Jump to content

sKunKbad

Members
  • Posts

    1,832
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by sKunKbad

  1. Right now I have my WAMP (wampserver2) set up so that it uses .htaccess and .htpasswd files. The .htpasswd files contain username:password combinations, but unlike all hosts that I have dealt with in the past, my passwords aren't encrypted. I want to use the standard crypt() encryption option for passwords, but I don't see a place in the httpd.conf file to set this, and don't know what to do from here. Any help is appreciated.
  2. OK, I figured out that if my raw password is in the .htpasswd file it will work. How do I make apache check for an encrypted password?
  3. I've tried going in to my httpd.conf file and changing the AllowOverride to All in a couple places. I'm checking to see if everything is working fine, and when I try to access a protected folder, I am prompted for a username and password, but when I enter them it asks me for them again as if they were wrong. For testing purposes I used "username" and "password" (username:MQGO990.8Fl.c) in the .htpassword file, and I have the .htaccess set like so: AuthUserFile C:\wamp\www\siteOne\.htpasswd AuthName "Confidential" AuthType Basic require valid-user What am I missing? The error log says: [Tue Jan 01 22:19:55 2008] [error] [client 127.0.0.1] user username: authentication failure for "/siteOne/confidential/index.php": Password Mismatch
  4. sKunKbad

    .htaccess

    well, I'm no Apache guru, but I think that the .htaccess files have to be "turned on" in the httpd.conf, so in that regard localhost may not be like your real web host. see http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride
  5. stay at 100% of what? height?
  6. sKunKbad

    .htaccess

    if you want it to work on your localhost, then you will probably have to modify the httpd.conf file.
  7. sKunKbad

    .htaccess

    I modified it, go up and see. No, it isn't the php.ini. You would create a file called .htaccess and upload it to your root directory (assuming Apache is running on your server).
  8. sKunKbad

    .htaccess

    I think you would do something like this: <Location /yourFolderName/> deny from all </Location>
  9. try this too: TEXT FILE NAMED html_parse_4_links.txt: what the heck <div id='somediv'>im ready for a big glass of coke</div> blah blah blah PHP FILE NAMED html_parse_4_links.php: <html> <head> <style type="text/css"> #editbox { width:500px; height:200px; } </style> </head> <body> <?php if ($_GET['editbox'] != ""){ //if the editbox has anything in it $filename = 'html_parse_4_links.txt'; //this is the file to write to $edit = $_GET['editbox']; //this is the contents of the editbox $before = $_GET['before']; $after = $_GET['after']; $somecontent = urldecode($before); $somecontent.= "<div id='somediv'>"; $somecontent.= $edit; $somecontent.= "</div>"; $somecontent.= urldecode($after); // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In the example, they were opening $filename in append mode "a", but here we are overwriting the file in mode "w". //"a" mode might be pretty cool for a appending a blog with a user comment... if (!$handle = fopen($filename, 'w')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } }else{ $url = "html_parse_4_links.txt"; $input = @file_get_contents($url) or die('Could not access file: $url'); $regexp = "(.*)<div id='somediv'>(.*)<\/div>(.*)"; if(preg_match_all("/$regexp/si", $input, $matches)) { $beforeEdit = urlencode($matches[1][0]); $string = $matches[2][0]; $theEdit = htmlentities($string); $afterEdit = urlencode($matches[3][0]); echo "<form action='html_parse_4_links.php' method='get'> <input type='text' name='editbox' id='editbox' value='$theEdit'></input> <input type='hidden' name='before' value='$beforeEdit'></input> <input type='hidden' name='after' value='$afterEdit'></input> <input type='submit' value='Save Back 2 File' /> </form>"; } } ?> </body> </html> All you would have to do is modify the code slightly.
  10. try reading this: http://www.sitecritic.net/articleDetail.php?id=188
  11. For me I use cURL only for posting form data to processing scripts and online databases. I know there are other uses for it, but I wouldn't use it for a redirect. I think using the header() method is the standard.
  12. Search around for pagination classes. I'm not talking about tutorials, I'm talking about OOP. The work has been done, so don't re-invent the wheel.
  13. I hate domain issues like that. I recently had an issue with an AJAX request that was trying to open a file, and it not working because www and non-www are treated as separate domains.
  14. you could try the php function strtolower()
  15. For as long as I can remember, I always had a hard time parsing XML in php4. In fact, it was so hard for me, I'd tell people that if they didn't have php5 I wouldn't even attempt to help them. Then I found a parsing class that works almost identically to SimpleXML, but for php4. http://www.criticaldevelopment.net/xml/doc.php You may also find a parsing class that works well for you, but this is the one I liked best after trying out a few.
  16. This is a huge topic. I suggest reading some php books. Almost all php books include a section on security.
  17. Typecast everything. If your input expects a string, typecast it to a string, and so on. If you have forms where input is boolean, or dropdown boxes / radio buttons specify choices, make sure that the choices are the only choices accepted by the processing script.
  18. use an equals sign instead of a colon
  19. Revraz, you might ask one of these users to check their cookie permissions and see what the default is showing. I am interested to know what they say. It would seem extreme that Microsoft would do this because cookie use is so widespread. The users of these machines would be very limited to how they see and use the internet. Just another reason not to get Vista!
  20. Sessions are handled server side, but the session ID "PHPSESSID" is a cookie. If Vista/IE7 has its default cookie permissions set to not allow cookies then it could be a problem.
  21. MadTechie is right about appending the GET to the URL in the CURLOPT_URL. In your initial post you said:
  22. I have used cURL to post to different pages in 2 projects in the past. Post fields are added to a cURL post as follows: curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, array('name'=>'skunkbad', 'lastname'=>'stinky', 'job'=>'yes', 'age'=>"$age", 'city'=>'Temecula', 'state'=>'California', 'country'=>'USA')); That's all there is to it. If it's not working, then it is something else.
  23. Try removing: curl_setopt($ch, CURLOPT_FTPAPPEND, 1); and curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable and echo $result; Normally if you want to just echo the result like you are doing, returntransfer is not needed because this is the default action of cURL.
  24. There are lots of variations of how to derive the answer. I think this flexibility in php is what makes it so easy to learn. Take these other solutions for example: <?php echo "<br>"; $string = 'There was a dog who was blue'; $word = 'was'; $offset = strpos($string,$word); $secondPos = strpos($string,$word,$offset+1)+1; echo "The second position of the word \"$word\" in the string \"$string\" is at character number $secondPos."; ?> <?php echo "<br>"; $string = "There was a dog who was blue"; $revstring = strrev($string); $needle = "was"; $revneedle = strrev($needle); $pos_las = strlen($string) - strpos($revstring,$revneedle) - strlen($needle) +1; echo "The last position of \"". strrev($needle) ."\" in the string \"$string\" is at character number $pos_las"; ?>
  25. Your output needs to be inside your loop, like this: $myquery = mysql_query("select * from MYSQLDB"); while($row = mysql_fetch_array($myquery)){ extract($row); echo"<table border='0' cellspacing='0' cellpadding='3'> <tr> <td width='77%'><font face='Arial, Helvetica, sans-serif' size='2'>$name</font></td> <td width='23%'><img src='status.php?link=$url' width='37' height='20'></td> </tr>"; }
×
×
  • 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.