[PHP] IP Address Filtering
Ave, I¹ve run into a slight problem. We maintain a Guestbook for our company¹s website. Lately we have been getting a lot of ³Spam² entries into the Guestbook. I added a snippet into the PHP Script a field in the mySQL database to record the IP Address of posters. However, for the SPAM posts, it records ³Null² instead of an IP Address. I¹m using $REMOTE_ADDR to records the IP. It records IP Addresses of any genuine poster... But NULL for the spam poster. What else can I do to block the SPAM entry? Is there some other Unique Identifier that I can record of the Spam poster and then block him? Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] IP Address Filtering
Ave, I have to say I absolutely love your idea! It¹s probably a solution for my problem, at the same time, like the other guy said, freaking hilarious!!! :0) I think I¹ll probably write up a script that displays everything except records with NULL as IP for regular audience... And displays all records with NULL as IP for audience who¹s IP is recorded as NULL. Thanks! Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com On 3/29/06 4:13 PM, Joe Harman [EMAIL PROTECTED] wrote: if you really want to mess with them.. only show the user with the NULL IP address all the spam posts.. .make them think that they've been successful On 3/29/06, Rahul S. Johari [EMAIL PROTECTED] wrote: -- Joe Harman - * My programs never have bugs, they just develop random features. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IP Address Filtering
Ave, Curt, thanks for your response. Is this a common guestbook, like a 3rd party tool you got and added to the web site? If so, do they already have a solution in place with an add-on or such. No, actually it's a script I have written myself from scratch. And unfortunately (or fortunately perhaps), I haven't ever run into this problem before. You really want to use $_SERVER['REMOTE_ADDR']; That is should, I agree! A common method (now adays) is have the form that is being posted provide a challange/response method (like CAPTCHA) to verify that someone is actually sitting there filling out the form instead of a script doing the work. One of the problems with this method is well it limits your visually impared audience from being able to add to the guestbook, since it requires a visual response to the challenge. Another method is to require javascript for a challenge response method, this of course limits your audience to those who have javascript enabled, and I'm not sure if it really 'visually impared' friendly. I have implemented both those methods in different scripts I have written and maintain across different websites. Visual Confirmation using Image Verification and JavaScript Confirmation. However, I honestly don't want to add such an 'extra' step in my Guestbook for users who simply wish to put in a nice comment about the site, at least not at this point, which is why I do want to stay away from these methods for the Guestbook for now. Let me try a few other suggestions first and see how it goes, and then I'll decide if I need to add more capabilities/security to the Guestbook. Thanks for your insight, always brain-enhancing. Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com
[PHP] IP Address Filtering - Problem Continues
Ave, Unfortunately my problem persists. The reason my script was recording NULL as IP address was because I was using $REMOTE_ADDR. When I started using the correct syntax, i.e., $SERVER['REMOTE_ADDR'], it actually did start recording the IP Address of the spammer. The problem is, the spammer is using multiple IP Address. His IP Address changes every 6 - 8 entries. I have so far recorded 5 different IP Addresses of the spammer. Although I can create a Database and keep adding his IP Address to the database, and run a check from the Guestbook script to scan against Blocked Addresses, It¹s not the most efficient method in the world. What other logic can I apply to automatically block the spammer? Or at least have a more efficient method of blocking the Spammer and his IP¹s? Thanks. On 3/30/06 8:41 AM, Rahul S. Johari [EMAIL PROTECTED] wrote: Ave, Curt, thanks for your response. Is this a common guestbook, like a 3rd party tool you got and added to the web site? If so, do they already have a solution in place with an add-on or such. No, actually it's a script I have written myself from scratch. And unfortunately (or fortunately perhaps), I haven't ever run into this problem before. You really want to use $_SERVER['REMOTE_ADDR']; That is should, I agree! A common method (now adays) is have the form that is being posted provide a challange/response method (like CAPTCHA) to verify that someone is actually sitting there filling out the form instead of a script doing the work. One of the problems with this method is well it limits your visually impared audience from being able to add to the guestbook, since it requires a visual response to the challenge. Another method is to require javascript for a challenge response method, this of course limits your audience to those who have javascript enabled, and I'm not sure if it really 'visually impared' friendly. I have implemented both those methods in different scripts I have written and maintain across different websites. Visual Confirmation using Image Verification and JavaScript Confirmation. However, I honestly don't want to add such an 'extra' step in my Guestbook for users who simply wish to put in a nice comment about the site, at least not at this point, which is why I do want to stay away from these methods for the Guestbook for now. Let me try a few other suggestions first and see how it goes, and then I'll decide if I need to add more capabilities/security to the Guestbook. Thanks for your insight, always brain-enhancing. Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] Creating a Photo Album
Jay Blanchard wrote: [snip] I am postilng pictures up on a website. So far I have a picture per page. This will get not be very efficient as time goes on. Is there anyway that I can have one page with only the image updating? Can this be done in PHP. If it can would someone explain it to me. The only thing I k.now how to do well in PHP is mysql queries and data validatlion. [/snip] I would look at coppermine to see how they do it. http://coppermine-gallery.net/index.php -- Jason S. Motes php at imotes.com www.imotes.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IP Address Filtering - Problem Continues
Ave, I had to eliminate that option because his IP is varying drastically. There is no range, it's just drastically varying. I wouldn't be surprised if he's using an IP Spoofing script/program etcetera. On 4/5/06 11:16 AM, Jay Blanchard [EMAIL PROTECTED] wrote: You could always block a range of IP addresses, but you may cut out a legitimate user. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IP Address Filtering - Problem Continues
Ave, I'm being left with lesser and lesser choices then to try CAPCHTA. I'm gonna look into it now and see if I need to implement this now. Thanks. On 4/5/06 3:52 PM, tedd [EMAIL PROTECTED] wrote: disclaimer Not that I promote CAPCHTA, but there are simple solutions that will slow down some spam while allowing some with vision problems to pass, such as -- http://www.xn--ovg.com/captcha -- namely, the graphic selection demo. Granted it's not the best, it doesn't solve everything, and I never said it did (at least no one can prove it) -- so don't whack me for it -- it's just a suggestion. /disclaimer tedd Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Internal Server Error
Ave, This is something I don¹t understand. I have 3 php scripts that run fine on my localhost server, but when I upload the 3 files to my Internet Server (Hosting Account), I get the 500 Internal Server Error. I am able to access them fine on my machine here (Running Apache Web Server)... But on my internet server, it just keeps giving me the 500 Internal Server Error. Any reason why it would be doing so? Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] Internal Server Error : Resolved
Well I did figure out the problem. The folder I was uploading the files to had special permissions (yeah I know, Duuuhh!). I kept thinking the files I'm uploading are having a permissions issue, it just skipped my mind that the folder I was uploading to had Special Permissions, not the files. I moved the files to another folder and it works! Well, sort of. I'm getting ye 'ol Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at... error. But I'll work it out. Nothing that I haven' dealt with before. Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com On 4/13/06 10:06 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: look at the apache error log on the hosting site. i suspect that you'll find that the configuration of your machine differs from that of your hosting provider, so you're using a function or capability that's not supported on their site. you should also turn your php error reporting up so that you see anything that's reported at that level. in short, without knowing the specific error information, there's not a lot that anyone can do to help -- so start with the logs. Original Message Date: Thursday, April 13, 2006 10:00:26 AM -0400 From: Rahul S. Johari [EMAIL PROTECTED] To: PHP php-general@lists.php.net Subject: [PHP] Internal Server Error Ave, This is something I don¹t understand. I have 3 php scripts that run fine on my localhost server, but when I upload the 3 files to my Internet Server (Hosting Account), I get the 500 Internal Server Error. I am able to access them fine on my machine here (Running Apache Web Server)... But on my internet server, it just keeps giving me the 500 Internal Server Error. Any reason why it would be doing so? Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- End Original Message -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload Progress Bar (PHP/AJAX?)
Ave, I wrote a File Manager application for my company which allows the management our clients to upload files share files. The application has been running fine since a while now, but lately I thought about adding a Progress Bar for the file upload form. I searched a bit to find that PHP is not capable of producing an Upload Progress Bar, and I was looking into the AJAX PHP progress bar which seems to be pretty popular. I run my Apache Web Server on a Mac OS X. Although I downloaded configured AJAX, and also upload progress meter extension... Nothing worked... And I found out that PHP has to be patched, recompiled, reconfigured reinstalled on a unix level (configure, make), which I really don¹t want to do at this stage as I¹m not an expert in that. I was just wondering if there is an alternate... Any other way to produce a progress bar. If someone is experienced with the AJAX/PHP Upload progress bar, and would like to contribute suggestions, I¹m open to that as well. Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com
[PHP] Paged Results Set in MySQL DB with one result
Greetings Gents, I have an interesting problem I would like some ideas on for a solution. I cannot seem to find any code examples on the net, though I might not be looking in the right place really. I have some articles stored in a MySQL DB. What I want is if the article is above a certain length in characters, to page article through a few pages for site readability. So I would want to print X number of words/characters. Save the where the pointer is, move on to the next page, and display the same amount and so on for as many pages as needed. I know about pulling paged results using the limit function but that would not seem to apply as really I would want to page the results within one record (one field really). Does anyone have any ideas?? Thanks Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file Upload - checking file size before uploading
James Nunnerley wrote: Is there anyway to check the size of a file before it starts uploading it? For instance, if the file is huge, and takes ages to upload, and is then rejected by the server, the user will be somewhat annoyed! I'm not even sure this is a php question! Nope not a PHP question. However you can set the max file size within the form tag of HTML. I forget the proper snytax and tag off the top of my head. I am not sure the error it spits out as I have never tested that. you can also use javascript or the like to check the file size. Bless Be Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Handling Large Check Box Data
Ave, I¹m a little confused as to what¹s the best way to handle this. I have a form which, apart from lots of other fields, has a set of 25 30 Check Boxes, each of which asks the user for some kind of information which the user can check or leave unchecked. The information each Check Box collects will also appear in the ³Listing² for users to view once the user has completed submitted the form. Furthermore, there is an Advanced Search also available to users which will also provide the same 25 - 30 check boxes which define the search criteria. I¹m not sure what¹s the best, most efficient way to do this. The tedious way to do this is to make 30 fields in the mySQL database, and if the check box is checked, the data goes into the corresponding field... And similarly listing the data from the field if field is non-empty And similarly including each field in the Search options. I want suggestions for a better/faster way to do this. I did think about creating a single field and storing the data from each checked¹ check box as comma separated values in the single field. I¹m not sure how to do that and if that¹s the best way But even if I can, I¹m not sure how to get the data to display separately out of that field in the Listings view and more importantly how to include that data in the Search options. Any help would be appreciated. Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com
[PHP] Running two versions of PHP locally
Greetings Gents, I am interested in running two versions of of PHP. I want to see if I can get my boss to buy into migrating to PHP 5. I want to set it up locally. Locally I am running apache on a windows XP box with PHP 4. I would like I would like to be able to set up PHP 5 as well on the server and have some folders/virtual hosts set up in php 4 and others in php 5? Is this possible? How would I go about doing it? Thanks Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Looping through a Db query result twice in PEAR
Greetings All, I have a problem that I usually solve in MySQL pretty easily, but using PEAR identifiers are not working. Any suggestions. I want to loop through a result set in two different while loops that are not nested. I am able to do in it MySQl as follows $sql=Some query; $result = $conn-query($sql); while ($row = $result-fetchArray()) { echo $row['hey']; } while ($row2 = $result-fetchArray()) { echo $row2['otherhey']; } This has worked in the past and I do not have to hit up the DB twice for the same information. However when I try something similar with PEAR it does not work. So the below does not work. This is my first time using PEAR. So can anyone help me out. I cannot seem to find anything about this on the documentation online. $sql=Some query; $result = $db-query($sql); while($result-fetchInto($data)) { echo \t\t\tlia href=\#$data[id]\$data[question]/a/li\n; } while($result-fetchInto($data2)) { echo a name=\#$data2[id]\$data2[answer]/a/li\n; } Thanks Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload files problems
Hi! When the users of my system try to go up files of more than 460 K, they receive the message: Fatal error: Maximum execution time of 90 seconds exceeded in c:\websites\iracbiogenar48\iracbiogen.com.ar\virtual\procesa_msjpriv.php on line 2 I'm using the following method to up load the files: if($archivo_name) { $dpath=./archivos_recibidos/.$archivo_name; if(move_uploaded_file($archivo, $dpath)) {//Se realiza la transmision del archivo al servidor. echo font size=2 face=Arial, Helvetica, sans-serifEl archivo .$archivo_name.. ha sido transferido exitosamente./font/div/td; } else { echo font size=2 face=Arial, Helvetica, sans-serifADVERTENCIA: El arcvhio .$archivo_name.. no ha podido enviarse./font/div/td; } Do I have control on these 90 seconds? or is a parameter of the server? What can I do to solve this problem? Ahead of time thank you very much, Tom. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload files problems
My host uses safe mode... What other thing can I do? Some other method exists to send files besides POST method? Thank you, Tom. Ryan Creaser [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Ing. Tomás Liendo wrote: Hi! When the users of my system try to go up files of more than 460 K, they receive the message: Fatal error: Maximum execution time of 90 seconds exceeded in c:\websites\iracbiogenar48\iracbiogen.com.ar\virtual\procesa_msjpriv.php on line 2 I'm using the following method to up load the files: if($archivo_name) { $dpath=./archivos_recibidos/.$archivo_name; if(move_uploaded_file($archivo, $dpath)) {//Se realiza la transmision del archivo al servidor. echo font size=2 face=Arial, Helvetica, sans-serifEl archivo .$archivo_name.. ha sido transferido exitosamente./font/div/td; } else { echo font size=2 face=Arial, Helvetica, sans-serifADVERTENCIA: El arcvhio .$archivo_name.. no ha podido enviarse./font/div/td; } Do I have control on these 90 seconds? or is a parameter of the server? What can I do to solve this problem? Ahead of time thank you very much, Tom. See http://php.net/set_time_limit, although it might not work if your host uses safe mode. - Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Checkbox Hidden Field to Delete Row
Ave, I¹m stuck on a problem here. I have a file manager kind of application and I¹m trying to add the functionality to delete multiple files. Basically, there¹s a bunch of rows generated dynamically. Each row has a checkbox for ³Delete² option, and a hidden field which contains the name of the File associated with the record. If a user checks a checkbox to delete certain rows, it should be able to delete those rows from mySQL as well as delete the files associated with that record. I created both the checkboxes the hidden fields to be Arrays. I run a loop to delete all rows (based on ID¹s) where the checkbox was Checked. It does that part fine... The problem is linking the Filename array to the Checkbox Array. It deletes the first two files uploaded no matter what rows are checked. Basically, the Filename array is not associating with the Checkbox array. So if a person checks the 3rd and 5th checkbox... The 3rd 5th row is deleted from mySQL, but the 1st and 2nd file is deleted, not the 3rd 5th. Following is my code to generate the checkboxes hidden fields... td width=15span class=\style11\ input type=checkbox name=thisID[] value=$myrow[ID]input type=hidden name=\PF[]\ value=\imsafm/$showfilesuser/$myrow[filename]\input type=hidden name=login value=$loginINPUT TYPE=hidden name=showfilesuser value=$showfilesuser/td Following is the code to delete the checked rows/files... for($I=0;$Isizeof($thisID);$I++) { $sql = DELETE FROM file WHERE ID='$thisID[$i]'; $result = mysql_query($sql) or die(Fatal Error: .mysql_error()); $thefile = $PF[$i]; unlink($thefile); } I have no clue what to do... It¹s just not working out. Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] Checkbox Hidden Field to Delete Row - SOLVED
Ave, I spent 3 hours trying to find or develop a solution for this problem... And believe it or not, within 3 minutes of sending the problem to the mailing list, I actually generated a solution!! Ray, you’re spot on with what’s actually happening, but this is what I did to resolve it... Here’s my code to generate the Dynamic Row with Checkboxes: td width=15span class=\style11\ input type=checkbox name=thisID[] value=\$myrow[ID]#imsafm/$showfilesuser/$myrow[filename]\input type=hidden name=login value=$loginINPUT TYPE=hidden name=showfilesuser value=$showfilesuser/td I completely eliminated the Hidden field... Instead, added the value of both the Row ID the Filename to the checkbox, with a seperator “#”. Here’s my code to delete the Row Corresponding File: foreach($thisID AS $value) { $pieces = explode(#, $value); $sql = DELETE FROM file WHERE ID='$pieces[0]'; $result = mysql_query($sql) or die(Fatal Error: .mysql_error()); $thefile = $pieces[1]; unlink($thefile); } As you can see, I basically explode the Array on the “#” seperator, and delete the Row File. Is working like a charm!! On 6/1/06 4:07 PM, Ray Hauge [EMAIL PROTECTED] wrote: On Thursday 01 June 2006 12:58, Rahul S. Johari wrote: Ave, I¹m stuck on a problem here. I have a file manager kind of application and I¹m trying to add the functionality to delete multiple files. Basically, there¹s a bunch of rows generated dynamically. Each row has a checkbox for ³Delete² option, and a hidden field which contains the name of the File associated with the record. If a user checks a checkbox to delete certain rows, it should be able to delete those rows from mySQL as well as delete the files associated with that record. I created both the checkboxes the hidden fields to be Arrays. I run a loop to delete all rows (based on ID¹s) where the checkbox was Checked. It does that part fine... The problem is linking the Filename array to the Checkbox Array. It deletes the first two files uploaded no matter what rows are checked. Basically, the Filename array is not associating with the Checkbox array. So if a person checks the 3rd and 5th checkbox... The 3rd 5th row is deleted from mySQL, but the 1st and 2nd file is deleted, not the 3rd 5th. Rahul S. Johari The problem is coming from how checkboxes submit their information to the form. Only the checked checkboxes will actually send data. The unchecked ones will not send anything. Hidden fields differ, in that they ALWAYS send their data. This is probably causing a mis-match between the two arrays. You could verify that by doing a var_dump on the arrays before you delete anything. I would suggest that since you keep a record of the file in the database, include the file location in that database record. Then before you delete it, get the file name, delete the file, then delete the record. I think that would save you a bunch of headaches. Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] Checkbox Hidden Field to Delete Row - SOLVED
Ray, Interestingly, I don't' allow special characters in File Names for files being uploaded to the File Manager. So that problem won't occur. Thanks. On 6/1/06 4:23 PM, Ray Hauge [EMAIL PROTECTED] wrote: On Thursday 01 June 2006 13:15, Rahul S. Johari wrote: Tad different, but that will definitely work as well. It's a long shot, but just make sure that filenames don't have a # in them. Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] popen and pclose. Something changed in 4.4.2 !
Greetings! I was using popen and pclose on a previous version of PHP on Windows with an older version of Apache (2.x). ( I think it was 4.4.1 but will need to check as i am not sure). pclose(popen(start . $exe . . $args, r)) Where $exe is my path to the batch file and $args are the arguments for the batch file. The batch file, in turn calls other batch files on a shared folder on a different PC On Windows, it would open up the dos window and run commands there and exit and the PHP script that called the pclose would terminate loading on the users' browsers. Now, with PHP 4.4.2, the pclose and popen send the tasks to the background and the dos window does not show up! As a result, killing the dos process is not possible (i get access denied in windows...) and the users cannot see the dos window when it runs. I would like the php script to send the commands to a dos window, and the php script to finish executing. I tried passthru, system, exec and proc_open... and none of them work. None of them bring up the dos window. Please help! Regards Venkat
[PHP] popen and pclose. Something changed in 4.4.2 ! ....Fixed
On windows, allow Apache service to interact with the desktop... in the services manager GUI Rgds Venkat ** Greetings! I was using popen and pclose on a previous version of PHP on Windows with an older version of Apache (2.x). ( I think it was 4.4.1 but will need to check as i am not sure). pclose(popen(start . $exe . . $args, r)) Where $exe is my path to the batch file and $args are the arguments for the batch file. The batch file, in turn calls other batch files on a shared folder on a different PC On Windows, it would open up the dos window and run commands there and exit and the PHP script that called the pclose would terminate loading on the users' browsers. Now, with PHP 4.4.2, the pclose and popen send the tasks to the background and the dos window does not show up! As a result, killing the dos process is not possible (i get access denied in windows...) and the users cannot see the dos window when it runs. I would like the php script to send the commands to a dos window, and the php script to finish executing. I tried passthru, system, exec and proc_open... and none of them work. None of them bring up the dos window. Please help! Regards Venkat
[PHP] Trouble figuring out a Walk through an Array
Greetings All, Having trouble figureing out a certain walk through an array. And I am not finding the help I need in the manual or anything. I have an associative arr ($arr) With about 20 elements in it. Ten of which are required. So I have another associative array called $required, with all the elements in the array that are required. I have initaited a foreach loop on the $arr splitting things into $key and $value. Now the part I am having trouble with is this. I want to see if $key matches any of the values in $required. If so do something in particular. If not then do something else. It does not particularly matter which value in the $required it matches, just so long as it matches. Thanks for any help. Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Trouble figuring out a Walk through an Array
Greetings All, Having trouble figureing out a certain walk through an array. And I am not finding the help I need in the manual or anything. I have an associative arr ($arr) With about 20 elements in it. Ten of which are required. So I have another associative array called $required, with all the elements in the array that are required. I have initaited a foreach loop on the $arr splitting things into $key and $value. Now the part I am having trouble with is this. I want to see if $key matches any of the values in $required. If so do something in particular. If not then do something else. It does not particularly matter which value in the $required it matches, just so long as it matches. Thanks for any help. Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Trouble figuring out a Walk through an Array
Greetings All, Having trouble figureing out a certain walk through an array. And I am not finding the help I need in the manual or anything. I have an associative arr ($arr) With about 20 elements in it. Ten of which are required. So I have another associative array called $required, with all the elements in the array that are required. I have initaited a foreach loop on the $arr splitting things into $key and $value. Now the part I am having trouble with is this. I want to see if $key matches any of the values in $required. If so do something in particular. If not then do something else. It does not particularly matter which value in the $required it matches, just so long as it matches. Thanks for any help. Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP on Windows 2003 Server
Hi, I have enough experience working with PHP on Windows XP over IIS, but now I need to work on Windows Server 2003, algo with IIS. I installed PHP (With the installer that I downloaded from www.php.net) but it doesn't work. When I try to see a PHP page I receive the following message: The server can not found What can I do? Ahead of time, thank you very much. Tom. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Looking for a string function
Greetigns Gents, I seem to remember a built in php function that will take a huge block of text. Then just spit out X number of characters from it and follow it with an additional string value. But I cannot remember what it is. I seem to remember it being something other than the substr(). I am looking to pull the first say 200 characters from an article and follow the last character/word with something like ... Does anyone know what I am talking about, or am I just smoking something and my memory is going? Blessed Be Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fixing ID's in mySQL Table
Ave, Is there a way to fix ID sequence in a MySQL table using PHP? Basically I have some tables with a lot of records, 1000 to 5000. ID¹ is the Primary Key column in these tables, and at the time the code was originally written, there weren¹t much verification of data being input going on. Thus a lot of junk records were being let in, which had to be deleted at some point or another. Now the ID sequence is all screwed up. It¹s not in sequence anymore. Is there a way to fix this? Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] Fixing ID's in mySQL Table
Ave, This is what I need to do. Let's say, my ID's in a table look like this: 1 7 9 11 12 19 26 27 29 30 I need to alter the table so that the ID's are in a sequence like this: 1 2 3 4 5 6 7 8 9 10 It's easy to manually do this if you have a table with 10 records, but you can't do it manually in a table with 5000 records. I know that I can DELETE the ID Column and recreate it and that will Fix this problem, but doing that over and over with all the tables isn't what I'm really looking for. I just feel there should be a way in PHP to execute a logical query to do this. If not of course I can do the delete/recreate using phpmyadmin, but I just want to see if there's a php script way to do it. Thanks. On 11/8/05 9:22 AM, Gustav Wiberg [EMAIL PROTECTED] wrote: Hi there! Do you want an orderby-statement to be done on ID-field? Is that what you mean? I would go to phpmyadmin and fix that in the database-structure. (or some kind of database-utility) /G http://www.varupiraten.se/ - Original Message - From: Rahul S. Johari [EMAIL PROTECTED] To: PHP php-general@lists.php.net Sent: Tuesday, November 08, 2005 2:37 PM Subject: [PHP] Fixing ID's in mySQL Table Ave, Is there a way to fix ID sequence in a MySQL table using PHP? Basically I have some tables with a lot of records, 1000 to 5000. OID¹ is the Primary Key column in these tables, and at the time the code was originally written, there weren¹t much verification of data being input going on. Thus a lot of junk records were being let in, which had to be deleted at some point or another. Now the ID sequence is all screwed up. It¹s not in sequence anymore. Is there a way to fix this? Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fixing ID's in mySQL Table
Thanks! On 11/8/05 11:49 AM, Georgi Ivanov [EMAIL PROTECTED] wrote: You van do this : 1.Create new table with exactly the same structure as orig table. 2.Create little php script which does this : select * from origTBL while($line=mysql_fecth_array($res)){ insert into newtbl values() } In the new tbl yuo will have the records ordered. Than just rename the tables. On Tuesday 08 November 2005 16:28, Rahul S. Johari wrote: Ave, This is what I need to do. Let's say, my ID's in a table look like this: 1 7 9 11 12 19 26 27 29 30 I need to alter the table so that the ID's are in a sequence like this: 1 2 3 4 5 6 7 8 9 10 It's easy to manually do this if you have a table with 10 records, but you can't do it manually in a table with 5000 records. I know that I can DELETE the ID Column and recreate it and that will Fix this problem, but doing that over and over with all the tables isn't what I'm really looking for. I just feel there should be a way in PHP to execute a logical query to do this. If not of course I can do the delete/recreate using phpmyadmin, but I just want to see if there's a php script way to do it. Thanks. On 11/8/05 9:22 AM, Gustav Wiberg [EMAIL PROTECTED] wrote: Hi there! Do you want an orderby-statement to be done on ID-field? Is that what you mean? I would go to phpmyadmin and fix that in the database-structure. (or some kind of database-utility) /G http://www.varupiraten.se/ - Original Message - From: Rahul S. Johari [EMAIL PROTECTED] To: PHP php-general@lists.php.net Sent: Tuesday, November 08, 2005 2:37 PM Subject: [PHP] Fixing ID's in mySQL Table Ave, Is there a way to fix ID sequence in a MySQL table using PHP? Basically I have some tables with a lot of records, 1000 to 5000. OID¹ is the Primary Key column in these tables, and at the time the code was originally written, there weren¹t much verification of data being input going on. Thus a lot of junk records were being let in, which had to be deleted at some point or another. Now the ID sequence is all screwed up. It¹s not in sequence anymore. Is there a way to fix this? Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Walking through a bunch of MySQL Records
Greetings all, I have a question. I want to display a group of records pulled form a MySQL db in the following fashion. 16 27 38 49 510 Now I can easily figure out how to display the records as 12 34 56 78 910 But since I am in an HTML table and the need to display the TR and /TR I am not sure how to make th logic so that I can get the first listing. Can anyone help me out?? Need more information?? Thanks Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OS Detection
Ave, I'm working on a Guestbook for a site and I'm trying to identify Browser Operating System of the user and eventually I'll display the Icon matching the Browser/OS in the entry. I'm able to identify and use an If Conditional statement for the Browser, but I can't seem to identify the OS. This is what I'm using to identify the Browser: function browser_detection( $which_test ) { // initialize the variables $browser = ''; $dom_browser = ''; // set to lower case to avoid errors, check to see if http_user_agent is set $navigator_user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : ''; // run through the main browser possibilities, assign them to the main $browser variable if (stristr($navigator_user_agent, opera)) { $browser = 'opera'; $dom_browser = true; } elseif (stristr($navigator_user_agent, msie 4)) { $browser = 'msie4'; $dom_browser = false; } elseif (stristr($navigator_user_agent, msie)) { $browser = 'msie'; $dom_browser = true; } elseif ((stristr($navigator_user_agent, konqueror)) || (stristr($navigator_user_agent, safari))) { $browser = 'safari'; $dom_browser = true; } elseif (stristr($navigator_user_agent, gecko)) { $browser = 'mozilla'; $dom_browser = true; } elseif (stristr($navigator_user_agent, mozilla/4)) { $browser = 'ns4'; $dom_browser = false; } else { $dom_browser = false; $browser = false; } // return the test result you want if ( $which_test == 'browser' ) { return $browser; } elseif ( $which_test == 'dom' ) { return $dom_browser; // note: $dom_browser is a boolean value, true/false, so you can just test if // it's true or not. } } $user_browser = browser_detection('browser'); echo $user_browser; if ( $user_browser == 'opera' ) { echo OPERA; } else { echo SOMETHING ELSE; } ? Any suggestions on getting the OS ? Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] OS Detection
Ave, Interesting. I did get this JavaScript code for OS detection: // This script sets OSName variable as follows: // Windowsfor all versions of Windows // MacOS for all versions of Macintosh OS // Linux for all versions of Linux // UNIX for all other UNIX flavors // Unknown OS indicates failure to detect the OS var OSName=Unknown OS; if (navigator.appVersion.indexOf(Win)!=-1) OSName=Windows; if (navigator.appVersion.indexOf(Mac)!=-1) OSName=MacOS; if (navigator.appVersion.indexOf(X11)!=-1) OSName=UNIX; if (navigator.appVersion.indexOf(Linux)!=-1) OSName=Linux; document.write('Your OS: '+OSName); Which does serve my purpose. I guess I'll work something with this out. Thanks. On 11/17/05 10:21 AM, George Pitcher [EMAIL PROTECTED] wrote: Rahul, The Client OS is a 'client' object, so isn't necessarily passed by the Browser. Try javascript. George -Original Message- From: Rahul S. Johari [mailto:[EMAIL PROTECTED] Sent: 17 November 2005 3:10 pm To: PHP Subject: [PHP] OS Detection Ave, I'm working on a Guestbook for a site and I'm trying to identify Browser Operating System of the user and eventually I'll display the Icon matching the Browser/OS in the entry. I'm able to identify and use an If Conditional statement for the Browser, but I can't seem to identify the OS. This is what I'm using to identify the Browser: function browser_detection( $which_test ) { // initialize the variables $browser = ''; $dom_browser = ''; // set to lower case to avoid errors, check to see if http_user_agent is set $navigator_user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : ''; // run through the main browser possibilities, assign them to the main $browser variable if (stristr($navigator_user_agent, opera)) { $browser = 'opera'; $dom_browser = true; } elseif (stristr($navigator_user_agent, msie 4)) { $browser = 'msie4'; $dom_browser = false; } elseif (stristr($navigator_user_agent, msie)) { $browser = 'msie'; $dom_browser = true; } elseif ((stristr($navigator_user_agent, konqueror)) || (stristr($navigator_user_agent, safari))) { $browser = 'safari'; $dom_browser = true; } elseif (stristr($navigator_user_agent, gecko)) { $browser = 'mozilla'; $dom_browser = true; } elseif (stristr($navigator_user_agent, mozilla/4)) { $browser = 'ns4'; $dom_browser = false; } else { $dom_browser = false; $browser = false; } // return the test result you want if ( $which_test == 'browser' ) { return $browser; } elseif ( $which_test == 'dom' ) { return $dom_browser; // note: $dom_browser is a boolean value, true/false, so you can just test if // it's true or not. } } $user_browser = browser_detection('browser'); echo $user_browser; if ( $user_browser == 'opera' ) { echo OPERA; } else { echo SOMETHING ELSE; } ? Any suggestions on getting the OS ? Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTTP User Authentication Problems
Ave, I¹m trying to run this very simple HTTP user authentication script: ?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm=Private'); header('HTTP/1.0 401 Unauthorized'); echo 'Unauthorized'; exit; } else { if(($_SERVER['PHP_AUTH_USER']==try) ($_SERVER['PHP_AUTH_PW']==try)) { ? HTML HEAD/HEAD BODY My Stuff Goes Here! /BODY /HTML ? } else { echo Access Denied; } } ? The problem is, this script runs perfectly fine on my localhost machine at home, however it¹s not working on my web server (purchased webhosting). When I open this page on my web site, it does bring up the popup box asking for Username Password the problem is, even if I type the correct user/pass, it won¹t accept it. It keeps asking me for user/pass again and again and finally brings up the ³Unauthorized² text on the page. Why won¹t it allow the correct user/pass to login? I don¹t understand. The only difference between the PHP on my localhost and the PHP on my webhost server is that my local machine is running PHP 5 and the webhost server is running PHP 4.4.1 Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] HTTP User Authentication Problems
Ave, Steve, I did a phpinfo() on my webhost and as it turns out, they are using a CGI binary version, much to my surprise and dismay. Anyhow... Do I have any alternatives for an http authentication kind of authentication ? Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com On 12/6/05 9:50 AM, Steve McGill [EMAIL PROTECTED] wrote: Hi Rahul, Try doing a print_r($_SERVER) to see if the variables are being set. If they aren't, take a look at the phpinfo(); - chances are your host is using a CGI binary version of PHP to use together with a security wrapper like suPHP or phpSuExec, which might throw away the variables that you require. Steve Rahul S. Johari [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] Ave, I¹m trying to run this very simple HTTP user authentication script: ?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm=Private'); header('HTTP/1.0 401 Unauthorized'); echo 'Unauthorized'; exit; } else { if(($_SERVER['PHP_AUTH_USER']==try) ($_SERVER['PHP_AUTH_PW']==try)) { ? HTML HEAD/HEAD BODY My Stuff Goes Here! /BODY /HTML ? } else { echo Access Denied; } } ? The problem is, this script runs perfectly fine on my localhost machine at home, however it¹s not working on my web server (purchased webhosting). When I open this page on my web site, it does bring up the popup box asking for Username Password the problem is, even if I type the correct user/pass, it won¹t accept it. It keeps asking me for user/pass again and again and finally brings up the ³Unauthorized² text on the page. Why won¹t it allow the correct user/pass to login? I don¹t understand. The only difference between the PHP on my localhost and the PHP on my webhost server is that my local machine is running PHP 5 and the webhost server is running PHP 4.4.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 4 Digit ID with Leading Zeros
Ave, I want to assign a 4 Digit ID with leading zeros to each record added using a form I have created. The PHP scripts does two things: (a) It adds the data to a mySQL table (b) it generates a CSV file with the data The 4 Digit ID (beginning from 0001) will be used in two places: (a) It will be the ID for the record in the mySQL table, instead of the usual ID that we create in mySQL. It will be a Primary Key, Not Null, Auto_Increment (b) It will also be the filename for the CSV file. So basically it has to match the record adding in the mySQL table and the filename for the CSV. I¹m trying to figure out how to do this but am not sure. Any help appreciated. Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] 4 Digit ID with Leading Zeros
Ave, I think this will work for me. Here's what I'm gonna do... When the form is submitted: First, add the records to the mySQL table. An ID will be automatically generated. Then, call the ID from the mySQL table, using your code, add the leading Zeros to it, and generate the CSV file with that new ID as the filename. The only issue that I still have is... The file name will be 0001.csv, while in the mySQL table, the ID for that record who's csv file has been generated, will be 1. What I would have preferred to have is make both the ID in mySQL table and the filename have the leading zeros. But I'm not sure if that's possible. Thanks. On 12/15/05 10:10 AM, Jim Moseby [EMAIL PROTECTED] wrote: I¹m trying to figure out how to do this but am not sure. Any help appreciated. I'm not sure of what you are asking, but I'll assume that because you posted the to the PHP list, that you are asking how to take a MySQL autoincrement number and add leading zeros to it. Try this: $row=mysql_fetch_array($result); $four_digit_id=str_pad($row['id'], 4, 0, STR_PAD_LEFT); JM Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 4 Digit ID with Leading Zeros
Ave, I'm looking into the ZEROFILL option now. Didn't know about it before but it looks promising and probably is my solution. I'll get back. Thanks a ton! On 12/15/05 10:24 AM, Jim Moseby [EMAIL PROTECTED] wrote: What I would have preferred to have is make both the ID in mySQL table and the filename have the leading zeros. But I'm not sure if that's possible. Then, take the suggestion of another respondent to this topic, and have a look at MySQL's ZEROFILL option. I'm not sure if you can use it with an auto-increment field, but that's my best guess. JM Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 4 Digit ID with Leading Zeros
Ave, That Worked!! That was the perfect solution. Everything is working just the way I wanted it to work now. I'm using ZEROFILL in my mySQL table and pulling the ID to generate the filename. Thanks a TON! On 12/15/05 10:17 AM, David Grant [EMAIL PROTECTED] wrote: Rahul, Rahul S. Johari wrote: The 4 Digit ID (beginning from 0001) will be used in two places: (a) It will be the ID for the record in the mySQL table, instead of the usual ID that we create in mySQL. It will be a Primary Key, Not Null, Auto_Increment Adding ZEROFILL to that definition might be what you're after. Cheers, David Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 4 Digit ID with Leading Zeros
Ave, Primarily the application is for recycling some data. Things will be added by a client, shortly processed thereafter in-house, and removed. We won't be reaching the 10,000 records for this application. Thanks. On 12/15/05 11:00 AM, Jim Moseby [EMAIL PROTECTED] wrote: I'm looking into the ZEROFILL option now. Didn't know about it before but it looks promising and probably is my solution. I'll get back. Obviously, with a 4 digit id, you will only be able to store 10,000 records. If I recall correctly, MySQL auto-increment fields will not reuse id's when they are deleted. So, you will need to take that into consideration when (if) you reach the 9,999th record. JM Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 4 Digit ID with Leading Zeros
Ave, Yes phpMyAdmin does but I'm sure many other don't. I'll keep this in mind. Thanks. On 12/15/05 11:01 AM, John Hinton [EMAIL PROTECTED] wrote: Rahul S. Johari wrote: Ave, I'm looking into the ZEROFILL option now. Didn't know about it before but it looks promising and probably is my solution. I'll get back. Thanks a ton! On 12/15/05 10:24 AM, Jim Moseby [EMAIL PROTECTED] wrote: Zerofill in mysql will do it. But, many mysql 'clients' don't 'display' the zeros. As best that I remember, phpMyAdmin does show the zeros, so be careful as what you 'see' might not really be what you 'get'. Seems like there are issues with the viewing of this in Excel as well.. Friggin programs that think they are smarter that people Anyway, that'll do the mysql side of it for you. John Hinton Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 4 Digit ID with Leading Zeros
Ave, Now that is an interesting perception. I didn't think about that. Well I can always change it to five or six. Let me re-assess this with the concerned person in the department and see what the scenario is like. I'll have to check the fluency of incoming data and expectancy of reaching the 10,000th mark. Thanks a bunch. On 12/15/05 12:38 PM, Jim Moseby [EMAIL PROTECTED] wrote: Yes, but as I understand it, MySQL will continue to increment as new records are added, so it would be possible that you have only one record in the table, but not be able to add another because of the 4 digit restriction. If this is the case, you will only be able to have 10,000 ADDs, not 10,000 records. Just something to be aware of. JM Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 4 Digit ID with Leading Zeros
Ave, I did actually think about a periodic reset, as I do something like that for one other application, different issue. Thanks. On 12/15/05 1:24 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: If it's really a temporary table, then you can probably reset the auto increment counter periodically so you'll never hit . If it doesn't have to be 4 digits, that you just want it padded out with zeros, you can have the numbers in the databse be 1, 2, 3, 4 (regular, no padding) and just use PHP to pad the numbers for display purposes too. Just some random thoughts. -TG = = = Original message = = = Ave, Now that is an interesting perception. I didn't think about that. Well I can always change it to five or six. Let me re-assess this with the concerned person in the department and see what the scenario is like. I'll have to check the fluency of incoming data and expectancy of reaching the 10,000th mark. Thanks a bunch. On 12/15/05 12:38 PM, Jim Moseby [EMAIL PROTECTED] wrote: Yes, but as I understand it, MySQL will continue to increment as new records are added, so it would be possible that you have only one record in the table, but not be able to add another because of the 4 digit restriction. If this is the case, you will only be able to have 10,000 ADDs, not 10,000 records. Just something to be aware of. JM Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can't install
Hi I can't install PHP on Windows. The error: Windows Can't found c:\Windows\System32\issext.vbs What Can I do? Please Help me! Thnaks, Tom. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can't install
Sorry but I can't find the file issext.vbs!! Where can I get it Can you send me this file? Thank you! Tom Barry [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Ing. Tomás Liendo wrote: Hi I can't install PHP on Windows. The error: Windows Can't found c:\Windows\System32\issext.vbs What Can I do? Please Help me! Thnaks, Tom. Copy the issext.vbs to your system32 folder. Don't have it? Well: www.google.de -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can't install
Yes, I don't have the file in my PC and I can't find It on Google. Well... I'll see Tkank you very much. Tom. Barry [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Ing. Tomás Liendo wrote: Sorry but I can't find the file issext.vbs!! Where can I get it Can you send me this file? Thank you! Tom have you used your pc's search function to search for the file? I don't have an ISS server so i can't send it to you -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with query
Hi I need the students that didn't take an exam. The tables: exams(id_test, title, desciption, ) results(id_student, id_test, date, qualification...) I'm using a version of MySQL that doesn't support NOT IN, then I tried in this way: SELECT * FROM exams LEFT JOIN results ON exams.id_test=results.id_test WHERE results.id_test IS NULL AND id_student=.$user The query doesn't return anything... What Can I do??? Ahead of time, thank you very much, Tom. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] assignment operator works for comparison??
Hi, Dan wrote: if($shiny = 0){ This does not compare anyting, it assigns 0 to $shiny yes i know, but shouldnt this operation return true? No, it doesn't return true. The "=" operator returns the value of the expression on its right hand side. Therefore, the statement given above is equivalent to (as far as the if is concerned): if (0) { because the "=" operator returns 0, the value on its right hand side. That is why a statement like: a = b = c = 2 sets all the above variables to 2. Otherwise, if it were to operate the way you think it should, it would set "c" to 2 and "a" and "b" to "true" ;-). Hope that clears up things for you. -- Regards, Harshdeep Singh Jawanda. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] show tables in oracle 8-i
At 11:09 AM 4/12/01 -0700, Dennis Gearon wrote: I've been looking through the book, and so far, I can't find the command for 'show tables' in Oracle 8i. Anyone know it? It should be programmatically available, I would think, as an SQL command. SELECT TABLE_NAME FROM ALL_TABLES; - Brian - Brian S. Dunworth Sr. Software Development Engineer Oracle Database Administrator The Printing House, Ltd. (850) 875-1500 x225 [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySql / sql help plz!
At 02:33 PM 4/23/01 -0700, elias wrote: how can i get an SQL statment that when run, i get a query result like that: Id: Value count: --- -- a4 values b4 values c2 values SELECT ID,COUNT(*) FROM table_name GROUP BY ID; i feel that it's easy...but i'm not really good at SQL. ..and you probably won't get better at it here. Try an SQL list or any number of online tutorials or books on SQL. - Brian - Brian S. Dunworth Sr. Software Development Engineer Oracle Database Administrator The Printing House, Ltd. (850) 875-1500 x225 [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] link variables space problem in netscape
At 02:23 AM 4/25/01 +0800, Mark Lo wrote: Hi, I am having a problem in link variables in netscape. etc. www.domain.com?xx=1xxx=2=mark loxxxee=polol if the above link contains space, then everyting is faded after the space, how to over come this problem in netscape. In IE5, it is okay to have spacein link variables. The proper way to phrase In IE5, it is okay to have spaces in link variables is IE5, which doesn't follow the specifications of the language, works with spaces embedded in the links. Netscape, which follows (at least that part of) the HTML specification, disallows embedded spaces in links. Meanwhile, try the urlencode() and urldecode() functions. :) Thank you Welcome. - Brian S. Dunworth Sr. Software Development Engineer Oracle Database Administrator The Printing House, Ltd. (850) 875-1500 x225 [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Wierd error messages
At 03:03 PM 4/25/01 +0100, Euan Greig wrote: [25-Apr-2001 14:34:48] PHP Warning: Missing ] in üu variable in Unknown on line 0 [25-Apr-2001 14:34:50] PHP Warning: Missing ] in }´üt variable in Unknown on line 0 [...] etc I hate to say it, but this looks suspiciously like a memory leak in WindowsNT... especially if the problem cleared up after rebooting. - Brian - Brian S. Dunworth Sr. Software Development Engineer Oracle Database Administrator The Printing House, Ltd. (850) 875-1500 x225 [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP]OT, but dual-boot operating system question
Beware if you're using WinNT or Windows 2000. Neither one plays nice with LILO. At 01:41 PM 4/30/2001 -0400, Toby Miller wrote: Your safest bet would probably be to look into RedHat Linux. It's a fairly straight forward Linux distribution. It also includes the LILO boot loader which is one way to boot into more than one operating system on the same machine. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] This is driving me to drink...
...But my boss won't let me keep the Bushmill's at my desk. *sigh* So, assuming that $p_code is MNE and $neuroKey is 2, then $hub should be 2, right? Instead, it's coming up with 1, which is the value of $coreKey. What have I missed? $hub=$coreKey; if (($p_code==MNE)||($p_code=='SN')||($p_code=='PM')) { $hub=$neuroKey; } else if ($p_code==MAI) { $hub=$allergyKey; } else if (($p_code==SPS)||($p_code==MCC)) { $hub=$dermKey; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] This is driving me to drink...
Problem solved. Boy, that was easy. The database was adding trailing spaces to the codes (so that MNE was actually MNE and so on). $p_code=trim($p_code) did the trick. I could still use that Bushmill's, though. At 03:57 PM 5/1/2001 -0700, Richard S. Crawford wrote: ...But my boss won't let me keep the Bushmill's at my desk. *sigh* So, assuming that $p_code is MNE and $neuroKey is 2, then $hub should be 2, right? Instead, it's coming up with 1, which is the value of $coreKey. What have I missed? $hub=$coreKey; if (($p_code==MNE)||($p_code=='SN')||($p_code=='PM')) { $hub=$neuroKey; } else if ($p_code==MAI) { $hub=$allergyKey; } else if (($p_code==SPS)||($p_code==MCC)) { $hub=$dermKey; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Extending a Class
Greetings all, I have a class I use for MySQL connection and functions. I also have a class that I use to create Paged Results. The paged results class connects to a DB and uses allot of sql calls to make this happen. I am noticing that it does allot that the MySQL class does. What I would like to do is to Have the paged results extend the MySQL class so it can use the functions within that class so I can keep them updated in just one place. How would I go about doing that?? Is it as simple as something like this (this is shortened for convience)?? class Mysql { var $results; var $dbcnx; function Mysql($query, $cnx) { // Constructor function $this-dbcnx = $cnx; if (!$this-results = @mysql_query($query)) $this-_error(There was an error with executing your query. Try again later., $query); } } class PageResultSet extends MySQL { var $results; function PageResultSet ($query,$pageSize,$resultpage,$cnx) { $this-results = @mysql_query($query,$cnx) or $this-_error('Error Running your search. Try back later.', $query); $this-pageSize = $pageSize; if ((int)$resultpage = 0) $resultpage = 1; if ($resultpage $this-getNumPages()) $resultpage = $this-getNumPages(); $this-setPageNum($resultpage); } } I would like to be able to pass the results from the MySQL class to the PageResultSet class without have to do the query over and such. How would I go about coding that? I am not clear on that. Also can I extend a function in PageResultSet that is started in MySQL?? In MySQL I have function fetchAssoc() { if (!$this-results) return FALSE; $this-row++; return mysql_fetch_assoc($this-results); } In PageResultSet I have function fetchAssoc() { if (!$this-results) return FALSE; if ($this-row = $this-pageSize) return FALSE; $this-row++; return mysql_fetch_assoc($this-results); } Can I just write something like within PageResultSet function fetchAssocPRS extends fetchAssoc () { if ($this-row = $this-pageSize) return FALSE; } Thanks for the help. -- Blessed Be Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extending a Class
Thank you, This makes allot of sense. However one last question about this. If I access the overrided function from the child class do I access it by. $instanceofchildclass-parent::someMethod(); OR would I still simply just call it $instanceofchildclass-someMethod(); And it would get to use the overrided function in the child class?? -- Blessed Be Phillip Matthew Weier O'Phinney [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] * Brent Baisley [EMAIL PROTECTED] : You've got most of it. Just adding extends MySQL to your page result class will allow you to access all function in the MySQL class. I usually reference functions in the parent class like this: parent::FunctionName() This is a bad practice when inheriting, usually -- the whole point is that the parent classes methods are directly available to the child class without using such constructs. $this- FunctionName() will execute the method 'FunctionName' from the current class -- or any parent class if it is not defined in the current class. There's one good exception: You still reference functions in the current class using $this- , that way you can have functions of the same name in both classes. To make a method in the child class of the same name as a method in the parent class is called overriding -- and is usually done to either change the behaviour of that method (for example, if you want to do something completely different than what was done in the parent class) or to supplement the behaviour of the parent method -- for instance, if the child class wishes to do some processing before or after the parent method is executed. In this latter case, you *will* use the parent::FunctionName() construct -- so that you can actually access the method you're currently overriding: class parentClass { // ... function someMethod() { // do something } } class someClass extends parentClass { // ... function someMethod() { // do some processing first parent::someMethod(); // do some postprocessing } } So, in the OP's case, he might want to have override the fetchAssoc() method in his PageResultSet subclass so that it tacks on the LIMIT info to the SQL statement, and then have it call the parent (Mysql class) fetchAssoc() method with that modified SQL. On Jan 20, 2005, at 9:17 PM, Phillip S. Baker wrote: Greetings all, I have a class I use for MySQL connection and functions. I also have a class that I use to create Paged Results. The paged results class connects to a DB and uses allot of sql calls to make this happen. I am noticing that it does allot that the MySQL class does. What I would like to do is to Have the paged results extend the MySQL class so it can use the functions within that class so I can keep them updated in just one place. How would I go about doing that?? Is it as simple as something like this (this is shortened for convience)?? class Mysql { var $results; var $dbcnx; function Mysql($query, $cnx) { // Constructor function $this- dbcnx = $cnx; if (!$this- results = @mysql_query($query)) $this- _error(There was an error with executing your query. Try again later., $query); } } class PageResultSet extends MySQL { var $results; function PageResultSet ($query,$pageSize,$resultpage,$cnx) { $this- results = @mysql_query($query,$cnx) or $this- _error('Error Running your search. Try back later.', $query); $this- pageSize = $pageSize; if ((int)$resultpage = 0) $resultpage = 1; if ($resultpage $this- getNumPages()) $resultpage = $this- getNumPages(); $this- setPageNum($resultpage); } } I would like to be able to pass the results from the MySQL class to the PageResultSet class without have to do the query over and such. How would I go about coding that? I am not clear on that. Also can I extend a function in PageResultSet that is started in MySQL?? In MySQL I have function fetchAssoc() { if (!$this- results) return FALSE; $this- row++; return mysql_fetch_assoc($this- results); } In PageResultSet I have function fetchAssoc() { if (!$this- results) return FALSE; if ($this- row = $this- pageSize) return FALSE; $this- row++; return mysql_fetch_assoc($this- results); } Can I just write something like within PageResultSet function fetchAssocPRS extends fetchAssoc () { if ($this- row = $this- pageSize) return FALSE; } Thanks for the help. -- Blessed Be Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Matthew Weier O'Phinney | mailto:[EMAIL PROTECTED] Webmaster
[PHP] help with nl2br
Greetings all, Due to style sheet stuff I need to modify the nl2br (IE create or use a different function). I am pulling data from a database and using nl2br, which does the standard. some text copybr / br / Some more copybr / What I want instead is pSome text copy/p psome more text copy/p Again this is because of css and the designer I am workign with. Is there a built in function that can do something like this or another function out there. So far I cannot see anything. Or is there a way to view the coding of the nl2br function so I can create a new function modifying how it does it. Just asking so I do not have to create something from scratch. Thanks. -- Blessed Be Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using List() and a do-while loop with MySQL results.
Greetings all, I am pulling records from a MySQL DB. I am walking through the array using the whole. if ( $row = mysql_fetch_assoc($result)) { do{ //Some stuff }while ( $row = mysql_fetch_assoc($result)); } What I am wondering is if there is something I can do like. if ( list ($id, $someinfo) = mysql_fetch_assoc($result)) { do{ //Some stuff }while ( list ($id, $someinfo) = mysql_fetch_assoc($result)); } When I tried something like that The variables where not populated. Is there something I am doing wrong, or is this just something that cannot be done (or is bad programming practice??) Thanks. -- Blessed Be Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using List() and a do-while loop with MySQL results.
Thanks. That was the problem. I switched it to FetchRow and got what I was looking for. -- Blessed Be Phillip Chris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Excerpt from http://www.php.net/list *Note: * *list()* only works on numerical arrays and assumes the numerical indices start at 0. So the best way , in my opinion, to achieve this effect would be: while(list($id, $someinfo) = mysql_fetch_row($result)) { //Some stuff } Chris Phillip S. Baker wrote: Greetings all, I am pulling records from a MySQL DB. I am walking through the array using the whole. if ( $row = mysql_fetch_assoc($result)) { do{ //Some stuff }while ( $row = mysql_fetch_assoc($result)); } What I am wondering is if there is something I can do like. if ( list ($id, $someinfo) = mysql_fetch_assoc($result)) { do{ //Some stuff }while ( list ($id, $someinfo) = mysql_fetch_assoc($result)); } When I tried something like that The variables where not populated. Is there something I am doing wrong, or is this just something that cannot be done (or is bad programming practice??) Thanks. -- Blessed Be Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Search Engine with MySQL
Greetings all, I just serached the records and found this topic. This nearly answers my question but not completely. I have a search field and a class that I found that will explode queries into an array based on boolean values and such. Which is great so I get all the words a person is searching on and in what way. However I am not clear on the best way to query MySQL. I want to search over four fields in 2 different tables. Based on what I read below there is an easy way to do with with MySQL but I am not familiar with it. Can someone enlighten me on this, it sounds just like what I need. -- Blessed Be Phillip Ben Edwards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This kind of depends on what database you are using (I am asuming you mean you have a data driven site you want to search so strictly speaking it is the database that you want to search). Mysl has free text search facilities (i.e. you can pass it a number of words and it can search for them in a set of database fields and even kreates a 'ranking'). however this only works if you have a few hundread records - less than this and the results are unpredictable. Have you tries googeling for php search scripts? Ben On Thu, 20 Jan 2005 14:04:44 +0200, Rosen [EMAIL PROTECTED] wrote: Hi, Can someone recommend me a search engine script in PHP for inside one site? Thanks in advance! Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Ben Edwards - Poole, UK, England WARNING:This email contained partisan views - dont ever accuse me of using the veneer of objectivity If you have a problem emailing me use http://www.gurtlush.org.uk/profiles.php?uid=4 (email address this email is sent from may be defunct) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help: trouble with JCal Class
I am posting this here, as it is a bug in the application and I awanted to see if anyone else is using this and has come up with a solution. If not and after I figure out more in the code what is going on, if I cannot figure it out I will give you all a block of code. (Oh and I have emailed the author, I was just planning on launching this site today and need a solution ASAP) I downloaded this calendar application from PHP Classes, called JCal. It is a calendar with a tie in to a DB. Functions exactly how I need it , however we just discovered a significant bug today. This is what I wrote the author: Start On the first few days of the month things get real screwy. This is hitting our stage site. So I downloaded a clean install and loaded it locally and found the same bug. Doing some testing with the dates on my machine I discovered the following. It has something to do with Sunday's or something. So February 2005 starts on a Tuesday. It will display the 1st over and over till the first sunday. Then it begins cycling just fine. IE It shows the 1st 6 times till the first sunday. You move on to April which starts on Friday. It will show the 1st 3 times till it hits that sunday then cycles fine. It will also do this for each day thereafter till that first Sunday it hit. IE in Febraury it shows the 1st 6 times, the 2nd 5 times, the 3rd 4times etc. After that first sunday it works fine. I tried switch the day on the computer to other years and every month. Same bug appears. End Anyone else using this and found this problem? Most importantly you come up with a solution? -- Blessed Be Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SOLVED - trouble with JCal Class
I was able to figure out the problem. If there is anyone else out there that is using it and needs the solution let me know and I will pass it on. -- Blessed Be Phillip Phillip S. Baker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am posting this here, as it is a bug in the application and I awanted to see if anyone else is using this and has come up with a solution. If not and after I figure out more in the code what is going on, if I cannot figure it out I will give you all a block of code. (Oh and I have emailed the author, I was just planning on launching this site today and need a solution ASAP) I downloaded this calendar application from PHP Classes, called JCal. It is a calendar with a tie in to a DB. Functions exactly how I need it , however we just discovered a significant bug today. This is what I wrote the author: Start On the first few days of the month things get real screwy. This is hitting our stage site. So I downloaded a clean install and loaded it locally and found the same bug. Doing some testing with the dates on my machine I discovered the following. It has something to do with Sunday's or something. So February 2005 starts on a Tuesday. It will display the 1st over and over till the first sunday. Then it begins cycling just fine. IE It shows the 1st 6 times till the first sunday. You move on to April which starts on Friday. It will show the 1st 3 times till it hits that sunday then cycles fine. It will also do this for each day thereafter till that first Sunday it hit. IE in Febraury it shows the 1st 6 times, the 2nd 5 times, the 3rd 4times etc. After that first sunday it works fine. I tried switch the day on the computer to other years and every month. Same bug appears. End Anyone else using this and found this problem? Most importantly you come up with a solution? -- Blessed Be Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DBF to MySQL using PHP Script
Ave, Does anybody know of a working PHP script to convert DBF data into mySQL table? Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com
[PHP] Help with SQL Query String
Ave, Simple problem.. Following is a statement I¹m inserting in my PHP Script... But it doesn¹t work because I¹m not able to figure out how to put the variables with the trim() function in the SQL insert statement: $sql = INSERT INTO tblname (USERID,FULLNAME,SSN,STARTDATE) VALUES (trim($row[USERID]),trim($row[FULLNAME]),trim($row[SSNO]),trim($row[STARTDAT E])); I can of course predefine a unique variables for each of the $row[] variables with the trim() function and then use those variables in my INSERT statement... But I¹m sure there is a way this statement can work, I¹m just not able to figure it out and would love if anyway made a suggestion. Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] Help with SQL Query String
Ave, Thanks a lot folks. I did actually mention that doing something like $userid = trim($row['USERID']); And then using those variables in my SQL statement would work... The only reason I chose to make this post however and not do that was because I wanted to know if it can be done the other way. I do understand though that using the PHP trim() function in an SQL statemnt won't work. However the new snip about mySQL having it's own TRIM() function is also pretty cool. Thanks again all, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com On 3/31/05 10:30 AM, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] You should not just give him the code but rather tell him why. 1. trim() is a php function. MySQL does not know what to do with it. You need to place it 'outside' of the sql. You can also do something like this: $userid = trim($row['USERID']); Then use $userid in your sql. 2. Items in arrays must be in quotes. [/snip] Ya'll bitch when I make them RTFM, ya'll bitch when I do codewhat's a guy to do? j/k Actually http://dev.mysql.com/doc/mysql/en/string-functions.html shows that MySQL also has a trim function which could be applied thusly; $sql = INSERT INTO tblname (USERID,FULLNAME,SSN,STARTDATE) ; $sql .= VALUES ( ; $sql .= TRIM(' . $row['USERID'] . '), ; $sql .= TRIM(' . $row['FULLNAME'] . '), ; $sql .= TRIM(' . $row['SSNO'] . '), ; $sql .= TRIM(' . $row['STARTDATE'] . ') ; $sql .= ) ; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with SQL Query String
On 3/31/05 12:45 PM, Joseph Connolly [EMAIL PROTECTED] wrote: well...i would have told him to go pound sand...the php manual is great and so is the MySQL manual. People are just lazy. Ave, Pound sand .. Interesting. And yes, both the manuals are great, and people are extremely lazy and purposely idiotic, nonsensical and absurdly inconclusive of the inadequacies of their lifeless brains. Have an awesome day. PS: Jay.. The code works great... Thanks a ton again! Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com [/snip] Ya'll bitch when I make them RTFM, ya'll bitch when I do codewhat's a guy to do? j/k Actually http://dev.mysql.com/doc/mysql/en/string-functions.html shows that MySQL also has a trim function which could be applied thusly; $sql = INSERT INTO tblname (USERID,FULLNAME,SSN,STARTDATE) ; $sql .= VALUES ( ; $sql .= TRIM(' . $row['USERID'] . '), ; $sql .= TRIM(' . $row['FULLNAME'] . '), ; $sql .= TRIM(' . $row['SSNO'] . '), ; $sql .= TRIM(' . $row['STARTDATE'] . ') ; $sql .= ) ; -- 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] Creating INSERT INTO statement from dbf file
Ave, I¹ve written a code that is able to extract the Column names and Records from a simple dbf (foxpro) file and create an INSERT INTO sql statement which can be used to insert all those records with their corresponding field names in an existing mySQL table. (A CREATE TABLE code I wrote is able to create the table from the dbf file information). Following is the code I wrote for creating the INSERT INTO sql: ?php $db_path = $DATABASEFILE; $dbh = dbase_open($db_path, 0) or die(Error! Could not open dbase database file '$db_path'.); if ($dbh) { #Get the Information $column_info = dbase_get_header_info($dbh); $record_numbers = dbase_numrecords($dbh); #Run the loop for all the records in the Table for ($i = 1; $i = $record_numbers; $i++) { $row = dbase_get_record_with_names($dbh, $i); echo INSERT INTO .substr($DATABASEFILE_name,0,-4). (; #Run the loop for all the fields in the Table foreach ($column_info as $v1) {echo $v1[name],;} echo ) VALUES (; #Run the loop for all the values corresponding to fields in the Table foreach ($column_info as $v1) {echo '.trim($row[$v1[name]]).',;} echo '); br; } } dbase_close($dbh); ? It works fine, except for one problem. It¹s able to create the INSERT INTO sql statement, with all the fields and corresponding values, but as I¹m running a loop for both the fields names, and the values corresponding to fields names, it leaves a comma after the records are over. So instead of having this : INSERT INTO tblname (c1,c2,c3) VALUES (v1¹,¹v2¹,¹v3¹); I achieve this : INSERT INTO tblname (c1,c2,c3,) VALUES (v1¹,¹v2¹,¹v3¹,¹); Notice an additional Comma after column names, and an additional ,¹ after the values. I¹m not quite sure what to do to get rid of those. I¹ve tried some different combinations using different kind of logic with the echo statements, but it¹s not working out. Would love some help. Thanks, Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com
Re: [PHP] Creating INSERT INTO statement from dbf file - SOLVED!
Ave, I¹m sure there would be better ways of doing this, and mine may not be the most decent, but I did manage to solve this. Here¹s how I did it: - Create An Array - Run the loop for all the records in the table - Fill the array with the Field Names - Display the Fields names with the ³Comma² being inserted on an ³If² condition pertaining to the count() for the Array. So we place the ³Comma² only ³If² there is a Value remaining in the Array. - Reinitialize (empty) the Array upon restart of the loop (So that the next set of values can go in) I did this once for the Field Names and then again for the Values, and it works perfect! The commas apostrophes are just the way they should be, not excessive. The entire INSERT INTO SQL statement is generated from the data in the DBF file. Here¹s the code: ?php $db_path = $DATABASEFILE; $dbh = dbase_open($db_path, 0) or die(Error! Could not open dbase database file '$db_path'.); if ($dbh) { #Get the Information $column_info = dbase_get_header_info($dbh); $record_numbers = dbase_numrecords($dbh); $fArray = array(); $vArray = array(); #Run the loop for all the records in the Table for ($i = 1; $i = $record_numbers; $i++) { $row = dbase_get_record_with_names($dbh, $i); $fArray = array(); $vArray = array(); echo INSERT INTO .substr($DATABASEFILE_name,0,-4). (; #Run the loop for all the fields Assign Field Names to an Array foreach ($column_info as $v1) {$fArray[]=$v1[name]; }; #Run the loop for all values in the Array Display Field Names $c=count($fArray); for($j=0;$j=$c;$j++) { echo $fArray[$j]; if($j$c-1) { echo ,; } } echo ) VALUES (; #Run the loop for all the values corresponding to fields in the Table foreach ($column_info as $v1) { $vArray[]=trim($row[$v1[name]]); } #Run the loop for all values in the Array Display Values $c2=count($vArray); for($j2=0;$j2=$c2;$j2++) { if($j2$c2) { echo '; } echo $vArray[$j2]; if($j2$c2) { echo '; } if($j2$c2-1) { echo , ; } } echo ); br; } } dbase_close($dbh); ? Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com On 4/4/05 4:33 PM, Rahul S. Johari [EMAIL PROTECTED] wrote: Ave, I¹ve written a code that is able to extract the Column names and Records from a simple dbf (foxpro) file and create an INSERT INTO sql statement which can be used to insert all those records with their corresponding field names in an existing mySQL table. (A CREATE TABLE code I wrote is able to create the table from the dbf file information). Following is the code I wrote for creating the INSERT INTO sql: ?php $db_path = $DATABASEFILE; $dbh = dbase_open($db_path, 0) or die(Error! Could not open dbase database file '$db_path'.); if ($dbh) { #Get the Information $column_info = dbase_get_header_info($dbh); $record_numbers = dbase_numrecords($dbh); #Run the loop for all the records in the Table for ($i = 1; $i = $record_numbers; $i++) { $row = dbase_get_record_with_names($dbh, $i); echo INSERT INTO .substr($DATABASEFILE_name,0,-4). (; #Run the loop for all the fields in the Table foreach ($column_info as $v1) {echo $v1[name],;} echo ) VALUES (; #Run the loop for all the values corresponding to fields in the Table foreach ($column_info as $v1) {echo '.trim($row[$v1[name]]).',;} echo '); br; } } dbase_close($dbh); ? It works fine, except for one problem. It¹s able to create the INSERT INTO sql statement, with all the fields and corresponding values, but as I¹m running a loop for both the fields names, and the values corresponding to fields names, it leaves a comma after the records are over. So instead of having this : INSERT INTO tblname (c1,c2,c3) VALUES (v1¹,¹v2¹,¹v3¹); I achieve this : INSERT INTO tblname (c1,c2,c3,) VALUES (v1¹,¹v2¹,¹v3¹,¹); Notice an additional Comma after column names, and an additional ,¹ after the values. I¹m not quite sure what to do to get rid of those. I¹ve tried some different combinations using
[PHP] authentication problem
Hi all I'm trying to do authentication with database. I created the database and I inserted some usernames and passwords into my database. By using the below file, I'm trying to give access to the main page for the accounts that matches the username and password. The problem is that it do not recognize the usernames and password that i already inserted and it dont let me in. Do you see an problem with the code ort any idea? When I modifiy that line to 0, it lets me in if (mysql_num_rows($result) ==0) //---like that Thanks in advance :) This is my form and php file-- ?php session_start(); $errorMessage = ''; if (isset($_POST['txtUserId']) isset($_POST['txtPassword'])) { include 'library/config.php'; include 'library/opendb.php'; $userId = $_POST['txtUserId']; $password = $_POST['txtPassword']; // check if the user id and password combination exist in database $sql = SELECT user_id FROM tbl_auth_user WHERE user_id = '$userId' AND user_password = PASSWORD('$password'); $result = mysql_query($sql) or die('Query failed. ' . mysql_error()); if (mysql_num_rows($result) ==1) { // the user id and password match, // set the session $_SESSION['db_is_logged_in'] = true; // after login we move to the main page header('Location: main.php'); exit; } else { $errorMessage = 'Sorry, wrong user id / password'; } include 'library/closedb.php'; } ? html head titleBasic Login/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body ?php if ($errorMessage != '') { ? p align=centerstrongfont color=#99?php echo $errorMessage; ?/font/strong/p ?php } ? form action= method=post name=frmLogin id=frmLogin table width=400 border=1 align=center cellpadding=2 cellspacing=2 tr td width=150User Id/td tdinput name=txtUserId type=text id=txtUserId/td /tr tr td width=150Password/td tdinput name=txtPassword type=password id=txtPassword/td /tr tr td width=150nbsp;/td tdinput name=btnLogin type=submit id=btnLogin value=Login/td /tr /table /form /body /html -- __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need class to send email w/attachments
Ave, Try http://www.phpclasses.org/mimemessage I used it for my business application everyday, works great and is very efficient. Rahul S. Johari Coordinator, Internet Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com - Original Message - From: Bosky, Dave [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Friday, May 06, 2005 12:44 PM Subject: [PHP] need class to send email w/attachments Any recommendations for PHP classes that will send email messages with attachments? Thanks, Dave HTC Disclaimer: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you.
[PHP] Help : I need modify a the header information in a JPEG image file
Hi, I new to the php world ant the image too, and I need modify the header information in a JPEG image file, is that possibly? How? I need put some information in the image at the instant when the user download this from the web site. Thanks in Advance. Saludos, Patricio Vera.
RE: [PHP] test - please ignore
On that same note, if this list did NOT except attachments, we wouldn't have to worry as much about Thank You! and Details, etc... -Original Message- From: Wouter van Vliet [mailto:[EMAIL PROTECTED] Sent: Sunday, August 17, 2003 7:47 PM To: PHP General Subject: [PHP] test - please ignore I'm just testing if this list accepts text attachments .. would be much easier for code exchange and stuff... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] This is getting rediculus
I don't know, but if we can find out who it is and saywhere he livesI'll be glad to remedy the situation. :-) -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 11:57 AM To: Curt Zirzow Cc: [EMAIL PROTECTED] Subject: Re: [PHP] This is getting rediculus I was thinking about it, but how did he manage to send the confirmation email. Maybe the list admin did it ;) Curt Zirzow wrote: Some joker is somehow making all are posts being sent to request subscriptions, help-list, unsubscriptions.. etc. I'm not sure how we can stop this nonsense. Part of the problem is there seems to be nobody in control of this list. I have tried contacting several people about this but I haven't had any success. Does anyone know who to contact about this? Thanks, Curt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] This is getting ridiculous
But if we find a way to filter the list, say, for patterns just like virus checking programs do. That would probably solve a lot of problems. But again, nobody is really in control of the list so that is difficult...besides, hundreds of people use this list. I don't want to go through and block each individual user. That also defeats the purpose of this list. I'm subscribed so that I can keep up on issues people are having. If I have a question, or a comment, I'll throw my $.02 in. If people just go and block everyone else you end up with tons of redundant posts. Blocking the users is not solving the issue... -Original Message- From: Dan Anderson [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 1:18 PM To: Curt Zirzow Cc: PHP List Subject: Re: [PHP] This is getting rediculus This is fine an dandy but this problem needs to be resolved. not ignored!!! sarcasm What a brilliant idea! I'll tell you what, you start in the Eastern United States and tell everyone to use something besides Windows and I'll start in the Western United states. We'll meet up somewhere in the Great Plains and shake hands when we've eradicated viruses from America! Next stop: the world! BWAHAHAHA /sarcasm So long as we have people with this lists address in a Windows address book while there's a major worm raging there are going to be emails of this sort. I subscribe to several lists and each one appears to be affected. -Dan -- 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] Mailing List Weirdness
Forge the headerspleasesomeone. :) -Original Message- From: Dan Van Derveer [mailto:[EMAIL PROTECTED] Sent: Thursday, August 21, 2003 1:19 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Mailing List Weirdness Most mailing lists(I don't know about this one because I have yet to unsubscribe) require confirmation of the unsub too. I was thinking maybe us users can attempt to remove these other mailing lists for ourselves. Dan -Original Message- From: Van Andel, Robbert [mailto:[EMAIL PROTECTED] Sent: Thursday, August 21, 2003 12:45 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Mailing List Weirdness Is there no confirmation anymore when subscribing to the list?? I seem to recall that once I added my email I got several emails from this mailing list asking me to confirm the subscription. These returned emails are a pain in the a** if you ask me, or even if you don't :D Robbert van Andel -Original Message- From: Jonatan Pugliese. [mailto:[EMAIL PROTECTED] Sent: Thursday, August 21, 2003 9:38 AM To: Van Andel, Robbert; [EMAIL PROTECTED] Subject: Re: [PHP] Mailing List Weirdness yes me too - Original Message - From: Van Andel, Robbert [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 21, 2003 1:35 PM Subject: [PHP] Mailing List Weirdness The last two posts I sent to this mailing list produced a flurry of emails from various locations including majordomo stating it couldnt' understand the command I just sent it, a reply from a e-commerce site stating my order has been received, and others. Anyone else running into this? Robbert van Andel -- 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] PHP Interview questions
Each connected to a different light bulb, 3 switches, 3 bulbs. Not exactly rocket science here people. :-) -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2003 12:57 PM To: Jay Blanchard Cc: CPT John W. Holmes; Micheal Harris; [EMAIL PROTECTED] Subject: RE: [PHP] PHP Interview questions This smells like a trick question... Are the switches connected to the same light bulb? You've only mentioned one light bulb? 8) Cheers, Rob. On Tue, 2003-08-26 at 12:35, Jay Blanchard wrote: Also ask a couple of other questions that require thought, but have nothing else to do with code. such as... In one room you have 3 light switches, each connected to one light bulb in another room. How many trips must you make to determine which switch is connected to which light bulb? -- .-. | Worlds of Carnage - http://www.wocmud.org | :-: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul.| `-' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Interview questions
Oh manit is WAY too early for a question like this... -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, August 28, 2003 7:31 AM To: Jay Blanchard; Curt Zirzow; PHP General Subject: RE: [PHP] PHP Interview questions [snip] However, Curt does bring up a good pointgiven a real world situation create the decision logic (in code format) that demonstrates you grep the path needed to arrive at a conclusion. As many of us model business processes this is a valid method for determining familiarity with the problem solving method in a code based world. Some of you requested another situation [/snip] Many of you will have seen this one, but perhaps never applied programming logic to it. You come to a fork in the road. One fork takes to to Utopia (where you'd like to go) and the other takes you to the Black Forest (where you definitely do not want to go). There are two men standing there. You know that one always tells the truth, the other always liesbut you do not know which one performs which way. What is the one question that you can ask that will let you know which way is the way to Utopia? -- 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] var static
If I were you, I would use the following: if (!is_a ($miInstancia, 'db')) $miInstancia=new db(); That way you can ensure that the variable has been instantiated and is an instance of the db class.. But it may not really matter.. Jordan S. Jones Alvaro Martinez wrote: I've found the solution myself. The db class is the next: class db{ function db (){ // funcion que se conecta con la BBDD $result = @mysql_pconnect(inforalv, discoteca, password); if (!$result) return false; if ([EMAIL PROTECTED](discoteca)) return false; } function getInstancia(){ static $miInstancia; if (!get_class($miInstancia) == 'db') $miInstancia=new db(); return $miInstancia; } and the call to this class is the next: $conexiondb1=db::getInstancia(); $conexiondb2=db::getInstancia(); In the second call I obtain the same object. Muchas gracias por vuestra ayuda Alvaro Dynamical.Biz [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Although PHP supports static variables in functions (see here), it has no support for static variables in classes. http://www.php.net/manual/en/language.variables.scope.php (espero que te sirva) saludos aniceto lópez :: DYNAMICAL.BIZ web development host services Barcelona - Spain -Mensaje original- Asunto: [PHP] var static I want to obtain only one instance of one class. In other to do that, I call to a static method, that creates the instance(if it doesnt exit) or returns the reference of the instance. The call to the static method is the next: $conexiondb=db::getInstancia(); Well, but if I call to db::getInstancia() another time, I obtain another new object :-( The code of the db class is the next (it is a Singleton Pattern, but it doesnt work) class db{ var $_miInstancia; function db (){ // funcion que se conecta con la BBDD static $miInstancia; $this-_miInstancia=$miInstancia; $result = @mysql_pconnect(inforalv, discoteca, password); if (!$result) return false; if ([EMAIL PROTECTED](discoteca)) return false; } function getInstancia(){ if (!isset($this)) $_miInstancia=new db(); return $_miInstancia; } } I think that the problem is that the var _miInstance is not static and I dont know how to do it. Could you please tell me if there is anything wrong? Thanks. Alvaro -- 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] Question about the scope of functions
Greetings People, Now basically I am trying to set up an easy way to have key value pairs listed in a DB, and then be able to call the name of the key as a variable later in the code of the page and list the corresponding value in the DB. I am almost there. However I just need to figure out some scope issues with functions. I want to create variables with names on the fly through a function and have them last beyond the life of the function. However I do not want to have to declare each key/variable as a global variable in the function, will defeat the purpose of this. I have the following DB table sao_key sao_value app_past_enroll 1 something 0 something_else 1 yet 1 I have the following function function key_value ( $mysql ) { if ( $sao_row = $mysql - fetchRow() ) { do { ${$sao_row[0]} = $sao_row[1]; // Create a variablle to pull the radio variable name } while ( $sao_row = $mysql - fetchRow() ); } } I have the following code $sql = SELECT sao_key, sao_value FROM staff_app_options $sao = new MySQL ( $sql ); # Create an object with the above query key_value ( $sao ); echo 'Past Enrollment = ' . $app_past_enroll . NL; echo 'something = ' . $something . NL; echo 'something_else = ' . $something_else . NL; echo 'yet = ' . $yet . NL; So how do I get the script to read $app_past_enroll as a variable after it has been created by the function? Thanks for your help. Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about the scope of functions - I solved it
Hey all, Nevermind this. I just solved it myself. I found out it does not matter when you decalre a variable as global (other than I guess before you use it) So I made my function this way. function key_value ( $mysql ) { if ( $sao_row = $mysql - fetchRow() ) { do { global ${$sao_row[0]}; ${$sao_row[0]} = $sao_row[1]; // Create a variablle to pull the radio variable name } while ( $sao_row = $mysql - fetchRow() ); } } and it works like a charm. Phillip At 02:14 AM 8/31/2003 -0700, you wrote: Greetings People, Now basically I am trying to set up an easy way to have key value pairs listed in a DB, and then be able to call the name of the key as a variable later in the code of the page and list the corresponding value in the DB. I am almost there. However I just need to figure out some scope issues with functions. I want to create variables with names on the fly through a function and have them last beyond the life of the function. However I do not want to have to declare each key/variable as a global variable in the function, will defeat the purpose of this. I have the following DB table sao_key sao_value app_past_enroll 1 something 0 something_else 1 yet 1 I have the following function function key_value ( $mysql ) { if ( $sao_row = $mysql - fetchRow() ) { do { ${$sao_row[0]} = $sao_row[1]; // Create a variablle to pull the radio variable name } while ( $sao_row = $mysql - fetchRow() ); } } I have the following code $sql = SELECT sao_key, sao_value FROM staff_app_options $sao = new MySQL ( $sql ); # Create an object with the above query key_value ( $sao ); echo 'Past Enrollment = ' . $app_past_enroll . NL; echo 'something = ' . $something . NL; echo 'something_else = ' . $something_else . NL; echo 'yet = ' . $yet . NL; So how do I get the script to read $app_past_enroll as a variable after it has been created by the function? Thanks for your help. Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Blessings Phillip +++ IMPORTANT: This email message (including attachments, if any) is intended for the use of the individual addressee(s) named above and may contain information that is confidential, privileged or unsuitable for overly sensitive persons with low self-esteem, no sense of humor or irrational religious beliefs. If you are not the intended recipient, any dissemination, distribution or copying of this email is not authorized (either explicitly or implicitly) and constitutes an irritating social faux pas. Unless the word absquatulation has been used in its correct context somewhere other than in this warning, it does not have any legal or no grammatical use and may be ignored. No animals were harmed in the transmission of this email, although the barking dachshund next door is living on borrowed time, let me tell you. Those of you with an overwhelming fear of the unknown will be gratified to learn that there is no hidden message revealed by reading this warning backwards, so just ignore that Alert Notice from Microsoft. However, by pouring a complete circle of salt around yourself and your computer you can ensure that no harm befalls you, your family or your pets. If you have received this email in error, please add some nutmeg and egg whites, whisk and place in a warm oven for 40 minutes. +++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_FILES help. Counting help
Didier, My guess is in your HTML, you have the input(s) named as 'file'.. Because of the way that PHP handles it's POST/GET variables, you will want to redeclare your input names in your HTML to 'file[]'... This basically defines that it is an array.. Hope that helps, Jordan Didier McGillis wrote: I have three file fields in a form. I need it to upload those three items or two or one. I can get it to upload one, but not all three, habing trouble with the for loop and how I get a value of $i. if(isset($_POST['upload'])){ if (!empty($_FILES['file']['name'])){ $formats = array('mp3','exe'); if(in_array(strtolower(substr($_FILES['file']['name'],-3)),$formats)) { echo font face=\verdana,arial,helvetica\ size=\2\ color=\#00\bSorry! MP3's and .EXE's are disallowed!/b/font; }else{ //mkdir(upload/ . $_POST['dir'],0777); copy($_FILES['file']['tmp_name'], images/ . $_FILES['file']['name']); unlink($_FILES['file']['tmp_name']); echo font face=\verdana,arial,helvetica\ size=\2\ color=\#00\b.$i. File(s) Uploaded Successfully to b . $_POST['dir'] . /b directory!/b/font; } }else{ echo font face=\verdana,arial,helvetica\ size=\2\ color=\#00\bYou must specify a file to upload/b/fontbr\n; echo font face=\verdana,arial,helvetica\ size=\2\ color=\#00\a href=\javascript:history.back()\ back/a/fontbr\n; exit(); } } $i =$_FILES['file']['name']; is it for ($i=1;$i4;i++) { run code } or am I way off, help please. thanks, _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Jpgraph troubles
On Wed, 28 May 2003, Jordan Elver wrote: -Hi, -I've been creating some graphs using jpgraph and they work really well when I -view them directly i.e. directly through the script. My problem comes as soon -as I try to display them using the DEFANGED_IMG tag within another page. When I do: - -DEFANGED_IMG src=graph.php / - -I can't get it to display. It just shows the broken image icon. - -Any ideas whaty may be causing that? Some mail filters strip all IMG tags from HTML style emails to prevent unwanted trickery of loading images so see if an email address works. Some just change the IMG tag to DEFANGED_IMG effectively breaking the link. I only see this in email filters so I do not know why this is showing up on your PHP generated web page. - -TIA, -Jord --- -Jordan Elver -The office is like an army, and I'm the field general. You're my footsoldiers -and customer quality is the WAR!!! -- David Brent (The Office) - - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins [EMAIL PROTECTED] http://www.phphosts.com/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] easy conversion to a date?
Anthony, I believe that what you are looking for is the following: http://www.php.net/strtotime Jordan Anthony wrote: I have a form where the user enters a date into a text input field. I need to convert this text to a date and put it in a field in a mySQL database. Is there an easy way to do this? Do I have to tear the string appart and create a date out of the parts? Someone must have a fiunction that will do this work already right? Thanks for your help - Anthony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sound
Have you copied the sound file to your server as well? Jordan Bobby wrote: Does anybody know of a way under php to add a background sound to a webpage...i have sound on my page when it's local but as soon as I copy it to the server, nothing :( thanks -bobby Bobby Brooks [EMAIL PROTECTED] http://bobby-brooks.com Public Key = bobby-brooks.com/pubring.pkr Simulated disorder postulates perfect discipline; simulated fear postulates courage; simulated weakness postulates strength. Sun Tzu - The Art of War (Chap 5-17) ICQ-33647303 AOL_IM-TX Copenhagen Yahoo-tx_copenhagen1977 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sound
Negative. Sounds are client side, PHP is server side. -Original Message- From: Bobby [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 3:45 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP] sound I know that...i'm just curious if somebody knows of a bit of php code outside of the usual html embed src and background tags for sound on a webpage...and I'm trying to avoid having to add flash unless I have to...but yes that is an option Thanks -bobby -Original Message- From: Julien Wadin [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 9:40 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP] sound Php is on the server, not on the local client You can make it with Flash -Message d'origine- De : Bobby [mailto:[EMAIL PROTECTED] Envoyé : jeudi 29 mai 2003 21:39 À : [EMAIL PROTECTED] Objet : [PHP] sound Does anybody know of a way under php to add a background sound to a webpage...i have sound on my page when it's local but as soon as I copy it to the server, nothing :( thanks -bobby Bobby Brooks [EMAIL PROTECTED] http://bobby-brooks.com Public Key = bobby-brooks.com/pubring.pkr Simulated disorder postulates perfect discipline; simulated fear postulates courage; simulated weakness postulates strength. Sun Tzu - The Art of War (Chap 5-17) ICQ-33647303 AOL_IM-TX Copenhagen Yahoo-tx_copenhagen1977 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions can be dangerous
Wim While I do see the usefullness of sessions, I have to disagree with you on the security aspect. A session ID is just as vulnerable to sniffing as is a username / password combination. The only security you gain from using it instead is that it's value is time limited. If your application reallys needs all that security, you'd better be using a secure transport, period. The session might even be worse, because, for instance, if you're using the files session handler, another user of your system may be able to easily read the current sessions id's from the temp folder, and hijack an authenticated session, even if it were encrypted. As george stated, there is also always the chance that the session_id generator is NOT secure, in which case you're really up the proverbial creek. You're right, however, in that storing all the state information on the server is a good thing. Why pollute your html with hidden fields, or mangle the heck out of your urls. I DO believe that maintaining state is a necessity when attempting to write Applications on the web, instead of just web pages. --erik Wim Paulussen wrote: George, Having created an invoicing system using php , I very clearly understand the advantage the session construction holds : the information is maintained on the server, rather than floating around in cyberspace between the client and server each and every time you exchange information. If you want to use hidden input you need to set up a secure link each and every time you transfer the o so important username/password combination. Furthermore , the session data is not that difficult to access with another program as long as you can capture the session-id, which you can. All in all , I did not yet come across a better system to get something working in a manageable and secure way. You could go a step further and mimick the session_data management via a database interface if your data quality is such an important issue, but then again, make sure you have a foolproof system to make logging in into the database secure ! Nobody forces you to use the session system and if you want to shy away from it , it is your choice, but I am a little bit afraid that your lenghty email about session insecurity will be meaningfull only for the core PHP developers/auditors. Wim -Oorspronkelijk bericht- Van: George Whiffen [mailto:[EMAIL PROTECTED] Verzonden: Friday, May 30, 2003 4:27 PM Aan: [EMAIL PROTECTED] Onderwerp: [PHP] Sessions can be dangerous Dear All, There doesn't seem to be much discussion of the disadvantages and long term dangers of using php sessions. So let's redress the balance: 1. Heterogeneous Code Environments php session data is not easily accessible from non-php code e.g. Perl/C/ASP etc. In contrast, either client-stored data e.g. cookies, hidden posts, get variables, or data stored in a structured database table, (i.e. one column per variable), is easily accessible from other code. The implication is that sessions may suit you fine as long as only php is used on your site. However, if your site matures and you ever want or need to use another language for some pages, it will be hard for those pages to access data stored in sessions. On the other hand, if the data had been stored in an well-established industry standard format, you should have no problems. 2. Provably Secure Authentication Data Hopefully we all know by now that the best way to safely authenticate for access control is to make sure the username/password is checked every time either by your script, your webserver or a trusted third-party. However, I have the feeling some session users are tempted to simply authenticate in one script and store a logged in or username flag in the session without the username/password having been re-validated. It's not a complete disaster if you do this, which probably means lots of people do it! But this is only as secure as the session_id key. I don't doubt that session_ids are generated with a high-quality random number generator and should be suitably uncrackable. However, the crackability/vulnerability of a username/password schema is very well understood. Can we really say that the vulnerability/crackability of a session_id is as well understood? What happens if, and I'm sure it's a remote chance, there is ever a bug in the session-key generation that stops them being so random so a session_id crack becomes not just possible but real easy! Usernames/passwords just don't have that kind of vulnerability, and the vulnerabilities they do have are well known. 3. Independent Audit of Server Stored Data Procedures for independently verifying the data stored on a server in a SQL RDBMs are well established. It is easy to query the database schema to see what columns are defined. It is easy to verify that the data actually held in a column is as expected. In general it is easy to prove and verify what data is held e.g. to prove Data Protection compliance or Bank/Credit Card
Re: [PHP] general questions
Dale, 1. If my memory serves me correctly, when you initialize a variable, it is given the default value of NULL until something is assigned to it. 2. PHP is not a strongly typed language, meaning that your array would act as so: $arr_test[0] = 1; /// Integer type $arr_test[1] = My Name; /// String type $arr_test[2] = true; /// Boolean type Hope this helps, Jordan S. Jones Dale wrote: I am new to php and I just have some general questions. 1. when you create a new variable such as an integer, is it automatically initialized or is it considered empty similar to asp? 2. If I were to create an array and filled the array with a Boolean value, a string, and an integer what type would the array take on? Thanks, Dale
Re: [PHP] oasis banners - ot -
On Tue, 3 Jun 2003, Ryan A wrote: -Hi, -I have decided to check out Oasis banner software but cant figure out how -to install it in my shared hosting planbecause it says something about -compiling it into apache or php etc which has gotten me totally confused. -Anybody here worked with Oasis kindly tell me how you installed it. -Thanks, I have tried a few times without success. It seems to require some kind of cache feature which allows it to be fast, but not as straight forward as something like phpAdsNew. I did not have time to fiddle with such things and have plenty of horsepower anyway, so I went with phpAdsNew and moved on. Please let us know if you have success with Oasis. --Ryan - - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins [EMAIL PROTECTED] http://www.phphosts.com/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Username
You can add extra info into the appropriate fields like so. mail([EMAIL PROTECTED], the subject, $message, From: [EMAIL PROTECTED],[EMAIL PROTECTED]); However, your local sendmail might restrict this behavoir of changing the sender identity. Mine simply complaines about it in the mail logs, but does change the from information like I wish. Look here for more details: http://us2.php.net/manual/en/function.mail.php On Tue, 10 Jun 2003, Josh Thomas wrote: -I know that if you use sendmail to perform your mailings in php that the -sender shows up as the user and group for Apache. Now is there a way to make -the mail command display a different user in the from field? I know that I -could change the user/group for Apache to fix it, but is there a setting in -the PHP.conf file to change this. Will I be better off using pop and smtp -and just point it to my local box? - -Thanks -Josh Thomas -www.kickbackpoints.com - ** John Huggins [EMAIL PROTECTED] http://www.phphosts.com/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nl2br() Function for Paragraphs?
On Wed, 11 Jun 2003, Nick Wilson wrote: -Hello everyone, - -Has anyone written a function that does what nl2br() does but wraps text -in a p/p's instead? I'm a bit of a clean html type and nl2br() just -leaves me wishing there was a better way... Several examples appear in the user comments section of: http://us2.php.net/manual/en/function.nl2br.php - -I'm afraid my regex is dreadfull so I just hoped someone might have -already done it and be willing to share. ;-) - -Many thanks... - --- -Nick WIlson - - - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins [EMAIL PROTECTED] http://www.phphosts.com/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] piping email directly into PHP
On Wed, 11 Jun 2003, Adrian Teasdale wrote: -Hi there - -We are wanting to create a little help/crm tool for internal use. Rather -than reading (and parsing) in an email from a pop account, is it now -possible to pipe email in directly to a database via PHP? If so, any -pointers on how to do it and anything to watch out for? You might get good clues by examining the phorummail.php file in the Phorum.org forum script in their scripts directory of their tarball. http://www.phorum.org/ As I recall, it is meant to be passed email messages via .forward or something like that. It then looks at the mail contents and deals with it accordingly. Phorum is a MySQL thing so I assume they write the data to the database. Note that this file is meant to run like a typical shell script with this in the first line: #!/usr/local/bin/php -q Thus, you must have a compiled php executable in /usr/local/bin or whereever you keep your favorite programs. Just compile PHP with no parameters in ./configure and it should make a php binary perfect for use as a shell program tool. The -q turns off header generation I think making php a very suitable progamming language. Good luck. - -Thanks in advance - -Ade - - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins [EMAIL PROTECTED] http://www.phphosts.com/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Redirects in PHP
I don't know of any, but is there a good alternative? -Original Message- From: Zak Johnson [mailto:[EMAIL PROTECTED] Sent: Friday, June 13, 2003 1:31 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Redirects in PHP On 2003-06-13 10:34-0600, Michael wrote: Search engines frown on using meta refresh because of abuse problems. Some engines won't index the page period and all of them penalize you at the very least. While it will work as you described, you're sacrificing search engine positioning to use it. How many search engines do you know of that will parse and follow the JavaScript location.href redirection suggested earlier? -Zak -- 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] Redirects in PHP
But is this the type of stuff that gets penalized in Search Engines or no? -Original Message- From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED] Sent: Friday, June 13, 2003 1:47 PM To: Zak Johnson Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Redirects in PHP At 19:00 13.06.2003, Zak Johnson said: [snip] This will not solve the OP's problem; the header will still be output first, and the client will be immediately redirected. I am curious though; why is everyone suggesting to use JavaScript when the following in the head section of the HTML document will work just as well? meta http-equiv=refresh content=3;URL=http://example.com/new-page.html; / Am I missing something? [snip] This will (or should...) always work regardless of JS settings. Being a HTTP equivalent this also means you can transmit it as MIME header as well: header('Refresh: 5;URL=http://www.microsoft.com;'); echo 'Transferring you to Microsoft in 5 seconds...'; exit; HTH, -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Add new loadable module in php
I've run into a similar situation before because my default PHP install was not using the php.ini in /etc/ . In your phpinfo() does it list /etc/php.ini for the ini file or is something else listed? -Original Message- From: Neil [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 18, 2003 7:19 AM To: [EMAIL PROTECTED]; Skon Lapamnuaypol Cc: Marek Kilimajer Subject: Re: [PHP] Add new loadable module in php Skon Lapamnuaypol wrote: We use PHP 4.3.1 on Apache 1.3.27 (RedHat 7.3). We got a binary PHP rpm package from rpmfind.com. The problem occurred on v-webmail from phpguru.org. I already copied imap.so into /usr/lib/php4 and add an extension of imap.so on /etc/php.ini, then restart httpd. But, the application still can't see the imap module. I wonder that in the extension of php.ini, all of extension (.dll - windows platform) was commmented only mysql.so and imap.so were added. But, phpinfo command show a lot of loadable module. Just curious that where does phpinfo get the information from. - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: Skon Lapamnuaypol [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, June 18, 2003 4:43 PM Subject: Re: [PHP] Add new loadable module in php What platform are you running, where did you get php, do you have imap.so in the extension directory, did you restart webserver after changing its configuration? Skon Lapamnuaypol wrote: Hi, I'm newbie in PHP and tried to install webmail appliction on PHP engine. That webmail require a module IMAP,but my engine haven't have it yet. I tried to put a extenstion = imap.so in php.ini. But, the application still can't detect this module. Can I add php module without recompile PHP source. Thanks in advance, Skon L. Hello Where modules are concerned , you will need to stop and then start apache , as a reload/restart does not check for modules changes . I am not 100% sure of my explanation, but i know in pratice this is the case. Cheers Neil -- 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] preg_match?
Ok, here is my problem. I have a Postscript file that looks something like this: %!PS-Adobe-3.0 %%Title: Q-111BSD %%Creator: Windows NT 4.0 %%CreationDate: 8:31 6/30/2003 %%Pages: (atend) . And I want to get the Q-111BSD into a variable but I can't figure out how to keep it from grabbing the next line as well. Does anyone have any idea how I can do this? Thanks in advance! Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] preg_match? [SOLVED]
Sorry. Must be Monday or something :-) preg_match('/%%Title:(.*?)%%/i',$contents,$matches); -Original Message- From: Brian S. Drexler [mailto:[EMAIL PROTECTED] Sent: Monday, June 30, 2003 8:35 AM To: [EMAIL PROTECTED] Subject: [PHP] preg_match? Ok, here is my problem. I have a Postscript file that looks something like this: %!PS-Adobe-3.0 %%Title: Q-111BSD %%Creator: Windows NT 4.0 %%CreationDate: 8:31 6/30/2003 %%Pages: (atend) . And I want to get the Q-111BSD into a variable but I can't figure out how to keep it from grabbing the next line as well. Does anyone have any idea how I can do this? Thanks in advance! Brian -- 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] Get Rid of this Crook
You do have to admit though, it is a pretty good story. :-) Now let me ask you this. You reply to this e-mail and give your phone/fax numbers and then I'm assuming those get spammed all to hell too. Correct? -Original Message- From: Daryl Meese [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 7:33 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] Get Rid of this Crook Could someone that this ass of the mailing list Daryl -Original Message- From: MARIAM ABACHA [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 12:02 AM To: [EMAIL PROTECTED] Subject: [PHP] ASSISTANCE NEEDED Hello, I am sorry for the embarrassment this letter might cause you as we have not had any correspondence before this letter. I got your address through my nephew with Nigerian Military Chamber of Commerce industry and Mining during my research for a reliable and trustworthy partner who l can do business with though l did not disclose the nature of the business l intend to do with whoever he recommend for me. I am DR. MRS MARIAM ABACHA, wife of the late Nigeria Head of State, General Sanni Abacha who died on the 8th of June 1998 while still on active duty. I am contacting you in view of the fact that we will be of great assistance to each other likeness developing a cordial relationship. I currently have within my reach the sum of Twenty - Five Million US Dollars (US$25,000,000.00) cash which l intends to use for investment, like Real Estate Development specifically in your country. This money came as a payback contract deal between my late husband and a Russian Firm on our countries Multi-billion dollars Ajaokuta Steel Plant. The Russian Partners returned my husband's Share of USD$25,000,000.00 after the death of my husband and Lodged in my husband's Security Company of which l am director right now, the new Civilian Government have intensified their probe on my husband? Financial and oil company. In view of these, l acted fast to withdraw the US$25,000,000.00 from the company vault and deposited it in a Security Company. I have since declared the Security Company bankrupt. No record ever existed concerning the money traceable by the government because there is no documentation showing that we received the money from the Russian. Due to the current situation in the country concerning government attitude towards my family, it has become quite impossible for me to make use of this money within. Let me refer you to the front page of this day newspapers of 10th March 2001. You can check it through their website www.thisdayonline.com the present government in Nigeria had frozen and seized all our bank accounts both here in Nigeria and abroad.Thus consent l shall expect you to contact me urgently to enable us discuss in detail about this transaction.Bearing in mind that your assistance is needed to transfer this fund, I proposed a percentage of 30% of the total sum to you for the expected service and assistance, 5% for offsetting minor expenses incurred in the course of this transaction. Your urgent response is highly needed as to stop further contacts. All correspondence must be by the email address [EMAIL PROTECTED] I will give you my Tel numbers where you can contact me when I hear from you. I must use this opportunity to implore you to exercise the utmost indulgence to keep this matter extraordinarily confidential whatever your decision while await your prompt response. NB: Because of the security being mounted on the members of my family, l has decided that this transaction exist between you and my nephew Dr. Azeez Bello. Remember to include your private Tel/fax or mobile number for easy communication. Best Regards. DR. (MRS) MARIAM ABACHA -- 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] Communication between PHP Server code and HTML/JavaScript client without refreshing the page
Hi, It is RPC software. I have used it. It work for me. - Konstantin === Frn: Jon Smirl [SMTP:[EMAIL PROTECTED] Skickat: den 12 mars 1999 05:21 Till: [EMAIL PROTECTED] Angende: [PHP3] RPC for PHP from the browser This is a port of Microsoft's remote scripting that supports PHP as the processing system instead of ASP. The Script directory is an exact copy of the download available from http://www.microsoft.com/scripting but is has been extracted out of the windows exe to allow access from Unix. Remote scripting allows RPC calls to PHP objects located at the server. These calls can be synchronous or asynchronous. You can build some really cool pages by combining DHTML and RPC. In the simple case this lets you change part of a page without causing a reload. Remote scripting is supposed to work in MSIE and Netscape, but I haven't checked it in Netscape. The MS client components are unchanged, you use RSPROXY.CLASS and RS.HTM exactly as you would for the ASP engine. The only thing to watch for is that PHP method names are not case sensitive and Javascript names are. The result is that you need to always use lower case method names from your HTML file. RS.INC replaces RS.ASP on the server. They should function exactly the same, if they don't let me know. RSPROXY.JAVA source code is available by buying MS Visual Interdev. They distribute the compiled class for free. RSPROXY uses http GET to call remote methods which limits the amount of parameters that can be passed. At some point I'll recode it to use PUT and allow unlimited parameters. Simphp.htm -- client test program Simple.php3 -- server object being remoted rs.inc -- server support for remote scripting in php3 Jon Smirl [EMAIL PROTECTED] === Jon Haworth wrote: Hi Sharat, How do I communicate betwen an HTML page having JavaScript and a PHP server code without having to refresh the HTML page. I don't think this is possible: once PHP has run (and sent your Javascript to the browser), it's finished - you can't use it again until the next time the page loads. If you want to do this sort of thing you're looking at a Java applet or something along those lines. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php simple.php3 Description: application/unknown-content-type-php3_auto_file simphp.phtml Description: application/unknown-content-type-phtml_auto_file RSProxy.class Description: application/unknown-content-type-javaclassfile rs.js Description: JavaScript source -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Communication between PHP Server code and HTML/JavaScript client without refreshing the page
Hi, Excuse, skip one file. It is full set of RPC files. - Konstantin. Konstantin S. Kurilov wrote: Hi, It is RPC software. I have used it. It work for me. - Konstantin === Frn: Jon Smirl [SMTP:[EMAIL PROTECTED] Skickat: den 12 mars 1999 05:21 Till: [EMAIL PROTECTED] Angende: [PHP3] RPC for PHP from the browser This is a port of Microsoft's remote scripting that supports PHP as the processing system instead of ASP. The Script directory is an exact copy of the download available from http://www.microsoft.com/scripting but is has been extracted out of the windows exe to allow access from Unix. Remote scripting allows RPC calls to PHP objects located at the server. These calls can be synchronous or asynchronous. You can build some really cool pages by combining DHTML and RPC. In the simple case this lets you change part of a page without causing a reload. Remote scripting is supposed to work in MSIE and Netscape, but I haven't checked it in Netscape. The MS client components are unchanged, you use RSPROXY.CLASS and RS.HTM exactly as you would for the ASP engine. The only thing to watch for is that PHP method names are not case sensitive and Javascript names are. The result is that you need to always use lower case method names from your HTML file. RS.INC replaces RS.ASP on the server. They should function exactly the same, if they don't let me know. RSPROXY.JAVA source code is available by buying MS Visual Interdev. They distribute the compiled class for free. RSPROXY uses http GET to call remote methods which limits the amount of parameters that can be passed. At some point I'll recode it to use PUT and allow unlimited parameters. Simphp.htm -- client test program Simple.php3 -- server object being remoted rs.inc -- server support for remote scripting in php3 Jon Smirl [EMAIL PROTECTED] === Jon Haworth wrote: Hi Sharat, How do I communicate betwen an HTML page having JavaScript and a PHP server code without having to refresh the HTML page. I don't think this is possible: once PHP has run (and sent your Javascript to the browser), it's finished - you can't use it again until the next time the page loads. If you want to do this sort of thing you're looking at a Java applet or something along those lines. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Name: simple.php3 simple.php3Type: PHP3 (application/x-unknown-content-type-php3_auto_file) Encoding: base64 Name: simphp.phtml simphp.phtmlType: PHTML (application/x-unknown-content-type-phtml_auto_file) Encoding: base64 Name: RSProxy.class RSProxy.classType: Java Class File (application/x-unknown-content-type-javaclassfile) Encoding: base64 Name: rs.js rs.jsType: JavaScript Program (application/x-javascript) Encoding: 7bit RSProxy.class Description: application/unknown-content-type-javaclassfile rs.js Description: JavaScript source simple.php3 Description: application/unknown-content-type-php3_auto_file simphp.phtml Description: application/unknown-content-type-phtml_auto_file rs_php4.inc Description: application/unknown-content-type-inc_auto_file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php