Re: [PHP] Access denied to php files in Netscape 6
This seems absolutely impossible. Can you verify that you are using the *exact* same URL with each browser? I would recommend copy/pasting the URL from each into a text document or something to be sure every slash, etc., is identical. This will also ensure that you are accessing these scripts via the http:// scheme rather than the file:// scheme. Chris Chris Nielsen wrote: I'm running PWS on WinXP Pro. I can't test my php stuffs in Netscape cause it says Access Denied when I try to access any php file. They work fine in IE6. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Access denied to php files in Netscape 6
It's not impossible if the site is not opened up to full public access, and he is using different proxy settings on each browser. Check those. -Original Message- From: Chris Shiflett [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 2 October 2002 4:23 PM To: Chris Nielsen Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Access denied to php files in Netscape 6 This seems absolutely impossible. Can you verify that you are using the *exact* same URL with each browser? I would recommend copy/pasting the URL from each into a text document or something to be sure every slash, etc., is identical. This will also ensure that you are accessing these scripts via the http:// scheme rather than the file:// scheme. Chris Chris Nielsen wrote: I'm running PWS on WinXP Pro. I can't test my php stuffs in Netscape cause it says Access Denied when I try to access any php file. They work fine in IE6. -- 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: tricky gd question
imagecopyresampled($dst_img,$src_img,50,0,0,0,$new_w,$new_h,imagesx($src_img ),imagesy($src_img)); i have this basically if i half the width of the ratio scaled image , it puts the entire image into that area not just half the image like a crop would ? Mike Mannakee [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Have a look at ImageCopy in the manual. HTH Mike Electroteque [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... here is a tricky question, i have created a photo gallery script where i can edit the photo and gammacorrect the photos, at the moment i post the gamma value and refreshes the resized preview image , what i'd like to do is be able to have a before and after preview so half the image is the normal image and half the image is the gamma corrected image , is this possible ? any leads would be excellent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML Parser additional
You want to retain ownership, AND take contributions? Generally it'd be an either/or proposition wouldn't it? Justin French on 02/10/02 2:26 PM, Khalid El-Kary ([EMAIL PROTECTED]) wrote: hi, i wanted to add something, i want to receive contribtions from developers as well to make the parser be better _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookie
Hi, I use : apache 1.3.26, php 4.2.3, postgresql 7.2 (under solaris 7). I attempt to modify my old sources which run with the previous versions and I meet a problem with the cookie. I read that we can see the contents of a cookie with 2 methods : echo $testcookie echo $_COOKIE[testcookie] For me, only the second method runs. An idea ? In advance, thanks mb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie
I'm pretty sure this is a global variables problem. There is an option in your ini.php file that refers to 'global variables' You need to set this on, otherwise reference to them with the absolute variable name. Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom - Original Message - From: Max Buvry [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 2:37 AM Subject: [PHP] Cookie Hi, I use : apache 1.3.26, php 4.2.3, postgresql 7.2 (under solaris 7). I attempt to modify my old sources which run with the previous versions and I meet a problem with the cookie. I read that we can see the contents of a cookie with 2 methods : echo $testcookie echo $_COOKIE[testcookie] For me, only the second method runs. An idea ? In advance, thanks mb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cookie
The register globals function must be turned ON in your php.ini for the first method to work. -Original Message- From: Max Buvry [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 2 October 2002 2:38 AM To: [EMAIL PROTECTED] Subject: [PHP] Cookie Hi, I use : apache 1.3.26, php 4.2.3, postgresql 7.2 (under solaris 7). I attempt to modify my old sources which run with the previous versions and I meet a problem with the cookie. I read that we can see the contents of a cookie with 2 methods : echo $testcookie echo $_COOKIE[testcookie] For me, only the second method runs. An idea ? In advance, thanks mb -- 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] mail function problems
Hi Dan I (and others I know) have similar probs of seemingly disappearing emails - I thought it was down to mail filtering because I cant think of another explanation (but I dont know that for sure). I was given some advice here yesterday so I am forwarding you the mails. Debbie - Original Message - From: Dan McCullough [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 12:46 AM Subject: [PHP] mail function problems I use the mail function tons, never had a problem. I am working with a client with a different hosting vendor, they are using PHP 4.2.3, which I guess was a recient upgrade, anyway I was informed by the client that he wasnt getting email submissions from the website, but he was getting other emails, to those same accounts that were from outside the website. Short story long, I took one of the functions that uses the mail function inside of it, and I placed it on my server, and it worked flawlessly, place the same exact code on back on the other site, and nothing. Oh and I dont have access to their error logs. :( What sounds wrong? What sounds bad? Any thoughts? Anything i can look for? thanks, dan __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Undefined index:
Voisine wrote: Hi, I'm learning php from a book but because of global off I have have several Undefined index message! I don't want to change the default setting in my php.ini because I want to learn the good way. What I'm doing wrong? Undefined index: categorie if ($_POST['categorie'] == New) { You're not doing anything wrong. The problem here is that error_reporting has notices on. The $_POST['categorie'] is not defined. Change the error_reporting to excluse ERR_NOTICE, or use: if ( isset( $_POST['categorie'] ) $_POST['categorie'] == 'New' ) } // Your code here } HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] submitting a form to multiple places!!!
Here's what I do. We have an outsourced email newsletter management system that accepts GET method - so I just use fopen() to send the data to our list management system and then drop the information into a database on our server. $form1_submit_url = 'http://www.whatever.com/page.htm?something=123something=456'; $fp = fopen (c:\\data\\info.txt, r); - then my script continues to insert info an output confirmation message olinux --- Henry [EMAIL PROTECTED] wrote: Hi All, I have a problem that I hope you can help me with. I'm using a third party shopping cart solution which is quite frankly naff. They bundle some autoresponders with it. Unfortunately the autoresponders do not work!. I want to find a temporary solution to this. The easiest way would be to allow a form to be submitted to more than one place! Basically I would lke to have an intermediate php page that will submit the details (submitted to it) to two other pages and then follow the response of one of those other pages (the primary page). That way I can insert a different autoresponder handling system into the submission process but continue to use the shopping carts pages for the time being. Any suggestions? Henry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] submitting a form to multiple places!!!
If you need something more complex look into CURL as suggested earlier http://curl.haxx.se/ http://www.php.net/curl olinux --- olinux [EMAIL PROTECTED] wrote: Here's what I do. We have an outsourced email newsletter management system that accepts GET method - so I just use fopen() to send the data to our list management system and then drop the information into a database on our server. $form1_submit_url = 'http://www.whatever.com/page.htm?something=123something=456'; $fp = fopen (c:\\data\\info.txt, r); - then my script continues to insert info an output confirmation message olinux --- Henry [EMAIL PROTECTED] wrote: Hi All, I have a problem that I hope you can help me with. I'm using a third party shopping cart solution which is quite frankly naff. They bundle some autoresponders with it. Unfortunately the autoresponders do not work!. I want to find a temporary solution to this. The easiest way would be to allow a form to be submitted to more than one place! Basically I would lke to have an intermediate php page that will submit the details (submitted to it) to two other pages and then follow the response of one of those other pages (the primary page). That way I can insert a different autoresponder handling system into the submission process but continue to use the shopping carts pages for the time being. Any suggestions? Henry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to send POST info without a form?
Hi Snoopy can do this too: http://sourceforge.net/projects/snoopy/ Regards Girish -- www.girishnath.co.uk Lallous [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... try www.sloppycode.net * © Sloppycode.net All rights reserved. * @title Html Source class - api for getting/posting to websites * @author C.Small * @version 1.0 or phpclasses.org Elias, Chris Nielsen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a single php file that I want to do some different things (only one at a time, based on a conditional): display a form to the user for input submit information from (above) form to database list information in database (that has been INSERTed by the above) I want this file to be able to call itself using the following code: $input = $_SERVER['PHP_SELF'].?action=INPUT; $list = $_SERVER['PHP_SELF'].?action=LIST; print 'a href='.$input.'Input a new user/abr'; print 'a href='.$list.'List all users/a'; but I want to submit the action value as a POST rather than a GET. I then have conditionals around each of my modules that check $_POST['action'] for one of three values and only print that module if that's the action I need the file to perform. Basically I'm trying to figure out how to lump this all into one file. Obviously I could split it into three files that do each of the desired actions, but I would then also have to have a fourth file which provides a front end into it, which I don't want to do and is what got me started down this path. How can I submit POST information to a php file without using an HTML form? TIA. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie
Thanks for your response. The doc isn't explicit when it explains this two methods and don't focus on the register globals function for the first method. So I use the second method only. Thanks mb Bob Irwin wrote: I'm pretty sure this is a global variables problem. There is an option in your ini.php file that refers to 'global variables' You need to set this on, otherwise reference to them with the absolute variable name. Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom - Original Message - From: Max Buvry [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 2:37 AM Subject: [PHP] Cookie Hi, I use : apache 1.3.26, php 4.2.3, postgresql 7.2 (under solaris 7). I attempt to modify my old sources which run with the previous versions and I meet a problem with the cookie. I read that we can see the contents of a cookie with 2 methods : echo $testcookie echo $_COOKIE[testcookie] For me, only the second method runs. An idea ? In advance, thanks mb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help required on cookies
Hi Friends, I would like to know where the cookies will be stored? I have enabled cookies using session.use_cookies = 1. I found cookies will be stored in the environmental variable HTPP_COOKIE_VARS. But I didn't find anywhere this variable in my php.ini file. If I want to print all cookies stored in my browser how can I print? I tried to print in this way ?php echo All cookies :.$HTTP_COOKIE_VARS; echo brprevious cookie :.$HTTP_COOKIE_VARS[$Tamilnadu]; echo brprevious cookie :.$Tamilnadu; ? Output: Allcookies: Previouscookie: Previouscookie:Chennai === Please tell me how to print all the stored cookies in my browser and where these cookies will be stored? Where Can I see all these cookies?? Any logs we have to check?? Where can I see the http response headers?? (like cookies and stuff )..Do I need to use any protocol analyzer? Thanks in advance Balaji **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] get access to define() constants with dynamic names
Hi all, my script knows three different constants define(G_T_USER,user_profile); define(G_T_TEAM,SAFETOUR_team); define(G_T_CALL,SAFETOUR_call); Is it possible to get access to them, if I have the names (USER, TEAM, CALL) in a variable? It must be something like that: aName = TEAM; myString = G_T_$sName; // myString = SAFETOUR_team Any hint to solve this problem would be useful. heiko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help required on cookies
Balaji Ankem wrote: Hi Friends, I would like to know where the cookies will be stored? Cookies are stored on the client, either in memory or written to disk. If I want to print all cookies stored in my browser how can I print? I'm going to assume this isn't really what you mean, and you want to print all of the cookies made available to PHP. You see, as I said, the cookies are stored on the client. If PHP, running on a remote Web site, had access to all cookies stored in your browser, this would be a big security problem, wouldn't it? I think what you're looking for is this: pre ? print_r($_COOKIE); ? /pre Where can I see the http response headers?? (like cookies and stuff )..Do I need to use any protocol analyzer? I wrote a simple utility in PHP to help me view the HTTP communication regardless of what Web site I'm interacting with. It basically uses the PHP sockets extension to behave like an HTTP proxy, so that you just configure your browser to use it as a proxy while you browse. It then embeds the HTTP transactions into the replies (text replies only) for convenience, so that they're just displayed at the bottom of each Web page. You're welcome to have a look to see if it might be useful to you. See http://protoscope.org/ for more information or http://shiflett.org/projects/protoscope/sample.html for an example of what it looks like when you use it. Happy hacking. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP with Oracle
Warning: Unable to load dynamic library 'C:\PHP\extensions/php_oci8.dll' - there are slashes and backslashes in the string 'C:\PHP\extensions/php_oci8.dll'. it looks odd. May be you would have a look to include_path and extension_dir in php.ini ? Regards, Philippe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get access to define() constants with dynamic names
Hi Heiko Try this: $aName = TEAM; eval( '$myString = G_T_'.$aName.';' ); // evaluates to: $myString = G_T_TEAM echo $myString; // Should print out SAFETOUR_team I haven't tested this, but it should work. Regards Scott On 10/2/2002 10:47 AM, Heiko Mundle wrote: Hi all, my script knows three different constants define(G_T_USER,user_profile); define(G_T_TEAM,SAFETOUR_team); define(G_T_CALL,SAFETOUR_call); Is it possible to get access to them, if I have the names (USER, TEAM, CALL) in a variable? It must be something like that: aName = TEAM; myString = G_T_$sName; // myString = SAFETOUR_team Any hint to solve this problem would be useful. heiko -- //// // Scott Houseman // // Jam Warehouse http://www.jamwarehouse.com/ // // Smart Business Innovation // // +27 21 4477440 / +27 82 4918021// //// -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Connect to oracle on another host
I've been writing PHP scripts for a long time but never needed to get data from an Oracle database. Till now. - First, you need php compile with --oci - Then, you have to install the oracle client. Note : you can't find the oracle client alone. you need to download the entire oracle (500Mb !!) at http://otn.oracle.com/software/products/oracle8i/content.html and then choose in the setup to install the oracle client. After that, it would be possible to connect your remote oracle with ocilogon($username, $pw, $host). host (e.g. somewhere.somewhere.com) Note that I'm dubitative about your example. host is normally a string you should see in the oracle file tnsnames.ora. I've never seen a host oracle variable as an url ?? Hope it will help you Regards, Phlippe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help required on cookies
Hi Chris, Thanks for the help. ? print_r($_COOKIE); ? It is giving error saying call to undefined function _r(); And Setcookie in php is not conforming to the RFC2109. Comment and version how do we set? Thanks in advance Balaji -Original Message- From: Chris Shiflett [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 2:21 PM To: Balaji Ankem Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Help required on cookies Balaji Ankem wrote: Hi Friends, I would like to know where the cookies will be stored? Cookies are stored on the client, either in memory or written to disk. If I want to print all cookies stored in my browser how can I print? I'm going to assume this isn't really what you mean, and you want to print all of the cookies made available to PHP. You see, as I said, the cookies are stored on the client. If PHP, running on a remote Web site, had access to all cookies stored in your browser, this would be a big security problem, wouldn't it? I think what you're looking for is this: pre ? print_r($_COOKIE); ? /pre Where can I see the http response headers?? (like cookies and stuff )..Do I need to use any protocol analyzer? I wrote a simple utility in PHP to help me view the HTTP communication regardless of what Web site I'm interacting with. It basically uses the PHP sockets extension to behave like an HTTP proxy, so that you just configure your browser to use it as a proxy while you browse. It then embeds the HTTP transactions into the replies (text replies only) for convenience, so that they're just displayed at the bottom of each Web page. You're welcome to have a look to see if it might be useful to you. See http://protoscope.org/ for more information or http://shiflett.org/projects/protoscope/sample.html for an example of what it looks like when you use it. Happy hacking. Chris **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help required on cookies
Balaji Ankem wrote: ? print_r($_COOKIE); ? It is giving error saying call to undefined function _r(); That's weird. Maybe you have a space between print and _r? The function is print_r() with no spaces. And Setcookie in php is not conforming to the RFC2109. In what way? Remember that the setcookie() function itself does not need to conform to any syntax guidelines. Only the resulting HTTP header must conform to specifications such as those described in RFC 2109. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get access to define() constants with dynamic names
Thanks, it works! Scott Houseman wrote: Hi Heiko Try this: $aName = TEAM; eval( '$myString = G_T_'.$aName.';' ); // evaluates to: $myString = G_T_TEAM echo $myString; // Should print out SAFETOUR_team I haven't tested this, but it should work. Regards Scott On 10/2/2002 10:47 AM, Heiko Mundle wrote: Hi all, my script knows three different constants define(G_T_USER,user_profile); define(G_T_TEAM,SAFETOUR_team); define(G_T_CALL,SAFETOUR_call); Is it possible to get access to them, if I have the names (USER, TEAM, CALL) in a variable? It must be something like that: aName = TEAM; myString = G_T_$sName; // myString = SAFETOUR_team Any hint to solve this problem would be useful. heiko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help required on cookies
But in RFC2109 they mentioned Comment and version are also attributes of the setcookie header. How do you set these attributes using php?? How this print_r() function works?? Thanks in advance Balaji -Original Message- From: Chris Shiflett [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 2:52 PM To: Balaji Ankem Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Help required on cookies Balaji Ankem wrote: ? print_r($_COOKIE); ? It is giving error saying call to undefined function _r(); That's weird. Maybe you have a space between print and _r? The function is print_r() with no spaces. And Setcookie in php is not conforming to the RFC2109. In what way? Remember that the setcookie() function itself does not need to conform to any syntax guidelines. Only the resulting HTTP header must conform to specifications such as those described in RFC 2109. Chris **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help required on cookies
Balaji Ankem wrote: But in RFC2109 they mentioned Comment and version are also attributes of the setcookie header. How do you set these attributes using php?? These attributes are optional. Be careful not to confuse the setcookie() PHP function with the Set-Cookie HTTP header. I'm not certain if the setcookie() function itself provides a way to specify some of the less common optional attributes, because I never use it. PHP gives you complete control over cookies with the header() function, and that's what I generally use. You can specify your Set-Cookie header however you want with code like this: header(Set-Cookie: whatever you want); How this print_r() function works?? Just use it like I mentioned: pre ? print_r($_COOKIE); ? /pre You'll see. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can I pass the ftp transfer mode in a string?
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Thanks guys, I was unaware having quotes around it would make a difference. Works fine once I removed the quotes. John Kelly wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Can I pass the ftp transfer mode in a string like ... $filetype = FTP_ASCII; $upload = ftp_fput($conid, $dfile, $sfile, $filetype); I ask as when I do I get the following error message ... Warning: ftp_fput() expects parameter 4 to be long, string given If I replace $filetype with the text FTP_ASCII or FTP_BINARY it works fine. Quick explanation: FTP_ASCII is a symbolic constant, FTP_ASCII is a string. -- David Robley A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Works from the command line but NOT from PHP
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... DonPro wrote: $queryID = mysql_query(SELECT HSCode, UOM, EDescript FROM HSCodes WHERE MATCH(EDescript) AGAINST (' . $description . ') ORDER BY HSCode, UOM, EDescript); I don't see what is wrong but try echoing the text of the query itself and see if it contains what you think it does around the $desription area. HTH Chris Two bob says this is a register_globals problem -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail function problems
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I use the mail function tons, never had a problem. I am working with a client with a different hosting vendor, they are using PHP 4.2.3, which I guess was a recient upgrade, anyway I was informed by the client that he wasnt getting email submissions from the website, but he was getting other emails, to those same accounts that were from outside the website. Short story long, I took one of the functions that uses the mail function inside of it, and I placed it on my server, and it worked flawlessly, place the same exact code on back on the other site, and nothing. Oh and I dont have access to their error logs. :( What sounds wrong? What sounds bad? Any thoughts? Anything i can look for? thanks, dan Are you setting a From: field? It may be that the from address as sent by the provider won't resolve, which may cause problems. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OOP class names
I told you something incorrectly yesterday:- - From what you say you dont want get_class_name because this gives you the name of the class not the instance of it. get_class is PHP's function for getting the name of a class not get_class_name Sorry - I must have been thinking in Java mode. Debbie - Original Message - From: Davíð Örn Jóhannsson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 01, 2002 1:59 PM Subject: [PHP] OOP class names Is there any way to get a print out of class names of an object, lets say I have a object called obj and I have x number of classes and I want to find out, theyr names, for example obj-class1 obj-class2 etc. Thanks David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quotes in text strings
Hi Single quote's in strings entered via a text input field are subsequently appearing with what appears to be an escape character - comm\'ents how can i correct this? I've tried htmlspecialchars($string, ENT_QUOTES); and htmlentities($string, ENT_QUOTES); but these don't seem to work (maybe its me). Thanks Javier _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: quotes in text strings
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hi Single quote's in strings entered via a text input field are subsequently appearing with what appears to be an escape character - comm\'ents how can i correct this? I've tried htmlspecialchars($string, ENT_QUOTES); and htmlentities($string, ENT_QUOTES); but these don't seem to work (maybe its me). stripslashes() is the immediate solution, but you might also want to consider the various 'magic_quotes' settings in your php.ini -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: quotes in text strings
Javier Montserat wrote: Hi Single quote's in strings entered via a text input field are subsequently appearing with what appears to be an escape character - comm\'ents how can i correct this? I've tried htmlspecialchars($string, ENT_QUOTES); and htmlentities($string, ENT_QUOTES); but these don't seem to work (maybe its me). Probably you have magic_quotes_gpc set to On in php.ini...you can change this to Off, or you can use stripslashes() on the $string variable... HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Recursive Replace
? for ($i = 7; $i sizeof($info); $i+=1) { echo $info[$i]; } ? That line of code successfully will display lines 7 and on of an included text file into my HTML boilerplate. However, in my hundreds of source text files, br is not included at the end of the lines, therefore lines 7 and on appear as one chunk of text, rather than neatly formatted lines. How can I combine that line of code with str_replace() or some other replace function in order to turn \n into br for each line. I've experimented with several different possibilities, but none of them output anything. Please help ASAP. The lyrics site is the most popular part of my website, and unfortunately it's down until I get this code figured out. -- Kyrie Eleison, Rick www.spiritsword.com/phpBB2/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] eregi_replace / preg_match_all
-Original Message- From: Jennifer Swofford [mailto:[EMAIL PROTECTED]] Sent: 01 October 2002 21:21 To: [EMAIL PROTECTED] Subject: [PHP] eregi_replace / preg_match_all Why does this work: $contents = eregi_replace((\)(.(/))*[A-Z0-9_/-]+(.gif|.jpg), \blah.gif, $contents); But this does not: preg_match_all((\)(.(/))*[A-Z0-9_/-]+(.gif|.jpg), $contents, $matches); for ($i=0; $i count($matches[0]); $i++) { echo matched: .$matches[0][$i].\n } I get this error: Warning: Unknown modifier '(' in /home/littleduck/www/www/newcontrol/temp/fread.php on line 20 Well, first of all you've switched from a POSIX-extended regular expression function, eregi_replace(), to a Perl-compatible regular expression (PCRE) function, preg_match_all() -- all the POSIX-extended function names begin with an e, and all the PCRE ones with a p. The rules are different for the two sets, and one of the most important ones is that the PCRE functions require the pattern to be enclosed within delimiters, and the POSIX-extended ones don't (this is because you can add optional _modifiers_ after the ending delimiter for PCRE matching). The syntax of the regular expressions is also slightly different, and a pattern that works reliably for PCRE won't necessarily for POSIX-extended, and vice versa -- especially as PCRE is far more versatile and feature-rich. So, your basic problem in the preg_match_all() is that you haven't *added* delimiters -- the requirement is that you must use the same character both before and after your pattern, or a matched pair from one of the sets (), {}, [], and . So, the pattern parser is seeing the initial ( in your expression, treating it as the opening delimiter, and taking your basic pattern to be the text up to the matching ) -- that is, just (\). It then looks to see if the next character is a valid _modifier_ (remember them?), finds ( which isn't one, and complains -- and bingo!, there's your Unknown modifier '(' message. So, this, for example, would work: preg_match_all({(\)(.(/))*[A-Z0-9_/-]+(.gif|.jpg)}, $contents, $matches); although I'd point out that . is a pattern-matching element that means any character, so you might prefer to escape it -- unfortunately, both regular expressions and PHP's double-quoted strings use \ as their escape character, so to get a single backslash into the expression to escape the ., you've got to use two \\s (and to match an actual single backslash, you have to write no less than *four* backslashes!). So this would give: preg_match_all({(\)(\\.(/))*[A-Z0-9_/-]+(\\.gif|\\.jpg)}', $contents, $matches); Because of the problems with backslash breeding that this can cause, I'd always recommend using single-quoted strings for your patterns -- especially as, in this case, you have a double-quote in the pattern! Thus, my final effort would be: preg_match_all('{()(\.(/))*[A-Z0-9_/-]+(\.gif|\.jpg)}', $contents, $matches); Lastly, you may care to search the archives of this list for postings about the relative efficiency of the two types of expressions -- I know one set is frequently recommended as more efficient than the other, but can never remember which! Hope this is helpful, 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] Recursive Replace
Hi Rick, How can I combine that line of code with str_replace() or some other replace function in order to turn \n into br for each line. I think you're looking for http://www.php.net/nl2br. Specifically: for ($i = 7; $i sizeof($info); $i+=1) echo nl2br($info[$i]); Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Recursive Replace
Nevermind. Leave it to me to make a very stupid mistake. I fixed it though, and now it works great. For any who are interested, here is the working code... Dunno why you'd need it, but whatever: ? for ($i = 7; $i sizeof($info); $i+=1) { $new7 = str_replace(\n,br,$info[$i]); echo $new7; } ? My mistake was leaving that I left the second '$' out of '$info[$i]'. At least I found it before I frustrated myself. Thanks anyway! :-) -- Kyrie Eleison, Rick www.spiritsword.com/phpBB2/ Rick Beckman wrote: ? for ($i = 7; $i sizeof($info); $i+=1) { echo $info[$i]; } ? That line of code successfully will display lines 7 and on of an included text file into my HTML boilerplate. However, in my hundreds of source text files, br is not included at the end of the lines, therefore lines 7 and on appear as one chunk of text, rather than neatly formatted lines. How can I combine that line of code with str_replace() or some other replace function in order to turn \n into br for each line. I've experimented with several different possibilities, but none of them output anything. Please help ASAP. The lyrics site is the most popular part of my website, and unfortunately it's down until I get this code figured out. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php question
-Original Message- From: michael saxbury [mailto:[EMAIL PROTECTED]] Sent: 01 October 2002 22:57 I am trying to understand in deatil exactly what PHP is, I know that it is a scripting markup type language, but. Is it correct to say that PHP is essentially just C++ code wrapped in PHP blocks which are embedded in HTML? Good grief, no! PHP syntax may be c-*like*, but it is definitely *not* c++. There are many important differences (some of them very subtle) that will reach out and bite you if you think of it as c++. PHP is itself, a separate and distinct language, and should not be thought of in any other clothes...!! Its original and principal use is as a server-side scripting language, but it now has a command-line version, and people have even played with active-scripting and (if I've read recent postings right!) c-embedded versions. 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] backwards compat for newly developed scripts ($_GET / $HTTP_GET_VARS)
-Original Message- From: Paul Nicholson [mailto:[EMAIL PROTECTED]] Sent: 02 October 2002 02:11 Hey gang, I've been wondering about developing scripts that the end-user might run on php 4.1.0. I've heard allot of ways except for one that I recently thought of. How about using: - if(!isset($_GET)) { global $HTTP_GET_VARS; $_GET = $HTTP_GET_VARS; } - ? That allows you to use $_GET as if you were using the new versions and it only requires one lineand doesn't depend on the new versions to have $HTTP_*_VARS. It also works for the other vars(POST, SESSION, etc). I think this is going the wrong way about it -- the $HTTP_*_VARS arrays may be deprecated, but the PHP developers have confirmed that they are not going to disappear any time soon, so for code that has to work regardless of register_globals setting and existence or not of superglobals, I'd stick with those. (And, as already pointed out, the $_* arrays you create in this way are *not* superglobals, and so would need to be globalled in every function which references them, just like the $HTTP_*_VARS arrays -- so the only saving is maybe a few characters less to type, but with the addition of much potential for confusion.) 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] access denied
The PHP script im using works on my computers server, but when after uploading to my web server i get this... Warning: fopen(wtest.txt, wb+) - Permission denied in /home/canberra/public_html/bomonster/canberra.php on line 6 Dunno why either, the directory is not protected, can anyne help me with this? one? The particular code in question... //Writing of local file $rContents = implode( \r\n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); if( ($fp = fopen( 'wtest.txt', 'wb+' )) !== false ) { fputs( $fp, $rContents ); fclose( $fp ); } -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Recursive Replace
-Original Message- From: Rick Beckman [mailto:[EMAIL PROTECTED]] Sent: 02 October 2002 12:12 ? for ($i = 7; $i sizeof($info); $i+=1) { echo $info[$i]; } ? That line of code successfully will display lines 7 and on of an included text file into my HTML boilerplate. However, in my hundreds of source text files, br is not included at the end of the lines, therefore lines 7 and on appear as one chunk of text, rather than neatly formatted lines. How can I combine that line of code with str_replace() or some other replace function in order to turn \n into br for each line. If it's genuinely one line per $info[] element, just add the dad-blamed br to your echo: ? for ($i = 7; $i sizeof($info); $i+=1) { echo $info[$i], 'br'; } ? 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] PHP and Flash
From: Rebekah Garner [EMAIL PROTECTED] Okay, this may be a bit off topic, BUT we just finished a website using PHP, MySql and Flashwell, I need someone...anyone to check out this URL for me and click on the Stallions menu, and tell me if anything loads into the text field. The client swears that it isn't, but it is dammit. Or is it? http://www.overbrookfarm.myiglou.com/ Works fine for me in Mac OS 9.2, both Mozilla 1.0 and IE 5.1, Flash player 6. But with Mac OS 9, IE 5.1 and Flash player 5, I get a blank page. -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recursive Replace
Thanks everyone! Works great! :-) If only I would have noticed how obvious it was before trying making it more difficult than I had to. -- Kyrie Eleison, Rick www.spiritsword.com/phpBB2/ Mike Ford wrote: -Original Message- From: Rick Beckman [mailto:[EMAIL PROTECTED]] Sent: 02 October 2002 12:12 ? for ($i = 7; $i sizeof($info); $i+=1) { echo $info[$i]; } ? That line of code successfully will display lines 7 and on of an included text file into my HTML boilerplate. However, in my hundreds of source text files, br is not included at the end of the lines, therefore lines 7 and on appear as one chunk of text, rather than neatly formatted lines. How can I combine that line of code with str_replace() or some other replace function in order to turn \n into br for each line. If it's genuinely one line per $info[] element, just add the dad-blamed br to your echo: ? for ($i = 7; $i sizeof($info); $i+=1) { echo $info[$i], 'br'; } ? 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] How to send POST info without a form?
[snip] from the client end, you can't from the server end, you can use curl. ... but I want to submit the action value as a POST rather than a GET. I then have conditionals around each of my modules that check $_POST['action'] for one of three values and only print that module if that's the action I need the file to perform. Basically I'm trying to figure out how to lump this all into one file. Obviously I could split it into three files that do each of the desired actions, but I would then also have to have a fourth file which provides a front end into it, which I don't want to do and is what got me started down this path. How can I submit POST information to a php file without using an HTML form? [/snip] http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51 HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Regular expression help converting doc to xml
(For the archives) The RegEx I finally used was this: search: D(.*) replace: DD\1/DD I tried this in 3 editors: jEdit, eMacs and BBEdit jEdit interpreted the replace expression as literally \1 eMacs didn't like the parenthesis in the search string In BBEdit it worked like a charm. Not sure why. Perhaps different implementations of RegEx. Is this true? On Fri, 2002-09-27 at 16:53, John Holmes wrote: I have a fairly large html document that I need to convert to xml. The current format is is: DD A whole bunch of text DT Something else /DT (There is a new line in there before DT) Which I need to convert to DD A whole bunch of text /DD DT Something else /DT $new_text = str_replace(\n\tDT,/DD\n\tDT,$your_text); Assuming there is a tab in there... You'd be better off getting an editor that'll do this for you. Textpad lets you search and replace with regular expressions. Other programs do too. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] backwards compat for newly developed scripts ($_GET / $HTTP_GET_VARS)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 yeah, at the top of each functionwhere you would normally put global $HTTP_GET_VARS; The created $_GET is not a superglobal so its scope is only in the function its defined in or if you define it in the global namespace you'd have to global $_GET; inside of your function I'm sure that'll conflict with the superglobals on newer versions. On Wednesday 02 October 2002 12:13 am, Sascha Cunz wrote: At the top of each _function_? Urgs. Sounds like a hell of a lot of work. Would be enough at the beginning of the script - or even better, creating a dummy include for that or it might even be posibile to run it via an .htaccess (how is this option named php_prepend or such?). ... If they can't update the PHP Version they should update the ISP :-) Well, 4.0.6 might be a famous release (as you can find this very often), but it's about 1 year old now... If ISPs don't updated, they make their own machines vulnerable - the only conclusion (to make them learn their lesson) can be, that customers keep on running away, ain't it? Thats if they notice the one or two clients that leave over this issue. :| - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9muqkDyXNIUN3+UQRAiHUAJ4mxVd+makwIpmvsgIYauKCPl+mhwCeMrFA z4cX5Z3+ib/hirVLc5cSHbA= =Se8t -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and Flash
Not sure where you mean by 'into the text field' but I see a drop down menu with a photo loaded underneath and then underneath that further menus with more pics of horses. Debbie - Original Message - From: Lowell Allen [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 12:40 PM Subject: Re: [PHP] PHP and Flash From: Rebekah Garner [EMAIL PROTECTED] Okay, this may be a bit off topic, BUT we just finished a website using PHP, MySql and Flashwell, I need someone...anyone to check out this URL for me and click on the Stallions menu, and tell me if anything loads into the text field. The client swears that it isn't, but it is dammit. Or is it? http://www.overbrookfarm.myiglou.com/ Works fine for me in Mac OS 9.2, both Mozilla 1.0 and IE 5.1, Flash player 6. But with Mac OS 9, IE 5.1 and Flash player 5, I get a blank page. -- Lowell Allen -- 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 send POST info without a form?
hi, you can make a hidden form l like this form style=visibilty:hidden;position:absolute;top:0px;left:0px; action=yourpage.php method=post id=myform .. form fields /form //in javascript you can use this myform.submit() and your form will be submited khalid _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using PHP to create tables?
In order to get my site on-line, I need to upload all my files, and create a few PostgreSQL tables that the scripts rely upon. I've created a script that should create these tables, but in testing it, nothing happens - no tables are created. I wondering whether it's even possible to create these tables from php? The other possibility is to use pg_dump, but again, wouln't that require that the tables already exist on the server? So, I guess my question is: can I use php to accomplish these tasks, or do I have to have access to psql (server-side)? Here's the script I've created: ?php include(dbc.php); /* db connection script to pre-existing db on server*/ $ct = CREATE TABLE dip ( rid serial int4 NOT NULL, rfname varchar(50) NOT NULL, rsname varchar(50) NOT NULL, rm1name varcahr(50), rm2name varchar(50), rm3name varchar(50), rinit varchar(8), rnee varchar(50), rcity varchar(50), rprov varchar(50), rcountry varchar(50), rdate date, rsponsor int4, radopt int4, rpix varchar(50), rproduct varchar(50), rplacement varchar(50), robid int4, rmemid int4, rbook text, rconfirm int4, rupload varchar(200) ); ? Sorry for the real 'newbie' question here, but this is something I've never done, so I'm going in totally blind. I'd greatly appreciate any advice concerning what to do, or watch out for. Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Using PHP to create tables?
[snip] I've created a script that should create these tables, but in testing it, nothing happens - no tables are created. I wondering whether it's even possible to create these tables from php? ... So, I guess my question is: can I use php to accomplish these tasks, or do I have to have access to psql (server-side)? ... [/snip] Yes it is possible, and you should include some sort of error checking to find why you are having problems. I recommend the mysql_error() function as a good place to start. You'll probably get some sort of permissions problem. HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP to create tables?
It appears to me you are not actually executing the SQL you are storing in the varible. Did you accidently miss that out of your email? I would supply you with more information but I don't know how to use PostgreSQL, but since you are coding with it, I guess you should be able to figure out the correct command Andrew - Original Message - From: Andre Dubuc [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 2:44 PM Subject: [PHP] Using PHP to create tables? In order to get my site on-line, I need to upload all my files, and create a few PostgreSQL tables that the scripts rely upon. I've created a script that should create these tables, but in testing it, nothing happens - no tables are created. I wondering whether it's even possible to create these tables from php? The other possibility is to use pg_dump, but again, wouln't that require that the tables already exist on the server? So, I guess my question is: can I use php to accomplish these tasks, or do I have to have access to psql (server-side)? Here's the script I've created: ?php include(dbc.php); /* db connection script to pre-existing db on server*/ $ct = CREATE TABLE dip ( rid serial int4 NOT NULL, rfname varchar(50) NOT NULL, rsname varchar(50) NOT NULL, rm1name varcahr(50), rm2name varchar(50), rm3name varchar(50), rinit varchar(8), rnee varchar(50), rcity varchar(50), rprov varchar(50), rcountry varchar(50), rdate date, rsponsor int4, radopt int4, rpix varchar(50), rproduct varchar(50), rplacement varchar(50), robid int4, rmemid int4, rbook text, rconfirm int4, rupload varchar(200) ); ? Sorry for the real 'newbie' question here, but this is something I've never done, so I'm going in totally blind. I'd greatly appreciate any advice concerning what to do, or watch out for. Tia, Andre -- 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] Quick question.
Simon Angell wrote: Thanks for that Robert *it works*, now i have 1 more problem, after uploading to my web server i get this... Warning: fopen(wtest.txt, wb+) - Permission denied in /home/canberra/public_html/bomonster/canberra.php on line 6 Dunno why either, the directory is not protected, can you help me with that one? What are the permissions and ownerships? Do these ownerships and permissions match up with the webserver versus your own ownership? Cheers, Rob. -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Windows makes me cry... this will fix the problem... Change: $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); To: $rContents = implode( \r\n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); If that doesn't work: To: $rContents = implode( \n\r, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); I can never remember the order :) Cheers, Rob. Simon Angell wrote: i removed a / and it worked :) ?php $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); if( ($fp = fopen( 'test/canberratest.txt', 'w+' )) !== false ) { fputs( $fp, $rContents ); fclose( $fp ); } ? Now the format of the content is no longer, can this be fixed? This is how it is originally. IDN10035 BUREAU OF METEOROLOGY CANBERRA METEOROLOGICAL OFFICE FORECAST FOR THE ACT Issued at 3:34pm on Tuesday the 1st of October 2002 SITUATION: AND this is how the text file writes IDN10035BUREAU OF METEOROLOGYCANBERRA METEOROLOGICAL OFFICEFORECAST FOR THE ACTIssued at 3:34pm on Tuesday the 1st of October 2002SITUATION: with all through it where a new line is suppose to be. Can this be fixed, or will i just need to work around it? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Simon Angell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... i tried that ine and got this... Warning: fopen(/test/canberra.txt, w+) - No such file or directory in C:\Xitami\webpages\bomonster\test2.php on line 4 code.. ?php $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false ) { fputs( $fp, $rContents ); fclose( $fp ); } ? I think i know what the probelm is. .if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false ) should be if( ($fp = fopen( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' , 'w+' )) !== false ) But, where do i put the file name and directory to write? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Simon Angell wrote: Hi everyone. I asked this a week or so ago but i am unsure if it got to the list, so here we go again. I am trying to get a remote file to be copied onto my own web server, I have looked at fopen() and fread() and fwrite() and get the general idea of each, but im wondering how to join the commandes to get the file i want from the remote ftp server, copied and written onto my own server. Something like the following might work (not tested AT ALL): $rContents = implode( \n, file( 'ftp://www.foo.bar/me/my/data.txt' ) ); if( ($fp = fopen( '/tmp/myFile.txt', 'w+' )) !==
Re: [PHP] mail function problems
They found the problem, the webserver that the client was on had the wrong path to sendmail, a correction in php.ini and a restart and it was working again. --- Debbie Dyer [EMAIL PROTECTED] wrote: Hi Dan I (and others I know) have similar probs of seemingly disappearing emails - I thought it was down to mail filtering because I cant think of another explanation (but I dont know that for sure). I was given some advice here yesterday so I am forwarding you the mails. Debbie - Original Message - From: Dan McCullough [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 12:46 AM Subject: [PHP] mail function problems I use the mail function tons, never had a problem. I am working with a client with a different hosting vendor, they are using PHP 4.2.3, which I guess was a recient upgrade, anyway I was informed by the client that he wasnt getting email submissions from the website, but he was getting other emails, to those same accounts that were from outside the website. Short story long, I took one of the functions that uses the mail function inside of it, and I placed it on my server, and it worked flawlessly, place the same exact code on back on the other site, and nothing. Oh and I dont have access to their error logs. :( What sounds wrong? What sounds bad? Any thoughts? Anything i can look for? thanks, dan __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Theres no such thing as a problem unless the servers are on fire! __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com = Theres no such thing as a problem unless the servers are on fire! __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP to create tables?
Hi Andrew, Oh, I feel SO stupid! I 'forgot' that line in my code! Sigh . . . I've just got a big serving of humble-pie! I probably would have stared at that code for hours without noticing it. Thanks! (btw, nice name, eh?) Regards, Andre On Wednesday 02 October 2002 09:53 am, Andrew Brampton wrote: It appears to me you are not actually executing the SQL you are storing in the varible. Did you accidently miss that out of your email? I would supply you with more information but I don't know how to use PostgreSQL, but since you are coding with it, I guess you should be able to figure out the correct command Andrew - Original Message - From: Andre Dubuc [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 2:44 PM Subject: [PHP] Using PHP to create tables? In order to get my site on-line, I need to upload all my files, and create a few PostgreSQL tables that the scripts rely upon. I've created a script that should create these tables, but in testing it, nothing happens - no tables are created. I wondering whether it's even possible to create these tables from php? The other possibility is to use pg_dump, but again, wouln't that require that the tables already exist on the server? So, I guess my question is: can I use php to accomplish these tasks, or do I have to have access to psql (server-side)? Here's the script I've created: ?php include(dbc.php); /* db connection script to pre-existing db on server*/ $ct = CREATE TABLE dip ( rid serial int4 NOT NULL, rfname varchar(50) NOT NULL, rsname varchar(50) NOT NULL, rm1name varcahr(50), rm2name varchar(50), rm3name varchar(50), rinit varchar(8), rnee varchar(50), rcity varchar(50), rprov varchar(50), rcountry varchar(50), rdate date, rsponsor int4, radopt int4, rpix varchar(50), rproduct varchar(50), rplacement varchar(50), robid int4, rmemid int4, rbook text, rconfirm int4, rupload varchar(200) ); ? Sorry for the real 'newbie' question here, but this is something I've never done, so I'm going in totally blind. I'd greatly appreciate any advice concerning what to do, or watch out for. Tia, Andre -- 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] Quick question.
I am the webmaster of the site, i pay for the server space, is that what you mean? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Simon Angell wrote: Thanks for that Robert *it works*, now i have 1 more problem, after uploading to my web server i get this... Warning: fopen(wtest.txt, wb+) - Permission denied in /home/canberra/public_html/bomonster/canberra.php on line 6 Dunno why either, the directory is not protected, can you help me with that one? What are the permissions and ownerships? Do these ownerships and permissions match up with the webserver versus your own ownership? Cheers, Rob. -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Windows makes me cry... this will fix the problem... Change: $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); To: $rContents = implode( \r\n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); If that doesn't work: To: $rContents = implode( \n\r, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); I can never remember the order :) Cheers, Rob. Simon Angell wrote: i removed a / and it worked :) ?php $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); if( ($fp = fopen( 'test/canberratest.txt', 'w+' )) !== false ) { fputs( $fp, $rContents ); fclose( $fp ); } ? Now the format of the content is no longer, can this be fixed? This is how it is originally. IDN10035 BUREAU OF METEOROLOGY CANBERRA METEOROLOGICAL OFFICE FORECAST FOR THE ACT Issued at 3:34pm on Tuesday the 1st of October 2002 SITUATION: AND this is how the text file writes IDN10035BUREAU OF METEOROLOGYCANBERRA METEOROLOGICAL OFFICEFORECAST FOR THE ACTIssued at 3:34pm on Tuesday the 1st of October 2002SITUATION: with all through it where a new line is suppose to be. Can this be fixed, or will i just need to work around it? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Simon Angell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... i tried that ine and got this... Warning: fopen(/test/canberra.txt, w+) - No such file or directory in C:\Xitami\webpages\bomonster\test2.php on line 4 code.. ?php $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false ) { fputs( $fp, $rContents ); fclose( $fp ); } ? I think i know what the probelm is. .if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false ) should be if( ($fp = fopen( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' , 'w+' )) !== false ) But, where do i put the file name and directory to write? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in
Re: [PHP] Quick question.
No i mean switch to the directory in which you have th file with the code and type 'ls -al' Then look at the permissions and ownerships. Don't forget the web server runs with different permissions thatn you do at home. Cheers, Rob. Simon Angell wrote: I am the webmaster of the site, i pay for the server space, is that what you mean? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Simon Angell wrote: Thanks for that Robert *it works*, now i have 1 more problem, after uploading to my web server i get this... Warning: fopen(wtest.txt, wb+) - Permission denied in /home/canberra/public_html/bomonster/canberra.php on line 6 Dunno why either, the directory is not protected, can you help me with that one? What are the permissions and ownerships? Do these ownerships and permissions match up with the webserver versus your own ownership? Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question.
i am unsure what you mean, where exactly do it type in 'ls -al' ? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... No i mean switch to the directory in which you have th file with the code and type 'ls -al' Then look at the permissions and ownerships. Don't forget the web server runs with different permissions thatn you do at home. Cheers, Rob. Simon Angell wrote: I am the webmaster of the site, i pay for the server space, is that what you mean? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Simon Angell wrote: Thanks for that Robert *it works*, now i have 1 more problem, after uploading to my web server i get this... Warning: fopen(wtest.txt, wb+) - Permission denied in /home/canberra/public_html/bomonster/canberra.php on line 6 Dunno why either, the directory is not protected, can you help me with that one? What are the permissions and ownerships? Do these ownerships and permissions match up with the webserver versus your own ownership? Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Images problem
Hi, I know that is old problem, but I could'n solved until now. Sorry for any inconvenience. I've installed gd-2.0.1 (in /my/home) and php-4.2.3 with the following options: ./configure --with-mysql --with-apache=../apache_1.3.26 --with-gd=/my/home/gd-2.0.1 --prefix=/my/home/local --with-freetype-dir=/usr --enable-gd-native-ttf --enable-gd-imgstrttf --with-jpeg-dir=/usr --with-png-dir=/usr -with-zlib --enable-track-vars The OS is Solaris 2.8. Everything went ok, but when I try to create on fly a png image, it doesn't create a image on my web browser. I don't see any errors in apache error_log. The source of the my script is: ?php header (Content-type: image/png); $im = imagecreate (50, 100) or die (Cannot Initialize new GD image stream); $background_color = imagecolorallocate ($im, 255, 255, 255); $text_color = imagecolorallocate ($im, 233, 14, 91); imagestring ($im, 1, 5, 5, A Simple Text String, $text_color); imagepng ($im); ? Any ideea where I should look for errors, etc? Thank you in advance, Mihaela __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Images problem
Hi, I know that is old problem, but I could'n solved until now. Sorry for any inconvenience. I've installed gd-2.0.1 (in /my/home) and php-4.2.3 with the following options: ./configure --with-mysql --with-apache=../apache_1.3.26 --with-gd=/my/home/gd-2.0.1 --prefix=/my/home/local --with-freetype-dir=/usr --enable-gd-native-ttf --enable-gd-imgstrttf --with-jpeg-dir=/usr --with-png-dir=/usr -with-zlib --enable-track-vars The OS is Solaris 2.8. Everything went fine, but when I try to create on fly a png image, it doesn't create a image on my web browser. I don't see any errors in apache error_log. The source of the my script is: ?php header (Content-type: image/png); $im = imagecreate (50, 100) or die (Cannot Initialize new GD image stream); $background_color = imagecolorallocate ($im, 255, 255, 255); $text_color = imagecolorallocate ($im, 233, 14, 91); imagestring ($im, 1, 5, 5, A Simple Text String, $text_color); imagepng ($im); ? Any ideea where I should look for errors, etc? Thank you in advance, Mihaela __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php 4.2.3 giving prob.
hi, i am facing a strange problem i am using php 4.2.3 the url says http://ipaddress/admin/add_doc.php?id=264mode=add;. but in the php file when i try to print $id and $mode it couldnt print the values.. but in some other files it successfully reads the parameters from url. moreover, the same code is working fine in some older version of php..(on another machine) what m i doing wrong here? can someone give me some pointers. thanx and regards anil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Recursive Replace
If it's genuinely one line per $info[] element, just add the dad-blamed br to your echo: ? for ($i = 7; $i sizeof($info); $i+=1) { echo $info[$i], 'br'; } ? Also, just an FYI to the OP, you may want to calculate sizeof($info) before hand, and use a variable in your for() statement. That way it doesn't have to calculate sizeof() each loop... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 4.2.3 giving prob.
Turn on register_globals in your php.ini On Wed, 2 Oct 2002, Anil Garg wrote: hi, i am facing a strange problem i am using php 4.2.3 the url says http://ipaddress/admin/add_doc.php?id=264mode=add;. but in the php file when i try to print $id and $mode it couldnt print the values.. but in some other files it successfully reads the parameters from url. moreover, the same code is working fine in some older version of php..(on another machine) what m i doing wrong here? can someone give me some pointers. thanx and regards anil -- 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] How can I check for variances in spelling within form text input fields?
Hi, I would like some ideas on how to perform the following. Any input from the PHP gurus would be appreciated. I have a form where my customer feels out certain information. Part of this information is the company name, address, city and state/province of their customer. I have to assign a unique number to their customer based on the information they typed in. Here is my problem: 1) They may enter the same customer twice but have a slightly different spelling (maybe adding a LTD. to the company name) 2) Two of my customers may have the same customer. They will type it into my form but again with variant spelling. I would like to know if there is an algorithm which allows me to check for small variances in spelling so that I would know if this customer has already been assigned my unique number and therefore not assign a duplicate number. Thanks, Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP with GD and Jpeg
If have gd 1.8.4 compiled with zlib and jpeg support... This works fine but whenever I try to make php 4.2.3: configure --enable-track-vars --enable-trans-sid --with-mysql --with-apxs -- with-gd --with-jpeg-dir=/usr/local/lib --with-zlib I register following line: checking for gdImageCreateformGif in -lgd... (cached) no checking for gdImageCreateformjpeg in -lgd... (cached) no Can you tell me whats my fault? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Images problem
Hi, I know that is old problem, but I could'n solved until now. Sorry for any inconvenience. I've installed gd-2.0.1 (in /my/home) and php-4.2.3 with the following options: ./configure --with-mysql --with-apache=../apache_1.3.26 --with-gd=/my/home/gd-2.0.1 --prefix=/my/home/local --with-freetype-dir=/usr --enable-gd-native-ttf --enable-gd-imgstrttf --with-jpeg-dir=/usr --with-png-dir=/usr -with-zlib --enable-track-vars The OS is Solaris 2.8. Everything went ok, but when I try to create on fly a png image, it doesn't create a image on my web browser. I don't see any errors in apache error_log. The source of the my script is: ?php header (Content-type: image/png); $im = imagecreate (50, 100) or die (Cannot Initialize new GD image stream); $background_color = imagecolorallocate ($im, 255, 255, 255); $text_color = imagecolorallocate ($im, 233, 14, 91); imagestring ($im, 1, 5, 5, A Simple Text String, $text_color); imagepng ($im); ? Any ideea? P.S Using I.E explorer as web browser get the error: Call to undefined function: imagejpeg() in b/my/home/usr/local/apache_1.3.26/htdocs/test1.php/b on line b8/bbr / Thank you in advance, Mihaela __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache2 and PHP4.2.3 - errors
PHP doesn't officially support Apache2 at this point. Go back to Apache1. On Thu, 3 Oct 2002, Chris Aitken wrote: Hi all, I have recently upgraded to apache2 on my FreeBSD 4.6 box, and the upgrade worked well, the daemon was running and serving pages etc. So I installed the latest PHP build in my ports tree (4.2.3) and it compiled no problems, but when I added the required lines into my httpd.conf to make it run, I get the following error when I try and start apache # apachectl start Syntax error on line 273 of /usr/local/etc/apache2/httpd.conf: Cannot load /usr/local/libexec/apache2/libphp4.so into server: /usr/local/libexec/apache2/libphp4.so: Undefined symbol pthread_getspecific now line 273 of my httpd.conf file is LoadModule php4_modulelibexec/apache2/libphp4.so And that file exists, so I really dont know what the problem is. Any help on this would be greatly appreciated. Chris -- 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] Looking for work
Hi, my name is Clint Tredway and I am a web developer in Dallas Texas. I am looking for any projects that you may need help with. My rates are very reasonable and I can be reached at anytime. Thanks, Clint -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting users IP address into a variable.
I'm sure there has to be a way to verify which IP address is accessing from. I need to establish a page where when I enter it records the IP address I'm logging in from, to a database. Problem is I can't seem a command in php that can assign that to a variable, as in: $ip=HTTP_GET_ ANY IDEAS Thanks Elliot J. Balanza -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting users IP address into a variable.
$REMOTE_ADDR On Wed, 2 Oct 2002, Webmaster MBTRADINGCO wrote: I'm sure there has to be a way to verify which IP address is accessing from. I need to establish a page where when I enter it records the IP address I'm logging in from, to a database. Problem is I can't seem a command in php that can assign that to a variable, as in: $ip=HTTP_GET_ ANY IDEAS Thanks Elliot J. Balanza -- 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] Getting users IP address into a variable.
Try: $ip=$_SERVER['REMOTE_ADDR'] -Original Message- From: Webmaster MBTRADINGCO [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 1:08 PM To: [EMAIL PROTECTED] Subject: [PHP] Getting users IP address into a variable. I'm sure there has to be a way to verify which IP address is accessing from. I need to establish a page where when I enter it records the IP address I'm logging in from, to a database. Problem is I can't seem a command in php that can assign that to a variable, as in: $ip=HTTP_GET_ ANY IDEAS Thanks Elliot J. Balanza -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** Any views, opinions or authorizations contained in this email are solely those of the author and do not necessarily represent those of ArvinMeritor, Inc. If you are not familiar with the corporate authority of the author, please obtain confirmation in writing of the content of this email prior to taking any action on the basis of the information. If you are not the intended recipient, you are hereby notified that any disclosure, copying or distribution of the information enclosed is strictly prohibited. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache2 and PHP4.2.3 - errors
Hi all, I have recently upgraded to apache2 on my FreeBSD 4.6 box, and the upgrade worked well, the daemon was running and serving pages etc. So I installed the latest PHP build in my ports tree (4.2.3) and it compiled no problems, but when I added the required lines into my httpd.conf to make it run, I get the following error when I try and start apache # apachectl start Syntax error on line 273 of /usr/local/etc/apache2/httpd.conf: Cannot load /usr/local/libexec/apache2/libphp4.so into server: /usr/local/libexec/apache2/libphp4.so: Undefined symbol pthread_getspecific now line 273 of my httpd.conf file is LoadModule php4_modulelibexec/apache2/libphp4.so And that file exists, so I really dont know what the problem is. Any help on this would be greatly appreciated. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Getting users IP address into a variable.
Hi, I'm sure there has to be a way to verify which IP address is accessing from. $ip=HTP_GET_ $REMOTE_ADDR ...and to deal with some (but not all) proxies: $ip = (getenv(HTTP_X_FORWARDED_FOR)) ? getenv(HTTP_X_FORWARDED_FOR) : getenv(REMOTE_ADDR); Either way you're still going to get stuff that isn't right, so make sure (a) you validate the contents of $ip before doing anything with it, and (b) you're not using it for anything critical. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache2 and PHP4.2.3 - errors
I haven't tried php with apache 2 on linux yet, but the windows distribution of php has 2 dlls: php4apache.dll and php4apache2.dll; there's nothing in the documentation about the second dll whatsoever, neither any installation guide for Apache 2; the guide actually says using the php4apache.dll as a module, and obviously it didn't work. Looking around I found the second file and it works perfectly... there should be something like this in the linux distribution too. __ Ionut PHP doesn't officially support Apache2 at this point. Go back to Apache1. On Thu, 3 Oct 2002, Chris Aitken wrote: Hi all, I have recently upgraded to apache2 on my FreeBSD 4.6 box, and the upgrade worked well, the daemon was running and serving pages etc. So I installed the latest PHP build in my ports tree (4.2.3) and it compiled no problems, but when I added the required lines into my httpd.conf to make it run, I get the following error when I try and start apache # apachectl start Syntax error on line 273 of /usr/local/etc/apache2/httpd.conf: Cannot load /usr/local/libexec/apache2/libphp4.so into server: /usr/local/libexec/apache2/libphp4.so: Undefined symbol pthread_getspecific now line 273 of my httpd.conf file is LoadModule php4_modulelibexec/apache2/libphp4.so And that file exists, so I really dont know what the problem is. Any help on this would be greatly appreciated. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting users IP address into a variable.
Try: $ip = ; if ( $HTTP_X_FORWARDED_FOR ) { $ip = $HTTP_X_FORWARDED_FOR; } elseif( $HTTP_VIA ) { $ip = $HTTP_VIA; } elseif( $REMOTE_ADDR ) { $ip = $REMOTE_ADDR; } else { die(); // or perhaps some better response } --- Webmaster MBTRADINGCO [EMAIL PROTECTED] wrote: I'm sure there has to be a way to verify which IP address is accessing from. I need to establish a page where when I enter it records the IP address I'm logging in from, to a database. Problem is I can't seem a command in php that can assign that to a variable, as in: $ip=HTTP_GET_ ANY IDEAS Thanks Elliot J. Balanza -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Bill Farrell Multivalue and *nix Support Specialist Phone: (828) 667-2245 Fax: (928) 563-5189 Web: http://www.jwfarrell.com __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getImageSize
anyone know what migth cause this error. I changed the mode to 777, made sure that is was the correct owner.group. getimagesize: Unable to open 'images/product/i3_berkeley_bed_2drw.jpg' for reading = Theres no such thing as a problem unless the servers are on fire! __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I check for variances in spelling within form text input fields?
Don I am not a 'PHP guru' and I dont know where you can find an algorithm but:- If the only problem is users adding/not using name extensions, then for your company exists already test you could remove known extensions from the input company name - ltd, plc, etc - and replace this with a wildcard for the check. eg. SELECT id FROM table WHERE name LIKE '$input_name_without_extensions%' Debbie - Original Message - From: DonPro [EMAIL PROTECTED] To: php list [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 4:27 PM Subject: [PHP] How can I check for variances in spelling within form text input fields? Hi, I would like some ideas on how to perform the following. Any input from the PHP gurus would be appreciated. I have a form where my customer feels out certain information. Part of this information is the company name, address, city and state/province of their customer. I have to assign a unique number to their customer based on the information they typed in. Here is my problem: 1) They may enter the same customer twice but have a slightly different spelling (maybe adding a LTD. to the company name) 2) Two of my customers may have the same customer. They will type it into my form but again with variant spelling. I would like to know if there is an algorithm which allows me to check for small variances in spelling so that I would know if this customer has already been assigned my unique number and therefore not assign a duplicate number. Thanks, Don -- 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] Inheritance and a class function: on what class was it called?
Assume you've got some class that has one or more classes inherited from it. The parent class has a function that is normally called using the :: operator (a class function). Assume also that the class function is never called from an object function. Is it possible to find if the class function was called on the parent class, or on the child class? example: Class A has a function foo(), callable by A::foo(). Class B extends A. If outside code makes the call B::foo(), can you tell from within foo() that the function was called on B and not A? I think this is impossible but I want to confirm that suspicion. It's important that the call B::foo() isn't made from inside any object function, so that there's no context for the $this variable; the get_class() function isn't applicable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting users IP address into a variable.
Webmaster MBTRADINGCO wrote: I'm sure there has to be a way to verify which IP address is accessing Don't count on it to identify users on the internet though. Regards Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Math problem (222)
For a coursework assignment I have to investigate this thing where you do the following for example: 264- Choose 3 digits that are not the same 12 - Find the sum of them. 264 246 624 642 426 462- List all the possible combinations of those digits _ 2664 - Add the combinations 2664 / 12 = 222- Divide the answer by the sum of the three digits and you allways get 222! To speed up the process of finding any exceptions if any, I thought id use php to do this, however i get a problem, the script runs without any coding errors, but it doesnt do what i want it to do - instead of returning any three digit combo that doesnt return 222, it just prints EVERY combo whice passes my conditional statement to weed out numbers that have digits where 2 or more are the same. Here is my code: ?php for ($i = 012; $i 987; $i ++) { $comma = chunk_split($i, 1, ,); $split = explode(,, $comma); if ($split[0] == $split[1] || $split[0] == $split[2] || $split[1] == $split[2]) { } else{ $digitstotal = $split[0] + $split[1] + $split[2]; $num1 = $split[0].$split[1].$split[2]; $num2 = $split[0].$split[2].$split[1]; $num3 = $split[1].$split[0].$split[2]; $num4 = $split[1].$split[2].$split[0]; $num5 = $split[2].$split[0].$split[1]; $num6 = $split[2].$split[1].$split[0]; $numtotal = $num1 + $num2 + $num3 + $num4 + $num5 + $num6; $answer = $numtotal / $digitstotal; if ($answer != 222) { echo($i does not return 222!br); } } } ? What is wrong with it? Any help at all is greatly apreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Getting users IP address into a variable.
Actually I'm just using it so a customer can acces a PWS that is broadcasting on its own security cameras. I have a DSL that disconnects every 8 hours, and gives dinamyc IP, so each time it connects it goes to my site, and writes down the addres, so my customer can access the report, and see what is the current IP address for it's server. Thanks to all it worked. -Mensaje original- De: Jon Haworth [mailto:[EMAIL PROTECTED]] Enviado el: Miércoles, 02 de Octubre de 2002 10:19 a.m. Para: [EMAIL PROTECTED] Asunto: RE: [PHP] Getting users IP address into a variable. Hi, I'm sure there has to be a way to verify which IP address is accessing from. $ip=HTP_GET_ $REMOTE_ADDR ...and to deal with some (but not all) proxies: $ip = (getenv(HTTP_X_FORWARDED_FOR)) ? getenv(HTTP_X_FORWARDED_FOR) : getenv(REMOTE_ADDR); Either way you're still going to get stuff that isn't right, so make sure (a) you validate the contents of $ip before doing anything with it, and (b) you're not using it for anything critical. Cheers Jon -- 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] upgrading script from using GLOBALS
Hi, I am trying to upgrade my script which currently uses globals (and register_globals=on) to turning that flag off. The online documentation on register globas has the following code recommended by users in order to register the variables: $GLOBALS[dbname] = dbname; //register globals foreach ($GLOBALS as $key=$val) { if ($key !=GLOBALS') { eval(\$$key = '$val';); } } I am using the global array to connect to my database. I find that if I insert the code above, I get an error message that the document contains no data. Can anyone tell me why? Perhaps I would be better off just declaring the variable? Would that take care of the problem? $dbname= dbname; Thanks, Nicole -- Nicole Lallande [EMAIL PROTECTED] 760.753.6766 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] stat failed for Resource ?
Hey folks, Whenever I try to open files via fopen i get the following message stat failed for Resource for id #1 Fopen Wrapper is turned on in php.ini What wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Math problem (222)
Well, since it's for school I'll only point out a couple of issues... - your for loop will never test the number 987 even though it should. - add the following line rightr after you compute $numtotal: print($numtotal = $num1 + $num2 + $num3 + $num4 + $num5 + $num6\n); and you'll see that you'll get output like: 28.6 = 2.6.5 + 2.5.6 + 6.2.5 + 6.5.2 + 5.2.6 + 5.6.2 which should help you understand why it's not doing what you think it's doing. good luck. On Wed, 2 Oct 2002 [EMAIL PROTECTED] wrote: For a coursework assignment I have to investigate this thing where you do the following for example: 264- Choose 3 digits that are not the same 12 - Find the sum of them. 264 246 624 642 426 462- List all the possible combinations of those digits _ 2664 - Add the combinations 2664 / 12 = 222- Divide the answer by the sum of the three digits and you allways get 222! To speed up the process of finding any exceptions if any, I thought id use php to do this, however i get a problem, the script runs without any coding errors, but it doesnt do what i want it to do - instead of returning any three digit combo that doesnt return 222, it just prints EVERY combo whice passes my conditional statement to weed out numbers that have digits where 2 or more are the same. Here is my code: ?php for ($i = 012; $i 987; $i ++) { $comma = chunk_split($i, 1, ,); $split = explode(,, $comma); if ($split[0] == $split[1] || $split[0] == $split[2] || $split[1] == $split[2]) { } else{ $digitstotal = $split[0] + $split[1] + $split[2]; $num1 = $split[0].$split[1].$split[2]; $num2 = $split[0].$split[2].$split[1]; $num3 = $split[1].$split[0].$split[2]; $num4 = $split[1].$split[2].$split[0]; $num5 = $split[2].$split[0].$split[1]; $num6 = $split[2].$split[1].$split[0]; $numtotal = $num1 + $num2 + $num3 + $num4 + $num5 + $num6; $answer = $numtotal / $digitstotal; if ($answer != 222) { echo($i does not return 222!br); } } } ? What is wrong with it? Any help at all is greatly apreciated. -- 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] Inheritance and a class function: on what class was it called?
I think I know what you mean. You could get it to return the name of the class. eg. class A { function foo () { return get_class($this); } } class B extends A { } class C extends A { } $a = new A(); $b = new B(); $c = new C(); print $a-foo(); print $b-foo(); print $c-foo(); Is this what you mean? Debbie - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 6:29 PM Subject: [PHP] Inheritance and a class function: on what class was it called? Assume you've got some class that has one or more classes inherited from it. The parent class has a function that is normally called using the :: operator (a class function). Assume also that the class function is never called from an object function. Is it possible to find if the class function was called on the parent class, or on the child class? example: Class A has a function foo(), callable by A::foo(). Class B extends A. If outside code makes the call B::foo(), can you tell from within foo() that the function was called on B and not A? I think this is impossible but I want to confirm that suspicion. It's important that the call B::foo() isn't made from inside any object function, so that there's no context for the $this variable; the get_class() function isn't applicable. -- 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 can I check for variances in spelling within form text input fields?
Debbie Dyer wrote: company exists already test you could remove known extensions from the input company name - ltd, plc, etc - and replace this with a wildcard for the check. - Original Message - From: DonPro [EMAIL PROTECTED] information is the company name, address, city and state/province of their customer. I have to assign a unique number to their customer based on the information they typed in. Here is my problem: 1) They may enter the same customer twice but have a slightly different spelling (maybe adding a LTD. to the company name) 2) Two of my customers may have the same customer. They will type it into Sorry this post is OT. I think name matching is quite a problem, I've never found a foolproof way around it. Debbie's answer is good for the question you ask, but still many cases fall through. In the UK, British Telecom years ago changed its name to BT but both get used. Post Office changed its name to Consignia and now back again to Post Office. Then one company buys out another e.g. Foo Ltd buys Bar Ltd. I don't think you should go by the name alone. Use the post/zip code too. In the UK, a street number (or name) plus the postcode is unique to a building (though it does not help with several companies/appartments in the same building). The post/zip code matching will not help with companies with more than one site. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Math problem (222)
What is wrong with it? Any help at all is greatly apreciated. Consider the differences between my code below and yours. And as far as I can see, there's no combination higher than eleven, lower than 987 which doesn't work out. ? for ($i = 12; $i 987; $i++) { $newI = $i; settype($newI, string); $newI = str_pad($newI, 3, 0, STR_PAD_LEFT); $digits = $newI[0] + $newI[1] + $newI[2]; $num1 = $newI[0].$newI[1].$newI[2]; $num2 = $newI[0].$newI[2].$newI[1]; $num3 = $newI[1].$newI[0].$newI[2]; $num4 = $newI[1].$newI[2].$newI[0]; $num5 = $newI[2].$newI[0].$newI[1]; $num6 = $newI[2].$newI[1].$newI[0]; $sum = $num1 + $num2 + $num3 + $num4 + $num5 + $num6; $answer = $sum / $digits; if ($answer != 222) { echo $i. does not fit in the scheme.; } } ? Jome -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inheritance and a class function: on what class was it called?
not quite... the case I'm interested in is this, given your example: print C::foo(); which would print nothing, unfortunately, since when the function is called using the :: operator there is no $this variable. basically what I'm looking for is a replacement for get_class($this) when the function is called using :: thanks /nick Debbie Dyer [EMAIL PROTECTED] wrote in message 054c01c26a3f$34f6d230$de093c3e@homepc">news:054c01c26a3f$34f6d230$de093c3e@homepc... I think I know what you mean. You could get it to return the name of the class. eg. class A { function foo () { return get_class($this); } } class B extends A { } class C extends A { } $a = new A(); $b = new B(); $c = new C(); print $a-foo(); print $b-foo(); print $c-foo(); Is this what you mean? Debbie - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 6:29 PM Subject: [PHP] Inheritance and a class function: on what class was it called? Assume you've got some class that has one or more classes inherited from it. The parent class has a function that is normally called using the :: operator (a class function). Assume also that the class function is never called from an object function. Is it possible to find if the class function was called on the parent class, or on the child class? example: Class A has a function foo(), callable by A::foo(). Class B extends A. If outside code makes the call B::foo(), can you tell from within foo() that the function was called on B and not A? I think this is impossible but I want to confirm that suspicion. It's important that the call B::foo() isn't made from inside any object function, so that there's no context for the $this variable; the get_class() function isn't applicable. -- 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] Inheritance and a class function: on what class was it called?
I dont understand what you are saying then or what you are trying to do. How can you call C::foo() outside of a class? You access class functions externally with - Debbie - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 7:24 PM Subject: Re: [PHP] Inheritance and a class function: on what class was it called? not quite... the case I'm interested in is this, given your example: print C::foo(); which would print nothing, unfortunately, since when the function is called using the :: operator there is no $this variable. basically what I'm looking for is a replacement for get_class($this) when the function is called using :: thanks /nick Debbie Dyer [EMAIL PROTECTED] wrote in message 054c01c26a3f$34f6d230$de093c3e@homepc">news:054c01c26a3f$34f6d230$de093c3e@homepc... I think I know what you mean. You could get it to return the name of the class. eg. class A { function foo () { return get_class($this); } } class B extends A { } class C extends A { } $a = new A(); $b = new B(); $c = new C(); print $a-foo(); print $b-foo(); print $c-foo(); Is this what you mean? Debbie - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 6:29 PM Subject: [PHP] Inheritance and a class function: on what class was it called? Assume you've got some class that has one or more classes inherited from it. The parent class has a function that is normally called using the :: operator (a class function). Assume also that the class function is never called from an object function. Is it possible to find if the class function was called on the parent class, or on the child class? example: Class A has a function foo(), callable by A::foo(). Class B extends A. If outside code makes the call B::foo(), can you tell from within foo() that the function was called on B and not A? I think this is impossible but I want to confirm that suspicion. It's important that the call B::foo() isn't made from inside any object function, so that there's no context for the $this variable; the get_class() function isn't applicable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Math problem (222)
[EMAIL PROTECTED] wrote: errors, but it doesnt do what i want it to do - instead of returning any three digit combo that doesnt return 222, it just prints EVERY combo whice passes my conditional statement to weed out numbers that have digits where 2 or more are the same. I can't write bug-free code first time either. I have had to learn to debug. In this case I would start just before your line... if ($answer != 222) { ...and put in echo $answer to see what number it actually has. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP User Name on Win2000
Hello everyone! On Win 2k, what is PHP's user name? Or, what username does PHP access files (on the system) as? -john =P e p i e D e s i g n s www.pepiedesigns.com Providing Solutions That Increase Productivity Web Developement. Database. Hosting. Multimedia. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP User Name on Win2000
The one that accesses the filesystem through PHP is the webserver itself, not PHP. And as your server is probably instaleld as a service, it runs under SYSTEM credentials. - Original Message - From: [-^-!-%- [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 9:43 PM Subject: [PHP] PHP User Name on Win2000 Hello everyone! On Win 2k, what is PHP's user name? Or, what username does PHP access files (on the system) as? -john =P e p i e D e s i g n s www.pepiedesigns.com Providing Solutions That Increase Productivity Web Developement. Database. Hosting. Multimedia. -- 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] Inheritance and a class function: on what class was it called?
when you call a function with -, you must call it on an object ($c-foo(), for example). the function is termed an object function when used that way. php has an operator :: that enables that same function to be called without a specific object; in this case, I'm referring to it as a class function. another term for this is usually static function. any function of a class can be called in both ways. the only catch is that, when called as a class function, the function can't in turn call any functions on $this or a fatal error will result. sorry this is so confusing, I probably should've used the term static from the beginning. /nick - Original Message - From: Debbie Dyer [EMAIL PROTECTED] To: Nick Eby [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 11:33 AM Subject: Re: [PHP] Inheritance and a class function: on what class was it called? I dont understand what you are saying then or what you are trying to do. How can you call C::foo() outside of a class? You access class functions externally with - Debbie - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 7:24 PM Subject: Re: [PHP] Inheritance and a class function: on what class was it called? not quite... the case I'm interested in is this, given your example: print C::foo(); which would print nothing, unfortunately, since when the function is called using the :: operator there is no $this variable. basically what I'm looking for is a replacement for get_class($this) when the function is called using :: thanks /nick Debbie Dyer [EMAIL PROTECTED] wrote in message 054c01c26a3f$34f6d230$de093c3e@homepc">news:054c01c26a3f$34f6d230$de093c3e@homepc... I think I know what you mean. You could get it to return the name of the class. eg. class A { function foo () { return get_class($this); } } class B extends A { } class C extends A { } $a = new A(); $b = new B(); $c = new C(); print $a-foo(); print $b-foo(); print $c-foo(); Is this what you mean? Debbie - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 6:29 PM Subject: [PHP] Inheritance and a class function: on what class was it called? Assume you've got some class that has one or more classes inherited from it. The parent class has a function that is normally called using the :: operator (a class function). Assume also that the class function is never called from an object function. Is it possible to find if the class function was called on the parent class, or on the child class? example: Class A has a function foo(), callable by A::foo(). Class B extends A. If outside code makes the call B::foo(), can you tell from within foo() that the function was called on B and not A? I think this is impossible but I want to confirm that suspicion. It's important that the call B::foo() isn't made from inside any object function, so that there's no context for the $this variable; the get_class() function isn't applicable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] extract domain name from a URL
Folks, I want to keep track of referers to my site. I want to store the domain name of the referer in a db field. I want 'just' the domain name, not the full url. So I need a snippet of code that could parse the $HTTP_REFERER, and return just the domain name. Example 1) http://www.google.com 2) http://www.google.com/ 3) http://www.google.com/search?sourceid=navclientq=evil+microsoft ... would all give me http://www.google.com Could anyone give me a hand? Thanks! -- : Joseph Szobody : Computers are like airconditioners: They stop working properly if you open windows. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Setting date fields in mysql queries
I have the following line in a program I'm working on: $query = UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id $ndate is a properly formated date read from a text field on a form on the previous page. When I run the query using mysql_query, it returns TRUE each time, but the field is not updated. The only explanation I can think of is that there is something wrong with the date value. I've echoed it to the screen and it looks fine, but the query still doesn't work. Any suggestions? Thanks in advance, Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Setting date fields in mysql queries
From: Brad Harriger [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 3:17 PM Subject: [PHP] Setting date fields in mysql queries I have the following line in a program I'm working on: $query = UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id $ndate is a properly formated date read from a text field on a form on the previous page. When I run the query using mysql_query, it returns TRUE each time, but the field is not updated. The only explanation I can think of is that there is something wrong with the date value. I've echoed it to the screen and it looks fine, but the query still doesn't work. Any suggestions? When you say it looks fine, are you meaning it looks like 2002-10-02? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Setting date fields in mysql queries
[snip] I have the following line in a program I'm working on: $query = UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id $ndate is a properly formated date read from a text field on a form on the previous page. When I run the query using mysql_query, it returns TRUE each time, but the field is not updated. The only explanation I can think of is that there is something wrong with the date value. I've echoed it to the screen and it looks fine, but the query still doesn't work. Any suggestions? [/snip] Are you actually running the query somehow? Like with mysql_query()? Since you didn't deliver more code it this is the guess I would take. $query = UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id ; // do some error checking if(!($data = mysql_query($query, $your_bd_connection))){ print(MySQL reports: . mysql_error() . \n); exit(); } HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: extract domain name from a URL
Never mind. Didn't realize PHP had the parse_url function. Got it! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] BAD FILE DESCRIPTOR
I keep receiving the following error when I try to use fopen() to a remote server, regardless of which server I try to connect to apparently. I've verified that allow_url_fopen is set to true, so this should be functioning properly. I'm only trying to read the contents of the file so why doesn't this act like a web browser would? I can browse to the location with my web browser, but I cannot get the contents of the file with PHP. Why is this happening to me? The error is bad file descriptor
[PHP] Help with Numbers
I am looking for a way to find the highest 5 and lowest 5 numbers within 300 or so numbers. Here is what I have so far... $Tickers = array(); $Current = array(); // SQL QUERY TO GET TICKERS MSSQL_CONNECT($HostName,$UserName,$Password); mssql_select_db($DBName) or DIE(Table unavailable); $Results = MSSQL_QUERY(SELECT CompanyName,Ticker FROM Company WHERE Ticker != ''); $RowCount = MSSQL_NUM_ROWS($Results); print $RowCount Number of Tickersbr\n; if($RowCount != 0) { for ($i = 0; $Field = MSSQL_FETCH_ARRAY($Results); ++$i) { array_push($Tickers, $Field[Ticker]); } } else { print There was nothing selected in the Query, it may have been bad.; } foreach($Tickers as $Ticker) { Get Last price on the ticker from database. and... array_push($Current, $Value); } Now that I have the values in an array I would like to pull out the five highest and the 5 lowest. Is there a way to do thatif not, is there another way to do what I am looking for. I keep thinking I would have to compare each ticker against all the others to verify it's standing...and that seems like a lot of work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Paging HOWTO for PHP n' MYSQL
Hi people, i've been searching for a while in google and vivisimo for docs that treats paging techniques for php and mysql. And so far i seek nothing. I always get stuck with empty documents (if you know what I mean). Can U give me a hand with this. If you already have a doc of this nature, or the URL to get one ? Regards, and thanks in advance... Francisco M. Vaucher -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with Numbers
Sort the arrays and pick off the first and last elements. On Wed, 2 Oct 2002, Christopher J. Crane wrote: I am looking for a way to find the highest 5 and lowest 5 numbers within 300 or so numbers. Here is what I have so far... $Tickers = array(); $Current = array(); // SQL QUERY TO GET TICKERS MSSQL_CONNECT($HostName,$UserName,$Password); mssql_select_db($DBName) or DIE(Table unavailable); $Results = MSSQL_QUERY(SELECT CompanyName,Ticker FROM Company WHERE Ticker != ''); $RowCount = MSSQL_NUM_ROWS($Results); print $RowCount Number of Tickersbr\n; if($RowCount != 0) { for ($i = 0; $Field = MSSQL_FETCH_ARRAY($Results); ++$i) { array_push($Tickers, $Field[Ticker]); } } else { print There was nothing selected in the Query, it may have been bad.; } foreach($Tickers as $Ticker) { Get Last price on the ticker from database. and... array_push($Current, $Value); } Now that I have the values in an array I would like to pull out the five highest and the 5 lowest. Is there a way to do thatif not, is there another way to do what I am looking for. I keep thinking I would have to compare each ticker against all the others to verify it's standing...and that seems like a lot of work. -- 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] Help with CHdir
I get this error from php when i execute this code can you help me ;) Warning: chdir() expects parameter 1 to be string, resource given in C:\\read.php on line 146 145 echo centerAttachment :; 146 $rep = opendir(C:\\xxx\\Attach\\$id\\); 147 chdir($rep); 148 while ($zone = readdir($rep)) 149 { 150 if (!is_dir($zone)) echo a href=\../Attach/$id/$zone\$zone/abr; 151 } 152 echo /center; 153 } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php