Jump to content

natbob

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

natbob's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. if you don't want anyone to read the logs you can block them in your apache config if they are malicious web bots which look at the robots.txt file and then go to all of the listed places, you can make a trap by adding an entry which will lead them to a page where thier user agent is recorded and blocked from the site completely Just a note it might be a good idea to add some of the popular user agents (FF, IE etc.) to an exclusion so that a curious visitor doesn't end up blocking all of the visitors using thier browser.
  2. $r = new HttpRequest($webpageToGet); $r->send(); $res = $r->getResponseBody(); will also work, it uses the HTTP class/extension
  3. I'm trying to use glade to build the ui for the app I'm making with php-gtk. I followed the hello glade tutorial and copied and pasted their example and ran it on a gtk distribution of php from the official gtk website. I get the error "Class gladeXML is not found". Does it need to be loaded as a module? I'm running windows xp so I just used the binaries rather then compiling it. Just a note, I can successfully run other gtk apps that were made through just php code. Thanks
  4. I think you just answered my question. Thanks.
  5. I'm trying to find out what a good price to charge for creating a website with custom blog and event tools along with about 10 pgs of static content. The blog and event tools are all written from scratch and customized to fit the customers needs. I have done a little reasearch but all of the things that I found were very out of date. ???
  6. This may not work for you but you could use a function like levenshtein (http://www.php.net/manual/en/function.levenshtein.php) it will tell you how close two words are together, this would be used on the fly by comparing the search to the database of items, like this: <?php $short = -1; //how close of a match it is while($row = mysql_fetch_assoc($result)) { $lev = levenshtein(strtolower($_GET['word']), strtolower($row['name']), 1, 1, 1); if ($lev == 0) { //if there is a perfect match $close = $word; $short = 0; $id = $row['id']; break; } if ($lev <= $short || $short < 0) { //if there has been no match or if the current word is a better match $close = $word; $ans = $row['name']; $id = $row['id']; $short = $lev; } } ?> That code would take a mysql query result and output the closest match to the input ($_GET['word']).
  7. Here http://www.php.net/manual/en/function.levenshtein.php is a link to a function which finds how close two words are in spelling. It may be of some help. Here is code implementing the function. It goes through a query result and finds the closest match to $_GET['word']. <?php while($row = mysql_fetch_assoc($result)) { $lev = levenshtein(strtolower($_GET['word']), strtolower($row['name']), 1, 1, 1); if ($lev == 0) { $close = $word; $short = 0; $id = $row['id']; break; } if ($lev <= $short || $short < 0) { $close = $word; $ans = $row['name']; $id = $row['id']; $short = $lev; } } ?>
  8. You may already know this but, to send mail from PHP your need to use an SMTP mail server. Then you need to configure it in your php.ini file. If you have already done these things, then if you are running all of this on your computer, check your SMTP server for errors. Since it is not showing the error message the message got to the server. I can't find anything wrong with your code so... I would look at your SMTP server.
  9. I started learning C a few days ago and have the basic syntax down. I have looked at pointers and how they work and think that I have a basic understanding of that. I have read some things stating how hard pointers were and am wondering where they would be used and why they would be so hard. Thanks
  10. When yo mark a thread as solved that has a < or > in its name, it will end up double escaped. Like this: 2 < 5 is automatically 2 < 5 after you originally start it, but after you "solve" it then the ampersand in < is escaped to 2 &lt; 5 witch outputs 2 < 5 instead of 2 < 5 so the problem is in the escaping of ampersands when you mark a post as solved.
  11. thanks, I looked at one of the OOP tutorials on this site.
  12. In the code for pirep_process.php add this right before closing the database connection: <?php $result = mysqlquery("SELECT * FROM total"); $oldnum = mysql_fetch_assoc($result); $newnum = $oldnum['total'] + $flthrs; mysql_query("UPDATE total SET total = '$newnum'"); ?> note: it uses a table named total witch has one column named total witch is an integer, it has one row, make sure that that row starts with a value of zero.
  13. I'm not quite sure what you mean, do the posted headers work or are they the ones you are using now? I do not know very much about java but the headers you posted would do what are in the comments header('Content-type: class/java'); //says that this page is a java class header('Content-disposition: attachment; filename="applet.class"'); //says that you want the browser to download the class to the disk header('Content-length: ' . filesize($path)); print($file); //the class is read and put on the screen? if you want to just have the browser parse it as a class then the following should be good <?php header('Content-type: class/java'); print($file); ?> or if you want the client to download it: <?php header('Content-disposition: attachment; filename="applet.class"'); ?> Once again I'm pulling from my limited Java knowledge so I may be wrong.
  14. I would use #1 just because it uses less code. I ran a speed test and #2 takes 1.5 times as long (with the === operator of course ) so from a performance perspective, 1 is faster.
  15. The code for the form is fine but on next.php you forgot to close your function calls and you need to quote the filename as so. <?php $file = fopen("test.txt", "a+"); fwrite($file, $_POST["name"]); fwrite($file, $_POST["age"]); fclose("test.txt"); ?> I hope this helps.
×
×
  • 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.