[PHP] no-cache headers
Hi, I am new to PHP and am having problems with no-cache headers, I have the following code added as the first line of code in the page... ? header(Expires: Mon, 01 Jan 1997 00:00:00 GMT); header(Cache-Control: no-store, no-cache, must-revalidate); header(Pragma: no-cache); ? A combination of no-cache headers usually does the trick, well in ColdFusion anyway :o), yet this code still shows the wrong images after an upload until a refresh of the browser is performed. Have I done something wrong or are headers not very reliable in PHP? TIA --- Phil Ewington - Technical Director --- 43 PLC 35 Broad Street, Wokingham Berkshire RG40 1AU --- T: +44 (0)118 978 9500 F: +44 (0)118 978 4994 W: http://www.43plc.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_fetch_array()
Hi All, I am new to PHP and am having a bit of trouble. I have a recordset using... $events = mysql_fetch_array($recordset); this drags in 3 columns from my table... event_id, event_title, event_date I want to search the recordset for a given date, if found I want to be able to reference event_id event_title from the row. I am using PHP 4.01. TIA Phil Ewington. --- P.S. If there are any ColdFusion developers on this list, what is the PHP equivalent of a structure? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_fetch_array()
Jason, This is for an events calendar, I want all the dates form the db but when I am generating the individual days for the calendar I need to know whether there is an event for that day, hence pulling out all the dates from the db. As I am looping through all the days in a month to dynamically create the calendar, I do not want to loop through the entire recordset to look for a date for that day in each iteration. Does your method find any row in the recordset with a given date? I am at present exploring the possibility of creating individual arrays for each row in the recordset using the date as the name of the array, then testing to see if it exists. That way I can check for the existence of a given date at any point in my code and reference the associated values without looping through the recordset each time. My code is as follows... while ($row = mysql_fetch_assoc($events)) { $a = date_ . $row[event_date]; $$a = array($row[event_id], $row[event_title]); } if ($date_2002-04-15) { do_something(); } Any comments will be greatfully received. Phil. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: 05 April 2002 11:31 To: [EMAIL PROTECTED] Subject: Re: [PHP] mysql_fetch_array() On Friday 05 April 2002 18:21, you wrote: Hi All, I am new to PHP and am having a bit of trouble. I have a recordset using... $events = mysql_fetch_array($recordset); this drags in 3 columns from my table... event_id, event_title, event_date I want to search the recordset for a given date, if found I want to be able to reference event_id event_title from the row. I am using PHP 4.01. Shouldn't you be doing your searching and selecting from within your mysql query? But if you insist on doing it in PHP then: if ($events['event_date'] == whatever) { do_something(); } -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* You will engage in a profitable business activity. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagecopyresized() problems
Hi, I am trying to copy and resize an image using imagecopyresized() and cannot seem to crack it. Below is the code I am using, can anyone tell me why I keep getting and invalid image resource warning and is this the src or dest parameter that the error is referring to? $srcImageName = ../properties/$line[propid].jpg; $destImageName = $rm_branchref . _ . $line[propid] . .jpg; $destImage = imagecreate(275, 183); imagecopyresized($destImage, $srcImageName, 0, 0, 0, 0, 275, 183, imagesx($srcImageName), imagesy($srcImageName)); imageJpeg($destImage, $destImageName, 75); imagedestroy($destImage); All that happens is that I get an identical copy of the image, and not a resized one. TIA Phil Ewington. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RegEx (back referencing)
Hi, I am am writing a function to color code and indent JavaScript source using regular expressions and cannot seem to get back referencing working. The pattern match is successful but the output is a single unrecognised character (a square). $string = eregi_replace((/?)(scr[^]*), «font color=maroon»\1«/font», $string); This results in opening and closing script/script tags being replaced with a square being wrapped in font tags. I have this working in Cold Fusion but cannot seem to convert my scripts to PHP. Can anyone help? TIA Phil Ewington. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RegEx (back referencing)
What's strange is that doing an ord($string) returns 171, which is a '1/2' char. So why does PHP convert the pattern match?? -Original Message- From: Phil Ewington [mailto:[EMAIL PROTECTED]] Sent: 03 August 2002 17:04 To: PHP General Subject: [PHP] RegEx (back referencing) Hi, I am am writing a function to color code and indent JavaScript source using regular expressions and cannot seem to get back referencing working. The pattern match is successful but the output is a single unrecognised character (a square). $string = eregi_replace((/?)(scr[^]*), «font color=maroon»\1«/font», $string); This results in opening and closing script/script tags being replaced with a square being wrapped in font tags. I have this working in Cold Fusion but cannot seem to convert my scripts to PHP. Can anyone help? TIA Phil Ewington. -- 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] RegEx (back referencing)
Danny, It still doesn't work, could this be a problem in 4.0.4pl1 ?? -Original Message- From: Danny Shepherd [mailto:[EMAIL PROTECTED]] Sent: 03 August 2002 18:11 To: [EMAIL PROTECTED]; PHP-General Subject: Re: [PHP] RegEx (back referencing) If you're trying to get scriptLots of javascript/script to look like font color=maroonLots of javascript/font then this will be a start $string = eregi_replace('(/?)(scr[^]*)', '\\1font color=maroon',$string); This will produce - font color=maroonLots of javascript/font color=maroon - not perfect, but a start. Danny. - Original Message - From: Phil Ewington [EMAIL PROTECTED] To: Danny Shepherd [EMAIL PROTECTED] Sent: Saturday, August 03, 2002 5:52 PM Subject: RE: [PHP] RegEx (back referencing) \\1 outputs nothing at all wrapped in font tags and closing tags \ wrapped in font tags :o( -Original Message- From: Danny Shepherd [mailto:[EMAIL PROTECTED]] Sent: 03 August 2002 17:47 To: [EMAIL PROTECTED]; PHP General Subject: Re: [PHP] RegEx (back referencing) try \\1 - Original Message - From: Phil Ewington [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Saturday, August 03, 2002 5:03 PM Subject: [PHP] RegEx (back referencing) Hi, I am am writing a function to color code and indent JavaScript source using regular expressions and cannot seem to get back referencing working. The pattern match is successful but the output is a single unrecognised character (a square). $string = eregi_replace((/?)(scr[^]*), «font color=maroon»\1«/font», $string); This results in opening and closing script/script tags being replaced with a square being wrapped in font tags. I have this working in Cold Fusion but cannot seem to convert my scripts to PHP. Can anyone help? TIA Phil Ewington. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Installing PHP 4 on a RAQ3
Hi, As I have only ever worked on a Windows platform, installing PHP MySQL on a RAQ3 is completely alien to me. I attempted to install the binaries by following instructions I dug up somewhere, and it all went badly wrong :o( I have since had the RAQ reset so I could start again. This time round I installed the RaQ3-RaQ4-MySQL-3.23.37-1.pkg from cobalt, this went on OK, but now I need to install PHP. As there is no .pkg for the RAQ3, I have been advised that I do need to install the binaries for PHP 4. Do I need to give a path for the --with mysql option, and if so where does the .pkg install MySQL? Any idiot proof step by step instructions will be greatly appreciated, along with which is the best/most stable version of PHP 4?, and where is best to install it? Thanks in advance, Phil. - Phil Ewington Cold Fusion Developer - T: 01344 643138 E: mailto:[EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Installing PHP 4 on a RAQ3
Followed those instructions and apache gives an error when I restart: Syntax error on line 33 of /etc/httpd/conf/httpd.conf: Cannot load /usr/lib/apache/libphp4.so into server: /usr/lib/apache/libphp4.so: cannot open shared object file: No such file or directory /usr/sbin/httpd I have looked in /usr/lib/apache/ and all that is there is libperl.so, where is it, and how can I find it? Help!!, Please :o) - Phil Ewington Cold Fusion Developer - T: 01344 643138 E: mailto:[EMAIL PROTECTED] - -Original Message- From: Philip Olson [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 25, 2001 6:50 PM To: Phil Ewington Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Installing PHP 4 on a RAQ3 Hello Phil, I've seen this come up a few times, search the archives for a bit: http://marc.theaimsgroup.com/?l=php-generals=raq The following comes up and may be useful. Don't hesitate to reply back on how helpful it is, perhaps eventually some raq instructions can make their way into installation section of manual. Try: HOWTO: Installation on Cobalt RaQ (RaQ3 or RaQ4) : http://marc.theaimsgroup.com/?l=php-generalm=98039640119670 Also, the manual's install instructions should be of some use: http://www.php.net/manual/en/install.unix.php regards, Philip Olson On Sun, 25 Nov 2001, Phil Ewington wrote: Hi, As I have only ever worked on a Windows platform, installing PHP MySQL on a RAQ3 is completely alien to me. I attempted to install the binaries by following instructions I dug up somewhere, and it all went badly wrong :o( I have since had the RAQ reset so I could start again. This time round I installed the RaQ3-RaQ4-MySQL-3.23.37-1.pkg from cobalt, this went on OK, but now I need to install PHP. As there is no .pkg for the RAQ3, I have been advised that I do need to install the binaries for PHP 4. Do I need to give a path for the --with mysql option, and if so where does the .pkg install MySQL? Any idiot proof step by step instructions will be greatly appreciated, along with which is the best/most stable version of PHP 4?, and where is best to install it? Thanks in advance, Phil. - Phil Ewington Cold Fusion Developer - T: 01344 643138 E: mailto:[EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] File Permissions
Hi All, I am having problems with file permissions. I am trying to use fopen() to write to a text file and get the error - 'permission denied'. I then used chmod(file.txt, 0755); and got the message that I was not the file owner, can someone help me out? PHP 3.0.9 Solaris 2.7/Apache 1.3.3 TIA Phil. BTW: I am completely new to PHP and Apache. Phil Ewington - Cold Fusion Developer T: 01344 643138 M: 07811 309116 E: mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Security
Hi, Can PHP run as a different user for different sites on the same server. The reason I ask is a client that has a PHP web site on our RAQ4 has had a PHP application written by someone else and wants us to upload it. Can PHP be configured to allow certain web sites access to files and directories within their web root only? TIA Phil Ewington Technical Director 43 PLC 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)118 978 9500 F: +44 (0)118 978 4994 E: [EMAIL PROTECTED] W: http://www.43plc.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Register Globals
Hi, I have just upgraded PHP to 4.2.3 and have found that register_globals defaults to 'off'. I have changed this setting in the php.ini file, yet phpinfo() still shows register_globals = 'off' and my scripts that rely on this setting are failing. The file I edited was /etc/httpd/php.ini, so why is register_globals still set to 'off'? TIA Phil Phil Ewington Technical Director 43 PLC 35 Broad Street, Wokingham Berkshire RG40 1AU Tel: +44 (0)118 978 9500 Fax: +44 (0)118 978 4994 http://www.43plc.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PECL JSON package
Hi All, I have just installed the PECL JSON package, or at least think I have!! But how do I use it?? I was expecting /usr/share/pear/Services/JSON.php to be found on my system for include but not so. My system tells me I have 1.2.1 successfully installed but I cannot find any docs that tell me how to make use of it. I am running PHP 5.1.6 at present. TIA Phil. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PECL JSON package
Phil Ewington - iModel wrote: Hi All, I have just installed the PECL JSON package, or at least think I have!! But how do I use it?? I was expecting /usr/share/pear/Services/JSON.php to be found on my system for include but not so. My system tells me I have 1.2.1 successfully installed but I cannot find any docs that tell me how to make use of it. I am running PHP 5.1.6 at present. TIA Phil. OK, seems I am confusing PECL and PEAR. Have now configured extension using phpize and enabled in php.ini. - Phil. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PECL JSON package
Eric Butera wrote: On Thu, Dec 11, 2008 at 5:43 AM, Phil Ewington - iModel phil.ewing...@i-model.co.uk wrote: Phil Ewington - iModel wrote: Hi All, I have just installed the PECL JSON package, or at least think I have!! But how do I use it?? I was expecting /usr/share/pear/Services/JSON.php to be found on my system for include but not so. My system tells me I have 1.2.1 successfully installed but I cannot find any docs that tell me how to make use of it. I am running PHP 5.1.6 at present. TIA Phil. OK, seems I am confusing PECL and PEAR. Have now configured extension using phpize and enabled in php.ini. - Phil. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you're using the pecl version, it is json_encode(). If you're using the pear version you say require_once 'Services/JSON.php'; $json = new Services_JSON(); $output = $json-encode($value); If you're using php5, you should have json in the build unless it was disabled for some reason. If you're going to be using it a lot, you're really going to want the speed of the c version. Yeah thanks. I am using the PECL version and have it compiled as an extension now working fine, just got confused with installing PEAR scripts. I have PHP 5.1.6, JSON only available in build from 5.2.0 I believe. - Phil. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_match_all question
Hi All, Having an issue with regular expressions, never been my strong point! The following pattern only picks up one instance per line, if more than one instance exists all text from first {{ to last }} is included, can anyone point out where I am going wrong? preg_match_all(/\{\{lang:(.*)\}\}/, $str, $tags); Here is an example of what needs to be processed ullispan{{lang:PA1Feature1}}/span/lilispan{{lang:PA1Feature2}}/span/li/ul ullispan{{lang:PA2Feature1}}/span/lilispan{{lang:PA2Feature2}}/span/li/ul TIA Phil. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_match_all question
Robert Cummings wrote: On Fri, 2009-01-16 at 09:42 +, Phil Ewington - iModel Ltd. wrote: Hi All, Having an issue with regular expressions, never been my strong point! The following pattern only picks up one instance per line, if more than one instance exists all text from first {{ to last }} is included, can anyone point out where I am going wrong? preg_match_all(/\{\{lang:(.*)\}\}/, $str, $tags); You need the ungreedy modifier: preg_match_all(/\{\{lang:(.*)\}\}/U, $str, $tags); Cheers, Rob. Rob you're a star, thanks mate. - Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reading/writing files outside of web root
Hi All, I am revisiting a previous question posted here as after lots of investigation and code testing I cannot get what I want. I want to use PHP to read/write files that are outside of the web root and not owned by apache. To be specific... $HOME/.procmailrc $HOME/.spamassassin/user_prefs .procmailrc must be owned by root.root and chmod'd to 600 or is does not work, user_prefs can be owned by anyone, it does not seem to care who or what the permissions are. The first problem is .procmailrc, someone on this list suggested to use chown/chmod in PHP to change the file so it can be read/written to by PHP, this I soon realized was not an option as the file owned by root cannot be changed. For some reason user_prefs will not open for read/write even when I tested it under apache.apache and chmod'd to 755, perhaps because /home is owned by root? So my question is can I easily/safely edit files outside of the web root using PHP or is there a 3rd party command line tool to do this? TIA --- Phil Ewington 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.6 - Release Date: 07/02/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reading/writing files outside of web root
Jason Wong wrote: On Wednesday 09 February 2005 02:31, Richard Lynch wrote: Phil Ewington - 43 Plc wrote: For some reason user_prefs will not open for read/write even when I tested it under apache.apache and chmod'd to 755, perhaps because /home is owned by root? Something went wrong with this test. You SHOULD have been able to read/write that file in PHP, assuming 'apache' is the user PHP runs as. Use http://php.net/phpinfo to confirm that it really *IS* 'apache' user that's running apache/php. It *will* fail if apache has no access to $HOME! I stand corrected. In addition to read/write access to the file itself, Apache must have at least eXecute (directory listing) permission to the directory containing that file. /home being owned by root is not the issue -- But if it's not something the apahce user can 'ls /home' and get the contents of, then you've got a problem. Thanks for all the input guys. The cron job suggestion is a great idea and I will go with this over using sudo. Thanks again. - Phil Ewington. -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] xslt_process() error
Hi Guys, I am trying to replicate a ColdFusion custom tag I wrote for transforming an XML doc with XSLT and having major problems. When I use xslt_process() I get the following error: Warning: Sablotron error on line 1: XML parser error 4: not well-formed (invalid token) in The XML XSL files all display correctly in browsers and it all works with CF, what can the problem be? I have read articles about a bug in the Sablotron libraries so the XSL file must not have any headers, this makes no difference. Can anyone help? Thanks in advance, --- Phil Ewington 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.2 - Release Date: 02/05/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FW: xslt_process() error
Hi All, I am trying to replicate a ColdFusion custom tag I wrote for transforming an XML doc with XSLT and having major problems. When I use xslt_process() I get the following error: Warning: Sablotron error on line 1: XML parser error 4: not well-formed (invalid token) in The XML XSL files all display correctly in browsers and it all works with CF, what can the problem be? I have read articles about a bug in the Sablotron libraries so the XSL file must not have any headers, this makes no difference. Can anyone help? Thanks in advance, --- Phil Ewington 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.3 - Release Date: 03/05/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsockopen()
Hi All, I am having problems with fsockopen() and wondered if anyone else has encountered this behaviour. My problem is that when connecting to an invalid domain I cannot trap the errors. I have tried setting a variable then testing the value, which prints a warning to the screen... $sck_handle = fsockopen($hostname, $port, $errno, $errstr, $timeout); if (!$sck_handle) { // socket could not be opened. $http_statuscode = Error: . $errno . - . $errstr; } else { ... } How can I get $errno $errstr, are these for read/write errors rather than socket initialisation? I need to know why the socket could not be opened so I can give an appropriate error message. TIA Phil Ewington - Technical Director -- 43 Plc 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)118 978 9500 F: +44 (0)118 978 4994 E: mailto:[EMAIL PROTECTED] W: http://www.43plc.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fsockopen()
Positive, I am deliberately using invalid domains to test how to catch errors when users misspell their domain. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: 30 September 2003 12:01 To: [EMAIL PROTECTED] Subject: Re: [PHP] fsockopen() On Tuesday 30 September 2003 18:46, Phil Ewington - 43 Plc wrote: I am having problems with fsockopen() and wondered if anyone else has encountered this behaviour. My problem is that when connecting to an invalid domain I cannot trap the errors. Have you checked that it is really an invalid domain and not simply been hijacked by Versign: http://www.techweb.com/tech/network/20030926_network -- 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 -- /* H. L. Mencken's Law: Those who can -- do. Those who can't -- teach. Martin's Extension: Those who cannot teach -- administrate. */ -- 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] fsockopen()
Sorry Jason, I did read the article but must have been away with the fairies for a moment. I was testing domains that are complete rubbish but they were all .com and .net so yes you were right and I am a complete fool ;o). Now getting an error message 'No such file or directory' when testing on another TLD, strange message for 'domain cannot be found', but hey life would be boring if everyone thought along the same lines :o) -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: 30 September 2003 15:51 To: [EMAIL PROTECTED] Subject: Re: [PHP] fsockopen() On Tuesday 30 September 2003 20:39, Phil Ewington - 43 Plc wrote: Positive, I am deliberately using invalid domains to test how to catch errors when users misspell their domain. Did you read that article (or are you aware of what it is about)? And what invalid domains have you tried? -- 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 -- /* Life is the childhood of our immortality. -- Goethe */ -- 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] ftp_connect() issues
Hi All, A script that has been running successfully for over 18 months has suddenly stopped working due to ftp_connect() failing. I have been assured that nothing has changed on the ftp server so now need to try and find out why this is happening. ftp_connect seems to only return true or false, no specific RFC error codes :o( Can anyone suggest where I can start looking for a resolution to this matter? Running PHP 4.2.3 on a Cobalt RAQ4. TIA Phil. Phil Ewington - Technical Director -- 43 Plc 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)118 978 9500 F: +44 (0)118 978 4994 E: mailto:[EMAIL PROTECTED] W: http://www.43plc.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp_connect() issues
I can still connect to the ftp server from my client machine using any number of FTP apps, I also created an ftp test tool, on the same server as I am currently having problems, that lets you enter an ftp host, username password to see if it can connect and login. I can login to other ftp servers just not the one I want to. Strangely I managed to get a connection to the suspect ftp server a couple of times then nothing again. Seems to be an intermittent problem, but it would be nice to know whether it was a connection that was being dropped by the remote server or whether there were network issues that stopped the request reaching the target server. Phil. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: 10 October 2003 17:51 To: [EMAIL PROTECTED] Subject: Re: [PHP] ftp_connect() issues On Saturday 11 October 2003 00:01, Phil Ewington - 43 Plc wrote: A script that has been running successfully for over 18 months has suddenly stopped working due to ftp_connect() failing. I have been assured that nothing has changed on the ftp server so now need to try and find out why this is happening. And have you verified that you can still connect to the ftp server via other means? And have you verified that the script can connect to other ftp servers? -- 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 more rational to sacrifice one life than six. -- Spock, The Galileo Seven, stardate 2822.3 */ -- 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] sorting multi-dimensional arrays
Hi All, I am trying to sort a multi-dimensional array using a value in the second dimension. I have looked at the usort examples but don't fully understand what usort is actually doing so am struggling. I have tried the following: if (! getmxrr($this-_Domain, $as_hosts, $ai_weights)) { return false; } for ($i = 0; $i count($as_hosts); $i++) { $this-MXRecs[] = array($as_hosts[$i], $ai_weights[$i]); } function IsBestMX($a, $b) { if ($a[1] == $b[1]) { return 0; } return ($a[1] $b[1]) ? -1 : 1; } usort($this-MXRecs); Can anyone point me in the right direction? TIA Phil. --- Phil Ewington - Technical Director 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sorting multi-dimensional arrays
Ooops, forgot to specify the compare function with usort(); all working now. Phil. -Original Message- From: Phil Ewington - 43 Plc [mailto:[EMAIL PROTECTED] Sent: 22 December 2003 14:08 To: [EMAIL PROTECTED] Subject: [PHP] sorting multi-dimensional arrays Hi All, I am trying to sort a multi-dimensional array using a value in the second dimension. I have looked at the usort examples but don't fully understand what usort is actually doing so am struggling. I have tried the following: if (! getmxrr($this-_Domain, $as_hosts, $ai_weights)) { return false; } for ($i = 0; $i count($as_hosts); $i++) { $this-MXRecs[] = array($as_hosts[$i], $ai_weights[$i]); } function IsBestMX($a, $b) { if ($a[1] == $b[1]) { return 0; } return ($a[1] $b[1]) ? -1 : 1; } usort($this-MXRecs); Can anyone point me in the right direction? TIA Phil. --- Phil Ewington - Technical Director 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.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] fsockopen() errors.
Hi All, Can anyone tell me the best way to avoid errors using fsockopen(). I have tried wrapping the function call in a conditional statement, and have also tried calling the function and then testing the return. Example 1: $sckHandle = fsockopen($server, 25, $errNo, $errString); if ($sckHandle) { code here... } Example 2: if ($sckHandle = fsockopen($server, 25, $errNo, $errString)) { code here... } both give this error on failing to connect to a given server: fsockopen(): unable to connect to mx3.hotmail.com:25 I was under the impression that example 2 would not trigger an error if fsockopen() failed. Any help will be greatly appreciated. Phil. --- Phil Ewington - Technical Director 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fsockopen() errors.
Hi Miguel, I am giving it a test at the moment, thanks. -- Phil. -Original Message- From: Miguel J. Jiménez [mailto:[EMAIL PROTECTED] Sent: 08 March 2004 12:29 To: Phil Ewington - 43 Plc Cc: PHP Subject: Re: [PHP] fsockopen() errors. Is it an error or a warning? If it is a warning you can try use @ before fsockopen() to avoid echoing warning messages [EMAIL PROTECTED](...)]. -- Miguel J. Jiménez ISOTROL, S.A. (Área de Internet) Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA) [EMAIL PROTECTED] TLFNO. 955036800 ext. 111 -- 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] fsockopen() errors.
Hmm, added @ to fsockopen() function, still happens, can anyone shed any light on this? TIA Phil. -Original Message- From: Phil Ewington - 43 Plc [mailto:[EMAIL PROTECTED] Sent: 08 March 2004 12:57 To: Miguel J. Jiménez Cc: PHP Subject: RE: [PHP] fsockopen() errors. Hi Miguel, I am giving it a test at the moment, thanks. -- Phil. -Original Message- From: Miguel J. Jiménez [mailto:[EMAIL PROTECTED] Sent: 08 March 2004 12:29 To: Phil Ewington - 43 Plc Cc: PHP Subject: Re: [PHP] fsockopen() errors. Is it an error or a warning? If it is a warning you can try use @ before fsockopen() to avoid echoing warning messages [EMAIL PROTECTED](...)]. -- Miguel J. Jiménez ISOTROL, S.A. (Área de Internet) Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA) [EMAIL PROTECTED] TLFNO. 955036800 ext. 111 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: fsockopen() errors.
Tom, Thought about that one or simply trying to catch the error in my site wide error handler, will give it a try, thanks. -- Phil. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 08 March 2004 15:53 To: PHP Subject: [PHP] Re: fsockopen() errors. On 8 Mar 2004 Phil Ewington - 43 Plc wrote: Can anyone tell me the best way to avoid errors using fsockopen(). I have tried wrapping the function call in a conditional statement, and have also tried calling the function and then testing the return. Here's an approach I have used to avoid any error messages at all -- presumably you could also set a flag in the error handler to indicate what happened, if you need that. . $olderr = error_reporting(0); set_error_handler(ignoreerrhandler); $fp = fsockopen(.) restore_error_handler(); error_reporting($olderr); if ($fp) { [worked] } else { [failed] } . function ignoreerrhandler($errno, $errstr, $errfile, $errline) { return; } -- Tom -- 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] fsockopen() throwing errors
Hi All, How can I stop fsockopen() throwing an error and killing my script when it cannot connect? I have tried the following: $this-_Socket = fsockopen($s_server, $this-_Port, $i_errno, $s_errstr, $this-_Timeout); if (!$this-_Socket) { ... code to handle connection failure } and ... if (!$this-_Socket = fsockopen($s_server, $this-_Port, $i_errno, $s_errstr, $this-_Timeout)) { ... code to handle connection failure } I have also tried prefixing fsockopen() with @ but when it fails to connect it kills my script by throwing an error. Any advise here will be much appreciated as this code is mission critical. TIA - Phil. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing args to a PHP script from the command line
Hi All, Can anyone tell me how to pass arguments to a PHP script from the command line? I know I need to use the -args option but how exactly, I have tried the following... /usr/bin/php myscript.php -args key=value but this does not work, the script executes but key is not available as $_GET[key] in my script. Any pointers will be much appreciated. TIA Phil. --- Phil Ewington - Technical Director 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing args to a PHP script from the command line
Phil Ewington - 43 Plc wrote on donderdag 10 juni 2004 12:58: Hi All, Can anyone tell me how to pass arguments to a PHP script from the command line? I know I need to use the -args option but how exactly, I have tried the following... /usr/bin/php myscript.php -args key=value You don't have to call the -args argument. just run the script from command line like this: php myscript.php value Where value is the argument you want to use in the script. These arguments are stored in an arrray ($argv). Do a print_r($argv) and you can see the content. OK, but if no param name is passed in, I assume that the order they are passed in as must be correct or the script will not know what values belong to which parameters? This seems a little odd, I assume that $argv only exists when accessed from the command line? My script needs to be excuted from both command line and from web browsers. but this does not work, the script executes but key is not available as $_GET[key] in my script. Any pointers will be much appreciated. TIA Phil. --- Phil Ewington - Technical Director 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing args to a PHP script from the command line
Phil Ewington - 43 Plc wrote on donderdag 10 juni 2004 14:27: Phil Ewington - 43 Plc wrote on donderdag 10 juni 2004 12:58: Hi All, Can anyone tell me how to pass arguments to a PHP script from the command line? I know I need to use the -args option but how exactly, I have tried the following... /usr/bin/php myscript.php -args key=value You don't have to call the -args argument. just run the script from command line like this: php myscript.php value Where value is the argument you want to use in the script. These arguments are stored in an arrray ($argv). Do a print_r($argv) and you can see the content. OK, but if no param name is passed in, I assume that the order they are passed in as must be correct or the script will not know what values belong to which parameters? This seems a little odd, I assume that $argv only exists when accessed from the command line? My script needs to be excuted from both command line and from web browsers. How do you mean the order must be correct. Use some code like this to give it an index value. for ($counter=0; $counter $argc; $counter++) { list($key, $value) = each($argv); echo (key . $key . has value : . $value . \n); } Your example was... php myscript.php value That is just a value, no parameter name as with a query string, take this example... php myscript.php a b Let's say that this was requested from a browser like myscript.php?1=a2=b PHP uses 1 2 to refer to the values, but the values would get mixed up if I was to use... $argv[0] $argv[1] and the order of a and b were different when the script was called. Does that make sense? I find it odd that I need to write more code to 1) check $_GET and 2) check $argv, also simple error checking will fail for command line stuff when checking that all the required params are present. From what i understand the argv argc are only avaliable when the script is run from commandline. Just do a check on this and if not there get some $_POST or $_GET variables. but this does not work, the script executes but key is not available as $_GET[key] in my script. Any pointers will be much appreciated. TIA Phil. --- Phil Ewington - Technical Director 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing args to a PHP script from the command line
Phil Ewington - 43 Plc wrote on donderdag 10 juni 2004 15:11: Phil Ewington - 43 Plc wrote on donderdag 10 juni 2004 14:27: Phil Ewington - 43 Plc wrote on donderdag 10 juni 2004 12:58: Hi All, Can anyone tell me how to pass arguments to a PHP script from the command line? I know I need to use the -args option but how exactly, I have tried the following... /usr/bin/php myscript.php -args key=value You don't have to call the -args argument. just run the script from command line like this: php myscript.php value Where value is the argument you want to use in the script. These arguments are stored in an arrray ($argv). Do a print_r($argv) and you can see the content. OK, but if no param name is passed in, I assume that the order they are passed in as must be correct or the script will not know what values belong to which parameters? This seems a little odd, I assume that $argv only exists when accessed from the command line? My script needs to be excuted from both command line and from web browsers. How do you mean the order must be correct. Use some code like this to give it an index value. for ($counter=0; $counter $argc; $counter++) { list($key, $value) = each($argv); echo (key . $key . has value : . $value . \n); } Your example was... php myscript.php value That is just a value, no parameter name as with a query string, take this example... php myscript.php a b Let's say that this was requested from a browser like myscript.php?1=a2=b PHP uses 1 2 to refer to the values, but the values would get mixed up if I was to use... $argv[0] $argv[1] and the order of a and b were different when the script was called. Does that make sense? I find it odd that I need to write more code to 1) check $_GET and 2) check $argv, also simple error checking will fail for command line stuff when checking that all the required params are present. ic now i understand what you mean :) Why not just pass the arguments on commandline like this: php myscript.php 1=a 2=b and then just split on '=' to get key value. That will do for me! Still more coding than I would like and not how I think it should be implemented, but hey we don't actually live in an ideal world do we ;o) Thanks for your help, it is much appreciated. - Phil. From what i understand the argv argc are only avaliable when the script is run from commandline. Just do a check on this and if not there get some $_POST or $_GET variables. but this does not work, the script executes but key is not available as $_GET[key] in my script. Any pointers will be much appreciated. TIA Phil. --- Phil Ewington - Technical Director 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Changing the directory that PHP runs from (CLI)
Hi All, I have read the manual page for 'Using PHP from the command line' thoroughly and cannot find the answer to my problem. I have a script that needs to be accessed from both the command line and from web browsers. I tested the script from the command line and all worked well. As soon as I set the script to run from the crontab, all my includes fail because of paths. I believe the manual tries to cover forcing PHP to run from an alternative location but makes no sense to me. Can anyone tell me what changes I need to make to the following crontab entry... 0 23 * * * /usr/bin/php /path/to/my/script.php arg1 arg2 arg3 /dev/null TIA - Phil. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Changing the directory that PHP runs from (CLI)
Justin, I think I will go for the ini_set() option, seems to be the best bet to not affect anything else. Thanks. - Phil. -Original Message- From: Justin Patrin [mailto:[EMAIL PROTECTED] Sent: 11 June 2004 15:42 To: [EMAIL PROTECTED] Subject: [PHP] Re: Changing the directory that PHP runs from (CLI) Phil Ewington - 43 Plc wrote: Hi All, I have read the manual page for 'Using PHP from the command line' thoroughly and cannot find the answer to my problem. I have a script that needs to be accessed from both the command line and from web browsers. I tested the script from the command line and all worked well. As soon as I set the script to run from the crontab, all my includes fail because of paths. I believe the manual tries to cover forcing PHP to run from an alternative location but makes no sense to me. Can anyone tell me what changes I need to make to the following crontab entry... 0 23 * * * /usr/bin/php /path/to/my/script.php arg1 arg2 arg3 /dev/null TIA - Phil. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 Well, you could put your includes in a central location and set the include_path correctly in your php.ini. If that won't work for you, you can use chdir(dirname(realpath(__FILE))) to change to the script's directory. You could also use ini_set to add whatever directory you need ot the script's include_path. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Scheduling a PHP script
Hi All, I have a PHP script that I need to call from both web browsers from a crontab but whichever route I choose I hit a problem. Here are the options I have tried along with problems encountered... PHP - /usr/bin/php /home/sites/home/web/schedules/index.php arg1 arg2 arg3 After resolving include path issues using ini_set() I get... Call to undefined function: mysql_connect(). I assume that all mysql functions are unavailable?? curl - /usr/bin/curl -u username:password http://www.domain.com/script.php?arg1=aarg2=barg3=c This gives me a PHP error... Undefined index: arg2 Only the first argument is available wget - /usr/bin/wget --http-user=username --http-passwd=password http://www.domain.com/script.php?arg1=aarg2=barg3=c This does not give an error but gives a message... `index.php?fuseaction=NewMembers.1' saved [557] Again it looks like query string is ignored. The database changes and email report that are supposed to occur on successful execution are unavailable! lynx - /usr/bin/lynx -dump -auth=username:password http://www.domain.com/script.php?arg1=aarg2=barg3=c This gives me a PHP error... Undefined index: arg2 Only the first argument is available again! Any ideas anyone? TIA - Phil. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.705 / Virus Database: 461 - Release Date: 12/06/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Scheduling a PHP script
On Mon, 14 Jun 2004 12:10:30 +0100 Phil Ewington - 43 Plc [EMAIL PROTECTED] wrote: PHP - /usr/bin/php /home/sites/home/web/schedules/index.php arg1 arg2 arg3 After resolving include path issues using ini_set() I get... Call to undefined function: mysql_connect(). I assume that all mysql functions are unavailable?? Is your commandline php executable compiled --with-mysql ? My PHP installation (4.3.6) was configured with: with-mysql=shared curl - /usr/bin/curl -u username:password http://www.domain.com/script.php?arg1=aarg2=barg3=c When issuing commands through bash (or alike) you need to surround the string with double-quotes (), because is a bash-operator, meaning put into background. With the command above you will execute /usr/bin/curl -u username:password http://www.domain.com/script.php?arg1=a; in the background, arg2=b in the background, and arg3=c in the foreground ;) That worked a treat! Thanks. The correct command is: /usr/bin/curl -u username:password http://www.domain.com/script.php?arg1=aarg2=barg3=c; This also applies to wget, lynx and all other commandline tools you can imagine ;-) -- Dennis Freise [EMAIL PROTECTED] GnuPG key: 2DE8 CCEF 6E20 11D4 3B27 21EC B0BA 1749 D2C8 38ED Available at: http://www.final-frontier.ath.cx/?key-plain --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.705 / Virus Database: 461 - Release Date: 12/06/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] WDDX functions not working!!
Hi All, I have been running 4.3.4 on a Cobalt RaQ 4 for some months and have been using the WDDX functions with great effect. I have recently moved all our sites to a new server (Linux RedHat ES 3 running PHP 4.3.6) and found that the WDDX functions do not work! No errors just nothing happens. I checked the phpinfo and it clearly shows that wddx is enabled (as I would expect with the --enable-wddx configure option). I have found this to be the case for 4.3.6, 4.3.8 4.3.9. What's going on?? $wddx_string = wddx_deserialize($wddx_packet); This should generate an array but does not! Has anyone else found this? What version does it work on? Installing PHP 5 is not an option at the moment as all our classes would need re-writing to conform to the new standards. TIA - Phil. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.769 / Virus Database: 516 - Release Date: 24/09/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Permissions
Hi All, I have a need for a PHP application to read/write Linux system files that have root.root ownership. At present reading not a problem but writing obviously is denied. I know there are probably some serious security issues here, but what should I be doing to allow this behaviour. I am running PHP 4.3.8 on Linux Redhat Fedora 1 installed as an Apache module. TIA --- Phil Ewington 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.797 / Virus Database: 541 - Release Date: 15/11/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Bespoke Email Solutions
Hi All, I have been using a Windows platform for generating and sending bespoke emails from .csv format lists but have had to swap to a Linux solution. We are using Postfix instead of Visnetic as our mail server but need a replacement for our email generation software (WorldMerge). Does anyone know of any PHP scripts that will generate emails from a database of email addresses and an HTML template with bespoke content I.E greetings, unsubscribe email address links, etc... and send to an SMTP server? TIA Phil Ewington. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.725 / Virus Database: 480 - Release Date: 19/07/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php