Jump to content

warnockm

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by warnockm

  1. I've created a SOAP server in PHP 5.0 using SoapServer(). The functions i've added work fine using simple datatypes, but when i use complex datatypes, i run into problems. i'm using a class to define my functions. For a few of the functions, i return complex data types, which are instances of another class. My question is: what do i use as my target namespace? Right now i start the webserver with: $server = new SoapServer( NULL, array('uri' => "urn://www.w3.org/2001/12/soap-encoding") ); $server->SetClass('ws'); $server->handle(); "ws" is the name of my class with the functions.
  2. I'm trying to add a search api to an application. By search API, i mean i want to add search capability for external applications, using a standard protocol like Z39.50, OAI-PMH, or OpenSearch. I want external programs to be able to connect to a webpage on my site and search my application and return results to it, like wikipedia and amazon provide. I've had some luck on the "Client" side by using Pear::Services_OpenSearch. Does this module let you create opensearch applications?
  3. I'm running Apache 2.2.3, PHP 5.2 and MySQL 5.0 on a Windows XP SP2 machine.  Everything installed fine and i configured each module to work w/ the other.  Next i installed phpMyAdmin 2.9.1.1 and the first time i ran it, it ran fine.  Now, when i start it, an instance of http hangs w/ cpu running high.  If i kill the instance and reload, sometimes it works.  I tried using the php module - apache_filtered, and the first time i ran phpMyAdmin w/ the new module it worked, but on a reload it did not.  Same when i switched back to the standard php-apache module.  It's very hit and miss when it works, about 50/50 but leaning towards more of not working.  Is there something could be causing this?
  4. i think the CURL_HEADER bug report is pretty old.  I've had success using CURL_HEADER, however, all it does is puts the header in w/ the data, so you get: Content-type: text/html ... etc at the top, and then the response <html> ... etc after that.  Someone wrote something the separates the responses.  apparently its just 2 new lines/carriage returns:http://us2.php.net/manual/en/function.curl-setopt.php#44986.  I was hoping to have it built into the CURL functions, since i can't see how having the header and response in the same would be that useful.
  5. and is that the header and content separately?  That feature isn't documented.
  6. i'm trying to use php and CURL to view the header to get the content-type and the file data.  I use the curl option: CURLOPT_HEADER true to see the header, but i want to get the file data and header separately.  is that possible?
  7. no one has been replying on here.  Is it me or my questions??????
  8. I have a very odd problem, but i'm sure the members of phpfreaks can help.  I have a linux server running PHP 5.1.  I mounted a windows filesharing using cifs.  The mounted directory is owned by www, my web service user.  I'm using PHP to create a directory (mkdir($dir, 0777) on the share and store files in there.  When i write them, i get a file permission error.  When i look at the permssions, i see it is own by root, even through it was created by php (www). drwxr-xr-x 2 root root 0 Sep 22 16:11 new_dir I understand why its not writable.  www can't write to this.  However, the interesting thing is, when i run the script again, and it doens't have to create the directory, the files store.  after the second run, the permissons change to: drwxrwxrwx 1 root root 0 Sep 22 16:26 new_dir Also, the colors in bash change to green/white, and dircolors say its: "STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)" Why is it creating a directory owned by root.  and then why do the permissions change?  I'm doing nothing to change the permissions.  i just check if the dir exists, create it if it doesn't, and write files to the new dir.  Is it something w/ the way i mount the share? thanks!
  9. Does anyone know of something that's been released that spiders websites?  Specifically, i want to give it a site (or a list of them) and have it spider them, staying only in that site, and download all of the documents, like .doc or .pdfs.  Then return periodically and report the changes and download the new ones.  Has anyone seen anything like this in PHP?  i'll code it myself if i have to , but might as well not reinvent the wheel.  Thanks!
  10. I using HTML forms to copy and paste information from webpages and Word documents.  The data is stored in a mysql database (default Latin1_swedish_ci).  Certain characters, like quotes, look weird.  They will return as letters w/ accents, and even the TM trademark symbol when i view it in phpMyAdmin.  It then display correctly in HTML, and when emailed in HTML to outlook. The problem is, i'm creating text based files that can only have ASCII, and these quotes and other characters are not showing up as the proper quotes, they are shoing up as a series of weird characters.  Is there a way to convert these quotes to normal, non-directional, quotes, or convert the encoding or charset?  I'm not really sure what i'm dealing w/ so i could use the help. this is an example of the weird chars: – is in the sql database, pasted from a webpage.  The webpage displays in the browser as a long dash - and "&ndash;" in the html code.
  11. i'm trying to do some things in PHP where i have to connect to a webserver that requries a server certificate (.crt file) to be installed.  my php script is the client and IIS is the server.  How do i import a certificate for PHP to see?  is it in PHP or openssl?  thanks
  12. [!--quoteo(post=389324:date=Jun 29 2006, 12:26 PM:name=Buyocat)--][div class=\'quotetop\']QUOTE(Buyocat @ Jun 29 2006, 12:26 PM) [snapback]389324[/snapback][/div][div class=\'quotemain\'][!--quotec--] It looks like your for loop would work just fine... try this for ($i = 0; $i < count($array); $i++) { // do some stuff here // if you remove a value from $array then do this $i = 0; } So, you start the loop over every time you remove a value, that way you'll be sure not to skip anything. The while loop I had suggested before just checks for the condition, you're right it may not help if you need to be at the ith place in both arrays at once, but if you can coordinate the arrays without using $i then it may still work. [/quote] I don't think this work work. picture the scenario where i have 6 values (index 0 -> 5). I then remove #2 and #4. I'm left with elements 0, 1, 3, 5. I now only have 4 elements in the array. If i loop i = 0 to 4, i is going to be 0, 1, 2, 3 but i need it to be 0, 1, 3, 5. Or i need it to be 0, 1, 2, 3, 4, 5 and check of the element exists. it would not on #2, and #4. Am i totally missing something? thanks everyone, edit: i'm using unset() to remove the value. is that correct?
  13. [!--quoteo(post=389312:date=Jun 29 2006, 11:53 AM:name=Buyocat)--][div class=\'quotetop\']QUOTE(Buyocat @ Jun 29 2006, 11:53 AM) [snapback]389312[/snapback][/div][div class=\'quotemain\'][!--quotec--] Try using a while loop, while (count($_index_array) > 0) { // do stuff and here and remove the index from $_index_array upon success } [/quote] Won't this do the same thing as a foreach loop? How do i get the index value of the array?
  14. Hi, i have a problem i can't seem to figure out. I'm using two arrays to create columns for a report. Basically one array has all of the columns you can use and the other has which ones are actually in the report. Once you add one, to the report, it should disappear from the first array. I'm not sure how to get the index's of the values in teh array. for instance. if i have elements 0 through 5 (total of 6) and I remove #3 (now a total of 5), how do i loop through the remaining elements and still use the indexs? for ( $a = 0; $a < count( $array); $a++ ) { // } doesn't work, because when i remove elements, the count changes. the count becomes 5 and it goes from 0 to 4 instead of 5. foreach( $array as $val ) { // } doesn't work because now i don't know the indexes. so is there a way to get the index number of a value, or loop through array w/o using count, but still see the indexes? i don't mind checking if the array element exists. thanks,
  15. Does anyone have any code to search through text for a link, then add html around it to make it clickable? Should input text and output the same text w/ html links. thanks!
  16. [!--quoteo(post=378393:date=May 30 2006, 11:19 AM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ May 30 2006, 11:19 AM) [snapback]378393[/snapback][/div][div class=\'quotemain\'][!--quotec--] Try: [code]$path = dirname($_SEVER['PHP_SELF']);[/code] [/quote] Thanks, but it just returns "." when you run it from in that directory. any way to see the full path?
  17. This should be simple, but i can't think of how to do it. I want to get the path of the script that's currently being run. I have an application in both a running and test folder, and i want to know which path its in. I have used getcwd(), but that is the directory from which you are running the script. I'm running the script from the command line. thanks!
  18. I wanted to thank you for your help. I sucessfully implemented a index running in parallel to my data. TO build the index takes about a minute; almost the entire time is in the mysql query. Then to update the search table when the data changes doesn't add a noticable difference and searches take fractions of a second. It's exactly what i needed.
  19. [!--quoteo(post=375515:date=May 20 2006, 11:35 AM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ May 20 2006, 11:35 AM) [snapback]375515[/snapback][/div][div class=\'quotemain\'][!--quotec--] That's because you're using so many joins and so many different fulltext indexes. You'd have to maintain your own index which you update as you insert/update records into these various tables & fields. That way, you'd only have to query a single table. [/quote] Sorry for my ignorance. would this be a table used only for the search? When i return search results, i only return one thing, the company. So would i create a row for each company, with the text that i would be searching for? So if there are a few columns from each joined table, i would put the data from each searchable column into this new table, so when i search, it only searches one place, w/ no joined tables? thanks for your patience and explanations!
  20. [!--quoteo(post=375257:date=May 19 2006, 11:43 AM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ May 19 2006, 11:43 AM) [snapback]375257[/snapback][/div][div class=\'quotemain\'][!--quotec--] I don't know what you mean by "examples of indexing". [/quote] Yeah, i was afraid we may be talkign abotu different things. By indexing, i do not mean using index values to represent other rows on other tables, i mean creating a "snapshot" of the data to search, instead of searching the real data. Kind of how google does it. For instance, you would go through every value of every relavent column on every relavent row, such as the ones containing important text, and pull out each word and put them in a table, next go through each word and count how many times it's in an entry. You build a table that references each word to each result, in my case, a company, and stores it. Then when you search for a word, you return the companies that have that word, but you never go through all of the table. Where i'm having trouble and slowdowns is all of the cross referencing. I'm returning one value each time, a name of a company, but i'm searchign through all of their records, locations, people attached to them, work, etc. When you link about 10 tables, it slows down quite a bit. I dont' have a lot of records or data in them, but its the "JOIN" state ments that are killing me. I was hoping to do an index each night, and use that as a search. It would not be up to teh second, but would greatly improve search speed. this is my query string that is taking so long: [code] SELECT table_01.table_01_id, table_01.name, last, first, city, state , MATCH ( table_01.description ) AGAINST ('search_term') + MATCH ( table_01.capabilities )  AGAINST ('search_term' ) + MATCH ( table_01.comments ) AGAINST ('search_term' ) + MATCH ( table_07.workdesc ) AGAINST ('search_term' ) + MATCH ( table_07.client ) AGAINST ( 'search_term' ) + MATCH ( table_07.table_07 ) AGAINST ( 'search_term' ) + MATCH ( table_09.description ) AGAINST ( 'search_term' ) + MATCH ( table_09.datatext ) AGAINST ( 'search_term' ) + MATCH ( city ) AGAINST ( 'search_term' ) + MATCH ( table_05.last ) AGAINST ( 'search_term' ) + MATCH ( table_05.first ) AGAINST ( 'search_term' ) + MATCH ( table_10.client ) AGAINST ( 'search_term' ) + MATCH ( table_10.department ) AGAINST ( 'search_term' ) + MATCH ( table_12.nature ) AGAINST ( 'search_term' ) + MATCH ( table_11.title ) AGAINST ( 'search_term' ) + MATCH ( table_11.desc ) AGAINST ('search_term' ) + MATCH ( table_08.note ) AGAINST ( 'search_term' ) + MATCH ( table_01.name ) AGAINST ( 'search_term' ) AS score FROM table_01 LEFT JOIN table_02 ON table_01.table_01_id = table_02.table_01_id LEFT JOIN table_03 ON table_02.table_03_id = table_03.table_03_id LEFT JOIN table_04_01 ON table_01.table_01_id = table_04_01.table_01_id LEFT JOIN table_05 ON table_04_01.table_05_id = table_05.table_05_id LEFT JOIN table_06 ON table_01.table_01_id = table_06.table_01_id LEFT JOIN table_07 ON table_01.table_01_id = table_07.table_01_id LEFT JOIN table_08 ON table_06.table_06_id = table_08.table_06_id LEFT JOIN table_09 ON ( table_01.table_01_id = table_09.table_01_id OR table_07.table_07_id = table_09.table_07_id OR table_06.table_06_id = table_09.protable_09_id ) LEFT JOIN table_10 ON table_01.table_01_id = table_10.table_01_id LEFT JOIN table_11 ON table_07.table_07_id = table_11.table_07_id LEFT JOIN table_12 ON table_10.table_10_id = table_12.table_10_id WHERE ( MATCH ( table_01.description ) AGAINST ('search_term') OR MATCH ( table_01.capabilities ) AGAINST ('search_term' ) OR MATCH ( table_01.comments ) AGAINST ('search_term' ) OR MATCH ( table_07.workdesc ) AGAINST ('search_term' ) OR MATCH ( table_07.client ) AGAINST ( 'search_term' ) OR MATCH ( table_07.table_07 ) AGAINST ( 'search_term' ) OR MATCH ( table_09.description ) AGAINST ( 'search_term' ) OR MATCH ( table_09.datatext ) AGAINST ( 'search_term' ) OR MATCH ( city ) AGAINST ( 'search_term' ) OR MATCH ( table_05.last ) AGAINST ( 'search_term' ) OR MATCH ( table_05.first ) AGAINST ( 'search_term' ) OR MATCH ( table_10.client ) AGAINST ( 'search_term' ) OR MATCH ( table_10.department ) AGAINST ( 'search_term' ) OR MATCH ( table_12.nature ) AGAINST ( 'search_term' ) OR MATCH ( table_11.title ) AGAINST ( 'search_term' ) OR MATCH ( table_11.desc ) AGAINST ('search_term' ) OR MATCH ( table_08.note ) AGAINST ( 'search_term' ) OR MATCH ( table_01.name ) AGAINST ( 'search_term' ) ) GROUP BY table_01.table_01_id ORDER BY score DESC[/code] no real surprise it takes 64 seconds on a PII 450mhz w/ 190megs of ram. Its real fast when it doesn't do a text search because it doesn't have to join those other tables. Also, i turned on caching which speeds up duplicate searches, but the system isn't used enough for that. It doesn't have data added to it that often, it just needs to query this faster.
  21. [!--quoteo(post=374899:date=May 18 2006, 06:15 AM:name=semtex)--][div class=\'quotetop\']QUOTE(semtex @ May 18 2006, 06:15 AM) [snapback]374899[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hey there. Just to be sure, do you know the mysql fulltext (boolean) search possibility? It can return a score that more or less determines the relevance of the search. It's also quite fast, even on large databases. Here's an excellent tutorial: [a href=\"http://www.phpfreaks.com/tutorials/129/0.php\" target=\"_blank\"]http://www.phpfreaks.com/tutorials/129/0.php[/a] [/quote] I'm doing full text searches on all of the fields. I like how it gives me a score, but i don't like how slow it is. Any examples on the indexing?
  22. Hi, i'm currently maintaining a web application i built that stores a lot of text data on a slow computer. The tables are heavily cross referenced, and because of this, my text searches take about a minute to perform. I'm looking at creating an index that is updated when an entry is updated, or nightly. Does anyone have any example code on doing this? I think the idea is to gather all of the words in the mysql tables, and then go through each table, count the number or words and assign the value of each page and word combination. I'd like to see examples of people doing this. Thanks!
  23. I writing some php code to check my email and download the attachements. I'm using a pop account and using the imap() functions built into php. I am able to check my mail and see the encoded attachment in the body using imap_body(), however, i'm not sure what to do with it! DOes anyone know of example code or a plugin to deal w/ downloading attachements? the body looks like this: This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C6687A.001D3210 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ------=_NextPart_000_0001_01C6687A.001D3210 Content-Type: image/jpeg; name="ATT00001.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ATT00001.jpg" /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkz .... I'd like to get the Content-Type, filename and content-transfer-encoding, as well as the contents out of the email. thanks
  24. [!--quoteo(post=367984:date=Apr 24 2006, 10:24 AM:name=shoz)--][div class=\'quotetop\']QUOTE(shoz @ Apr 24 2006, 10:24 AM) [snapback]367984[/snapback][/div][div class=\'quotemain\'][!--quotec--] Try not using [a href=\"http://www.php.net/stripslashes\" target=\"_blank\"]stripslashes[/a] when retrieving the information from the database. When you use addslashes you're only escaping characters that would be misinterpreted by MYSQL had you not. The end result is that only your original data is stored, not the slashes that were used to escape the data. You should only need to worry about stripping slashes from the data retrieved if [a href=\"http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-runtime\" target=\"_blank\"]magic_quotes_runtime[/a] is on. [/quote] yeah, that fixed it. But my question is, why? I don't have Magic quotes on in my php.ini
  25. [!--quoteo(post=367087:date=Apr 20 2006, 11:16 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Apr 20 2006, 11:16 PM) [snapback]367087[/snapback][/div][div class=\'quotemain\'][!--quotec--] That's seems impossible -- these functions are each other's inverse, such that x = stripslashes(addslashes(x)). There must be something else going on -- are you sure magic quotes aren't on? [/quote] Thanks for the reply. I checked and magic quotes are OFF. When i uploaded a file and downloaded and compared the original to the downlaoded. There are slashes in the original that are being removed. Isn't it possible that there are slashes not added by addslashes() that are removed by strip slashes?
×
×
  • 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.