RE: [PHP] PHP code in a database
This might be what you need. http://www.php.net/manual/en/function.eval.php -Jared -Original Message- From: Jean-Rene Cormier [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 12:11 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP code in a database I'm trying to make a script that'll take some pages from a database but I want it to execute the PHP that's in the pages that it'll fetch from the database. Say it gets the data from the page in $data I want it to put the data on the screen and if there's some PHP code in the $data variable I want it to be executed. Is there a way I can do that? Jean-Rene Cormier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SMS with PHP
I had this exact need but I was solved partially by my cell phone provider. I have verizon and verizon actaully assigns each phone an email address if you have text messenging. So all i had to do was send an email to that address and it would go to my phone in about 30 seconds or so. -Jared -Original Message- From: Alexandra Aguiar [mailto:[EMAIL PROTECTED]] Sent: Monday, June 10, 2002 1:47 PM To: [EMAIL PROTECTED] Subject: [PHP] SMS with PHP Hello ppl... i'd like to know if it's possible that a php script sends message to a cell phone... i please anything about it ... thnx in advance.. Alexandra Aguiar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] storing html in a db
You might consider using output buffering in order to accomplish that goal. http://www.php.net/manual/en/ref.outcontrol.php You could buffer the entire page and store the buffer into the DB at the end of the page load. -Jared -Original Message- From: W. Enserink [mailto:[EMAIL PROTECTED]] Sent: Monday, June 10, 2002 3:35 PM To: [EMAIL PROTECTED] Subject: [PHP] storing html in a db hi all, i was wondering, i'm making a php page. this php page is outputting a very lot of html to a browser. is it also possible to "capture" this html code and store it in a database? so later on i can retrieve a full html page without the "dynamic elements in it" thx Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] forcing file downloads
20% represents a space. -Jared -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 9:01 AM To: php Subject: [PHP] forcing file downloads I know this has been discussed many times, but I've been hunting through the archives with very little resolution on the issue. I've found the following note in the annotated manual: > Additional notes to my workaround on Q266305: > > I have tested my findings with PDF, XLS, DOC and ZIP. However JPG and GIF > didn't make IE pop up the download box. By changing content type from > "octet-stream" to "force-download" (or some undefined > type), it will work. Of course, we need to take care of other browsers > too. Here is the improved code, hope it helps: > > header("Content-type: application/force-download"); > > if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) > header("Content-Disposition: filename=$myfile" . > "%20"); // For IE > else > header("Content-Disposition: attachment; filename=$myfile"); > // For Other browsers > > Note: If you are using session together with this download, you will need > to add the following line BEFORE the code above to make IE work: > > session_cache_limiter(""); 1. Is this a widely accepted practice for forcing downloads (a pop-up window to download a file), given the problems with older versions of IE? 2. Can someone tell me what the %20 is there for? Regards, Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] shell command
Here are the functions you need: http://www.php.net/manual/en/ref.exec.php -Jared -Original Message- From: Roman Duriancik [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 15, 2002 9:30 AM To: PHP-General Subject: [PHP] shell command How to execute dos\winnt command in php script, i need disk map in php excample : -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SQL Server test tool
I would imagine that you could use fsockopen to open a socket connection on that port in order to test it. -Jared -Original Message- From: Scott St. John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 15, 2002 8:53 AM To: [EMAIL PROTECTED] Subject: [PHP] SQL Server test tool Has anyone seen or know if it is possible to use PHP to test if a SQL server is alive on port 1433? I know I could run a query, but was looking for something to actually test on the port. Thanks, -Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with mail() w/Win2k
Hey guys I recently join this list and this is my first real post to it so if I f**k something up please do beat me to death. :) I have a simple mailer script that was mailing POSTed form information to a client, this script was running on a Debian box w/Apache. This server is having hardware issues so I moved the sites to a win2k machine. The same script bombs out when it trys to use the mail() function. The error message I receive is not so enlightening: Warning: Server Error in D:\Inetpub\belcoind.com\mailFunc.php on line 24 I changed the line in the php.ini to read: SMTP = localhost; the server has its own smtp service running on it I also tried: SMTP = mail.mydomain.com; This genereated the same problem. I have been using PHP with Apache forever but I rarely use it on Windows so any insight into this problem would be great. Thanks in advance, -Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Using php as a scripting language within cron jobs?
I personally have never come across the method that is involved in compiling PHP as a binary, but I have come up with a way to run PHP scripts from the Command Line and Cron without the binary. from the cron I would call this command... wget -q -T10 http:/www.mydomain.com/myScript.php -0 /dev/null I have never had a problem with this method, although I am sure it has a higher overhead than compiling as a binary and directly calling php. -Jared -Original Message- From: Henry Grech-Cini [mailto:[EMAIL PROTECTED]] Sent: Friday, May 17, 2002 6:12 AM To: [EMAIL PROTECTED] Subject: [PHP] Using php as a scripting language within cron jobs? Hi All, Is this possible? I really don't want to go back to perl5 to setup an autoresponder system! Henry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Looking for web based email
This is the one my company uses: http://nocc.sourceforge.net/ I found it very easy to modify, and it fully supports attachments as well as the related RFCs. -Jared -Original Message- From: Craig [mailto:[EMAIL PROTECTED]] Sent: Friday, May 17, 2002 4:46 AM To: [EMAIL PROTECTED] Subject: [PHP] Looking for web based email I am in the process of developing a website with a webmail system similar in functions to hotmail Does anyone have any suggestions for where to start? thanks craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Listing the contents of a directory in an array
I actaully had to do that yesterday, here is the code i used. $path = "/foo/bar"; $myArray = $array(); $dir = opendir($path); while($file = readdir($dir)) { // if(!ereg("^\.", $file) { $myArray[count($myArray)] = $file; // } } closedir($dir); If you want to exclude the always present "." and ".." directories just uncomment those two lines. -Jared -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, May 17, 2002 8:31 AM To: [EMAIL PROTECTED] Subject: [PHP] Listing the contents of a directory in an array I am a newbie so be kind I have looked into the manual about directory functions etc. I want to return all the files from a directory into a array. Could some one give me a few pointers or something? I keep getting confused but I have used google and the manual. I can find functions but I am not sure how I can list the files into an array. Thanks in advance, JJ Harrison [EMAIL PROTECTED] www.tececo.com
RE: [PHP] apache redirect and request
getenv("HTTP_HOST"); Then parse the data as you need to to get to the root of the domain. -Jared -Original Message- From: Adrian Murphy [mailto:[EMAIL PROTECTED]] Sent: Friday, May 17, 2002 9:20 AM To: [EMAIL PROTECTED] Subject: [PHP] apache redirect and request Hi, my isp has set up an internal redirect that resolves www.mysite.biz to www.mysite.com how can i check if the request was for the .biz version. thx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Server error when executing mail() function
I was having this same problem a few weeks ago and ended up giving up. After reading the response about the headers i decided to try it. If i call this it works: mail($recipient, $subject); If i call this is gets the server error msg: mail($recipient, $subject, $headers); In that case their are like 10 headers but none of them are ended properly with CRLF. Hope this helps -Jared -Original Message- From: Paul Cuthbertson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 11:49 AM To: Tyler Longren; [EMAIL PROTECTED] Subject: Re: [PHP] Server error when executing mail() function Firstly, thank you for the continued help. Unfortunately I just tried this: ..and the error still occurred. The error appears immediately, as if it's not even trying to connect to anything. Paul. - Original Message - From: "Tyler Longren" <[EMAIL PROTECTED]> To: "Paul Cuthbertson" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: 28 May 2002 16:34 Subject: Re: [PHP] Server error when executing mail() function > Try this thread on phpbuilder.com: > http://www.phpbuilder.com/forum/read.php3?num=4&id=6681&loc=0&thread=6681 > > One person suggests using fewer headers as windows can be picky about which > headers you're trying to send with your e-mail. > > Good luck, > Tyler Longren > Captain Jack Communications > www.captainjack.com > [EMAIL PROTECTED] > > - Original Message - > From: Paul Cuthbertson > To: [EMAIL PROTECTED] ; Tyler Longren > Sent: Tuesday, May 28, 2002 10:27 AM > Subject: Re: [PHP] Server error when executing mail() function > > > I'm afraid all I get is: > > Warning: Server Error in d:\htdocs\scriptname.php on line 19 > > Line 19 being the mail() command. The script works fine on a different > server. Any Ideas? > > Paul. > > > - Original Message - > From: "Tyler Longren" <[EMAIL PROTECTED]> > To: "Paul Cuthbertson" <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > Sent: 28 May 2002 16:14 > Subject: Re: [PHP] Server error when executing mail() function > > > > Is 'Server Error' all you get? > > If there's more, please post the whole error message. ;-) > > > > thanks! > > tyler > > > > - Original Message - > > From: "Paul Cuthbertson" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Tuesday, May 28, 2002 9:06 AM > > Subject: [PHP] Server error when executing mail() function > > > > > > Hi, > > > > I keep getting a 'Server Error' when executing the mail() function. I > > thought the problem was the SMTP server in php.ini, so I've tried several > > alternatives (including my Outlook smtp and free smtp servers). I'm > starting > > to think that it's not that that's causing the problem. Is there anything > > else that can cause the same error? > > > > Info: > > OS: Win98 > > PHP Version: 4.1.2 > > Web Server: Apache/1.3.6 (Win32) > > Browser: MSIE 6.0 > > > > Regards, > > > > Paul Cuthbertson. > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Dates
Something like this.. $start = "2002-10-9"; $end = "2002-11-16"; $arStart = explode("-", $start); $arEnd = explode("-", $end); $startTime = date("U", mktime(0,0,0,$arStart[1], $arStart[2], $arStart[0])); $endTime = date("U", mktime(0,0,0,$arEnd[1], $arEnd[2], $arEnd[0])); $dif = $endTime - $startTime; // in seconds That will do it but you could simplfy it with some more advanced techniques. -Jared -Original Message- From: Jeroen Timmers [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 2:17 PM To: [EMAIL PROTECTED] Subject: [PHP] Dates i have two dates for example 2002-10-9 and 2002-11-16 Is there a function to see how many day's between thore date's is? Jeroen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question regarding :: syntax
According to the CHM manual: "Sometimes it is useful to refer to functions and variables in base classes or to refer to functions in classes that have not yet any instances.: Using parent::foo() works fine but I am having problems getting the variable part of this to work. For Example: class A { var $b A() { $b = "something"; } } class B extends A { B() { echo parent::$b // this is the problem } } Is there not a way to refer directly to the parent properties? Or do i have to setup a get function for every parent var that I want to access. Thanks -Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] CHM Form Of PHP Manual? (Was: [PHP] Question regarding :: syntax)
The CHM version of the help file can be downloaded here: http://www.php.net/download-docs.php -Jared -Original Message- From: Jason Teagle [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 12:16 PM To: php list Subject: [PHP] CHM Form Of PHP Manual? (Was: [PHP] Question regarding :: syntax) - Original Message - From: "Jared Boelens" <[EMAIL PROTECTED]> To: "php list" <[EMAIL PROTECTED]> Sent: Monday, June 03, 2002 5:06 PM Subject: [PHP] Question regarding :: syntax > According to the CHM manual: There's a CHM form of a PHP manual? * bounce, bounce *Where could I get it from? I find self-contained help files s much easier... _ _ o oJason Teagle < [EMAIL PROTECTED] v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question regarding :: syntax
So am i to understand that i will have to do it in this manner? class A { var $b; A() { } function getB() { return $this->B; } function setB($b) { $this->B = $b; } } class B extends A { B($b) { parent::setB($b); } } $B = new B(); echo $B->getB(); This means writing a get and set function for every property that belongs to the parent. I understand this is how it is done in other languages but the manual is misleading in this case. It explicity says "Sometimes it is useful to refer to functions and variables..". This lead me to believe that you could directly access VARIABLES as well as functions. I guess i was wrong. Oh well, it just means more typing for me, which means more hours, which means more $. -Jared -Original Message- From: Tobyn Baugher [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 12:30 PM To: php list Subject: Re: [PHP] Question regarding :: syntax On Mon, 2002-06-03 at 12:06, Jared Boelens wrote: > Is there not a way to refer directly to the parent properties? Or do i have > to setup a get function for every parent var that I want to access. Tis my understanding that you cannot refer to class properties without an instance of the class. If I were wrong it would make my life much easier, but I don't believe I am. Regards, Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question regarding :: syntax
This may be a dumb question but, how can you be sure that the $this-> is referring to the parent classes' property and not the current class. On that note, does it really matter of which one it refers? -Jared -Original Message- From: Tobyn Baugher [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 12:58 PM To: php list Subject: RE: [PHP] Question regarding :: syntax On Mon, 2002-06-03 at 12:45, Jared Boelens wrote: > So am i to understand that i will have to do it in this manner? *SNIP* No no no... B extends A, and you have an instance of B. Just do this: class A { var $b; *snip* } class B { function B($b) { $this->b = $b; } } That will work fine. Regards, Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question regarding :: syntax
That is exactly what I thought, I was just looking for some reassurance. I have been working with C# lately and the syntax for classes is a lot more explicit. I wanted to make sure I wasn't making a mistake on what PHP implcitly does. Thanks -Jared -Original Message- From: Tobyn Baugher [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 1:58 PM To: php list Subject: RE: [PHP] Question regarding :: syntax On Mon, 2002-06-03 at 13:42, Jared Boelens wrote: > This may be a dumb question but, how can you be sure that the $this-> is > referring to the parent classes' property and not the current class. On > that note, does it really matter of which one it refers? B inherits $b from A. $this->b and "parent"->b are the exact same thing. This is why there's no special syntax to access "parent"->b from PHP. Toby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Overriding Class functions and variables
>From reading the manual, it is my understanding that one cannot explicitly override parent class functions and/or properties. I found this article stating, "You can override any function but it is an implicit override...any function that is overridden in a child is never called in the parent, so if you have funct() on both, only child will be called." http://www.phpbuilder.com/forum/archives/2/2000/12/2/115715 In my case i am trying to override a variable. I have a property Username for both the parent and the child. I am wondering if there is a way to differenciate between parent->Username and child->Username. Thanks -Jared -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php