Re: [PHP] XML
> 1. How efficient is to use XML+XSLT solution? Does it > add processing overhead to the system? The efficientcy is relative to many factors, however I can stress this. The style sheets can be cached client side and then only xml data can be sent to the user. This reduces bandwidth and allows the transformation to be done on the client side instead of server side. Also not that xml + xslt transformations can be done server side. I usually do browser checks to determine if the browser is capable of handling xml+xslt transformations: if so then i send the files. Now if the browser is old or has issues (i.e. Internet explorer 5.5) then i can do the transformation server side and send html. Also note that you can set up a caching system at this point. If the transformation is done server side then yes you have that over head. However, if you are only serving up xml files and xslt files (part of the time on xslt) then u are reducing server load. > 2. Do you have some examples which can describe the > separation of layers using the XML+XSLT technology? Here are some sites that can get you started: 1. w3c.org 2. w3schools.com 3. xml.com > 3. Currently i am storing the data in the mysql > database. so first i need to create the xml file on > fly and then i need to integrate this xml file with > the xsl style sheet. Please corret if i am wrong > anywhere yes that is correct...u can set up a system that creates xml files on the fly and then assigns an associated xsl(t) file for it. Basically, we are using php to create xml files to send to clients and xslt to transform that data. Think of it in these terms xml (raw data) and xslt (presentation logic). However, do not forget that xml (xslt, xsd, xpath, etc) are their own technologies so they require knowledge of them. With xml you can start working on creating your own web services that are php driven. That should get u started. -- BigDog -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Anyone for cookies and milk? :-)
Nomadeous <[EMAIL PROTECTED]> wrote: > From the official doc: > http://www.php.net/manual/en/function.setcookie.php > All the arguments except the name argument are optional. You may also > replace an argument with an empty string ("") in order to skip that > argument. Because the expire and secure arguments are integers, they cannot > be skipped with an empty string, use a zero (0) instead. I'm going to get a new eye doctor tomorrow :) Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate() error
no errors have come up yet, still getting the same problem too, I am pulling out my hair :) everything else works nice and smoothly just this whole gd thing... "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Do you get any error at apache start up or in error logs? > > Michelle Bernard wrote: > > > Hi Philip, > > > > Thanks for your response, I tried those steps, still no go, getting that > > same error > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Display HTML/PHP code on a web page
Jason Paschal <[EMAIL PROTECTED]> wrote: > I've googled for it, but nothing came up. How do I display code on a page > without it being executed? This has to do with how your webserver is set up, because it see's that its a php file it runs it thruough php. > i want the page to display HTML code as it would look if you typed it into > an editor (not encoded), and the code I want to display is being spit out > by PHP. Which functions should i look at? i can get it to display with > urlencode, but, of course, it's encoded. htmlentities(); > Thank you, Your welcome. > Jason > > P.S. a bit more info: Uh, oh.. I thought I had it under control :) > I'm pulling a file from my site like this: $file = > file("http:///file.php";); > it works fine, but i want to be able to print out lines that meet a certain > criteria, and that includes any of the html source that comes along with it. > however, the the search script tries to execute the lines instead of > displaying them. hm.. so your trying to fetch the file from a web server but don't want it to execute that file.php? See answer to first questoin. > i don't want to write this to a file and then display as this is for admin > purposes and i want to be able to do quick scans from a browser, and i want > the matches to display underneath the search form, which I can do, but I > make a note of it because the page still has to react as an html page (form > submission). > this make any sense? You lost me here. Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Recomposed per instructions??? jpeg photo file upload problem
Hi All, I have a system that allows a person to upload photos to the server via an admin web form. I have been using the code for about a year with no problem. I designed it specifically for a client of mine that has just started cruising on a sailboat for a few years. They tryed uploading a photo from a public library via the web form and they got the error message that it was not a jpeg file. The relevent PHP code from my system for the checking is: if ($type != "image/jpeg") { $ReturnSaying = "!! The file is not a JPEG picture. Please try again"; include("photo_error.php"); exit; Anyway, this system has been tested and tested again on multiple platforms and conditions, except a public library. Question: Is it possible that the library is using some proxy system that is messing with the file so it comes out bad? Also, I have confirmed that the file is a jpeg file. Any ideas are greatly appreciated, John -- === John T. Beresford, Owner Digital Studio Design Edmond, OK http://www.digitalstudiodesign.com/ 405.760.0794 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fwrite not working in php3
sorry guys the server was full again , doesnt return any error at all funny hey > On Thursday 17 July 2003 09:46, [EMAIL PROTECTED] wrote: >> hi there i have a little problem writing files on a php3 server this >> code worked yesterday but isnt >> >> $handle = >> fopen("/www_tools/apache/htdocs/phptest/temp_real/test.inc",'a'); >> $buffer = "test"; >> echo fwrite($handle,$buffer,4000); >> fclose($handle); >> >> i get a filesize of 0 and nothing writes to it what could it be ? > > What does the error logs say? And try following the examples in the > manual which incorporates the error checking that your code lacks. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > -- > /* > The wages of sin are unreported. > */ > > > -- > 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] Code and Good Design Methods
Actually, MVC works really well with XML technologies, however, there needs alot of work in php's core to fully utilize the benefits of an mvc paradigm. -- BigDog On Wed, 2003-07-16 at 04:12, Joel Rees wrote: > > Hi Joel, > > > > Thanks for nice comments on the XML, XSL. > > > > I want to know more about it. can you please send me > > some article, links and tutorials? > > > > Thanks > > > > Hardik > > The ultimate source for xml related technologies is the World > Wide Web Consortium at > > http://www.w3.org > > Most of the pages there are legalese, and really deep swimming. I think > they do have some introductory materials, however. > > Model/View/Controller materials are most likely to be found in relation > to SmallTalk, Objective C, and Java, since the concepts were originally > worked out in those arenas. MVC and XML don't mix well, but the MVC > concept is good to keep in mind if you want to use XML well. > > Other than that, there is plenty of material on the web. I know weeding > out the bad stuff is not easy, but many of the pages that got me started > have moved, I know not where. > > -- > Joel Rees, programmer, Kansai Systems Group > Altech Corporation (Alpsgiken), Osaka, Japan > http://www.alpsgiken.co.jp > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Anyone for cookies and milk? :-)
>From the official doc: http://www.php.net/manual/en/function.setcookie.php All the arguments except the name argument are optional. You may also replace an argument with an empty string ("") in order to skip that argument. Because the expire and secure arguments are integers, they cannot be skipped with an empty string, use a zero (0) instead. setcookie("name2","1",0,"",".bestwebhosters.com"); or setcookie("name2","1",0,"",".bestwebhosters.com",0); ;-) "Curt Zirzow" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Ryan A <[EMAIL PROTECTED]> wrote: > > Hey, > > Am just getting into PHP cookies and have gotten a problem...(surprise > > surprise) > > > > Am trying to set a basic cookie to see exactly how things work before I > > start using it in my apps, heres the code i am using: > > (SetCookieEx.php) > > > setcookie("name1","1","","",".bestwebhosters.com"); > > setcookie("name2","1","","",".bestwebhosters.com"); > > > > echo "done"; > > ?> > > > > This is the output I am getting: > > ** > > Warning: setcookie() expects parameter 3 to be long, string given in > > /bestweb/public_html/testing/SetCookieEx.php on line 2 > > > > Warning: setcookie() expects parameter 3 to be long, string given in > > /bestweb/public_html/testing/SetCookieEx.php on line 3 > > done > te> > > > bool setcookie ( string name [, string value [, int expire [, string > path [, string domain [, int secure]) > > [...] > > All the arguments except the name argument are optional. You may also > replace an argument with an empty string ("") > > > at first look this appears to be a bug. but I have a fealing its only > cause your error_reporting is set to E_ALL thus a warning is shown > because the third paramater should be a interger so change it to: > > setcookie("name2","1",0,"",".bestwebhosters.com"); > > mabey documentation should be changed. > > > > > This is how I am trying to read the cookies: (ReadCookieEx.php) > > > > > if (isset($_COOKIE ['name1'])){ > > echo $_COOKIE ['name1']; > > }else{echo "wrong1";} > > > > if (isset($_COOKIE ['name2'])){ > > echo $_COOKIE ['name2']; > > }else{echo "wrong2";} > > ?> > > > > This is the output i am getting: > > *** > > wrong1wrong2 > > hmm.. > > few things: > 1. is your setcookie returning true or false? > 2. have you examined (or even see the cookie get set) the actual cookie >to see > 3. good reading for intro to cookies for programmers: > http://wp.netscape.com/newsref/std/cookie_spec.html > > > > > > > > > Anybody have any ideas? > > > > Cheers, > > -Ryan > > > > Curt > -- > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] STRING FORMATTING QUESTION
Dale Hersh <[EMAIL PROTECTED]> wrote: > My question is regarding strings in php. I have this form in which the user > fills in a description. The problem is that if the user uses any > aprostrophe's or any other unusual characters in the form, the string can > not be inserted into my ms sql database. > > Any ideas? http://www.php.net/addslashes and http://www.php.net/manual/en/ref.sybase.php#ini.magic-quotes-sybase > > Thanks, > Dale Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How unsafe is register_globals?
Paul Chvostek <[EMAIL PROTECTED]> wrote: > > I've got this new server running with folks from all over uploading PHP > code. I don't know all the folks, so I've turned on safe_mode, set an > open_basedir to each user's documentroot, and left register_globals at > its default. > > And now I'm getting scads of requests to turn on register_globals from > folks who want to run php-nuke and some other established packages that > rely on it. You could trick em and set error_reporting = E_ALL & ~E_WARNING, and just say they need to get the software fixed :) > > I realize that register_globals isn't itself unsafe ... but do the > potential insecurities put my server at risk, or only customer data? no server risks as far as I know, just security flaws in the applications. > > By turning register_globals on with an otherwise safe open_basedir, > are there things that could be revealed about the server that would > otherwise be hidden? > > My instinct says to leave register_globals OFF, and if folks want to run > software that requires it, they should lobby the software maintainers to > upgrade the software. (But how likely is php-nuke to get fixed?) I would tend to agree with you. Some influence on it depends on wether php is going to remove the ability to turn register_globals on and off through the config. As a developer myself, I'd rather see safer programming techniques used. > Thoughts? > > -- > Paul Chvostek <[EMAIL PROTECTED]> > Operations / Abuse / Whatever > it.canada, hosting and development http://www.it.ca/ Not much but I hope it gave ya my view point on it anyway Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] state (Field Problem)
got it working.. -- Thank you, Louie Miranda ([EMAIL PROTECTED]) - Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 17, 2003 1:49 PM Subject: Re: [PHP] state (Field Problem) > On Thursday 17 July 2003 12:56, Louie Miranda wrote: > > > Given this problem.. > > I have this html form that has a "State" option and it list all the US > > states. And i also have a "State/Province" field if ever he does not live > > in the US. > > > > My problem is how will i recognize both? I Mean, i will pass it over to a > > php program and ofcourse the php will parse the user _POST's and display > > it. > > > > USA / State: Washington DC > > Not USA / State: Whatever > > > > > > -- > > Select State > value=StateProvince>Not USA > > -- > > State or Province (Not USA): > > -- > > > > How will i pass this? Double thing? and make it just one.. > > It's just a matter of deciding which field to use. If the user bothered to > fill in 'StateProvince' then use and display that as the state. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > -- > /* > Tell me, O Octopus, I begs, > Is those things arms, or is they legs? > I marvel at thee, Octopus; > If I were thou, I'd call me us. > -- Ogden Nash > */ > > > -- > 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] reading from dir and displaying thumbs
On Thursday 17 July 2003 02:44, Ryan A wrote: > I want to convert my old java greetings programs into php scripts but am > stuck on one little thing. > I have a bunch of thumbnails in a 3 directories, the problem is the number > of thumbnails in each directory is differient...how do i first make the > script look into the directory, display (maybe 15 per page?) thumbnails > with a link to the main program which will take one parameter depending on > the thumbnail name. > eg: > thumbnail name is 1.jpg so that thumbnail should have a link such as href /somescript.php?name=1> What exactly is your problem? "reading from dir"? manual > Directory functions manual > Filesystem functions "displaying thumbs"? manual > Image functions -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Digital circuits are made from analog parts. -- Don Vonada */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fwrite not working in php3
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi there i have a little problem writing files on a php3 server this code > worked yesterday but isnt > > $handle = fopen("/www_tools/apache/htdocs/phptest/temp_real/test.inc",'a'); Test your $handle to see if you successfully opened the file. if (! $handle) { // check permissions die('croak: can't open the file'); } > $buffer = "test"; > echo fwrite($handle,$buffer,4000); > fclose($handle); > > i get a filesize of 0 and nothing writes to it what could it be ? > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fwrite not working in php3
On Thursday 17 July 2003 09:46, [EMAIL PROTECTED] wrote: > hi there i have a little problem writing files on a php3 server this code > worked yesterday but isnt > > $handle = fopen("/www_tools/apache/htdocs/phptest/temp_real/test.inc",'a'); > $buffer = "test"; > echo fwrite($handle,$buffer,4000); > fclose($handle); > > i get a filesize of 0 and nothing writes to it what could it be ? What does the error logs say? And try following the examples in the manual which incorporates the error checking that your code lacks. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The wages of sin are unreported. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How unsafe is register_globals?
On Thursday 17 July 2003 13:06, Paul Chvostek wrote: > Perhaps that's where I need advice. Currently, a .htaccess file with: > > php_flag register_globals on > > gets the error "php_flag not allowed here". I see from the comments at > http://www.php.net/register_globals that I need AllowOverride Options to > make that function ... but is it possible to have fine-grained enough an > AllowOverride statement that only register_globals can be changed? > > I wouldn't want a user to use his .htaccess file to turn off safe_mode > or open_basedir. Take control of the setting yourself by setting it httpd.conf, inside the container of the virtual host in question. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* FORTUNE'S FUN FACTS TO KNOW AND TELL: #44 Zebras are colored with dark stripes on a light background. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] bcc on php
Louie Miranda <[EMAIL PROTECTED]> wrote: > hello, > > how do you make a bcc on php on a form 2 email settings.. I would suggest: http://phpmailer.sourceforge.net/ Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] bcc on php
Ralph Guzman <[EMAIL PROTECTED]> wrote: > Just include Bcc in the extra headers. Take a look at > > Example 4. Sending complex email > http://www.php.net/manual/en/function.mail.php > um.. don't use that example, it is the incorrect way to send a bcc. for one it wont work and two the people will see the bcc, defeating the purpose of a bcc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] state (Field Problem)
On Thursday 17 July 2003 12:56, Louie Miranda wrote: > Given this problem.. > I have this html form that has a "State" option and it list all the US > states. And i also have a "State/Province" field if ever he does not live > in the US. > > My problem is how will i recognize both? I Mean, i will pass it over to a > php program and ofcourse the php will parse the user _POST's and display > it. > > USA / State: Washington DC > Not USA / State: Whatever > > > -- > Select State value=StateProvince>Not USA > -- > State or Province (Not USA): > -- > > How will i pass this? Double thing? and make it just one.. It's just a matter of deciding which field to use. If the user bothered to fill in 'StateProvince' then use and display that as the state. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Tell me, O Octopus, I begs, Is those things arms, or is they legs? I marvel at thee, Octopus; If I were thou, I'd call me us. -- Ogden Nash */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Display HTML/PHP code on a web page
Don't really understand the problem but htmlspecialchars() will convert: Justin & Co into Justin & Co ... which will solve half your problem... not sure what to do with php code... perhaps the same thing... Or, you may want to look at show_source() and highlight_file() as well... Justin On Thursday, July 17, 2003, at 02:59 PM, Jason Paschal wrote: I've googled for it, but nothing came up. How do I display code on a page without it being executed? i want the page to display HTML code as it would look if you typed it into an editor (not encoded), and the code I want to display is being spit out by PHP. Which functions should i look at? i can get it to display with urlencode, but, of course, it's encoded. Thank you, Jason P.S. a bit more info: I'm pulling a file from my site like this: $file = file("http:///file.php";); it works fine, but i want to be able to print out lines that meet a certain criteria, and that includes any of the html source that comes along with it. however, the the search script tries to execute the lines instead of displaying them. i don't want to write this to a file and then display as this is for admin purposes and i want to be able to do quick scans from a browser, and i want the matches to display underneath the search form, which I can do, but I make a note of it because the page still has to react as an html page (form submission). this make any sense? _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- [This E-mail scanned for viruses] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Anyone for cookies and milk? :-)
Ryan A <[EMAIL PROTECTED]> wrote: > Hey, > Am just getting into PHP cookies and have gotten a problem...(surprise > surprise) > > Am trying to set a basic cookie to see exactly how things work before I > start using it in my apps, heres the code i am using: > (SetCookieEx.php) > setcookie("name1","1","","",".bestwebhosters.com"); > setcookie("name2","1","","",".bestwebhosters.com"); > > echo "done"; > ?> > > This is the output I am getting: > ** > Warning: setcookie() expects parameter 3 to be long, string given in > /bestweb/public_html/testing/SetCookieEx.php on line 2 > > Warning: setcookie() expects parameter 3 to be long, string given in > /bestweb/public_html/testing/SetCookieEx.php on line 3 > done te> bool setcookie ( string name [, string value [, int expire [, string path [, string domain [, int secure]) [...] All the arguments except the name argument are optional. You may also replace an argument with an empty string ("") at first look this appears to be a bug. but I have a fealing its only cause your error_reporting is set to E_ALL thus a warning is shown because the third paramater should be a interger so change it to: setcookie("name2","1",0,"",".bestwebhosters.com"); mabey documentation should be changed. > > This is how I am trying to read the cookies: (ReadCookieEx.php) > > if (isset($_COOKIE ['name1'])){ > echo $_COOKIE ['name1']; > }else{echo "wrong1";} > > if (isset($_COOKIE ['name2'])){ > echo $_COOKIE ['name2']; > }else{echo "wrong2";} > ?> > > This is the output i am getting: > *** > wrong1wrong2 hmm.. few things: 1. is your setcookie returning true or false? 2. have you examined (or even see the cookie get set) the actual cookie to see 3. good reading for intro to cookies for programmers: http://wp.netscape.com/newsref/std/cookie_spec.html > > > > Anybody have any ideas? > > Cheers, > -Ryan > Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Interesting question re HTTP Ranges and PHP
--- Dan Goodes <[EMAIL PROTECTED]> wrote: > What I want is for the PHP script to read ALL the headers for the > request (in particular, RANGE headers), and then return the relevant > portion of the file. Can this be done fairly simply? I think you will find all header in the $_SERVER array. It is definitely possible to do what you're wanting, but I'm not sure exactly how simple you will think it is. Maybe there is some existing code someone has written that does this sort of thing for you, but I'm not aware of any. At most, you would just have to parse the Range header yourself to deduce what byte range to serve. > Also is there a way for PHP to tell apache which response code to > send? Yeah, this should work: header('HTTP/1.1 206 Partial Content'); Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Interesting question re HTTP Ranges and PHP
Hi folks, I currently have an interesting dilemma - any help is appreciated (if possible, CC directly to [EMAIL PROTECTED] as well as the list). What Ive got is a PHP wrapper script that performs authetication, and uses "readfile()" to return the requested file. So a user requests /path/to/file, PHP interveins and performs authentication, then does a realfile on /REAL/path/to/file to return the file. What I want is for the PHP script to read ALL the headers for the request (in particular, RANGE headers), and then return the relevant portion of the file. Can this be done fairly simply? Obviously there has to be additional headers returned to the client by the script when it's returning a RANGE response. Also is there a way for PHP to tell apache which response code to send? i.e. in my testing even tho I send a "resume code" with wget, apache's response is 200 OK, not 206 Partial Content... Any help/advice is appreciated... -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How unsafe is register_globals?
On Wed, Jul 16, 2003 at 11:42:29PM -0500, Jonathan Villa wrote: > > This is only my stubborn opinion... > > I would turn it on for now with a warning that it will be turned off > soon... At least in my case, it's never been on in the past, and the queries are coming from folks who want me to change it from its current OFF state. > From: Chris Shiflett [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 16, 2003 11:22 PM > > So, I would turn it on if I were in your situation, or rather, I would allow > them to override the default settings via a .htaccess file (assuming Apache). Perhaps that's where I need advice. Currently, a .htaccess file with: php_flag register_globals on gets the error "php_flag not allowed here". I see from the comments at http://www.php.net/register_globals that I need AllowOverride Options to make that function ... but is it possible to have fine-grained enough an AllowOverride statement that only register_globals can be changed? I wouldn't want a user to use his .htaccess file to turn off safe_mode or open_basedir. -- Paul Chvostek <[EMAIL PROTECTED]> Operations / Abuse / Whatever it.canada, hosting and development http://www.it.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Display HTML/PHP code on a web page
--- Jason Paschal <[EMAIL PROTECTED]> wrote: > I've googled for it, but nothing came up. How do I display code > on a page without it being executed? Try htmlentities() Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Display HTML/PHP code on a web page
I've googled for it, but nothing came up. How do I display code on a page without it being executed? i want the page to display HTML code as it would look if you typed it into an editor (not encoded), and the code I want to display is being spit out by PHP. Which functions should i look at? i can get it to display with urlencode, but, of course, it's encoded. Thank you, Jason P.S. a bit more info: I'm pulling a file from my site like this: $file = file("http:///file.php";); it works fine, but i want to be able to print out lines that meet a certain criteria, and that includes any of the html source that comes along with it. however, the the search script tries to execute the lines instead of displaying them. i don't want to write this to a file and then display as this is for admin purposes and i want to be able to do quick scans from a browser, and i want the matches to display underneath the search form, which I can do, but I make a note of it because the page still has to react as an html page (form submission). this make any sense? _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] state (Field Problem)
Given this problem.. I have this html form that has a "State" option and it list all the US states. And i also have a "State/Province" field if ever he does not live in the US. My problem is how will i recognize both? I Mean, i will pass it over to a php program and ofcourse the php will parse the user _POST's and display it. USA / State: Washington DC Not USA / State: Whatever -- Select StateNot USA -- State or Province (Not USA): -- How will i pass this? Double thing? and make it just one.. -- Thank you, Louie Miranda ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] STRING FORMATTING QUESTION
My question is regarding strings in php. I have this form in which the user fills in a description. The problem is that if the user uses any aprostrophe's or any other unusual characters in the form, the string can not be inserted into my ms sql database. Any ideas? Thanks, Dale -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How unsafe is register_globals?
This is only my stubborn opinion... I would turn it on for now with a warning that it will be turned off soon... I work for a company which is strictly Microsoft/Domino Technology and until I arrived, many have not heard of PHP and for the few that did, well let's just say that sloppy, unstable, and inconsistent code which they have seen has made is hard for me to get an opportunity to display what PHP can do... Fortunately, I now have the opportunity and discussions are reduced to the basic google searches... php vs. asp/jsp/lotus script. So in summary, try to push for some form of coding standard, it might help PHP in the long run. -Original Message- From: Chris Shiflett [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 16, 2003 11:22 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] How unsafe is register_globals? --- Paul Chvostek <[EMAIL PROTECTED]> wrote: > I've got this new server running with folks from all over > uploading PHP code. I don't know all the folks, so I've > turned on safe_mode, set an open_basedir to each user's > documentroot, and left register_globals at its default. > > And now I'm getting scads of requests to turn on > register_globals from folks who want to run php-nuke and > some other established packages that rely on it. First, your instincts are good, and register_globals is best left off. However, that is the developer in me speaking. >From an administrator's perspective, it really doesn't matter. Turning it on won't allow your users (who are themselves developers) to do anything more malicious than leaving it off would; it doesn't give them more power or privilege. In fact, since register_globals is no magic cure, it won't even necessarily make the applications that they run and/or develop any more secure. They could develop an application just as insecure with register_globals off, and it really only affects their application and their users for the most part anyway. So, I would turn it on if I were in your situation, or rather, I would allow them to override the default settings via a .htaccess file (assuming Apache). Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- 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] How unsafe is register_globals?
--- Paul Chvostek <[EMAIL PROTECTED]> wrote: > I've got this new server running with folks from all over > uploading PHP code. I don't know all the folks, so I've > turned on safe_mode, set an open_basedir to each user's > documentroot, and left register_globals at its default. > > And now I'm getting scads of requests to turn on > register_globals from folks who want to run php-nuke and > some other established packages that rely on it. First, your instincts are good, and register_globals is best left off. However, that is the developer in me speaking. >From an administrator's perspective, it really doesn't matter. Turning it on won't allow your users (who are themselves developers) to do anything more malicious than leaving it off would; it doesn't give them more power or privilege. In fact, since register_globals is no magic cure, it won't even necessarily make the applications that they run and/or develop any more secure. They could develop an application just as insecure with register_globals off, and it really only affects their application and their users for the most part anyway. So, I would turn it on if I were in your situation, or rather, I would allow them to override the default settings via a .htaccess file (assuming Apache). Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing $Vars between 2 php pages
why not build a GET QUERY_STRING, save it in a database along with the session_id, the read it on the second page, parsing the string. Jeff Harris wrote: |Valentin wrote: | |>Hi, is any way to pass a $Var from one to other php pages without using |> and Cookies? |> |>Thanks, |> On Jul 16, 2003, "John Manko" claimed that: |page1.php |$_SESSION['myvars_VARNAME'] = $varname; |the 'myvars_' is just for identification purposes, so avoid over-writing |anthing that you might not want to. | |page2.php |$varname = $_SESSION['myvars_VARNAME']; Session still either use cookies or URI: "There are two methods to propagate a session id: Cookies, URL parameter" Thus sayeth the oracle: http://www.php.net/manual/en/ref.session.php The only way that I can see of passing a variable from page to page without using cookies or URI would be to make sure that only one person can access the entire site at one time and use either a database or a file on the server. Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How unsafe is register_globals?
I've got this new server running with folks from all over uploading PHP code. I don't know all the folks, so I've turned on safe_mode, set an open_basedir to each user's documentroot, and left register_globals at its default. And now I'm getting scads of requests to turn on register_globals from folks who want to run php-nuke and some other established packages that rely on it. I realize that register_globals isn't itself unsafe ... but do the potential insecurities put my server at risk, or only customer data? By turning register_globals on with an otherwise safe open_basedir, are there things that could be revealed about the server that would otherwise be hidden? My instinct says to leave register_globals OFF, and if folks want to run software that requires it, they should lobby the software maintainers to upgrade the software. (But how likely is php-nuke to get fixed?) Thoughts? -- Paul Chvostek <[EMAIL PROTECTED]> Operations / Abuse / Whatever it.canada, hosting and development http://www.it.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pdf information..
hmtldoc rulez , i have tried fpdf and is tedious u have to draw the tables >> What's the problem with paying for something if > > nothing.. nothings wrong, but if the free GNU software can do it also, > i switch to free software. > > Like php is :) At first not that mature but look at it now.. > > people have different opinions, and i respect yours. > > > > -- > Thank you, > Louie Miranda ([EMAIL PROTECTED]) > > > - Original Message - > From: "Justin French" <[EMAIL PROTECTED]> > To: "Louie Miranda" <[EMAIL PROTECTED]> > Cc: "php" <[EMAIL PROTECTED]> > Sent: Thursday, July 17, 2003 9:48 AM > Subject: Re: [PHP] pdf information.. > > >> >> On Thursday, July 17, 2003, at 11:38 AM, Louie Miranda wrote: >> >> > i never tried FPDF but just downloaded it. i'll try in a while.. >> > have you tried making a business card using this? >> > >> > i've testing the pdflib it works great, but the sad thing is i have >> > to pay >> > for it. >> >> What's the problem with paying for something if >> >> a) it does the job >> >> b) saves you hundreds of hours in development >> >> c) provides your business with an income stream (you aren't giving >> away these business cards, are you?) >> >> I agree it isn't cheap, but don't rule it out based on price alone. >> Consider the ROI (return on investment). >> >> And no, I don't work for PDFLib -- I've never even used it! >> >> >> Justin >> > > > -- > 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] jpeg photo file upload problem
Hi All, I have a system that allows a person to upload photos to the server via an admin web form. I have been using the code for about a year with no problem. I designed it specifically for a client of mine that has just started cruising on a sailboat for a few years. They tryed uploading a photo from a public library via the web form and they got the error message that it was not a jpeg file. The relevent PHP code from my system for the checking is: if ($type != "image/jpeg") { $ReturnSaying = "!! The file is not a JPEG picture. Please try again"; include("photo_error.php"); exit; Anyway, this system has been tested and tested again on multiple platforms and conditions, except a public library. Question: Is it possible that the library is using some proxy system that is messing with the file so it comes out bad? Also, I have confirmed that the file is a jpeg file. Any ideas are greatly appreciated, John -- === John T. Beresford, Owner Digital Studio Design Edmond, OK http://www.digitalstudiodesign.com/ 405.760.0794 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pdf information..
> What's the problem with paying for something if nothing.. nothings wrong, but if the free GNU software can do it also, i switch to free software. Like php is :) At first not that mature but look at it now.. people have different opinions, and i respect yours. -- Thank you, Louie Miranda ([EMAIL PROTECTED]) - Original Message - From: "Justin French" <[EMAIL PROTECTED]> To: "Louie Miranda" <[EMAIL PROTECTED]> Cc: "php" <[EMAIL PROTECTED]> Sent: Thursday, July 17, 2003 9:48 AM Subject: Re: [PHP] pdf information.. > > On Thursday, July 17, 2003, at 11:38 AM, Louie Miranda wrote: > > > i never tried FPDF but just downloaded it. i'll try in a while.. > > have you tried making a business card using this? > > > > i've testing the pdflib it works great, but the sad thing is i have to > > pay > > for it. > > What's the problem with paying for something if > > a) it does the job > > b) saves you hundreds of hours in development > > c) provides your business with an income stream (you aren't giving away > these business cards, are you?) > > I agree it isn't cheap, but don't rule it out based on price alone. > Consider the ROI (return on investment). > > And no, I don't work for PDFLib -- I've never even used it! > > > Justin > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pdf information..
I have used pdflib EXTENSIVELY for over a year. I develop products for a company who sells web based tools that allow medium/large corporations to automate the creation of advertising materials. These tools are used by the companies dealers and franchieses. We chose pdflib because of a few unique capabilities it had when working with fonts and other strict standards in the printing world. FPDF,CLIBPDF(I think) and a few others were not as advanced at the time either. My other concern was that I wanted to go with a stable company. I plan on revisiting these as they showed fairly good promise last year, but I haven't investigated them much since. Depending on your project requirements, it is possible to find a web host that has pdflib capabilities. Stephen On Wednesday 16 July 2003 20:48, Justin French wrote: > On Thursday, July 17, 2003, at 11:38 AM, Louie Miranda wrote: > > i never tried FPDF but just downloaded it. i'll try in a while.. > > have you tried making a business card using this? > > > > i've testing the pdflib it works great, but the sad thing is i have to > > pay > > for it. > > What's the problem with paying for something if > > a) it does the job > > b) saves you hundreds of hours in development > > c) provides your business with an income stream (you aren't giving away > these business cards, are you?) > > I agree it isn't cheap, but don't rule it out based on price alone. > Consider the ROI (return on investment). > > And no, I don't work for PDFLib -- I've never even used it! > > > Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pdf information..
On Thursday, July 17, 2003, at 11:38 AM, Louie Miranda wrote: i never tried FPDF but just downloaded it. i'll try in a while.. have you tried making a business card using this? i've testing the pdflib it works great, but the sad thing is i have to pay for it. What's the problem with paying for something if a) it does the job b) saves you hundreds of hours in development c) provides your business with an income stream (you aren't giving away these business cards, are you?) I agree it isn't cheap, but don't rule it out based on price alone. Consider the ROI (return on investment). And no, I don't work for PDFLib -- I've never even used it! Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fwrite not working in php3
hi there i have a little problem writing files on a php3 server this code worked yesterday but isnt $handle = fopen("/www_tools/apache/htdocs/phptest/temp_real/test.inc",'a'); $buffer = "test"; echo fwrite($handle,$buffer,4000); fclose($handle); i get a filesize of 0 and nothing writes to it what could it be ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML
Hi there, I read this interesting thread and come up with some questions. 1. How efficient is to use XML+XSLT solution? Does it add processing overhead to the system? 2. Do you have some examples which can describe the separation of layers using the XML+XSLT technology? 3. Currently i am storing the data in the mysql database. so first i need to create the xml file on fly and then i need to integrate this xml file with the xsl style sheet. Please corret if i am wrong anywhere So far i have above questions in my mind. If i come up with other questions then i will let you know. Thanks Hardik --- Ray Hunter <[EMAIL PROTECTED]> wrote: > XML is a way to store data in a structure format > that is correct and is > platform independent; meaning u can share data with > anything that > understands xml format. > > For web applications xml allows you to send data to > the client and have > the browser do the parsing for you. (I would suggest > ie5.5 and ns6.0 > browsers if you are doing client-side parsing). If > you are doing > server-side php parsing then i would suggest using > domxml+domxslt or > using xslt (sablotron). Then you can parse the xml > doc, get xhtml(html) > and send that to the user. > > The benefits are seperation of logic and > presentation in your php. All > presentation code should be in your xslt style > sheets and all logic > should create a data document (xml). This allow you > to change the > presentation with out changing logic. > > -- > BigDog > > On Tue, 2003-07-08 at 04:26, Petre Agenbag wrote: > > Hi List > > > > Firstly, this question is arguable more about XML > than PHP, but they are > > interlinked, so I hope it is "topical" for this > list. > > > > Firstly, Where I come from: > > > > I am VERY comfortable with PHP/MySQL on Linux and > understand all those > > concepts. > > > > Now I'm trying to see the benefits of XML, and > quite frankly, I just > > cannot see why one would want to use it... > > > > Anyway, I don't want to start a discussion on that > from. > > > > I have done extensive reading on XML/XSL(XSLT : > XHTML), DTD and XML > > parsing on browser and server side. > > > > I arguable still don't have a 100% understanding > of exactly how things > > fit together, but the little bit I think I got so > far is: > > > > I would use an XML doc to package my data in a > structure. > > This XML file is "useless" on it's own, and good > for transporting data > > to another app or client. > > Should I need to do something with the data, I > would look at XSL and in > > particular XSLT in order to convert the XML into > XHTML so a browser can > > display the data ( so we can safely assume that I > am only interested in > > the web applications of XML) > > > > This is where I'm starting to get a headache, > because now it seems that > > there are browser issues wrt XSL, and one also > have the added choice of > > parsing the XML with the browser or on server > level. > > > > For me, parsing it on browser level must be a > no-no, as I would assume > > that it's would take alot of effort to find out > what type of browser the > > client has, then load the appropriate XSL file for > that browser. > > > > So, I'm here, with the server side XML parsing in > mind. > > > > Now on M$ systems, it seems that IIS has built in > ActiveX XMLDOM parsing > > built in, and you can "easily" parse the XML > document by using ASP etc. > > > > So can I assume that this is also true with > PHP/Apache, ie, Apache has a > > built in XML parser and I can use PHP fnuctions to > parse my XML file on > > the server side and thus "pump" out XHTML that is > compatible with all > > past and future browsers? > > > > Also, what is the procedure that most of you > (members of the PHP lists) > > follow when dealing with XML. ie, do you go for > the client side parsing > > or do you do server side parsing. And how do you > decide when to use XML > > and when to stick to trusty old PHP/MySQL? ( > Sorry, know this is > > probably the dumbest question I can ask, but I > really battle to see when > > to use it, or rather WHY I should use it seeing > that the data is > > arguably "static" in nature ( I would either get > the XML file from > > somewhere else, or I would generate it from some > source and pass it on, > > effectively creating a little data island/snapshot > of the actual data at > > a point in time?) > > > > Thanks for any input. > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: socket programming
> http://nanoweb.si.kz/ > thanks for this link, it will helps me alot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pdf information..
i never tried FPDF but just downloaded it. i'll try in a while.. have you tried making a business card using this? i've testing the pdflib it works great, but the sad thing is i have to pay for it. -- Thank you, Louie Miranda ([EMAIL PROTECTED]) - Original Message - From: "Enda Nagle" <[EMAIL PROTECTED]> To: "'Louie Miranda'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, July 16, 2003 6:20 PM Subject: RE: [PHP] pdf information.. > I used FPDF (http://www.fpdf.org) to do a system for a customer where he > could generate invoices and shipping labels. > > I just used A4 page size but I remember seeing in the documentation that > you can specify sizes of pages etc. > > Also the PDFs work on mm, not pixels. > > I know you can embed 300dpi images into the PDF, any time I printed them > they turned out ok. > > Best of all, its free and you don't need to use PDF Lib. > > Enda > -- > > > > > -Original Message- > From: Louie Miranda [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 16, 2003 8:30 AM > To: [EMAIL PROTECTED] > Subject: [PHP] pdf information.. > > > Hello, > > I have been given a task to generate a business card program over the > web. The option that i can think of it to make it easier is generate a > pdf based on the user's experience over my preview program on the web. > > Now im wondering does pdf have those image resolution size? I mean on > image you can specify 100x100 pixels and make the resolution into > 300dpi. How about pdf? > > -- > Thank you, > Louie Miranda ([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 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need Help: Please click on Test Link
Hello, This is a reply to an e-mail that you wrote on Thu, 17 Jul 2003 at 02:02, lines prefixed by '>' were originally written by you. > I need your help. > Can you please visit a site > http://sspsoft.com/test/ip2ll.php (in case if you cannot get it, > please > click on http://ns1.webhostdns.us and then click on the website link.) > which should identify your Country, State, City. Please click on one > of the > buttons to provide feedback. > I am trying to get hits from different parts of the world to make sure > that > it works. > Planning to develop a webservice from this. Did not work for me, it was just blank. I use the free IP to country database at http://ip-to-country.com whenever I need country stats and I have never had a problem with it (obviously never rely on results from a database like this to make your site work correctly though and let the user override the country settings if it effects how they can use your site). David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: pdf information..
Sven, thanks for the info! "sven" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > a pdf-page can have almost every format you want. > > originally you work with postscript-dots, where 72 dots are 1 inch. > it's easy from that point to calculate from metric system, where 1 > inch is 2.54 cm or 25.4 mm. > > with this in mind you can exactly define the height and width of your > pdf-page. i suggest you use one of the ready-made pdf-php-classes. > > ciao SVEN > > "Louie Miranda" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > news:[EMAIL PROTECTED] > > Hello, > > > > I have been given a task to generate a business card program over > > the web. The option that i can think of it to make it easier is > > generate a pdf > based > > on the user's experience over my preview program on the web. > > > > Now im wondering does pdf have those image resolution size? I mean > > on > image > > you can specify 100x100 pixels and make the resolution into 300dpi. > > How about pdf? > > > > -- > > Thank you, > > Louie Miranda ([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
[PHP] Need Help: Please click on Test Link
Hi I need your help. Can you please visit a site http://sspsoft.com/test/ip2ll.php (in case if you cannot get it, please click on http://ns1.webhostdns.us and then click on the website link.) which should identify your Country, State, City. Please click on one of the buttons to provide feedback. I am trying to get hits from different parts of the world to make sure that it works. Planning to develop a webservice from this. Thanks in advance, Suhas _ Encrypt your PHP code for FREE at http://encphp.sspsoft.com _ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] bcc on php
Just include Bcc in the extra headers. Take a look at Example 4. Sending complex email http://www.php.net/manual/en/function.mail.php -Original Message- From: Louie Miranda [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 16, 2003 5:47 PM To: [EMAIL PROTECTED] Subject: [PHP] bcc on php hello, how do you make a bcc on php on a form 2 email settings.. -- Thank you, Louie Miranda ([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
[PHP] bcc on php
hello, how do you make a bcc on php on a form 2 email settings.. -- Thank you, Louie Miranda ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: MySQL query problems
Not sure what the problem was, but I dug up a similar script I used for something else and modifed it for this project, and voila. I then put the two side by side and I still can't see where the problem is. Thanks for the input. -Original Message- From: Nomadeous [mailto:[EMAIL PROTECTED] Sent: July 16, 2003 5:31 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: MySQL query problems But what's your prob ? When you say the second one seems to never be executed ... Does the line: $row = mysql_fetch_array($result2); launches a Php Error ? And pay attention, because you're using mysql_fetch_array and mysql_fetch_row, be sure that you are not treating the result in the same way ;-) "Beauford.2005" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Hi, > > Not sure if the problem here is PHP or MySQL, but here we go. I am > trying to do two queries on a database - one after the other, but the > second one never seems to get executed. The two queries are identical > except for two variables. I have checked my form and they are correct > and are being sent to the PHP script the way they should be. > > The variables are $playerto, $playerfrom, $nameto, $namefrom. The 'TO' > query is the one that doesn't work. > > Here is my code. Any help is appreciated. > > if ($namefrom != $nameto) { > if ($playerfrom != $playerto) { > > include("2004server.inc"); > if($error) { > include("trades-input.php"); > exit; > } > > $query1 = "select manager.idn, manager.total, > roster.idp, position, points from roster join reference > join manager where manager.idn=reference.idn and > reference.idp=roster.idp and manager.idn like '$namefrom' and > roster.idp like '$playerfrom'"; > > $result1 = mysql_query($query1) or $mysqlerror = mysql_error(); > if ($mysqlerror) { > $error = "$d_base_error$email_error"; > include("trades-input.php"); > exit; > } > > $line = mysql_fetch_row($result1); > > mysql_free_result($result1); > > $query2 = "select manager.idn, manager.total, > roster.idp, position, points from roster join reference > join manager where manager.idn=reference.idn and > reference.idp=roster.idp and manager.idn like '$nameto' and roster.idp > like '$playerto'"; > > $result2 = mysql_query($query2) or $mysqlerror = mysql_error(); > if ($mysqlerror) { > $error = "$d_base_error$email_error"; > include("trades-inputs.php"); > exit; > } > > $row = mysql_fetch_array($result2); > > mysql_free_result($result2); > } > } > -- 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] PROBLEMS WITH STRINGS & SQL DATABASE
Hello, This is a reply to an e-mail that you wrote on Thu, 17 Jul 2003 at 01:13, lines prefixed by '>' were originally written by you. > This my problem: > I have this insert statement in my code that works fine for all > strings > except strings that include the following characters: > ' " Have yo escaped the data correctly for the database server that you are using? For example, if you are using mysql, do this to any sata you intend to use as data within fields in the query: $data = mysql_escape_string($data); or generally, this should also work: $data = addslashes($data); David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PROBLEMS WITH STRINGS & SQL DATABASE
This my problem: I have this insert statement in my code that works fine for all strings except strings that include the following characters: ' " Any ideas? Thanks, Dale -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Verifying a certain amount of numbers
On Thursday, July 17, 2003, at 12:17 AM, Curt Zirzow wrote: Excellent point! I find my self using regex's a bit to often when there are other solutions available. btw, have you ever tested the difference between if(ereg('^[0-9]{6}$',$str)) if(preg_grep('^[0-9]{6}$',$str)) I've been meaning to find out advantages/disadvantages with PERL vs. POSIX compatible. Hi, I haven't, but feel free to do your own :) Use the sample found on http://au.php.net/microtime Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Object can not be used after a session
Hi Mike Yes your right about when the session data is updated. The problem then lies in when I try to read the object from the session var. I include at the top of the file the class definition. Not to get sidetracked but when you say you wrote another layer, are you talking about utilizing the __sleep() and __wakeup functions and then serializing/unserializing within those functions? so far manually serialize-ing and unserialize-ing prior to assigning the object and after retrieving the object seems to work. Matt Mike Migurski wrote: Wow thats strange?? I am using PHP 4.3.2 as well and I don't see that happening where it serializes the object when assigning it to the $_SESSION. It doesn't do it when you assign it into the $_SESSION array, it does it when the script completes and updated session data is written to the session file. This actually caused me a lot of grief a while back, when scripts were bombing out and session data was being lost - I ended up writing another layer on top of the session that explicitly wrote crucial data at critical junctures, rather than relying on the built-in support. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html
RE: [PHP] Re: correct session format?
--On Monday, June 23, 2003 08:30:19 AM -0600 "Johnson, Kirk" <[EMAIL PROTECTED]> wrote: So what is the diffirent between : session_start (); $_SESSION['eventid'] = 'arma2'; and session_start (); session_register('arama2'); Use the first method to create session variables when register_globals is "off" in the php.ini file. Use the second method when it is "On". http://www.php.net/session Kirk First, there is a bit of a coding error here. The two examples should be: session_start (); $_SESSION['eventid'] = 'arma2'; and session_start (); session_register('eventid'); Second, the documentation indicates that if you turn off register globals you must us the super global $_SESSION[]. But, it later says that $_SESSION[] and session_register() set the same values. (It does talk about a problem with this in 4.2.3 that is fixed in 4.3) My question is what is the effect of mixing these two techniques. For example with register globals off should: session_start (); session_register('eventid'); $_SESSION['eventid'] = 'foo'; Does the session_register() hurt? What is the interaction? The larger question for us a PRIDE is we have quite a bit of code that assumes register globals is on and we are doing new development where we would like to the the super global $_SESSION[] support instead of the older techniques. What are the consequences of mixing the two techniques? Thanks in advance, Bill +--- | Bill MacAllister | Senior Programmer, Pride Industries | 10030 Foothills Blvd., Roseville CA 95747 | Phone: +1 916.788.2402Fax: +1 916.788-2540 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Opening a Window with JavaScript
I also know with the javascript open window, you can force the print window to popup, what do you have to add to this link below?? Thanks -Original Message- From: Aaron Gould [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 3:48 AM To: Curt Zirzow; [EMAIL PROTECTED] Subject: Re: [PHP] Opening a Window with JavaScript Try this (note the "return false;" addition at the end): -- Aaron Gould Web Developer Parts Canada - Original Message - From: "Curt Zirzow" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 16, 2003 2:15 PM Subject: Re: [PHP] Opening a Window with JavaScript > Todd Cary <[EMAIL PROTECTED]> wrote: > > [...] > > However, if I use an anchor, the form is submitted. Is there a way to > > prevent this? Here is the code I tried: > > > > > > I believe you can put something like (not tested): > > > > > > Todd > > -- > > Curt > -- > > > -- > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing $Vars between 2 php pages
|Valentin wrote: | |>Hi, is any way to pass a $Var from one to other php pages without using |> and Cookies? |> |>Thanks, |> On Jul 16, 2003, "John Manko" claimed that: |page1.php |$_SESSION['myvars_VARNAME'] = $varname; |the 'myvars_' is just for identification purposes, so avoid over-writing |anthing that you might not want to. | |page2.php |$varname = $_SESSION['myvars_VARNAME']; Session still either use cookies or URI: "There are two methods to propagate a session id: Cookies, URL parameter" Thus sayeth the oracle: http://www.php.net/manual/en/ref.session.php The only way that I can see of passing a variable from page to page without using cookies or URI would be to make sure that only one person can access the entire site at one time and use either a database or a file on the server. Jeff -- Registered Linux user #304026. "lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import" Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this message should conform to RFC 1855. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: include statement giving me hives! - help
yes, I should have mentioned: $point is defined in the URL string http://something.com/index.html?point=12 "Baroiller Pierre-Emmanuel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > when you call your script, is $point defined somewhere ? > if $point is empty, you'll get an empty string for $links_include and > include $links_include will not work. > > Regards, > P.E. Baroiller > "Dougd" <[EMAIL PROTECTED]> a écrit dans le message de > news:[EMAIL PROTECTED] > > I am new to all this, but here is the basic code: > > > > $link_titles = file('links/master.txt'); > > $links_include = $link_titles[$point]; // path to directory > > include $links_include; > > > > If I echo the value of $links_include just prior to the include() function > > it contains what I would expect it to contain and the file does exist. But > I > > get an error: > > > > Warning: main(./main/links/topsites.php ) [function.main]: failed to > create > > stream: No such file or directory in . on line 23 > > > > Warning: main() [function.main]: Failed opening './main/links/topsites.php > ' > > for inclusion (include_path='.:/usr/local/lib/php') in on line 23 > > > > If I add the line: > > > > $links_include = "path to intended include file"; > > > > just prior to the include statement it works fine. > > > > Am I missing something? I've tried a variety of renditions of the > include() > > statement and can't get it to react unless I 'hard code' the value of > > $links_include. > > > > Appreciate your help!! > > > > -Doug > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to store a file into MSSQL?
[EMAIL PROTECTED] (John Manko) wrote in news:[EMAIL PROTECTED]: Does it apply also to MSSQL = Microsoft SQL Server? > Look here > http://www.mysql.com/doc/en/BLOB.html > > Actually, if you don't care if the images can be view from outside the > DB, you can do what I do. > I simplely put the name of the file in a varchar field, then let the > browser do the work for you. > This is good for files that are referenced from multiple entries (ie, > individual products each referencing the same series image) > but, blob can work fine. > -- *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: really no way to get byte size of variable?
Hi, did you try count($value) and strlen($value) ? count($value) will give size of an array, and strlen($value) size of a string ... Regards, P.E. Baroiller "Petre Agenbag" <[EMAIL PROTECTED]> a écrit dans le message de news:[EMAIL PROTECTED] > Hi List > Just want to make sure: > > Is there no way for me to easily determine the byte size occupied by a > variable (regardless of type)? > > It might be trivial, or I'm missing the point (as per usual)... > > I would like to find the actual byte size that is transmitted when say a > $_POST variable is sent, or how much memory a particular variable is taking > up. > > Just want to make sure. Some of the post received so far suggest that "one > character = one byte" etc, but I would love to work with something more > precise if possible, also, is a variable contains a multi-dimensional array, > would that "one character = one byte" formula still return a fair > representation? > > Thanks. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: include statement giving me hives! - help
Hi, when you call your script, is $point defined somewhere ? if $point is empty, you'll get an empty string for $links_include and include $links_include will not work. Regards, P.E. Baroiller "Dougd" <[EMAIL PROTECTED]> a écrit dans le message de news:[EMAIL PROTECTED] > I am new to all this, but here is the basic code: > > $link_titles = file('links/master.txt'); > $links_include = $link_titles[$point]; // path to directory > include $links_include; > > If I echo the value of $links_include just prior to the include() function > it contains what I would expect it to contain and the file does exist. But I > get an error: > > Warning: main(./main/links/topsites.php ) [function.main]: failed to create > stream: No such file or directory in . on line 23 > > Warning: main() [function.main]: Failed opening './main/links/topsites.php ' > for inclusion (include_path='.:/usr/local/lib/php') in on line 23 > > If I add the line: > > $links_include = "path to intended include file"; > > just prior to the include statement it works fine. > > Am I missing something? I've tried a variety of renditions of the include() > statement and can't get it to react unless I 'hard code' the value of > $links_include. > > Appreciate your help!! > > -Doug > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP & MS Exchange Server problem
Hi... are your sure your Exchanger server has imap enabled and port 143 is open ? If you've got the message "connection refused", it can be : - not imap server is running - your login/password couple is wrong or - you can't connect to the port 143... regards, P.E. Baroiller "Charles Vos" <[EMAIL PROTECTED]> a écrit dans le message de news:[EMAIL PROTECTED] Hello All--- I'm having some trouble getting PHP to communicate with my Windows 2000 MS Exchange Server... I'm running PHP 4.3.2 on a Win2000 machine serving with Apache 1.3. The code I'm using is: $mbox = imap_open("{x.x.x.x:143}","admin","adminpass", OP_HALFOPEN); $err = imap_errors(); while (list($key, $val) = each($err)) print imap_utf7_decode($val)."\n"; $alrt = imap_alerts(); while (list($key, $val) = each($alrt)) print imap_utf7_decode($val)."\n"; This yields the error: Warning: imap_open(): Couldn't open stream {x.x.x.x:143} in c:\apache\apache\htdocs\sdimail.php on line 11 Connection refused If I change the imap_open command to use {x.x.x.x:143\} as the host, I get a different error: Warning: imap_open(): Couldn't open stream {x.x.x.x:143\} in c:\apache\apache\htdocs\sdimail.php on line 11 Can't open mailbox {192.168.0.3:143\}: invalid remote specification which makes me suspect that I am actually able to connect but PHP isn't finding anything it likes (what is it looking for?) can anyone help me with this or at least point me towards a tutorial on using PHP with MS Exchange? Thanks in advance for your help, -Charlie [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using Extensions
Of course on the official page ;-) http://www.php.net/manual/en/funcref.php Each extension defines functions which can easily be recognised by their prefix: example: xslt_create => xslt extension bzwrite => bzip2 extension "Brenton Dobell" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Hello all, > > recently i started haveing a closer look at the heart of the php engine and > found a whole heap of unused extensions :S, where can i look to learn more > about these and how to use them??/ > > Thanks in advance > > Brenton > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Object can not be used after a session
>Wow thats strange?? I am using PHP 4.3.2 as well and I don't see that >happening where it serializes the object when assigning it to the >$_SESSION. It doesn't do it when you assign it into the $_SESSION array, it does it when the script completes and updated session data is written to the session file. This actually caused me a lot of grief a while back, when scripts were bombing out and session data was being lost - I ended up writing another layer on top of the session that explicitly wrote crucial data at critical junctures, rather than relying on the built-in support. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Anyone for cookies and milk? :-)
--- Ryan A <[EMAIL PROTECTED]> wrote: > Am just getting into PHP cookies and have gotten a problem...(surprise > surprise) > > Am trying to set a basic cookie to see exactly how things work before I > start using it in my apps, heres the code i am using: > (SetCookieEx.php) > setcookie("name1","1","","",".bestwebhosters.com"); > setcookie("name2","1","","",".bestwebhosters.com"); I can never remember the attribute order for setcookie without looking it up, and I prefer to just use header() to set my own Set-Cookie header. A simple example for just testing things would go something like this: header('Set-Cookie: foo=bar'); Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Anyone for cookies and milk? :-)
"Ryan A" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Hey, > Am just getting into PHP cookies and have gotten a problem...(surprise > surprise) > > Am trying to set a basic cookie to see exactly how things work before I > start using it in my apps, heres the code i am using: > (SetCookieEx.php) > setcookie("name1","1","","",".bestwebhosters.com"); > setcookie("name2","1","","",".bestwebhosters.com"); > > echo "done"; > ?> > > This is the output I am getting: > ** > Warning: setcookie() expects parameter 3 to be long, string given in > /bestweb/public_html/testing/SetCookieEx.php on line 2 > > Warning: setcookie() expects parameter 3 to be long, string given in > /bestweb/public_html/testing/SetCookieEx.php on line 3 > done Those errors appear because you out "" in the third parameter of the setcookie function. The parser expects a long (or an integer if you prefer ;-) ) This parameter is used to affect the life of the cookie, put 215000, for a one hour cookie. Thanks for the milk :-) > > This is how I am trying to read the cookies: (ReadCookieEx.php) > > if (isset($_COOKIE ['name1'])){ > echo $_COOKIE ['name1']; > }else{echo "wrong1";} > > if (isset($_COOKIE ['name2'])){ > echo $_COOKIE ['name2']; > }else{echo "wrong2";} > ?> > > This is the output i am getting: > *** > wrong1wrong2 > > > > Anybody have any ideas? > > Cheers, > -Ryan > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL query problems
But what's your prob ? When you say the second one seems to never be executed ... Does the line: $row = mysql_fetch_array($result2); launches a Php Error ? And pay attention, because you're using mysql_fetch_array and mysql_fetch_row, be sure that you are not treating the result in the same way ;-) "Beauford.2005" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Hi, > > Not sure if the problem here is PHP or MySQL, but here we go. I am > trying to do two queries on a database - one after the other, but the > second one never seems to get executed. The two queries are identical > except for two variables. I have checked my form and they are correct > and are being sent to the PHP script the way they should be. > > The variables are $playerto, $playerfrom, $nameto, $namefrom. The 'TO' > query is the one that doesn't work. > > Here is my code. Any help is appreciated. > > if ($namefrom != $nameto) { > if ($playerfrom != $playerto) { > > include("2004server.inc"); > if($error) { > include("trades-input.php"); > exit; > } > > $query1 = "select manager.idn, manager.total, > roster.idp, position, points from roster join reference > join manager where manager.idn=reference.idn and > reference.idp=roster.idp and manager.idn like '$namefrom' and > roster.idp like '$playerfrom'"; > > $result1 = mysql_query($query1) or $mysqlerror = > mysql_error(); > if ($mysqlerror) { > $error = "$d_base_error$email_error"; > include("trades-input.php"); > exit; > } > > $line = mysql_fetch_row($result1); > > mysql_free_result($result1); > > $query2 = "select manager.idn, manager.total, > roster.idp, position, points from roster join reference > join manager where manager.idn=reference.idn and > reference.idp=roster.idp and manager.idn like '$nameto' and > roster.idp like '$playerto'"; > > $result2 = mysql_query($query2) or $mysqlerror = > mysql_error(); > if ($mysqlerror) { > $error = "$d_base_error$email_error"; > include("trades-inputs.php"); > exit; > } > > $row = mysql_fetch_array($result2); > > mysql_free_result($result2); > } > } > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Regex help needed
First, the prob you got : WARNING comes from the following error: (\s+face=\"Verdana, Arial, Helvetica, sans-serif\"|)> After the | (OR) sign, you must define another case, example: echo eregi_replace ("(\s*)\s*\s*purchasing power parity", '%POWER%', 'sdsdssPurchasing power parity'); Secondly, it's right that the \s expression is not recognised in " purchasing\s+power\s+parity " , a little strange, but you can use two different ways instead of '\s': - [[:space:]] - [ ] The brackets allows you to define a sequence of characters patterns (in the second case above, the space character). It will give: echo eregi_replace ("(\s*)\s*\s*purchasing[[:space:]]+power[[:space:]]+parity", '%POWER%', 'sdsdssPurchasing power parity'); Just a little help, you can find on the page http://www.php.net/manual/en/ref.regex.php that could be useful for you: ^ Start of line $ End of line n? Zero or only one single occurrence of character 'n' n* Zero or more occurrences of character 'n' n+ At least one or more occurrences of character 'n' n{2} Exactly two occurrences of 'n' n{2,} At least 2 or more occurrences of 'n' n{2,4} From 2 to 4 occurrences of 'n' . Any single character () Parenthesis to group expressions (.*) Zero or more occurrences of any single character, ie, anything! (n|a) Either 'n' or 'a' [1-6] Any single digit in the range between 1 and 6 [c-h] Any single lower case letter in the range between c and h [D-M] Any single upper case letter in the range between D and M [^a-z] Any single character EXCEPT any lower case letter between a and z. Pitfall: the ^ symbol only acts as an EXCEPT rule if it is the very first character inside a range, and it denies the entire range including the ^ symbol itself if it appears again later in the range. Also remember that if it is the first character in the entire expression, it means "start of line". In any other place, it is always treated as a regular ^ symbol. In other words, you cannot deny a word with ^undesired_word or a group with ^(undesired_phrase). Read more detailed regex documentation to find out what is necessary to achieve this. [_4^a-zA-Z] Any single character which can be the underscore or the number 4 or the ^ symbol or any letter, lower or upper case ?, +, * and the {} count parameters can be appended not only to a single character, but also to a group() or a range[]. therefore, ^.{2}[a-z]{1,2}_?[0-9]*([1-6]|[a-f])[^1-9]{2}a+$ would mean: ^.{2} = A line beginning with any two characters, [a-z]{1,2} = followed by either 1 or 2 lower case letters, _? = followed by an optional underscore, [0-9]* = followed by zero or more digits, ([1-6]|[a-f]) = followed by either a digit between 1 and 6 OR a lower case letter between a and f, [^1-9]{2} = followed by any two characters except digits between 1 and 9 (0 is possible), a+$ = followed by at least one or more occurrences of 'a' at the end of a line. Sid a écrit: Hello, Well I am doing by first reg ex operations and I am having problems which I just cannot figure out. For example I tried echo eregi_replace ("(\s*)\s*\s*purchasing power parity", '%POWER%', 'sdsdssPurchasing power parity'); and this worked perfectly, but when I chnaged that to echo eregi_replace ("(\s*)\s*\s*purchasing\s+power\s+parity", '%POWER%', 'sdsdssPurchasing power parity'); It does not detect the string. Srange. According to what I know, \s+ will detect a single space also. I tried chnaging the last 2 \s+ to \s* but this did not work also. Any ideas on this one? As I proceed I would like the expression to detect the optional face attribute also, so I tried echo eregi_replace ("(\s*)\s*\s*purchasing power parity", '%POWER%', 'sdsdssPurchasing power parity'); ... and this gave me an error like Warning: eregi_replace(): REG_EMPTY:çempty (sub)expression in D:\sid\dg\test.php on line 2 Any ideas? BTW any place where I can get started on regex? I got a perl book that explains regex, but I have got to learn perl first (I dont know any perl) Thanks in advance. - Sid Sid a écrit: Hello, Well I am doing by first reg ex operations and I am having problems which I just cannot figure out. For example I tried echo eregi_replace ("(\s*)\s*\s*purchasing power parity", '%POWER%', 'sdsdssPurchasing power parity'); and this worked perfectly, but when I chnaged that to echo eregi_replace ("(\s*)\s*\s*purchasing\s+power\s+parity", '%POWER%', 'sdsdssPurchasing power parity'); It does not detect the string. Srange. According to what I know, \s+ will detect a single space also. I tried chnaging the last 2 \s+ to \s* but this did not work also. Any ideas on this one? As I proceed I would like the expression to detect the optional face attribute also, so I tried echo eregi_replace ("(\s*)\s*\s*purchasing power parity", '%POWER%', 'sdsdssPurchasing power parity'); ... and this gave me an error like Warning: eregi_replace(): REG_EMPTY:çempty (sub)expression in D:\sid\dg\test.php on line 2 Any ideas? BTW any place where I can get started
[PHP] Anyone for cookies and milk? :-)
Hey, Am just getting into PHP cookies and have gotten a problem...(surprise surprise) Am trying to set a basic cookie to see exactly how things work before I start using it in my apps, heres the code i am using: (SetCookieEx.php) This is the output I am getting: ** Warning: setcookie() expects parameter 3 to be long, string given in /bestweb/public_html/testing/SetCookieEx.php on line 2 Warning: setcookie() expects parameter 3 to be long, string given in /bestweb/public_html/testing/SetCookieEx.php on line 3 done This is how I am trying to read the cookies: (ReadCookieEx.php) This is the output i am getting: *** wrong1wrong2 Anybody have any ideas? Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex and variable usage
Gerard Samuel a écrit: Curt Zirzow wrote: Gerard Samuel <[EMAIL PROTECTED]> wrote: or even preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{' . $foo . ', ' . $bar . '}$/', $some_string) I think, you Forgot, a \ before the $ at the end of the expression... that should work. Unfortunately it doesn't for some reason. Don't know why. but you could do this: $pattern = "/^[a-z0-9\-_\.]+\.[a-z0-9]{$foo, $bar}\$/"; preg_match($pattern, $some_string) But this does, so Im good. Thanks for the tips... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP & MS Exchange Server problem
Hello All--- I'm having some trouble getting PHP to communicate with my Windows 2000 MS Exchange Server... I'm running PHP 4.3.2 on a Win2000 machine serving with Apache 1.3. The code I'm using is: $mbox = imap_open("{x.x.x.x:143}","admin","adminpass", OP_HALFOPEN); $err = imap_errors(); while (list($key, $val) = each($err)) print imap_utf7_decode($val)."\n"; $alrt = imap_alerts(); while (list($key, $val) = each($alrt)) print imap_utf7_decode($val)."\n"; This yields the error: Warning: imap_open(): Couldn't open stream {x.x.x.x:143} in c:\apache\apache\htdocs\sdimail.php on line 11 Connection refused If I change the imap_open command to use {x.x.x.x:143\} as the host, I get a different error: Warning: imap_open(): Couldn't open stream {x.x.x.x:143\} in c:\apache\apache\htdocs\sdimail.php on line 11 Can't open mailbox {192.168.0.3:143\}: invalid remote specification which makes me suspect that I am actually able to connect but PHP isn't finding anything it likes (what is it looking for?) can anyone help me with this or at least point me towards a tutorial on using PHP with MS Exchange? Thanks in advance for your help, -Charlie [EMAIL PROTECTED]
Re: [PHP] Regex help needed
Sid <[EMAIL PROTECTED]> wrote: > Hello, > > Well I am doing by first reg ex operations and I am having problems which I just > cannot figure out. > > For example I tried > echo eregi_replace ("(\s*)\s* size=\"2\">\s*purchasing power parity", '%POWER%', 'sdsdss bgcolor="#f8f8f1">Purchasing power parity'); > and this worked perfectly, > > but when I chnaged that to > echo eregi_replace ("(\s*)\s* size=\"2\">\s*purchasing\s+power\s+parity", '%POWER%', 'sdsdss bgcolor="#f8f8f1">Purchasing power parity'); > It does not detect the string. Srange. According to what I know, \s+ will detect a > single space also. I tried chnaging the last 2 \s+ to \s* but this did not work also. > Any ideas on this one? I'd do something like this, unless your string must have to have the attributes to the html elements. ]*>[[:space:]]*]*>[[:space:]]*]*>[[:space:]]*purchasing[[:space:]]*power[[:space:]]*parity > As I proceed I would like the expression to detect the optional face attribute also, > so I tried > echo eregi_replace ("(\s*)\s* size=\"2\"(\s+face=\"Verdana, Arial, Helvetica, sans-serif\"|)>\s*purchasing power > parity", '%POWER%', 'sdsdssPurchasing power parity'); > ... and this gave me an error like > Warning: eregi_replace(): REG_EMPTY:çempty (sub)expression in D:\sid\dg\test.php on > line 2 (\s+face=\"Verdana, Arial, Helvetica, sans-serif\"|)>\s*purchasing power parity the problem is regex is expecting something here---^ you can change it to: (\s+face=\"Verdana, Arial, Helvetica, sans-serif\">|>)\s*purchasing power parity > > Any ideas? BTW any place where I can get started on regex? I got a perl book that > explains regex, but I have got to learn perl first (I dont know any perl) Go right to the source: http://www.oreilly.com/catalog/regex/ > > Thanks in advance. > > - Sid Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] include statement giving me hives! - help
I am new to all this, but here is the basic code: $link_titles = file('links/master.txt'); $links_include = $link_titles[$point]; // path to directory include $links_include; If I echo the value of $links_include just prior to the include() function it contains what I would expect it to contain and the file does exist. But I get an error: Warning: main(./main/links/topsites.php ) [function.main]: failed to create stream: No such file or directory in . on line 23 Warning: main() [function.main]: Failed opening './main/links/topsites.php ' for inclusion (include_path='.:/usr/local/lib/php') in on line 23 If I add the line: $links_include = "path to intended include file"; just prior to the include statement it works fine. Am I missing something? I've tried a variety of renditions of the include() statement and can't get it to react unless I 'hard code' the value of $links_include. Appreciate your help!! -Doug -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex and variable usage
Curt Zirzow wrote: Gerard Samuel <[EMAIL PROTECTED]> wrote: or even preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{' . $foo . ', ' . $bar . '}$/', $some_string) that should work. Unfortunately it doesn't for some reason. Don't know why. but you could do this: $pattern = "/^[a-z0-9\-_\.]+\.[a-z0-9]{$foo, $bar}\$/"; preg_match($pattern, $some_string) But this does, so Im good. Thanks for the tips... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] really no way to get byte size of variable?
Hi List Just want to make sure: Is there no way for me to easily determine the byte size occupied by a variable (regardless of type)? It might be trivial, or I'm missing the point (as per usual)... I would like to find the actual byte size that is transmitted when say a $_POST variable is sent, or how much memory a particular variable is taking up. Just want to make sure. Some of the post received so far suggest that "one character = one byte" etc, but I would love to work with something more precise if possible, also, is a variable contains a multi-dimensional array, would that "one character = one byte" formula still return a fair representation? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex and variable usage
Gerard Samuel <[EMAIL PROTECTED]> wrote: > Has anyone had any success with using variables in a regex shown below?? > > $foo = 3; > $bar = 4; > preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{$foo, $bar}$/', $some_string) You have single quotes, so php wont expand the variables inside. > > or even > preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{' . $foo . ', ' . $bar . '}$/', > $some_string) that should work. but you could do this: $pattern = "/^[a-z0-9\-_\.]+\.[a-z0-9]{$foo, $bar}\$/"; preg_match($pattern, $some_string) > but this would work > preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{3,4}$/', $some_string) > > Thanks for any pointers.. Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regex and variable usage
Has anyone had any success with using variables in a regex shown below?? $foo = 3; $bar = 4; preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{$foo, $bar}$/', $some_string) or even preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{' . $foo . ', ' . $bar . '}$/', $some_string) but this would work preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{3,4}$/', $some_string) Thanks for any pointers.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Object can not be used after a session
Wow thats strange?? I am using PHP 4.3.2 as well and I don't see that happening where it serializes the object when assigning it to the $_SESSION. I am using the dbg debugger and nusphere PHP editor and I can step through the code and as I do it shows that the session var is not serialized. However when I checked the session data in the /tmp directorie it appears to serialized It could be that my version of PHP doesn't match the dbg version and dbg reporting back false information (which I have to look into that). Also I checked my ini settings and it shows the session.serialize_handler = php which should be default. Another thing is that I didn't come accross in my reading of http://www.php.net/manual/en/language.oop.serialization.php where it says that objects assigned to the global $_SESSION var is automatically serialized. I did see that if you use the session_register() function it automatically serializes but again I'd like to avoid that. Right now it seems I have many unkowns, so i'm going to narrow them down Matt Mike Migurski wrote: $customer = new Customer($_GET['facilityID'], $_GET['customerID']); $_SESSION['acceptPayment']['serializedCustomer'] = serialize($customer); so now when I have moved on to another page or another instance of the same page and I want to access the object from the session var, I do so like this: $customer = unserialize($_SESSION['acceptPayment']['serializedCustomer']); and now you can access the object. There is a hidden jewl about this method, I now no longer have to include or require the class file because it is already defined in the serialized string. Really, you don't need the serialize/unserialize in there, as they are handled automagically. $_SESSION['customer'] = $customer; and $customer = $_SESSION['customer'] should work just fine. I'm doing this with 4.3.2, and a casual glance at my sess_* files in /tmp shows that the objects are stored in serialized form and the __sleep() method is called the usual way. My understanding is that classes must be defined prior to unserializing an object if you dan't want to risk having the object becoming disassociated from its class, but your method above does have the advantage that you decide when that serialization takes places and can load the classes there, rather than having to do so prior to session_start(). http://www.php.net/manual/en/language.oop.serialization.php - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regex help needed
Hello, Well I am doing by first reg ex operations and I am having problems which I just cannot figure out. For example I tried echo eregi_replace ("(\s*)\s*\s*purchasing power parity", '%POWER%', 'sdsdssPurchasing power parity'); and this worked perfectly, but when I chnaged that to echo eregi_replace ("(\s*)\s*\s*purchasing\s+power\s+parity", '%POWER%', 'sdsdssPurchasing power parity'); It does not detect the string. Srange. According to what I know, \s+ will detect a single space also. I tried chnaging the last 2 \s+ to \s* but this did not work also. Any ideas on this one? As I proceed I would like the expression to detect the optional face attribute also, so I tried echo eregi_replace ("(\s*)\s*\s*purchasing power parity", '%POWER%', 'sdsdssPurchasing power parity'); ... and this gave me an error like Warning: eregi_replace(): REG_EMPTY:çempty (sub)expression in D:\sid\dg\test.php on line 2 Any ideas? BTW any place where I can get started on regex? I got a perl book that explains regex, but I have got to learn perl first (I dont know any perl) Thanks in advance. - Sid
[PHP] reading from dir and displaying thumbs
Hi guys, I want to convert my old java greetings programs into php scripts but am stuck on one little thing. I have a bunch of thumbnails in a 3 directories, the problem is the number of thumbnails in each directory is differient...how do i first make the script look into the directory, display (maybe 15 per page?) thumbnails with a link to the main program which will take one parameter depending on the thumbnail name. eg: thumbnail name is 1.jpg so that thumbnail should have a link such as Anybody have any ideas or links please tell me. Cheers! -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL query problems
I tried that, but there is no error to stop the script at this point. The script continues past this point and to the end of the script - there are just no values in the variables for the second query, which obviously gives me the wrong results. -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: July 16, 2003 1:18 PM To: Beauford.2005 Cc: PHP Subject: Re: [PHP] MySQL query problems Change $email_error to $mysqlerror and hopefully some error message will appear. Beauford.2005 wrote: > if ($mysqlerror) { > $error = "$d_base_error$email_error"; > include("trades-input.php"); > exit; > } -- 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] Odd Error (PHP4 & IIS)
Tried. Didn't work then, isn't working now. Johnny Martinez wrote: I see this randomly on my little server. Just hit the refresh button :P J -Original Message- From: Shena Delian O'Brien [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 16, 2003 10:57 AM To: [EMAIL PROTECTED] Subject: [PHP] Odd Error (PHP4 & IIS) Hi - Got PHP4 running on IIS as a testing server (only used internally for my own testing purposes). It suddenly just flurbed on pages it worked fine on minutes ago. Now suddenly it gives me this error (with popups telling me about the missing files): Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. For more information as to why this behaviour exists, see the manual page for CGI security. For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page. PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4\imap.so' - The specified module could not be found. in Unknown on line 0 PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4\ldap.so' - The specified module could not be found. in Unknown on line 0 PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4\pgsql.so' - The specified module could not be found. in Unknown on line 0 I don't know why it's looking in /usr/lib - I'm running WinXP and IIS, not apache, and not linux. I looked in php.ini and there's no pointers to directories like that there! Ugh.. furthermore cgi.force_redirect is set to 0 like it should! Any assistance is appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Odd Error (PHP4 & IIS)
I see this randomly on my little server. Just hit the refresh button :P J -Original Message- From: Shena Delian O'Brien [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 16, 2003 10:57 AM To: [EMAIL PROTECTED] Subject: [PHP] Odd Error (PHP4 & IIS) Hi - Got PHP4 running on IIS as a testing server (only used internally for my own testing purposes). It suddenly just flurbed on pages it worked fine on minutes ago. Now suddenly it gives me this error (with popups telling me about the missing files): Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. For more information as to why this behaviour exists, see the manual page for CGI security. For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page. PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4\imap.so' - The specified module could not be found. in Unknown on line 0 PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4\ldap.so' - The specified module could not be found. in Unknown on line 0 PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4\pgsql.so' - The specified module could not be found. in Unknown on line 0 I don't know why it's looking in /usr/lib - I'm running WinXP and IIS, not apache, and not linux. I looked in php.ini and there's no pointers to directories like that there! Ugh.. furthermore cgi.force_redirect is set to 0 like it should! Any assistance is appreciated. -- 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] Opening a Window with JavaScript
Try this (note the "return false;" addition at the end): -- Aaron Gould Web Developer Parts Canada - Original Message - From: "Curt Zirzow" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 16, 2003 2:15 PM Subject: Re: [PHP] Opening a Window with JavaScript > Todd Cary <[EMAIL PROTECTED]> wrote: > > [...] > > However, if I use an anchor, the form is submitted. Is there a way to > > prevent this? Here is the code I tried: > > > > > > I believe you can put something like (not tested): > > > > > > Todd > > -- > > Curt > -- > > > -- > 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] Opening a Window with JavaScript
Todd Cary <[EMAIL PROTECTED]> wrote: > [...] > However, if I use an anchor, the form is submitted. Is there a way to > prevent this? Here is the code I tried: > > I believe you can put something like (not tested): > > Todd > -- Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Odd Error (PHP4 & IIS)
Hi - Got PHP4 running on IIS as a testing server (only used internally for my own testing purposes). It suddenly just flurbed on pages it worked fine on minutes ago. Now suddenly it gives me this error (with popups telling me about the missing files): Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. For more information as to why this behaviour exists, see the manual page for CGI security. For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page. PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4\imap.so' - The specified module could not be found. in Unknown on line 0 PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4\ldap.so' - The specified module could not be found. in Unknown on line 0 PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4\pgsql.so' - The specified module could not be found. in Unknown on line 0 I don't know why it's looking in /usr/lib - I'm running WinXP and IIS, not apache, and not linux. I looked in php.ini and there's no pointers to directories like that there! Ugh.. furthermore cgi.force_redirect is set to 0 like it should! Any assistance is appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Opening a Window with JavaScript
I want to have a link on a php page that when opened, has to be closed in order to move on. I have done this on pages using a button and _javascript_ as follows: When the button is clicked, the form is *NOT* submitted - this is what I want. However, if I use an anchor, the form is submitted. Is there a way to prevent this? Here is the code I tried: When the above is executed, the page is submitted, and I do not want that Todd -- <>
Re: [PHP] KEEP IMAGE RATIO
And I still don't see how your proposed method handles the problem you mentioned above with Image2... RDB Now, first, what would you prefer? Second, I hope you understand how the new feature would address the issue (and that you know what the issue is - if i explained it clearly, of course) As sent to [EMAIL PROTECTED] (please read in total, some stuff added) -- consider: Image1 : 100x100 (Ratio = 1:1) Image2 : 100x200 (Ratio = 1:2) Space available for display : 75x75 now, i can say "width=75% height=75%", but this will only work for Image1, since Image2 will end up as 75x150 (which clearly does not fit the 75x75 constraints) now, if i specify "width=75 height=75", again, this works for Image1, but not Image2, since the new Image2 ratio will be 1:1, with Image2 losing 1/2 of it's heigth ratio. Rather, with "img width=75 height=75 ratio=keep", we will have the following results: Final Display: Image1 : 75x75 : (RATIO 1x1) Image2 : 38x75 (37.5x75) : (RATIO 1:2) This is something simple enough for the browser to handle, and I think it should. - Now, as far as not seeing how this helps, keep in mind that this is NOT a feature, but SHOULD, and a reponse I got from [EMAIL PROTECTED] is the following: = this is what I use to maintain aspect ratio and constrain the image to the limits I have if($image_path == "") { $relative_directory = "/images/logo.gif"; $size = @GetImageSize(getenv("DOCUMENT_ROOT").$relative_directory); } else { $relative_directory = "/images/gallery/$sportid/"; $size = @GetImageSize(getenv("DOCUMENT_ROOT").$relative_directory."/".$image_path); } $width = $size[0]; $height = $size[1]; if($width > 500) { if(($width > 500)&&($height > 400)) { $width2 = ($size[0] - ( $size[0] * (1 - (500/$size[0]; $height2 = ($size[1] - ( $size[1] * (1 - (400/$size[1]; } else { $width2 = ($size[0] - ( $size[0] * (1 - (500/$size[0]; $height2 = $size[1]; } } else { $width2 = $size[0]; $height2 = $size[1]; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to address __FILE__ constant in extensions?
Hi there, i am not getting it. How can I read out the magical __FILE__ constant inside an _extension_ (a loadable module) ? Its not in symbol_table, so where is it? bg Sam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL query problems
Change $email_error to $mysqlerror and hopefully some error message will appear. Beauford.2005 wrote: if ($mysqlerror) { $error = "$d_base_error$email_error"; include("trades-input.php"); exit; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP explodes without using isset()
John Manko <[EMAIL PROTECTED]> wrote: > I've tried checking if $_POST and $_GET vars are set with just > > if($_POST['yuck']) > > When 'yuck' is not present my code always explodes with > *"Notice*: Undefined index: yuck" on the page output. You can use the @ error suppressor. if (@$_POST['yuck'])) > I never see any mention in the codes examples referencing a php > function that instructs the preprocessor not to output > such messages, but I've seen this used a lot of places. > I'm forced to use isset() with everything. Now, if there is > a switch to set in php.ini, this will do my no good since I > only have access to it on my dev box. Am I missing out > on something here, or do people just accept such messages (doubt it). if you dont want to use the @ other alternatives are: 1. .htaccess is turned on, you can issue a php_value to set the error reporting. 2. use ini_set(). HTH, Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP explodes without using isset()
Hello, This is a reply to an e-mail that you wrote on Wed, 16 Jul 2003 at 17:37, lines prefixed by '>' were originally written by you. > I've tried checking if $_POST and $_GET vars are set with just > if($_POST['yuck']) > When 'yuck' is not present my code always explodes with > *"Notice*: Undefined index: yuck" on the page output. > I never see any mention in the codes examples referencing a php > function that instructs the preprocessor not to output > such messages, but I've seen this used a lot of places. > I'm forced to use isset() with everything. Now, if there is > a switch to set in php.ini, this will do my no good since I > only have access to it on my dev box. Am I missing out > on something here, or do people just accept such messages (doubt it). If you have error reporting set to E_ALL this is the expected behaviour as you are trying to utilise an array index that does not exist. It is the better coding style to check the variable with isset() but if you do not want to do that you will have to turn down error reporting. David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP explodes without using isset()
I've tried checking if $_POST and $_GET vars are set with just if($_POST['yuck']) When 'yuck' is not present my code always explodes with *"Notice*: Undefined index: yuck" on the page output. I never see any mention in the codes examples referencing a php function that instructs the preprocessor not to output such messages, but I've seen this used a lot of places. I'm forced to use isset() with everything. Now, if there is a switch to set in php.ini, this will do my no good since I only have access to it on my dev box. Am I missing out on something here, or do people just accept such messages (doubt it). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get size of variable n bytes
Hello, This is a reply to an e-mail that you wrote on Wed, 16 Jul 2003 at 16:35, lines prefixed by '>' were originally written by you. > Yes, well, that complicates things. > You see, I'm trying to determine the size that the $_POST variable > will be > in bytes, because there is a byte limit in the php.ini file for POST > variable size, so I was hoping for something easy like > bytes_size($_POST)... > Would also be handy to calculate how much memory your script will > use/need. > So, you say there is no such function or no way to determine it? The POST data is all sent as text anyway so what I said about assuming 1 character = 1 byte will be the best way of calculatuing the size of the entire request (remember to include all variable names, ?, & and = characters as well though). David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Test (ignore)
Some of my mail hasn't appeared on list for a while, just testing if connection is working. IGNORE THIS MESSAGE :) -- .-. | Worlds of Carnage - http://www.wocmud.org | :-: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul.| `-' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Verifying a certain amount of numbers
Justin French <[EMAIL PROTECTED]> wrote: > If you care about performance at all, try and find away around the > problem without regular expressions... > > I tested > > if( (strlen($str) == 6) && (is_int($str)) ) > I did some more tests on this problem is that $str is still considered a string and not an integer here is my test script and results: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL query problems
Hi, Not sure if the problem here is PHP or MySQL, but here we go. I am trying to do two queries on a database - one after the other, but the second one never seems to get executed. The two queries are identical except for two variables. I have checked my form and they are correct and are being sent to the PHP script the way they should be. The variables are $playerto, $playerfrom, $nameto, $namefrom. The 'TO' query is the one that doesn't work. Here is my code. Any help is appreciated. if ($namefrom != $nameto) { if ($playerfrom != $playerto) { include("2004server.inc"); if($error) { include("trades-input.php"); exit; } $query1 = "select manager.idn, manager.total, roster.idp, position, points from roster join reference join manager where manager.idn=reference.idn and reference.idp=roster.idp and manager.idn like '$namefrom' and roster.idp like '$playerfrom'"; $result1 = mysql_query($query1) or $mysqlerror = mysql_error(); if ($mysqlerror) { $error = "$d_base_error$email_error"; include("trades-input.php"); exit; } $line = mysql_fetch_row($result1); mysql_free_result($result1); $query2 = "select manager.idn, manager.total, roster.idp, position, points from roster join reference join manager where manager.idn=reference.idn and reference.idp=roster.idp and manager.idn like '$nameto' and roster.idp like '$playerto'"; $result2 = mysql_query($query2) or $mysqlerror = mysql_error(); if ($mysqlerror) { $error = "$d_base_error$email_error"; include("trades-inputs.php"); exit; } $row = mysql_fetch_array($result2); mysql_free_result($result2); } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: XML Array
> "Lee" == Lee Doolan <[EMAIL PROTECTED]> writes: > "Michael" == Michael Smith <[EMAIL PROTECTED]> writes: Michael> Hey, I'm looking for a function to take an XML file and Michael> turn it into a PHP array with the same structure. Lee> here's something that I found on the internet a few months Lee> back. here I am following up my own post yet again.. I forgot to include an example of use. here's a little snippet that uses xmlize(): ## probably actually should use join here. I guess I was too concerned ## about the whitespace $xData=""; while (list($k, $v)= each($xml)) { $xData .= trim($v); } ## turn the XML into an array $ary= xmlize($xData); ## split into several different arrays depending on donation amount $hofTable= $ary['patronHofTable']['#']['tableData']['0']['#']['hofTableEntry']; $platinumAry= $goldAry= $silverAry= $insiderAry= array(); if (!isset($hofTable['0']['#']['text'])) { foreach($hofTable as $hofkey => $hofVal) { $entry= $hofVal['#']['Data']['0']['#']; if ($entry > 999) { $platinumAry[]= $hofVal; } else if ($entry > 499) { $goldAry[]= $hofVal; } else if ($entry > 99) { $silverAry[]= $hofVal; } else { $insiderAry[]= $hofVal; } } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] HTTPS POST without user/client intervention
|-Original Message- |From: PHP List [mailto:[EMAIL PROTECTED] |Sent: Tuesday, July 15, 2003 1:02 PM |To: [EMAIL PROTECTED] |Subject: [PHP] HTTPS POST without user/client intervention | |I am writing a php script to accept an HTTPS POST of data from a remote |site, process the data, and send an HTTPS POST response back (not |necessarily to the same remote site). I can do this pretty easily in |PERL (which I may have to if I can't find a PHP solution). Also I need |to do the https post without any kind of client or user interaction. I |have checked through php.net and phpbuilder.com but have only come up |with things for HTTP POST (no SSL Encryption). Anyone run across |something like this, or can point me in a direction to look? | On Jul 16, 2003, "Ralph Guzman" claimed that: | |I think what you are looking for is socket connections: |http://www.php.net/manual/en/function.fsockopen.php | |Or CURL | |http://www.php.net/manual/en/ref.curl.php | Another option for you is to ouput a blank page with just a form pointing where you need it to, with hidden inputs, and at the end of the page or in a , document.form.submit(); Assuming your client has JavaScript. Jeff Harris -- Registered Linux user #304026. "lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import" Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this message should conform to RFC 1855. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Apache Web Server config file and PHP (pleasegive advice on what problem may be me)
Did you add these lines to http.conf?: LoadModule php4_module c:/php4/sapi/php4apache.dll AddModule mod_php4.c AddType application/x-httpd-php .php If you did, did you restart apache afterwards? karen santmyer wrote: HI: Can anyone refer me to someone that can help with the problem below. I installed Apache Web Server on my laptop which has Windows XP. I then installed PHP. I followed the directions in the book I had on installing apache and php and what to add to the apache configuration file. Here is what is happening: After installing everything, I tested my Apache web server installation first and saw the apache web server page like the book said. Then it said to do a little php program - which had phpinfo() in it. But when I retyped the url I got a message that asked me did I want to download a file, which was the php program file. The PHP is 4.3.2 and the apache web server is 2.0. What am I doing wrong? Should I use apache 1.3.2? Please help. I understand everything, just don't know why it is prompting me to download a file. Thanks. Karen - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] KEEP IMAGE RATIO
On Wednesday 16 July 2003 09:46 am, John Manko wrote: > Ok, before you go responding with percentages, I should note this. > > consider this: > Image1 : 100x100 (Ratio = 1:1) > Image2 : 100x200 (Ratio = 1:2) > > Space available for display : 75x75 > > now, i can say "width=75% height=75%", but this will > only work for Image1, since Image2 will end up > as 75x150 (which clearly does not fit the 75x75 constraints) > > now, if i specify "width=75 height=75", again, this works for Image1, but > not Image2, since the new Image2 ratio will be 1:1, with Image2 losing > 1/2 of it's heigth ratio. And I still don't see how your proposed method handles the problem you mentioned above with Image2... RDB > John Manko wrote: > > Ok, I'm surprised that this is not taken care of with HTML. > > > > I propose the following standard (but also looking for a PHP > > workaround if available) > > for the Img HTML tag: > > > > RATIO = Keep|Ignore, default Ignore > > > > < img width='x' height='y' RATIO='Keep|Ignore' > > > > > Where, RATIO=Keep will inlarge the image to a > > max WIDTH or HEIGHT (which ever comes first), > > without changing the perspective ratio. > > > > I don't want to have to use Photoshop or Gimp to > > ensure that the images a width=x or heigth=y will keep ratio. > > > > If anyone belongs to W3C, please consider this. > > > > Thanks -- - /"\ ASCII Ribbon Campaign against HTML \ / email and proprietary format X attachments. / \ - Have you been used by Microsoft today? Choose your life. Choose freedom. Choose LINUX. - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multi file multi colomn
is there a max file handle pool in php? look at: http://us3.php.net/fopen http://us3.php.net/fwrite FB wrote: Hi, I have 40 text files.. each files have 1 colomn of a data. I want to write a script to merge them like datafrom1;datafrom2;datafrom3;datafrom40 how can I do that? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: XML Array
> "Michael" == Michael Smith <[EMAIL PROTECTED]> writes: Michael> Hey, I'm looking for a function to take an XML file and Michael> turn it into a PHP array with the same structure. here's something that I found on the internet a few months back. I've used it a number of times: C U TH E R E C U TH E R E C U TH E R E /* xmlize() is by Hans Anderson, [EMAIL PROTECTED] * * Ye Ole "Feel Free To Use it However" License [PHP, BSD, GPL]. * some code in xml_depth is based on code written by other PHPers * as well as one Perl script. Poor programming practice and organization * on my part is to blame for the credit these people aren't receiving. * None of the code was copyrighted, though. * * This is a stable release, 1.0. I don't foresee any changes, but you * might check http://www.hansanderson.com/php/xml/ to see * * usage: $xml = xmlize($array); * * See the function traverse_xmlize() for information about the * structure of the array, it's much easier to explain by showing you. * Be aware that the array is somewhat tricky. I use xmlize all the time, * but still need to use traverse_xmlize quite often to show me the structure! * */ function xmlize($data, $WHITE=1) { $data = trim($data); $vals = $index = $array = array(); $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, $WHITE); xml_parse_into_struct($parser, $data, $vals, $index); xml_parser_free($parser); $i = 0; $tagname = $vals[$i]['tag']; if ( isset ($vals[$i]['attributes'] ) ) { $array[$tagname]['@'] = $vals[$i]['attributes']; } else { $array[$tagname]['@'] = array(); } $array[$tagname]["#"] = xml_depth($vals, $i); return $array; } /* * * You don't need to do anything with this function, it's called by * xmlize. It's a recursive function, calling itself as it goes deeper * into the xml levels. If you make any improvements, please let me know. * * */ function xml_depth($vals, &$i) { $children = array(); if ( isset($vals[$i]['value']) ) { array_push($children, $vals[$i]['value']); } while (++$i < count($vals)) { switch ($vals[$i]['type']) { case 'open': if ( isset ( $vals[$i]['tag'] ) ) { $tagname = $vals[$i]['tag']; } else { $tagname = ''; } if ( isset ( $children[$tagname] ) ) { $size = sizeof($children[$tagname]); } else { $size = 0; } if ( isset ( $vals[$i]['attributes'] ) ) { $children[$tagname][$size]['@'] = $vals[$i]["attributes"]; } $children[$tagname][$size]['#'] = xml_depth($vals, $i); break; case 'cdata': array_push($children, $vals[$i]['value']); break; case 'complete': $tagname = $vals[$i]['tag']; if( isset ($children[$tagname]) ) { $size = sizeof($children[$tagname]); } else { $size = 0; } if( isset ( $vals[$i]['value'] ) ) { $children[$tagname][$size]["#"] = $vals[$i]['value']; } else { $children[$tagname][$size]["#"] = ''; } if ( isset ($vals[$i]['attributes']) ) { $children[$tagname][$size]['@'] = $vals[$i]['attributes']; } break; case 'close': return $children; break; } } return $children; } /* function by [EMAIL PROTECTED], a HUGE help! * * this helps you understand the structure of the array xmlize() outputs * * usage: * traverse_xmlize($xml, 'xml_'); * print '' . implode("", $traverse_array . ''; * * */ function traverse_xmlize($array, $arrName = "array", $level = 0) { foreach($array as $key=>$val) { if ( is_array($val) ) { traverse_xmlize($val, $arrName . "[" . $key . "]", $level + 1); } else { $GLOBALS['traverse_array'][] = '$' . $arrName . '[' . $key . '] = "' . $val . "\"\n"; } } return 1; } -- Flowers of morning glory. +-+ The sky above this street |donate to causes I care about: | Begins to overcast.| http://svcs.affero.net/rm.php?r=leed_25 | --Sugita+-+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing $Vars between 2 php pages
Thanks John! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php