RE: [PHP] GEnerating PDF's
Petre, We use the R&OS PDF Class its very easy to set up and has a ton of options, best part is that you don't need PDFLIB. http://www.ros.co.nz/pdf Hth Thank You Brian Paulson Sr. Web Developer Email: [EMAIL PROTECTED] Phone: 1-800-279-6397 Fax: 1-719-544-0264 URL: www.chieftain.com --- -Original Message- From: Petre Agenbag [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2003 12:32 AM To: [EMAIL PROTECTED] Subject: [PHP] GEnerating PDF's Hi List I'm investigating different possibilities to generate printable and read-only documents, and the "best" method seems to be generating PDF's, however, I have NO experience with working with PDF's, and the examples in the manual only list a simple "one-liner" text pdf. Where can I find more material that will explain in layman's terms how to generate pdf's from various sources. As example, I'd like to generate PDF's of a webpage "on-the-fly" or even from data in MySQL tables. It seems that you need to provide the pdf generation process with the co-ordinates and size of each "element", but it is the location of the "elements" that I have trouble with, ie. what is needed to define each element? Thanks for the help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CLI problems
I have been looking for answer but have not located any thing that will solve my problem. The problem I am having is that I cannot get php scripts to run from the command line, I can run php straight from the command line and it works and by using -f it parses my file just fine, but when it comes to running the script from the command line all I get is the : bad interpreter : and I know that I am telling it the correct location. [EMAIL PROTECTED] user]# /usr/bin/php -v PHP 4.3.2 (cli) (built: Jun 2 2003 08:52:29) Copyright (c) 1997-2003 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies [EMAIL PROTECTED] user]# vi test.php #!/usr/bin/php [EMAIL PROTECTED] user]# ./test.php : bad interpreter: No such file or directory -rwxrwxrwx1 user user 39 Jun 3 15:43 test.php Thank You Brian Paulson Sr. Web Developer Email: [EMAIL PROTECTED] Phone: 1-800-279-6397 Fax: 1-719-544-0264 URL: www.chieftain.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] getting page title using PHP
Tim, Here is a function that we use to retrieve the title of the page function title($filename,$dir) { $loc = "$dir/$filename"; if(@is_file("$loc/$filename")) { $open=fopen("$loc/$filename","r"); while(!feof($open)) { $line=fgets($open,255); $string = $line; while ( ereg( '([^<]*)(.*)', $string, $regs ) ) { $string = $regs[2]; } } return $regs[1]; } } Hth Thank You Brian Paulson Sr. Web Developer Email: [EMAIL PROTECTED] Phone: 1-800-279-6397 Fax: 1-719-544-0264 URL: www.chieftain.com --- -Original Message- From: Tim Thorburn [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 7:03 PM To: [EMAIL PROTECTED] Subject: [PHP] getting page title using PHP Hi, As a matter of curiosity I've created a little script that will check what screen resolution visitors to my site are using and store the information into a MySQL database. So far, I'm recording the users IP address, screen resolution, and the date/time they visited. Now I'd like to be able to use this same script for all my pages - but I don't want to have to add in a page title each time I want to use the script, nor do I want to make page titles in PHP for all my pages. Is there a command in PHP that can get what's between the and tags? I found a few scripts that can get page titles if they are given a URL to go seek - but these scripts seem to store most of the pages HTML code in memory and I don't think my web host would enjoy that. TIA -Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Errors with 4.2.2
I have been running 4.1.1 due to any time I upgraded to 4.2.0 I would get emalloc errors. Now that this upgrade to 4.2.2 I am getting the same errors and this is a must upgrade. If any one can help with finding out why I am getting these errors I would appreciate it. [This is from my error_log file] FATAL: emalloc(): Unable to allocate -273464 bytes FATAL: emalloc(): Unable to allocate -272312 bytes [Tue Jul 23 16:27:36 2002] [notice] child pid 26650 exit signal Segmentation fault (11) [Tue Jul 23 16:27:36 2002] [notice] child pid 26612 exit signal Segmentation fault (11) I get this on some pages, but not all pages Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Emalloc Fatal Error
Well after searching around I have found nothing really but a bunch of questions about this problem. I can run php 4.1.2 just fine with no troubles When I install 4.2.1 I started getting Emalloc() errors on some pages. The pages that seem to cause errors are pages that access the database, but not all pages that access the database cause the error. This problem is the only think keeping me from moving to 4.2.1 Any help would be appreciated. Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php'ed mysql query
Try printing the $query1 to the browser and see what it looks like that solves 99% of my Query problems. Thank you Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com 1-800-269-6397 -Original Message- From: Christopher Allen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 16, 2001 12:25 PM To: php Subject: [PHP] php'ed mysql query Hello, Can anyone tell me why this query errors out? It works from the mysql client command line just fine $query1 = "select * from zip_base where '$zip1' >= zip && '$zip1' <= CONCAT (SUBSTRING(zip , '1' , LENGTH (zip) - LENGTH (range) ), range)"; Christopher C. M. Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Tutorial?
You might also go to http://www.devshed.com they have a very good php section. For code to look at go to http://www.weberdev.com/ or http://www.zend.com Thank you Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com 1-800-269-6397 -Original Message- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: Friday, March 02, 2001 7:49 AM To: PHP Subject: RE: [PHP] Tutorial? I started with this: http://www.php.net/tut.php went from there. Also http://www.thickbook.com/ has some good stuff. Jeff Oien > Hi there, > Iam new to the world of PHP, and after my boss told me to learn PHP and MySQL, I > found my way here. > I am gettign to frips with MySQL, and Basic PHP seems to be sticking in my > brain, but I'd really appreciate it if you guys could point me in the direction > of a good on-line tutorial that'd point out the basics of geting these two > technologies to talk to one another. > > Ultimatly, I'd like to have a login screen, that checkes user name against > password on my Database. > > You guys were recommended to me by a subscriber from another list, I hoep you > can help. > > Thanks in advance, > Tris... > > > > > > ** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. If you have received this email in error please notify > the system manager. > > This footnote also confirms that this email message has been swept by > MIMEsweeper for the presence of computer viruses. > > > ** > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Not isset
try if(!(isset($order))) { $order=$Table."ID"; } hth Thank you Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com 1-800-269-6397 -Original Message- From: Mike [mailto:[EMAIL PROTECTED]] Sent: Friday, March 09, 2001 1:34 PM To: [EMAIL PROTECTED] Subject: [PHP] Not isset how do I write a Not isset as in: if != isset($order) { $order=$Table."ID"; } mikep [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] search results return by relevancy
You might try this article on devshed on how to create a search engine using MySql and php. http://www.devshed.com/Server_Side/PHP/Search_Engine/ I currently use this same Technique to run our classifieds at http://www.chieftainclassifieds.com Thank you Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com 1-800-269-6397 -Original Message- From: Jen Hall [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 19, 2001 7:57 AM To: php3 Mailing List Subject: [PHP] search results return by relevancy Hi there I have some scripts that do a search in a MySQL database table. I want to be able to return rows that match a query, in order of relevancy. For example, say I have a table that has the following data |row_id| data |--|- | 1 | cat | 2 | cat cat | 3 | cat cat cat | 4 | cat cat | 5 | cat cat cat cat cat cat cat | 6 | cat | 7 | cat cat cat cat | 8 | cat cat cat cat cat I want to do a search that would return row_id 5 first, then row_id 8, then row_id 7, then 3, etc. So I want to order the return by relevancy. What should the sql query look like? select * from table where data like '%cat%' order by ? thanks -jen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP & Java ?
Is there any way that we can see the page? That might help in sorting out the problem Thank you Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com 1-800-269-6397 -Original Message- From: Jack Sasportas [mailto:[EMAIL PROTECTED]] Sent: Friday, May 04, 2001 11:22 AM To: php Subject: Re: [PHP] PHP & Java ? I am echoing the javascript and other html, and at this point *not* putting values into the javascript. I take a string like so: $string=" JavaCode HTML "; I make sure that *everything* in the quotes has only sinlge quotes no double quotes so that PHP doesn't think its the end of the string, then I echo $string; Somehow the java mouseover breaks, then I tried taking the java mouseover single quotes and putting them back to double quotes preceeded by a \ to tell php to ignore that quote, but that didn't work either. Is it the way I am echoing or something ? Thanks ! Peter Dudley wrote: > If it's javascript, then be careful about echoing PHP variables into > Javascript strings. If you have something like (in Javascript) > > var myString = ''; > > and $phpString contains any apostrophes, then the javascript will break > because Javascript thinks the string has ended prematurely. E.g, if > $phpString is "My cat's pajamas" then the javascript would be sent to the > browser thus: > > var myString = 'My cat's pajamas'; > > and you can see that there are too many single quotes, which will, of > course, cause Javascript's high-powered debugging utilities to kick in and > give you a highly useful error report. > > Pete. > > > While working on some web sites which contain mouse over java, and then > > adding in some db stuff via php/mysql, the java seems to break. > > Is there something special I need to do to prevent that break? > > Is this a common problem? > > Does using templates get around that problem ? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] accessing Javascript Cookies with php
I am having to use JavaScript to set a cookie, and if the page that sets the cookie is any where but in the root web dir of the server I am unable to retrieve it with php. I have tested this out with Windows+apache+php4 and Linux+apache+php4 and am unable to retrieve the cookie. Has any one had this same Problem? Thank you Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com 1-800-269-6397 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Apache not starting after installing php --with-gd
I get the following error when I try to start apache Cannot load /usr/lib/apache/libphp4.so into server: /usr/lib/libgd.so: undefined symbol: uncompress /usr/sbin/httpd It has been running fine tell we recompiled using the with-gd option I did find some mention of this but it mostly talks of this happening with Mysql and we have been using mysql with out any troubles. we re using a Cobalt Raq3i Any Ideas? Thank You Brian Paulson Sr. Web Developer The Pueblo Chieftain www.chieftain.com 1-800-279-6397 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Removing every thing between ( )
Hello, What would the regular expression be to remove all the text between ( ) $string = "This is a (001 Test) and (002 Test)"; The numbers always change but the word stays the same Any help would be appreciated. Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Removing every thing between ( )
Great, Thanks for the help, worked like a charm Brian -Original Message- From: CC Zona [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 1:50 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Removing every thing between ( ) In article <001901c1ba5d$634e3840$89010a0a@bpaulson>, [EMAIL PROTECTED] (Brian Paulson) wrote: > What would the regular expression be to remove all the text between > ( ) > > $string = "This is a (001 Test) and (002 Test)"; $string=preg_replace("/\(.+\)/U",'',$string); Note that leading/trailing spaces are left in, and the parens are dropped, so you may want to adjust it a bit. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Removing every thing between ( )
Ok help me out here, isn't the point of this list to get help? How long is too long to work on a solution before ask for help? Brian -Original Message- From: bvr [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 2:33 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Removing every thing between ( ) whoops.. I see you allready got a cut and clean answer. now your lazy *and* lucky ;) try to figure it yourself next time, believe me it'll open up possibilities!! bvr. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Replacing non exact strings
Julio, Try this $search = "Joe Doe"; $original = "Joe Cougar Doe"; $final = "Joe Cougar Doe"; $terms = explode(" ",$search); for($i=0; $i".$terms[$i]."", $original); } echo $original; Should get you started. Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com -Original Message- From: Julio Nobrega Trabalhando [mailto:[EMAIL PROTECTED]] Sent: Friday, May 03, 2002 8:36 AM To: [EMAIL PROTECTED] Subject: [PHP] Replacing non exact strings Hi List, Imagine a form where user can search for clients using a 'name' field. When submitted, there's a result page, linking results to another page with the client information. I need to make the terms inputted at the form bold when they appear at the client information page. Problem is: When someone searchs for "Joe Doe", and the client's name is "Joe Doe", I can make it "Joe Doe". But when the name is "Joe Cougar Doe", I can't bold it (parts Joe && Doe) because there's this "Cougar" in the middle. The result I am looking for is "Joe Cougar Doe". So: $searched = "Joe Doe"; $original = "Joe Cougar Doe"; $final = "Joe Cougar Doe"; Any ideas about how can I achieve this result? I am currently using eregi_replace($searched, "$searched", $original), so that's why it only accepts the whole string. Thanks a lot, Julio Nobrega. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Weather Scripts
I recently made a class that gets its info from the NOAA which is free for public use. At the moment it is a little buggy and not quite complete. You can look at it here http://spectre013.grunews.com/weather It works for any location in the world by using the 4 character Airport Code. I will have the source if you want to use it, but at the moment it is in no condition to be used on a live site. Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com -Original Message- From: Simos Varelakis (OLD) [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 5:27 AM To: 'Erik Price'; 'Shannon Doyle' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Weather Scripts > > Hi People, > > I have been looking around the web lately and have noted a number of > sites are running what appears to be php scripts that parse their local > weather information and display it on their wesite. > > Well, I want to do the same, however I have been searching and found > nothing that does what I want it to do. The only ones that I can find > are either the output style of weather.com (ie all or nothing) or use > their own graphics etc to display the data. > > All I want to be able to do is give the current conditions (ie partly > cloudy) and the current temperature. I haven't decided if I then want to > use this info to create an image or if I will display it as straight > text. I want to do the same thing and I wonder if there are sites which can give me weather info for European cities (in xml format) for free... Thanks in advance for your help Simos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I suck at regular expressions!
Been Using this Function for some time and works real well with two exceptions 1. if the title line has a CR in it it will no get the title Example: This is a bad Title 2. If there are any other < > tags in the title it will fail. ([^<]*)(.*)', $string, $regs ) ) { $string = $regs[2]; } } return $regs[1]; } } ?> -Original Message- From: Richard S. Crawford [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 14, 2001 11:30 PM To: [EMAIL PROTECTED] Subject: [PHP] I suck at regular expressions! I am trying to get the title of an html file... you know, the string between the < title > and < /title > tags... Here is the function I've got so far: function fileTitle($fileName) { $myFile = fopen($fileName, "r"); $myText=""; while (!feof($myFile)) { $myText .= fgets($myFile,255); } fclose($myFile); if (eregi("(.+)",$myText,$theTitle)) return $theTitle[0]; else return "(No Title)"; } The trouble is, it always returns "(No Title)", regardless of whether the file has a title defined in the header or not. I suspect I'm doing something fundamentally wrong. Can anyone set me straight? Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] quick friday query
Casper, My guess would be that the folder that you are trying to write the file to doesn't have the correct permissions to allow the webserver to write to it. Try that and let me know if it works! Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com -Original Message- From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]] Sent: Friday, November 16, 2001 9:49 AM To: Php-General Subject: [PHP] quick friday query I am writing files to my server using $fp = fopen("myfile.txt", "w"); this all works. However in the php manual it says that by using the "w" switch that php will create the file if it doesn exist However this does not seem to work I can only write to a file that already exists and has CHMOD 777 Is this a school boy error or do I need my server re configured? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] WXFEED Weather Script
I am trying to locate a script called WXFEED by John Sanders. The only place this script seems to be located is on hotscripts but the link no longer works. So if any one has downloaded it and still has it around I would appreciate it if I could get a copy. Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] 4.1.0 and is_file
This morning after I got 4.1.0 installed and running I started getting the following warning where I used is_file to check to see if a file was present. Warning: stat failed for /gallery/pictures/.desc (errno=2 - No such file or directory) in /gallery/index.php on line 451 Has any one else had this problem? Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Parsing HTML tags
I use this function function title($filename,$dir) { $loc = "path/to/dir/where/file/is"; if(is_file("$loc/$filename")) { $open=fopen("$loc/$filename","r"); while(!feof($open)) { $line=fgets($open,255); $string = $line; while(ereg( '([^<]*)(.*)', $string, $regs ) ) { $string = $regs[2]; } } return $regs[1]; } } call it like so print(title("home.htm","web/articles")); The only drawback is if there is any < > tags in between the tags it will not get the title, also if the title is on two lines like this This is the title of my page it won't get the title either. hth Thank you Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com 1-800-269-6397 -Original Message- From: Chris Empson [mailto:[EMAIL PROTECTED]] Sent: Friday, April 13, 2001 8:45 AM To: [EMAIL PROTECTED] Subject: [PHP] Parsing HTML tags Could anyone tell me how to extract a string from between a pair of HTML tags? Specifically, I would like to extract the page title from between the and tags. I have read the regular expression docs and I'm still a bit stuck. Can anyone help? Thanks in advance, Chris Empson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] APXS -S option in 4.0.6
Have been trying to compile 4.0.6 with this configure line: ./configure --with-config-file-path=/etc/httpd/conf/ --with-mysql --with-gd=/usr/local --enable-ftp --enable-xml --with-jpeg-dir=/usr/local/include --with-png-dir=/usr/local/include --with-zlib-dir=/usr/local/include --with-apxs=/usr/sbin/apxs And am getting the folowing error Make install make[1]: Entering directory `/home/sites/home/users/admin/php-4.0.6' /home/sites/home/users/admin/php-4.0.6/build/shtool mkdir -p "/usr/lib/apache" && /usr/sbin/apxs -S LIBEXECDIR="/usr/lib/apache" -i -a -n php4 libs/libphp4.so apxs:Error: Unknown option: S Usage: apxs -g -n apxs -q ... apxs -c [-o ] [-D [=]] [-I ] [-L ] [-l ] [-Wc,] [-Wl,] ... apxs -i [-a] [-A] [-n ] ... make[1]: *** [install-sapi] Error 1 make[1]: Leaving directory `/home/sites/home/users/admin/php-4.0.6' make: *** [install-recursive] Error 1 Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] The Pueblo Chieftain www.chieftain.com 1-800-279-6397 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] building a search engine ??
http://www.htdig.org -Original Message- From: Navid A. Yar [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 10:50 AM To: 'scott [gts]'; 'php' Subject: RE: [PHP] building a search engine ?? This sounds interesting. Where can I find htdig? -Original Message- From: scott [gts] [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 12:20 PM To: php Subject: RE: [PHP] building a search engine ?? and to answer one of the previous questions, yes... it is *very* resource intensive to scan an entire directory tree full of files every single time a user wants to search as far as i know, htdig indexes the information into one big file, and just reads thru that... which will save you loads of disk accesses and generally speed up search queries mucho... not to mention that allowing any users to submit data on a web form and then use that data in a command line tool is asking for trouble... :) best of luck. > -Original Message- > From: Miles Thompson [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 12, 2001 8:46 AM > To: void; [EMAIL PROTECTED] > Subject: Re: [PHP] building a search engine ?? > > > > Why reinvent the wheel? Use htdig or one of the other open source > search > engines. There's a memo on the htdgi site on integrating PHP and htdig. > > Miles Thompson > > At 02:26 PM 7/12/01 +0200, void wrote: > >I am thinking of building a search engine with the grep command for > >our site. i have my information in a mysql db, > >but i am putting it back into text files. > >reoson being is that maybe the mysql db goes down under hevy load, > >and then our site would look like a tree with out branches. > >So i put all the info in the text files. > > > >now for the search engine i have a form that posts of the pattern. on > >the page receiving this pattern as say $searchpattern i do the > >command grep --binary-files=without-match -lri "$searchpattern" $path > > > >is this too resource intensive ? > > > >How does this idea sound ? > > > >please let me know. > >thanx in advance for any replies. > > > >Cape Town South Africa > > > > > > > > > > > > > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] To > >contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is it possible to detect the Browser type/version in PHP?
Here is something that I use and works good Thank You Brian Paulson Sr. Web Developer The Pueblo Chieftain Online [EMAIL PROTECTED] http://www.chieftain.com > -Original Message- > From: nayco [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 11, 2001 9:48 AM > To: Zhu George-CZZ010; [EMAIL PROTECTED] > Subject: Re: [PHP] Is it possible to detect the Browser > type/version in PHP? > > > with some environnement variable > er, i'm going to take a look, wait. > > > (°-Nayco, > //\[EMAIL PROTECTED] > v_/_ http://nayco.free.fr > > > - Original Message - > From: Zhu George-CZZ010 <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, September 11, 2001 5:35 PM > Subject: [PHP] Is it possible to detect the Browser > type/version in PHP? > > > > Hi, > > > > I once had the Javascript codes to detect the browser > type/version > > (but > unfortunately, I lost the codes), does anyone have the > Javascipt code? or can PHP do the same job (how?) > > > > Thank you very much in advance. > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] To > > contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] To contact the list > administrators, e-mail: [EMAIL PROTECTED] > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: something like alert (javascript)
Here is something that I finished the other day that does what you need function MyForm_onsubmit() { bSuccess = true; if(MyForm.action[0].checked) { var x=window.confirm("Message to be displayed here") if (x) bSuccess = true; else bSuccess = false; } return bSuccess; } Put form stuff in here Hope this helps Thank You Brian Paulson Sr. Web Developer The Pueblo Chieftain Online [EMAIL PROTECTED] http://www.chieftain.com > -Original Message- > From: John Lim [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 03, 2001 11:50 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: something like alert (javascript) > > > Try LensDebug. Generates messages in a second window from PHP. > > http://phplens.com/lens/free_code/lensdebug.php > > "Eduardo Kokubo" <[EMAIL PROTECTED]> wrote in message 001801c14c18$07d4d7c0$a102a8c0@cttmar">news:001801c14c18$07d4d7c0$a102a8c0@cttmar... Is there any function in PHP that is similar to alert() or confirm() of javascript ? I tried die() but that's not what I need. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Database editor
You might also want to try http://sourceforge.net/projects/phpmyadmin That is where you will find the newest version of the program. Thank You Brian Paulson Sr. Web Developer The Pueblo Chieftain Online [EMAIL PROTECTED] http://www.chieftain.com > -Original Message- > From: Girish Nath [mailto:[EMAIL PROTECTED]] > Sent: Friday, October 05, 2001 5:39 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Database editor > > > Hi > > Take a look at phpMyAdmin at : > > http://phpwizard.net/projects/phpMyAdmin/ > > -- > > phpMyAdmin is intended to handle the adminstration of MySQL > over the web. Currently it can: > > - create and drop databases > - create, copy, drop and alter tables > - delete, edit and add fields > - execute any SQL-statement, even batch-queries > - manage keys on fields > - load text files into tables > - create and read dumps of tables > - export data to CSV values > - administer multiple servers and single databases > > -- > > Regards > > > Girish > > > - Original Message - > From: "-:-Doigy-:-" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, October 05, 2001 12:34 PM > Subject: [PHP] Database editor > > > > Hi Folks, > > > > I'm after a quick and easy way to edit tables in a mySQL database, > > much > like > > you would in ms excel. I'm thinking I'll do it with forms... > > > > Is there a non-commerical solution in existance already? > > > > Cheers, > > > > Steve > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] To > > contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] To contact the list > administrators, e-mail: [EMAIL PROTECTED] > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] A good search tutorial
There is a good search engine tutorial at devshed - http://www.devshed.com/c/a/PHP/Quick-and-Dirty-Search-Engine-with-PHP-and-My SQL/ I use it for a few searches on our site and it works well. Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] www.chieftain.com 1-800-279-6397 x 207 -Original Message- From: Phpu [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 3:28 AM To: [EMAIL PROTECTED] Subject: [PHP] A good search tutorial Hi there I have a site driven by a database and I need a search engine...when someone enter a word the script to search the entire database for that word and return the results. Could someone give me the link to that kind of tutorial? Please email me asap -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Extract of a Paragraph
$string = substr($stringname,0,50); echo $string; http://www.php.net/substr Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] www.chieftain.com 1-800-279-6397 x 207 -Original Message- From: Daniel Perez Clavero [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 7:01 AM To: [EMAIL PROTECTED] Subject: [PHP] Extract of a Paragraph Hi list, I would like to show a extract (first 50 words of a text), in order to construct something similar to articles view with read more link. To Extract the first 50 words, should I use str_word_count, and explode/implode or there´s another way, much simple. Any sample would be apreciated. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] apache lookdown
I had the same problem when we just moved and were able to solve it with this Options Indexes MultiViews AcceptPathInfo On Hth Thank You Brian Paulson Sr. Web Developer [EMAIL PROTECTED] www.chieftain.com 1-800-279-6397 x 207 -Original Message- From: Marc Greenstock [mailto:[EMAIL PROTECTED] Sent: Thursday, March 11, 2004 1:36 AM To: [EMAIL PROTECTED] Subject: [PHP] apache lookdown Hi all, A long time ago I became accustomed to writing my php navigation structure using what I think is called apache lookdown (correct me if im wrong). Basically what it does is when a user types in www.example.com/index.php/doc/1/ apache checks to see if there is a directory called index.php/doc/1/ if there is it goes to it otherwise it goes down the chain until it gets to index.php. Now I have been using this for quite some time, I think its pretty cool, because it provides the user with a user friendly URI, and apparently google likes it too. Problem I am in the process of moving a site that uses this onto another server, that other server (Linux Red Hat, Apache 2.0) doesn't do the lookdown. It simply returns 404. Does anybody know how to fix this? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Suggest for List
General List http://marc.theaimsgroup.com/?l=php-general CVS list http://marc.theaimsgroup.com/?l=php-cvs&r=1&w=2 Dev List http://marc.theaimsgroup.com/?l=php-dev&r=1&w=2 Install http://marc.theaimsgroup.com/?l=php-install&r=1&w=2 KB http://marc.theaimsgroup.com/?l=php-kb&r=1&w=2 Migration http://marc.theaimsgroup.com/?l=php-migration&r=1&w=2 Pear http://marc.theaimsgroup.com/?l=php-pear&r=1&w=2 QA http://marc.theaimsgroup.com/?l=php-qa&r=1&w=2 Template http://marc.theaimsgroup.com/?l=php-template&r=1&w=2 Windows http://marc.theaimsgroup.com/?l=php-windows&r=1&w=2 PHP4 Beta http://marc.theaimsgroup.com/?l=php4beta&r=1&w=2 And there is more here http://marc.theaimsgroup.com/?w=2 just scroll down to the www section. Thank you Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com 1-800-269-6397 -Original Message- From: April [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 01, 2001 1:18 PM To: Philip Olson; Benjamin Munoz Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Suggest for List oh look, someone's getting snippy with me for speaking on the list and admitting I'm a newbie already. Patronizing does get to be a reflex action after hearing the same question so many times, yeah. But if I can't post about the goodness/badness of having a newbie list and an advanced list, because I wasn't here in 1999 for the first one and had no idea it had happened, without being given tips on how to search google and get out of your hair while you discuss big boy things... If the volume is enough to make the experts snippy (which it does regularly), why are the experts this huge asset the newbies can't lose? If it's something that no one on the newbie list could answer, someone could just ask on the advanced list. Anyway, on a trying not to be controversial and contrary note, where are the archives? People keep saying that, but I can't find any that work. - Original Message - From: "Philip Olson" <[EMAIL PROTECTED]> To: "Benjamin Munoz" <[EMAIL PROTECTED]> Cc: "'April'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, February 01, 2001 2:03 PM Subject: RE: [PHP] Suggest for List > > One suggestion for all newbies (and all) is this : > > Search the archives > > Search google > > Figure out a few keywords that will be in the answer and/or question and > do a search. Go here : > > http://marc.theaimsgroup.com/?l=php-general > > Q: "I want to redirect using php, how?" > T: "redirect" or "redirection" > > Q: "When i use rand() it not work, why???" > T: "random" or "rand" or "mt_rand" > > Or, let's say PHP gives an error, search them too : > > Q: Headers already sent, wtf?! > T: "headers already sent" and/or "Cannot add header information" > > Remember, the archive is HUGE so sift through the pages, use the > navigation (next in thread, next => ...) and usually an answer will be > found. YOU ARE NOT ALONE! > > When using google, append the term "PHP" and guess what, it works! Google > is amazing, it searches the entire world, all mailing lists, faqts, sites, > etc. A little research goes a long ways and who knows what else will be > learned during this process (hint: a lot). I digress. Want to play a > little game? For every question you see, research archives/google and see > how long it takes to find an answer. It's fun! But, each to their own. > It's easy to get frustrated by repeat questions but we must realize it's > not the same person asking over and over ... > > Regards, > > Philip Olson > http://www.cornado.com/ > > > > On Thu, 1 Feb 2001, Benjamin Munoz wrote: > > > April, > > > > There was a discussion like in 1999 (i remember cuz I was learning PHP > > then), and Richard Lynch (i think) had a good point that splitting the list > > would reduce the quality of the answers on the beginners list--PHP newbies > > answering each others questions, you see. > > > > Newbies should continue to post here. A tip: some developers preface their > > posts with something like: "newbie question". If you do this, you'll likely > > get flooded with friendly and helpful responses.Try it :) > > > > -Ben > > > > -Original Message- > > From: April [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, February 01, 2001 11:25 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] Suggest for List > > > > > > I've been searching for a muc
RE: [PHP] how to specify the sender email address in the mail() function?
Try this mail($recipient,"subject"," $content ","From: $sender\nReply-To: $sender\nX-Mailer: PHP/" . phpversion()); Hope this helps Thank you Brian Paulson Sr. Web Developer [EMAIL PROTECTED] http://www.chieftain.com 1-800-269-6397 -Original Message- From: david klein [mailto:[EMAIL PROTECTED]] Sent: Friday, February 02, 2001 12:25 PM To: [EMAIL PROTECTED] Subject: [PHP] how to specify the sender email address in the mail() function? It seems that mail($recipient, $subject, $content) has no place to specify the sender's email address. Does anyone know how to specify the sender's email address? Thanks, David _ Get your FREE download of MSN Explorer at http://explorer.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]