[PHP-CVS] cvs: php4 /ext/imap php_imap.c
thies Wed Feb 21 12:33:46 2001 EDT Modified files: /php4/ext/imap php_imap.c Log: fix possible leak. Index: php4/ext/imap/php_imap.c diff -u php4/ext/imap/php_imap.c:1.56 php4/ext/imap/php_imap.c:1.57 --- php4/ext/imap/php_imap.c:1.56 Sun Feb 18 10:15:01 2001 +++ php4/ext/imap/php_imap.cWed Feb 21 12:33:46 2001 @@ -25,7 +25,7 @@ | PHP 4.0 updates: Zeev Suraski <[EMAIL PROTECTED]> | +--+ */ -/* $Id: php_imap.c,v 1.56 2001/02/18 18:15:01 thies Exp $ */ +/* $Id: php_imap.c,v 1.57 2001/02/21 20:33:46 thies Exp $ */ #define IMAP41 @@ -732,6 +732,8 @@ } } efree(hashed_details); + efree(IMAPG(imap_user)); IMAPG(imap_user) = 0; + efree(IMAPG(imap_password)); IMAPG(imap_password) = 0; RETURN_FALSE; } @@ -741,6 +743,8 @@ node = malloc(sizeof(pils)); if (node == NULL) { efree(hashed_details); + efree(IMAPG(imap_user)); IMAPG(imap_user) = 0; + efree(IMAPG(imap_password)); IMAPG(imap_password) = 0; RETURN_FALSE; } @@ -777,6 +781,8 @@ free(headp); efree(hashed_details); + efree(IMAPG(imap_user)); IMAPG(imap_user) = 0; + efree(IMAPG(imap_password)); IMAPG(imap_password) = 0; RETURN_FALSE; } @@ -789,6 +795,8 @@ if (imap_stream == NIL) { php_error(E_WARNING, "Couldn't open stream %s\n", (*mailbox)->value.str.val); + efree(IMAPG(imap_user)); IMAPG(imap_user) = 0; + efree(IMAPG(imap_password)); IMAPG(imap_password) = 0; RETURN_FALSE; } -- PHP CVS 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] help change filename.
Hi! I am trying to change a filename this is my php: It doesn´t work do I need some more code to get it working, something like fopen? Thanks for any help. Regards Jan -- 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] fread over ftp
I'm having some trouble reading a text file from a remote server into a string. The code is as follows: if( !($fd = @fopen($ftp_url, "r")) ){ $error = true; $error_msg = "Unable to connect to server."; } else { $file_contents = fread($fd, 10); fclose($fd); } if( empty($file_contents) ){ $error = true; $error_msg = "Did not read file."; } The problem is that the fread doesn't always succeed; about about half the time the $file_contents string tests as empty. There is never a problem with the fopen, and there doesn't seem to be any consistancy in the failure... The same file may be loaded into the string on run one, and missing the next. The remote server is NT-based. Does anybody know what is going wrong here? I don't have to add any logic to "wait" for the fread to complete, do I? Thanks, mth. -- 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] pop textarea field w/ text incl. quotes
Is it necessary to include the 'http:' in the DB field? It would make your life a lot easier to drop it. You would then store the url values as www.mydomain.com Then, modify your code to add the 'HTTP' whenever it encounter a URL, or wherever you will create a link. This would eliminate the need to deal with special characters... __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com "The world is waiting, are you ready?" -+___+- On Wed, 21 Feb 2001, Paul Warner wrote: > Simon- > > Thanks for the tip...I trued using the htmlspecialchars() which allowed the > remainder of the form to display properly, but left no value in the > textarea. Then I noticed a difference in the method I was using compared to > yours - I'm still learning the ways of PHP so it will take me a while to > determine the significance of the syntax differences: > > Mine: value="htmlspecialchars($linkurl)">\n' ?> > > Yours: " . htmlspecialchars($link) . "" ?> > > I wanted a graphical representation of the present link displayed above the > textarea and then attempted to use php's substitution to build the text area > within the same string. I updated my code to be more like yours and arrived > at: > > '?>" . > htmlspecialchars($linkurl) . "\n"?> > > which seems to make the parser behave as I intended. > > Anyway...thanks! > > -- Paul > > - Original Message - > From: "Simon Garner" <[EMAIL PROTECTED]> > To: "Paul Warner" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, February 21, 2001 8:19 PM > Subject: Re: [PHP] pop textarea field w/ text incl. quotes > > > > Don't worry about quotes - the problem is that you have HTML markup inside > > your . You just need to convert < and > to < and >, > > respectively, in your link text. The functions htmlspecialchars() or > > strip_tags() can do this for you. > > > > i.e.: > > > > " . htmlspecialchars($link) . "" ?> > > > > When the form is submitted (and when it's viewed), those entities will be > > converted back to their real characters automatically by the browser. > > > > > -- > 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 Digest 22 Feb 2001 01:08:34 -0000 Issue 526
php-general Digest 22 Feb 2001 01:08:34 - Issue 526 Topics (messages 40941 through 41086): Re: Deleting mySql records based on dates 40941 by: Kevin Cawthorne 40943 by: Christian Reiniger 40945 by: Kevin Cawthorne 40949 by: php3.developersdesk.com Re: email a page as attachment 40942 by: Adrian Murphy Re: access violation 40944 by: Phil Driscoll 40983 by: Wade Halsey Re: Terrible Hosting Experience 40946 by: Brian V Bonini 40951 by: Thomas Deliduka 40959 by: Hrishi 40963 by: Brian V Bonini 40964 by: Jason Bouwmeester 40967 by: Jeff Oien 40974 by: Hrishi 40976 by: Hrishi 40979 by: Jeff Oien 40980 by: Toby Miller 40986 by: Thomas Deliduka 40987 by: Thomas Deliduka 40989 by: Thomas Deliduka 40990 by: Brian V Bonini 40995 by: Gary 41011 by: Boaz Yahav 41016 by: Richard McLean 41023 by: Brian V Bonini 41025 by: Brian V Bonini 41027 by: Brian V Bonini Editing a files hex? 40947 by: Matt 40968 by: Chris Lee Re: reference, foreach, array (FYI) 40948 by: Yasuo Ohgaki IBase Help 40950 by: Niel Zeeman MIME type detection on file 40952 by: Andris Jancevskis 40972 by: Chris Lee 40981 by: Andris Jancevskis 40985 by: Chris Lee Getting the file a PHP script is called from 40953 by: Dan Watt 40975 by: Chris Lee 41054 by: Dan Watt Re: PHP vs. FreeTDS 40954 by: Mark Roedel POST against GET 40955 by: Denis L. Menezes 40977 by: Chris Lee How to pipe a command output into another command 40956 by: Martin Kong 40962 by: Sebastian Stadtlich array headaches 40957 by: Matt Williams 40958 by: Pavel Kalian 40965 by: Matt Williams 40969 by: Jason Stechschulte 40971 by: Matt Williams 41080 by: David Robley Re: .ins file 40960 by: Chris Lee HTTP_REFERER doesn't work with redirects...? 40961 by: Dhaval Desai Re: Document Management System in PHP 40966 by: clayton collie I need some advice 40970 by: Ana Carolina Blanco Abascal Apache & php as a DSO module woes! 40973 by: Bob Horton fopen 40978 by: Boget, Chris Displaying an image, that is pulled from a DB, inline 40982 by: Boget, Chris 40984 by: Chris Lee Session files? (Very Techy Questions) 40988 by: Michael Zornek 40999 by: Sebastian Stadtlich 41008 by: Michael Zornek 41037 by: php3.developersdesk.com Variable Strangeness 40991 by: Jason Murray 40992 by: Boget, Chris 40997 by: php3.developersdesk.com 41002 by: Chris Lee AS400 Insert - The answer 40993 by: Karl J. Stubsjoen Accessing variables from a form 40994 by: Don 41000 by: Chris Lee 41001 by: Pavel Jartsev GD / FreeType2 40996 by: Dale Frohman Handling File Uploads : ASCII/Binary transfers 40998 by: Jeff Gannaway 41006 by: Chris Lee Making .phtml an extension 41003 by: Brandon Orther 41004 by: Jon Haworth 41007 by: Pavel Jartsev 41009 by: Angerer, Chad 41024 by: Michael Stearne Warning: page expired and cache-control header 41005 by: Janet Valade Re: Postgresql session handling 41010 by: Bolt Thrower a good hosting experience 41012 by: Julie Meloni 41035 by: Mark Maggelet 41038 by: Jeff Gannaway 41043 by: ..s.c.o.t.t.. 41045 by: Mark Maggelet 41050 by: Javier Muniz 41068 by: Brian V Bonini Re: HELP! IBase - PHP 41013 by: Brett Bandy Configuring PHP4 on pair.com 41014 by: Jeff Oien 41026 by: Michael Stearne 41029 by: Jeff Oien 41076 by: Jeff Oien How to get information from 41015 by: Zenith 41081 by: David Robley How can I log message, by syslogd? 41017 by: Zenith 41036 by: Chris Lee session var not carrying 41018 by: W.D. Re: I am looking for an image library that can do blurs 41019 by: Matt McClanahan I'm confused about Regular Expressions. 41020 by: Kenneth R Zink II 41032 by: php3.developersdesk.com 41056 by: Robin Vickery Form Variables! 41021 by: Bruno Freire 41022 by: Boget, Chris How to issue a new session without closing the browser? 41028 by: Evelio Martinez Tough one? 41030 by: Mike 41034 by: Jason Stechschulte 41055 by: Robin Vickery 41059 by: Shawn Esplin Print in html Try something like: $time = time(); // unix time now $day_limit = 28; // how many days to allow $day = 86400; // how many seconds in 24 hours(1 day) $difference = bcmul($day_limit,$day); // multiply the seconds($day) by the day limit($day_limit) $limit = bcs
RE: [PHP] Terrible Hosting Experience
That was just an FYI... If it happens again I'll let you know and you can pursue it with them. > -Original Message- > From: Boaz Yahav [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 21, 2001 12:22 PM > To: '[EMAIL PROTECTED]'; Boaz Yahav; Krznaric Michael; 'Thomas > Deliduka'; PHP List > Subject: RE: [PHP] Terrible Hosting Experience > > > I'm at my site all day and I'm coming from Israel. > I never had a downtime problem. > > As for service, I forwarded your mail to them and it took them > about 5 minutes to reply that they would be more than happy > to get your IP and go over any problem you might have reaching > WeberDev.com. > > Now, how is that for service? > > Sincerely > > berber > > Visit http://www.weberdev.com Today!!! > To see where PHP might take you tomorrow. > > > -Original Message- > From: Brian V Bonini [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 21, 2001 3:45 PM > To: Boaz Yahav; [EMAIL PROTECTED]; Krznaric Michael; 'Thomas Deliduka'; > PHP List > Subject: RE: [PHP] Terrible Hosting Experience > > > H, I have to tell you, and perhaps your not aware, > but I've gone to your site many times and had it not > come up. Then have the traceroutes reveal that the site > was unreachable at it's final destination. > > -Brian > *** > > > -Original Message- > > From: Boaz Yahav [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, February 21, 2001 2:16 AM > > To: '[EMAIL PROTECTED]'; Krznaric Michael; 'Thomas Deliduka'; PHP > > List > > Subject: RE: [PHP] Terrible Hosting Experience > > > > > > Guys, > > > > When you decide you want to pay for hosting and get the best > > service possible check out : > > > > http://www.weberdev.com/index.php3?GoTo=phenominet/prices.htm > > > > This is your one stop shop for hosting. WeberDev.com is hosted there > > and I can tell you that their service is amazing. They are > fast, reliable > > and more than anything, very professional (specially in PHP / MySQL). > > > > Sincerely > > > > berber > > > > Visit http://www.weberdev.com Today!!! > > To see where PHP might take you tomorrow. > > > > > > -Original Message- > > From: Brian V Bonini [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, February 21, 2001 1:20 AM > > To: Krznaric Michael; 'Thomas Deliduka'; PHP List > > Subject: RE: [PHP] Terrible Hosting Experience > > > > > > Hmmm, last I heard they were using an OC-3 circuit, > > that's not too impressive. lots of those floating > > around. We've been running on an OC-48 for some > > time now > > > > > -Original Message- > > > From: Krznaric Michael [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, February 20, 2001 5:56 PM > > > To: 'Thomas Deliduka'; PHP List > > > Subject: RE: [PHP] Terrible Hosting Experience > > > > > > > > > I was about to buy a server from Alabanza. Am I ever glad I > > didn't. The > > > only thing impressive about them is their connection. And for > > all I know > > > they could be lying about that, as well. > > > > > > Mike > > > > > > -Original Message- > > > From: Thomas Deliduka [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, February 20, 2001 3:18 PM > > > To: PHP List > > > Subject: Re: [PHP] Terrible Hosting Experience > > > > > > > > > On 2/20/01 3:17 PM this was written: > > > > > > > We host and provide servers to a good number > > > > of clients that have come over from Alabanza. > > > > All of them complaining of similar experiences > > > > I think that company has been plagued for a > > > > long time > > > > > > I agree. I have dealt with them on one level or another since > 1997. They > > > used to have great customer service and skillful people. Well, > > > those people > > > left out of frustration and better opportunities and they were > > > replaced with > > > idiots. These idiots that man their help desks and other > > > services now have > > > very little to know about how to even work a computer. > > > > > > I know that they have their help their help-desk in a college town and > > > employ people from the university. Some of the CS reps are > > philosophy and > > > other liberal arts students. > > > > > > I called one day to give my updated credit card information to a > > > billing rep > > > but they weren't in so I got a CS rep. They said, "You can update it > > > online", I said, "Your control panel isn't behind a secure > > server. I will > > > not update my Credit card information online." I asked her > > write it down, > > > put it in an envelope and deliver it to the billing rep by hand. > > > The CS rep > > > said, "No problem." > > > > > > About a week later I received an e-mail. I was forwarded from the > > > CS rep the > > > conversation that took place 0VER E-MAIL with my CC information > > > included in > > > the e-mail from the very first sending. I was so mad. I told > > her that she > > > just compromised my CC number! She said, "But I sent it right to > > > her in the > > > office." I said,
Re: [PHP] crontab help
put a sleep(300); at the end of your while() loop - I did this on my mass mailer and it worked like a charm. --Joe On Fri, Feb 22, 2002 at 02:53:10PM +0800, Arnold Gamboa wrote: > hi there. > > is there a way to tell crontab to do: > > "run script every 5 mins for 1 hour".. > > i have this mass email script that is so huge that i need it to chunk into > records and make sure that it will run every 5 mins for 1 hour. > > Thanks for any help. > -- --- Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V --- -- 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-CVS] cvs: php4 /ext/ircg ircg.c
sas Wed Feb 21 11:58:32 2001 EDT Modified files: /php4/ext/ircg ircg.c Log: Allow users to set the ident string which we use to register with the IRC server. Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.33 php4/ext/ircg/ircg.c:1.34 --- php4/ext/ircg/ircg.c:1.33 Sun Feb 18 04:44:34 2001 +++ php4/ext/ircg/ircg.cWed Feb 21 11:58:32 2001 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: ircg.c,v 1.33 2001/02/18 12:44:34 sas Exp $ */ +/* $Id: ircg.c,v 1.34 2001/02/21 19:58:32 sas Exp $ */ #include "php.h" #include "php_ini.h" @@ -86,6 +86,7 @@ php_fmt_msgs_t *fmt_msgs; irc_write_buf wb; HashTable ctcp_msgs; + char *ident; /* NOT available outside of ircg_pconnect or register_hooks */ } php_irconn_t; static char *fmt_msgs_default[] = { @@ -580,6 +581,15 @@ static void register_hooks(irconn_t *conn, void *dummy) { + php_irconn_t *irconn = dummy; + + if (irconn->ident) { + smart_str m; + + smart_str_sets(&m, irconn->ident); + irc_set_ident(conn, &m); + } + irc_register_hook(conn, IRCG_MSG, msg_handler); irc_register_hook(conn, IRCG_QUIT, quit_handler); irc_register_hook(conn, IRCG_ERROR, error_handler); @@ -617,21 +627,23 @@ PHP_FUNCTION(ircg_pconnect) { - zval **p1, **p2, **p3, **p4 = NULL, **p5 = NULL; + zval **p1, **p2, **p3, **p4 = NULL, **p5 = NULL, **p6; const char *username; const char *server = "0"; + const char *ident = NULL; int port = 6667; php_fmt_msgs_t *fmt_msgs = NULL; php_irconn_t *conn; - if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 5 - || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3, &p4, &p5) == FAILURE) + if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 6 + || zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3, &p4, +&p5, &p6) == FAILURE) WRONG_PARAM_COUNT; switch (ZEND_NUM_ARGS()) { + case 6: + convert_to_string_ex(p6); + ident = Z_STRVAL_PP(p6); case 5: - if (Z_TYPE_PP(p5) != IS_ARRAY) - WRONG_PARAM_COUNT; case 4: convert_to_string_ex(p4); fmt_msgs = lookup_fmt_msgs(p4); @@ -652,6 +664,7 @@ */ conn = malloc(sizeof(*conn)); conn->fd = -1; + conn->ident = ident; zend_hash_init(&conn->ctcp_msgs, 10, NULL, NULL, 1); if (irc_connect(username, register_hooks, @@ -659,9 +672,10 @@ free(conn); RETURN_FALSE; } - if (p5) { + if (p5 && Z_TYPE_PP(p5) == IS_ARRAY) { ircg_copy_ctcp_msgs(p5, conn); } + conn->ident = NULL; conn->fmt_msgs = fmt_msgs; irconn_id++; conn->irconn_id = irconn_id; -- PHP CVS 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 hosting experience
liquidweb.com has some nice looking deals. last time i checked, they supported MySQL/PHP/Perl/lots of other stuff > -Original Message- > From: Jeff Gannaway [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 21, 2001 05:59 > To: Mark Maggelet; [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP] a good hosting experience > > > Don't know your definition of CHEAP but check out OLM.net or webAXXS.net > (they're the same company, just different marketing plans). I've recent;y > signed up for their new RSE servers which are a real bargain in my > opinion... but then again I've got a site with 650 meg of graphics plus 6 > or 7 smaller sites > > -Jeff > > At 10:49 AM 2/21/01 -0800, Mark Maggelet wrote: > >Right now I'm looking for a cheap virtual host that runs mysql > >3.23.30 or higher, does anybody know one? > > ___ > > 2001 Wall Calendars >* Art, Jazz, Blues, Women's, African-American. >* Everyday Discounts. >* Excellent paper and reproductions. > > And as always, a great selection of abstract, > contemporary and African-American art prints. > > PopStreet.com is your avenue to art. > http://www.popstreet.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]
Re: [PHP] crontab help
thanks for the comment let's just say i have 100k emails to send... don't you think that will drain the system resources if i send it all at once even if you have usleep(300) on each while? your comment please. > put a sleep(300); at the end of your while() loop - I did this on my mass > mailer and it worked like a charm. > > --Joe > > On Fri, Feb 22, 2002 at 02:53:10PM +0800, Arnold Gamboa wrote: > > hi there. > > > > is there a way to tell crontab to do: > > > > "run script every 5 mins for 1 hour".. > > > > i have this mass email script that is so huge that i need it to chunk into > > records and make sure that it will run every 5 mins for 1 hour. > > > > Thanks for any help. > > > > -- > > -- - > Joe Stump, PHP Hacker, -o) > http://www.miester.org http://www.care2.com /\\ > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V > -- - > > > -- 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 hosting experience
On Wed, 21 Feb 2001 14:55:25 -0800, ..s.c.o.t.t.. ([EMAIL PROTECTED]) wrote: >liquidweb.com has some nice looking deals. > >last time i checked, they supported >MySQL/PHP/Perl/lots of other stuff well, most hosts do, but not many are using 3.23.30 or higher. I'm looking for a host that somebody knows for sure is running a current version of mysql. thanks, - Mark -- 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] HELP! IBase - PHP
What do you mean flatlines? Does the solaris machine's CPU move to ~100% utilization? You might be hitting the automatic garbage collection. Use gstat -h to watch your transactions states. Particularly the oldest transaction and the oldest interesting transaction. By default an auto garbage collection kicks off when the difference between these two numbers is 2. If this is happening it might indicate that you aren't using your transactions as effective as possible. For example leaving them open for extended periods of time. hope this helps, Brett Bandy ""Niel Zeeman"" <[EMAIL PROTECTED]> wrote in message 001c01c09bf9$4cd89c00$756410ac@NielZ">news:001c01c09bf9$4cd89c00$756410ac@NielZ... Hi there I have a big problem and would greatly appreciate help.. I have a production site runnig the php4.0.4 isapi on IIS5 with a ibase backend db running on solaris Now I have the problem that when ever a couple of people( 2-6) login from the web the database flatlines... This is with about 10-30 local users logged into the db aswell. the site is basically a data capturing site please any help is welcome thanks Niel Zeeman Tel(W): (043)7014247 Cell: 082 651 4083 eMail: [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] Tough one?
I'm not sure this is the best way to do it, but you could try: $keys = array_keys($HTTP_POST_VARS); for($x = 2; $x < (count($keys) - 1); $x++) { $updateString=$updateString.$keys[$x]."='".$HTTP_POST_VARS[$keys[$x]]."',"; } $x++; $updateString=$updateString.$keys[$x]."='".$HTTP_POST_VARS[$keys[$x]]."'"; or: $keys = array_keys($HTTP_POST_VARS); for($x = 2; $x < count($keys); $x++) { if($x != (count($keys) - 1)) { $updateString=$updateString.$keys[$x]."='".$HTTP_POST_VARS[$keys[$x]]."',"; } else { $updateString=$updateString.$keys[$x]."='".$HTTP_POST_VARS[$keys[$x]]."'"; } } -Original Message- From: Mike [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 21, 2001 11:34 AM To: [EMAIL PROTECTED] Subject: [PHP] Tough one? I am building an update string on the fly from form fields.I am trying to add a comma between fields but I cant have one after the last field.This is the code that doesnt work.Also I cant have a comma at all in a table with only one updated field. $keys = array_keys($HTTP_POST_VARS); for($x = 2; $x < count($keys); $x++) { $updateString=$updateString.$keys[$x]."='".$HTTP_POST_VARS[$keys[$x]]."',"; Thanks Mike [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] crontab help
hi there. is there a way to tell crontab to do: "run script every 5 mins for 1 hour".. i have this mass email script that is so huge that i need it to chunk into records and make sure that it will run every 5 mins for 1 hour. Thanks for any help.
[PHP] PDF Problems
Hi, I am running PHP4.04pl1, pdflib3.03, jpeg6b, tiff3.5.5, apache1.3.17. Some of the pdf functions work, but others don't, such as pdf_new(). Does anybody know what the problem is? I have been all over the documentation, email archives, and support discussions at phpbuilder.com thanks, Sam
[PHP] Handling File Uploads : ASCII/Binary transfers
I'm no whiz with header types, so my attempts with the PHP.net docs wasn't too successful... Here's the deal. My customer needs to upload an ASCII export file of database info generated by MS Access on their PC. I've written a script that allows them to upload their Access files then does a LOAD DATA INFILE command to integrate it into the MySQL database on the web server. The problem is that whatever transfer method is used is causing some data corruption. I ran into this problem before when I was manually FTPing export files then using LOAD DATA INFILE. I fixed it by switcheing from Binary FTP to ASCII FTP. How can this be done with a PHP script??? Thanks! -Jeff Gannaway ___ 2001 Wall Calendars * Art, Jazz, Blues, Women's, African-American. * Everyday Discounts. * Excellent paper and reproductions. And as always, a great selection of abstract, contemporary and African-American art prints. PopStreet.com is your avenue to art. http://www.popstreet.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] Accessing variables from a form
ok here we are, your code is *almost* correct, but even syntaxialy correct doesnt mean it should be used :) use arrays, its a tone easier. to fix your code change $name =& $field; to $name = $$field; now to make the code, a ton easier to use, use arrays. "; ... ?> $val) { echo $val; } ... ?> arrays are great things, use them lost :) haha -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 "Don" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > I'm in a quandary here. I have a form which contains sever tables each > containing similar fields. The number of tables are dynamic based on > vales I retrieve from a database. Each table has the following fields: > > $name > $phone > $fax > > In order to differentiate the filed names in my form, I created a loop > and extended each field name with the loop iteration as such ($rownum is > my loop counter): > > > " > " > " > > So I would have field variables of: > $name1, $name2, $name3, ... > $phone1, $phone2, $phone3, ... > $fax1, $fax2, $fax3, ... > > So far so good as I have verified that these fields exist. > > Now, when the user clicks on the submit button, the form data gets > posted to a PHP script. I wish to access the variables but here I am at > a loss. I attempted the following code without success ($rownum is the > number of tables I created): > > for ($i = 1; $i <= $rownum; $i++) { > $field = "phone" . $i; > $name =& $field; > echo $field . ":" . $name . "\n"; > } > > The docs state that references are NOT pointers. So., how can I > access my variables? I could not find any information on Macros or > Pointers. > > Thanks, > Don > > > > > -- > 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] ZEND_DEBUG
Hello All, Is there a way to turn ZEND_DEBUG on or off without recompiling? 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]
Re: [PHP] PDF Problems
After spending a lot of time on this I think I almost have it figured out. I don't think it is a problem with the install. A found on php.net where when using pdflib 3.03, pdf_new() doesn't work. The fix is at the bottom of http://www.php.net/manual/en/ref.pdf.php It says to change pdf_new() to the following: header( "Content-type: application/pdf" ); Doesn't work for me, so I put From: Michael Stearne <[EMAIL PROTECTED]> > Date: Wed, 21 Feb 2001 17:31:45 -0500 > To: Sam Goin <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] PDF Problems > > What OS and glibc version? There are problems with the set-up in RH7. > > Michael > > > Sam Goin wrote: > >> Hi, >> >> I am running PHP4.04pl1, pdflib3.03, jpeg6b, tiff3.5.5, apache1.3.17. >> >> Some of the pdf functions work, but others don't, such as pdf_new(). >> >> Does anybody know what the problem is? I have been all over the >> documentation, email archives, and support discussions at phpbuilder.com >> >> thanks, >> >> Sam > > > -- > 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] Generating percentages of numbers
My idea is so easy it can't be right but here goes. Couldn't you read the total and page count into an array, the divide array values 1-3 by array value 0 and multiply that by 100? In other words: $row[0] = 1000; $row[1] = 500; $row[2] = 250; $row[3] = 250; array[1]/array[0] = 0.5 * 100 = 50 array[2]/array[0] = 0.25 * 100 = 25 array[3]/array[0] = .25 * 100 = 25 Like I said it's too simple but I haven't tested it so I'm probably missing something. John Guynn This email brought to you by RFCs 821 and 1225. -Original Message- From: Blake S. [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 21, 2001 4:15 PM To: [EMAIL PROTECTED] Subject: [PHP] Generating percentages of numbers I have a database of numbers: TOTAL HITS: 1000 PAGE 1: 500 PAGE 2: 250 PAGE 3: 250 How can I query these numbers and display back a percentage number? For instance with the numbers above: PAGE 1: 50% PAGE 2: 25% PAGE 3: 25% Or is their a process by which to store numbers for easily getting this to work? -- 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] resizing images
I have been using the tools from ImageMagick (convert) to create thumb nails of pictures upload to our site. Once you have the uploaded file just: if (exec('convert -w 100x100 ... src_file dest_file')) { error } I hope this helps. Dale Frohman wrote: > Does anyone know of a way to resize images as they are being uploaded? > Would you write these images to a mysql database or straight to a file on > the server? The pictures will be small < 100k > > 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]
RE: [PHP] Configuring PHP4 on pair.com
Just wanted to say pair.com upgraded my server today and it went so smoothly I didn't even notice it. They now have PHP4 on my server. pair.com is a great hosting service as long as you don't need hand holding or super quick tech support. Jeff Oien > > I went through this installation process to install PHP4 on a pair > > server. When I try to run a PHP script I get an internal server error > > with this: Premature end of script headers: /usr/www/users//cgi-bin/php4.cgi > > What should I do from here? Thanks. > > Jeff Oien -- 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] Session problems
We have designed a web based email program that we have recently found a problem with...If you open up two email accounts in two different browser windows, the first window opened takes on the session that the second window is in. It appears that you can open up as many sessions as you like, but all open windows take on the session properties of the most recently opened session...This happens in Windows and Linux with either IE or Netscape...Has anyone else had this problem and if so how can I work around it... Thanks, -- Jack Davis Network Administrator Bootheel Internet Services [EMAIL PROTECTED] (573)888-0075 fax (573)888-0098 -- 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] Re: How to issue a new session without closing the browser?
I'm not sure what is the original function design of session_destory(). Committing that, my code does not delete currently registered session data from memory. This result in writing currently registered session write to session database again unless programmer explicitly unregister them. If you want to delete session data in memory, you can do that in pg_session_destory() or anywhere in you can use session_unset() to unset all session variables. User session handlers are called in this order. session is started explicitly or implicitly then pg_session_open() called and data is read using pg_session_read() at that time programmer can see session variables. (If programer calls my pg_session_destory() it only deletes data in db and data is still in memory) connection is closed. pg_session_write() is called (since session data is in memory, write back to session database) then pg_session_close() is called. I thought deleting only session data in database would give more freedom to programmers while working session variables. It might be better to put session_unset() in pg_session_destory(), if it suppose to. Regards, --- Yasuo Ohgaki === Original Message === Hi! I have used your postgresql session functions in http://www.php.net/manual/en/ref.session.php with few changes. I have a login.php page that register 3 things - the pg_connect string, - a login flag to indicate that we already have done the login - actual time In a second php page I test - if login variable is set, if not I redirect to the login page. - if time has expired, if affirmative redirect to login page I have added a "pg_session_destroy" in your "user functions" to delete the actual session but when I reenter in the login page the session_start() re-creates the data I have just deleted with the same session_id. I would like to know how to issue a new session without closing the browser? What did I missed? - Working with php 4.0.4 - php.ini contains session.auto_start Off session.cache_expire 180 session.cache_limiter nocache session.cookie_domain no value session.cookie_lifetime 0 session.cookie_path / session.cookie_secure Off session.entropy_file no value session.entropy_length 0 session.gc_maxlifetime 60 session.gc_probability 1 session.name PHPSESSID session.referer_check no value session.save_handler user session.save_path /tmp session.serialize_handler php session.use_cookies On - track_vars and gpc_globals are not enabled TIA -- Evelio Martínez -- 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] pop textarea field w/ text incl. quotes
This must be why you guys get paid the big $$ . I _never_ thought of looking at the HTML for errors, doh! Given the nature of the user who will be inputting the data (familiar with HTML) I will probable keep this 'quick-n-dirty' for now - I do like the multiple fields concept for future mods as it will allow for less-HTML literate users to easily build their links. Thanks a bunch! -- Paul - Original Message - From: "Simon Garner" <[EMAIL PROTECTED]> To: "John Monfort" <[EMAIL PROTECTED]>; "Paul Warner" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, February 21, 2001 8:53 PM Subject: Re: [PHP] pop textarea field w/ text incl. quotes > From: "John Monfort" <[EMAIL PROTECTED]> > > > > > > > Is it necessary to include the 'http:' in the DB field? > > > > It would make your life a lot easier to drop it. > > > > You would then store the url values as > > www.mydomain.com > > > > Then, modify your code to add the 'HTTP' whenever it encounter a URL, or > > wherever you will create a link. > > > > This would eliminate the need to deal with special characters... > > > > > No it wouldn't, as the http:// is not the problem, the problem is the HTML > markup. What Paul could do is have two DB fields, for the URL and the link > text, and then form the tag at runtime instead of in the data. But this > maybe is not what he wants. > > Eg > > $linkurl = "http://www.blah.com"; > $linktext = "Blah"; > > echo "$linktext"; > ?> -- 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] Tough one?
> "M" == "Mike" <[EMAIL PROTECTED]> writes: > I am building an update string on the fly from form fields.I am > trying to add a comma between fields but I cant have one after the > last field.This is the code that doesnt work.Also I cant have a > comma at all in a table with only one updated field. > $keys = array_keys($HTTP_POST_VARS); > for($x = 2; $x < count($keys); $x++) > { > $updateString=$updateString.$keys[$x]."='".$HTTP_POST_VARS[$keys[$x]]."',"; > } OK, making assumptions about the order of the fields in the form is dangerous. Making assumptions about the order of an associative array is doubly so, although PHP seems remarkably forgiving about it. But assuming that's really what you want: $value) $pairs[] = $key . "='" . $value . "'"; $updateString .= join(', ', $pairs); ?> -- Robin Vickery. BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE -- 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] Terrible Hosting Experience
> On Wednesday 21 February 2001 20:54, Jeff Oien wrote: > > I would agree. I've had clients hosted on pair for quite a while. > > They are still using PHP 3 however. > 'almost complete control of the server' includes the ability to compile your > own PHP and use it to run the place :) of course, this doesnt mean you get to > hack at the modules. Is there documentation anywhere about how I can do that? I've only installed PHP on my Windows machine. Thanks. Jeff Oien -- 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] getting what's between
Maybe something along the lines of: $results = eregi("Item3[a-Z 0-9]", $data); -David On Wed, 21 Feb 2001 23:32:04 -0600, Tyler Longren said: > Hello, > > I've been reading a LOT on how to solve my problem today, but haven't been > able to come up with anything yet. > > Here's my problem: > I have an html file that contains many table rows like this: > > Item1Item1 Again > Item2Item2 Again > Item3Item3 Again > Item4Item4 Again > > And so on. I want to search this html for a table row that has 'Item3' in > the first cell. And the second cell should contain 'Item3 Again'. I know > that I can do this with something like this: > > $file = fopen("http://localhost/html.html", "r"); > $data = fread($file, 1); > $results = eregi("Item3Item3 Again", $data); > > > However, this won't exactly work for me, because that contents of the > second cell will change daily, so tomorrow, the third table row could look > like this: > > Item3Item3 Has Changed > > I was thinking I could use sscanf() to do this, but couldn't get anything > to work. I've tried everything I can think of. > > Sorry if the explanation of my problem was hard to understand, I don't > exactly understand it myself. Thanks everybody!!! > > Regards, > Tyler Longren > > > -- > 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] > -- TANSTAAFL -- 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-CVS] cvs: php4 /sapi/thttpd thttpd.c
sas Wed Feb 21 12:25:53 2001 EDT Modified files: /php4/sapi/thttpd thttpd.c Log: If we cannot send the header, we don't need to continue with the page. Index: php4/sapi/thttpd/thttpd.c diff -u php4/sapi/thttpd/thttpd.c:1.35 php4/sapi/thttpd/thttpd.c:1.36 --- php4/sapi/thttpd/thttpd.c:1.35 Mon Feb 19 02:28:08 2001 +++ php4/sapi/thttpd/thttpd.c Wed Feb 21 12:25:53 2001 @@ -98,7 +98,8 @@ vec[n++].iov_len = 2; TG(hc)->bytes += 2; - writev(TG(hc)->conn_fd, vec, n); + if (writev(TG(hc)->conn_fd, vec, n) == -1 && errno == EPIPE) + php_handle_aborted_connection(); } static int sapi_thttpd_read_post(char *buffer, uint count_bytes SLS_DC) -- PHP CVS 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] Tough one?
Actually, you may not have to do all that. you can use implode(). By default, implode will join an array, with the supplied character. So, if you have $list = (one two three four); you can do $all = implode("," , $list); to get $all = "one,two,three,four"; This works pretty well... enjoy! __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com "The world is waiting, are you ready?" -+___+- On Wed, 21 Feb 2001, Jason Stechschulte wrote: > On Wed, Feb 21, 2001 at 01:34:10PM -0500, Mike wrote: > > $keys = array_keys($HTTP_POST_VARS); > > for($x = 2; $x < count($keys); $x++) > > { > > $updateString=$updateString.$keys[$x]."='".$HTTP_POST_VARS[$keys[$x]]."',"; > > } > $updateString = ereg_replace(",$", "", $updateString); > > That should take care of the trailing comma. > > > -- > Jason Stechschulte > [EMAIL PROTECTED] > -- > One of the reasons Perl is faster than certain other unnamed interpreted > languages is that it binds variable names to a particular package (or > scope) at compile time rather than at run time. > -- Larry Wall in <[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-CVS] cvs: php4 /ext/midgard Makefile.in article.c attachment.c element.c event.c eventmember.c file.c group.c host.c image.c member.c mgd_oop.h midgard.c oop.c page.c pageelement.c pagelink.c person.c preferences.c sitegroup.c snippet.c snippetdir.c style.c topic.c
emile Wed Feb 21 14:18:55 2001 EDT Modified files: /php4/ext/midgard Makefile.in article.c attachment.c element.c event.c eventmember.c file.c group.c host.c image.c member.c mgd_oop.h midgard.c oop.c page.c pageelement.c pagelink.c person.c preferences.c sitegroup.c snippet.c snippetdir.c style.c topic.c Log: Centralized object fetching for get_object_by_guid Index: php4/ext/midgard/Makefile.in diff -u php4/ext/midgard/Makefile.in:1.3 php4/ext/midgard/Makefile.in:1.4 --- php4/ext/midgard/Makefile.in:1.3Sat Feb 17 15:21:49 2001 +++ php4/ext/midgard/Makefile.inWed Feb 21 14:18:54 2001 @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.3 2001/02/17 23:21:49 emile Exp $ +# $Id: Makefile.in,v 1.4 2001/02/21 22:18:54 emile Exp $ # # Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]> # Copyright (C) 2000 The Midgard Project ry @@ -29,6 +29,7 @@ snippetdir.c style.c sitegroup.c \ preparser-parser.c preparser-scanner.c \ preparser.c + LTLIBRARY_SHARED_NAME = midgard.la LTLIBRARY_SHARED_LIBADD = $(MIDGARD_SHARED_LIBADD) Index: php4/ext/midgard/article.c diff -u php4/ext/midgard/article.c:1.5 php4/ext/midgard/article.c:1.6 --- php4/ext/midgard/article.c:1.5 Tue Feb 20 16:24:56 2001 +++ php4/ext/midgard/article.c Wed Feb 21 14:18:54 2001 @@ -1,4 +1,4 @@ -/* $Id: article.c,v 1.5 2001/02/21 00:24:56 davidg Exp $ +/* $Id: article.c,v 1.6 2001/02/21 22:18:54 emile Exp $ Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]> Copyright (C) 2000 The Midgard Project ry Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]> @@ -396,18 +396,7 @@ WRONG_PARAM_COUNT; } - php_midgard_get(&MidgardArticle, return_value, - "id,up,topic,name,title,abstract,content,author," - "Date_format(created,'%d.%m.%Y') AS date," - "Date_format(created,'%D %b. %Y') AS adate," - "Date_format(created,'%D %M %Y') AS aldate," - "extra1,extra2,extra3,article.score,type," - "Unix_Timestamp(created) AS created,creator," - "Unix_Timestamp(revised) AS revised,revisor,revision," - "Unix_Timestamp(approved) AS approved,approver," - "Unix_Timestamp(locked) AS locked,locker," - "url,icon,view,print," - CALENDAR_FIELDS, "article", (*id)->value.lval); + php_midgard_get_object(return_value, MIDGARD_OBJECT_ARTICLE, (*id)->value.lval); } MGD_FUNCTION(get_article_by_name) Index: php4/ext/midgard/attachment.c diff -u php4/ext/midgard/attachment.c:1.4 php4/ext/midgard/attachment.c:1.5 --- php4/ext/midgard/attachment.c:1.4 Mon Feb 19 08:39:19 2001 +++ php4/ext/midgard/attachment.c Wed Feb 21 14:18:54 2001 @@ -1,4 +1,4 @@ -/* $Id: attachment.c,v 1.4 2001/02/19 16:39:19 davidg Exp $ +/* $Id: attachment.c,v 1.5 2001/02/21 22:18:54 emile Exp $ Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]> Copyright (C) 2000 The Midgard Project ry Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]> @@ -356,9 +356,7 @@ else if (aid == MGD_ERR_INVALID_NAME) { WRONG_PARAM_COUNT; } else if (aid < 0) { RETURN_FALSE_BECAUSE(aid); } - php_midgard_get(&MidgardAttachment, return_value, - "id,name,title,mimetype,score,author,created,ptable,pid", - "blobs", aid); + php_midgard_get_object(return_value, MIDGARD_OBJECT_BLOBS, aid); } MGD_FUNCTION(serve_attachment) Index: php4/ext/midgard/element.c diff -u php4/ext/midgard/element.c:1.3 php4/ext/midgard/element.c:1.4 --- php4/ext/midgard/element.c:1.3 Sat Feb 17 15:21:49 2001 +++ php4/ext/midgard/element.c Wed Feb 21 14:18:54 2001 @@ -1,4 +1,4 @@ -/* $Id: element.c,v 1.3 2001/02/17 23:21:49 emile Exp $ +/* $Id: element.c,v 1.4 2001/02/21 22:18:54 emile Exp $ Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]> Copyright (C) 2000 The Midgard Project ry Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]> @@ -48,10 +48,7 @@ } convert_to_long_ex(id); - php_midgard_get(&MidgardElement, - return_value, - "id,style,name,value", - "element", (*id)->value.lval); + php_midgard_get_object(return_value, MIDGARD_OBJECT_ELEMENT, +(*id)->value.lval); break; case 2: if (zend_get_parameters_ex(2, &style, &name) != SUCCESS) { Index: php4/ext/midgard/event.c diff -u php4/ext/midgard/event.c:1.3 php4/ext/midgard/event.c:1.4 --- php4/ext/midgard/event.c:1.3
[PHP] MySQL execution order?
Since I've always found my answers in the archive, this is my first post, so please excuse any blunders... I'm trying to download info from a table as a tab-delimted text file. This part works fine. (By disabling the UPDATE statement in the code sample below, I can get the same data file sent time after time.) I need to keep the data in the table for future reference, and only want to download each new record once, so I added a DateTime field that gets updated after downloading. Then searching on that field gives me just the records that haven't been downloaded yet. The weird part is that it seems like the LAST MySQL command (UPDATE) gets executed before the FIRST one (SELECT), because the SELECT statement comes up with 0 rows. Here's some selected (modified) parts of the PHP code: First, I perform the SQL: SELECT * from db_table WHERE (DownloadedDateTime = '-00-00 00:00:00') Then, it parses and sends the info: while ($row = mysql_fetch_row($result)) { while (list($key, $val) = each($row)) { $val = ereg_replace("[\n\r\t]"," ",$val); $val = ereg_replace(" {2,}"," ",$val); echo $val . "\t"; } //end of line echo "\r"; } Then I perform the SQL: UPDATE LOW_PRIORITY db_table SET DownloadedDateTime=CURRENT_TIMESTAMP WHERE (DownloadedDateTime = '-00-00 00:00:00') -- Any ideas why the rows are getting the DownloadedDateTime field updated before they get SELECTed? Thanks, Don Johnson [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] getting what's between
Hello, I've been reading a LOT on how to solve my problem today, but haven't been able to come up with anything yet. Here's my problem: I have an html file that contains many table rows like this: Item1Item1 Again Item2Item2 Again Item3Item3 Again Item4Item4 Again And so on. I want to search this html for a table row that has 'Item3' in the first cell. And the second cell should contain 'Item3 Again'. I know that I can do this with something like this: $file = fopen("http://localhost/html.html", "r"); $data = fread($file, 1); $results = eregi("Item3Item3 Again", $data); However, this won't exactly work for me, because that contents of the second cell will change daily, so tomorrow, the third table row could look like this: Item3Item3 Has Changed I was thinking I could use sscanf() to do this, but couldn't get anything to work. I've tried everything I can think of. Sorry if the explanation of my problem was hard to understand, I don't exactly understand it myself. Thanks everybody!!! Regards, Tyler Longren -- 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] Saving changes to a file
Hello, I am trying to make am admin page for a few other pages in PHP but I dont know how to save the changes made. ie. The page has a few checkboxes & select boxes that when changed, change some variables that are then used in other pages. However I want the changes in the admin page to be permanent, until they are changed again. Not just for that session or user, but if the change is made it stays changed until the administrator decideds to go back in and change it again. How do you save the changes in that file on the server, by just using a browser? -- Regards, YoBro - DO NOT REPLY TO THIS VIA EMAIL PLEASE USE THE NEWSGROUP All emails sent to this address are automatically deleted. This is to avoid SPAM! - -- 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] pop textarea field w/ text incl. quotes
From: "John Monfort" <[EMAIL PROTECTED]> > > > Is it necessary to include the 'http:' in the DB field? > > It would make your life a lot easier to drop it. > > You would then store the url values as > www.mydomain.com > > Then, modify your code to add the 'HTTP' whenever it encounter a URL, or > wherever you will create a link. > > This would eliminate the need to deal with special characters... > No it wouldn't, as the http:// is not the problem, the problem is the HTML markup. What Paul could do is have two DB fields, for the URL and the link text, and then form the tag at runtime instead of in the data. But this maybe is not what he wants. Eg http://www.blah.com"; $linktext = "Blah"; echo "$linktext"; ?> > > On Wed, 21 Feb 2001, Paul Warner wrote: > > > Simon- > > > > Thanks for the tip...I trued using the htmlspecialchars() which allowed the > > remainder of the form to display properly, but left no value in the > > textarea. Then I noticed a difference in the method I was using compared to > > yours - I'm still learning the ways of PHP so it will take me a while to > > determine the significance of the syntax differences: > > > > Mine: > value="htmlspecialchars($linkurl)">\n' ?> > > > > Yours: " . htmlspecialchars($link) . "" ?> > > > > I wanted a graphical representation of the present link displayed above the > > textarea and then attempted to use php's substitution to build the text area > > within the same string. I updated my code to be more like yours and arrived > > at: > > > > '?>" . > > htmlspecialchars($linkurl) . "\n"?> > > > > which seems to make the parser behave as I intended. > > > > Anyway...thanks! > > > > -- Paul > > > > - Original Message - > > From: "Simon Garner" <[EMAIL PROTECTED]> > > To: "Paul Warner" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > Sent: Wednesday, February 21, 2001 8:19 PM > > Subject: Re: [PHP] pop textarea field w/ text incl. quotes > > > > > > Don't worry about quotes - the problem is that you have HTML markup inside > > > your . You just need to convert < and > to < and >, > > > respectively, in your link text. The functions htmlspecialchars() or > > > strip_tags() can do this for you. > > > > > > i.e.: > > > > > > " . htmlspecialchars($link) . "" ?> > > > > > > When the form is submitted (and when it's viewed), those entities will be > > > converted back to their real characters automatically by the browser. > > > > > -- 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-CVS] cvs: php4 /main main.c
Would something like this solve bugs 9311 (and 9341) too? > + if (op_array != NULL) destroy_op_array(op_array); - Colin -- PHP CVS 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 hosting experience
Don't know your definition of CHEAP but check out OLM.net or webAXXS.net (they're the same company, just different marketing plans). I've recent;y signed up for their new RSE servers which are a real bargain in my opinion... but then again I've got a site with 650 meg of graphics plus 6 or 7 smaller sites -Jeff At 10:49 AM 2/21/01 -0800, Mark Maggelet wrote: >Right now I'm looking for a cheap virtual host that runs mysql >3.23.30 or higher, does anybody know one? ___ 2001 Wall Calendars * Art, Jazz, Blues, Women's, African-American. * Everyday Discounts. * Excellent paper and reproductions. And as always, a great selection of abstract, contemporary and African-American art prints. PopStreet.com is your avenue to art. http://www.popstreet.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] Why Arrays in Forms? ( Was "Accessing variables from a form" )
You don't have to specify them as "PHP arrays". You can do something like: PHP will create the array for you. Jason --- Brian White <[EMAIL PROTECTED]> wrote: > Why do you have to specify multi-value fields in > HTML > forms specifically as PHP arrays? > > It seems incompatible with other CGI languages, and > could make it difficlt to chop and change CGI > engines in > the background. > > At 19:08 21/02/2001 +0200, Pavel Jartsev wrote: > >If you create your fields like this: > > >... > >echo ' name="name['.$rownum.']">'; > >echo ' name="phone['.$rownum.']">'; > >echo ''; > >... > >?> > > Regs > > Brian White > - > Brian White > Step Two Designs Pty Ltd - SGML, XML & HTML > Consultancy > Phone: +612-93197901 > Web: http://www.steptwo.com.au/ > Email: [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] > __ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.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-CVS] cvs: php4 /ext/mysql php_mysql.c
shane Wed Feb 21 15:57:29 2001 EDT Modified files: /php4/ext/mysql php_mysql.c Log: Initalize some of the global vars. Crashed under ms debugger without having them initialized. Index: php4/ext/mysql/php_mysql.c diff -u php4/ext/mysql/php_mysql.c:1.70 php4/ext/mysql/php_mysql.c:1.71 --- php4/ext/mysql/php_mysql.c:1.70 Sun Feb 18 08:59:18 2001 +++ php4/ext/mysql/php_mysql.c Wed Feb 21 15:57:28 2001 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_mysql.c,v 1.70 2001/02/18 16:59:18 eschmid Exp $ */ +/* $Id: php_mysql.c,v 1.71 2001/02/21 23:57:28 shane Exp $ */ /* TODO: @@ -274,6 +274,10 @@ static void php_mysql_init_globals(zend_mysql_globals *mysql_globals) { mysql_globals->num_persistent = 0; + mysql_globals->default_socket = NULL; + mysql_globals->default_host = NULL; + mysql_globals->default_user = NULL; + mysql_globals->default_password = NULL; } @@ -349,10 +353,10 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) { - char *user, *passwd, *host_and_port, *socket, *tmp, *host=NULL; - char *hashed_details; + char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, *tmp=NULL, +*host=NULL; + char *hashed_details=NULL; int hashed_details_length, port = MYSQL_PORT; - MYSQL *mysql; + MYSQL *mysql=NULL; void (*handler) (int); zval **z_host=NULL, **z_user=NULL, **z_passwd=NULL; zend_bool free_host=0; -- PHP CVS 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] htaccess problems disabling phplib
From: "Gfunk" <[EMAIL PROTECTED]> >Hi, I'm trying to disable phplib, and I have a .htaccess file consisting of the line > >php_value auto_prepend_file none > >And now I'm getting a 500 internal server error. Can anybody shed some light >on what I'm doing wrong? > >Cheers, >Gfunk It sounds like your Apache configuration does not allow the php_value directive to appear in an .htaccess file. Check your error_log for a description of the problem. In httpd.conf (or access.conf) find an applicable block and check the setting of AllowOverride. I'm not actually sure what the override setting you need is, but you could try Options or just All. http://httpd.apache.org/docs/mod/core.html#allowoverride Example: AllowOverride All ... Of course, if you're able to edit httpd.conf then you could just put the php_value directive directly in there. :) Cheers Simon Garner -- 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] Why Arrays in Forms? ( Was "Accessing variables from a form" )
That's the point - why do I have to have 'name="myArray[]"'. Why do I have to specify the '[]'s at all? Brian At 13:44 21/02/2001 -0800, jason cox wrote: >You don't have to specify them as "PHP arrays". You >can do something like: > > > > > > >PHP will create the array for you. > >Jason - Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [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] fdf example needed
Hi, I am having some problems creating FDF/PDF's on the fly. I have created a PDF with Abobe Acrobat 4 including forms. I would like to send PDF's via mail filling the fields in the PDF using my mysql database, so that everyone gets their own prefilled PDF. Does any of you have an example script I may use?? Thanks, Patrick. PS I checked phpbuilder.com, but the examples assume that the pdf is opened via the browser. -- 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-CVS] cvs: php4 /ext/standard crypt.c
jon Wed Feb 21 19:37:32 2001 EDT Modified files: /php4/ext/standard crypt.c Log: The php_rand() and php_srand() functions added in the previous commit require the inclusion of php_rand.h. Index: php4/ext/standard/crypt.c diff -u php4/ext/standard/crypt.c:1.36 php4/ext/standard/crypt.c:1.37 --- php4/ext/standard/crypt.c:1.36 Wed Feb 21 16:24:19 2001 +++ php4/ext/standard/crypt.c Wed Feb 21 19:37:32 2001 @@ -17,7 +17,7 @@ | Rasmus Lerdorf <[EMAIL PROTECTED]> | +--+ */ -/* $Id: crypt.c,v 1.36 2001/02/22 00:24:19 jmoore Exp $ */ +/* $Id: crypt.c,v 1.37 2001/02/22 03:37:32 jon Exp $ */ #include #include "php.h" @@ -48,6 +48,7 @@ #include "php_lcg.h" #include "php_crypt.h" +#include "php_rand.h" /* The capabilities of the crypt() function is determined by the test programs -- PHP CVS 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] pop textarea field w/ text incl. quotes
Why store the html in the db? Why not have multiple db fields, say url and desc then when you grab them from the db to be outputed put them into the html print ''.$desc.''; Then you wouldn't have to input all the html when it gets stored in the db, not have to worry about quotes, or htmlspecialchars();. Also out of curiosity are you stripping all tags but from the input? Wouldn't want to get any nasty users inputting refresh tags or anything... -David Reid On Wed, 21 Feb 2001 17:46:30 -0800 (PST), John Monfort said: > > > Is it necessary to include the 'http:' in the DB field? > > It would make your life a lot easier to drop it. > > You would then store the url values as > www.mydomain.com > > Then, modify your code to add the 'HTTP' whenever it encounter a URL, or > wherever you will create a link. > > This would eliminate the need to deal with special characters... > > __John Monfort_ > _+---+_ > P E P I E D E S I G N S > www.pepiedesigns.com > "The world is waiting, are you ready?" > -+___+- > > On Wed, 21 Feb 2001, Paul Warner wrote: > > > Simon- > > > > Thanks for the tip...I trued using the htmlspecialchars() which allowed the > > remainder of the form to display properly, but left no value in the > > textarea. Then I noticed a difference in the method I was using compared to > > yours - I'm still learning the ways of PHP so it will take me a while to > > determine the significance of the syntax differences: > > > > Mine: > value="htmlspecialchars($linkurl)">\n' ?> > > > > Yours: " . htmlspecialchars($link) . "" ?> > > > > I wanted a graphical representation of the present link displayed above the > > textarea and then attempted to use php's substitution to build the text area > > within the same string. I updated my code to be more like yours and arrived > > at: > > > > '?>" . > > htmlspecialchars($linkurl) . "\n"?> > > > > which seems to make the parser behave as I intended. > > > > Anyway...thanks! > > > > -- Paul > > > > - Original Message - > > From: "Simon Garner" <[EMAIL PROTECTED]> > > To: "Paul Warner" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > Sent: Wednesday, February 21, 2001 8:19 PM > > Subject: Re: [PHP] pop textarea field w/ text incl. quotes > > > > > > Don't worry about quotes - the problem is that you have HTML markup inside > > > your . You just need to convert < and > to < and >, > > > respectively, in your link text. The functions htmlspecialchars() or > > > strip_tags() can do this for you. > > > > > > i.e.: > > > > > > " . htmlspecialchars($link) . "" ?> > > > > > > When the form is submitted (and when it's viewed), those entities will be > > > converted back to their real characters automatically by the browser. > > > > > > > > > -- > > 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] > > -- Karl's version of Parkinson's Law: Work expands to exceed the time alloted it. -- 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] Trans sid and form posts
Can anyone tell me if trans sid is supposed to work through form posts, and if so how to make it work right? It is working fine through normal links, but we have quite a few posts, and they lose the session. :( Thanks, Shawn -- 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] array headaches
On Thu, 22 Feb 2001 02:11, Matt Williams wrote: > I have done it this way... > > $menu = array(); > $count = $db->num_rows(); > for($i = 0; $db->next_record(); $i++) > { > $menu[$i]["name"] = $db->f("name"); > $menu[$i]["url"] = $db->f("topic_id"); > } > > OK, so is there a better way of acheiving the same end result? > and this is what I've got to print the results > > while ( list($name, $subarray) = each($menu) ) > > > echo " href=\"".$subarray["url"]."\">".$subarray["name"]."\n"; > > } > > is there any better way of doing this?? > > thanks > > M@ Why do you need to put the values in an array, then read through the array to print the values? Why not just print each record as you get it from the DB? -- David Robley| WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet| http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA -- 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] image orientation/resizing images
> At 17:48 21/02/2001 -0500, Jaxon wrote: > >Is there any way to take an image from the filesystem, say a .jpg or .png, > >and display it in a different orientation? e.g. 20 degrees to the right? > > At 17:18 21/02/2001 -0500, Dale Frohman wrote: > >Does anyone know of a way to resize images as they are being uploaded? > >Would you write these images to a mysql database or straight to a file on > >the server? The pictures will be small < 100k > > > In both cases, the answer will have to be some kind of server side utility > that can dynamically feed up translated images. Chris' very nice "image from > database" snippet gives a guidline on how this might work - whether or not what > you want can be done in PHP, I don't know. Actually, Brian's suggestion won't really solve your problems nor really apply. (No offense intended) In both cases you want to physically manipulate the images. This will require, as Brian mentioned, a utility. You'll want to look into using either ImageMagik or GD. I've never used ImageMagik but I have used GD quite a bit. To enable the PHP GD functions, you'll need to compile PHP with GD support. The more recent versions of GD support mainly JPEG and PNG image formats. GIF is not supported because it is copyrighted. If you need GIF support, you might be able to find an older version. You'll need one that's about a year old. (I believe that's when they stop supporting it.) In regards to the second question, you wouldn't even have to store the image in a database if you just want to manipulate it. You can just manipulate in on the filesystem. Hope that answers your questions, Jason -- 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] htaccess problems disabling phplib
Hi, I'm trying to disable phplib, and I have a .htaccess file consisting of the line php_value auto_prepend_file none And now I'm getting a 500 internal server error. Can anybody shed some light on what I'm doing wrong? Cheers, Gfunk
Re: [PHP] Terrible Hosting Experience
On 2/21/01 10:14 AM this was written: > Speaking of hosting companies, has anyone had experience with a company > called www.nomonthlyfees.com? You can see by the "Data Center" Information: -- The NoMonthlyFees.com NOC located in Baltimore, Maryland is OnNet with GlobalCenter (GC), Qwest Communications and GTE through three separate bandwidth-on-demand connections which enter Baltimore in our building. --- They are a reseller of Alabanza Servers. I wouldn't go with them. -- Thomas Deliduka IT Manager - New Eve Media The Solution To Your Internet Angst http://www.neweve.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] pop textarea field w/ text incl. quotes
From: "Paul Warner" <[EMAIL PROTECTED]> > Simon- > > Thanks for the tip...I trued using the htmlspecialchars() which allowed the > remainder of the form to display properly, but left no value in the > textarea. Then I noticed a difference in the method I was using compared to > yours - I'm still learning the ways of PHP so it will take me a while to > determine the significance of the syntax differences: > > Mine: value="htmlspecialchars($linkurl)">\n' ?> > > Yours: " . htmlspecialchars($link) . "" ?> > > I wanted a graphical representation of the present link displayed above the > textarea and then attempted to use php's substitution to build the text area > within the same string. I updated my code to be more like yours and arrived > at: > > '?>" . > htmlspecialchars($linkurl) . "\n"?> > > which seems to make the parser behave as I intended. > > Anyway...thanks! > > -- Paul > Ah, the HTML element does not support a VALUE attribute so your way will not work. :) Unlike tags, the contents (value) of a textarea should be inserted between the ... tags, rather than as an attribute. Hence what you need is: " . htmlspecialchars($linkurl) . "\n"; ?> In the outputted HTML this will give you: http://www.blah.com">BlahBlah Which should render as a link, followed by a textarea with the HTML code for that link. If you want the first link to render as code as well then you need to run it through htmlspecialchars() too. Cheers > - Original Message - > From: "Simon Garner" <[EMAIL PROTECTED]> > To: "Paul Warner" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, February 21, 2001 8:19 PM > Subject: Re: [PHP] pop textarea field w/ text incl. quotes > > > > Don't worry about quotes - the problem is that you have HTML markup inside > > your . You just need to convert < and > to < and >, > > respectively, in your link text. The functions htmlspecialchars() or > > strip_tags() can do this for you. > > > > i.e.: > > > > " . htmlspecialchars($link) . "" ?> > > > > When the form is submitted (and when it's viewed), those entities will be > > converted back to their real characters automatically by the browser. > > -- 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] Warning: page expired and cache-control header
Previously on this list, there have been questions about the Warning: page has expired problem. When you submit a form, then press the back button, you get this message and have to press refresh before the page will redisplay. I have discovered that if you use the following header command, the problem does not occur. header("Cache-Control: public"); The back button takes you back to the form, without a warning message, and the form redisplays with the info you entered. Does anyone know a reason that the above header should not be used? Does it cause some sort of problem that I should be aware of? Janet -- 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] pop textarea field w/ text incl. quotes
Simon- Thanks for the tip...I trued using the htmlspecialchars() which allowed the remainder of the form to display properly, but left no value in the textarea. Then I noticed a difference in the method I was using compared to yours - I'm still learning the ways of PHP so it will take me a while to determine the significance of the syntax differences: Mine: \n' ?> Yours: " . htmlspecialchars($link) . "" ?> I wanted a graphical representation of the present link displayed above the textarea and then attempted to use php's substitution to build the text area within the same string. I updated my code to be more like yours and arrived at: '?>" . htmlspecialchars($linkurl) . "\n"?> which seems to make the parser behave as I intended. Anyway...thanks! -- Paul - Original Message - From: "Simon Garner" <[EMAIL PROTECTED]> To: "Paul Warner" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, February 21, 2001 8:19 PM Subject: Re: [PHP] pop textarea field w/ text incl. quotes > > Don't worry about quotes - the problem is that you have HTML markup inside > your . You just need to convert < and > to < and >, > respectively, in your link text. The functions htmlspecialchars() or > strip_tags() can do this for you. > > i.e.: > > " . htmlspecialchars($link) . "" ?> > > When the form is submitted (and when it's viewed), those entities will be > converted back to their real characters automatically by the browser. > -- 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] pop textarea field w/ text incl. quotes
From: "Paul Warner" <[EMAIL PROTECTED]> > I seem to be stuck on a very simple (to me) issue. I am trying to build a > database of links for a site. A user inputs an HTML link into a text box > which is stored in a SQL db. This works fine. I need to display this data > on pages, and retrieving it into the page displays fine as well. The > problem arises when I need to provide a means to edit this link. Here's > what I've got: > > Link as stored in db: http://winners-circle.com">Winners Circle > Design Group > variants I've tried to store: http://winners-circle.com\">Winners > Circle Design Group > href=\\\"http://winners-circle.com\\\">Winners Circle Design Group > href='http://winners-circle.com'>Winners Circle Design Group > > All result in the textarea box in the form being populated with (basicly all > the output to the end of the page): Winners Circle Design > Group">\n > > Created: > 20010221195310 > > > Last Modified: > 20010219104604 > > > > > > > I'm sure that the answer is right in front of me, but my heads bleeding to > badly from hitting the wall so many times, I can't see it! > > -- Paul > Don't worry about quotes - the problem is that you have HTML markup inside your . You just need to convert < and > to < and >, respectively, in your link text. The functions htmlspecialchars() or strip_tags() can do this for you. i.e.: " . htmlspecialchars($link) . ""; ?> When the form is submitted (and when it's viewed), those entities will be converted back to their real characters automatically by the browser. Cheers Simon Garner -- 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] Why Arrays in Forms? ( Was "Accessing variables from a form" )
On Thu, 22 Feb 2001 08:24, Brian White wrote: > That's the point - why do I have to have 'name="myArray[]"'. Why > do I have to specify the '[]'s at all? > > Brian > > At 13:44 21/02/2001 -0800, jason cox wrote: > >You don't have to specify them as "PHP arrays". You > >can do something like: > > > > > > > > > > > > > >PHP will create the array for you. > > > >Jason > > - > Brian White > Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy > Phone: +612-93197901 > Web: http://www.steptwo.com.au/ > Email: [EMAIL PROTECTED] Because otherwise you have one variable name, and it will contain the last value which was assigned to it. I don't know any languages where you can do: $value = 'A' $value = 'B' $value = 'C' print $value and get a result other than C -- David Robley| WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet| http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA -- 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] Session problems
Mensaje citado por: Jack Davis <[EMAIL PROTECTED]>: > We have designed a web based email program that we have > recently found a problem with...If you open up two email > accounts in two different browser windows, the first window > opened takes on the session that the second window is in. > It appears that you can open up as many sessions as you > like, but all open windows take on the session properties > of the most recently opened session...This happens in Windows > and Linux with either IE or Netscape...Has anyone else > had this problem and if so how can I work around it... That is because you're usuing cookies, and the cookie is part of the bowsers information. Opening another netscape session isn't really a new netscape, but a new browser using the same session. And, by default, the cookie will die when the browser is close. Saludos... :-) System Administration: It's a dirty job, but someone told I had to do it. - Martín Marqués email: [EMAIL PROTECTED] Santa Fe - Argentinahttp://math.unl.edu.ar/~martin/ Administrador de sistemas en math.unl.edu.ar - -- 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] pop textarea field w/ text incl. quotes
I seem to be stuck on a very simple (to me) issue. I am trying to build a database of links for a site. A user inputs an HTML link into a text box which is stored in a SQL db. This works fine. I need to display this data on pages, and retrieving it into the page displays fine as well. The problem arises when I need to provide a means to edit this link. Here's what I've got: Link as stored in db: http://winners-circle.com">Winners Circle Design Group variants I've tried to store: http://winners-circle.com\">Winners Circle Design Group http://winners-circle.com\\\">Winners Circle Design Group Winners Circle Design Group All result in the textarea box in the form being populated with (basicly all the output to the end of the page): Winners Circle Design Group">\n Created: 20010221195310 Last Modified: 20010219104604 I'm sure that the answer is right in front of me, but my heads bleeding to badly from hitting the wall so many times, I can't see it! -- Paul -- 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] Terrible Hosting Experience
On Wednesday 21 February 2001 20:54, Jeff Oien wrote: > I would agree. I've had clients hosted on pair for quite a while. > They are still using PHP 3 however. 'almost complete control of the server' includes the ability to compile your own PHP and use it to run the place :) of course, this doesnt mean you get to hack at the modules. > Jeff Oien > > > while we're on this topic, i'd suggest people take a look at pair > > networks: > > > > http://www.pair.net > > > > i've had some good experience with them, almost complete control of the > > server (even on virtual hosts). > > they have the best support i have seen till date, and some of the best > > connections i've seen in the industry. > > > > cheers, > > Hrishi -- 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] Getting the file a PHP script is called from
$PHP_SELF echo $PHP_SELF; -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 ""Dan Watt"" <[EMAIL PROTECTED]> wrote in message 970j62$6j0$[EMAIL PROTECTED]">news:970j62$6j0$[EMAIL PROTECTED]... > As a beginner to PHP4, I wrote a simple logging program (since my server > does not have the best logging functionality) to track where users go on my > website. The way I am implementing it is by including it as a virtual="myphpscript.php" --> inside another include file, the footer to all > of my pages > so, it works out like this: > HTML Page > -> Included footer > -> Included PHP script > > Now, the HTTP_ENV_VARS work fine even in this setup, and return > HTTP_REFERRER correctly as the page I visited before coming to the current > page. But that is not what I want. I would like a way, without putting the > php script inside my HTML files, to be able to determine what page called > the script. Any help would be appreciated! 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]
RE: [PHP] a good hosting experience
Wasn't 3.23 just declared stable like a couple weeks ago? > -Original Message- > From: Mark Maggelet [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 21, 2001 1:50 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: [PHP] a good hosting experience > > > The last time I used these guys I didn't like them because the > software they were running was way out of date. I can deal with an > old version of php, but mysql needs to be current because there's too > many things that old versions can't do. > > Right now I'm looking for a cheap virtual host that runs mysql > 3.23.30 or higher, does anybody know one? > > thanks, > - Mark > > On Wed, 21 Feb 2001 09:35:22 -0800, Julie Meloni > ([EMAIL PROTECTED]) wrote: > >As a follow-up to the "Terrible Hosting Experience" posts, here's a > >"Good Hosting Experience" post. > > > >I completely and unabashedly recommend Hurricane Electric > >(www.he.net), > >for virtual or dedicated hosting. AND...they're not paying me a > >thing to > >say that. :) > > > >They have virtual host packages starting at ten bucks. > >thickbook.com > >runs on a thirty bucks a month virtual hosting package, and it's > >just > >fine (as far as I can tell). PHP 4, MySQL at all levels of pricing, > >and > >you can control local PHP values with .htaccess, just fine. > > > >I also have a 1U dedicated server there for $200/mo > >(www.mytrainingcamp.com) and am ecstatic about it. > > > >So, go Hurricane! > > > >- Julie > > > >++ > >| Julie Meloni ([EMAIL PROTECTED]) | > >|| > >| "PHP Essentials" and "PHP Fast & Easy" | > >| http://www.thickbook.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: php-list- > >[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] resizing images
Does anyone know of a way to resize images as they are being uploaded? Would you write these images to a mysql database or straight to a file on the server? The pictures will be small < 100k 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]
Re: AW: [PHP] Session files? (Very Techy Questions)
Addressed to: Michael Zornek <[EMAIL PROTECTED]> Michael Zornek <[EMAIL PROTECTED]> "'Php-General (E-Mail)" <[EMAIL PROTECTED]> ** Reply to note from Michael Zornek <[EMAIL PROTECTED]> Wed, 21 Feb 2001 12:15:32 -0500 > > At 5:54 PM +0100 2/21/01, Sebastian Stadtlich wrote: > When we post a new issue online we include a url right to the PDF. > Not to say we can't change that link to be somthing like: > > http://www.mysite.com/download.php?file=/TSR/0104/fullissue.pdf > > However all the old emails that are out there would still point right > to the PDF. So I guess we could make apache FWD and PDF GET requests > to the following script. Hmmm. Well I'll think about it. Hang on, this is going to be a wild ride... Lets say that you currently keep your pdf's in TSR/issue/fullissue.pdf, and that TSR is constant, issue changes each issue and fullissue.pdf may or may not be the only file in the issue directory. You hit the issue mentioned above at http://www.mysite.com/TSR/0104/fullissue.pdf. OK, here is what you do. Add the following to .htaccess or httpd.conf, in the virtual host block for www.mysite.com. If it is not a virtual host, it can be added anywhere near the bottom of the config file. ForceType application/x-httpd-php If you are using php3, it is application/x-httpd-php3 This makes apache execute the file TSR as if it was TSR.php, without having to have the .php extension. Now move your entire TSR directory outside of document root. Create a PHP program that checks to see if they are logged in and name it TSR. Place it in DocumentRoot or where ever you just removed the real TSR directory from. If they are logged in when the program is hit, then look in $PATH_INFO, which in this example will return '/0104/fullissue.php'. (Check me on the leading /, it might not be there.) Now you use $PATH_INFO and the path to where you moved the TSR directory to create the name of the file to send to them. Send your headers, then use readfile() to send the pdf. Rick Widmer Internet Marketing Specialists http://www.developersdesk.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] Making .phtml an extension
Brandon Orther wrote: > > Hello, > > I am trying to get .phtml to work for php files. How would I do this? If you have Apache, then following line in httpd.conf should help: AddType application/x-httpd-php .php .php3 .phtml -- Pavel a.k.a. Papi -- 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-CVS] cvs: php4 /ext/standard array.c crypt.c php_rand.h rand.c
jmoore Wed Feb 21 16:24:19 2001 EDT Modified files: /php4/ext/standard array.c crypt.c php_rand.h rand.c Log: Adding php_rand() and php_srand(seed) as a wrapper around random, lrand48 and rand. Index: php4/ext/standard/array.c diff -u php4/ext/standard/array.c:1.95 php4/ext/standard/array.c:1.96 --- php4/ext/standard/array.c:1.95 Wed Feb 21 09:22:26 2001 +++ php4/ext/standard/array.c Wed Feb 21 16:24:19 2001 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.95 2001/02/21 17:22:26 andrei Exp $ */ +/* $Id: array.c,v 1.96 2001/02/22 00:24:19 jmoore Exp $ */ #include "php.h" #include "php_ini.h" @@ -1364,18 +1364,7 @@ static int array_data_shuffle(const void *a, const void*b) { - return ( - /* This is just a little messy. */ -#ifdef HAVE_RANDOM -random() -#else -#ifdef HAVE_LRAND48 -lrand48() -#else -rand() -#endif -#endif - % 2) ? 1 : -1; + return (php_rand() % 2) ? 1 : -1; } Index: php4/ext/standard/crypt.c diff -u php4/ext/standard/crypt.c:1.35 php4/ext/standard/crypt.c:1.36 --- php4/ext/standard/crypt.c:1.35 Tue Feb 6 08:27:08 2001 +++ php4/ext/standard/crypt.c Wed Feb 21 16:24:19 2001 @@ -17,7 +17,7 @@ | Rasmus Lerdorf <[EMAIL PROTECTED]> | +--+ */ -/* $Id: crypt.c,v 1.35 2001/02/06 16:27:08 jimjag Exp $ */ +/* $Id: crypt.c,v 1.36 2001/02/22 00:24:19 jmoore Exp $ */ #include #include "php.h" @@ -85,14 +85,10 @@ #define PHP_STD_DES_CRYPT 1 #endif -#if HAVE_RANDOM -#define PHP_CRYPT_RAND random() -#elif HAVE_LRAND48 -#define PHP_CRYPT_RAND lrand48() -#else -#define PHP_CRYPT_RAND rand() -#endif +#define PHP_CRYPT_RAND php_rand() + + PHP_MINIT_FUNCTION(crypt) { #if PHP_STD_DES_CRYPT @@ -105,13 +101,7 @@ REGISTER_LONG_CONSTANT("CRYPT_MD5", PHP_MD5_CRYPT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CRYPT_BLOWFISH", PHP_BLOWFISH_CRYPT, CONST_CS | CONST_PERSISTENT); -#if HAVE_SRANDOM - srandom((unsigned int) time(0) * getpid() * (php_combined_lcg() * 1.0)); -#elif HAVE_SRAND48 - srand48((long) time(0) * (long) getpid() * (long) (php_combined_lcg() * 1.0)); -#else - srand((unsigned int) time(0) * getpid() * (php_combined_lcg() * 1.0)); -#endif + php_srand(time(0) * getpid() * (php_combined_lcg() * 1.0)); return SUCCESS; } Index: php4/ext/standard/php_rand.h diff -u php4/ext/standard/php_rand.h:1.6 php4/ext/standard/php_rand.h:1.7 --- php4/ext/standard/php_rand.h:1.6Sun Jul 2 16:46:47 2000 +++ php4/ext/standard/php_rand.hWed Feb 21 16:24:19 2001 @@ -19,7 +19,7 @@ | Based on code from: Shawn Cokus <[EMAIL PROTECTED]> | +--+ */ -/* $Id: php_rand.h,v 1.6 2000/07/02 23:46:47 sas Exp $ */ +/* $Id: php_rand.h,v 1.7 2001/02/22 00:24:19 jmoore Exp $ */ #ifndef PHP_RAND_H #definePHP_RAND_H @@ -34,6 +34,28 @@ #define PHP_RAND_MAX 2147483647 #else #define PHP_RAND_MAX RAND_MAX +#endif + +/* Define rand Function wrapper */ +#ifdef HAVE_RANDOM +#define php_rand() random() +#else +#ifdef HAVE_LRAND48 +#define php_rand() lrand48() +#else +#define php_rand() rand() +#endif +#endif + +/* Define srand Function wrapper */ +#ifdef HAVE_SRANDOM +#define php_srand(seed) srandom((unsigned int)seed) +#else +#ifdef HAVE_SRAND48 +#define php_srand(seed) srand48((long)seed) +#else +#define php_srand(seed) srand((unsigned int)seed) +#endif #endif #endif /* PHP_RAND_H */ Index: php4/ext/standard/rand.c diff -u php4/ext/standard/rand.c:1.23 php4/ext/standard/rand.c:1.24 --- php4/ext/standard/rand.c:1.23 Mon Feb 19 11:20:47 2001 +++ php4/ext/standard/rand.cWed Feb 21 16:24:19 2001 @@ -19,7 +19,7 @@ | Based on code from: Shawn Cokus <[EMAIL PROTECTED]> | +--+ */ -/* $Id: rand.c,v 1.23 2001/02/19 19:20:47 derick Exp $ */ +/* $Id: rand.c,v 1.24 2001/02/22 00:24:19 jmoore Exp $ */ #include @@ -199,15 +199,7 @@ WRONG_PARAM_COUNT; } convert_to_long_ex(arg); -#ifdef HAVE_SRANDOM - srandom((unsigned int) (*arg)->value.lval); -#else -#ifdef HAVE_SRAND48 - srand48((unsigned int) (*arg)->value.lval); -#else - srand((unsigned int) (*arg)->value.lval); -#endif -#endif + php_srand((*arg)->value.lval); } /* }}} */ @@ -253,15 +245,9 @@ } return_value->type = IS_LONG; -#ifdef HAVE_RANDOM - return_value->value.lval = random(); -#else -#ifdef HAVE_LRAND48 - return_value->value.lval = lrand48(); -#else - return_value->value.lval = rand(); -#endif -#endif + + return_value->value.lval = php_rand(); + /* * A bit of tricky math here.
[PHP] Problems with posix_getpwnam
What does it mean when I get the line 'posix_getpwnam(username) failed with "Error number not set" in /xx.php3 on line ##' printed? It doesn't return anything anymore. -- 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-CVS] cvs: php4 /ext/pdf pdf.c
rjs Wed Feb 21 15:30:20 2001 EDT Modified files: /php4/ext/pdf pdf.c Log: When using pdf_get_buffer() and doing a correct cleanup by calling pdf_delete() this always resulted in a coredump (after everything was finished, so only visible in the logfile). So it seems to be neccesary to copy the contents of the result of get_buffer, to avoid this coredump. Index: php4/ext/pdf/pdf.c diff -u php4/ext/pdf/pdf.c:1.71 php4/ext/pdf/pdf.c:1.72 --- php4/ext/pdf/pdf.c:1.71 Thu Feb 15 06:48:57 2001 +++ php4/ext/pdf/pdf.c Wed Feb 21 15:30:20 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: pdf.c,v 1.71 2001/02/15 14:48:57 thies Exp $ */ +/* $Id: pdf.c,v 1.72 2001/02/21 23:30:20 rjs Exp $ */ /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE. Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */ @@ -264,7 +264,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "PDF Support", "enabled" ); php_info_print_table_row(2, "PDFlib GmbH Version", tmp ); - php_info_print_table_row(2, "Revision", "$Revision: 1.71 $" ); + php_info_print_table_row(2, "Revision", "$Revision: 1.72 $" ); php_info_print_table_end(); } @@ -2176,7 +2176,7 @@ buffer = PDF_get_buffer(pdf, &size); - RETURN_STRINGL((char *)buffer, size, 0); + RETURN_STRINGL((char *)buffer, size, 1); } /* }}} */ -- PHP CVS 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-CVS] cvs: php4 /ext/odbc config.m4
ssb Wed Feb 21 10:23:53 2001 EDT Modified files: /php4/ext/odbc config.m4 Log: * dbmaker fix, shared support Index: php4/ext/odbc/config.m4 diff -u php4/ext/odbc/config.m4:1.35 php4/ext/odbc/config.m4:1.36 --- php4/ext/odbc/config.m4:1.35Thu Dec 28 11:12:28 2000 +++ php4/ext/odbc/config.m4 Wed Feb 21 10:23:53 2001 @@ -82,6 +82,7 @@ [ --with-adabas[=DIR] Include Adabas D support. DIR is the Adabas base install directory, defaults to /usr/local.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local fi @@ -113,6 +114,7 @@ [ --with-sapdb[=DIR] Include SAP DB support. DIR is SAP DB base install directory, defaults to /usr/local.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local fi @@ -139,6 +141,7 @@ [ --with-solid[=DIR] Include Solid support. DIR is the Solid base install directory, defaults to /usr/local/solid], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local/solid fi @@ -200,6 +203,7 @@ [ --with-empress[=DIR]Include Empress support. DIR is the Empress base install directory, defaults to \$EMPRESSPATH], [ + PHP_WITH_SHARED if test "$withval" != "no"; then if test "$withval" = "yes"; then ODBC_INCDIR=$EMPRESSPATH/odbccl/include @@ -227,6 +231,7 @@ [ --with-velocis[=DIR]Include Velocis support. DIR is the Velocis base install directory, defaults to /usr/local/velocis.], [ + PHP_WITH_SHARED if test "$withval" != "no"; then if test "$withval" = "yes"; then ODBC_INCDIR=/usr/local/velocis/include @@ -296,6 +301,7 @@ [ --with-iodbc[=DIR] Include iODBC support. DIR is the iODBC base install directory, defaults to /usr/local.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local fi @@ -320,6 +326,7 @@ install directory, defaults to /usr/local/easysoft/oob/client.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local/easysoft/oob/client fi @@ -346,6 +353,7 @@ [ --with-unixODBC[=DIR] Include unixODBC support. DIR is the unixODBC base install directory, defaults to /usr/local.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local fi @@ -373,6 +381,7 @@ OpenLink base install directory, defaults to /usr/local/openlink.], [ + PHP_WITH_SHARED if test "$withval" = "yes"; then withval=/usr/local/openlink fi @@ -409,8 +418,8 @@ # check DBMaker version (from 5.0 to 2.0) DBMAKER_VERSION=5.0 -while [[ test ! -d $DBMAKER_HOME/$DBMAKER_VERSION -a \ - "$DBMAKER_VERSION" != "2.9" ]]; do +while test test ! -d $DBMAKER_HOME/$DBMAKER_VERSION -a \ + "$DBMAKER_VERSION" != "2.9"; do DM_VER=`echo $DBMAKER_VERSION | sed -e 's/\.//' | awk '{ print $1-1;}'` MAJOR_V=`echo $DM_VER | awk '{ print $1/10; }' \ | awk -F. '{ print $1; }'` @@ -418,7 +427,7 @@ DBMAKER_VERSION=$MAJOR_V.$MINOR_V done -if [[ "$DBMAKER_VERSION" = "2.9" ]]; then +if test "$DBMAKER_VERSION" = "2.9"; then withval=$DBMAKER_HOME else DBMAKER_PATH=$DBMAKER_HOME/$DBMAKER_VERSION -- PHP CVS 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] Terrible Hosting Experience
Hmmm, well I guess everyone has different experiences. We've been with them (Vservers) for 5 years now and never had a single problem with downtime... > -Original Message- > From: Gary [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 21, 2001 11:49 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Terrible Hosting Experience > > > Thomas Deliduka wrote: > > > On 2/21/01 10:23 AM this was written: > > > > > >> Check out http://www.hostpro.com/hosting/shared/unix_products.html > >> > >> It's a semi-dedicated virtual environment with complete root access. > > > > > > I've heard good things about Host Pro. > > I disagree! We have had to pull clients off of them. Their site would go > down for days at a time and their email would go down the same way. If > you emailed support you might hear back from them in a day or two. If > you called support, you would be lucky if you were not left on hold for > 30 minutes or more. The straw that broke the camels back, they change > their email system and didn't notify our clients. > > In the end it took our clients lawyer to completely break off with them. > they kept bill and writing threating letters for months. > > Gary > > > -- > 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] Session files? (Very Techy Questions)
Ok, I'm new to sessions and have a few questions... Here is my plan. I'm running a news type web site where subscribers have different privileges on what they can view and download. The privileges are stored in a mySQL DB. My plan is to make users login (thereby starting a session with all their permission data). We will also allow the users to save their login and password as a cookie, thereby starting a new session every time they visit the web site. Using sessions to serve as a logged on status I'm pretty sure I can do authentication for PHP pages. However my worry is when someone types in a URL to get a PDF file. So what I was thinking of doing was writing an apache module that did the following: When a file with .pdf is asked for it looks to see if the user is currently in a session (aka 'logged on'). I'm guessing the module can know this by using the HTTP headers. Figuring we can look to see if its giving a cookie with the sid or its part of the URL. Ok, question 1: If I compile with -enable-trans-sid is the sid included as part of the HTTP header? Also my understanding is if i complied with this I don't have put the SID in each URL, if so and cookies are available on the client side which will PHP use? Once the module has the sid it can read the cookie like file related to that SID in the /tmp dir and figure out what the user's privileges are. Question 2: I was looking at the values in the php.ini file [Session] session.save_handler = files ; handler used to store/retrieve data session.save_path = /tmp; argument passed to save_handler ; in the case of files, this is the ; path where data files are stored session.use_cookies = 1 ; whether to use cookies session.name = PHPSESSID ; name of the session ; is used as cookie name session.auto_start= 0 ; initialize session on request startup session.cookie_lifetime = 0 ; lifetime in seconds of cookie ; or if 0, until browser is restarted session.cookie_path = / ; the path the cookie is valid for session.cookie_domain = ; the domain the cookie is valid for session.serialize_handler = php ; handler used to serialize data ; php is the standard serializer of PHP session.gc_probability= 1 ; percentual probability that the ; 'garbage collection' process is started ; on every session initialization session.gc_maxlifetime= 1440; after this number of seconds, stored ; data will be seen as 'garbage' and ; cleaned up by the gc process session.referer_check = ; check HTTP Referer to invalidate ; externally stored URLs containing ids session.entropy_length= 0 ; how many bytes to read from the file session.entropy_file = ; specified here to create the session id ; session.entropy_length= 16 ; session.entropy_file = /dev/urandom session.cache_limiter = nocache ; set to {nocache,private,public} to ; determine HTTP caching aspects session.cache_expire = 180 ; document expires after n minutes session.use_trans_sid = 1 ; use transient sid support if enabled ; by compiling with --enable-trans-sid Now according to this the cookie like files should be deleted after 1440 seconds, but on my machine their not. Any reason why? Thanks for you help ahead of time the few of you out there who might dare to tacle these questions. If anyone out there can point me to some good copy on PHP sessions and how they work under the hood please do so. thanks Mike
RE: [PHP] Form Variables!!!!!
> My problem is: > I wanna know the names of the variables that my actual page > recives from the last page (using the POST method). while( list( $formVarName, $formVarValue = each( $HTTP_POST_VARS )) { echo "$formVarName = $formVarValue\n"; } Chris
Re: [PHP] Can someone tell me the command to enable ftp support on php4.03?
I believe it's still --enable-ftp. Jason --- Brandon Orther <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to enable ftp can someone please remind > me what the command is? > > Thank you, > > > Brandon Orther > WebIntellects Design/Development Manager > [EMAIL PROTECTED] > 800-994-6364 > www.webintellects.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] > __ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.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] How to get information from
On Thu, 22 Feb 2001 04:20, Zenith wrote: > Hello everbody, if a have HTML document lik this: > > > > > > How can know whether the user is pressed on the "action1" or "action2" > image button?? http://au.php.net:81/FAQ.php#7.13 covers the topic nicely. -- David Robley| WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet| http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA -- 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 hosting experience
We're running 3.23.32, soon upgrading to .33 due to some security problems with .32 (either tonight or tomorrow), and running the latest release of PHP 4. Naturally, since I work for Granicus, I'm biased... but I think we're one of the better PHP hosts out there as far as services go. Our primary focus is colocation, but our hosting offering is PHP/MySQL centric (No postgres, very light perl support, etc), and the configuration of our machines shows it (we've actually in the process of writing a system that will allow you to analyze the performance if your scripts while they're running on your website). In any case, I'm trying to stay on this list as a contributer rather than a spammer so please excuse the shameless plug for my employer, but if you're interested and/or can't find anyone else, drop us a line at [EMAIL PROTECTED] and we'll give you all the gory details :) -jm -Original Message- From: Mark Maggelet [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 21, 2001 11:52 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] a good hosting experience On Wed, 21 Feb 2001 14:55:25 -0800, ..s.c.o.t.t.. ([EMAIL PROTECTED]) wrote: >liquidweb.com has some nice looking deals. > >last time i checked, they supported >MySQL/PHP/Perl/lots of other stuff well, most hosts do, but not many are using 3.23.30 or higher. I'm looking for a host that somebody knows for sure is running a current version of mysql. thanks, - Mark -- 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] Getting the file a PHP script is called from
That returns the PHP file. I am including the PHP file via Server Side Includes. I want a way to detect what file it was included from. ""Chris Lee"" <[EMAIL PROTECTED]> wrote in message 970nbs$1ah$[EMAIL PROTECTED]">news:970nbs$1ah$[EMAIL PROTECTED]... > $PHP_SELF > > echo $PHP_SELF; > > > -- > > > Chris Lee > Mediawaveonline.com > > em. [EMAIL PROTECTED] > > ph. 250.377.1095 > ph. 250.376.2690 > fx. 250.554.1120 > > > ""Dan Watt"" <[EMAIL PROTECTED]> wrote in message > 970j62$6j0$[EMAIL PROTECTED]">news:970j62$6j0$[EMAIL PROTECTED]... > > As a beginner to PHP4, I wrote a simple logging program (since my server > > does not have the best logging functionality) to track where users go on > my > > website. The way I am implementing it is by including it as a > > virtual="myphpscript.php" --> inside another include file, the footer to > all > > of my pages > > so, it works out like this: > > HTML Page > > -> Included footer > > -> Included PHP script > > > > Now, the HTTP_ENV_VARS work fine even in this setup, and return > > HTTP_REFERRER correctly as the page I visited before coming to the current > > page. But that is not what I want. I would like a way, without putting the > > php script inside my HTML files, to be able to determine what page called > > the script. Any help would be appreciated! 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 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] image orientation?
Hi, Is there any way to take an image from the filesystem, say a .jpg or .png, and display it in a different orientation? e.g. 20 degrees to the right? best regards, jaxon -- 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 hosting experience
The last time I used these guys I didn't like them because the software they were running was way out of date. I can deal with an old version of php, but mysql needs to be current because there's too many things that old versions can't do. Right now I'm looking for a cheap virtual host that runs mysql 3.23.30 or higher, does anybody know one? thanks, - Mark On Wed, 21 Feb 2001 09:35:22 -0800, Julie Meloni ([EMAIL PROTECTED]) wrote: >As a follow-up to the "Terrible Hosting Experience" posts, here's a >"Good Hosting Experience" post. > >I completely and unabashedly recommend Hurricane Electric >(www.he.net), >for virtual or dedicated hosting. AND...they're not paying me a >thing to >say that. :) > >They have virtual host packages starting at ten bucks. >thickbook.com >runs on a thirty bucks a month virtual hosting package, and it's >just >fine (as far as I can tell). PHP 4, MySQL at all levels of pricing, >and >you can control local PHP values with .htaccess, just fine. > >I also have a 1U dedicated server there for $200/mo >(www.mytrainingcamp.com) and am ecstatic about it. > >So, go Hurricane! > >- Julie > >++ >| Julie Meloni ([EMAIL PROTECTED]) | >|| >| "PHP Essentials" and "PHP Fast & Easy" | >| http://www.thickbook.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: php-list- >[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] image orientation/resizing images
Three quite related posts all in rapid sucesssion At 17:48 21/02/2001 -0500, Jaxon wrote: >Is there any way to take an image from the filesystem, say a .jpg or .png, >and display it in a different orientation? e.g. 20 degrees to the right? At 17:18 21/02/2001 -0500, Dale Frohman wrote: >Does anyone know of a way to resize images as they are being uploaded? >Would you write these images to a mysql database or straight to a file on >the server? The pictures will be small < 100k In both cases, the answer will have to be some kind of server side utility that can dynamically feed up translated images. Chris' very nice "image from database" snippet gives a guidline on how this might work - whether or not what you want can be done in PHP, I don't know. At 08:09 21/02/2001 -0800, Chris Lee wrote: >dspimage.inc > > include_once('database.egn'); > > header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); > header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); > header('Cache-Control: no-cache, must-revalidate'); > header('Pragma: no-cache'); > > if ( $prod_r = fetch_db_value('product_image', "WHERE product_id = >$product_id ") ) > { > if ($prod_r['product_image']) > { >Header("Content-Type: {$prod_r['product_image_type']}"); >echo $prod_r['product_image']; >exit(); > } > } > Header('Content-Type: image/gif'); > readfile("$DOCUMENT_ROOT/image/nopic.gif"); >?> > >index.php > echo " > > "; >?> - Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [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] PDF Problems
What OS and glibc version? There are problems with the set-up in RH7. Michael Sam Goin wrote: > Hi, > > I am running PHP4.04pl1, pdflib3.03, jpeg6b, tiff3.5.5, apache1.3.17. > > Some of the pdf functions work, but others don't, such as pdf_new(). > > Does anybody know what the problem is? I have been all over the > documentation, email archives, and support discussions at phpbuilder.com > > thanks, > > Sam -- 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] How can I log message, by syslogd?
look at http://www.php.net/manual/en/function.error-log.php you can tell php to send an error msg to the systems default logger (ie. syslog) -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 ""Zenith"" <[EMAIL PROTECTED]> wrote in message 970us5$fgt$[EMAIL PROTECTED]">news:970us5$fgt$[EMAIL PROTECTED]... > As I want to make my application more similar to those linux application, I > am going to see that, is it possible for logging information via syslog or > similar stuff?? > > I will happy, if you can also give me advice or comment on the efficiency > aspect!! > > Thnks > > > > -- > 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] Encryption
Hi, I am trying to do a simple encryption on a credit card number to store in a mysql text field. I also have to de-crypt the number after exporting to an access db. I tried to use xor encryption, but it seems to only work half the time, the other half, I can't seem to de-crypt the # properly, some of the numbers end up screwed. Is this because of the way mysql is storing the field? Mabye it can't recognize some of the characters that are generated from the xor encryption? Ex: 123456789123 may end up 1 YdR and then de-crypts to 1234(*$8912# Is it the that are the problem? Or is the the access database that isn't properly storing the ? Is there a better way to do this? Thanks, Chris
RE: [PHP] Configuring PHP4 on pair.com
Wow, my server is being upgraded today. I did all that for nothing. How do I undo what I just did? I checked this morning and PHP3 was still in use on my server. That's why I tried to install PHP4. Jeff Oien > Don't reference the absolute path to php4.cgi in your .htaccess it has to be > relative to the domain. Instead, try: > > Action application/x-httpd-php-xphp /cgi-bin/PHP2/php.cgi > AddHandler application/x-httpd-php-xphp .phtml > > This is how I got PHP2 back. BUT, if you server is one of the ones that have been > upgraded to FreeBSD 4, PHP4 is already installed. > > Try to run "uname -v" when you log in. You may not have to compile PHP4 like this. > > Or see if your server has been upgraded at > http://support.pair.com/notices/stable-upgrade.html > > Michael > > > Jeff Oien wrote: > > > I went through this installation process to install PHP4 on a pair > > server. When I try to run a PHP script I get an internal server error > > with this: Premature end of script headers: /usr/www/users//cgi-bin/php4.cgi > > What should I do from here? Thanks. > > Jeff Oien > > > > -- > > 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] Generating percentages of numbers
I have a database of numbers: TOTAL HITS: 1000 PAGE 1: 500 PAGE 2: 250 PAGE 3: 250 How can I query these numbers and display back a percentage number? For instance with the numbers above: PAGE 1: 50% PAGE 2: 25% PAGE 3: 25% Or is their a process by which to store numbers for easily getting this to work? -- 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] CGI BIN PHP
hehehehe...exact same hostill try that out tonight...as a side note have you been experiencing some problems lately with responsiveness from the server...i dont know if u r on the same one as me (ZEUS) but I was just curious...ive noticed some "issues" as of later.. When You Compensate For A Lack Of Skill By Doubling Your Efforts, There's No End To What You Can't Do. - Original Message - From: "Hrishi" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, February 21, 2001 4:01 AM Subject: Re: [PHP] CGI BIN PHP > hey, > > don't go bald yet :) > > my web host (communitech.net) has the same setup... is that where you're > hosted ? > > i have a script called 'php4.cgi' in my /cgi-bin which contains: > > #!/bin/sh > #echo -e "Content-type: text/plain\n\n"; > #set > SCRIPT_NAME=$REDIRECT_URL;export SCRIPT_NAME; > SCRIPT_FILENAME=$PATH_TRANSLATED;export SCRIPT_FILENAME; > /bin/php4; > #set > the #ed out commands are for debugging you may not need them. > my .htaccess in the documentroot contains : > > Action application/x-php4-script "/cgi-bin/php4.cgi" > AddHandler application/x-php4-script php > > > > i hope you can use this. > if you have any other problems, reply to the list because i'm sure more > people can use this 'technique'. its still under testing, (i made it 2 days > ago) so if there are any changes i need to make, i'll post it here. > > cheers, > hrishi > > > -- > 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] date format for MySQL
On Wed, 21 Feb 2001 11:36:02 -0800, Jerry Lake ([EMAIL PROTECTED]) wrote: >I have a field in my MySQL DB that is "DATE" > >on the form that populates this field, various >people will by typing in dates in various formats > >how to I convert say 2/21/01 or 02-21-2001 etc... >to 2001-02-21(MySQL Format) probably the safest thing is instead of giving them a text field, give them 3 drop downs for day month and year. -- 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] Can someone tell me the command to enable ftp support on php4.03?
Hello, I am trying to enable ftp can someone please remind me what the command is? Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.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] Why Arrays in Forms? ( Was "Accessing variables from a form" )
Why do you have to specify multi-value fields in HTML forms specifically as PHP arrays? It seems incompatible with other CGI languages, and could make it difficlt to chop and change CGI engines in the background. At 19:08 21/02/2001 +0200, Pavel Jartsev wrote: >If you create your fields like this: >... >echo ''; >echo ''; >echo ''; >... >?> Regs Brian White - Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [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] array headaches
I have done it this way... $menu = array(); $count = $db->num_rows(); for($i = 0; $db->next_record(); $i++) { $menu[$i]["name"] = $db->f("name"); $menu[$i]["url"] = $db->f("topic_id"); } OK, so is there a better way of acheiving the same end result? and this is what I've got to print the results while ( list($name, $subarray) = each($menu) ) echo "".$subarray["name"]."\n"; } is there any better way of doing this?? thanks M@ > -Original Message- > From: Pavel Kalian [mailto:[EMAIL PROTECTED]] > Sent: 21 February 2001 15:00 > To: Matt Williams; [EMAIL PROTECTED]; PHP_UK@egroups. com > Subject: Re: [PHP] array headaches > > > a) $menu[] = array("name" => $db->f("name"), "url" => $db->f("topic_id")); > > b) echo $menu[0]["name"]; //for example - depends on what you want to do > > BTW have a look into the manual, the array stuff is described pretty well > > Pavel > > - Original Message - > From: "Matt Williams" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]>; "PHP_UK@egroups. com" > <[EMAIL PROTECTED]> > Sent: Wednesday, February 21, 2001 3:56 PM > Subject: [PHP] array headaches > > > > Hi > > > > could anybody please help me get my head around the following. > > > > I get some url information from the database (title, url) > > I am trying to then put this into an array so I can pass it to > the page to > > display a menu. > > so > > a) how do I get the data into the array. would this be the way > to do it?? > > > > $menu = array(); > > while($db->next_record()) > > { > > $menu[]["name"] = $db->f("name"); > > $menu[]["url"] = $db->f("topic_id"); > > } > > which leads me onto > > b) how do I get the data back out. I can't test to see if the > above works > as > > I can't get at the data > > > > TIA > > > > M@ > > > > > > -- > > 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] Variable Strangeness
or... that forces the comparison to be compared as a string. this only has to be done sometimes, usually php is quite good at determining what you want. -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 "Jason Murray" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > I came across this: > > $confidential = 0; > echo "$confidential " . ($confidential == "yes"); > > In which "0 1" was printed. > > Is there something I'm missing? > > Thanks, > Jason > > -- > Jason Murray > Developer > http://www.jwebmedia.com/ > 1 877 525 jWEB > > -- > 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] I need some advice
Hi, Am I missing something How is it that I can read php code en htmls files but I can't read php3 files? I check that mod_php3.c is load with /usr/local/apache/bin/httpd -l I add the following lines: AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3 .html AddType application/x-httpd-php3 -source .phps 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]
Re: [PHP] I am looking for an image library that can do blurs
On Tue, Feb 20, 2001 at 04:10:08PM -0800, Brandon Orther wrote: > I am looking for an Image Library that can blur text. Does anyone know of > an image library that can work with php to make blured text? It's not a very versatile (Can't define the extent to which a blur is done), but php_imlib does it. You could, of course, re-blur the text if it wasn't enough the first time. . :) http://mmcc.cx/php_imlib/ Matt -- 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-CVS] cvs: php4 /main main.c
shane Wed Feb 21 12:50:49 2001 EDT Modified files: /php4/main main.c Log: zend_compile_file returns a NULL on error, check for that before calling destroy_op_array unless we like crashes :-) Index: php4/main/main.c diff -u php4/main/main.c:1.350 php4/main/main.c:1.351 --- php4/main/main.c:1.350 Tue Feb 20 17:43:15 2001 +++ php4/main/main.cWed Feb 21 12:50:49 2001 @@ -19,7 +19,7 @@ */ -/* $Id: main.c,v 1.350 2001/02/21 01:43:15 hholzgra Exp $ */ +/* $Id: main.c,v 1.351 2001/02/21 20:50:49 shane Exp $ */ #include @@ -1263,7 +1263,8 @@ op_array = zend_compile_file(file, ZEND_INCLUDE CLS_CC); retval = (op_array?SUCCESS:FAILURE); - destroy_op_array(op_array); + /* SMC op_array may be NULL */ + if (op_array != NULL) destroy_op_array(op_array); return retval; } -- PHP CVS 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] Making .phtml an extension
assuming you are using Apache... add AddType application/x-httpd-php .phtml to your httpd.conf file -Original Message- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 21, 2001 11:14 AM To: PHP User Group Subject: [PHP] Making .phtml an extension Hello, I am trying to get .phtml to work for php files. How would I do this? Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.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]
[PHP] No GIF support in this PHP build???
I have several images all over my site but when I call an image by a php3 file I get this error: ImageCreateFromGif: No GIF support in this PHP build in Any ideas... 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] Getting the file a PHP script is called from
As a beginner to PHP4, I wrote a simple logging program (since my server does not have the best logging functionality) to track where users go on my website. The way I am implementing it is by including it as a inside another include file, the footer to all of my pages so, it works out like this: HTML Page -> Included footer -> Included PHP script Now, the HTTP_ENV_VARS work fine even in this setup, and return HTTP_REFERRER correctly as the page I visited before coming to the current page. But that is not what I want. I would like a way, without putting the php script inside my HTML files, to be able to determine what page called the script. Any help would be appreciated! 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]
RE: [PHP] Print in html
hi, with ?> readfile(""); ?> ") as well. sascha -- 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] date format for MySQL
I have a field in my MySQL DB that is "DATE" on the form that populates this field, various people will by typing in dates in various formats how to I convert say 2/21/01 or 02-21-2001 etc... to 2001-02-21(MySQL Format) Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.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] I'm confused about Regular Expressions.
Addressed to: "Kenneth R Zink II" <[EMAIL PROTECTED]> [EMAIL PROTECTED] ** Reply to note from "Kenneth R Zink II" <[EMAIL PROTECTED]> Wed, 21 Feb 2001 11:42:28 -0600 > > --=_NextPart_000_00AC_01C09BFB.5E254010 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > I was just reading at DevShed on how to use Regular Expressions, but now = > I'm even more confused. > > Can someone please explain how I would use a REGEX to determine in and = > uploaded file is a .gif or .jpg file? if( ereg( 'gif|jpg', $filename )) Better yet, try doing a getImageSize() on the uploaded file, before you move it and look at the [2] element of what is returned. This will give you the actual type of file from inspecting its contents rather than just trusting the extension that was typed. http://www.php.net/manual/en/function.getimagesize.php Rick Widmer Internet Marketing Specialists http://www.developersdesk.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] Print in html
Hello, I am trying to finish up a script with instructions on how to add my banner add script to someone's .phtml file. I need to print in the html page that has instructions for the user. Anyway when I try to do that it just runs as a script... does anyone know how I can get over this? Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.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] Print in html
On Thursday 22 February 2001 00:12, Brandon Orther wrote: > Hello, > > I am trying to finish up a script with instructions on how to add my banner > add script to someone's .phtml file. I need to print use : echo ''; the single quotes ensure that php does not evaluate the contents of the string constant cheers, hrishi -- 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] Re: I'm still stuck...
I'm working on a test envyroment, so I can't give you my URL because I can't pass through the firewall, the real site is http://www.bb.com.mx. With both files I see the same, it's kind of long Thanks a lot Extensions Extensions Additional Information PHP core CFLAGS= HSREGEX= Basic Functions No additional information. PHP_DLDynamic Library support enabled. PHP_dir No additional information. PHP_filestatNo additional information. PHP_file No additional information. PHP_head No additional information. Sendmail Path to sendmail: /usr/sbin/sendmail -t Syslog No additional information. PostgreSQL Allow persistent links:Yes Persistent links: 1/Unlimited Total links: 1/Unlimited Compilation definitions: PGSQL_INCLUDE= PGSQL_LFLAGS= PGSQL_LIBS= Socket functions No additional information. Regular ExpressionsBundled regex library enabled gd Version 1.6 (PNG) or later, FreeType support Apache APACHE_INCLUDE= APACHE_TARGET= Apache Version: Apache/1.3.11 Apache Release: 10311100 Apache API Version: 19990320 Hostname/port: www.bb.com.mx:80 User/Group: nobody(99)/99 Max Requests: per child: 0keep alive: onmax per connection: 100 Timeouts: connection: 300keep-alive: 15 Server Root: /usr/local/apache Loaded modules: mod_ssl, mod_php3, mod_setenvif, mod_so, mod_auth, mod_access, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, mod_vhost_alias, http_core CryptNo additional information. DBM This is GDBM version 1.8.0, as of May 19, 1999. bcmath No additional information. browscap No additional information. PHP_pack No additional information. PCRE Perl Compatible Regular Expressions PCRE library version: 2.05 21-Apr-1999 Posix $Revision: 1.19 $ LCG No additional information. Configuration Configure command: ./configure '--with-pgsql=/usr/local/pgsql' '--with-config-file-path=/usr/local/apache/conf' '--with-apache=/usr/src/apache_1.3.11' '--enable-track-vars' '--with-gd=/usr/local' '--with-ttf=/usr/local' php3.ini file path is set to: /usr/local/apache/conf Directive Master ValueLocal Value arg_separator & & asp_tags 0 0 auto_prepend_file /data/bajio/lib/prepend.php3 auto_append_file browscap none none cgi_ext none none debugger.host nonenone debugger.port 00 define_syslog_variables 00 display_errors 1
Re: [PHP] Tough one?
On Wed, Feb 21, 2001 at 01:34:10PM -0500, Mike wrote: > $keys = array_keys($HTTP_POST_VARS); > for($x = 2; $x < count($keys); $x++) > { > $updateString=$updateString.$keys[$x]."='".$HTTP_POST_VARS[$keys[$x]]."',"; } $updateString = ereg_replace(",$", "", $updateString); That should take care of the trailing comma. -- Jason Stechschulte [EMAIL PROTECTED] -- One of the reasons Perl is faster than certain other unnamed interpreted languages is that it binds variable names to a particular package (or scope) at compile time rather than at run time. -- Larry Wall in <[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]