[PHP] Re: some data output formatting and grouping question...
Hi, if I got you right, you want to output each value for Y and then print out how often this value appears? If yes, you could try this: SELECT Y, COUNT(Y) AS NUMBER FROM TABLE GROUP BY Y HAVING U = 'me' Well, it's Monday morning and I don't know, if this will work, but I guess it does! ;-) Just try it out in phpmyadmin or so... Regards, Bastian Victor schrieb: I just have a fucking mental block; I cannot at all conceive the necessary syntax to or even the theoretical algorithm that I need, to do the following: Consider the following table: U | X | Y --|---|-- me|001|0a me|002|0a me|003|0a me|002|0b me|003|0b me|004|0b ..|...|.. then the code says: SELECT * FROM Y WHERE U = me So now what? - remember I do not know the value of Y, so it has to be an automatic thing; I can't just say ... WHERE U = me AND Y = a. I want this output: 0a 001 002 003 ___ (hr) 0b 002 003 004 How the hell do I do that? I can't think of the goddamn' syntax! __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Disable refresh?
At 02:41 02.12.2002, Martin Towell said: [snip] no, no way to disable and no variable to say a refresh happened one way to get around it is to submit to the page that does the update, then get that page to do a header(location...) to another page. When the user refreshes, they'll only refresh the last page, and not the updating page. [snip] This will not stop the user from hitting the Back button and refreshing the form... What I do (and it works flawlessly) is to have a serial number stored in the session data. This serial number, mirrored in form data as a hidden field, is incremented with each klick the script receives. Thus the code handling script input is able to determine if the form it just received is the last form it generated (serial number matches), or is outdated (serial number mismatches), for what reason ever, be it a refresh or the user stepping back and resubmitting. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] page auto reload after new window closed
Hi to all, Sorry for this kind of post but i cant find a better mailing list for javascript. I have a problem in refreshing my php page script. Im using javascript to open new window for editing purposes. But i want my opener opener page to auto reload upon submit in my new window. Any idea? thanks in advance Regards, mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] page auto reload after new window closed
At 09:21 02.12.2002, Michael P. Carel said: [snip] Sorry for this kind of post but i cant find a better mailing list for javascript. I have a problem in refreshing my php page script. Im using javascript to open new window for editing purposes. But i want my opener opener page to auto reload upon submit in my new window. [snip] Use JavaScript, for example. There is a window property called opener which is a handle to the window which opened the popup. Upon form submit, you could: script language=JavaScript function submitForm(form) { document.forms[form].submit(); window.opener.location.reload(); window.close(); return true; } /script ...within your form code... form name=myform method=post action=something ...your form contents... button value=Submit this onClick=submitForm(myform) /form -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Disable refresh?
you can use a session : - start the session when the form is first sent - destroy the session upon the first valid insert - subsequent upadates will be prevented since the session is destroyed.. usually multiple updates happens when the user hits the submit button several times or upon refreshing the page ... hence the session method should work fine good luck ! --- Larry Brown [EMAIL PROTECTED] wrote: Anyone know of a method of preventing a user from refreshing a page. I get multiple updates with the same information in my database... Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = +--+ |Wana Know what ISLAM is all about ? | +--+ visit : http://www.sultan.org/#int __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] last updated ?
Morgan Hughes wrote: Or use stat() to get the page's mtime, something like Good idea. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] header() and target page
--- John W. Holmes [EMAIL PROTECTED] wrote: I am just full of them this weekend. Is it possible to direct a header like a html link (i.e. target=_top) ? I have a page that is in a frame, and I want the new page that is called to break the frame and load in the entire frame. I do not see why not have the request initially opened in the parent frame since both a and form tags support the target propery... which will be set in this case to parent I hope this makes your life easier ! good luck ! = +--+ |Wana Know what ISLAM is all about ? | +--+ visit : http://www.sultan.org/#int __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] includes globals
Is it not set or is it empty? Try adding this code to menu function after global $LOCATION; if(!isset($LOCATION) die('$LOCATION is not set!'); Cesar Aracena wrote: Hi all, I'm making a site with a dynamic menu based on IF statements and DB queries, but have this little problem which I can't understand the reason. My programming method is based upon an application.php file which controls the hole site and paths, template files for the header footer and main PHP files which includes all the needed files that I mentioned before. As an example of this, the header TITLE tag has a ?=$TITLE? variable to take a different title for each page and after that, I put a $LOCATION variable to tell the menu() function which page is being displayed (different menus for products, about us, etc.) but the menu() function (fetched from a library) is not recognizing this $LOCATION variable. I'm declaring it as a GLOBAL inside the function, but nothing happens. Here's part of my code: This is part of my product's index.php file: SNIP ? require (../application.php); $TITLE = Joyería Mara; $LOCATION = ; include ($CFG-templatedir/header.inc); ? TR TD VALIGN=top P!--COMIENZO DE CUERPO--TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100% HEIGHT=100% TR TD VALIGN=top WIDTH=200 PTABLE BORDER=0 CELLSPACING=0 CELLPADDING=15 WIDTH=100% TR TD ? menu(); ? /SNIP === And this is the menu() function: SNIP function menu(){ GLOBAL $LOCATION; if ($LOCATION = productos){ GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK, $CFG; $MENU_NAME = Nosotros; $MENU_LINK = .$CFG-wwwroot./nosotros; $MENU_BACK = 66; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK; $MENU_NAME = Productos; $MENU_LINK = .$CFG-wwwroot./productos; $MENU_BACK = 99; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK; $MENU_NAME = Regístrese; $MENU_LINK = .$CFG-wwwroot./registrese; $MENU_BACK = 66; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); GLOBAL $MENU_NAME, $MENU_BACK, $MENU_LINK; $MENU_NAME = Contacto; $MENU_LINK = .$CFG-wwwroot./contacto; $MENU_BACK = 66; menu_def(); unset($GLOBALS['MENU_BACK'], $GLOBALS['MENU_NAME'], $GLOBALS['MENU_LINK']); } else if ($LOCATION = nosotros){ echo hi; } else{ echo none; } } /SNIP == Any thoughts? Thanks Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I run a command as root?
Hi I'm trying to find out how to run a command on the server as root. Does anybody know how to do this? Thanks Luke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] page auto reload after new window closed
This would prevent nonjavascript browsers from submiting the form. Better would be to use the page that comes after submiting: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleForm submited successfully/title meta http-equiv=Content-Type content=text/html link rel=stylesheet href=styles.css type=text/css /head body bgcolor=#FF text=#00 onLoad=window.opener.location.reload(); window.close() h3Form submited successfully/h3br input type=button value=Close onClick=window.close() /body /html Ernest E Vogelsinger wrote: At 09:21 02.12.2002, Michael P. Carel said: [snip] Sorry for this kind of post but i cant find a better mailing list for javascript. I have a problem in refreshing my php page script. Im using javascript to open new window for editing purposes. But i want my opener opener page to auto reload upon submit in my new window. [snip] Use JavaScript, for example. There is a window property called opener which is a handle to the window which opened the popup. Upon form submit, you could: script language=JavaScript function submitForm(form) { document.forms[form].submit(); window.opener.location.reload(); window.close(); return true; } /script ...within your form code... form name=myform method=post action=something ...your form contents... button value=Submit this onClick=submitForm(myform) /form -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I run a command as root?
Hi I'm trying to find out how to run a command on the server as root. Does anybody know how to do this? Thanks Luke
Re: [PHP] some data output formatting and grouping question...
you got the results, now loop it, and if you find Y is different from the previous one, print it: $previous=''; while($row=mysql_fetch_array($res) { if($row['Y']!=$previous) echo $row[Y]br; echo $row[X]br; } Victor wrote: I just have a fucking mental block; I cannot at all conceive the necessary syntax to or even the theoretical algorithm that I need, to do the following: Consider the following table: U | X | Y --|---|-- me|001|0a me|002|0a me|003|0a me|002|0b me|003|0b me|004|0b ..|...|.. then the code says: SELECT * FROM Y WHERE U = me So now what? - remember I do not know the value of Y, so it has to be an automatic thing; I can't just say ... WHERE U = me AND Y = a. I want this output: 0a 001 002 003 ___ (hr) 0b 002 003 004 How the hell do I do that? I can't think of the goddamn' syntax! __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I run a command as root?
On Monday 02 Dec 2002 10:47 am, Luke van Blerk wrote: Hi I'm trying to find out how to run a command on the server as root. Does anybody know how to do this? su root password: your_root_password then run your command This is a php list not a *nix list John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How do I run a command as root?
Hi Luke, I'm trying to find out how to run a command on the server as root. Does anybody know how to do this? How about using a combination of exec() and sudo (assuming you're in the sudoers file, that is)? Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I run a command as root?
As your server process run as nobody or apache, you need a wrapper setuid root program that will execute the command you want, but you must be very carefull so it is not exploitable. Luke van Blerk wrote: Hi I'm trying to find out how to run a command on the server as root. Does anybody know how to do this? Thanks Luke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I run a command as root?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 the commande run y PHP on the server are run as the user which apache is running as ...aka www or nobody in lot's of case ... so forget running a root commande ( infac for security reason ... it's not very good :/ ) Le Lundi 2 Décembre 2002 10:44, Luke van Blerk a écrit : Hi I'm trying to find out how to run a command on the server as root. Does anybody know how to do this? Thanks Luke - -- __ / Matthieu Le Corre | Service Informatique | | Inspection Academique de la Sarthe | 72000 LE MANS | | Tel : 02 43 61 58 91 | Mail : [EMAIL PROTECTED] \ -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE960k/iQG6YxCcev4RAp5PAKCCFTNSZt53WTikYRIJSpR/2Ra84ACfR/0K nrqZuoXNcuu1GWy99XVu7fs= =Y7GA -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Disable refresh?
Ernest E Vogelsinger wrote: This will not stop the user from hitting the Back button and refreshing the form... If the user wants it he can do it even with your method. My point is he don't do it unintentionally, so I use just the Location method -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Failed php module load
Hello all Im trying to load php 4.2.3 as a dynamic module into apache server 2.0.43 but am running into problems. Everytime i run the configtest or try and start the apache server i get the following error. Cannot load /usr/lib/apache/libphp4.so into server: /usr/lib/apache/libphp4.so: undefined symbol: ap_block_alarms I have spent some time trying to find a solution to this problem and have seen on the help pages of php.net that it is to do with the apache DSO sharing. I followed the suggestion and recompiled apache with the --enable-shared=max --enable-rule=SHARED_CORE but this still doesnt make any difference. Has anyone else out there seen this problem and maybe know how to fix it? Thanks for any help in advance!! __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Newbie Question
Hi all, I have a mySQL database called srchresult in a srchresult base. In it, i have 9 fields. Everything works perfectly. I would like to know how can i list in a HTML table 30 results for example but only with 7 columns (7 fields only) ? I 've tried some scripts but i can't work this out (i'm a newbie) Thanks a lot, Hacook -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie Question
Hi Hacook, I have a mySQL database called srchresult in a srchresult base. In it, i have 9 fields. Everything works perfectly. I would like to know how can i list in a HTML table 30 results for example but only with 7 columns (7 fields only) ? Try this: ?php // open the db connection - replace these with your own settings $db = mysql_connect([server], [username], [password]); // select the database - replace with your own mysql_select_db([database], $db); // get the query - add your own field names here $q = mysql_query(SELECT Field1, Field2, Field3 FROM srchresult LIMIT 30); // start the table echo table; // loop through the results while ($r = mysql_fetch_array($q)) { // echo a table row ? tr td?=$r[Field1]?/td td?=$r[Field2]?/td td?=$r[Field3]?/td /tr ?php // end of while() loop } // finish the table echo /table; ? It's untested - shout if it doesn't work. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to get/wait for user-input?
Hello! I'm using a PHP-script as a small console-app. Is the only way to give parameters to it the $QUERY_STRING, or can I wait for the user to input something (like scanf in C)? I couldn't find anything in the docs, so perhaps this is not possible?! Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to get/wait for user-input?
For console app you can use readline functions Martin Thoma wrote: Hello! I'm using a PHP-script as a small console-app. Is the only way to give parameters to it the $QUERY_STRING, or can I wait for the user to input something (like scanf in C)? I couldn't find anything in the docs, so perhaps this is not possible?! Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing arguments to the same script
what abou using action=questions instead of questions=1, then you can use array: $links=array('questions'=Questions link content will go here, 'samples'=Samples link content will go here, echo $links[$_GET['action']] this would be neater. Troy May wrote: Thanks for responding. I think I'm still doing something wrong. Take a peek: if(isset($_GET['questions'])) { echo Questions link content will go here; } elseif(isset($_GET['samples'])) { echo Samples link content will go here; } elseif(isset($_GET['rates'])) { echo Rates link content will be here; } elseif(isset($_GET['contact'])) { echo Contact information will go here.; } else { echo Main content goes here.; } The only thing that EVER gets displayed is the final else. (Main content goes here.) What am I doing wrong? Once again, the links are in this format: a href=index.php?samples Any ideas? -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 01, 2002 7:39 PM To: 'Troy May'; 'PHP List' Subject: RE: [PHP] Passing arguments to the same script I'm sure this is easy, but I'm drawing a blank. I need to have links at the bottom of the page that passes arguments to the same script (itself) when it gets reloaded. How do we do this? I have the links like this now: a href=index.php?samples How do I determine what is passed? I need to do an if statement with different outputs depending on the argument. if ($samples) { do something } if(isset($_GET['samples'])) { do something } ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and WebDAV
Hi All I am currently working on a simple document management system in PHP. Metadata and revision histories and other relevant data is stored in a PostgreSQL database. I would like to set up this system so that there is NO access to any documents through the filesystem (web folders etc.) Hence, the ideal situation is the following: (much simplified) The user is sent to an URL such as: http://www.blah.com/document.php?docid=9994112 This script document.php pushes the Word Document (or whatever type of document it may be) to the user's browser which in turn loads the relevant application. Now, normally when a user clicks Save it will attempt to save the file back to the Temporary Internet Files directory or something similar. I would like to make it possible for the user to simply be able to hit Save. The request is then sent back (a webdav request) to http://www.blah.com/document.php?docid=9994112 where this script can then retrieve the body of the file saved back to the web and then store it on the server file system as it pleases. That PHP script then updates the metadata in the PostgreSQL database. So basically what I want to use of WebDAV is its facility for saving back to the web. I'm not really interested in locking or versioning etc. Will PHP and WebDAV support what I am looking for here? If not, is there anything else that will? The key point is that I must give the users a transparent way of saving back to the web without them having any access to the documents through shares etc. Thanks in advance. --- Adam Whitehead Software Developer - CSM Technology Microsoft Certified Professional (MCP) Ph: (08) 89361 455 ** Mobile (0411) 241 120 E-mail: [EMAIL PROTECTED] www.csm.com.au This e-mail, including any attachments, is intended only for the use of the individual or entity named above and may contain information that is confidential and privileged. Any information contained in this e-mail is not to be used or disclosed for any purpose other than the purpose for which you received it. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. If you have received this e-mail by mistake, please delete this e-mail permanently from your system. WARNING: Although the company has taken reasonable precautions to ensure no viruses are present in this e-mail, the company can not accept responsibility for any loss or damage arising from the use of this e-mail or attachments. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cache caches anyway, regardless
i had this problem when my pages were cached when I wanted them to be refreshed, so I went deep in it and included all the recomended headers by the manual, and it worked fine.. I also tried on a clean version, by emptying up the browser cache and temp files on my client machine... until one page came from nowhere, an old old version! now my question is, where did that page come from? are these pages cached anywhere on the SERVER? I have an account on an APACHE server, and I dont know where to look for temporary files, if any get cached... Thank you for any help you can provide. [EMAIL PROTECTED] = Yours Elmota __ http://www.geocities.com/FashionAvenue/5774/index.html __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Who can tell me the best php-base webmail?
Thank you for reading my mail! -- Who can tell me the best php-base webmail? I want a webmail for my mail server, give me a suggest, please! -- Joskey Liaus [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cache caches anyway, regardless
on 02/12/02 10:49 PM, Elmota Abdul Ayyash ([EMAIL PROTECTED]) wrote: i had this problem when my pages were cached when I wanted them to be refreshed, so I went deep in it and included all the recomended headers by the manual, and it worked fine.. I also tried on a clean version, by emptying up the browser cache and temp files on my client machine... until one page came from nowhere, an old old version! now my question is, where did that page come from? are these pages cached anywhere on the SERVER? I have an account on an APACHE server, and I dont know where to look for temporary files, if any get cached... It could be any proxy server between the client and the server, plus any proxies ON the server... this would include the user's local machine, their local network, their ISP, and any ISP/server in between the client and the server (do a traceroute), althoguh in this case it sounds like you're talking about a LAN. I don't *think* Apache caches anything by itself. Of course changing the filename will ensure you aren't using a cached copy :) Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date problem
Thanks for this, I understand how to update in date in database, but I need when I get date from database to increase or decrease before to save in database. Can you help me for this ? John W. Holmes [EMAIL PROTECTED] wrote in message 001501c2999b$d24a71f0$7c02a8c0@coconut">news:001501c2999b$d24a71f0$7c02a8c0@coconut... I want to get date from database, to increment ot decrement it with some days, to show the date and after thath if user confirm it to save it to database. There are a ton of ways you can do it. You can select the date and it's inc/dec value in the same statement: SELECT datecol, datecol + INTERVAL 1 DAY FROM yourtable WHERE ... Display whatever you need, if the user agrees to the new day, then issue an update query: UPDATE yourtable SET datecol = datecol + INTERVAL 1 DAY WHERE ... To make those queries dynamic, you can replace the '1' with a variable and assign it's value in PHP to either -1, 1, 2, 3, etc... $inc = -1; UPDATE yourtable SET datecol = datecol + INTERVAL $inc DAY WHERE ... Or... You can select out the date you have now, use strtotime() to make it into a unix timestamp (which PHP works with), and date() to format it however you want. If the user approves the new date, you can reformat the unix timestamp back to a -MM-DD format with date() or use FROM_UNIXTIME() in your query to insert/update the new date into the database... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Who can tell me the best php-base webmail?
Hi Joskey, Who can tell me the best php-base webmail? IMP (http://www.horde.org/imp/) is pretty good, I use it for my webmail and don't have any complaints. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions not written to db on windows...
-Original Message- From: Gerard Samuel [mailto:[EMAIL PROTECTED]] Sent: 29 November 2002 20:45 To: php-gen Subject: [PHP] Sessions not written to db on windows... I have a bit of code that uses sessions and stores session data in the database. Works flawlessly on FreeBSD 4.7/mySQL/PostgreSQL running php 4.2.3. When trying to run my code on Windows 2k with MSSQL and mySQL, its not working. The windows box is running php 4.1.2 (its a dev box). If my memory serves me correctly, sessions is broke in PHP 4.1.2 on Windows -- try upgrading. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Failed php module load
-Original Message- From: bob pilly [mailto:[EMAIL PROTECTED]] Sent: 02 December 2002 11:24 Im trying to load php 4.2.3 as a dynamic module into apache server 2.0.43 but am running into problems. Everytime i run the configtest or try and start the apache server i get the following error. I think you have a fundamental version mismatch there -- AFAIR with Apache 2.0.43, you have to use a pre-production version of PHP 4.3, which at present probably means 4.3.0RC2 (unless they've slipped another one out whilst I wasn't looking!). Anyway, go have a look at http://snaps.php.net/ and see what's available. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 2 Dec 2002 13:33:15 -0000 Issue 1739
php-general Digest 2 Dec 2002 13:33:15 - Issue 1739 Topics (messages 126660 through 126712): Re: Disable refresh? 126660 by: Larry Brown 126661 by: Martin Towell 126663 by: Larry Brown 126683 by: Ernest E Vogelsinger 126686 by: phpnew_bocket 126698 by: Marek Kilimajer Re: [PHP-INST] OS X and Curl Issues 126662 by: Randall Perry Re: XTemplate 126664 by: Oleg Krogius Passing arguments to the same script 126665 by: Troy May 12 by: John W. Holmes 126667 by: Troy May 126668 by: Kyle Gibson 126669 by: Chris Wesley 126670 by: John W. Holmes 126671 by: Jonathan Sharp 126672 by: Jonathan Sharp 126673 by: Troy May 126674 by: Troy May 126704 by: Marek Kilimajer header() and target page 126675 by: Jami 126676 by: John W. Holmes 126688 by: phpnew_bocket Re: includes globals 126677 by: Cesar Aracena 126678 by: Tom Rogers 126689 by: Marek Kilimajer Why all the returned emails from this list? 126679 by: Troy May Dynamically Adding methods to an object 126680 by: Brian Takita some data output formatting and grouping question... 126681 by: Victor 126682 by: Bastian Vogt 126693 by: Marek Kilimajer page auto reload after new window closed 126684 by: Michael P. Carel 126685 by: Ernest E Vogelsinger 126691 by: Marek Kilimajer Re: last updated ? 126687 by: Chris Hewitt How do I run a command as root? 126690 by: Luke van Blerk 126692 by: Luke van Blerk 126694 by: John Wards 126695 by: Jon Haworth 126696 by: Marek Kilimajer 126697 by: Matthieu Le Corre Failed php module load 126699 by: bob pilly 126712 by: Ford, Mike [LSS] Newbie Question 126700 by: hacook 126701 by: Jon Haworth How to get/wait for user-input? 126702 by: Martin Thoma 126703 by: Marek Kilimajer PHP and WebDAV 126705 by: Adam.Whitehead.csm.com.au Cache caches anyway, regardless 126706 by: Elmota Abdul Ayyash 126708 by: Justin French Who can tell me the best php-base webmail? 126707 by: joskey.lianluo.com 126710 by: Jon Haworth Re: Date problem 126709 by: Rosen Re: Sessions not written to db on windows... 126711 by: Ford, Mike [LSS] Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- If not, is there a variable that provides information that a refresh occurred to load the page? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 01, 2002 8:23 PM To: PHP List Subject: [PHP] Disable refresh? Anyone know of a method of preventing a user from refreshing a page. I get multiple updates with the same information in my database... Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- no, no way to disable and no variable to say a refresh happened one way to get around it is to submit to the page that does the update, then get that page to do a header(location...) to another page. When the user refreshes, they'll only refresh the last page, and not the updating page. HTH Martin -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED]] Sent: Monday, December 02, 2002 12:33 PM To: PHP List Subject: RE: [PHP] Disable refresh? If not, is there a variable that provides information that a refresh occurred to load the page? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 01, 2002 8:23 PM To: PHP List Subject: [PHP] Disable refresh? Anyone know of a method of preventing a user from refreshing a page. I get multiple updates with the same information in my database... Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- 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 ---End Message--- ---BeginMessage--- Thanks guys this forum is going to get me in trouble. It is so convenient I keep asking questions too soon. After submitting the amendment to the original question I thought of the solution of setting a session variable and then clearing it before and after the submittal page. I'll work the gray matter a little harder next time before
[PHP] How to give parameters to a console php-script?
Hello! I start a console app with php myscript.php4 (just prints ok). How can I give parameters to it? I tried: php myscript.php4 myparameter php myscript.php4?myparameter php myscript.php4?param=myparameter But always php just returns without doing nothing (not even giving an error or printing Ok!) I'm using PHP 4.2.3. on Windows2000). Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to give parameters to a console php-script?
Hello Martin, I start a console app with php myscript.php4 (just prints ok). How can I give parameters to it? I tried: php myscript.php4 myparameter php myscript.php4?myparameter php myscript.php4?param=myparameter But always php just returns without doing nothing (not even giving an error or printing Ok!) I'm using PHP 4.2.3. on Windows2000). I'm using the same version/platform and things work fine (for me). Manual: Chapter 23. Using PHP from the command line You are correct the first time. What do argv and argc tell you? Is the php.ini file set up so that these variables are shown/valid? Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to give parameters to a console php-script?
Hi, What do argv and argc tell you? Is the php.ini file set up so that these variables are shown/valid? Undefined variable: argv - so I guess this is the problem ;-) What do I have to change in the php.ini? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to give parameters to a console php-script?
ll I found a register_argc_argv = On in my php.ini, which should work then. But I also found, that I have to use print Ok: .$_SERVER[argv][1]; instead of print Ok: .$argv[1]; Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to give parameters to a console php-script?
Martin, Ah yes, the famous 'read the upgrade notes - gotcha'! Well done, you figured it out... =dn ll I found a register_argc_argv = On in my php.ini, which should work then. But I also found, that I have to use print Ok: .$_SERVER[argv][1]; instead of print Ok: .$argv[1]; Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to give parameters to a console php-script?
Martin, Ah yes, the famous 'read the upgrade notes - gotcha'! Well done, you figured it out... =dn Thanx for your help, it pointed me in the right direction ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Who can tell me the best php-base webmail?
Le Lundi 2 D¨¦cembre 2002 13:30, [EMAIL PROTECTED] a ¨¦crit : Who can tell me the best php-base webmail? I want a webmail for my mail server, give me a suggest, please! Joskey Liaus [EMAIL PROTECTED] This is a hard question to answer ;-) I use SquirrelMail (http://www.squirrelmail.org/), Which is quite good... IlohaMaim (http://ilohamail.org/) Looks quite fine, too. Have you tried IMP ? -- ,, ( ¡ã Nicolas Costes /||\IUT de La Roche / Yon ( ^ ) [EMAIL PROTECTED] ^ ^http://luxregina.free.fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Check valid chars in string
function valid_chars($file_name) { for($i = 0; $i strlen($file_name); $i++) { if (!in_array($file_name[$i], array('q','w','e','r','t','y','u','i','o','p','l','k','j','h', 'g','f','d','s','a','z','x','c','v','b','n','m','Q','W', 'E','R','T','Y','U','I','O','P','L','K','J','H','G','F', 'D','S','A','Z','X','C','V','B','N','M','0','1','2','3', '4','5','6','7','8','9', '.', '_'))) { return false; } else { return true; } } Found this snippet of code on php.net (http://www.php.net/manual/sk/ref.strings.php), but it just reurns a parse error. OS: OS X 10.2 PHP: PHP 4.2.3 MYSQL: 3.23.51 // magnus n. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Check valid chars in string
It's missing a closing brace. I would, however, tend to drop that way of doing things and use a regex: function ValidChard($file_name) { if(preg_match(![^a-z0-9\-\.]!is, $file_name)) { return false; } return true; } Much easier on the eye, don't you think? :) James Magnus Nilsson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... function valid_chars($file_name) { for($i = 0; $i strlen($file_name); $i++) { if (!in_array($file_name[$i], array('q','w','e','r','t','y','u','i','o','p','l','k','j','h', 'g','f','d','s','a','z','x','c','v','b','n','m','Q','W', 'E','R','T','Y','U','I','O','P','L','K','J','H','G','F', 'D','S','A','Z','X','C','V','B','N','M','0','1','2','3', '4','5','6','7','8','9', '.', '_'))) { return false; } else { return true; } } Found this snippet of code on php.net (http://www.php.net/manual/sk/ref.strings.php), but it just reurns a parse error. OS: OS X 10.2 PHP: PHP 4.2.3 MYSQL: 3.23.51 // magnus n. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to give parameters to a console php-script?
Hi, I want to do the same under unix:- php myscript.php4 myparameter but the PHP CGI supplied by my ISP has register_argc_argv switched off. Is there any other way to access command line parameters when register_argc_argv is off? Thanks, Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and WebDAV
I don't know much about WebDAV, but sounds like that is not possible with PHP. You need something on the client side. I have used Groove (a collaboration software, They have a free demo as well - http://groove.net). It's not PHP based but when I open a shared document and switch back to groove I receive a popup window - 'Groove has deteceted changes to 'Document Name' Would you like to upload changes?' Something like that. So I guess maybe you could use some type of client side program that checks the document last modified on opening and then again when they switch back to the (both from the Temp files folder) web browser. olinux --- [EMAIL PROTECTED] wrote: Hi All I am currently working on a simple document management system in PHP. Metadata and revision histories and other relevant data is stored in a PostgreSQL database. I would like to set up this system so that there is NO access to any documents through the filesystem (web folders etc.) Hence, the ideal situation is the following: (much simplified) The user is sent to an URL such as: http://www.blah.com/document.php?docid=9994112 This script document.php pushes the Word Document (or whatever type of document it may be) to the user's browser which in turn loads the relevant application. Now, normally when a user clicks Save it will attempt to save the file back to the Temporary Internet Files directory or something similar. I would like to make it possible for the user to simply be able to hit Save. The request is then sent back (a webdav request) to http://www.blah.com/document.php?docid=9994112 where this script can then retrieve the body of the file saved back to the web and then store it on the server file system as it pleases. That PHP script then updates the metadata in the PostgreSQL database. So basically what I want to use of WebDAV is its facility for saving back to the web. I'm not really interested in locking or versioning etc. Will PHP and WebDAV support what I am looking for here? If not, is there anything else that will? The key point is that I must give the users a transparent way of saving back to the web without them having any access to the documents through shares etc. Thanks in advance. --- Adam Whitehead Software Developer - CSM Technology Microsoft Certified Professional (MCP) Ph: (08) 89361 455 ** Mobile (0411) 241 120 E-mail: [EMAIL PROTECTED] www.csm.com.au This e-mail, including any attachments, is intended only for the use of the individual or entity named above and may contain information that is confidential and privileged. Any information contained in this e-mail is not to be used or disclosed for any purpose other than the purpose for which you received it. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. If you have received this e-mail by mistake, please delete this e-mail permanently from your system. WARNING: Although the company has taken reasonable precautions to ensure no viruses are present in this e-mail, the company can not accept responsibility for any loss or damage arising from the use of this e-mail or attachments. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I include specific files?
I'm new to PHP, but from Lasso I'm used to the following sort of arrangement (in pseudo-code) Search for matching records If number found=1 include /folder/subfolder/file1 If number found1 include /folder/subfolder/file2 If number found=0 include /anotherfolder/subfolder/file99 where the included file contains the appropriate code for displaying a list, a detailed record etc. In fact the whole page is made up almost entirely from a succession of included files. The paths all hang from the root as with HTML (for example img src=/images-folder-at-root-level/image.gif). In PHP the include_path stops this process in its tracks. I'm with an ISP so I don't suppose I can control include_path (.:/usr/local/lib/php). Are there any other options? TIA Roddie Grant [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How do I include specific files?
Hi Roddie, The require or include functions will do this for you, see http://www.php.net/manual/en/function.include.php Paths are absolute to the file system, not where the web server path starts, eg suppose your file is at /usr/home/www/riddie/phpscripts/somedir/script.php you would include a file (into script.php) from the phpscripts directory using either require('/usr/home/www/riddie/phpscripts/myincfile.php') or require('../myincfile.php') but require('/phpscripts/myincfile.php') would not work as php does not work from paths set by the webserver. HTH, Kevin Roddie Grant [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm new to PHP, but from Lasso I'm used to the following sort of arrangement (in pseudo-code) Search for matching records If number found=1 include /folder/subfolder/file1 If number found1 include /folder/subfolder/file2 If number found=0 include /anotherfolder/subfolder/file99 where the included file contains the appropriate code for displaying a list, a detailed record etc. In fact the whole page is made up almost entirely from a succession of included files. The paths all hang from the root as with HTML (for example img src=/images-folder-at-root-level/image.gif). In PHP the include_path stops this process in its tracks. I'm with an ISP so I don't suppose I can control include_path (.:/usr/local/lib/php). Are there any other options? TIA Roddie Grant [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem uploading files other than text/plain ones
Hello guys I'm trying to do a simple task: upload files. However, when I try to upload files other than text/plain ones I get an empty $_FILES array. Is there anything I've got to modify in my php.ini file? I'm just following the expample in the php manual, the only thing different is that I process the upload task with a function: function upload_file($_POST, $_FILES) { //The same code as in the php manual return true; //If everything went ok } if (upload_file($_POST, $_FILES)) echo The file has been uploaded; else echo Sorry, try again; It works fine with text/plain files, so, am I overlooking anything here? Thanks a lot *** Wilmar Pérez Network Administrator Library System Tel: ++57(4)2105962 University of Antioquia Medellín - Colombia 2002 *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem uploading files other than text/plain ones
You know about the php.ini option upload_max_filesize? Perhaps its default value is not enough for your task? Greeting from Keith Aachen, Germany -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I include specific files?
On Monday 02 December 2002 23:57, Roddie Grant wrote: In PHP the include_path stops this process in its tracks. I'm with an ISP so I don't suppose I can control include_path (.:/usr/local/lib/php). Are there any other options? You can set the include_path at run-time using: ini_set(include_path, /new/path); -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Pardon me while I laugh. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Triggering a PHP Script
My Problem: I've got a PHP script (running on Apache) that can take several hours to complete. The script sends out a newsletter to those who have requested it. When calling this script from a web browser, the browser hangs until the script has fully executed. If the user hits Stop while the script is running, it will terminate the script. My Questions: What is the best way to trigger this script? Is there a way to do it without using a CGI script? I am basically wondering if there is a way to create a trigger this php page script that will run the script on Apache and not hang the browser. Also, are there any problems calling MySQL from a PHP CGI script? Thanks, Ryan Bates -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Who can tell me the best php-base webmail?
We use SquirrelMail (http://www.squirrelmail.org). I've customized the front-end and it's a breeze. I can't give you first-hand testimony on administration, but our administrator likes it. Users have no compliants. We use it with Postfix. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re: ini_set() / Jason Wong / dynamically setting this?
Hi everyone: I just read the reply from Jason Wong pretty much just about my question. Using the ini_set() command at the top of all my pages I think would work out ok, but when I upload my pages to the server, how can I dynamically set the include path to match the root of my web folder on the shared server? I am working on a website, and I have a shared hosting account on a win2k machine. When I upload from my local machine to the shared hosting machine I have to change a variable on each of my pages that gives me the proper path to including the necessary files to execute the page properly. If I don't I get an error. I've included a link to the error message below. As an aside, I picked up this piece of software that lets me grab HTML or other content from web pages and puts it into its own window and gives me a link to it. I am finding it way handy for sharing these errors that I get with other people. They just click the link to view the error, rather then getting a ton of debug code in an email message. I highly recommend trying it out, makes my life a lot easier. http://www.amplifytheweb.com/amplify/?13B53210-FD7A-4DDA-999E-993D243F4 BB4 http://www.amplifytheweb.com/amplify/?13B53210-FD7A-4DDA-999E-993D243F4B B4 So my question is, Is there a way to make a custom PHP.INI sort of thing that works only for my site, that I can include in my pages so I don't have to keep changing the dang path every time I want to do an upload? I'm sure someone must have a solution to this. Thanks, Matt
Re: [PHP] Test links?
Beth, When fopen successfully opens a file it populates an array $http_response_header, which you can examine to see if the link works or not - I don't believe you can actually get the file itself, but since that's not what we're after that's not a problem! I noticed this reference to $http_response_header and straightaway quizzed the manual, only to find that the only references to it (eg file open) lead nowhere. Have gone through a few other pages, looking to see if I might happen upon some detail, but failed. Sadly you don't refer to it in the code snippet provided (below). Any code I've attempted blindly has failed/reported errors. Please point me in the right direction (otherwise I guess it'll be time to download the new v4.3.0-RC and risk the bleeding edge - which according to the manual does something different anyway...) =dn Having said that, fopen produces a very annoying error if it doesn't find the page, but I found the following works: ?php $SQL = SELECT linkurl, linkID FROM links; $result = mysql_query($SQL); while($linkdata = mysql_fetch_array($result)){ $fp = fopen($linkdata['linkurl'],r); if($fp) { echo p.$linkdata['linkurl']. is still valid./p; }else{ echo p.$linkdata['linkurl']. is invalid. Updating database... ; $SQL = UPDATE links SET status = 0 WHERE linkID = '.$linkdata['linkID'].'; $result2 = mysql_query($SQL); if($result2) { echo Database updated/p; } } } ? Rather than deleting the link, it's probably better to set a flag to show it was invalid last time you checked, but check it again next time. Or you could keep a count of the number of failed attempts, and delete if it goes beyond 3 or so. Not sure how to supress the warning message that PHP automatically does when you haven't got a valid URL though. Hope this works for you! Beth Gore -- http://bethanoia.dyndns.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How do I run a command as root?
Thanks for all the replys. I'll be checking out sudo. p.s I forgot to put 'in a script' Luke Van Blerk [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi I'm trying to find out how to run a command on the server as root. Does anybody know how to do this? Thanks Luke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_match()
Hello I have one coloumn with lots of e-mail adress like this: [EMAIL PROTECTED];[EMAIL PROTECTED];[EMAIL PROTECTED] [EMAIL PROTECTED];[EMAIL PROTECTED];[EMAIL PROTECTED] [EMAIL PROTECTED] And i want to take the first row and put the adresses into an array, then the second row... I try like this, but i don't know what i can write in preg_match() to only get the email adress. while(odbc_fetch_row($ret)){ $Epost = odbc_result($ret,Epost); preg_match_all( '/?/', $Epost, $result); foreach ($result[0] as $loop_result) sturle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Test links?
Rob/Beth, The code should also consider: 1 updating the db if the link is 'valid', ie if previously it had been 'down'! 2 putting an @ to prevent any errors causing a hard-stop at the fopen line 3 that the url/database must contain protocol information, ie http://www.nytimes.com not www.nytimes.com. Thanks for the discussion, =dn Rob Packer wrote: Okay, I'm confused... file, fopen, and fsockopen seem to say not found on alot valid URLs... does this look to be correct usage? $url = $row[0]; // just get the url from the db $fp = implode ('', file ($url)); if (!$fp) {echo font color=redbUnable to access file/b/font; } else { fclose($fp); echo The link is working!; } It seems I always get this warning... Warning: Supplied argument is not a valid File-Handle resource in /web/home/nrc.net/www/robert/links4.php on line 11 If someone can tell me what I'm doing wrong, I'd appreciate it. Thanks, Robert When fopen successfully opens a file it populates an array $http_response_header, which you can examine to see if the link works or not - I don't believe you can actually get the file itself, but since that's not what we're after that's not a problem! Having said that, fopen produces a very annoying error if it doesn't find the page, but I found the following works: ?php $SQL = SELECT linkurl, linkID FROM links; $result = mysql_query($SQL); while($linkdata = mysql_fetch_array($result)){ $fp = fopen($linkdata['linkurl'],r); if($fp) { echo p.$linkdata['linkurl']. is still valid./p; }else{ echo p.$linkdata['linkurl']. is invalid. Updating database... ; $SQL = UPDATE links SET status = 0 WHERE linkID = '.$linkdata['linkID'].'; $result2 = mysql_query($SQL); if($result2) { echo Database updated/p; } } } ? Rather than deleting the link, it's probably better to set a flag to show it was invalid last time you checked, but check it again next time. Or you could keep a count of the number of failed attempts, and delete if it goes beyond 3 or so. Not sure how to supress the warning message that PHP automatically does when you haven't got a valid URL though. Hope this works for you! Beth Gore -- http://bethanoia.dyndns.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Triggering a PHP Script
Ryan, My Problem: I've got a PHP script (running on Apache) that can take several hours to complete. The script sends out a newsletter to those who have requested it. When calling this script from a web browser, the browser hangs until the script has fully executed. If the user hits Stop while the script is running, it will terminate the script. My Questions: What is the best way to trigger this script? Is there a way to do it without using a CGI script? I am basically wondering if there is a way to create a trigger this php page script that will run the script on Apache and not hang the browser. Also, are there any problems calling MySQL from a PHP CGI script? First: trust that you are only sending to opted-in clients!? (we're kind of sensitive about spammers around here!) The manual is your friend: Chapter 23. Using PHP from the command line. Add code to prevent PHP from timing-out (see another current thread) and that takes care of your program. It will now run, outside the browser, in the background, and you/your user can carry on using the browser... As far as trigger goes, you can type the command into the command line, or run some sort of 'job', or set it up to run off a scheduler, eg CRON or AT/Scheduled Tasks. Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] phpAds Sillyness
A fresh install of phpAds is resulting in a funky error, everytime you go to add a client or a ad, it prompts you to log in again. Now quoting from thier FAQ: Q: The login doesn't work, it keeps prompting for username/password all over again.or I can't add banners. A: Make sure you have enabled magic_quotes_gpc in your PHP configuration. I doubled checked, magic_quotes_gpc IS on for that dir. Any thoughts? Matt TrollBoy Wiseman Webmaster: Shoggoth.net Site Designer: phpslash.org The oldest and strongest emotion of mankind is fear, and the oldest and strongest kind of fear is fear of the unknown. -H.P. Lovecraft - Please do not resell my e-mail address to anyone or send me unsolicited e-mail - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpAds Sillyness
At 19:01 02.12.2002, Matt \TrollBoy\ Wiseman spoke out and said: [snip] A fresh install of phpAds is resulting in a funky error, everytime you go to add a client or a ad, it prompts you to log in again. Now quoting from thier FAQ: Q: The login doesn't work, it keeps prompting for username/password all over again.or I can't add banners. A: Make sure you have enabled magic_quotes_gpc in your PHP configuration. [snip] A2: enable register_globals in your php.ini, and try again. If it works then, shoot them. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpAds Sillyness
A2: enable register_globals in your php.ini, and try again. If it works then, shoot them. It was on; register_globals On On magic_quotes_gpc On On Any other suggestions? Matt TrollBoy Wiseman Webmaster: Shoggoth.net Site Designer: phpslash.org The oldest and strongest emotion of mankind is fear, and the oldest and strongest kind of fear is fear of the unknown. -H.P. Lovecraft - Please do not resell my e-mail address to anyone or send me unsolicited e-mail - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpAds Sillyness
Did you change anything in the session settings from the PHP default? -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] phpAds Sillyness
I sure didn't. Here's my PHPInfo() http://www1.metalink.net/~mjw/phpAds/phpinfo.php Matt TrollBoy Wiseman Webmaster: Shoggoth.net Site Designer: phpslash.org The oldest and strongest emotion of mankind is fear, and the oldest and strongest kind of fear is fear of the unknown. -H.P. Lovecraft - Please do not resell my e-mail address to anyone or send me unsolicited e-mail - - Original Message - From: Adam Voigt [EMAIL PROTECTED] To: Matt TrollBoy Wiseman [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, December 02, 2002 1:15 PM Subject: Re: [PHP] phpAds Sillyness Did you change anything in the session settings from the PHP default? -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpAds Sillyness
Hmm, you got me. The last time I installed it, it worked fine after I turned register global's on. There's a support forum on there website if no one else here has any bright idea's. -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] preg_match()
Why not use split() (http://www.php.net/split) or explode() instead of matching? ..michael.. On Mon, 2002-12-02 at 09:34, Sturle wrote: Hello I have one coloumn with lots of e-mail adress like this: [EMAIL PROTECTED];[EMAIL PROTECTED];[EMAIL PROTECTED] [EMAIL PROTECTED];[EMAIL PROTECTED];[EMAIL PROTECTED] [EMAIL PROTECTED] And i want to take the first row and put the adresses into an array, then the second row... I try like this, but i don't know what i can write in preg_match() to only get the email adress. while(odbc_fetch_row($ret)){ $Epost = odbc_result($ret,Epost); preg_match_all( '/?/', $Epost, $result); foreach ($result[0] as $loop_result) sturle -- Michael Sweeney [EMAIL PROTECTED] Verisity Design, Inc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_match()
Well, if you truly mean split by row, if $emaillist contains them all: $earray = explode(\n,$emaillist); Then, if you wanted each email address in it's own subarray position: for($counter = 0; $counter count($earray); $counter++) { $earray[$counter] = explode(;,$earray[$counter]); } That would give you: $earray[0][0] = [EMAIL PROTECTED]; $earray[0][1] = [EMAIL PROTECTED]; $earray[0][2] = [EMAIL PROTECTED]; $earray[1][0] = [EMAIL PROTECTED]; Etc, assuming you had 3 email's per line. -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
[PHP] PHP Course - San Francisco, CA 12/16-12/18
PHP Programming Bootcamp DESCRIPTION: This hands-on PHP Programming course provides the knowledge necessary to design and develop dynamic, database-driven web pages using PHP version 4. PHP is a language written for the web, quick to learn, easy to deploy and provides many advantages over other server-side scripting languages. The course introduces the PHP framework and syntax, and covers in depth the most important functions used to build dynamic data enriched web applications. Students learn how to connect to any ODBC-compliant database, and perform hands-on practice with a MySQL database to create database-driven HTML forms and reports. Students will also learn how to configure PHP and Apache Web Server. The course also introduces advanced programming constructs, object oriented programming with PHP, and XML parsing with PHP. PREREQUISITES: Experience with a programming or scripting language and HTML. DURATION: 3 Days CONTACT: [EMAIL PROTECTED] COST - $1295 Overview Of PHP . Static vs. Dynamic Web Sites . Dynamic Content from Databases . Developing Dynamic Internet Applications . Client-Side Scripting vs. Server-Side Scripting . Overview of PHP Advantages and Capabilities . Configuring PHP.INI Conditional Constructs . True and False Expressions . Switch/Case Statement . Timestamps PHP Functions . Introduction to Functions . Declaring Functions . Scope . Passing Arguments to Functions . Returning Values from a Function . Using Include Files . The Require Statement . Recursion . Dynamic Function Calls . Predefined PHP Functions Arrays in PHP . What are Arrays? . Usage of Arrays in PHP . Indexing Arrays . Initializing Arrays . Adding and Removing from Arrays . One-Dimensional Arrays . Multi-Dimensional Arrays . Array Functions Working with Data Files in PHP . Searching File Contents With Regular Expressions . Changing and Editing File Contents . Splitting and Joining Information Inside Files . String Functions . Regular Expression Functions . Reading, Writing and Deleting Files . Handling File Permissions . File Locking . Reading Directory Contents . Creating and Deleting Directories E-mail and PHP . Using Mail Servers (SMTP and Send mail) . Converting Messages to Readable Formats . Sending E-mail . Sending Attachments . Sending Binary Attachments . Sending HTML E-mail . Validating an E-mail Address . Automating E-mail Messaging Basic Scripting and Looping Constructs . PHP Scripting Fundamentals . Print Statement . Code Blocks . Primitive Data Types . Defining Constants and Variables . Looping Constructs . Exit Break Introduction to the Apache Web Server . Configuration Files . PHP Installation and Configuration . WWW Sites within Apache . Website Properties . RPM Installation vs. Binary Installation PHP Operators . Logical Operators . Relational Operators . Bitwise Operators . Other Operators Working with Databases and Forms . Configuring PHP For Database Support . PHP's Database APIs . PHP's SQL API . MySQL vs. Access . MySQL vs. SQL Server . Database Drivers . Database Driver Class Wrappers . ODBC . Simple SQL Queries via PHP . Tracking Visitors with Session IDs . Populating Forms . Retrieving Data from Forms Configuring and Using MySQL . MySQL as a Client/Server Solution . Introduction to MySQL Capabilities as a RDBMS . Installing and Configuring MySQL . Connecting to MySQL . PHP Functions Specific to MySQL . Executing SQL Calls . Select . Insert . Fetch . Update . Delete . Using PHP MyAdmin to configure MySQL Using Cookies with PHP . Purpose of Cookies . Cookie Myths . Setting Cookies . Retrieving Cookies . Expiring Cookies . Deleting Cookies . Storing Arrays in Cookies Miscellaneous PHP Tasks . Error Logging . Session Management Maintaining State . How to Build a Shopping Cart . Using Environmental Variables . Changing Execution by Redirecting to Other URLs . Embedding JavaScript with PHP . Using HTTP and FTP Protocols to Pass Data . Showing Different Content to Different Browsers . Getting IP Addresses from Visitors -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Who can tell me the best php-base webmail?
also take a look at hord-imap (http://www.hord.org) -js On Mon, 2 Dec 2002 14:06:01 +0100 [EMAIL PROTECTED] wrote: Le Lundi 2 D¨¦cembre 2002 13:30, [EMAIL PROTECTED] a ¨¦crit : Who can tell me the best php-base webmail? I want a webmail for my mail server, give me a suggest, please! Joskey Liaus [EMAIL PROTECTED] This is a hard question to answer ;-) I use SquirrelMail (http://www.squirrelmail.org/), Which is quite good... IlohaMaim (http://ilohamail.org/) Looks quite fine, too. Have you tried IMP ? -- ,, ( ¡ã Nicolas Costes /||\IUT de La Roche / Yon ( ^ ) [EMAIL PROTECTED] ^ ^http://luxregina.free.fr -- 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: ini_set() / Jason Wong / dynamically setting this?
On Tuesday 03 December 2002 01:20, Matt Babineau wrote: Hi everyone: I just read the reply from Jason Wong pretty much just about my question. Using the ini_set() command at the top of all my pages I think would work out ok, but when I upload my pages to the server, how can I dynamically set the include path to match the root of my web folder on the shared server? Look at the output of phpinfo(), in particular the contents of $_SERVER, you should find what you need in there. I've included a link to the error message below. As an aside, I picked up this piece of software that lets me grab HTML or other content from web pages and puts it into its own window and gives me a link to it. I am finding it way handy for sharing these errors that I get with other people. They just click the link to view the error, rather then getting a ton of debug code in an email message. I highly recommend trying it out, makes my life a lot easier. I disagree. If possible you should always post your error message/code to the list. I, for one, would not bother to go click on a link to see what the problem is, it's too much like hard work ;-) Plus it might be a bit of social engineering and the link leads to the latest Outlook exploit (which is why I don't use said program). http://www.amplifytheweb.com/amplify/?13B53210-FD7A-4DDA-999E-993D243F4 BB4 http://www.amplifytheweb.com/amplify/?13B53210-FD7A-4DDA-999E-993D243F4B B4 And another reason is all these posts are archived. Someone stumbling upon these posts in a few years time might not be able to reach the above link, thus they wouldn't have the faintest idea of what you are referring to. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* What do you do when your real life exceeds your wildest fantasies? You keep it to yourself. -- Broadcast News */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Red Hat 8 Apache problem - stumped :-(
Hi there, This might be better suited for an Apache newsgroup, but I thought I'd try here first. I installed Apache and PHP on RH8 a few weeks ago following the instructions on [URL 1, below], and both were running with absolutely no problems. Today however, I rebooted my machine and http://localhost gave me a connection was refused when trying to contact localhost. Also, Apache would not restart: -- Syntax error on line 52 of /www/conf/httpd.conf: Invalid command 'ServerType', perhaps mis-spelled or defined by a module not included in the server configuration -- On removing the ServerType statement, I get: -- [root@localhost conf]# /usr/sbin/apachectl -f /www/conf/httpd.conf Syntax error on line 236 of /www/conf/httpd.conf: Port was replaced with Listen in Apache 2.0 -- On fixing this, I get: -- [root@localhost conf]# /usr/sbin/apachectl -f /www/conf/httpd.conf Syntax error on line 330 of /www/conf/httpd.conf: Invalid command 'Order', perhaps mis-spelled or defined by a module not included in the server configuration -- Of course, the problems go on and on... and on. I'm new to the world of Linux, so could anyone throw some ideas my way? Thanks, Lee [URL 1] [http://www.e-gineer.com/instructions/install-php4x-for-apache1xx-on-linux.phtml] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Who can tell me the best php-base webmail?
On Tuesday 03 December 2002 02:34, Jonathan Sharp wrote: also take a look at hord-imap (http://www.hord.org) That's horde with an 'e' on the end, it's silent but it's still there ;-) -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Sometimes, too long is too long. -- Joe Crowe */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Triggering a PHP Script
Don't worry. The newsletter is only sent to those who have requested it in their registration, and the user can easily unsubscribe at any time. Anyway, it looks like I will have to go with a CGI Script. Thanks for your reply. If anyone has any alternative methods please let me know. Ryan Bates On Monday, December 2, 2002, at 09:37 AM, DL Neil wrote: Ryan, My Problem: I've got a PHP script (running on Apache) that can take several hours to complete. The script sends out a newsletter to those who have requested it. When calling this script from a web browser, the browser hangs until the script has fully executed. If the user hits Stop while the script is running, it will terminate the script. My Questions: What is the best way to trigger this script? Is there a way to do it without using a CGI script? I am basically wondering if there is a way to create a trigger this php page script that will run the script on Apache and not hang the browser. Also, are there any problems calling MySQL from a PHP CGI script? First: trust that you are only sending to opted-in clients!? (we're kind of sensitive about spammers around here!) The manual is your friend: Chapter 23. Using PHP from the command line. Add code to prevent PHP from timing-out (see another current thread) and that takes care of your program. It will now run, outside the browser, in the background, and you/your user can carry on using the browser... As far as trigger goes, you can type the command into the command line, or run some sort of 'job', or set it up to run off a scheduler, eg CRON or AT/Scheduled Tasks. Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Red Hat 8 Apache problem - stumped :-(
Your best bet is to get rid of Apache 2.0 and install an Apache 1.3.x RPM instead. -Rasmus On 2 Dec 2002, Lee P. Reilly wrote: Hi there, This might be better suited for an Apache newsgroup, but I thought I'd try here first. I installed Apache and PHP on RH8 a few weeks ago following the instructions on [URL 1, below], and both were running with absolutely no problems. Today however, I rebooted my machine and http://localhost gave me a connection was refused when trying to contact localhost. Also, Apache would not restart: -- Syntax error on line 52 of /www/conf/httpd.conf: Invalid command 'ServerType', perhaps mis-spelled or defined by a module not included in the server configuration -- On removing the ServerType statement, I get: -- [root@localhost conf]# /usr/sbin/apachectl -f /www/conf/httpd.conf Syntax error on line 236 of /www/conf/httpd.conf: Port was replaced with Listen in Apache 2.0 -- On fixing this, I get: -- [root@localhost conf]# /usr/sbin/apachectl -f /www/conf/httpd.conf Syntax error on line 330 of /www/conf/httpd.conf: Invalid command 'Order', perhaps mis-spelled or defined by a module not included in the server configuration -- Of course, the problems go on and on... and on. I'm new to the world of Linux, so could anyone throw some ideas my way? Thanks, Lee [URL 1] [http://www.e-gineer.com/instructions/install-php4x-for-apache1xx-on-linux.phtml] -- 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] Test links?
DL Neil wrote: Beth, I noticed this reference to $http_response_header and straightaway quizzed the manual, only to find that the only references to it (eg file open) lead nowhere. Have gone through a few other pages, looking to see if I might happen upon some detail, but failed. Sadly you don't refer to it in the code snippet provided (below). Any code I've attempted blindly has failed/reported errors. Please point me in the right direction (otherwise I guess it'll be time to download the new v4.3.0-RC and risk the bleeding edge - which according to the manual does something different anyway...) Yeah, it's not mentioned anywhere else, I just completely guessed at what to do with this and got lucky on the first attempt, but if you do a ... ?php print_r($http_response_header); ? ... you get tons of junk like: Array ( [0] = HTTP/1.1 200 OK [1] = Date: Mon, 02 Dec 2002 17:54:47 GMT [2] = Server: Apache/1.3.27 (Unix) PHP/4.2.3 mod_perl/1.27 mod_gzip/1.3.19.1a [3] = Cache-Control: max-age=900, public, must-revalidate, max-age=900 [4] = Expires: Mon, 02 Dec 2002 18:09:47 GMT [5] = Last-Modified: Mon, 02 Dec 2002 17:51:56 GMT [6] = ETag: 28de7-cfa4-3deb9dbc [7] = Accept-Ranges: bytes [8] = Content-Length: 53156 [9] = Connection: close [10] = Content-Type: text/html; charset=iso-8859-1 ) When I first programmed the little function for Rob, I used it to check for a 200 status, but it turns out that fopen completely fails UNLESS it gets that 200, so it wasn't necessary. Beth Gore -- http://bethanoia.dyndns.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] some data output formatting and grouping question...
I just have a mental block; I cannot at all conceive the necessary syntax to or even the theoretical algorithm that I need, to do the following: Consider the following table: U | X | Y --|---|-- me|001|0a me|002|0a me|003|0a me|002|0b me|003|0b me|004|0b ..|...|.. then the code says: SELECT * FROM Y WHERE U = me So now what? - remember I do not know the value of Y, so it has to be an automatic thing; I can't just say ... WHERE U = me AND Y = a. I want this output: 0a 001 002 003 ___ (hr) 0b 002 003 004 How the h3ll do I do that? I can't think of the g0dd4mn' syntax! __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Problem or MySQL (Match ... against)?
I'm stuck. I have been to the MySQL lists for this. Now I'm reconsidering my PHP code. http://ccl.flsh.usherb.ca/print/display.table.inc.phps I just don't know where I'm going wrong anymore. If I run this SQL in PHPMyAdmin, it works. jdaxell.ccl should have one entry for ready maria. SELECT id,AU,ST,BT,AT FROM jdaxell.ccl WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('ready maria' IN BOOLEAN MODE) ORDER BY id asc When I run the same (copied and pasted) SQL in PHP, it is as though MySQL is doing a boolean search for `+ready +maria` without the double quotes and finding results in every database. if you search for ready maria it should only find one entry. http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26quot%3B So what have I done wrong now :( John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Problem or MySQL (Match ... against)?
On Mon, 2 Dec 2002, jtjohnston wrote: SELECT id,AU,ST,BT,AT FROM jdaxell.ccl WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('ready maria' IN BOOLEAN MODE) ORDER BY id asc When I run the same (copied and pasted) SQL in PHP, it is as though MySQL is doing a boolean search for `+ready +maria` without the double quotes and finding results in every database. if you search for ready maria it should only find one entry. Escape the double quotes.('\ready maria\' IN BOOLEAN g.luck, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Weird upload problem
Hello guys Well, I've been trying to upload a file without much success so far. So I'm trying to find the error but honestly this has become a real puzzle for me. Ive got the following form: form enctype=\multipart/form-data\ name=\book_add\ method=\post\ action=.$PHP_SELF.?management=8 table trtd class=\nolink\File to upload:/td input type=\hidden\ name=\MAX_FILE_SIZE\ value=\2000\ tdinput type=\file\ name=\formfile\/td /tr /table The action thing just passes the results to a function for it to process the upload, like this: if ($management) { switch($management) { //Several cases case 8: do_upload_file($_POST, $_FILES) break; } } You may guess what the do_upload_file function is for, but all I'm doing at the moment with it is trying to find out what the hell is going on here, so there it is: function do_upload_file($_POST, $_FILES) { if (is_array($_FILES)) echo $_FILES is okbr; else exit; if (is_array($_POST)) echo $_POST is okbr; else exit; echo File tmp_name: .$_FILES['formfile']['tmp_name'].br; echo File size: .$_FILES['formfile']['size'].br; echo File type: .$_FILES['formfile']['type'].br; echo Error: .$_FILES['formfile']['error']; } The results when trying to upload any kind of file but text/plain ones: $_FILES is ok $_POST is ok File tmp_name: none File size: 0 File type: application/pdf Error: As you can see the file type is being detected (I already tried with the most common types: rtf, doc, xls, zip, ppt, pdf) but I'm getting nothing for name or size. I'm also not getting any error message. If I run the script with a text/plain file it goes through it without a problem. I can't see an error in the way I am handling this upload thing, I also tried not passing the values to a function but doing it directly in the case statement with the same results. Does anyone have a good idea of what's going on here? Hope someone does for I just run out of ideas. Thanks a lot *** Wilmar Pérez Network Administrator Library System Tel: ++57(4)2105962 University of Antioquia Medellín - Colombia 2002 *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Shipping Rate Question
Hi, I've found a number of UPS rate calculators in php and I'm wondering if anyone has used many shipping calculators written in php. If so, what success have you had? Any stories/recommendations to share? Thanks very much, Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php shipping rate question
Hi, I've found a number of UPS rate calculators in php and I'm wondering if anyone has used many shipping calculators written in php. If so, what success have you had? Any stories/recommendations to share? Thanks very much, Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why all the returned emails from this list?
At 11:16 PM 12/1/02 -0800, Troy May wrote: I'm getting nailed with a bunch of returned emails like this: [EMAIL PROTECTED] - no such user here. There is no user by that name at this server. : Message contains [1] file attachments What's going on? Each one has a different address, but the terminalgmb.ru part is the same for each one. I believe you are the victim of one of the new viruses. (klez?) Someone with your name in their address book has the virus, and you are the lucky one it chose to use for the From: address on all the mails it is sending out. Don't open that attachemnt!!! Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] invalid range
when I do this eregi(^([a-zåäö_\.- ]+)$,$value); I get this: Warning: Invalid range end in /home/zinekweb/public_html/corporate/_mcm_contacts_upload.php on line 42 Why? I running Apache1.3 on my XP machine with PHP 4.2something.. but when I upload to a RedHat7.2 server with Apache.1.3 and PHP4.0something I get this error. Can anyone help me out here? Any clues? /peter a -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Show Folder Contents in Form
Hello, Is it possible, and if so how, to get the filenames and last edited time/date, then display them in a select field in a form for a user to select? I'd need to show them in order of most recently edited to last edited. How can this be done if it can? Thanks, Stephen Craton http://www.melchior.us Life is a gift from God. Wasting it is like destroying a gift you got from the person you love most. -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Show Folder Contents in Form
you could first read the files and their modified-dates into an array; sort the array; and finally build a select widget from the array... function sortByTime($a, $b) { if ($a[time] == $b[time]) return 0; return ($a[time] $b[time]) ? -1 : 1; } while (false !== ($file = readdir(/some/directory/))) { if ($file != . $file != ..) $files[] = array(file = $file, time = filectime(/some/directory/.$file)); } usort($files, sortBytime); echo select; while (list(,$filearr) = each($files)) echo option value=\.$filearr[file].\.$filearr[file]. .$filearr[time]; Stephen [EMAIL PROTECTED] wrote in message 000901c29a46$590a2320$0200a8c0@melchior">news:000901c29a46$590a2320$0200a8c0@melchior... Hello, Is it possible, and if so how, to get the filenames and last edited time/date, then display them in a select field in a form for a user to select? I'd need to show them in order of most recently edited to last edited. How can this be done if it can? Thanks, Stephen Craton http://www.melchior.us Life is a gift from God. Wasting it is like destroying a gift you got from the person you love most. -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Problem or MySQL (Match ... against)?
Chris, or anyone, I have tried to escape the slashes. Debugging ... $sql = 'SELECT ... ... AGAINST (\'ready maria\' IN BOOLEAN MODE) ...'; This works. But if I addslashes or stripslashes, or do nothing, it does not work. See these 3 variations. Neither work. What should I do? A part from hang myself :) $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST (\''.addslashes($search).'\' IN BOOLEAN MODE) ORDER BY id asc'; $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST (\''.stripslashes($search).'\' IN BOOLEAN MODE) ORDER BY id asc'; $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST (\''.$search.'\' IN BOOLEAN MODE) ORDER BY id asc'; John SELECT id,AU,ST,BT,AT FROM jdaxell.ccl WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('ready maria' IN BOOLEAN MODE) ORDER BY id asc When I run the same (copied and pasted) SQL in PHP, it is as though MySQL is doing a boolean search for `+ready +maria` without the double quotes and finding results in every database. if you search for ready maria it should only find one entry. Escape the double quotes.('\ready maria\' IN BOOLEAN g.luck, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: invalid range
looks like because you have a dash inside your character class; when inside a character class the dash is a special character and you'd have to escape it eregi(^([a-zåäö_\.\- ]+)$, $value); Peter A [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... when I do this eregi(^([a-zåäö_\.- ]+)$,$value); I get this: Warning: Invalid range end in /home/zinekweb/public_html/corporate/_mcm_contacts_upload.php on line 42 Why? I running Apache1.3 on my XP machine with PHP 4.2something.. but when I upload to a RedHat7.2 server with Apache.1.3 and PHP4.0something I get this error. Can anyone help me out here? Any clues? /peter a -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with Search and Replace in a PDF Document
Hello All: I am 6 days new to PHP. I find the syntax to be quite similar to Perl, so that has helped alot. I am having problems doing a search and replace in an Adobe PDF document. What I have done is made an Adobe PDF document using Adobe Distiller from a MS Word document. I then changed some of the fields to be forms. I made the value of the forms something like ##VARIABLE1##. Using PHP, I wanted to be able to call this form, and search and replace the variable above with say, for example, a person's name. Below is the code I am trying to use: $contents = file (Notice.pdf); for($i=0; $i sizeof($contents); $i++){ $staff .= eregi_replace(##VARIABLE1##, $FirstName, $contents[$i]); $length = $length + (strlen($contents[$i])); } $fp = fopen(Final.pdf, w); fputs ($fp, $staff,$length); fclose ($fp); The problem is that the filesize of the new file ends up being much smaller than the original file. The above code works fine on plain text files, but does not like PDF (probably any binary file for that matter). Any ideas or suggestions? Best Regards, Gabriel C. Murphy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: invalid range
On Mon, 2 Dec 2002, Nick Eby wrote: looks like because you have a dash inside your character class; when inside a character class the dash is a special character and you'd have to escape it eregi(^([a-zedv_\.\- ]+)$, $value); Traditionally in regexes, a dash has to come last, otherwise the regex engine interprets it as a range. Escaping it may work too, but I've never had trouble moving dashes to the last char in the range, so your regex would look like this: eregi(^([a-zedv_\. -]+)$,$value); -- Morgan Hughes C programmer and highly caffeinated mammal. [EMAIL PROTECTED] ICQ: 79293356 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why all the returned emails from this list?
At 11:16 PM 12/1/02 -0800, Troy May wrote: I'm getting nailed with a bunch of returned emails like this: [EMAIL PROTECTED] - no such user here. There is no user by that name at this server. : Message contains [1] file attachments What's going on? Each one has a different address, but the terminalgmb.ru part is the same for each one. I believe you are the victim of one of the new viruses. (klez?) Someone with your name in their address book has the virus, and you are the lucky one it chose to use for the From: address on all the mails it is sending out. Don't open that attachemnt!!! I think this is different. I've been on the receiving end of returned klez mails and these don't look like them. I also got a bunch of the same returned emails and the beginning of that email address is mine (holmes072000). The attachment is the original message I replied to that must of triggered all of these. There are some weird headers in there that mention the terminalgmb.ru address. Here is is: Received: from bytecity.ru ([80.250.64.36]) by terminalgmb.ru ([127.0.0.1]) with DomainPOP (MDaemon.PRO.v6.5.1.R) for [EMAIL PROTECTED]; Mon, 02 Dec 2002 08:57:07 +0200 Received: by iq (mbox gmbterm) (with Cubic Circle's cucipop (v1.31 1998/05/13) Mon Dec 2 08:57:05 2002) X-From_: [EMAIL PROTECTED] Fri Nov 29 19:54:22 2002 Envelope-to: [EMAIL PROTECTED] Delivery-date: Fri, 29 Nov 2002 19:54:22 +0200 Received: from pb1.pair.com ([216.92.131.4]) by iq.wbt.ru with smtp (Exim 3.33 #2) id 18HpLK-0006dS-00 for [EMAIL PROTECTED]; Fri, 29 Nov 2002 19:54:22 +0200 Received: (qmail 25422 invoked by uid 1010); 29 Nov 2002 17:54:19 - Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] Delivered-To: mailing list [EMAIL PROTECTED] Received: (qmail 25407 invoked from network); 29 Nov 2002 17:54:19 - Reply-To: [EMAIL PROTECTED] From: John W. Holmes [EMAIL PROTECTED] To: 'Sturle' [EMAIL PROTECTED], [EMAIL PROTECTED] Date: Fri, 29 Nov 2002 12:54:10 -0500 Organization: U.S. Army Message-ID: 001e01c297d0$55ab32f0$7c02a8c0@coconut MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 In-Reply-To: [EMAIL PROTECTED] X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal Subject: RE: [PHP] Convert dates X-Envelope-To: [EMAIL PROTECTED] X-MDRemoteIP: 80.250.64.36 X-MDRcpt-To: [EMAIL PROTECTED] X-MDaemon-Deliver-To: [EMAIL PROTECTED] Is there a way to convert a date 2002-11-29 00:00:00:000to 29 November 2002 Yes. Try strtotime() and date() in PHP, or break the string apart. If this date is coming from MySQL, then look at the DATE_FORMAT() function that you can use in your query to format it. ---John Holmes... -- 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] Decrypting mcrypted strings on Windows desktop
Hi folks, Bit OT but I am hoping someone on the list can help. I need to encrypt short strings in PHP, using mcrypt by preference, email it to the customer, and have him decrypt the string on the Windoze desktop. But all the Windows encryption utilities I can find use proprietary file formats - none can decrypt the string output by mcrypt. Can anyone help me out here - I am running out of time. Either an open source or a commercial solution would be fine. -- Geoff Caplan Advantae Ltd mailto:[EMAIL PROTECTED] http://www.advantae.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP --with-dbm enabled???
I'm being told that I need to have php compiled --with-dbm and it is not, but it is complied --with-db3. Is that the same thing or do I need recopile --with-dbm to use the dbmopen() function? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Browser going to page twice?
I'm having a weird problem. When I go to a page on my site, it often goes twice. I'm not sure if this is a client-side or server-side problem, but it doesn't happen on other sites. Is this a common problem, or am I making some dumb mistake? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IIS 5
I'm getting You are not authorized to view this page when trying to run .php files. How do I fix this? I'm running php isapi on iis 5 on w2k server. 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] Date problem
Thanks for this, I understand how to update in date in database, but I need when I get date from database to increase or decrease before to save in database. Can you help me for this ? Yeah, I already did: You can select out the date you have now, use strtotime() to make it into a unix timestamp (which PHP works with), and date() to format it however you want. If the user approves the new date, you can reformat the unix timestamp back to a -MM-DD format with date() or use FROM_UNIXTIME() in your query to insert/update the new date into the database... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] print to file
Okay, this is probably stupid, but how do you print to a file? Thanks, Bryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDF Help Please
I need to figure out by tonight how to: 1. open a .pdf file using php. 2. add text to certain parts of it. 3. save it and output to browser. 4. Then delete the temp file so the process can be done over again. I have PDFlib but not the $1000 PDI addition Please help, Ryan
Re: [PHP] Decrypting mcrypted strings on Windows desktop
I've done something similar (encrypt a message, send it to a client, let them decrypt locally), and so far, the easiest solution was to simply install PHP and Apache on their PC. You could also check out PGP-GTK, which is a cross-platform, client-side extension to PHP for making GUI's... haven't worked with it yet, but I plan to soon. on 03/12/02 9:32 AM, Geoff Caplan ([EMAIL PROTECTED]) wrote: I need to encrypt short strings in PHP, using mcrypt by preference, email it to the customer, and have him decrypt the string on the Windoze desktop. But all the Windows encryption utilities I can find use proprietary file formats - none can decrypt the string output by mcrypt. Can anyone help me out here - I am running out of time. Either an open source or a commercial solution would be fine. Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: print to file
$fp=fopen(filename,a); fputs($fp,text to the file); fclose($fp); Regards, Thomas On Mon, 2 Dec 2002 15:52:23 -0800 (PST) [EMAIL PROTECTED] (Bryan Koschmann - Gkt) wrote: Okay, this is probably stupid, but how do you print to a file? Thanks, Bryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] nl2br ( ) and forms
When I call data from a form, How do I integrate nl2br to it so that it displays with linebreaks? Example code: td?php echo $_POST[echomeaddress]; ?/td Thanks in advance, Ryan
Re: [PHP] nl2br ( ) and forms
td?php echo nl2br($_POST[echomeaddress]); ?/td Ryan Smaglik wrote: When I call data from a form, How do I integrate nl2br to it so that it displays with linebreaks? Example code: td?php echo $_POST[echomeaddress]; ?/td Thanks in advance, Ryan -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP + Java
Does anyone have PHP 4.2.3 and Java running together? I need to see how you have the php.ini file set up... Here is mine and it just hangs... [Java] java.class.path=/usr/local/lib/php/php_java.jar java.home=/usr/local/java java.library=/usr/local/java/jre/lib/i386/hotspot/libjvm.so extensions_dir=/usr/local/lib/php/extensions/no-debug-non-zts-20020429 extension=java.so Thanks, -- Ray Hunter email: [EMAIL PROTECTED] www:http://venticon.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions, Cookies, and Subdomains
Hello, I've a bit of a problem and was wondering if anyone out there can help straighten it out. I have never worked with cookies or php sessions before as the need for such has never presented itself before. Up until this point I have been using a very customized version of PostNuke but things are to the point where I need a custom system from scratch. I want to use php sessions for my user system because they seem to be more transparent to the visitor, but there are a few problems that I think I am going to run into based on what I've read. I want to have my website split into several subdomains with a shared user system. That is to say that when someone logs into foo.mysite.com they'd also be logged into bar.mysite.com when they go to it. It is my understanding that php sessions will not work in this way, being that each subdomain has its own sessions. If this is the case, is there a way around this? If it is the case and there isn't a way around this, is this able to be done with regular cookies? Also, php sessions only last a certain amount of time. I'd like for users to remain logged in indefinitely if they choose to do so while logging in. Assuming this is absolutely impossible in sessions, is it feasible to use php sessions as the basis of my user system, but use cookies as a secondary to it if users choose to remain logged in? Any help at all would be really appreciated, because I'd like to get the new version of my site rolled out soon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php