RE: [PHP] libxml
Hi, I need to use PHP from cvs for other reasons. Anyway, libxml 2.3.9 -> Configure wants a higher version (2.4.2). libxml 2.4.6 -> Causes the trouble. libxml 2.4.2 -> Wont build - dies after configre libxml 2.4.5 -> same problem BTW, this error appears for xmltree calls. am wokring on clearing out bad redhate 7.1 libraries which may be causing conflicts, before attempting again. Its my poorly educated guess, that this may be the cause. Sean -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 24 October 2001 11:55 PM To: php; [EMAIL PROTECTED] Subject: Re: [PHP] libxml On Wednesday 24 October 2001 11:38, php wrote: > Firstly, > I use php 4.0.5 and libxml 2.3.9 on several machines without any problem. Older php and libxml combinations however caused many segmentation faults, especially with not well-formatted xmls. Are you sure that you warning message is related to libxml library? If you compile php without domxml the warning message disappears? Arpi > thanks to those who replied to me last week about xmldom support > with this error: > > Warning: Unknown list entry type in request shutdown (0) in > Unknown on line 0 > > I've since tried a few combinations of versions of libxml, and > expat (dont know if expat would > matter), any was wondering if anyone who is using dom support > correctly could > tell me which versions work for them. > > > Thank you, > > Sean -- 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] Sending / Receiving Cookies with Fopen??
Hello all. I have a problem to solve, but have no idea where to start.. I am writing a site right now that needs to read information from many other web pages on different domains (using fopen). However a few sites have given me the error: "you need to have cookies enabled to view this page". This is because it is the PHP engine that is hitting the web page, and not my browser directly. The PHP engine does not support cookies as my browser does, thus I get this 'no cookies' error. Is there any way to make these web sites think I have cookies enabled? Can I send specific message headders that would mimic having cookies present? Or can I encode the cookies into the URL in some way? Or better yet, is there a way to allow PHP to accept cookies and send these back to the server every time I request a page? Thanks for any help. I have no idea were to turn next! Andrew -- FYII: The fopen type stuff I'm doing is.. $file = @fopen ("$Hyperlink", "r"); while (!feof ($file)) { $line = fgets ($file, 1024); // yadda yadda yadda } fclose($file); -- 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] Netscape 6.1 problem and SELECT lists / FORMS
Haven't tried this, but what about sending "nocache" headers to the browser (??) -Original Message- From: Jason Caldwell [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 4:12 PM To: [EMAIL PROTECTED] Subject: [PHP] Netscape 6.1 problem and SELECT lists / FORMS NS6.1 remembers the items that were selected in a SELECT list when I call the same page back with a header() function... normally this wouldn't be a problem -- however, in my case, I am (through PHP) printing all selected items to the top of the list, and all unselected items to the bottom -- this has the effect of showing all the users (right up front / top) all the selections they've made without having to scroll through the entire list -- Now, in NS4.x and IE5.x this functionality works fine. But in NS6.1 the items are pushed to the top alright, however, they aren't highlighted (ie. selected) -- looking at the source for the page, the SELECTED statement is in the tag (as I said, it works fine in everything but NS6.1 :-) ) Through playing around, I discovered that with NS6.1 -- this is the result of the FORM NAME (ie. name="frmWhatever") -- I appended a random number at the end of the FORM NAME each time I pressed the submit button and the page was called back through a header() function. This seemed to fix the problem (ie. the items in the select list that were suppose to be selected, were!) -- however, all other items on my forms lost their data (again, only in NS6.1) -- so, if nothing else, I at least discovered that the FORM NAME plays a roll in this dysfunctionality. Now I ask you -- the great pool of knowledge -- any suggestions on how I can get NS6.1 forms to behave? Thanks. 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] Netscape 6.1 problem and SELECT lists / FORMS
NS6.1 remembers the items that were selected in a SELECT list when I call the same page back with a header() function... normally this wouldn't be a problem -- however, in my case, I am (through PHP) printing all selected items to the top of the list, and all unselected items to the bottom -- this has the effect of showing all the users (right up front / top) all the selections they've made without having to scroll through the entire list -- Now, in NS4.x and IE5.x this functionality works fine. But in NS6.1 the items are pushed to the top alright, however, they aren't highlighted (ie. selected) -- looking at the source for the page, the SELECTED statement is in the tag (as I said, it works fine in everything but NS6.1 :-) ) Through playing around, I discovered that with NS6.1 -- this is the result of the FORM NAME (ie. name="frmWhatever") -- I appended a random number at the end of the FORM NAME each time I pressed the submit button and the page was called back through a header() function. This seemed to fix the problem (ie. the items in the select list that were suppose to be selected, were!) -- however, all other items on my forms lost their data (again, only in NS6.1) -- so, if nothing else, I at least discovered that the FORM NAME plays a roll in this dysfunctionality. Now I ask you -- the great pool of knowledge -- any suggestions on how I can get NS6.1 forms to behave? Thanks. 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]
Re: [PHP] PDF library
look at http://24.5.29.77:10080/phpinfo.html That's a phpinfo() from a machine that supports pdflib You will clearly see the PDF library support and information about what library etc.- It's right below the pgsql support on that page. On Thu, 25 Oct 2001 12:25:31 +0800 "Pierre" <[EMAIL PROTECTED]> wrote: > Thanks, I had a look, very usefull indeed. > > But I am still not quite sure about what I am looking for !!! > > Which information should I find to be sure the server can handle pdf > function ? > > Thanks. > > Pierre > > - Original Message - > From: Jason Murray <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Thursday, October 25, 2001 9:08 AM > Subject: RE: [PHP] PDF library > > > > Check the output from phpInfo() ... > > > > > > -- > > Jason Murray > > [EMAIL PROTECTED] > > Web Developer, Melbourne IT > > "Work now, freak later!" > > > > > -Original Message- > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, October 25, 2001 11:08 AM > > > To: [EMAIL PROTECTED]; > > > UNEXPECTED_DATA_AFTER_ADDRESS@.SYNTAX-ERROR > > > Subject: [PHP] PDF library > > > > > > > > > Hi everybody, > > > > > > Does anyone know a way to check if a server is able or > > > not to support PHP script including PDF related function ? > > > > > > I guess I need to know if the server has API idoine or > > > something like that. > > > > > > Thanks for your help. > > > > > > Pierre > > > > > > By the way, any good tutorial about creation of PDF file > > > using PHP ? The purpose is to print dynamic table. > > > > > > > > > -- > > > 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] > -- -=-=-=-=-=-=-=-=-=-=-=-=- Michael A. Peters http://24.5.29.77:10080/ -- 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] About mail attachments
> how to send an attachment in PHP mail > can anyone pl send a sample code http://planetkiller.shadow.net.au/mime-php.txt Jason -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT "Work now, freak later!" -- 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] About mail attachments
hi how to send an attachment in PHP mail can anyone pl send a sample code Nigam
Re: [PHP] PDF library
Thanks, I had a look, very usefull indeed. But I am still not quite sure about what I am looking for !!! Which information should I find to be sure the server can handle pdf function ? Thanks. Pierre - Original Message - From: Jason Murray <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, October 25, 2001 9:08 AM Subject: RE: [PHP] PDF library > Check the output from phpInfo() ... > > > -- > Jason Murray > [EMAIL PROTECTED] > Web Developer, Melbourne IT > "Work now, freak later!" > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, October 25, 2001 11:08 AM > > To: [EMAIL PROTECTED]; > > UNEXPECTED_DATA_AFTER_ADDRESS@.SYNTAX-ERROR > > Subject: [PHP] PDF library > > > > > > Hi everybody, > > > > Does anyone know a way to check if a server is able or > > not to support PHP script including PDF related function ? > > > > I guess I need to know if the server has API idoine or > > something like that. > > > > Thanks for your help. > > > > Pierre > > > > By the way, any good tutorial about creation of PDF file > > using PHP ? The purpose is to print dynamic table. > > > > > > -- > > 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] Enabling php in only certain hosts and directories
Thanks! What would people reccommend? 1) just using safe mode 2) using open_basedir and disable_functions 3) all of the above? 4) Just shutoff the server :) If (2) or (3) what functions are most at risk? I understand that safe_mode limits quite a few already. Regards, Joseph -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 24 October 2001 11:01 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Enabling php in only certain hosts and directories On Wednesday 24 October 2001 08:19, you wrote: > Well, php runs the same as apache, so whatever apache can access, > php can access. > So any files with the db passwords that need to be accessed by php, > can be seen by all users who can upload php scripts to your server. That's not completely true. You can use open_basedir, safe_mode settings in apache's configuration, based on virtualhosts or even directories. This way you can restrict users, virtual hosts to their own directories. Arpi > > Hello all, > > > > I am just configuring up a new web server, and I want to be able > > to run php only in the web servers main document root and in > > specified virtual hosts, I have a fair understanding on how to go > > about this, but would really like some feedback before I get to > > far into it. Basically the only directories I don't want to be > > able to use php are all the user directories (/~username) unless > > they have been mapped to a virtual host that has the right > > directives in them to enable php. -- 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] conjob etc.
Hi there. Need your help / comments on this couple of issues. 1. I already have a php compiled in apache module running.. How can i install a cgi version that will also support mysql/postgresql/interbase (as it was also supported on the compiled version) 2. If I'll be running a cron job calling a php script that access mysql and reads data EVERY 5 MINS, will i exhaust my box's resources? That is the best /safest thing i have in mind in as far as doing an email account manipulation on the linux box. Any idea is also appreciated. Thanks.. Mabuhay! -- Arnold Gamboa Pres., Managing Dir. SparrowInteractive.com, Inc. [EMAIL PROTECTED] http://www.sparrowinteractive.com (63) 2 - 532-5373 / 532-5387 --- "He chose the nails" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Php and Emacs21
On Tue, 23 Oct 2001 21:59:10 -0700, Nick Richardson wrote: >Put this file in your emacs/lisp/progmodes dir... then make sure that >secureCRT has ANSI Color checked in your site's emulation >configuration... > >Then add (autoload 'php-mode "php-mode-099" "PHP Mode" t) to your >.emacs >file. > >This is how i do it on a windows box... it should work just the same >on a >unix system. - if it doesn't work, search for php-mode-099 on google >and >find the documentation on how to install it =) Thanks, this mode deals with highlighting php pretty well, but it doesn't seem to know how to deal with html blocks. I haven't found anything better yet though. I did find a good ssh client called putty that does emacs color really well and is freeware. -- 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] PDF library
Hi everybody, Does anyone know a way to check if a server is able or not to support PHP script including PDF related function ? I guess I need to know if the server has API idoine or something like that. Thanks for your help. Pierre By the way, any good tutorial about creation of PDF file using PHP ? The purpose is to print dynamic table. -- 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] PHP library
Hi everybody, Does anyone know a way to check if a server is able or not to support PHP script including PDF related function ? I guess I need to know if the server has API idoine or something like that. Thanks for your help. Pierre By the way, any good tutorial about creation of PDF file using PHP ? The purpose is to print dynamic table. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Using Logical OR operator in IF statement???
>> if ((substr($sString,(strlen($sString)-1)!="-")) or Looks to me that the bracketing is wrong... try: if ((substr($sString,(strlen($sString)-1))!="-") or -Original Message- From: Mark [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 11:12 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Using Logical OR operator in IF statement??? >> if (substr($sString,(strlen($sString)-1)!="-")) { I think you meant either substr($sString,strlen($sString)-2) or substr($sString,-1) >> print "You can't have a dash at the end of your string."; >> } >> >> and this works: >> if (substr($sString,0,1)!="-") { >> print "You can't have a dash at the beginning of your string."; >> } >> >> But, this doesn't work for any case: >> if ((substr($sString,(strlen($sString)-1)!="-")) or >> (substr($sString,0,1)!="-")) { >> print "you can't have a dash at the beginning or end of your >>string."; >> } >> >> What could be wrong? I've used a logical OR operator in the >>middle of an >IF >> statement like this before, but for some reason, this just isn't >>working. >> Anyone got any ideas? I suppose I can just evaluate this with two >different >> IF statements, but it seems like I shoud be able to do it in one >>and >reduce >> duplicate code. Thanks very much in advance. >> >> .Brad >> >> >> > > > -- Mark, [EMAIL PROTECTED] on 10/24/2001 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Using Logical OR operator in IF statement???
>> if (substr($sString,(strlen($sString)-1)!="-")) { I think you meant either substr($sString,strlen($sString)-2) or substr($sString,-1) >> print "You can't have a dash at the end of your string."; >> } >> >> and this works: >> if (substr($sString,0,1)!="-") { >> print "You can't have a dash at the beginning of your string."; >> } >> >> But, this doesn't work for any case: >> if ((substr($sString,(strlen($sString)-1)!="-")) or >> (substr($sString,0,1)!="-")) { >> print "you can't have a dash at the beginning or end of your >>string."; >> } >> >> What could be wrong? I've used a logical OR operator in the >>middle of an >IF >> statement like this before, but for some reason, this just isn't >>working. >> Anyone got any ideas? I suppose I can just evaluate this with two >different >> IF statements, but it seems like I shoud be able to do it in one >>and >reduce >> duplicate code. Thanks very much in advance. >> >> .Brad >> >> >> > > > -- Mark, [EMAIL PROTECTED] on 10/24/2001 -- 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 library
Check the output from phpInfo() ... -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT "Work now, freak later!" > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 25, 2001 11:08 AM > To: [EMAIL PROTECTED]; > UNEXPECTED_DATA_AFTER_ADDRESS@.SYNTAX-ERROR > Subject: [PHP] PDF library > > > Hi everybody, > > Does anyone know a way to check if a server is able or > not to support PHP script including PDF related function ? > > I guess I need to know if the server has API idoine or > something like that. > > Thanks for your help. > > Pierre > > By the way, any good tutorial about creation of PDF file > using PHP ? The purpose is to print dynamic table. > > > -- > 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] PDF library
Hi everybody, Does anyone know a way to check if a server is able or not to support PHP script including PDF related function ? I guess I need to know if the server has API idoine or something like that. Thanks for your help. Pierre By the way, any good tutorial about creation of PDF file using PHP ? The purpose is to print dynamic table. -- 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] MSSQL 7.0 and PHP
> varchar only accepts values up to 255 (so does char) I've found this too .. MS-SQL probably ceil()s the parameter in the table create statement to 255 without throwing an error. Have a quick look at the column you've created and you'll probably find it's a char(255). > To get larger than that you have to use 'text' Sounds right to me. Regards James -- 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: socket question
There is some source code on the php.net site which captures the credits with output buffering and then uses then in the page. Once you have the data in a variable you can do what you like to it. if (function_exists('ob_start')) { ob_start(); phpcredits(); $credits = ob_get_contents(); ob_end_clean(); } Maybe that will do the trick. -- 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] URL variables
try $QUERY_STRING -Original Message- From: Clint Tredway [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 5:13 AM To: PHP General Subject: [PHP] URL variables How do I reference URL variables..? -- 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] socket question
Hey. Anoyone know how i would go about using one of the internal variables, such as phpinfo() or phpcredits() to send through a socket. like for: write ($msgsock, ":RWorld PRIVMSG $pnum :phpcredits()\n", strlen (":RWorld PRIVMSG $pnum :phpcredits()\n")); so it sends the actual information instead of just "phpcredits()". I have tried with $credits = phpcredits(); and placed the $credits in the line above, but that seemed to echo it to my console then send the number 1 through the socket. Any help on this would be greatly appreciated :) Tim -- 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] Q:Why is my code returning this? Help?
Hello, As mainly a designer w/ HTML and JS php is usually just an end of site add on to process forms and I LOVE php! I've been away from PHP coding for about a month and I can't figure out what I'm forgetting here is partial of the form, the php handler, and the final email I get. If you see some syntax I'm botching let me know please. Title... Mr. Ms. Mrs. *First Name: *Last Name: *Mailing Address: *City, State, Zip: .. THE PHP HANDLER... Your form has been proccessed and sent to ... " ); ?> AND FINALLY THE SENSELESS EMAIL I GET AT THE END... My name is , , , I am looking for a loved one. here is my contact information: , , , , , Phone Number: Fax: The best time to call is My email address is .. What in the world? Did I forget everything PHP taught me? What the heck are those weird commas from and I could swear a form element named "xname" is called in php via $xname ??? Please let me know what you see, -Marcus PS, I just ran phpinfo(); on my server and it looks like all the others that work. -- Marcus James Christian UNLIMITED Multimedia Internet Design http://mjchristianunlimited.com Proudly presents the music of CHROMATICUS at http://www.mp3.com/chromaticus and http://chromaticus.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] authentication help
Hi, Would someone please give me a few pointers on how to generate a simple PHP to check for user's name and password before directing to a directory? e.g., I have a index.php with a form where I have action="login.php". How would I write login.php to check username and password if I have them hard coded in login.php and if authentication fails the user is directed back to index.php? Is this safe? Regards, Norman -- 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] Trying to subtract...no luck. (Long Code)
Thanks all...I got what I needed. I'm amazed at how many different ways there are to do the same thing! mto -- Michael O'Neal Web Producer/ Autocrosser ST 28 '89 Civic Si - M A N G O B O U L D E R - http://www.thinkmango.com e- [EMAIL PROTECTED] p- 303.442.1821 f- 303.938.8507 -- 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] Trying to subtract...no luck. (Long Code)
Jeez michael, i'm sorry but i am not going to go through all of your code. I do have a suggestion for you, without looking at the code. As you know. php has flexible variables. I mean, if you say $a=1 then $a is an integer, if you say $b='i' then $b is a string. Very easy to make code quickly, but for the larger scripts it can be a pit trap. I think that while you intended the variables to be numbers, they somehow turned into strings. Maybe you added a (empty) string somewhere ($a .=''). Several ways to deal with it. First have a look at what is in the variable: echo 'string "a" is ['.$a.']'; i always add something around the string to see spaces. Another thing you can try is to force the value into an integer. I think something like $c= intval($a) - intval ($b); but have a look around the manual to be sure. hth, let me know at my own email if it helped? Chris --- - -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --- - -- 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 NEED HELP WITH PWS AND W98
I've been running Apache on 98SE (I agree - DON'T ASK!) for most of this year without ny issues at all. Win98needs reboots a few times a week, but it's not Apache's problem. I also run PHP4.0.6 and 4.0.8-dev and MySQL 3.23.43 and they all work and play well together. Just to keep my sanity, I also run a linux server too :). It helps me knowing that computers aren't supposed to have to be rebooted to keep them stable! -- Gaylen [EMAIL PROTECTED] http://www.gaylenandmargie.com PHP KISGB v2.1 Guestbook http://www.gaylenandmargie.com/phpwebsite "Richard S. Crawford" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Getting PHP to work with Apache is pretty simple. The documentation is easy to read. I would agree with trying Apache on your Win98 box; but be warned that the current Apache release is only supposed to be stable on NT platforms. Since I have win2k it's not an issue for me, but it might now work on Windows 98. At 08:54 AM 10/24/2001, Chris Hayes wrote: >hi Nicolas, >pws is not so great. if you are still in the beginning phase >you may consider to use the free Apache server. It has a >version for windows, very stable. >You just need to make some changes to the configuration file to >make php work. btw you do not need to compile php if you >download the right version! (don't download 'source' but maybe >they call it 'binary' or whatever). > >There are even packets on the internet which include working >combinations of apache + php4 + mysql (mysql= free very popular >web database). Just do a search on a search engine. >There are also instruction pages on how to make php work on >apache (you need to change two or three lines in a >configuration file). > >good luck. >Chris Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP object communication
Not coming from a programming background, I'm going to have difficulty explaining this one... :) I would like to handle an entire application through one object, which in turn contains objects. I only recently "got" classes though, and I don't fully understand if what I want to do is possible, or if I'm going about it the wrong way. Consider: Tying the first two together is no problem, I can just extend the Config class. However I would like to incorporate the third and fourth as objects inside the main object: Error = new Error; $Core->DB= new DB ?> This is fine when working in the main application, or in the $Core object, but where I get stuck is with communication between the $Core->Error and $Core->DB objects. Say for example that within the DB class I encountered an error, and wanted to talk to the Error object - I /could/ do this: Error = $Core->Error; } } ?> But if I extend the application later and add a bunch of new classes, it means I have to do the same for each object I add. I get the impression that I might be able to do this with references, but I can't get a handle on them for the life of me. Can someone explain? Sorry for the lengthy post. Thanks, adam -- 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] problem pattern matching a url with question mark
http://([\/~_\.0-9A-Za-z#&-?]+) first you have to escape the ? with a backslash and second the - has to go at the end of the [] or else it thinks you mean any char between & and ? On Wed, 24 Oct 2001 16:27:34 -0400, [EMAIL PROTECTED] wrote: >ah, sorry about the confusion. The url I provided is just an example >of a >url containing a question mark for which I'm trying to find a >pattern match >in my content text. > > >-Original Message- >From: Neil Freeman [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, October 24, 2001 4:16 AM >Cc: [EMAIL PROTECTED] >Subject: Re: [PHP] problem pattern matching a url with question mark > > >Why does your URL contain .asp? > >[EMAIL PROTECTED] wrote: > >> I found the following code currently used on our website to match a >url >> expression. Unfortunately, when I added a question mark, the >>webpage >that >> contained the url with the question mark just "hung" and would not >load into >> my browser at all. Currently, the url links only up to the question >mark. >> >> Here's the url I'm trying to get to work: >> >>http://www.thejakartapost.com/yesterdaydetail.asp?fileid=20011018.G0 >>7 >> >> Can you look at the code below and tell me what I'm doing wrong? >> >> - Shawna >> >> ORIGINAL CODE >> >> // this will find web addresses and encapsulate each one in a >>standard >> anchor >> >> while(ereg("http://([\/~_\.0-9A-Za-z#&-]+)", $content, $match)){ >> $http_old = $match[0]; >> $http = "dubdubdub" . $match[1] . $match[2]; >> $url = "HREF=\"javascript:externalURL('$http')\";>$http"; >> $content = ereg_replace($http_old, $url, $content); >> }; >> >> $content = ereg_replace("dubdubdub", "http://";, $content); >> >> CODE WITH QUESTION MARK >> >> // this will find web addresses and encapsulate each one in a >>standard >> anchor >> >> while(ereg("http://([\/~_\.0-9A-Za-z#&-?]+)", $content, $match)){ >> $http_old = $match[0]; >> $http = "dubdubdub" . $match[1] . $match[2]; >> $url = "HREF=\"javascript:externalURL('$http')\";>$http"; >> $content = ereg_replace($http_old, $url, $content); >> }; >> >> $content = ereg_replace("dubdubdub", "http://";, $content); >> >> -- >> 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] >> >> *** >> This message was virus checked with: SAVI 3.50 >> last updated 23rd October 2001 >> *** > >-- > > Email: [EMAIL PROTECTED] > [EMAIL PROTECTED] > > > -- Mark, [EMAIL PROTECTED] on 10/24/2001 -- 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] Can PHP do what this javascript does...
Thanks for all the reponses. I know that php is server-side only, and that certain things like mouse-overs, are client-side, wasn't sure about the printer function though. I could have assumed it was, but I try not to assume anything, but always ask to make sure. Regards, Chip Mike Eheler <[EMAIL PROTECTED]> on 10/24/2001 10:31:30 PM Internet mail from: To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: Re: [PHP] Can PHP do what this javascript does... There's a really long method of doing it that would work, but would involve server-side browser detection, and a database containing a list of browsers that support print shortcuts. Stick with the JS. Mike [EMAIL PROTECTED] wrote: >To print: >Click here or Select File >and then Print from your browser's menu. > >Is there an equivelant bit of code to do this printer shortcut with php? > >-- >Chip Wiegand >Computer Services >www.simradusa.com >[EMAIL PROTECTED] >Simrad, Inc >Lynnwood, WA >425-712-1138 > >"There is no reason anyone would want a computer in their home." > --Ken Olson, president, chairman and founder of Digital Equipment Corp., >1977 > (-- Then why do I have nine? Somebody help me!) > > -- 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: Removing an Array Element
That won't work, as that will only unset the *value* not the *element*. I think I have to do the following as there isn't a prebuilt PHP array function that does what I need -- the following should work fine: $myArray = array('100'=>'jibberjabber','200'=>'morejibberjabber','0'=>''); if(isset($myArray[0])) { foreach($myArray as $key=>$value) { if($key == 0) continue; $newArray[$key] = $value; } $myArray = $newArray; } Thanks though -- :-) Jason "Julio Nobrega Trabalhando" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >Basically, I just want to know if the Key is set, and if so -- remove it... > > unset();... > > -- > > Julio Nobrega > > A hora está chegando: > http://toca.sourceforge.net > "Jason Caldwell" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > How can I remove an Array Element from my Array? > > > > For example: > > > > $myArray = > > array('100'=>'jibberjabber','200'=>'morejibberjabber','0'=>''); > > > > if(isset($myArray[0])) > > // here is where I want to purge Key[0] from the Array all > together > > ; > > > > I check for the presence of Key[0], which may not be the first or last key > > in the array, so array_pop won't work... array_splice would be tricky and > > would like to avoid creating a FOREACH or FOR loop -- > > > > Basically, I just want to know if the Key is set, and if so -- remove > it... > > is there a simple way to do this? > > > > Thanks > > 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] Hmmm? PHP+PostgreSQL
I've installed PostgreSQL into /usr/local/pgsql, then I tried to include into my PHP support for PostgreSQL and made next: (I had pre-compiled support for mySQL before that) make clean ./configure --with-apxs=/usr/local/apache/bin/apxs --enable-versioning --enable-track-vars --with-pgsql --with-mysql make make install (I have mySQL, too) Compilation process was great, no errors. Nevertheless, next little PHP script: testing needed functions of current-gtlg with PHP+PostgreSQL still says: Fatal error: Call to undefined function: pg_connect() in /usr/local/apache/htdocs/pg-php/index.php on line 7 What I did wrong, guys? Will be looking forward your answer, please, CC: to [EMAIL PROTECTED] Thanks. -- green [http://www.extrasy.net] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Removing an Array Element
>Basically, I just want to know if the Key is set, and if so -- remove it... unset();... -- Julio Nobrega A hora está chegando: http://toca.sourceforge.net "Jason Caldwell" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > How can I remove an Array Element from my Array? > > For example: > > $myArray = > array('100'=>'jibberjabber','200'=>'morejibberjabber','0'=>''); > > if(isset($myArray[0])) > // here is where I want to purge Key[0] from the Array all together > ; > > I check for the presence of Key[0], which may not be the first or last key > in the array, so array_pop won't work... array_splice would be tricky and > would like to avoid creating a FOREACH or FOR loop -- > > Basically, I just want to know if the Key is set, and if so -- remove it... > is there a simple way to do this? > > Thanks > 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]
RE: [PHP] how do i give optional arguments to functions??
Yes, it definitely should :) Heh, I think I originally had "", but then new that'd result with the double space problem, so changed it. My bad. -Original Message- From: John A. Grant [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 1:28 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] how do i give optional arguments to functions?? "Chris Bailey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Check out the manual section on default parameters... > > But the basics are: > > function top($image = "null") { > if ($image) Shouldn't that be: function top($image=null) if ($image) -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- 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] Trying to subtract...no luck. (Long Code)
Another way to accomplish this, preferred in my mind, is: while ($myrow = db_fetch_array($result)) : while (list($key,$val) = each($myrow)) : $$key = $val; endwhile; $difference = $budget - $actual; . . . endwhile; Chuck At 1:34 PM -0700 10/24/01, Jim Lucas wrote: >one problem on the second script you are trying to use variables that are in >an array. > >if this is where you are talking about >you need to specify the array[key] > >> while ($myrow=DB_fetch_array($result)){ >> >> >> $difference = ($budget - $actual); > >$difference = ($myrow[budget] - $myrow[actual]); > Chuck Theobald, Technology Manager ERIC Clearinghouse on Educational Management 5207 University of Oregon, Eugene, OR, 97403-5207 800-438-8841 * 541-346-1662 (voice) * 541-346-2334 (fax) * 541-337-0182 (cell) * * http://eric.uoregon.edu/ * mailto:[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] PHP connetion of mySQL
Keep getting this error, anyone know why .. Using dreamweaver and Phakt plugin for PHP and everytime I connect inside dreamweaver it works fine, but once posted to the web I get an error. Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in /home/sites/site2/web/atkins/adodb/adodb-mysql.inc.php on line 113 Thnaks -- 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 do i give optional arguments to functions??
"Chris Bailey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Check out the manual section on default parameters... > > But the basics are: > > function top($image = "null") { > if ($image) Shouldn't that be: function top($image=null) if ($image) -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- 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] Can PHP do what this javascript does...
There's a really long method of doing it that would work, but would involve server-side browser detection, and a database containing a list of browsers that support print shortcuts. Stick with the JS. Mike [EMAIL PROTECTED] wrote: >To print: >Click here or Select File >and then Print from your browser's menu. > >Is there an equivelant bit of code to do this printer shortcut with php? > >-- >Chip Wiegand >Computer Services >www.simradusa.com >[EMAIL PROTECTED] >Simrad, Inc >Lynnwood, WA >425-712-1138 > >"There is no reason anyone would want a computer in their home." > --Ken Olson, president, chairman and founder of Digital Equipment Corp., >1977 > (-- Then why do I have nine? Somebody help me!) > > -- 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] Opening a new page when done
If you are going to use the javascript solution, be sure to add a container for browsers that do not support javascript or have it disabled: Of course, pure PHP is far superior... :-) Chuck James Fairbairn wrote: > just print the following at the point where you decide you want to redirect: > > > > > > a better alternative is to send a redirection header with the response, but > this depends on you not sending any HTML output to the browser before > processing is complete: > > header("Location: whereveryouwannago.php"); > exit; // don't do any more processing after this redirect. > ?> > > hope this helps. > > james -- 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] problem pattern matching a url with question mark
ah, sorry about the confusion. The url I provided is just an example of a url containing a question mark for which I'm trying to find a pattern match in my content text. -Original Message- From: Neil Freeman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 4:16 AM Cc: [EMAIL PROTECTED] Subject: Re: [PHP] problem pattern matching a url with question mark Why does your URL contain .asp? [EMAIL PROTECTED] wrote: > I found the following code currently used on our website to match a url > expression. Unfortunately, when I added a question mark, the webpage that > contained the url with the question mark just "hung" and would not load into > my browser at all. Currently, the url links only up to the question mark. > > Here's the url I'm trying to get to work: > http://www.thejakartapost.com/yesterdaydetail.asp?fileid=20011018.G07 > > Can you look at the code below and tell me what I'm doing wrong? > > - Shawna > > ORIGINAL CODE > > // this will find web addresses and encapsulate each one in a standard > anchor > > while(ereg("http://([\/~_\.0-9A-Za-z#&-]+)", $content, $match)){ > $http_old = $match[0]; > $http = "dubdubdub" . $match[1] . $match[2]; > $url = "$http"; > $content = ereg_replace($http_old, $url, $content); > }; > > $content = ereg_replace("dubdubdub", "http://";, $content); > > CODE WITH QUESTION MARK > > // this will find web addresses and encapsulate each one in a standard > anchor > > while(ereg("http://([\/~_\.0-9A-Za-z#&-?]+)", $content, $match)){ > $http_old = $match[0]; > $http = "dubdubdub" . $match[1] . $match[2]; > $url = "$http"; > $content = ereg_replace($http_old, $url, $content); > }; > > $content = ereg_replace("dubdubdub", "http://";, $content); > > -- > 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] > > *** > This message was virus checked with: SAVI 3.50 > last updated 23rd October 2001 > *** -- Email: [EMAIL PROTECTED] [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] Trying to subtract...no luck. (Long Code)
one problem on the second script you are trying to use variables that are in an array. if this is where you are talking about you need to specify the array[key] > while ($myrow=DB_fetch_array($result)){ > > > $difference = ($budget - $actual); $difference = ($myrow[budget] - $myrow[actual]); > > > printf("%s%s%s%s%s%s To: " "Php-General@Lists. Php. Net"" <[EMAIL PROTECTED]> Sent: Wednesday, October 24, 2001 1:18 PM Subject: [PHP] Trying to subtract...no luck. (Long Code) > Hi. I'm trying to figure out how to subtract 1 variable from another, but > I'm not having any luck. > > It works on this page: > > > > $db_name = "comanche"; > $table_name = "ProjectTasks"; > > $connection = @mysql_connect("$db","$user","$pass") or die("Couldn't > Connect."); > $db = @mysql_select_db($db_name, $connection) or die("Couldn't select > database."); > > $sql ="SELECT budget,actual FROM $table_name"; > > $result = @mysql_query($sql, $connection) or die("Couldn't execute query."); > > while ($row = mysql_fetch_array($result)) { > $budget=$row['budget']; > $actual=$row['actual']; > $difference = ($budget - $actual); > > > echo "$budget - $actual = $difference"; > > } > > > $num = @mysql_num_rows($result); > > ?> > > > But not on this page: > > ---BEGIN LONG PHP STUFF -- > > > > $title = "Tasks Maintenance"; > include("../inc/hdr.php"); > include("header.inc"); > include("DateFunctions.inc"); > > > if (!isset($ProjectID)){ > > echo "This page must be called from the projects list page with the > tasks link. Alternatively, you can enter the link as > Tasks.php?ProjectID=ProjectID numberProject List"; > exit; > } > > if ($submit) { > > //initialise no input errors assumed initially before we test > $InputError = 0; > > /* actions to take once the user has clicked the submit button > ie the page has called itself with some user input */ > > //first off validate inputs sensible > > if (strlen($TaskName) > 50 OR strlen($TaskName)==0) { > $InputError = 1; > echo "The task name must be entered and be fifty characters or > less long"; > } elseif (!is_date($EarliestStart)) { > $InputError = 1; > echo "The date the task was initiated must be specified in the > format dd/mm/"; > } elseif (!is_numeric($ExpectedDuration) || $ExpectedDuration<0){ > $InputError = 1; > echo "The expected duration of the task must be specified as a > number - greater or equal to 0"; } > > > if ($InputError !=1){ > > $SQL_EarliestStart = FormatDateForSQL($EarliestStart); > > if (isset($SelectedTask)) { > > > > $sql = "UPDATE ProjectTasks SET TaskName='$TaskName', > TaskDescription='$TaskDescription', EarliestStart='$SQL_EarliestStart', > TaskChampion='$TaskChampion', ExpectedDuration=$ExpectedDuration, > Status='$Status', budget='$budget', actual='$actual' WHERE TaskID = > $TaskID"; > > $result = DB_query($sql,$db); > if (DB_error_no($db) !=0) { > echo "The task could not be updated because - " . > DB_error_msg($db) . " The SQL statement used for the update was:$sql"; > } else { > echo "task updated"; > unset($SelectedTask); > unset($TaskName); > unset($TaskDescription); > unset($TaskChampion); > unset($EarliestStart); > unset($ExpectedDuration); > unset($Status); > unset($budget); > unset($actual); > } > > } else { //not a new task > > > > $sql = "INSERT INTO ProjectTasks (ProjectID, TaskName, > TaskDescription, EarliestStart, TaskChampion, ExpectedDuration, Status, > budget, actual) VALUES ($ProjectID, '$TaskName', '$TaskDescription', > '$SQL_EarliestStart', '$TaskChampion', $ExpectedDuration, '$Status', > '$budget', '$actual')"; > > $result = DB_query($sql,$db); > if (DB_error_no($db) !=0) { > echo "The task could not be added because - " . > DB_error_msg($db) . " the SQL used to insert the new task was:" . $sql; > } else { > echo "Task inserted"; > unset($TaskName); > unset($TaskDescription); > unset($TaskChampion); > unset($EarliestStart); > unset($ExpectedDuration); > unset($Status); > unset($budget); > unset($actual); > } > } > } else { > echo "Validation failed, no updates or deletes took place."; > } > > } elseif ($delete) { > //the link to delete a selected record was clicked instead of the submit > button > > $sql="DELETE FROM ProjectTasks WHERE TaskID=$TaskID"; > $result = DB_query($sql,$db); > > $sql="DELETE FROM TaskDependancies WHERE TaskID=$TaskID"; > $result = DB_query($sql,$db); > > $sql="DEL
[PHP] slow mcrypt_create_iv()
Hi, I have a system of programs that use mcyrpt routines. The first few times I run through the routine containing mcrypt_create_iv it returns quite quickly, but afterwards, this function can take from 5 to 15 seconds to return. The function wrapping the encryption routines is as follows: $this->cipher = MCRYPT_TripleDES; $this->mcrypt_mode = MCRYPT_MODE_ECB; $this->randomizer = MCRYPT_DEV_RANDOM; function encrypt_and_hex($input) { include '/www/php/key.inc'; $td = mcrypt_module_open ($this->cipher, "", $this->mcrypt_mode, ""); $iv_size = mcrypt_enc_get_iv_size ($td); $iv = mcrypt_create_iv ($iv_size, $this->randomizer); mcrypt_generic_init ($td, $key, $iv); $output = bin2hex(mcrypt_generic ($td, $input)); mcrypt_generic_end ($td); return $output; } I get similar delays in the decryption routine. Any ideas as to why it slows down and/or how to fix it would be appreciated. Thanks, Chuck Chuck Theobald, Technology Manager ERIC Clearinghouse on Educational Management 5207 University of Oregon, Eugene, OR, 97403-5207 800-438-8841 * 541-346-1662 (voice) * 541-346-2334 (fax) * 541-337-0182 (cell) * * http://eric.uoregon.edu/ * mailto:[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] Trying to subtract...no luck. (Long Code)
Hi. I'm trying to figure out how to subtract 1 variable from another, but I'm not having any luck. It works on this page: "; } $num = @mysql_num_rows($result); ?> But not on this page: ---BEGIN LONG PHP STUFF -- This page must be called from the projects list page with the tasks link. Alternatively, you can enter the link as Tasks.php?ProjectID=ProjectID numberProject List"; exit; } if ($submit) { //initialise no input errors assumed initially before we test $InputError = 0; /* actions to take once the user has clicked the submit button ie the page has called itself with some user input */ //first off validate inputs sensible if (strlen($TaskName) > 50 OR strlen($TaskName)==0) { $InputError = 1; echo "The task name must be entered and be fifty characters or less long"; } elseif (!is_date($EarliestStart)) { $InputError = 1; echo "The date the task was initiated must be specified in the format dd/mm/"; } elseif (!is_numeric($ExpectedDuration) || $ExpectedDuration<0){ $InputError = 1; echo "The expected duration of the task must be specified as a number - greater or equal to 0"; } if ($InputError !=1){ $SQL_EarliestStart = FormatDateForSQL($EarliestStart); if (isset($SelectedTask)) { $sql = "UPDATE ProjectTasks SET TaskName='$TaskName', TaskDescription='$TaskDescription', EarliestStart='$SQL_EarliestStart', TaskChampion='$TaskChampion', ExpectedDuration=$ExpectedDuration, Status='$Status', budget='$budget', actual='$actual' WHERE TaskID = $TaskID"; $result = DB_query($sql,$db); if (DB_error_no($db) !=0) { echo "The task could not be updated because - " . DB_error_msg($db) . " The SQL statement used for the update was:$sql"; } else { echo "task updated"; unset($SelectedTask); unset($TaskName); unset($TaskDescription); unset($TaskChampion); unset($EarliestStart); unset($ExpectedDuration); unset($Status); unset($budget); unset($actual); } } else { //not a new task $sql = "INSERT INTO ProjectTasks (ProjectID, TaskName, TaskDescription, EarliestStart, TaskChampion, ExpectedDuration, Status, budget, actual) VALUES ($ProjectID, '$TaskName', '$TaskDescription', '$SQL_EarliestStart', '$TaskChampion', $ExpectedDuration, '$Status', '$budget', '$actual')"; $result = DB_query($sql,$db); if (DB_error_no($db) !=0) { echo "The task could not be added because - " . DB_error_msg($db) . " the SQL used to insert the new task was:" . $sql; } else { echo "Task inserted"; unset($TaskName); unset($TaskDescription); unset($TaskChampion); unset($EarliestStart); unset($ExpectedDuration); unset($Status); unset($budget); unset($actual); } } } else { echo "Validation failed, no updates or deletes took place."; } } elseif ($delete) { //the link to delete a selected record was clicked instead of the submit button $sql="DELETE FROM ProjectTasks WHERE TaskID=$TaskID"; $result = DB_query($sql,$db); $sql="DELETE FROM TaskDependancies WHERE TaskID=$TaskID"; $result = DB_query($sql,$db); $sql="DELETE FROM TaskDependancies WHERE RequiresTaskID=$TaskID"; $result = DB_query($sql,$db); echo "Task Deleted ! "; unset($SelectedTask); unset($TaskName); unset($TaskDescription); unset($TaskChampion); unset($EarliestStart); unset($ExpectedDuration); unset($Status); unset($budget); unset($actual); } /*Show some details about the master task for which tasks are being maintained */ $sql = "SELECT ProjectName, ProjectDescription, PlayerName, PlayerEmail FROM ProjectMaster, Players WHERE ProjectMaster.Champion = Players.PlayerID AND ProjectID =" . $ProjectID; $result = DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); echo "Project: " . $myrow["ProjectName"] . "Project Lead: " . $myrow["PlayerName"] . "" . $myrow["ProjectDescription"] . ""; /*Show tasks underway for modification or viewing status*/ $sql = "SELECT TaskID, TaskName, DATE_FORMAT(EarliestStart,'%d/%m/%Y') AS FmtEarliestStart, ExpectedDuration, PlayerName, Status, budget, actual FROM ProjectTasks, Players WHERE ProjectTasks.TaskChampion=Players.PlayerID AND ProjectTasks.ProjectID=" . $ProjectID; $result = DB_query($sql, $db); if (DB_num_rows($result)!=0) { echo " Task Earliest Start Duration Project Lead Status Budget Actual Difference\n\n"; while ($myrow=DB_fetch_array
[PHP] Removing an Array Element
How can I remove an Array Element from my Array? For example: $myArray = array('100'=>'jibberjabber','200'=>'morejibberjabber','0'=>''); if(isset($myArray[0])) // here is where I want to purge Key[0] from the Array all together ; I check for the presence of Key[0], which may not be the first or last key in the array, so array_pop won't work... array_splice would be tricky and would like to avoid creating a FOREACH or FOR loop -- Basically, I just want to know if the Key is set, and if so -- remove it... is there a simple way to do this? Thanks 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] Re: [PHP-DB] array-problems
Try this: <<< BEGIN:PHP-CODE >>> $result = mysql_query ("SELECT DISTINCT date FROM linktracker WHERE name LIKE '$PHP_AUTH_USER' GROUP BY date ORDER BY date"); if (mysql_num_rows($result)) { for($i=0;$i array($i => $row["date"]), "end" => array($i => $row["date"]) ); } } else { print ("Sorry, no record were found."); } function drawSelect($which) { global $date; foreach($date[$which] AS $date_begin) { ?> Begindate Enddate <<< END:PHP-CODE >>> btw - you need to watch your closing '>' you are missing a few. Plus to get distince to work right you need to use the "GROUP BY" clause. Jim - Original Message - From: "Bart Verbeek" <[EMAIL PROTECTED]> To: "Php-General-list" <[EMAIL PROTECTED]>; "PHP-DB mailinglist" <[EMAIL PROTECTED]> Sent: Wednesday, October 24, 2001 12:23 PM Subject: [PHP-DB] array-problems > Hello, > Can anyone help me with this script I'm using? > > I've saved dates in a database and want to make two select-lists of these > dates in a html-form. > I want to select each unique date one time (no doubles). > List 1 is used to set the begin-date of the query for the report, List 2 > will > set the end-date and must be reversed. > When the form is processed the data selected between the begin-date and the > end-date has to be show. > > I can't seem to get my code to work: the select-lists stay empty after > processing the code below. > > Can anyone help? Tips... > > regards, > > Bart > > > <<< BEGIN:PHP-CODE >>> > $i=0; > $result = mysql_query ("SELECT DISTINCT date FROM linktracker WHERE name > LIKE '$PHP_AUTH_USER' ORDER BY date"); > if ($row = mysql_fetch_array($result)) { > do { > $date = array( > "begin" => array($i => $row["date"]), > "end" => array($i => $row["date"]) > ); > $i++; > } while ($row = mysql_fetch_array($result)); > } else {print ("Sorry, no record were found."); > } //end else $result > > print("BegindateEnddate\n". > " name=\"date_select\">". > " value=\"date_select\">". > ""); > > while (list($key, $date_begin) = each($date[begin])) { > echo "" . $date_begin . > "\n"; > } > > print(""); > > rsort($date[end]); > > while (list($key, $date_end) = each($date[end])) { > echo "" . $date_end . > "\n"; > } > > print("\n". > "". > ""); > > mysql_free_result ($result); > mysql_close(); > <<< END:PHP-CODE >>> > > > -- > PHP Database 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] how do i give optional arguments to functions??
Don't forget: if a function has multiple arguments the optional ones must be to the RIGHT of the required ones: function testing123($one, $two="2", $three="3")// Good function testing123($one="1", $two, $three="3")// Bad function testing123($one="1", $two="2", $three)// Bad Mike Frazer "Chris Bailey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > It could be, but then you would have two spaces in between the 2nd and 3rd > "blah", instead of just the one space. But, depending on your actual > application, this may work out. > > -Original Message- > From: DL Neil [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 24, 2001 10:41 AM > To: Arpad Tamas; Richard S. Crawford; sunny AT wde; php > Subject: Re: [PHP] how do i give optional arguments to functions?? > > > > On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote: > > > > The default value for $image parameter was missing: > > > > > function top ($image="defaultvalue") { > > > if ($image=="defaultvalue") echo "blah blah blah"; > > > else echo "blah blah $image blah"; > > > } > > If the default value can be set to an empty string can the if statement then > be removed? > >function top ($image="") >{ > echo "blah blah $image blah"; >} > > - watch those spaces (if they're present in live data)! > =dn > > > > -- > 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] URL variables
How do I reference URL variables..? -- 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] sorting an array of objects
On Wed, Oct 24, 2001 at 10:43:53AM +0100, L Melville wrote: > Is it possible to sort a class array using array multisort, I have two items > in each class that I wish to sort by, one is a text and the other is the > first item in an array within within each class. i.e.;- > > $class[$index]->text; > $class[$index]->array[0]; > > how can I do this? I'd use usort() instead. http://www.php.net/manual/en/function.usort.php The manual page has a couple examples for sorting objects by their member variables. 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]
Re: [PHP] Can PHP do what this javascript does...
Javascript can be embedded in PHP files anyway. I do a lot of database management interfaces in PHP and one thing I want to do is protect items from being accidentally deleted. I use Javascript to verify that they intended to click on the link to delete the information. Remember, PHP files are enhanced HTML files, which means the browser will parse them exactly the same as a standard HTML file. Mike Frazer "Richard S. Crawford" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Unfortunately, since PHP lives on the server and JavaScript lives on the browser, there really is no way to get PHP to do what you want. Stick with JavaScript. There's really no reason not to when you're doing client-side programming. At 11:14 AM 10/24/2001, [EMAIL PROTECTED] wrote: >To print: >Click here or Select File >and then Print from your browser's menu. > >Is there an equivelant bit of code to do this printer shortcut with php? > >-- >Chip Wiegand >Computer Services >www.simradusa.com >[EMAIL PROTECTED] >Simrad, Inc >Lynnwood, WA >425-712-1138 > >"There is no reason anyone would want a computer in their home." > --Ken Olson, president, chairman and founder of Digital Equipment Corp., >1977 > (-- Then why do I have nine? Somebody help me!) > > >-- >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] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] FORMs (HELP) --- PHP Gurus (Please HELP)
Hi, How can be possible to call other functions (that have a html pages) from a first function that also have a html with a form and pass all html variables without losing them? I've a problem that from a html form I'm losing all html variables and this is happening because this form is located in the 3th function (one inside another)... If you know a better way to deal with this... I'm interested to learn... Thanks for all. Simple example that may work: file name: xyz.php function display($ref) { printf('The REF have %s",$ref); } function query() { echo('); echo(' Ref '); } // PG options switch($pg) { case 1:display($ref); break; default:query(); break; } -- 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: Redirecting to a new php file
Use the header() function in conjunction with the Location HTTP header: header("Location: http://host.domain.tld/path/to/file.php";); This MUST be sent to the browser before ANY other output. You can execute as many commands as you like but this must come before any output (and before the tag in your file). Mike Frazer "Sridhar Moparthy" <[EMAIL PROTECTED]> wrote in message news:001301c15cbc$f38018b0$[EMAIL PROTECTED]... > Hi All, > > Is there any command in PHP that redirects to a php file from another php > file? > If not does any one know how to implement this functionality? > > Thank you, > Sridhar Moparthy > > > -- 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] is_int() and is_double
I am having trouble with the is_int() and is_double() functions. The relevant parts of the function I'm using are: --- function lookupProduct( $partNum, $serial ) { print( "lookupProduct( $partNum, $serial )\n" ); print( "\n" ); printf( "\$partNum: %d does %sappear to be a number, and %sa double\n", $partNum, ( is_numeric( $partNum ) ? "" : "not " ), ( is_double( $partNum ) ? "" : "not " ) ); printf( "\$serial: %d does %sappear to be a number, and %sa double\n", $serial, ( is_numeric( $serial ) ? "" : "not " ), ( is_double( $serial ) ? "" : "not " ) ); } --- The function is called after a form submission from HTML. When I enter 12 14 I get: --- lookupProduct( 12, 14 ) $partNum: 12 does appear to be a number, and not a double $serial: 14 does appear to be a number, and not a double --- When I enter 12.514.8 I get: --- lookupProduct( 12.5, 14.8 ) $partNum: 12 does appear to be a number, and not a double $serial: 14 does appear to be a number, and not a double --- Why is the function is_double() failing? I have an analagous problem with the is_int() function. Thanks! -Michael -- In light of the terrorist attack on the U.S.: They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -- Benjamin Franklin, 1759 -- 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] use of system/exec
On Wed, 24 Oct 2001 18:19:19 +, John Gurley wrote: >Hello, >Could someone please show me an example of code using system >or >exec. Would be great if the string was a unix command. >Cheers >John I like backticks the best because they're easiest to deal with. -- 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] Can PHP do what this javascript does...
Unfortunately, since PHP lives on the server and JavaScript lives on the browser, there really is no way to get PHP to do what you want. Stick with JavaScript. There's really no reason not to when you're doing client-side programming. At 11:14 AM 10/24/2001, [EMAIL PROTECTED] wrote: >To print: >Click here or Select File >and then Print from your browser's menu. > >Is there an equivelant bit of code to do this printer shortcut with php? > >-- >Chip Wiegand >Computer Services >www.simradusa.com >[EMAIL PROTECTED] >Simrad, Inc >Lynnwood, WA >425-712-1138 > >"There is no reason anyone would want a computer in their home." > --Ken Olson, president, chairman and founder of Digital Equipment Corp., >1977 > (-- Then why do I have nine? Somebody help me!) > > >-- >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] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] use of system/exec
Hello, Could someone please show me an example of code using system or exec. Would be great if the string was a unix command. Cheers John _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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] Can PHP do what this javascript does...
On Wed, 24 Oct 2001 [EMAIL PROTECTED] wrote: > To print: > Click here or Select File > and then Print from your browser's menu. > > Is there an equivelant bit of code to do this printer shortcut with > php? PHP - _server_ side Javascript - _client_ side PHP cannot affect your client like Javascript can. -- Sapere aude My mind not only wanders, it sometimes leaves completely. -- 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 PHP do what this javascript does...
To print: Click here or Select File and then Print from your browser's menu. Is there an equivelant bit of code to do this printer shortcut with php? -- Chip Wiegand Computer Services www.simradusa.com [EMAIL PROTECTED] Simrad, Inc Lynnwood, WA 425-712-1138 "There is no reason anyone would want a computer in their home." --Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977 (-- Then why do I have nine? Somebody help me!) -- 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] phplib, pear db, metabase, adodb, and native mysql benchmarks
Someone asked me to benchmark PHPLib also. Here is the revised benchmarks, with some minor speedups for PEAR DB and Metabase. Benchmark was to select 82 rows from the products table 200 times. The tests were repeated 5 times. Connection times were excluded from the benchmark. Lower values are better. All numbers are in seconds. MySQL 1.12 1.12 1.17 1.15 1.14 ADODB 1.43 1.47 1.47 1.44 1.45 PhpLib 1.53 1.62 1.64 1.64 1.57 PEAR 2.91 2.90 2.85 2.83 2.84 (fetchInto) PEAR 3.14 3.13 3.22 3.12 3.16 (fetchRow) M'base 4.51 4.55 4.46 4.54 4.52 (numeric columns) M'base 4.99 4.72 4.71 4.71 4.72 (named columns) Average Overhead MySQL 1.14 - ADODB 1.45 27% PhpLib 1.60 40% PEAR 2.87 152% (fetchInto) PEAR 3.15 176% (fetchRow) M'base 4.52 296% (numeric cols) M'base 4.77 318% (named cols) Methodology Results on Pentium 800 Mhz running Win 2000, PHP 4.0.6 ISAPI on IIS5 with MySQL 3.23, all on the same machine. PEAR DB from PHP 4.0.6, ADODB 1.40, PhpLib 7.2d and Metabase 1.57 were used. Code revised on 22nd October 2001. PhpLib tests added 24th October 2001. Source code for these tests is available from http://phplens.com/lens/adodb/ -- 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 do i give optional arguments to functions??
It could be, but then you would have two spaces in between the 2nd and 3rd "blah", instead of just the one space. But, depending on your actual application, this may work out. -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 10:41 AM To: Arpad Tamas; Richard S. Crawford; sunny AT wde; php Subject: Re: [PHP] how do i give optional arguments to functions?? > On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote: > > The default value for $image parameter was missing: > > > function top ($image="defaultvalue") { > > if ($image=="defaultvalue") echo "blah blah blah"; > > else echo "blah blah $image blah"; > > } If the default value can be set to an empty string can the if statement then be removed? function top ($image="") { echo "blah blah $image blah"; } - watch those spaces (if they're present in live data)! =dn -- 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] COPY TO SENT FOLDER
use imap_append. That is what that function is for... it is also how to handle drafts... check out www.tijuana.com, it is a commercial web based mail service I wrote entirely in php with IMAP support. It also handles multiple attachments, multiple attachment forwarding, and sign up 'on-the-fly' i,e, sign up is instantly avaiable. If it does whatyou want I can send you the functions I wrote for it. However, it is function style programming, not OOP style... caveat emptor... richard --- Jhun Hubac <[EMAIL PROTECTED]> wrote: > Hi! > > I would like to ask help regarding my PHP script for sending out mails > and > then making a copy of that sent mail to the Sents mailbox. I have been > working a sort of "workaround" for this by creating a "Cc:" to myself > and > then performing an imap_mail_move to my INBOX.Sent folder. But the > problem > with this procedure is that the "To:" header that will be seen in the > Sents > folder would be my email address instead of the legal recipient. Is it > possible to re-write the headers? Are there any procedures in performing > > this option for web-based email? > > > -Jhun- > > > > > -- > 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!? Make a great connection at Yahoo! Personals. http://personals.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 do i give optional arguments to functions??
> On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote: > > The default value for $image parameter was missing: > > > function top ($image="defaultvalue") { > > if ($image=="defaultvalue") echo "blah blah blah"; > > else echo "blah blah $image blah"; > > } If the default value can be set to an empty string can the if statement then be removed? function top ($image="") { echo "blah blah $image blah"; } - watch those spaces (if they're present in live data)! =dn -- 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 do i give optional arguments to functions??
Ahh, good point. Thanks for the tip. :) At 10:45 AM 10/24/2001, Tamas Arpad wrote: >Not really necessary, but I like to make code without any warning >message (it also makes the code more cleaner as you said), and you'll >get a warning message if there's no parameter given at the function >call (without the default value). > Arpi Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] how do i give optional arguments to functions??
Check out the manual section on default parameters... But the basics are: function top($image = "null") { if ($image) ... else ... } Or maybe: That will set image to be null, so that you can call top either as: top(); or top($someimage); -Original Message- From: sunny AT wde [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 9:58 AM To: php Subject: [PHP] how do i give optional arguments to functions?? hi all!! i'm writing functions like - --- function top () { echo "blah blah blah";} --- what i want to do is make it so that i can do - --- function top($image) { echo "blah blah $image blah"; } --- but also make the $image parameter in the top() as optional. so if its not there, then tell php not to worry about it. any ideas?? thanks! sunny __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.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 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 do i give optional arguments to functions??
On Wednesday 24 October 2001 19:26, Richard S. Crawford wrote: > Hm, is the default attribute necessary? I've used this sort of > approach without the default attribute just fine in the past. > Though I admit that the default attribute would make me feel more > secure. Not really necessary, but I like to make code without any warning message (it also makes the code more cleaner as you said), and you'll get a warning message if there's no parameter given at the function call (without the default value). Arpi > > At 10:30 AM 10/24/2001, Arpad Tamas wrote: > >On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote: > > > >The default value for $image parameter was missing: > > > function top ($image="defaultvalue") { > > > if ($image=="defaultvalue") echo "blah blah blah"; > > > else echo "blah blah $image blah"; > > > } > > > > Arpi -- 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 do i give optional arguments to functions??
Hm, is the default attribute necessary? I've used this sort of approach without the default attribute just fine in the past. Though I admit that the default attribute would make me feel more secure. At 10:30 AM 10/24/2001, Arpad Tamas wrote: >On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote: > >The default value for $image parameter was missing: > > > function top ($image="defaultvalue") { > > if ($image=="defaultvalue") echo "blah blah blah"; > > else echo "blah blah $image blah"; > > } > > > Arpi > >-- >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] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Toronto Tutorial on Monday Oct.29 7PM
Turned out there was enough interest. Details at http://www.php.net/~rasmus/toronto.txt Will be another one in Ottawa on Thursday Nov.1, but I don't have details on that one yet. Watch the PHP calendar at www.php.net for it. -Rasmus -- 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 do i give optional arguments to functions??
On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote: The default value for $image parameter was missing: > function top ($image="defaultvalue") { > if ($image=="defaultvalue") echo "blah blah blah"; > else echo "blah blah $image blah"; > } > Arpi -- 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] File sharing
I'm trying to access an object as a Singleton. Here is the source code I'm using. The problem is that the member objFile from the $test variable is set to an open file in the class constructor. It works fine, but when I recover it from the memory, the file handler gets lost in starts being considered an int. Has anyone done this before ? "); include ("./ConcreteErrorLog/SingletonTest.inc"); $test = new Singleton; $test->testCreateSingleton(); echo("Creating shared memory."); $attachkey=1; $memorykey = shm_attach($attachkey); $variablekey=1; echo("Getting variable from memory. "); $test2=shm_get_var($memorykey,$variablekey); echo("Got the variable " . get_class($test2) . " "); if(!isset($test2) || empty($test2)){ echo("Putting in memory. "); shm_put_var($memorykey,$variablekey,$test); $test->testCreateSingleton(); } echo("The variable must be there by now. "); $test =& shm_get_var($memorykey,1); echo("Got it. "); echo("member is now = " . $test->intMember . ""); $test->testCreateSingleton(); if($HTTP_GET_VARS["clear"]=="yes"){ echo("Will remove shared object. "); shm_remove_var($memorykey,$variablekey); echo("Shared object removed. "); } echo(""); ?> -- 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 do i give optional arguments to functions??
function top ($image) { if ($image) echo "blah blah blah"; else echo "blah blah $image blah"; } There's probably a more efficient way to do it. At 09:57 AM 10/24/2001, sunny AT wde wrote: >hi all!! > >i'm writing functions like - >--- >function top () { > echo "blah blah blah";} >--- > >what i want to do is make it so that i can do - >--- >function top($image) { > echo "blah blah $image blah"; } >--- > >but also make the $image parameter in the top() as optional. so if >its not there, then tell php not to worry about it. > >any ideas?? > >thanks! > >sunny > > >__ >Do You Yahoo!? >Make a great connection at Yahoo! Personals. >http://personals.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] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to protect MySQL password
On Wednesday 24 October 2001 16:42, Kurt Lieber wrote: > On Wednesday 24 October 2001 00:30, you wrote: > > What we > > really need is an expert here to give us the low-down on the best > > way to accomplish the best security given regular tools. > > There isn't a way to solve it within the constraints you've > mentioned (shared server at a hosting provider, apache, > php-as-a-module) If apache has read access on a file, which it has > to have in order to serve it, someone else can get to that file via > a PHP/Perl/C/whatever script/program. Yes, you can use a server > that has php safe_mode enabled, but that doesn't mean your scripts > are safe -- it just means they're safe from being exploited by > other php scripts. If open_basedir is set properly for each user (and safe_mode is on), they can't reach each others' files at least from php. Of course if one can write and run programs with apache's user in another languages (perl, c, whatever) this doesn't help much (unless they can be configured in a similar way). > What about encryption? I think the encryption just makes someone's (who wants to steal something) work a little harder. In order to use the encrypted data, you have to decrypt it in php, so your code will contain the enc/decription algorithm and the keys that used. Arpi -- 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] how do i give optional arguments to functions??
hi all!! i'm writing functions like - --- function top () { echo "blah blah blah";} --- what i want to do is make it so that i can do - --- function top($image) { echo "blah blah $image blah"; } --- but also make the $image parameter in the top() as optional. so if its not there, then tell php not to worry about it. any ideas?? thanks! sunny __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.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] aaaaaaaaaaaaaaa
Franco Breciano wrote: > a for($i=0;$i<13;$i++){echo chr(97+($i?3:0));} drw -- 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 NEED HELP WITH PWS AND W98
Hi Oh yes, run apache+php on win 98. works like a wonder. try the php-win32 site for win98 specific distro. regards Srinivasan Ranganathan *NEW* Yahoo! Messenger for SMS *NEW* Now on your ORANGE phone Visit http://in.mobile.yahoo.com/smsmgr_signin.html -- 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] Problems with TTF
At 24.10.01 12:37, you wrote: >Warning: Could not find/open font in >/sdr/httpd/Prisa/DATA/private/libs/graficos/intradia.php on line 57 > >Line 57: ImageTTFText ($O_imagen, 11, 0, 10, 20, $O_colorValor, >"arial.ttf",$s_Valor); > >arial.ttf is into the same dir. > >Any ideas? I had the same problems while using postscriptfonts. try this $font=imagepsloadfont("YOUR.FONT"); you have to look for a substitution for imageepsloadfont maybe it´s imagettfloadfont(); - and you have to do this command TWO times. Don´t ask me why, but it works ?! Hope this helps Oliver -- 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: redirecting the browser
"Ozgur Demirtas" <[EMAIL PROTECTED]> wrote in message 001a01c15c57$ce6fad20$ea0d198a@Jackhammer">news:001a01c15c57$ce6fad20$ea0d198a@Jackhammer... > Hi all, > > I have a PHP script and at one point of the script I am trying to redirect > my browser to a certaion page. I can't seem to find an easy way of doing > this. header() call is so much of a problem. There is no such function like > redirect("...") as in ASP? > > PS: I am using PHP version 3.09 as an Apache module on Solaris. Discussion: http://www.chron.com/cs/CDA/story.hts/tech/735399 Solution: http://www.builder.com/Authoring/Tagmania/011000/index.html The latter solution is very good because it covers all of the bases. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- 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 NEED HELP WITH PWS AND W98
I use Apache on Win ME (don't ask!), and it works fine. Never tried it on 98 though. -- Dana Holt / [EMAIL PROTECTED] Xenos Online http://www.xenosonline.com/ --- This is my sig. There are many like it, but this one is mine. I must master my sig as I must master my life. Without my sig I am useless, without me my sig is useless. -- -Original Message- From: Richard S. Crawford [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 11:00 AM To: [EMAIL PROTECTED]; Nicolas Llamosas; [EMAIL PROTECTED] Subject:Re: [PHP] I NEED HELP WITH PWS AND W98 Getting PHP to work with Apache is pretty simple. The documentation is easy to read. I would agree with trying Apache on your Win98 box; but be warned that the current Apache release is only supposed to be stable on NT platforms. Since I have win2k it's not an issue for me, but it might now work on Windows 98. At 08:54 AM 10/24/2001, Chris Hayes wrote: >hi Nicolas, >pws is not so great. if you are still in the beginning phase >you may consider to use the free Apache server. It has a >version for windows, very stable. >You just need to make some changes to the configuration file to >make php work. btw you do not need to compile php if you >download the right version! (don't download 'source' but maybe >they call it 'binary' or whatever). > >There are even packets on the internet which include working >combinations of apache + php4 + mysql (mysql= free very popular >web database). Just do a search on a search engine. >There are also instruction pages on how to make php work on >apache (you need to change two or three lines in a >configuration file). > >good luck. >Chris Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Annotated PHP Manual
try to use webzip, or teleport, or such kind of software Salu2, V -Mensaje original- De: DL Neil [mailto:[EMAIL PROTECTED]] Enviado el: sábado 20 de octubre de 2001 17:08 Para: [EMAIL PROTECTED]; Yasuo Ohgaki Asunto: Re: [PHP] Re: Annotated PHP Manual > Khalid Hazmi wrote: > > How I can download the current Annotated PHP Manual??? > There is no such thing... AFAIK. => Yasuo Ohgaki Yasuo: Yes there is (and VERY useful it is too), check out the range of PHP documentation available from http://www.php.net/docs.php Khalid: Unlike some other packages I don't think there's a zipped-up, ready-for-download version. I presume this is because the online version is always 'the latest' - but I don't know how often they update it (maybe that's somewhere on the page I just quoted!?) You could try something called a "webwhacker" to download the web of pages that make up the manual... =dn -- 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] file system question
Well, this is a problem.. with perl, you can use suidperl, but not with php.. the most easyest way is to give write permission to apache user to the directory you want to upload the files... Rafael Steil On Wednesday 24 October 2001 11:43, you wrote: > Hello- > > I'm trying to write a php script that creates a directory and then copies > uploaded files to that directory. That isn't hard but what is hard is the > fact that the script tells me that i do not have permission to do any of > these actions. I'm running red hat 7.1 and I have heard things about > SetUID and sticky bits, however since I'm pretty much still a novice at > linux I'm not too sure what to do. The script is running under the > username Apache any ideas? > > thanks.. > jay -- 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 NEED HELP WITH PWS AND W98
Getting PHP to work with Apache is pretty simple. The documentation is easy to read. I would agree with trying Apache on your Win98 box; but be warned that the current Apache release is only supposed to be stable on NT platforms. Since I have win2k it's not an issue for me, but it might now work on Windows 98. At 08:54 AM 10/24/2001, Chris Hayes wrote: >hi Nicolas, >pws is not so great. if you are still in the beginning phase >you may consider to use the free Apache server. It has a >version for windows, very stable. >You just need to make some changes to the configuration file to >make php work. btw you do not need to compile php if you >download the right version! (don't download 'source' but maybe >they call it 'binary' or whatever). > >There are even packets on the internet which include working >combinations of apache + php4 + mysql (mysql= free very popular >web database). Just do a search on a search engine. >There are also instruction pages on how to make php work on >apache (you need to change two or three lines in a >configuration file). > >good luck. >Chris Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] XML newbie
Start your document with Sorry, couldn't resist it :-) http://www.w3.org/XML/ isn't a bad place to find out about it, but if you find them a bit dry or you're in need of a nice tutorial then you'd better get yourself over to http://hotwired.lycos.com/webmonkey/authoring/xml/ and have a look at their stuff. Cheers Jon -Original Message- From: Srinivasan Ranganathan [mailto:[EMAIL PROTECTED]] Sent: 24 October 2001 16:46 To: [EMAIL PROTECTED] Subject: [PHP] XML newbie Hi Its me again (for those who know me ;-)). ive been working with php and mysql for a while and am curious about xml. what do i have to do to get started? thanks in advance Srinivasan Ranganathan Do You Yahoo!? Send a newsletter, share photos & files, conduct polls, organize chat events. Visit http://in.groups.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] ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- 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 NEED HELP WITH PWS AND W98
> poor english. I need informacion about how configure Personal Web Server > under W98 to use with PHP 3.0 I downloaded the BIN code of PHP version > 3.0.17 for W32 and I followed the instructions on the manual “PHP > Manual” (I downloaded it in php.net page, and I configured the PHP.ini > file, etc, etc.), but I don’t know if I need to compile under C or > Visual C, or what I have to do after that to start to use PHP under w98 and > PWS. Some detailed informacion will very important for me. hi Nicolas, pws is not so great. if you are still in the beginning phase you may consider to use the free Apache server. It has a version for windows, very stable. You just need to make some changes to the configuration file to make php work. btw you do not need to compile php if you download the right version! (don't download 'source' but maybe they call it 'binary' or whatever). There are even packets on the internet which include working combinations of apache + php4 + mysql (mysql= free very popular web database). Just do a search on a search engine. There are also instruction pages on how to make php work on apache (you need to change two or three lines in a configuration file). good luck. Chris --- - -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --- - -- 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] XML newbie
Hi Its me again (for those who know me ;-)). ive been working with php and mysql for a while and am curious about xml. what do i have to do to get started? thanks in advance Srinivasan Ranganathan Do You Yahoo!? Send a newsletter, share photos & files, conduct polls, organize chat events. Visit http://in.groups.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] file system question
Hello- I'm trying to write a php script that creates a directory and then copies uploaded files to that directory. That isn't hard but what is hard is the fact that the script tells me that i do not have permission to do any of these actions. I'm running red hat 7.1 and I have heard things about SetUID and sticky bits, however since I'm pretty much still a novice at linux I'm not too sure what to do. The script is running under the username Apache any ideas? thanks.. jay -- 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] Error: 1 is not a valid mysql link resource
Hi all. With php version 4.0.1, I made a database class. I use a function called connect() to open database connection to mysql, and the link resource is stored in $GLOBALS["CONNETION_ID"] global variable. All of code work perfectly, with no any problems.. But when I upgraded to php version 4.0.6, the code wasn't work at all. The error returned is Warning: 1 is not a valid MySQL-Link resource in /usr/local/apache/htdocs/Produtora/manole/config/site/database.class.php on line 190 the line 190, in this case, is just $data = mysql_query($sql, $GLOBALS["CONNECTION_ID"]) it is the same code that works with php 4.0.1,, The link resource is valid ( at least I think that ), because when I do echo $GLOBALS["CONNECTION_ID"]; the return is Resource id #1 does anyone knows the problem??? thanks anyway, Rafael Steil -- 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 protect MySQL password
On Wednesday 24 October 2001 00:30, you wrote: > What we > really need is an expert here to give us the low-down on the best way to > accomplish the best security given regular tools. There isn't a way to solve it within the constraints you've mentioned (shared server at a hosting provider, apache, php-as-a-module) If apache has read access on a file, which it has to have in order to serve it, someone else can get to that file via a PHP/Perl/C/whatever script/program. Yes, you can use a server that has php safe_mode enabled, but that doesn't mean your scripts are safe -- it just means they're safe from being exploited by other php scripts. So, the only way to secure your PHP scripts from prying eyes (in a shared environment) is to upload them with group/world read permissions removed (i.e. chmod 700 or 600) But then Apache can't read that file either. That's where php-cgiwrap comes into play as it acts as an interface between apache and your chmodded 600 file. Basically, if you're on a shared server, you're either going to be buddies with your fellow users and trust them, or you're going to use something like php-cgiwrap which allows you to remove group/world read permissions and still let apache read the file. And, if security is *that* important to you, then you can, of course, use a dedicated server. Then you don't have to worry about other users. --kurt -- 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: Application servers / job priorities ?
"Lee" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am developing a portal that will allow users to perform various > calculations on their data sets. These calculations (handled by C / > Fortran programs) will be run as external processes (and may take up to > a few hours to complete). I am wondering if there is something that I > can use (either in PHP or as another external process) to act as an > application server i.e. allow multiple users to submit requests for > calculations, but place these requests in a queue - perhaps associating > each calculation with a priority, and handling each request as > appropriate. > > Can anyone suggest anything that may faciliate this? Any links/hints > would be greatly appreciated. Thanks very much in advance. I would separate this into front end/back end systems. The front end lets people sign in, submit a data set, request an operation, and set the priority. It should let them view job status and reorder/reprioritize the jobs. All this information gets stored in a database (three tables - one for users, one for data sets, one for jobs). The back end runs independantly - repeatedly queries the database to find the next most urgent job and spawns a program to do the calculation. Play with the number of concurrent threads per processor to find a good balance to keep the system busy but not bottlenecked. This set-up would make it very easy to distribute the calculations across multiple systems to speed things up. -- 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] Opening a new page when done
Assuming you don't output anything else to a web page: header ("Location: index.html"); should do the trick if you put it at the end of the program. Be warned, though, that if you output anything to the browser at all, the header function will not work. Good luck! At 06:39 AM 10/24/2001, Roy W wrote: >I have several scripts that when you complete a form it executes a PHP >script. > >At the end of each script I have a simple statement saying it's done and >then a place to hyperlink back to a given page: > >PRINT "Process complete. Click here to continue"; > >But what I really wanna do is just have the script code execute and when its >all done - just take the user automatically to "index.html" or some other >page. > >I know there's a command but cant seem to find it. Thought it might be >"include()" but couldn't figure out my syntax > >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] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Application servers / job priorities ?
Hi, I am developing a portal that will allow users to perform various calculations on their data sets. These calculations (handled by C / Fortran programs) will be run as external processes (and may take up to a few hours to complete). I am wondering if there is something that I can use (either in PHP or as another external process) to act as an application server i.e. allow multiple users to submit requests for calculations, but place these requests in a queue - perhaps associating each calculation with a priority, and handling each request as appropriate. Can anyone suggest anything that may faciliate this? Any links/hints would be greatly appreciated. Thanks very much in advance. - Best regards, Lee -- 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] Problems with TTF
On Wed, 24 Oct 2001 12:37:16 +0200 "Alberto" wrote: > Warning: Could not find/open font in > /sdr/httpd/Prisa/DATA/private/libs/graficos/intradia.php on line 57 > > Line 57: ImageTTFText ($O_imagen, 11, 0, 10, 20, $O_colorValor, > "arial.ttf",$s_Valor); > > arial.ttf is into the same dir. > > Any ideas? try "./arial.ttf" and see if that helps I don't remember if there's a font path for ttf fonts in php.ini or not- but if there is, its quite possible ./ isn't in it on your system. (If there's not one- there should be...) Last time I did anything with Freetype- I made a /fonts/php directory on my filesystem, and put whatever fonts I wanted in their, and called them full path. -- -=-=-=-=-=-=-=-=-=-=-=-=- Michael A. Peters http://24.5.29.77:10080/ -- 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] Opening a new page when done
just print the following at the point where you decide you want to redirect: a better alternative is to send a redirection header with the response, but this depends on you not sending any HTML output to the browser before processing is complete: hope this helps. james -Original Message- From: Roy W [mailto:[EMAIL PROTECTED]] Sent: 24 October 2001 14:39 To: [EMAIL PROTECTED] Subject: [PHP] Opening a new page when done I have several scripts that when you complete a form it executes a PHP script. At the end of each script I have a simple statement saying it's done and then a place to hyperlink back to a given page: PRINT "Process complete. Click here to continue"; But what I really wanna do is just have the script code execute and when its all done - just take the user automatically to "index.html" or some other page. I know there's a command but cant seem to find it. Thought it might be "include()" but couldn't figure out my syntax 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 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 NEED HELP WITH PWS AND W98
1)Install PHP w/ the installer or manually 2)In PWS add a new virtual directory and give it Script+Execute rights. 3)Create a simple script there (where the virtual directory points) and write just to see if everything is fine. you may want to try to ask in php.install group too. "Nicolas Llamosas" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > My name is Nicolás Llamosas, I`m from Río Cuarto, Argentina and sorry for my > poor english. I need informacion about how configure Personal Web Server > under W98 to use with PHP 3.0 I downloaded the BIN code of PHP version > 3.0.17 for W32 and I followed the instructions on the manual “PHP > Manual” (I downloaded it in php.net page, and I configured the PHP.ini > file, etc, etc.), but I don’t know if I need to compile under C or > Visual C, or what I have to do after that to start to use PHP under w98 and > PWS. Some detailed informacion will very important for me. > > Thanks. > > Nicolas Llamosas – [EMAIL PROTECTED] > > > _ > Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp > -- 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] OnUNload Scripts
This can be done...but what if the user closes the whole browser? the frame won't work cause it will also be closed i guess! The popup window will assure that in all cases it will be poped up. "Kodrik" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > >You could open a new window, give focus to the current window, and in the > > >new window, have it close itself after it's finished processing. > > An invisible frame is the easiest: > mailto:[EMAIL PROTECTED]] > > > > >Sent: Wednesday, October 24, 2001 4:16 PM > > >To: [EMAIL PROTECTED] > > >Subject: [PHP] OnUNload Scripts > > > > > > > > >Hi everyone, > > > > > >I can use javascripts onunload to run PHP file with a new window. > > >Is there anyway i can run PHP script file on ONUNLOAD with out opening a > > > new window ( in the back ground). > > > > > >Any one's help will be greatly appreciated. > > > > > >Best regards, > > >Hasan > > > > > > > > > > > >-- > > >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] libxml
On Wednesday 24 October 2001 11:38, php wrote: > Firstly, > I use php 4.0.5 and libxml 2.3.9 on several machines without any problem. Older php and libxml combinations however caused many segmentation faults, especially with not well-formatted xmls. Are you sure that you warning message is related to libxml library? If you compile php without domxml the warning message disappears? Arpi > thanks to those who replied to me last week about xmldom support > with this error: > > Warning: Unknown list entry type in request shutdown (0) in > Unknown on line 0 > > I've since tried a few combinations of versions of libxml, and > expat (dont know if expat would > matter), any was wondering if anyone who is using dom support > correctly could > tell me which versions work for them. > > > Thank you, > > Sean -- 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] Opening a new page when done
I have several scripts that when you complete a form it executes a PHP script. At the end of each script I have a simple statement saying it's done and then a place to hyperlink back to a given page: PRINT "Process complete. Click here to continue"; But what I really wanna do is just have the script code execute and when its all done - just take the user automatically to "index.html" or some other page. I know there's a command but cant seem to find it. Thought it might be "include()" but couldn't figure out my syntax 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]
Re: [PHP] PHP with XML
On Tuesday 23 October 2001 21:17, Vinicius Tavares wrote: > What I have to do to make the PHP4 run the DOM XML??? Download the libxml library (the development packages too, if you download the packaged distrib). And compile php with it (--with-dom switch for configure). http://www.xmlsoft.org Arpi -- 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] Enabling php in only certain hosts and directories
On Wednesday 24 October 2001 08:19, you wrote: > Well, php runs the same as apache, so whatever apache can access, > php can access. > So any files with the db passwords that need to be accessed by php, > can be seen by all users who can upload php scripts to your server. That's not completely true. You can use open_basedir, safe_mode settings in apache's configuration, based on virtualhosts or even directories. This way you can restrict users, virtual hosts to their own directories. Arpi > > Hello all, > > > > I am just configuring up a new web server, and I want to be able > > to run php only in the web servers main document root and in > > specified virtual hosts, I have a fair understanding on how to go > > about this, but would really like some feedback before I get to > > far into it. Basically the only directories I don't want to be > > able to use php are all the user directories (/~username) unless > > they have been mapped to a virtual host that has the right > > directives in them to enable php. -- 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 HELP WITH PWS AND W98
My name is Nicolás Llamosas, I`m from Río Cuarto, Argentina and sorry for my poor english. I need informacion about how configure Personal Web Server under W98 to use with PHP 3.0 I downloaded the BIN code of PHP version 3.0.17 for W32 and I followed the instructions on the manual “PHP Manual” (I downloaded it in php.net page, and I configured the PHP.ini file, etc, etc.), but I don’t know if I need to compile under C or Visual C, or what I have to do after that to start to use PHP under w98 and PWS. Some detailed informacion will very important for me. Thanks. Nicolas Llamosas – [EMAIL PROTECTED] _ Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp -- 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] Object sharing
Is there an easy way to save an object in this section ? The object will have something like an open file or a database connection... Thanks, Victor -Original Message- From: Andrey Hristov [mailto:[EMAIL PROTECTED]] Sent: quarta-feira, 24 de outubro de 2001 16:43 To: [EMAIL PROTECTED] Subject: Re: [PHP] Object sharing sharedMemory on *nix -- Andrey Hristov Web Developer Icygen Corporation BUILDING SOLUTIONS http://www.icygen.com On Wednesday 24 October 2001 09:35 am, you wrote: > Does anyone know a way to share an object with all sessions ? > The idea is to access the same database connection poll. > > Thanks, > Victor -- 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] Re: Help converting ASP->PHP
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > > > datCurrent, intCurrentMonthDays and intWorkDays are local > > > This didn't totaly help. This line I can't figure out: > > intCurrentMonthDays= Day[DateAdd["d",-1, DateAdd["m",1, datCurrent]]]; > > > > Basically it gets the number of days in the current month, How to do > > in PHP? > > Mr.Baseball, > > have a look at the manual page for the date function > http://www.php.net/manual/en/function.date.php > There is a an option to get the number of days in a month > do a search for 'number of days in the given month' Thanks, that was it...hmmm, it is wonderful when you FULLY read the manual, huh? -- 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] Object sharing
sharedMemory on *nix -- Andrey Hristov Web Developer Icygen Corporation BUILDING SOLUTIONS http://www.icygen.com On Wednesday 24 October 2001 09:35 am, you wrote: > Does anyone know a way to share an object with all sessions ? > The idea is to access the same database connection poll. > > Thanks, > Victor -- 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] Object sharing
Does anyone know a way to share an object with all sessions ? The idea is to access the same database connection poll. Thanks, Victor -- 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]