Re: [PHP] Netcraft
--- John Nichel [EMAIL PROTECTED] wrote: Does anyone know how Netcraft queries a webserver to get the info it does (OS, web server software, uptime, etc.)? http://uptime.netcraft.com/up/accuracy.html Please try to stick to PHP queries as much as possible. Thanks. 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] Netcraft
Maybe if I add a second question, which I figure didn't have to be asked, since I'm asking a PHP list, would make it all better Does anyone know how Netcraft queries a webserver to get the info it does (OS, web server software, uptime, etc.)? newstuffCan this be done with PHP/newstuff But thanks for the link anyway. Chris Shiflett wrote: --- John Nichel [EMAIL PROTECTED] wrote: Does anyone know how Netcraft queries a webserver to get the info it does (OS, web server software, uptime, etc.)? http://uptime.netcraft.com/up/accuracy.html Please try to stick to PHP queries as much as possible. Thanks. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Q on Class, inhertance, ec... (a bit long)
I have a quandary and I hope I can explain myself well enough that someone may understand and enlighten me. I am in the middle of building a (largish) Class. It is done for the most part, at least all pieces are there. Now I'm just trying to put the pieces together in a logical order. This is my issue; I have 2 sets of 12 methods that are identical in nature, but differ in implementation. Sort of like DB and Auth can handle different databases. (And yes, I've been studying them, but still am at a loss) I have my main class, BAZ, then I have 2 sub Classes, BAR and FOO. If x = 1, then I want to load BAR and utilize these 12 methods that are defined there. If x =2, then I want to load FOO and utilize these 12 methods that are defined there. The methods in each Sub-Class have the same names. My question is, how do I wrap this so that my methods calls are ignorant of with sub-class is used? Example: $myObject = new BAZ ( x = 2 ); // Utilize methods in FOO $myFred = $myObject-Fred; $myBarney = $myObject-Barney; or $myObject = new BAZ ( x = 1 ); // Utilize methods in BAR $myFred = $myObject-Fred; $myBarney = $myObject-Barney; And to throw a monkey with this wrenth, the 'factory' of the main class needs access to a few of these 'common' methods as well to prep several properties. Each sub-class contains about 600 lines of code, that I would rather not have in a single class file. Also, do I have to have these 12 methods names defined, but empty, in the main class? I hope this explains my non-understanding of PHP OOP to the level that someone can point me in the right direction. Thanks for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Maintains a persistent connection
On Thursday 25 September 2003 12:08, ascll wrote: Question: = Could my .php page ALWAYS get the latest values WITHOUT reload the page? That would be magic. -- 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 -- /* I'd love to go out with you, but I'm staying home to work on my cottage cheese sculpture. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Q on Class, inhertance, ec... (a bit long)
What about something like this? (actual code not tested, but concept has...) class FOO { function Fred() { echo Fred in FOO; } } class BAR { function Fred() { echo Fred in BAR; } } class BAZ { var $subclass; function BAZ($num) { if ($num == 1) $this-subclass = new FOO(); if ($num == 2) $this-subclass = new BAR(); } function Fred() { $this-subclass-Fred(); } } -Original Message- From: jsWalter [mailto:[EMAIL PROTECTED] Sent: Thursday, 25 September 2003 4:30 PM To: [EMAIL PROTECTED] Subject: [PHP] Q on Class, inhertance, ec... (a bit long) I have a quandary and I hope I can explain myself well enough that someone may understand and enlighten me. I am in the middle of building a (largish) Class. It is done for the most part, at least all pieces are there. Now I'm just trying to put the pieces together in a logical order. This is my issue; I have 2 sets of 12 methods that are identical in nature, but differ in implementation. Sort of like DB and Auth can handle different databases. (And yes, I've been studying them, but still am at a loss) I have my main class, BAZ, then I have 2 sub Classes, BAR and FOO. If x = 1, then I want to load BAR and utilize these 12 methods that are defined there. If x =2, then I want to load FOO and utilize these 12 methods that are defined there. The methods in each Sub-Class have the same names. My question is, how do I wrap this so that my methods calls are ignorant of with sub-class is used? Example: $myObject = new BAZ ( x = 2 ); // Utilize methods in FOO $myFred = $myObject-Fred; $myBarney = $myObject-Barney; or $myObject = new BAZ ( x = 1 ); // Utilize methods in BAR $myFred = $myObject-Fred; $myBarney = $myObject-Barney; And to throw a monkey with this wrenth, the 'factory' of the main class needs access to a few of these 'common' methods as well to prep several properties. Each sub-class contains about 600 lines of code, that I would rather not have in a single class file. Also, do I have to have these 12 methods names defined, but empty, in the main class? I hope this explains my non-understanding of PHP OOP to the level that someone can point me in the right direction. Thanks for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Databases
Hi Im kinda new to php. I have a linux server witch has our website on it. I want to make a download page. If a person clicks on a link , they must be able to download from our server. How difficult is this , can you send me an example ? Thanks Shaun van den Berg -- Novtel Consulting Tel: +27 21 9822373 Fax: +27 21 9815846 Please visit our website: www.novtel.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Databases
On Thursday 25 Sep 2003 08:14, Shaun van den Berg wrote: Hi Im kinda new to php. I have a linux server witch has our website on it. I want to make a download page. If a person clicks on a link , they must be able to download from our server. How difficult is this , can you send me an example ? How long is a piece of string? Too vague a question. Authenticated downloads? Downloads of files not in the web tree? Both have been covered in the past 2 weeks or so, and can be found in the archives. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] alphanumeric randomized image
Hi to all, I'm looking for a alphanumeric randomized image script. Can anyone give me a good link or an example for this? Thanks in advance. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] alphanumeric randomized image
On Thursday 25 Sep 2003 23:10, Michael P. Carel wrote: Hi to all, I'm looking for a alphanumeric randomized image script. Can anyone give me a good link or an example for this? This was covered not more than 24 hours ago, and is in the archives. It's also been covered in the past two weeks... http://marc.theaimsgroup.com/?l=php-generalw=2r=1s=+blurry+images+q=b -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Netcraft
I did see you on the other list, Well anyway. It can be a combination of system tools and php. Not just php, but also system tools like ping, traceroute, etc. Php can help a lot, on querying it over the website. But overall read the man :D -- - Louie Miranda http://www.axishift.com - Original Message - From: John Nichel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, September 25, 2003 2:08 PM Subject: Re: [PHP] Netcraft Maybe if I add a second question, which I figure didn't have to be asked, since I'm asking a PHP list, would make it all better Does anyone know how Netcraft queries a webserver to get the info it does (OS, web server software, uptime, etc.)? newstuffCan this be done with PHP/newstuff But thanks for the link anyway. Chris Shiflett wrote: --- John Nichel [EMAIL PROTECTED] wrote: Does anyone know how Netcraft queries a webserver to get the info it does (OS, web server software, uptime, etc.)? http://uptime.netcraft.com/up/accuracy.html Please try to stick to PHP queries as much as possible. Thanks. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- By-Tor.com It's all about the Rush http://www.by-tor.com -- 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] variables, passing again to another.
if ($psi_shipping_addtnl_info != '') { echo ' NO USER INPUT '; } Im catching a _POST variable from a form, now i wonder im filtering it out to pass again to another variable is this possible? -- - Louie Miranda http://www.axishift.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] variables, passing again to another.
On Thursday 25 September 2003 15:46, Louie Miranda wrote: if ($psi_shipping_addtnl_info != '') { echo ' NO USER INPUT '; } Im catching a _POST variable from a form, now i wonder im filtering it out to pass again to another variable is this possible? *assign* to another variable // $new = $old or pass to another *page*? // use sessions, or pass through the URL, or use // another form -- 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 -- /* And they told us, what they wanted... Was a sound that could kill some-one, from a distance. -- Kate Bush */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Q on Class, inhertance, ec... (a bit long)
Martin Towell [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What about something like this? snip I've been playing with that same approach this evening. But I guess I was hoping for a more direct, 1 level of inderection instead of 2. But, by making a base method in the main class, and it knowing about the second level of indirection, that sort-of solves the issue. Thanks for your time and thoughts. It help clarify my thinking and approach, and just showed me that I wasn't to far off the path, as it were. Walter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] alphanumeric randomized image
thanks i've found a good sample in phpclasses Class:PWGen - Original Message - From: Michael P. Carel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 25, 2003 3:10 PM Subject: [PHP] alphanumeric randomized image Hi to all, I'm looking for a alphanumeric randomized image script. Can anyone give me a good link or an example for this? Thanks in advance. Mike -- 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] 3 mins of your time please...logic problem
A different approache for the captcha.. instead of using a blurred image use some text and than ask a question about the text like What does the 2nd word in the first line of the 4thparagraph say? Things to make sure: - Use enough texts so that guessing the correct word is not possible. - Use random word extraction to make the word different on each invocation. - Use different questions types and mix numbers and words. Like what is the word after the first word... stuff like that 10 different question should suffice - make sure that you have a timeout or relocation after a wrong word to make brute force attacks unattractive or even impossible This should be fairly easy to implement using db and php and is not quite as complicated as creating a blurry image. (IMHO) The system is easy to extend and easy to use by humans. Regards Stefan Langer
[PHP] Refresh php section
= start Test.php = // Section-A ?php ... ? // Section-B ?php ... ? // Section-C ?php ... ? // Section-D ?php ... ? = end Test.php = Greetings, It that a way for me to reload Section-A's php codes every 1-second and Section-D's php codes every 5-second, that belongs to the SAME php file, say test.php? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Databases
You find a reasonable example if you go googling for 'PHP tutorial' and then sit down for an evening and read the manual. C -Original Message- From: Shaun van den Berg [mailto:[EMAIL PROTECTED] Sent: 25 September 2003 07:14 To: [EMAIL PROTECTED] Subject: [PHP] Databases Hi Im kinda new to php. I have a linux server witch has our website on it. I want to make a download page. If a person clicks on a link , they must be able to download from our server. How difficult is this , can you send me an example ? Thanks Shaun van den Berg -- Novtel Consulting Tel: +27 21 9822373 Fax: +27 21 9815846 Please visit our website: www.novtel.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Refresh php section
Consider 4 IFRAMEs on one page, with meta refreshes in each header which point to your php script with a get parameter of whichever 'section' you're dealing with. Regards Chris -Original Message- From: ascll [mailto:[EMAIL PROTECTED] Sent: 25 September 2003 08:48 To: [EMAIL PROTECTED] Subject: [PHP] Refresh php section = start Test.php = // Section-A ?php ... ? // Section-B ?php ... ? // Section-C ?php ... ? // Section-D ?php ... ? = end Test.php = Greetings, It that a way for me to reload Section-A's php codes every 1-second and Section-D's php codes every 5-second, that belongs to the SAME php file, say test.php? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help! the Error_Reporting doesn't work
I have set the PHP.INI as follow: error_reporting = E_ALL ~E_NOTICE display_errors = On display_startup_errors = Off log_errors = On log_errors_max_len = 1024 ignore_repeated_errors = Off ignore_repeated_source = Off report_memleaks = On track_errors = Off But it doesn't work How can i solve it? Thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help! the Error_Reporting doesn't work
I have set the PHP.INI as follow: error_reporting = E_ALL ~E_NOTICE display_errors = On display_startup_errors = Off log_errors = On log_errors_max_len = 1024 ignore_repeated_errors = Off ignore_repeated_source = Off report_memleaks = On track_errors = Off But it doesn't work How can i solve it? Thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Editor - which to use?
I write my code with pencil and paper and then scan it.. Dont need an editor ! John Nichel wrote: I know we've discussed this numerous times, but I'll chime in again (mainly because I'm bored). By far, I have been totally satisfied with UltraEdit. Lightweight, just about any language you want to edit, user configurable syntax highlighting (for those into that), handles UNIX / DOS / Mac files easily, etc, etc. And best of all, buy a liscense (cheap) and you're supporting a programmer, and not a company. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Record Selection
I have a table that the user can select numerous address's, I then want them to click submit and have a confirmation page that just shows the address's they selected. If you take a look at this you will see what I mean and where I have got to. ttp://www.tbptestsite.com/kaantest/index.php or download at http://www.tbptestsite.com/kaantest/calloff.zip on the 'ajr_calloff_selected.php' if the user does not add a quantity it shouldn't go through to the confirmation page, making it so only ones with quantities go to the confirmation page filtering out all the other records. Please could someone help me on this, I am completely new to PHP so this is all abit over my head. Many thanks in advance, Kaan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Editor - which to use?
I like accelerators I just didnt like the price. So I wrote my own, but I havent worked all the bugs out yet. From: Robert Cummings [EMAIL PROTECTED] To: Curt Zirzow [EMAIL PROTECTED] CC: PHP-General [EMAIL PROTECTED] Subject: Re: [PHP] PHP Editor - which to use? Date: 24 Sep 2003 09:44:40 -0400 On Wed, 2003-09-24 at 09:43, Curt Zirzow wrote: * Thus wrote Didier McGillis ([EMAIL PROTECTED]): alot easier for me with the returns and tabs. What I do is I have a script that strips out any space, tabs, carriage returns and then moves the code into the production environment. But really unless you are dealing with In some cases, files with no carriage returns is less effeciant than files with them. Accelerators are very efficient, and I'm pretty sure they don't store whitespace except when it's in a string :) Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ 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
RE: [PHP] How can I auto upload a file to the server?
[snip] But, as we all know, PHP doesn't run client side, so she'd have to turn her computer into a web server or run PHP from the command line. There still isn't a way to automatically submit a file over HTTP using either method, though. FTP would work, though... [/snip] I am surprised that this wasn't pointed out before. There are lots of things for which we use automated file retrieval (and it can be multiple files) all the time. Jane, is there a reason it needs to be via HTTP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Editor - which to use?
me? groan? never! :) Really I think most of agree that its a personal preference if you learned one way then you going to be the most comfortable in using that style. I am very used to C style coding and therefore am more comfortable using that. From: Kevin Bruce [EMAIL PROTECTED] To: PHP-General [EMAIL PROTECTED] Subject: Re: [PHP] PHP Editor - which to use? Date: Wed, 24 Sep 2003 10:34:33 -0400 FYI- New to this list but have been a php coder for 2 years. I know a lot of you out there are going to groan inwardly, but I use Dreamweaver, mainly because that's what I used since it's inception when I was writing static sites. I use OSX for my writing platform and occasionally use BBedit as well. If someone could point out a better PHP editor for the Mac, please speak up:) BTW- Dreamweaver has pretty decent PHP highlighting. I started out as a pure designer but got into the web and have since been a moderate code writer, so cut me some slack if my methods are not standard;) Whether or not it is proper form, I use the following format: if($conditional) { some code; } else { if($subconditional) { subsome code; } else { subsome alternate code; } } --- iChat screen name- mdsgkevin * Thus wrote Robert Cummings ([EMAIL PROTECTED]): *COUGH* *COUGH* EVERY REAL coder knows that you have to use the following brace style for your code to be accepted into the l33t hierarchy of [EMAIL PROTECTED]: if( $pos_params != false ) { $back_url = substr( $HTTP_GET_VARS['origin'], 0, $pos_params ); $back_url_params = substr( $HTTP_GET_VARS['origin'], $pos_params + 1 ); } else { $back_url = $HTTP_GET_VARS['origin']; $back_url_params = ''; } cat | realprogrammer if( $pos_params != false ) { $back_url = substr( $HTTP_GET_VARS['origin'], 0, $pos_params ); $back_url_params = substr( $HTTP_GET_VARS['origin'], $pos_params + 1 ); } else { $back_url = $HTTP_GET_VARS['origin']; $back_url_params = ''; } cat | realprogrammer | in_a_rush if($p) { $bu = substr( $_GET['o'], 0, $p ); $bup = substr( $_GET['o'], ++$p ); } else { $bu = $_GET['o']; $bup = ''; } :) Curt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help! the Error_Reporting doesn't work
[snip] error_reporting = E_ALL ~E_NOTICE display_errors = On display_startup_errors = Off log_errors = On log_errors_max_len = 1024 ignore_repeated_errors = Off ignore_repeated_source = Off report_memleaks = On track_errors = Off But it doesn't work How can i solve it? [/snip] I am going toask the obvious, did you restart Apache after editing the php.ini? Is php looking at this .ini? (You can see where php is looking, plus a whole lot of other stuff by putting a page with ?php phpinfo(); ? in it) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Editor - which to use?
I think that is the one thing that really gets me, and therefore is the reason that I stay away from Dreamweaver (my wife uses it, so its in the house) but I have to tweak the code it gives me or she gives me when something isnt working, and its always something odd or many things odd in the HTML or php. But again thats just me. From: Kevin Bruce [EMAIL PROTECTED] To: Cesar Cordovez [EMAIL PROTECTED], PHP-General [EMAIL PROTECTED] Subject: Re: [PHP] PHP Editor - which to use? Date: Wed, 24 Sep 2003 13:04:45 -0400 Thanks:) I'll give BBedit a go for a week and let you know how it turns out. Yes, Dreamweaver does sucketh much, but it's great for hashing out the page (WYSIWYG style) then tweeking the code. I Hate (capital H) hand typing nested tables.* :P *high school memoryHwat the hell do I need typing for, I'm going to be an illustrator!/high school memory THE best text/code editor in this planet is BBEdit. No questions about it. It is a pitty it only runs on Macs. I have used it to write text, code fortran, pascal, c, c++, html, css and php (among others). It is great, I love it. Kudos to Bare Bones! Great find/replace utility. Incredible adaptation to your needs. Owesome syntax coloring. Terminal included. FTP, mail, telnet, terminal, macro, perl included. Try it, now! Cesar (If any one cares, I also think that Dreamweaver Sucks!, big Time, capital S) Kevin Bruce wrote: FYI- New to this list but have been a php coder for 2 years. I know a lot of you out there are going to groan inwardly, but I use Dreamweaver, mainly because that's what I used since it's inception when I was writing static sites. I use OSX for my writing platform and occasionally use BBedit as well. If someone could point out a better PHP editor for the Mac, please speak up:) BTW- Dreamweaver has pretty decent PHP highlighting. -- Kevin Bruce Educational Web Designer VIP K-16 Grant http://www.scienceinquiry.org [EMAIL PROTECTED] Maryland Sea Grant College 4321 Hartwick Road, Suite 300 College Park, MD 20740 301.403.4220 ext. 25 OR (on Wednesdays and Fridays) 717.637.5370 AOL Instant Messenger screen name- mdsgkevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Editor - which to use?
lmao .. good one. From: pete M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP Editor - which to use? Date: Thu, 25 Sep 2003 10:59:19 +0100 I write my code with pencil and paper and then scan it.. Dont need an editor ! John Nichel wrote: I know we've discussed this numerous times, but I'll chime in again (mainly because I'm bored). By far, I have been totally satisfied with UltraEdit. Lightweight, just about any language you want to edit, user configurable syntax highlighting (for those into that), handles UNIX / DOS / Mac files easily, etc, etc. And best of all, buy a liscense (cheap) and you're supporting a programmer, and not a company. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Running system commands
It was filtering, but now I've opened the port to listen to my machine, which is running my web server (where all php scripts qre running). So, that's not a problem now. I've checked it (SSH) on the terminal, it's working fine with root as well as other users. Now, problem is, for other users it asks for password, which i dont want to surpass. Your idea of running encrypted tunnel to use telnet services is good, but i cann't use it, cause i've blocked that port, and i dont want to open it. Second thing is, yes I'm using system() for command from php and it's not showing any result. May be you r right that, it's just sitting waiting for password. If, you've any idea to deal with it, please let me know. Anyway, thanks a lot for your time and great help. Nitin - Original Message - From: Evan Nemerson [EMAIL PROTECTED] To: Nitin [EMAIL PROTECTED] Sent: Thursday, September 25, 2003 4:38 PM Subject: Re: [PHP] Running system commands If it's filtering port 22, you're not going to be able to access the server from any client, unless you can bypass the firewall. Only the server needs to be run as root. The client should _never_ be run as root. I don't know how to pass the password as an argument (and honestly hope there isn't one). Furthermore, the client will probably open the terminal to accept input instead of relying on stdin, so I doubt you can send the password via stdin. What I think you'll probably end up doing is creating an encrypted tunnel via SSH to a telnet server. Search for how to use port forwarding with whatever ssh software you're using, and learn the interface. Run the same command from a shell as you're running from PHP. Is there any output? What method for execution are you using (backtick, exec, system, passthru, etc)? It's also entirely possible that ssh is siting there waiting for a password you can't input because it's not a true terminal. On Thursday 25 September 2003 03:20 am, you wrote: Yeah, I did it with ipchains, it was blocking that particular port, that's fine. But how do I do all this functioning from within PHP. I mean, if I want to use ssh not with root, what should I do? Explain it if you can. How'll I give my password and do other functionning? and one more thing, it doesn't show any output on executing ssh from within php, now how do i know that it's working or not? I'm really thankful to you, for all your help. Nitin - Original Message - From: Evan Nemerson [EMAIL PROTECTED] To: Nitin [EMAIL PROTECTED] Sent: Thursday, September 25, 2003 11:38 AM Subject: Re: [PHP] Running system commands ipchains -L will show your firewall. if that doesn't work, you might want to try iptables -L... ipchains is obsolete. What does netstat -lp show for port 22/ssh? What does a portscan show? On Wednesday 24 September 2003 11:03 pm, you wrote: No problem starting it. When I connect with ssh, it says: Connect: connection to hostname on port 22 refused. And, same problem with root as well as others. Do you have any idea, where does ipchains store all the rules Accepting and Rejecting packets? Thanks for the help. Nitin - Original Message - From: Evan Nemerson [EMAIL PROTECTED] To: Nitin [EMAIL PROTECTED] Sent: Thursday, September 25, 2003 4:45 AM Subject: Re: [PHP] Running system commands What exactly is the problem? What does the sshd say when you try to start it? Are you running as root (which you must be for it to run on port 22, which is default)? On Wednesday 24 September 2003 04:51 am, you wrote: Thanks for the help, I'v configured ssh, but there seems to be some problem with particular port. Thanx anyway Nitin - Original Message - From: Evan Nemerson [EMAIL PROTECTED] To: Nitin [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 4:44 PM Subject: Re: [PHP] Running system commands google for openssh or lsh. I dunno if you'd be able to input the password through PHP, but if not you could telnet over an SSH encrypted tunnel... Or if you have absolutely no worries about security you could use telnet, but that would be, IMHO, a Bad Idea(TM). On Tuesday 23 September 2003 02:06 am, Nitin wrote: Hi all, I was wondering, if anyone can help me with running system commands from within php. Actually I have a script which deletes users from my database (which is of course MySQL), now I want to delete those users from system level also, as they are authenticated users of my OS also. Now, the problem is, that I'm running my MySQL server and web server on different machines. I can do whatever on remote DB
Re: [PHP] 3 mins of your time please...logic problem
From: [EMAIL PROTECTED] A different approache for the captcha.. instead of using a blurred image use some text and than ask a question about the text like What does the 2nd word in the first line of the 4thparagraph say? Reading images can still be automated, it just takes a lot more time to write a program to do so. A simple paragraph with text would be easy (relatively speaking) for a program to decipher and automatically answer. That's why you make the image screwy... the letters are tilted, overlapping, wavy, colored, or complex backgrounds, etc. Even the best of those images can be read by computer programs, though, although very few people would be able to write that program. Read here: http://www.cs.berkeley.edu/~mori/gimpy/gimpy.html ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Am stuck
Good day all I have a txt file that has values from various strings written to it. What Im looking for is the following $name = Chris'; I need to do a count on $name so that it returns 5 letters. Then before writing it to the output file I know that it has to be 40 charecters long before it gets written. So I know its 5 now I need automatically add another 35 empty spaces to it to make it 40 so that it makes the $name like this $name = Chris; if I do a count on this it should be 40 charecters long Can anyone help out here??? Chris
RE: [PHP] Am stuck
Try Str_len and str_pad Regards Chris -Original Message- From: Chris Grigor [mailto:[EMAIL PROTECTED] Sent: 25 September 2003 13:10 To: php Subject: [PHP] Am stuck Good day all I have a txt file that has values from various strings written to it. What Im looking for is the following $name = Chris'; I need to do a count on $name so that it returns 5 letters. Then before writing it to the output file I know that it has to be 40 charecters long before it gets written. So I know its 5 now I need automatically add another 35 empty spaces to it to make it 40 so that it makes the $name like this $name = Chris; if I do a count on this it should be 40 charecters long Can anyone help out here??? Chris If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql.lock file location
Hi, Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. Thanks Donald
[PHP] cannot execute?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, can anyone tell me why following script does not resize image? It calls ImageMagick function mogrify to resize image. Webserver user does have access to shell, script and image are owned by webserver user. ? $file = DSCI0005.JPG; exec(mogrify -resize 164x131! $file); ? Thank you - -- kind regards - -- Martin Hudec - -- :@: [EMAIL PROTECTED] :w: http://www.corwin.sk :m: +421.907.303.393 - -- -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/cu2b1VPr1EE7sj4RAjiRAKCKgQDRmp6b7SjW3VnT5lMlBr2YFQCgkL2h FypoB1eyT/Xux1vs9u415ro= =OrXs -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cannot execute?
The path mogrify is in PATH for webserver user? Try exec(/path/to/mogrify ... Also, the webserver user have write (not only read) the file ? -Mensaje original- De: Martin Hudec [mailto:[EMAIL PROTECTED] Enviado el: jueves, 25 de septiembre de 2003 15:29 Para: PHP-General Asunto: [PHP] cannot execute? Importancia: Baja -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, can anyone tell me why following script does not resize image? It calls ImageMagick function mogrify to resize image. Webserver user does have access to shell, script and image are owned by webserver user. ? $file = DSCI0005.JPG; exec(mogrify -resize 164x131! $file); ? Thank you - -- kind regards - -- Martin Hudec - -- :@: [EMAIL PROTECTED] :w: http://www.corwin.sk :m: +421.907.303.393 - -- -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/cu2b1VPr1EE7sj4RAjiRAKCKgQDRmp6b7SjW3VnT5lMlBr2YFQCgkL2h FypoB1eyT/Xux1vs9u415ro= =OrXs -END PGP SIGNATURE- -- 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] mysql.lock file location
On Thursday 25 September 2003 21:17, Donald Tyler wrote: Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. manual MySQL 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 -- /* Oh, give me a home, Where the buffalo roam, And I'll show you a house with a really messy kitchen. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cannot execute?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 User does have all required permissions. Yeah the path was missing. Thank you very much :). On Thursday 25 September 2003 15:25, Javier Tacon wrote: The path mogrify is in PATH for webserver user? Try exec(/path/to/mogrify ... Also, the webserver user have write (not only read) the file ? - -- kind regards - -- Martin Hudec - -- :@: [EMAIL PROTECTED] :w: http://www.corwin.sk :m: +421.907.303.393 - -- -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/cu9m1VPr1EE7sj4RAq0KAKCEObIC49iqOIeYwK7CpnRO3TC43gCeMOJv lgcgpFWYX5kgl6vhWa2sxj0= =9K+p -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help! the Error_Reporting doesn't work
What do you mean it doesn't work? It doesn't display errors? How do you know that you have errors? Are you running your own script or someone else's? -Shawn Luckyeagle [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have set the PHP.INI as follow: error_reporting = E_ALL ~E_NOTICE display_errors = On display_startup_errors = Off log_errors = On log_errors_max_len = 1024 ignore_repeated_errors = Off ignore_repeated_source = Off report_memleaks = On track_errors = Off But it doesn't work How can i solve it? Thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cannot execute?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Anyway I can't understand why php does not return any message in this: $mess = blablabla; if (exec(mogrify blbalba)) { $hlaska .= xixixixix; } echo $hlaska; - -- kind regards - -- Martin Hudec - -- :@: [EMAIL PROTECTED] :w: http://www.corwin.sk :m: +421.907.303.393 - -- -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/cvDF1VPr1EE7sj4RAvHYAJ9n0c0OsivY7JPXyQlwnawKsIbMsgCePOU6 7h52E1LqpAoZy4fxerOR1W0= =rZ68 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Antwort: Re: [PHP] 3 mins of your time please...logic problem
I agree that an image captcha can not be cracked by a lot of people, allthough it has been done. (and it takes only one program being released to do the job : ) ) Somethings to keep in mind is that you should use passphrases made up of random letters and numbers preventing the automated system from guessing them. The text captcha is based on the idea that the question you ask has to be interpreted first. I admit my question was not the best example but it should give an idea. A (maybe) better example: The author Frank Example is 35 years old. He studies Law at Harvard. BTW he says Hi. , What does the author Frank say? In a real world app this would be contained in a much larger text block and the question and text would be changed on each attempt. If you have a wide enough base of such questions it becomes virtually impossible to guess the correct word leaving only a brute force attack. A text captcha is fairly easy to set up using mysql and php but if you have a image captcha generator go with it or better even combine the two, it all depends on the grade of security you need against automation. regards Stefan Langer
Re: [PHP] Netcraft
You can see what they see using telnet (which incidentally suggests you can use a PHP script that opens a socket connection on port 80 to get the information). The commands in telnet are as follows: telnet www.interjinn.com 80 HEAD / HTTP/1.0 enter That will give you the OS, web server, and any PHP information. The uptime I believe is determined by making these queries at various intervals. HTH, Rob. On Thu, 2003-09-25 at 02:00, John Nichel wrote: Does anyone know how Netcraft queries a webserver to get the info it does (OS, web server software, uptime, etc.)? -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] PHP Editor - which to use?
Hi, Thursday, September 25, 2003, 10:40:27 PM, you wrote: DM lmao .. good one. From: pete M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP Editor - which to use? Date: Thu, 25 Sep 2003 10:59:19 +0100 I write my code with pencil and paper and then scan it.. Dont need an editor ! John Nichel wrote: I know we've discussed this numerous times, but I'll chime in again (mainly because I'm bored). By far, I have been totally satisfied with UltraEdit. Lightweight, just about any language you want to edit, user configurable syntax highlighting (for those into that), handles UNIX / DOS / Mac files easily, etc, etc. And best of all, buy a liscense (cheap) and you're supporting a programmer, and not a company. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php DM _ DM Add photos to your e-mail with MSN 8. Get 2 months FREE*. DM http://join.msn.com/?page=features/featuredemail If I did it that way I would never run out of toilet paper I guess -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cannot execute?
I don't know, but this works for me: ?php $correct = ls -la; $wrong = 123ls -la; if(exec($correct)) print correct cmd: correct\n; else print correct cmd: wrong; if(exec($wrong)) print wrong cmd: correct\n; else print wrong cmd: wrong; ? Anyhow, you can parse the output, example: exec(ls -la, $outputLines); foreach($outputLines as $line) { print $line.br; } -Mensaje original- De: Martin Hudec [mailto:[EMAIL PROTECTED] Enviado el: jueves, 25 de septiembre de 2003 15:42 Para: Javier Tacon; PHP-General Asunto: Re: [PHP] cannot execute? Importancia: Baja -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Anyway I can't understand why php does not return any message in this: $mess = blablabla; if (exec(mogrify blbalba)) { $hlaska .= xixixixix; } echo $hlaska; - -- kind regards - -- Martin Hudec - -- :@: [EMAIL PROTECTED] :w: http://www.corwin.sk :m: +421.907.303.393 - -- -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/cvDF1VPr1EE7sj4RAvHYAJ9n0c0OsivY7JPXyQlwnawKsIbMsgCePOU6 7h52E1LqpAoZy4fxerOR1W0= =rZ68 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP PDF Support...
I have successfuly been creating PDF files... however it is required that the files are printed Automatically - i.e. no need to hit print icon etc etc... Anyone know how to achieve this or atleast point me in the right direction? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP PDF Support...
In the current issue of php|architect - an electronically distributed magazine, which you can find here http://www.phparch.com/ there is an article on printing with php. The magazine is not free, but is good value anyway. HTH Francesco Brian M McGarvie [EMAIL PROTECTED] ha scritto nel messaggio news:[EMAIL PROTECTED] I have successfuly been creating PDF files... however it is required that the files are printed Automatically - i.e. no need to hit print icon etc etc... Anyone know how to achieve this or atleast point me in the right direction? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP PDF Support...
[snip] In the current issue of php|architect - an electronically distributed magazine, which you can find here http://www.phparch.com/ there is an article on printing with php. The magazine is not free, but is good value anyway. [/snip] and props to John Holmes who so frequently provides solutions on this list...he is one of the regular columnists for php|architect. *sniff* I knew him when *sniff* :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fw: Am stuck
Sorry maybe I should elaborate ?php $name = Chris; $b = '5'; /* this is the value count of $name; */ for ($a=$b; $a=40; $a++) { add a space to the end of $name; /* this then makes $name 40 charecters long (but what function do I use to add on spaces?? */ } ? Good day all I have a txt file that has values from various strings written to it. What Im looking for is the following $name = Chris'; I need to do a count on $name so that it returns 5 letters. Then before writing it to the output file I know that it has to be 40 charecters long before it gets written. So I know its 5 now I need automatically add another 35 empty spaces to it to make it 40 so that it makes the $name like this $name = Chris; if I do a count on this it should be 40 charecters long Can anyone help out here??? Chris
FW: [PHP] mysql.sock file location
I meant mysql.sock, sorry. -Original Message- From: Donald Tyler [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 8:18 AM To: [EMAIL PROTECTED] Subject: [PHP] mysql.lock file location Hi, Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. Thanks Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Q on Class, inhertance, ec... (a bit long)
class FOO { function Fred() { echo Fred in FOO; } } class BAR { function Fred() { echo Fred in BAR; } } class BAZFactory { function BAZFactory() { } function getInstance( $type ) { if( $type == 1 ) { return new FOO(); } else if( $type == 2 ) { return new BAR(); } else { return null; } } } // Factory load cost. $factory = new BAZFactory(); $obj = $factory-getInstance( 1 ); // 1 level of indirection, if used often it more than pays // for the factory load cost. $obj-Fred(); Cheers, Rob. On Thu, 2003-09-25 at 04:25, jsWalter wrote: Martin Towell [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What about something like this? snip I've been playing with that same approach this evening. But I guess I was hoping for a more direct, 1 level of inderection instead of 2. But, by making a base method in the main class, and it knowing about the second level of indirection, that sort-of solves the issue. Thanks for your time and thoughts. It help clarify my thinking and approach, and just showed me that I wasn't to far off the path, as it were. Walter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
[snip] I meant mysql.sock, sorry. Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. [/snip] But MySQL is running? PHP AFAIK doesn't care where mysql.sock is, unless it is not the default. locate mysql.sock look in my.conf to see if the paths match if not, change the path in my.conf and restart mysql There is a PHP directive in the php.ini ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. mysql.default_socket = where you can specify the location of the sock if need be. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.lock file location
The MySQL functions only allow me to change the location per function call. I want to change the default mysql.sock file location for PHP, it would seem silly to change every script to do that, especially since this is only a test server and the main server will most likely have the mysql.sock file in another location. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 8:26 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] mysql.lock file location On Thursday 25 September 2003 21:17, Donald Tyler wrote: Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. manual MySQL 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 -- /* Oh, give me a home, Where the buffalo roam, And I'll show you a house with a really messy kitchen. */ -- 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] Re: reading files through ssl protocal
Hi, i have the same problem.. If you are using 4.3.2 or 4.3.3 version of php, go to http://ftp.proventum.net/pub/php/win32/misc/openssl/ and download files. There is php4ts.dll in c:\php and replace it with this. There should be worked.. Astron Chris Edwards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Trying to read a file via ssl. It seems to read the file ok. The content is correct. But I get this when using the https protocol. Warning: fgets(): SSL: fatal protocol error or Warning: fread(): SSL: fatal protocol error When I use regular http, I do not get the warning. Anyone observed this behaviour and fixed it? Thanks. -- Chris Edwards Web Application Developer Outer Banks Internet, Inc. 252-441-6698 [EMAIL PROTECTED] http://www.OuterBanksInternet.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
Thanks for the reply. I forgot about the php.ini file. That seemed to point me in the right direction. However, although PHP is now looking at the correct file. I still get the error message: Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /usr/local/apache2/htdocs/dbtest.php on line 3 Do you have any idea why it would not connect even though its looking at the correct file? Here is the line from the PHP.ini file after I edited it (incase I did something retarded) mysql.default.socket = /var/lib/mysql/mysql.sock -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 9:06 AM To: Donald Tyler; [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location [snip] I meant mysql.sock, sorry. Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. [/snip] But MySQL is running? PHP AFAIK doesn't care where mysql.sock is, unless it is not the default. locate mysql.sock look in my.conf to see if the paths match if not, change the path in my.conf and restart mysql There is a PHP directive in the php.ini ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. mysql.default_socket = where you can specify the location of the sock if need be. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
[snip] Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /usr/local/apache2/htdocs/dbtest.php on line 3 [/snip] Can we see your connection string? My bet would be permissions... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fw: Am stuck
On Thu, 25 Sep 2003 15:17:26 +0200 Chris Grigor [EMAIL PROTECTED] wrote: Sorry maybe I should elaborate ?php $name = Chris; $b = '5'; /* this is the value count of $name; */ for ($a=$b; $a=40; $a++) { add a space to the end of $name; /* this then makes $name 40 charecters long (but what function do I use to add on spaces?? */ } ? Good day all I have a txt file that has values from various strings written to it. What Im looking for is the following $name = Chris'; I need to do a count on $name so that it returns 5 letters. Then before writing it to the output file I know that it has to be 40 charecters long before it gets written. So I know its 5 now I need automatically add another 35 empty spaces to it to make it 40 so that it makes the $name like this $name = Chris; if I do a count on this it should be 40 charecters long Can anyone help out here??? Look up str_pad(). Chris Regards, Andu Novac -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql.lock file location
On Thursday 25 September 2003 22:07, Donald Tyler wrote: The MySQL functions only allow me to change the location per function call. I want to change the default mysql.sock file location for PHP, it would seem silly to change every script to do that, especially since this is only a test server and the main server will most likely have the mysql.sock file in another location. That section of the manual contains a useful little table which shows what MySQL related parameters can be changed and where it can be changed. -- 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 -- /* Facts are the enemy of truth. -- Don Quixote */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Am stuck
On Thu, 25 Sep 2003 15:09:31 +0200 Chris Grigor [EMAIL PROTECTED] wrote: Good day all I have a txt file that has values from various strings written to it. What Im looking for is the following $name = Chris'; I need to do a count on $name so that it returns 5 letters. Then before writing it to the output file I know that it has to be 40 charecters long before it gets written. So I know its 5 now I need automatically add another 35 empty spaces to it to make it 40 so that it makes the $name like this $name = Chris; if I do a count on this it should be 40 charecters long Can anyone help out here??? Chris I don't think you need to determine the length of $name. You just need to use str_pad(). -- Raquel People demand freedom of speech as a compensation for the freedom of thought which they seldom use. --Kierkegaard -- Raquel People demand freedom of speech as a compensation for the freedom of thought which they seldom use. --Kierkegaard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
Yeah I thought so to. But I did a chmod 755 on the sock file and it didn't help. Here's the test script I am using: (Presume that's what you meant by connection string? ?PHP if($Connection = mysql_connect('localhost', '**', '**')) print 'Success!'; else print 'Failure'; ? -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 9:44 AM To: Donald Tyler; [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location [snip] Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /usr/local/apache2/htdocs/dbtest.php on line 3 [/snip] Can we see your connection string? My bet would be permissions... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
ohohohohohoo or you can delete that and restart mysql and it will recreate. i have seen that before and that worked. From: Jay Blanchard [EMAIL PROTECTED] To: Donald Tyler [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location Date: Thu, 25 Sep 2003 09:43:33 -0500 [snip] Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /usr/local/apache2/htdocs/dbtest.php on line 3 [/snip] Can we see your connection string? My bet would be permissions... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Help STOP SPAM with the new MSN 8 and get 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
Re: [PHP] mysql.sock file location
Donald Tyler wrote: Yeah I thought so to. But I did a chmod 755 on the sock file and it didn't help. Here's the test script I am using: (Presume that's what you meant by connection string? ?PHP if($Connection = mysql_connect('localhost', '**', '**')) print 'Success!'; else print 'Failure'; ? Are you sure the MySQL server is running? Can you connect from the command line using the same credentials as above? - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
[snip] Here's the test script I am using: (Presume that's what you meant by connection string? ?PHP if($Connection = mysql_connect('localhost', '**', '**')) print 'Success!'; else print 'Failure'; ? [/snip] Let's get a hair more info, try if(!($Connection = mysql_connect('localhost', '**', '**'))){ print(mysql_error() . \n); exit(); } It also has the added benefit of shortening the code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
yes like the user and the password ** and ** arent working for me. ;) From: Jay Blanchard [EMAIL PROTECTED] To: Brad Pauly [EMAIL PROTECTED], Donald Tyler [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location Date: Thu, 25 Sep 2003 10:12:50 -0500 [snip] Here's the test script I am using: (Presume that's what you meant by connection string? ?PHP if($Connection = mysql_connect('localhost', '**', '**')) print 'Success!'; else print 'Failure'; ? [/snip] Let's get a hair more info, try if(!($Connection = mysql_connect('localhost', '**', '**'))){ print(mysql_error() . \n); exit(); } It also has the added benefit of shortening the code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Help STOP SPAM with the new MSN 8 and get 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
RE: [PHP] mysql.sock file location
[snip] yes like the user and the password ** and ** arent working for me. ;) [/snip] Not to head way off topic, well, OTOH, yes I am... Didier, is that pronounced did-i-A or did-i-er, or am I way off base. I knew someone with the first iteration. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Netcraft
Robert Cummings wrote: can use a PHP script that opens a socket connection on port 80 to get For these interactive things, Perl seems much more appropriate for me. Using libwww aka LWP for the web client (LWP::UserAgent or LWP::RobotUA) Using DBI for access to a DB to store/retreive results. I'm doing this to check if (tens of) webservers are up (with HEAD /) It's often best to rely on a lib to follow 301/302 http redirects automatically rather than doing it by hand. BTW dont rely on DNS timeout for any erroneous or non existant .com/.net domains, since Verisign now redirects everything in their DNS to their IP 64.94.110.11, soon flooding us with advertising things :-( telnet www.interjinn.com 80 That will give you the OS, web server, and any PHP information. But keep in mind that it's based on the Server: HTTP header: 1. Some webservers didnt send any Server: header 2. Some send short names (ex only Apache) 3. Some send fake names, for security reasons That method is not reliable, as you can see. Other methods exist to check OS (fingerprinting) etc. But it remain quite complex. (round-robin DNS, load balancing, caching servers, firewalls...) Christophe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Netcraft
--- Christophe Chisogne [EMAIL PROTECTED] wrote: Robert Cummings wrote: can use a PHP script that opens a socket connection on port 80 For these interactive things, Perl seems much more appropriate for me. Using libwww aka LWP for the web client (LWP::UserAgent or LWP::RobotUA) Using DBI for access to a DB to store/retreive results. 1. This is a PHP list. 2. Robert was simply passing on a suggestion for how someone can get an idea about where this information comes from. 3. I'll telnet, you start writing Perl, and let's race. :-) 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] Netcraft
On Thu, 2003-09-25 at 11:25, Christophe Chisogne wrote: That method is not reliable, as you can see. Other methods exist to check OS (fingerprinting) etc. But it remain quite complex. (round-robin DNS, load balancing, caching servers, firewalls...) Maybe not, but it's the method that Netcraft uses since I see the request in my server log :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
Yes, I ping it and it says its alive. -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:07 AM To: Donald Tyler Cc: [EMAIL PROTECTED] Subject: Re: [PHP] mysql.sock file location Donald Tyler wrote: Yeah I thought so to. But I did a chmod 755 on the sock file and it didn't help. Here's the test script I am using: (Presume that's what you meant by connection string? ?PHP if($Connection = mysql_connect('localhost', '**', '**')) print 'Success!'; else print 'Failure'; ? Are you sure the MySQL server is running? Can you connect from the command line using the same credentials as above? - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
d-d-a is the proper way to say it but I pretty much go by everything including 'Hey you!' From: Jay Blanchard [EMAIL PROTECTED] To: Didier McGillis [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location Date: Thu, 25 Sep 2003 10:16:45 -0500 [snip] yes like the user and the password ** and ** arent working for me. ;) [/snip] Not to head way off topic, well, OTOH, yes I am... Didier, is that pronounced did-i-A or did-i-er, or am I way off base. I knew someone with the first iteration. _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fopen
Hi I am writing to a file different sources. The one writes the date and the next starts writing data. The date writes fine. $header = 0$gpsdate; echo $out_file; $fp = fopen($out_file, a); $write = (fwrite($fp, $header\n)); fclose($fp); Now I get to another batch process that inserts data into the same file but it starts on the same line the first time round, then carrys on to the next line.. So I end with this 2003-09-25 data data data data anyone help out so I can get it to write like this 2003-09-25 data data data Thanks Chris
RE: [PHP] mysql.sock file location
I wasn't worried about short code =0P I would have done this if I was: $Connection = mysql_connect('localhost','**','**') or die(mysql_error()); =0P -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:13 AM To: Brad Pauly; Donald Tyler Cc: [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location [snip] Here's the test script I am using: (Presume that's what you meant by connection string? ?PHP if($Connection = mysql_connect('localhost', '**', '**')) print 'Success!'; else print 'Failure'; ? [/snip] Let's get a hair more info, try if(!($Connection = mysql_connect('localhost', '**', '**'))){ print(mysql_error() . \n); exit(); } It also has the added benefit of shortening the code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.lock file location
Yeah I do that too. But I was reluctant to do that with something that just seemed like a fix for a problem that shouldnt even exist. If the server with my scripts is configured correctly, then I should never have to specify a .sock file. I hope... -Original Message- From: Jackson Miller [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:15 AM To: Donald Tyler Subject: Re: [PHP] mysql.lock file location On Thursday 25 September 2003 8:55, you wrote: Is there no way for me to change the default location for PHP? I have quite a few scripts that I really dont want to have to do that to. I would rather reconfigure PHP. You can set default mysql settings in php.ini which allows you to set a socket file. Then you leave the default settings out of mysql_connect all together. I _think_ that you can then connect with mysql_connect(localhost,username,password) and it will use the socket file set in php.ini. If that doesn't work you can try editing the client section of /etc/my.cnf Also, I always set up my apps in a way that the db connection is only in one place and just called from all the scripts that need it. You can do this with an include or using object oriented coding. This way if you ever have to make a system wide change you don't have to go to all the scripts and change it. Hope that helps. -Jackson -Original Message- From: Jackson Miller [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 8:24 AM To: Donald Tyler Subject: Re: [PHP] mysql.lock file location On Thursday 25 September 2003 8:17, Donald Tyler wrote: Hi, Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. mysql_connect(:/path/to/mysql.lock,username,password); -Jackson Thanks Donald -- jackson miller cold feet creative 615.321.3300 / 800.595.4401 [EMAIL PROTECTED] cold feet presents Emma the world's easiest email marketing Learn more @ http://www.myemma.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
[snip] I wasn't worried about short code =0P I would have done this if I was: $Connection = mysql_connect('localhost','**','**') or die(mysql_error()); =0P [/snip] Cool, but do you get errors? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] for loop break and continue
Hi, Is there an equivalent to the C++ 'break' command to stop execution of a for loop? I know I can use 'goto' but I don't want to unless I have to. for ($i=0; $i$n; $i++) if (some condition) break; And, what about 'continue' which skips the rest of the code in the for loop and immediately goes on to the next iteration? Thanks, Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] for loop break and continue
Take the sample code below, paste it to a PHP file, add a real conditional, execute script. Voila, you've taken the first step towards helping yourself. Cheers, Rob. On Thu, 2003-09-25 at 11:42, Rich Fox wrote: Hi, Is there an equivalent to the C++ 'break' command to stop execution of a for loop? I know I can use 'goto' but I don't want to unless I have to. for ($i=0; $i$n; $i++) if (some condition) break; And, what about 'continue' which skips the rest of the code in the for loop and immediately goes on to the next iteration? Thanks, Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP QT/KDE
Does anyone know of any projects to bring QT/KDE GUI bindings to PHP? It would be VERY cool to have something like PyKDE for PHP. Especially once PHP5 is released and SQLite is part of the KDe interpreter. I know there is PHP-GTK, but it's development appears stale. -Jackson -- jackson miller cold feet creative 615.321.3300 / 800.595.4401 [EMAIL PROTECTED] cold feet presents Emma the world's easiest email marketing Learn more @ http://www.myemma.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
Argh! Wonderful. Now I have broken something else. I just restarted the machine and now MySQL won't start. I keep getting the error: 030925 10:30:10 mysqld started 030925 10:30:10 InnoDB: Operating system error number 13 in a file operation. InnoDB: See http://www.innodb.com/ibman.html for installation help. InnoDB: The error means mysqld does not have access right to InnoDB: the directory. InnoDB: File name ./ibdata1 InnoDB: Fire operation call: 'open'. InnoDB: Cannot continue operation 030925 10:30:10 mysqld ended I went and checked the entire /var/lib/mysql directory structure and everything (including ibdata1) is set to root:mysql 755 I am going to headbut the screen in a minute! -Original Message- From: Donald Tyler [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:32 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location Yes, I ping it and it says its alive. -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:07 AM To: Donald Tyler Cc: [EMAIL PROTECTED] Subject: Re: [PHP] mysql.sock file location Donald Tyler wrote: Yeah I thought so to. But I did a chmod 755 on the sock file and it didn't help. Here's the test script I am using: (Presume that's what you meant by connection string? ?PHP if($Connection = mysql_connect('localhost', '**', '**')) print 'Success!'; else print 'Failure'; ? Are you sure the MySQL server is running? Can you connect from the command line using the same credentials as above? - Brad -- 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] mysql.sock file location
Donald Tyler wrote: Yes, I ping it and it says its alive. I don't understand. What did you ping? How does that mean it is running? Getting a response from a ping does not mean MySQL is running. Did you try connecting with a MySQL client from the command line? Have you looked at the running processes to see if it exists there? - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fopen
Chris, Looks like all you need to do is insert a statement that writes an \n to the file, although what you have should work. Kind of puzzling now that I look at it. Try adding the \n to $header before using it in the fwrite statement. $header .= \n; $write = (fwrite($fp, $header)); fflush($fp); fclose($fp); Matt Chris Grigor wrote: Hi I am writing to a file different sources. The one writes the date and the next starts writing data. The date writes fine. $header = 0$gpsdate; echo $out_file; $fp = fopen($out_file, a); $write = (fwrite($fp, $header\n)); fclose($fp); Now I get to another batch process that inserts data into the same file but it starts on the same line the first time round, then carrys on to the next line.. So I end with this 2003-09-25 data data data data anyone help out so I can get it to write like this 2003-09-25 data data data Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Am stuck
Why dont you trim the string first to ensure that there are no empty spaces at the end and beginning of it http://ca3.php.net/manual/en/function.trim.php and then do your count. Chris -- SNIP -- Good day all I have a txt file that has values from various strings written to it. What Im looking for is the following $name = Chris'; I need to do a count on $name so that it returns 5 letters. Then before writing it to the output file I know that it has to be 40 charecters long before it gets written. So I know its 5 now I need automatically add another 35 empty spaces to it to make it 40 so that it makes the $name like this $name = Chris; if I do a count on this it should be 40 charecters long Can anyone help out here??? Chris -- SNIP -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] for loop break and continue
DOH! This is a new addition to PHP because it wasn't there before! Thanks for the slap. Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Take the sample code below, paste it to a PHP file, add a real conditional, execute script. Voila, you've taken the first step towards helping yourself. Cheers, Rob. On Thu, 2003-09-25 at 11:42, Rich Fox wrote: Hi, Is there an equivalent to the C++ 'break' command to stop execution of a for loop? I know I can use 'goto' but I don't want to unless I have to. for ($i=0; $i$n; $i++) if (some condition) break; And, what about 'continue' which skips the rest of the code in the for loop and immediately goes on to the next iteration? Thanks, Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] for loop break and continue
On Thu, 2003-09-25 at 12:04, Rich Fox wrote: DOH! This is a new addition to PHP because it wasn't there before! Thanks for the slap. PHP has supported break for as long as I can remember which goes back to about 1999 and PHP 3.something. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Netcraft
In the Unix world with PHP, you can do OS fingerprinting by calling a system tool such as nmap (option: -O), but this require root privileges, and is not always perceived as well-behaviour by sysadmins. Or you can do everything you want with PHP sockets. I guess Netcraft use OS fingerprinting tool like nmap above their 'HEAD /' http requests. And ok, I wont post Perl things anymore ;-) Christophe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
No not a network IP ping. A mysqladmin ping: Mysqladmin --user=root ping -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:53 AM To: Donald Tyler Cc: [EMAIL PROTECTED] Subject: Re: [PHP] mysql.sock file location Donald Tyler wrote: Yes, I ping it and it says its alive. I don't understand. What did you ping? How does that mean it is running? Getting a response from a ping does not mean MySQL is running. Did you try connecting with a MySQL client from the command line? Have you looked at the running processes to see if it exists there? - Brad -- 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] mysql.sock file location
Don't know yet, I've managed to stop mysql from loading now! (See my previous mail) -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:40 AM To: Donald Tyler; [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location [snip] I wasn't worried about short code =0P I would have done this if I was: $Connection = mysql_connect('localhost','**','**') or die(mysql_error()); =0P [/snip] Cool, but do you get errors? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] parsing of large csv file for insert into pgsql via PHP
we have a number of csv dumps that occasionally have to be used to update tables in a postgres database... normally this is done by uploading the file and whomever running a php based parser which opens the file into an array via file(), does a split() on the comma, then executes an insert or update to the database with the split array values. we have a new upload that involves a 143mb file, compared to previous upload sizes of 10k to 150k. Is there a more efficient way to handle this rather than having PHP load the entire file into an array (which would have to be in memory during the operation, correct?). Perhaps fopen and reading line by line, or would that be the same load? thanks Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] for loop break and continue
Can't you let me have a shred of programming self-respect? Rich (I should have cracked the book) Fox On Thu, 2003-09-25 at 12:04, Rich Fox wrote: DOH! This is a new addition to PHP because it wasn't there before! Thanks for the slap. PHP has supported break for as long as I can remember which goes back to about 1999 and PHP 3.something. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] for loop break and continue
[snip] Can't you let me have a shred of programming self-respect? Rich (I should have cracked the book) Fox [/snip] Nah, too easy! :) We all get bumped from time to time -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help understanding code...
I've just picked up a more advanced book on PHP and it has a lot of example code in it. I understand most of it but some things I'm seeing I don't understand. Like the following... code: $couponcode = (! empty($_REQUEST['couponcode'])) ? $_REQUEST['couponcode'] : NULL; I think this is saying: If the global variable couponcode is not empty, then the variable '$couponcode' is equal to $_REQUEST['couponcode'] otherwise it gets a NULL value. What's throwing me is the use of the ! and ? and : If What I suspect is correct, I've never seen an if-then statement like this. If it is a replacement for an IF-Then statement then it's much cleaner and I'd like to use it. another one is: code: IF (!strcmp($operator, '+')) { $result = $num1 + $num2 } I've looked up strcmp() and know it's used to compair two strings. The $operator variable in the script that this was taken from is set to either -, +, * or /. What I don't understand here is what the ! in front of strcmp() means. Can anyone break down the code for me and explain the parts? thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help understanding code...
! means not, for example $yes != $no Regarding the (xxx) ? x : x; Your assumption is correct I use it alot, but sometimes it's still better to use if/else statements On Thu, 2003-09-25 at 11:47, Jeff McKeon wrote: I've just picked up a more advanced book on PHP and it has a lot of example code in it. I understand most of it but some things I'm seeing I don't understand. Like the following... code: $couponcode = (! empty($_REQUEST['couponcode'])) ? $_REQUEST['couponcode'] : NULL; I think this is saying: If the global variable couponcode is not empty, then the variable '$couponcode' is equal to $_REQUEST['couponcode'] otherwise it gets a NULL value. What's throwing me is the use of the ! and ? and : If What I suspect is correct, I've never seen an if-then statement like this. If it is a replacement for an IF-Then statement then it's much cleaner and I'd like to use it. another one is: code: IF (!strcmp($operator, '+')) { $result = $num1 + $num2 } I've looked up strcmp() and know it's used to compair two strings. The $operator variable in the script that this was taken from is set to either -, +, * or /. What I don't understand here is what the ! in front of strcmp() means. Can anyone break down the code for me and explain the parts? thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help understanding code...
On Thu, 2003-09-25 at 12:47, Jeff McKeon wrote: I've just picked up a more advanced book on PHP and it has a lot of example code in it. I understand most of it but some things I'm seeing I don't understand. Like the following... code: $couponcode = (! empty($_REQUEST['couponcode'])) ? $_REQUEST['couponcode'] : NULL; I think this is saying: If the global variable couponcode is not empty, then the variable '$couponcode' is equal to $_REQUEST['couponcode'] otherwise it gets a NULL value. What's throwing me is the use of the ! and ? and : Ternary operator, if the first expression evaluates to true then it returns the result of the second expression, otherwise it returns the result of the third expression. The ! is part of the first expression. If What I suspect is correct, I've never seen an if-then statement like this. If it is a replacement for an IF-Then statement then it's much cleaner and I'd like to use it. another one is: code: IF (!strcmp($operator, '+')) { $result = $num1 + $num2 } I've looked up strcmp() and know it's used to compair two strings. The $operator variable in the script that this was taken from is set to either -, +, * or /. What I don't understand here is what the ! in front of strcmp() means. Can anyone break down the code for me and explain the parts? This is a short form for testing if the strings are equal. Rather than test if strcmp( x, y ) == 0 which requires a comparison, a single boolean operator is applied so that if 0 is returns the ! makes it true. This is generally a carry forward from C coding style, where I believe the ! style runs through the processor faster than the == style. HTH, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help understanding code...
Thanks for the reply. What about he use of '!' with the strcmp() command. As I understand it, strcmp compairs two strings and returns 0 if str1 is less than str2, returns 0 if they are equal and returns 0 if str1 is greater than str2. At least that's what the PHP online manual says. How does the '!' NOT switch work with this? Is it saying If str1 and str2 are not equal? Or is it saying If str1 and str2 are not compared? Thanks, Jeff -Original Message- From: Jonathan Villa [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 12:50 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Help understanding code... ! means not, for example $yes != $no Regarding the (xxx) ? x : x; Your assumption is correct I use it alot, but sometimes it's still better to use if/else statements On Thu, 2003-09-25 at 11:47, Jeff McKeon wrote: I've just picked up a more advanced book on PHP and it has a lot of example code in it. I understand most of it but some things I'm seeing I don't understand. Like the following... code: -- -- $couponcode = (! empty($_REQUEST['couponcode'])) ? $_REQUEST['couponcode'] : NULL; -- -- I think this is saying: If the global variable couponcode is not empty, then the variable '$couponcode' is equal to $_REQUEST['couponcode'] otherwise it gets a NULL value. What's throwing me is the use of the ! and ? and : If What I suspect is correct, I've never seen an if-then statement like this. If it is a replacement for an IF-Then statement then it's much cleaner and I'd like to use it. another one is: code: -- -- IF (!strcmp($operator, '+')) { $result = $num1 + $num2 } -- -- I've looked up strcmp() and know it's used to compair two strings. The $operator variable in the script that this was taken from is set to either -, +, * or /. What I don't understand here is what the ! in front of strcmp() means. Can anyone break down the code for me and explain the parts? thanks, Jeff -- 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] Help understanding code...
Your assumptions are correct. It's called a ternary operator and it is a substitution or the if-else statements. I try not to overuse it since I don't think it's as readable as the block if statement. But for things not assigning a value to a variable, I think it's better than the block statement since you're more interested in the variable declaration than the condition of it's value. On Thursday, September 25, 2003, at 12:47 PM, Jeff McKeon wrote: I've just picked up a more advanced book on PHP and it has a lot of example code in it. I understand most of it but some things I'm seeing I don't understand. Like the following... code: --- - $couponcode = (! empty($_REQUEST['couponcode'])) ? $_REQUEST['couponcode'] : NULL; --- - I think this is saying: If the global variable couponcode is not empty, then the variable '$couponcode' is equal to $_REQUEST['couponcode'] otherwise it gets a NULL value. What's throwing me is the use of the ! and ? and : If What I suspect is correct, I've never seen an if-then statement like this. If it is a replacement for an IF-Then statement then it's much cleaner and I'd like to use it. another one is: code: --- - IF (!strcmp($operator, '+')) { $result = $num1 + $num2 } --- - I've looked up strcmp() and know it's used to compair two strings. The $operator variable in the script that this was taken from is set to either -, +, * or /. What I don't understand here is what the ! in front of strcmp() means. Can anyone break down the code for me and explain the parts? thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] yp_match() from another domain and master ?
Hi, I haven't found very many referenced for using php with YP/NIS aside from the occasional question answered. (Google is your friend), however I can't seem to find anything related to my latest quirrel: I want to access nismap data from another nisdomain which resides on another host, much like you can do an ypxfr of an entire nismap, I would like to be able to do an yp_match() on that foreign data. I can't seem to find anything on the php website relating to this. I'm scared that this might not possible and that php only relies on the nisdata provided by the host machine's libraries in stead of having it's own yp implementation, however if somebody can tell me I'm wrong, I'd be a very happy man. btw, anybody willing to help me connect my php scripts to a sybase database ? I know absolutely nothing about sybase,but I've found out that a lot of people (again:google) are having the same or similar problems I have. Just drop me a line if you feel up to the challenge. Thanks! With regards, Stephan -- Stephan van Beerschoten [SVB21-RIPE] [EMAIL PROTECTED] PGP fingerprint: 4557 9761 B212 FB4C 778D 3529 C42A 2D27 To err is human, to forgive is Not Company Policy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with imagettfbbox() function
Hello, I installed PHP 4.3.3 with default values. When I moved my sites, who use imagettfbbox() function, I received message -Fatal error: Call to undefined function: imagettfbbox() - everytime when I called this. GD library is installed and Freetype library I installed by hand. Hovewer infophp() don't display freetype library (it seems like everything installs ok). Can you help me? Miroslav Puzder _ Plan your week with MSN Weather- http://www.msn.sk/weather/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Timezones and Daylight Savings Time
What if you set the server to use UTC and then used the clients local system setting to offset it for each client? So the server would have it's time at UTC and a client in the Eastern US would be at -4. You could then detect the web client timezone setting and adjust as needed? This is just a logic suggestion, I have no idea if it's possible with code but I would imagin it would be.. Jeff -Original Message- From: J J [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 12:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Timezones and Daylight Savings Time Got a client site in Thailand that is about 13 hours different from the Web Server time so with any date/time stamping I need to add the 13 hours. However, when it comes time for DST, I'd hate to have to code for that or remember to manually change the time stamping. Is there some kind of automated function that determines the time zone of one location to another and stamps the correct time -- with or without DST? I guess otherwise you'd have to do something like: if Oct 31st and April XX { time+12 } else { time+13 Obviously not the correct code but that's the idea. Am I off base here? Is there a simpler method or something I'm not thinking of? If the server was dedicated I would just fix the server time to be Thailand time, but it's a shared server and I can't do that. Thanks in advance! __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- 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] Really Simple
Hi Can someone look at this code for me For Some reason when I add any more: INPUT NAME = \postcode[]\ TYPE = \HIDDEN\ VALUE=\$postcode\ The form doesnt send!! What I want is to have two more hidden fields storing the data for country and contact thanks -Code--- html head titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 link rel=stylesheet href=ajr_oss_styles.css type=text/css /head body bgcolor=#CC text=#00 p class=page_headingCall-off/p pspan class=body_textSelect the recipients and add the quantities to each destination/spanbr ?php include (holding_inc.php); $sql=SELECT * FROM distribution WHERE userID = $userID; $mysql_result=mysql_query($sql,$connection); $num_rows=mysql_num_rows($mysql_result); if ($num_rows == 0){ echo Sorry no data; } else { #we have results # create table # next line removed temporarily while testing arrays #echo FORM METHOD=GET ACTION=\ajr_calloff_mail.php\ ; echo img src=\$image\BR; echo FORM METHOD=GET ACTION=\ajr_calloff_confirm.php\; echo Product ID B$productID/BBRBR; echo Title B$title/BBRBR; echo User ID B$userID/BBRBR; echo Stock Level B$stock_level/BBRBR; echo TABLE BORDER=\2\; echo TRTHDist ID/THTHcompany/THTHadd1/THTHadd2/THTHadd3/THTHtown/TH THcounty/THTHpostcode/THTHcountry/THTHcontact/THTHquantity /TH/TR; echo INPUT NAME = \var_total\ TYPE = \text\ VALUE=\$num_rows\; while ($row=mysql_fetch_array($mysql_result)) { $distID=$row[distID]; $company=$row[company]; $add1=$row[add1]; $add2=$row[add2]; $add3=$row[add3]; $town=$row[town]; $county=$row[county]; $postcode=$row[postcode]; $country=$row[country]; $contact=$row[contact]; echo TR TD $distID INPUT NAME = \distID[]\ TYPE = \HIDDEN\ VALUE=\$distID\/TD TD$company INPUT NAME = \company[]\ TYPE = \HIDDEN\ VALUE=\$company\/TD TD$add1 INPUT NAME = \add1[]\ TYPE = \HIDDEN\ VALUE=\$add1\/TD TD$add2 INPUT NAME = \add2[]\ TYPE = \HIDDEN\ VALUE=\$add2\/TD TD$add3 INPUT NAME = \add3[]\ TYPE = \HIDDEN\ VALUE=\$add3\/TD TD$town INPUT NAME = \town[]\ TYPE = \HIDDEN\ VALUE=\$town\/TD TD$county INPUT NAME = \county[]\ TYPE = \HIDDEN\ VALUE=\$county\/TD TD$postcode INPUT NAME = \postcode[]\ TYPE = \HIDDEN\ VALUE=\$postcode\/TD TD$country TD$contact/TD TD INPUT NAME = \quantity[]\ TYPE = \text\ VALUE=\0\ /TD /TR; } echo /TABLE; } #end else echo INPUT TYPE=SUBMIT VALUE=\Send\; echo /FORM; mysql_close($connection); ? /p pTo Do:br add facility for ad-hoc addresses/p pselect only those who have check boxes/p p add stock level calculation/p pform validation /p /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with imagettfbbox() function
On Friday 26 September 2003 01:02, Miroslav Puzder wrote: I installed PHP 4.3.3 with default values. When I moved my sites, who use imagettfbbox() function, I received message -Fatal error: Call to undefined function: imagettfbbox() - everytime when I called this. GD library is installed and Freetype library I installed by hand. Hovewer infophp() don't display freetype library (it seems like everything installs ok). Can you help me? Did you recompile php (and restart webserver) after installing the FreeType libs? -- 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 -- /* It is easier to make a saint out of a libertine than out of a prig. -- George Santayana */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] problem with imagettfbbox() function
[snip] I installed PHP 4.3.3 with default values. When I moved my sites, who use imagettfbbox() function, I received message -Fatal error: Call to undefined function: imagettfbbox() - everytime when I called this. GD library is installed and Freetype library I installed by hand. Hovewer infophp() don't display freetype library (it seems like everything installs ok). Can you help me? [/snip] When you say installed by hand, did you include the information in the configure for PHP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Timezones and Daylight Savings Time
They want everything set to their time, so it would probably be easier just to determine the server time and add as necessary. I think... --- Jeff McKeon [EMAIL PROTECTED] wrote: What if you set the server to use UTC and then used the clients local system setting to offset it for each client? So the server would have it's time at UTC and a client in the Eastern US would be at -4. You could then detect the web client timezone setting and adjust as needed? This is just a logic suggestion, I have no idea if it's possible with code but I would imagin it would be.. Jeff __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] POST Variable Empty
I am pulling my hair trying to figure this out. Maybe some of you can shed some light on the problem. I am uploading a file through a web connection using the $_FILE array. Works perfectly on small files. The code executes and it goes through the script like a champ. BUT ... When I try to upload a larger file it fails. I get no Errors from PHP. The only way I knew it wasn't working is because my script is set up to catch errors. I checked Some of the other POST values to see if they had any value in them. None of them did. I even did a print_r($_POST) and it printed a blank array. So just to be stupid I tried printing the $_GET variable and it only had the information I was passing in the URL, none of the form information from the previous page. I have tried different files and different names for the files. Still the POST variable is empty. But when I use a smaller file the process works perfectly. Any ideas or suggestions would be greatly appreciated. Jonathan Pitcher ** PHP INFO ** PHP Version 4.3.0 System FreeBSD 4.4-RELEASE FreeBSD 4.4-RELEASE #9: Thu Jan i386 Build Date Jan 10 2003 17:41:54 Configure Command './configure' '--with-apxs=/usr/local/apache/1.3.27/bin/apxs' '--with-config-file-path=/usr/local/lib' '--disable-debug' '--enable-memory-limit' '--enable-zend-multibyte' '--with-regex=system' '--enable-mbstring=all' '--enable-mbregex' '--enable-dio' '--enable-versioning' '--with-msql=shared' '--with-bz2=shared,/usr' '--enable-sockets=shared' '--with-pcre-regex=/usr/local' '--with-iconv=shared,/usr/local' '--with-gdbm=shared,/usr/local' '--with-db3=shared,/usr/local' '--with-gettext=shared,/usr/local' '--with-curl=shared,/usr/local/curl' '--with-openssl=shared,/usr' '--with-pgsql=shared,/usr/local/pgsql' '--with-openssl=/usr' '--with-gd=shared,yes' '--enable-gd-native-ttf=shared' '--with-freetype-dir=shared,/usr/local' '--with-ttf=shared,/usr/local' '--with-jpeg-dir=shared,/usr/local' '--with-png-dir=shared,/usr/local' '--with-t1lib=shared,/usr/local' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--enable-ftp=shared' '--with-imap=shared,/usr/local' '--with-mcrypt=shared,/usr/local' '--with-mhash=shared,/usr/local' '--with-dom=shared,/usr/local/libxml2' '--with-dom-xslt=shared,/usr/local' '--with-dom-exslt=shared,/usr/local' '--with-mysql=shared,/usr/local/mysql' '--with-zlib-dir=/usr' Server API Apache Virtual Directory Support disabled Configuration File (php.ini) Path /usr/local/lib/php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety disabled Registered PHP Streams php, http, ftp, https, ftps, compress.zlib, compress.bzip2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php