[PHP] How to get the local date formated like this: 2002-03-15 Y2K Problem
Hi there, I am trying to find out how to get the local date in a format conform to this: 2002-03-15 The following code is a try, but it does not work like I want: $local_time = localtime(time() , 1); echo Date: $local_time[tm_year]'-'$local_time[tm_mon]'-'$local_time[tm_mday]; Returns: Date: 102-2-5 The prob is, that tm_year is not y2k compliant and the 0 are missing for month and day The goal is to find out, if a date provided by the user is in the future or not His date is in this format: [-mm-dd] Has anybody an idea? Thanx, Andy -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] How to get the local date formated like this: 2002-03-15 Y2K Problem
date(Y-m-d); Niklas -Original Message- From: Andy [mailto:[EMAIL PROTECTED]] Sent: 5. maaliskuuta 2002 9:59 To: [EMAIL PROTECTED] Subject: [PHP] How to get the local date formated like this: 2002-03-15 Y2K Problem Hi there, I am trying to find out how to get the local date in a format conform to this: 2002-03-15. The following code is a try, but it does not work like I want: $local_time = localtime(time() , 1); echo Date: . $local_time[tm_year].'-'.$local_time[tm_mon].'-'.$local_time[tm_mday]; Returns: Date: 102-2-5 The prob is, that tm_year is not y2k compliant and the 0 are missing for month and day The goal is to find out, if a date provided by the user is in the future or not. His date is in this format: [-mm-dd] Has anybody an idea? Thanx, Andy -- 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] exists?
It's late, I'm tired I want to parse $searchenquiry if(% exists in $searchenquiry) { do }else{ do } -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Perhaps a task for regexp?
Hy list, I'm currently writing an application to edit and send our customer news- letter. The interface and the template engine which will put the content into text or html templates is ready and working. Now I'd love to extend the system to automatically generate content lists. The html newsletter contains headers from h1 to h3. Now I'd like to parse through the text and get all occurences of h1.../h1 and h2.../h2 add a a name=.../a tag before each of them. How could this be done best? Would a regexp help to get all these entries? And how would I add the a name... tag? Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Directory
Help me, I want create directory on local disc in php script, do you know how ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] exists?
Do you have manual at all? Download it from www.php.net. The function ereg() is your answer. Niklas -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: 5. maaliskuuta 2002 10:29 To: [EMAIL PROTECTED] Subject: [PHP] exists? It's late, I'm tired. I want to parse $searchenquiry if(% exists in $searchenquiry) { do ... }else{ do ... } -- 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] exists?
Perhaps something like this: if(strpos($searchenquiry, %)) { do }else{ don't } /Joakim -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 9:29 AM To: [EMAIL PROTECTED] Subject: [PHP] exists? It's late, I'm tired. I want to parse $searchenquiry if(% exists in $searchenquiry) { do ... }else{ do ... } -- 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] Directory
mkdir() http://www.php.net/manual/en/function.mkdir.php -Original Message- From: Roman Duriancik [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 9:45 AM To: PHP-General Subject: [PHP] Directory Help me, I want create directory on local disc in php script, do you know how ? -- 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] sending multiple frames to different pages
Hello all I have just created a login script that works fine. At the moment I have a pretty simple (I have coded this but I am trying to keep it simple to explain what I am after if login != ok then generate HTML for error page else Generate HTML for ok page. end; what I want to do is if login != ok then generate HTML for error page else send browser frame1 to www.loginok.com AND send broswer frame2 to www.loginfeatures.com end can someone show me how to do the browser re-direction to multiple pages please ?? Also can someone explain the different ways to send frames/browser to a different page with PHP. Thanks, Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php files on cd
Hello Is it possible to put a mysql php web site on CD or maybe to capture the site statically to put it onto cd. thanks Ivan
[PHP] How to validate this date: 2002-02-31
Hi there, I am still lacking of one error the user can provide: Desired format: mmdd Asuming he enters a date: 2002-02-31 (There is no Feb 31) Is there a function which check is the date is ok? Thanx guys, Andy PS: I wrote this function which has the whole: /* * Validates the format of date * requested format: -mm-dd * Return false if not valid */ function validate_date($date){ return ereg (([0-9]{4})-([0-1]{1})([0-2]{1})-([0-3]{1})([0-9]{1}),$date); } -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] How to validate this date: 2002-02-31
On Tuesday 05 March 2002 17:27, Andy wrote: Hi there, I am still lacking of one error the user can provide: Desired format: .mm.dd Asuming he enters a date: 2002-02-31 (There is no Feb 31) Is there a function which check is the date is ok? Try checkdate() -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* If any man wishes to be humbled and mortified, let him become president of Harvard. -- Edward Holyoke */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to validate this date: 2002-02-31
First but may be not probably the best decision is to use (gm)strftime() and (gm)mktime(). So parse your string put the data into mktime() with hour/minute/second for exmaple 12,0,0 . Strftime() will return a unix timestamp. Use that timestamp with strftime() to get the year,month and date. If they are the same as the parsed the date is valid, otherwise not. Best regards, Andrey Hristov - Original Message - From: Andy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 05, 2002 11:27 AM Subject: [PHP] How to validate this date: 2002-02-31 Hi there, I am still lacking of one error the user can provide: Desired format: .mm.dd Asuming he enters a date: 2002-02-31 (There is no Feb 31) Is there a function which check is the date is ok? Thanx guys, Andy PS: I wrote this function which has the whole: /* * Validates the format of date * requested format: -mm-dd. * Return false if not valid */ function validate_date($date){ return ereg (([0-9]{4})-([0-1]{1})([0-2]{1})-([0-3]{1})([0-9]{1}),$date); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: time limit ?
However, the value cannot transfer by this method. I want the value transfer to a txt file ,although it is not completed -- ? http://fansing.hk.st/ ACG(!) http://acgzone.hk.st/ George Whiffen [EMAIL PROTECTED] ???:[EMAIL PROTECTED] ÁC¬P wrote: How can I set a time limit for a form made by PHP (i.e.the value will auto transfer after a certain time) -- Ác¬P¤u§@«Ç http://fansing.hk.st/ ACG¤¬°Ê°Ï°ì(¤j®a¦h¨Ç¨Ó¶K¹Ï§a!) http://acgzone.hk.st/ HTML forms execute in the client's browser, which does not care at all whether the form came from static html file, php, Perl, whatever. The simplest way to get a browser to time out is with a META refresh html tag in the HEADER part of your page e.g. META HTTP-EQUIV=Refresh CONTENT=15; URL=http://www.mysite.com/too_long.html;. This would automatically redirect to the too_long.html page after 15 seconds. George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] addslashes needed for db security? Hack proving web apps
Hi there, I am wondering how to make my application more secure No I was reading in a mysql book, that chars like ' are bad for db PHP provides the function addslashes Is this the way to check for bad entries a user provides? What happens if a hacker tryes to delete my db entries with a input like 'delete Are there any good articles on the web about checking user input, securing webapps against hackers? Thanx andy -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] How to validate this date: 2002-02-31
Dnia wtorek 05 marzec 2002 10:34, Jason Wong napisa: On Tuesday 05 March 2002 17:27, Andy wrote: Hi there, I am still lacking of one error the user can provide: Desired format: .mm.dd Asuming he enters a date: 2002-02-31 (There is no Feb 31) Is there a function which check is the date is ok? Try checkdate() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I use PHP4 module for Apache Win32 ????
How can I use PHP4 module for Apache Win32 _ wai wing hei ICQ#:102663005 Current ICQ status: SMS: (Send an SMS message to my ICQ): +2783142102663005 More ways to contact me: http://wwpicqcom/102663005 _ -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] Is it correct having number of forms in the same html page?
Yes, that can be correct, however: -You can only submit one form at a time - You cannot have 'nested' forms (forms in forms) bvr -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] How can I use PHP4 module for Apache Win32 ????
Download it from wwwphpnet Read install notes, come back when you really need help bvr hei wrote: How can I use PHP4 module for Apache Win32 -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] registering a session variable from a select statment.
Hi, I have a user auth script. Very simple and works. when I check the username and password I check it against a select all the values from the user table where the username and password match. (inputted from a 2 text boxes) like so //sets and runs SQL statement that brings back all info on user which matches us ername and password. $sql_authorisation = SELECT * FROM account_details WHERE account_name='$login_username' AND account_password=PASSWORD'$login_password'); $sql_authorisation_result = mysql_query($sql_authorisation); I then register 2 session variables $login_username and $login_password I would like to register a session variable from the select * I did earlier from the field user_level in the select statment so session register $user_auth_level='user_level' is this the correct way to do this ??? Thanks, Matt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ?include?... another dumb question
I have people telling me that I MUST put the ?include? file before or inside the header of the .php file I am writing before a script is pulled into my file. I usually just put the ?include? whereever I need it on the page. Actually have it embedded in an IF statement, so that if the conditions are not met, the script is not run and there is no need to pull in the script. It works fine Is placing the include at the top absolutely required, good programming convention or just preferred? thanks, Tami Team GotFusion
Re: [PHP] ?include?... another dumb question
On Tuesday 05 March 2002 20:58, Team GotFusion wrote: I have people telling me that I MUST put the ?include? file before or inside the header of the .php file I am writing before a script is pulled into my file. I usually just put the ?include? whereever I need it on the page. Actually have it embedded in an IF statement, so that if the conditions are not met, the script is not run and there is no need to pull in the script. It works fine Is placing the include at the top absolutely required, good programming convention or just preferred? Simply put, you can place them wherever you want. Obviously if your include file defines certain variables then common sense dictates that you include it before you refer to those variables. All this and more is covered in the manual. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* It is sweet to let the mind unbend on occasion. -- Quintus Horatius Flaccus (Horace) */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_query: how to uniquely identify the query???
Hi, I'm a bit a newbie at the mysql-php tandem, but I wanted to ask a pretty basic question Supose you do x=mysql_query(/somequery/) // fetch a row and then later you do y=mysql_query(/somequery/) If you want to fetch the following row for the query in x, you should probably make the distinction with the query in y, how do you do this? Can you give an example? How does this relate to resource link_identifier? Does it? sorry if this might be a bit trivial, but i'm a little stuck, Simon -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] File Upload.
Hi everybody I use a form to upload data to Oracle database using csv file I need to display a result page with all the lines who are good and the one which are bad Everything works fine except the little problem of the refresh If I click on the Explorer Refresh Button I will upload an other time the same file How can I solve this problem ? Laurent Drouet -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Re: Directory
Hi Roman, Check out: http://www.php.net/manual/en/function.mkdir.php Good luck, andy Roman Duriancik [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED]; Help me, I want create directory on local disc in php script, do you know how ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: php files on cd
| -Original Message- | From: Ivan Carey [mailto:[EMAIL PROTECTED]] | Sent: Tuesday, March 05, 2002 10:17 AM | Subject: [PHP] php files on cd | | Is it possible to put a mysql php web site on CD or maybe to | capture the site statically to put it onto cd. Hello, Ivan! Since php is a server based language, you'll always need a web server and the hypertext protocol. Maybe you can use a small web server like Xitami (on the Windows platform) to do the job. However, it's bound to be configured properly and to be started before use... The latter is easily to be done: I'm using HTTrack Website Copier (http://www.httrack.com) for this task. It's fairly adjustable and easy to use. Just try! Regards, Rodya Rodya Jörn Koester B2A MEDIA GRAFIC DESIGN Kassel,Germany,Europe,Earth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] File Upload.
This is exactly how I solve the problem as well, good to know I'm not the only one with that idea. That must mean it wasn't that bad of an idea. Dna -Original Message- From: Niklas Lampén [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 6:52 AM To: Php-General Subject: RE: [PHP] File Upload. I've solved this kind of problems with three pages: 1. Form 2. Insert / Update data 3. Information about insert / update Niklas -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 5. maaliskuuta 2002 15:34 To: [EMAIL PROTECTED] Subject: [PHP] File Upload. Hi everybody. I use a form to upload data to Oracle database using csv file. I need to display a result page with all the lines who are good and the one which are bad. Everything works fine except the little problem of the refresh If I click on the Explorer Refresh Button I will upload an other time the same file. How can I solve this problem ? Laurent Drouet -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help about Linux password change script
Hi, I'm trying to do a script for changing the Linux password of an user in a web page. I don't know how to implement the command passwd in a php script or to do a shell script which would be invoked by the php script. I hope someone can help me. Thanks. Henry Zambrano. _ Descargue GRATUITAMENTE MSN Explorer en http://explorer.yupimsn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ?include?... another dumb question
Yes, this is acceptable. Normally, include and require go at the top of the page out of convention. However, there is no requirement that they be there. Just be careful. it's an accepted convention because it's a good idea. Make sure you know what you are doing when you break with the tradition. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Team GotFusion [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 6:59 AM To: [EMAIL PROTECTED] Subject: [PHP] ?include?... another dumb question I have people telling me that I MUST put the ?include? file before or inside the header of the .php file I am writing before a script is pulled into my file. I usually just put the ?include? whereever I need it on the page. Actually have it embedded in an IF statement, so that if the conditions are not met, the script is not run and there is no need to pull in the script. It works fine Is placing the include at the top absolutely required, good programming convention or just preferred? thanks, Tami Team GotFusion -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: registering a session variable from a select statment.
Hi there :) Try something like this: session register (user_auth_level); $user_auth_level = $user_level; HTH, Joe :) Matthew Darcy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Hi, I have a user auth script. Very simple and works. when I check the username and password I check it against a select all the values from the user table where the username and password match. (inputted from a 2 text boxes) like so file://sets and runs SQL statement that brings back all info on user which matches us ername and password. $sql_authorisation = SELECT * FROM account_details WHERE account_name='$login_username' AND account_password=PASSWORD'$login_password'); $sql_authorisation_result = mysql_query($sql_authorisation); I then register 2 session variables $login_username and $login_password I would like to register a session variable from the select * I did earlier from the field user_level in the select statment so session register $user_auth_level='user_level' is this the correct way to do this ??? Thanks, Matt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: registering a session variable from a select statment.
Ammendment: You'll have to dump that value (the user's level) into a variable called user_level first. HTH Joe :) Lerp [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Hi there :) Try something like this: session register (user_auth_level); $user_auth_level = $user_level; HTH, Joe :) Matthew Darcy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Hi, I have a user auth script. Very simple and works. when I check the username and password I check it against a select all the values from the user table where the username and password match. (inputted from a 2 text boxes) like so file://sets and runs SQL statement that brings back all info on user which matches us ername and password. $sql_authorisation = SELECT * FROM account_details WHERE account_name='$login_username' AND account_password=PASSWORD'$login_password'); $sql_authorisation_result = mysql_query($sql_authorisation); I then register 2 session variables $login_username and $login_password I would like to register a session variable from the select * I did earlier from the field user_level in the select statment so session register $user_auth_level='user_level' is this the correct way to do this ??? Thanks, Matt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ?include?... another dumb question
Yep, ordered the manuals from Amazon.com... and they inadvertently shipped the books to my mom-in-law ha ha. except that she's retired and computers are still a mystery. So, I am muddling through with my PHP dev. dictionary until I get to see my relatives this weekend. (cheesy smiley) Tami Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; On Tuesday 05 March 2002 20:58, Team GotFusion wrote: I have people telling me that I MUST put the ?include? file before or inside the header of the .php file I am writing before a script is pulled into my file. I usually just put the ?include? whereever I need it on the page. Actually have it embedded in an IF statement, so that if the conditions are not met, the script is not run and there is no need to pull in the script. It works fine Is placing the include at the top absolutely required, good programming convention or just preferred? Simply put, you can place them wherever you want. Obviously if your include file defines certain variables then common sense dictates that you include it before you refer to those variables. All this and more is covered in the manual. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* It is sweet to let the mind unbend on occasion. -- Quintus Horatius Flaccus (Horace) */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] serialize
Hi All! I use this code to create a number of fields in a form depending on what input number I use. My problem occurs when i am going to save it. Right now only the value of the last field gets stored. I want to serialize all values from all fields so that they can be saved as a stringvalue is there any friendly soul out there who knows how to do it? /Axel ?php for ($i=0; $i$HTTP_GET_VARS['num']; $i++) { echo felnummer INPUT TYPE=\ TEXT\ name=\felnummer[i]\BR; } ? _ MSN Photos är det enklaste sättet att dela ut och skriva ut foton: http://photos.msn.se/Support/WorldWide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Converting Image Data Directly from MySQL
Hello list, Sorry for this cross post, I subscribed to PHP and PHP-DB, the PHP list seems to be receiving about 95% of the traffic so I thought I'd post this here as well to reach more of the PHP wizards. I've been stumped on this for a while, I have a large project where I am storing image data in a MySQL db for reasons I will not get into. The images are displayed as thumbnails in a table which are hyperlinks to a large file. The larger file is stored in the db as a BLOB type in GIF format. I have a nice freeware commandline program for creating thumbnails called gifsicle. I thought the following code would work: // connect to db, set up SQL, etc. etc. etc. $image = $row[image_data]; // this is the binary GIF image data Header (Content-type: image/gif); if ($view_type == thumbnail) { passthru (/usr/bin/gifsicle --resize 320x240 . $image); } else { echo $image; } flush(); This script works if called to view an image in full size, but if $view_type is set to thumbnail and the passthru command is executed, nothing is displayed. gifsicle generally works like this: /usr/bin/gifsicle --resize NNNxNNN src_image dest_image. I have tried using system and exec as well, nothing seems to work except the following: $fp = fopen(/tmp/tmp.gif,w); fwrite($fp, $image); fclose($fp); passthru(/usr/bin/gifsicle --resize 320x240 /tmp/tmp.gif); This adds a LOT of file system I/O though as it has to write each full sized image stored in the db /tmp and slows things down quite a bit. Does anyone have any other suggestions? My goal is to store only one version of each image file and create smaller versions on the fly. PHP is 4.1.2 on a SuSE Linux 7.3 box, latest Apache server, MySQL 3.23.44. Thanks for your help! Josh Trutwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing Content
On Monday, March 4, 2002, at 06:10 PM, Jonathan Duncan wrote: I want to make a web site that displays news headlines from my favorite news sites. The way that you're thinking of doing it (parsing via regexes from other site's HTML) is the Long Way Around. Why not do it the way the pros do it? This topic is a current front page headline at Developer Shed (www.devshed.com). Here is the link to the tutorial on this very topic: http://www.devshed.com/Server_Side/PHP/PHPRDF/page1.html You get to teach yourself a bit about XML along the way. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mktime() into TIMESTAMP ?
On Monday, March 4, 2002, at 07:22 PM, DL Neil wrote: The choice comes down to how you are generating the time data prior to its storage in the db, and how you plan to use it afterwards. If you are going to be doing lots of temporal processing in PHP, then UNIX timestamp is the way to go. If it is purely a 'label' then stick with that format - even storing a string in MySQL that it doesn't realise is a date! Both PHP and MySQL have a wide range of time/date functions to support such activities. Thanks David, I think I'm going to avoid potential problems with TIMESTAMP columns' unique features by just storing a PHP mktime() value into a VARCHAR(15) column (advice from someone on this list, I can't remember who). While it will mostly be a label, and I could take a shortcut, the advantage is that I can always reformat the Unix timestamp (mktime()) for that later, and I plan to do searches based on date at times. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Directory Size
Hello! I hope someone can help me with this...it's doin' my head in! Below I have a class I found for finding out directory sizes. What I have done is to get the username of each user and their create a directory path (based on their username - these directories do exist with subdirs). This works fine when I restrict the select statement to 1 user, but when selecting all, it generates an error for (nearly) all the users, namely, the ones with no contents in their directories. Thing is, just above the error, it prints what I want ( I think - haven't check it for accuracy yet). Any help or ideas on how to achieve this would be most helpful and appreciated!! (Win2K, PHP 4.1.1) The Code --- ?php include ../../conf/dbinfo.php; ? ?php class DirectoryInfo { //recursively gets the size of a directory. function get_dir_size($dir, $size) { if (isset($handle)) { $handle = ; } $handle = opendir($dir); if(!$handle ) { return $this-display_size(0); } else { while( $file = readdir($handle) ) { if($file != '.' and $file != '..') { is_dir($dir/$file) ? $this-get_dir_size($dir/$file, $size) : $size += filesize($dir/$file); } } if ($size 1) { return $this-display_size(0); $handle =; $size = 0; } else { return $this-display_size($size); $handle =; $size = 0; } } } // File size calculations - for display. function display_size($file_size) { if($file_size = 1073741824) { $file_size = round($file_size / 1073741824 * 100) / 100 . Gb; } elseif($file_size = 1048576) { $file_size = round($file_size / 1048576 * 100) / 100 . Mb; } elseif($file_size = 1024) { $file_size = round($file_size / 1024 * 100) / 100 . Kb; } else { $file_size = $file_size . bytes; } return $file_size; } } $sql = SELECT * FROM FTPUsers; $result = $dsn2-query( $sql ); if ( DB::isError( $result = $dsn2-query( $sql ) ) ) { echo DB::errorMessage( $result ); } else { while ( $row = $result-fetchRow( DB_FETCHMODE_ASSOC ) ) { $dir = F:/path/to/ . $row[Name] . ; $d = new DirectoryInfo; echo P . $row[Name] . nbsp; . $d-get_dir_size($dir, $size); } } ? --- Result --- User1 0 bytes Warning: OpenDir: Invalid argument (errno 22) in F:\OBS\WinPartnerWeb\www\partners\pa\obsWebsite\testsize.php on line 13 User2 0 bytes Warning: OpenDir: Invalid argument (errno 22) in F:\OBS\WinPartnerWeb\www\partners\pa\obsWebsite\testsize.php on line 13 User3 0 bytes User4 26.33 Mb Warning: OpenDir: Invalid argument (errno 22) in F:\OBS\WinPartnerWeb\www\partners\pa\obsWebsite\testsize.php on line 13 User5 0 bytes Warning: OpenDir: Invalid argument (errno 22) in F:\OBS\WinPartnerWeb\www\partners\pa\obsWebsite\testsize.php on line 13 User6 0 bytes Warning: OpenDir: Invalid argument (errno 22) in F:\OBS\WinPartnerWeb\www\partners\pa\obsWebsite\testsize.php on line 13 ... --- Thanks Simon H -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can I authenicate user with the accounts in passwd and shadow??
On Monday, March 4, 2002, at 07:51 PM, Zenith wrote: But I wonder if I can check the user account against with the /etc/passwd, i.e. use the system accounts. You can do this I think. I just saw an Oreillynet article about it, I think. If this link doesn't tell you how, then I don't know. http://www.onlamp.com/pub/a/php/2001/07/26/encrypt.html HTH, Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] live Counter
On Monday, March 4, 2002, at 07:59 PM, olev rumm wrote: Hello How can I monitor how many visitors are currently on line, with out refreshing the frame - like a live monitor. Olev I've seen questions like this quite a bit on this list. If you really think about it, nobody's logged in to your site. :) Your site is throwing out page requests, that's all. There's no place for them to log in. If you're referring to who is currently in the middle of a session on my site, then you'll have to come up with a workaround. Some ideas have included testing to see who has submitted a page request with a session ID within the past few minutes, or things like that. But you'll never be able to make sure someone is logged in or not because your server needs to wait for the user to send some information for it to know what it's doing. Think of HTTP as more like the postal service than a telephone service -- you just send data back and forth, rather than have a true interactive (stateful) session. Only with a custom web client like a Perl/Python/Java program could you do otherwise, unless you can come up with a really clever JavaScript code chunk that sends a message to the server when the user closes a browser window or quits or whatever. Even that would not be very reliable. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] registering a session variable from a select statment.
On Tuesday, March 5, 2002, at 06:54 AM, Matthew Darcy wrote: $sql_authorisation = SELECT * FROM account_details WHERE account_name='$login_username' AND account_password=PASSWORD'$login_password'); $sql_authorisation_result = mysql_query($sql_authorisation); I then register 2 session variables $login_username and $login_password I would like to register a session variable from the select * I did earlier from the field user_level in the select statment so session register $user_auth_level='user_level' is this the correct way to do this ??? For a bit more security: 1) Construct your SQL statement so that it returns the specific columns you want, i.e. SELECT account_name, account_password WHERE account_name='$login_username' AND account_password=PASSWORD('$login_password'); 2) If you are using PHP4.1 or later, you don't have to use session_register(), you can just create a session variable in the $_SESSION array, like $_SESSION['login_name'] = $login_username; $_SESSION['login_pw'] = $login_password; 3) if you want to register a session variable for the field 'user_level' in the select statement, you should probably add it to the list of things you are SELECTing from your query, and do the same thing with this as you did with the other two session variables. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] VeriSign
I have tried compling in the VeriSign support for phpI just downloaded the newest version of the VeriSign SDK, however, after I complie it with apxs and I restart httpd it will not start If I removed the --with-pfpro statment it works fine Any ideas? Michael -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] serialize
hHi $data = serialize($felnummer); That should do it.. Tom At 12:58 AM 6/03/2002, Axel Nilsson wrote: Hi All! I use this code to create a number of fields in a form depending on what input number I use. My problem occurs when i am going to save it. Right now only the value of the last field gets stored. I want to serialize all values from all fields so that they can be saved as a stringvalue is there any friendly soul out there who knows how to do it? /Axel ?php for ($i=0; $i$HTTP_GET_VARS['num']; $i++) { echo felnummer INPUT TYPE=\ TEXT\ name=\felnummer[i]\BR; } ? _ MSN Photos är det enklaste sättet att dela ut och skriva ut foton: http://photos.msn.se/Support/WorldWide.aspx -- 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] ?include?... another dumb question
On Tuesday, March 5, 2002, at 08:08 AM, Jason Wong wrote: Is placing the include at the top absolutely required, good programming convention or just preferred? Simply put, you can place them wherever you want. Obviously if your include file defines certain variables then common sense dictates that you include it before you refer to those variables. I was using a similar technique for some time, where I just included a file that contained whatever code I needed, in the place where it was appropriate. It ended up getting hard to handle, though, because sometimes I'd want access to an includefile's functions but the includefile contained HTML outside of PHP or perhaps an echo statement or something, and I had a header() function or cookie action somewhere below this (these things are invalid once HTML is first output). I eventually switched to a setup where my includefiles may contain variables or functions that I wish to use, but nothing that could output any HTML, so that I can include them wherever I want without worrying about it. I just call the function or use the variable in the decision logic of my scripts now. It's conceptually cleaner. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] serialize
On Tuesday, March 5, 2002, at 09:58 AM, Axel Nilsson wrote: I use this code to create a number of fields in a form depending on what input number I use. My problem occurs when i am going to save it. Right now only the value of the last field gets stored. I want to serialize all values from all fields so that they can be saved as a stringvalue is there any friendly soul out there who knows how to do it? /Axel ?php for ($i=0; $i$HTTP_GET_VARS['num']; $i++) { echo felnummer INPUT TYPE=\ TEXT\ name=\felnummer[i]\BR; } ? I did the exact same code just last week. Try this: for ($i = 0; $i $_GET['num']; $i++) { echo felnummer input type=\text\ name=\ . fellnummer[$i] . \ /br /; } It is very important that you use the doublequotes in the 'fellnummer[$i]' and not use single quotes, or your variable will not expand to the value of $i (it will think that you want a literal 'buck i'). Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help about Linux password change script
On Tuesday, March 5, 2002, at 02:25 PM, Henry Zambrano wrote: Hi, I'm trying to do a script for changing the Linux password of an user in a web page. I don't know how to implement the command passwd in a php script or to do a shell script which would be invoked by the php script. I hope someone can help me. Thanks. Try system() http://www.php.net/manual/en/function.system.php Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php4 / Class / Session
Hello! I am litle confused about this, so I hope someone could give reply on this message an give me the right answer I am comfortable with the use of session, but lately when I have surf around, I have found some documents/tutorials about saving Objects/classes in session It's here I am beginning to be confused Is this for earlier version of Php (Version 3) or what does this mean Is it like this: When a user comes to my site, I intializes all the classes the site needs to run properly, and then I serialize() the class and put them in a session variable Then when the user goes to other places on my site, I only have to unserialize() the class sessionvariable name and use the object EX: First page: ?PHP session_start(); require_once(Aclass); require_once(Bclass); $a = new A; $b = new B; $s[a] = serialize($a); $s[b] = serialize($b); session_register(s); $a-do_something(); $b-do_something_else(); ? Second Page: ?PHP session_start(); $a = unserialize($s[a]); $b = unserialize($s[b]); $a-do_something_on_page2(); $b-do_something_else_on_page2(); ? I hope someone could give a hint on how this work David Tandberg-Johansen -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] serialize
Instead of serialize(), you could also fix your existing code like this: ?php for ($i=0; $i$HTTP_GET_VARS['num']; $i++) { echo felnummer INPUT TYPE=\ TEXT\ name=\felnummer[ $i ]\BR; } ? Or ?php for ($i=0; $i$HTTP_GET_VARS['num']; $i++) { echo felnummer INPUT TYPE=\ TEXT\ name=\felnummer[]\BR; } ? bvr ?php for ($i=0; $i$HTTP_GET_VARS['num']; $i++) { echo felnummer INPUT TYPE=\ TEXT\ name=\felnummer[i]\BR; } ? -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] Can I authenicate user with the accounts in passwd and shadow??
You might want to try setting up an LDAP, kerberos, or NIS system before using the passwd and shadow file. There are some security issues that you might not be aware of... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 8:21 AM To: Zenith Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Can I authenicate user with the accounts in passwd and shadow?? On Monday, March 4, 2002, at 07:51 PM, Zenith wrote: But I wonder if I can check the user account against with the /etc/passwd, i.e. use the system accounts. You can do this I think. I just saw an Oreillynet article about it, I think. If this link doesn't tell you how, then I don't know. http://www.onlamp.com/pub/a/php/2001/07/26/encrypt.html HTH, Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help about Linux password change script
# passwd -? Usage: passwd [OPTION] accountName --stdin read new tokens from stdin (root only) bvr Henry Zambrano wrote: Hi, I'm trying to do a script for changing the Linux password of an user in a web page I don't know how to implement the command passwd in a php script or to do a shell script which would be invoked by the php script I hope someone can help me Thanks Henry Zambrano -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] Does anyone follow?
How about: while ($mydata = mysql_fetch_object($news)) { $mydata-AUS = str_replace( ;, ;, $mydata-AUS); $mydata-AUS = str_replace(; , ;, $mydata-AUS); $tempauthors = explode(;, $mydata-AUS); foreach ($tempauthors as $singleauthor) { if ($singleauthor ) $authors[$singleauthor][] = $mydate-id; } } ksort($authors); foreach ($authors as $author=$ids) { echo a href=\match.php?searchenquiry=.urlencode($author).match=partial+match\ ); echo($author./a); echo((. count[$ids] .) [); foreach ($ids as $id) echo($id); // need something a bit fancier here, but you get the idea echo(]br\n); } Tim Ward Internet chess www.chessish.com http://www.chessish.com -- From: jtjohnston [SMTP:[EMAIL PROTECTED]] Sent: 04 March 2002 23:55 To: [EMAIL PROTECTED] Subject: Re: [PHP] Does anyone follow? Can you show me how :) ? I'm in over my head. I get working with arrays, but need more practice, examples etc. to learn how to code from. How would two arays work? John Does anyone follow what I'm trying to do? I have a list of authors I explode from a field called AUS. I sort them sort($authors); The layout is agreeable. What I would like now to do is change: array_push($authors,$singleauthor); for array_push($authors,$singleauthor,$mydata-id); But how do I sort them now? These two lines permitted me to: sort($authors); foreach (array_count_values ($authors) as $author=$count) sort, count and display each occurence only once. O'Henry, James (5) #--- there were 5 occurences of O'Henry in my database explode Now what I want to do is display the id number (record number) of each occurence of O'Henry: O'Henry, James (5) [record 1, record 4, record, 87, record 119, record 120] How do I re-evaluate this code, modify it to display authors one time only, count the number of occurences in my database and somehow integrate $mydata-id ? Does anyone follow what I'm trying to do? --snip--- $myconnection = mysql_connect($server,$user,$pass); mysql_select_db($db,$myconnection); $news = mysql_query(select id,AUS from $table); $authors = array(); while ($mydata = mysql_fetch_object($news)) { $mydata-AUS = str_replace( ;, ;, $mydata-AUS); $mydata-AUS = str_replace(; , ;, $mydata-AUS); $tempauthors = explode(;, $mydata-AUS); foreach ($tempauthors as $singleauthor) { if ($singleauthor ) array_push($authors,$singleauthor); } } sort($authors); foreach (array_count_values ($authors) as $author=$count) { echo a href=\match.php?searchenquiry=.urlencode($author).match=partial+match\ .$author./a (.$count.)br\n; } mysql_close($myconnection); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] include() and paths
-Original Message- From: Nick Wilson [mailto:[EMAIL PROTECTED]] Sent: 01 March 2002 17:30 To: PHP-General Subject: Re: [PHP] include() and paths -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Nick Winfield declared I didn't catch the first part of this thread (rampant deletion ahoy) so please excuse if I am talking nadgers. The way I see it, if you are calling includes/requires from within other includes, the path is that of the script that makes the first include. If that makes any sense. Sure does, just wondered if anyone could see a way round my little wish :-) AFAIK there is no easy way to do this and as neither the manual nor this list has been able to tell me different I'll have to find another solution. Thanks for the help though! H'mm, the only even *vaguely* useful thing I can think of here is that dirname(__FILE__) should give you the full directory path of the *current* include file. Fine for here-relative names, but you'd need to manipulate it further to do the equivalent of ..-type relativities. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] REQUEST QUESTION
Hi Guys, I allready posted this question in detail but I believe I didn't explain it properly. There are 2 hidden variable in my FORM. 1. order = 10 and 2. order=20 I want to retrieve both the orders in the next page say somename.php. How do i do that. Regards, karthikeyan.
Re: [PHP] FORM RELATED QUESTION - I
Yes I did use $HTTP_POST_VARS but it removes duplicate values. Say if there are two hidden variables 1. order= 10 2. order= 20 I get order=20 the last one but i want both. I need both. Regards, karthikeyan. - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 05, 2002 9:18 AM Subject: Re: [PHP] FORM RELATED QUESTION - I On Tuesday 05 March 2002 10:39, karthikeyan wrote: how do i accomplish the same in php. I have one solution using GET method but I would really like to have it in POST because I am passing lots of values to this php file. == $ar=explode('',$QUERY_STRING); foreach ($ar as $stritem) { if(substr($stritem, 0, 5) == order) { $ordervalue = substr($stritem, 6); echo \ninput type=\hidden\ name=\order\ value=\ . urldecode($ordervalue) . \\n; } } == I don't fully understand your question and what your problem is. Taking a stab in the dark, did you want to retrieve the values resulting from a POST? If so then use: $HTTP_POST_VARS (php = 4.06) $_POST (php 4.06) -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Small things make base men proud. -- William Shakespeare, Henry VI */ -- 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] Mysql
Hi, I am trying to connect to the database like this: $db=mysql_pconnect(localhost, clark, clark) while in mysql do the following: grant all on * to clark identified by 'clark'; And I cannot connect to the DB unless I use root in my php Actually it seems to connect under 'clark' but will not select anything from the table Do I have to have this 'clark' user on my linux machine also? Vlad
Re: [PHP] REQUEST QUESTION
Call me silly, but I would just call the hidden values: $order1 and $order2 Did I miss why they both must be called order? On Tue, 5 Mar 2002, karthikeyan wrote: Hi Guys, I allready posted this question in detail but I believe I didn't explain it properly There are 2 hidden variable in my FORM 1 order = 10 and 2 order=20 I want to retrieve both the orders in the next page say somenamephp How do i do that Regards, karthikeyan -- -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] data from service into array
I'm retrieving data from a data service. This is the ENTIRE source code of the URL they let me receive: symbolRHAT/symbol price6.82/price date3/4/2002/date time3:59pm/time change0.32/change change_percent/change_percent open6.59/open high6.99/high low6.53/low volume932400/volume How can I insert the data values into an array ? Thanks Craig [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: REQUEST QUESTION
Karthikeyan [EMAIL PROTECTED] skrev i melding 002601c1c461$cfa08580$0600a8c0@aspire006..">news:002601c1c461$cfa08580$0600a8c0@aspire006..; Hi Guys, I allready posted this question in detail but I believe I didn't explain it properly. There are 2 hidden variable in my FORM. 1. order = 10 and 2. order=20 I want to retrieve both the orders in the next page say somename.php. How do i do that. Regards, karthikeyan. You must put the in a array like this input type=hidden name=order [1] value=10 input type=hidden name=order [2] value=20 On the nest page you just do echo The first order is .order[1]. and the second order is .order[2]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mysql
Change the grant to: grant all on * to clark@localhost identified by 'clark'; Then do a: flush privileges; I am trying to connect to the database like this: $db=mysql_pconnect(localhost, clark, clark) while in mysql do the following: grant all on * to clark identified by 'clark'; And I cannot connect to the DB unless I use root in my php Actually it seems to connect under 'clark' but will not select anything from the table -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] How to question...
This may seem a bit unorthodox but I am wondering if there is a simple way to take an existing web site done in mostly html and wrap that code in php so that when a user goes to view source they get nadda Remember I said a simple way Thanks in advance Jas -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] How to question...
No. Wrapping in PHP or any other scripting language won't hide the HTML from the user. For the browser to render it, you HAVE to send the HTML to the browser. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 10:51 PM To: [EMAIL PROTECTED] Subject: [PHP] How to question... This may seem a bit unorthodox but I am wondering if there is a simple way to take an existing web site done in mostly html and wrap that code in php so that when a user goes to view source they get nadda... Remember I said a simple way. Thanks in advance. Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to transfer letters (e.g. en-us, es, fr etc.) to full names (e.g. England, France etc.)?
Hi, I'm finishing a log script which determines what country the visitors come from via language settings in the browser Now I need to transfer those letters (eg en-us, es, fr etc) to full names (eg England, France etc) Do you know where I can find an index-file that I can use to make full names? Maybe you have one already you can send me? Thanks in advance! SED -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Re: file upload problem (files 7.5mb)
Stefan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; i wrote a php uploadscript and it works fine till the file is not larger then 7.5mb. is set the max upload file size in the upladfrom as well as in php.ini to 100mb. but it still doesn't work! system is linux red hat and php 4.0.6 (with mysql) is there anyone who had the samestefa problem and knows a solution? stefan I suspect the killer is 'post_max_size' Adjust settings for: max_execution_time memory_limit post_max_size Also you really should upgrade to php 4.1.2 since this fixes a security hole in file uploads. Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RSA Encryption with PHP (code attached)
Hi all, I currently trying to get RSA encryption working in PHP and have came up against a few issues that i hope somebody on here will be able to help me with. Basicly i have it mostly working and am able to generate keys OK and i can also encrypt/decrypt data that will fit into one message 'block' (their is currently no code to split a message up into blocks for encryption). The problem i have it that sometimes the encryption dosent seem to work correctly. I think that it is do to with me converting data back and forth between different bases and am 'losing' information somewhere along the line. Well if anybody on this list knows a bit about encryption or if you just want to help i would be very great full if you could look at the attached code and comment on where my problem might be coming from. I am making use of the gpm library so you will need that installed before you are able to run my code. Also please cc me directly on a any responses as they will get to me quicker then by just emailing the list alone. Regards, William. -- William Bailey. http://wb.pro-net.co.uk ?php /* * RSA Encryotion in PHP v0.1 :) *By William Bailey. * [EMAIL PROTECTED] * * This code is still in its infancy so it will probably not work * correctly. If you make any bug fixes/improvements or just have * any random comments then please send them my way. * */ set_time_limit(300); mt_srand((double)microtime()*1); function generate_prime ($bits) { $number=gmp_init('0'); for($i=$bits; $i=0; $i--){ $rand=mt_rand()%2; gmp_setbit($number, $i, $rand); } while(gmp_prob_prime($number)1){ $number=gmp_add($number, 1); } if(strlen(gmp_strval($number, 2))!=$bits){ $number=generate_prime($bits); }else{ //printf('preturning %s (%sbit)br', gmp_strval($number), strlen(gmp_strval($number, 2))); return (string)gmp_strval($number); } } function gen_RSA_keys ($bits=512, $e=17) { /* * $bits us the length desired for $n * ($p and $q will be half as long) * ($e, $n) is the public key * ($d, $n) id the provate key * * It seems that sometimes php forgets the resource id * for p and q therefore i have added the while(empty()) * condition to this script so that if php forgets the * resource id it will just loop and try agian. * * This might be because im running the cvs version of * php. :) * * Hopefull this will be resolved soon and should make * this code fastar as it will not have to generate * waisted prime numbers. */ $e=gmp_init((string)$e); $p=Null; while(empty($p)){ do { $p=gmp_init((string)generate_prime($bits/2)); $t=gmp_sub($p, 1); } while (gmp_gcd($t, $e)==1); } //printf('p is %s and has a value if %s br', $p, gmp_strval($p)); //flush(); $q=Null; while(empty($q)){ do { $q=gmp_init((string)generate_prime($bits/2)); $t=gmp_sub($q, 1); } while (gmp_gcd($t, $e)==1); } //printf('q is %s and has a value if %s br', $q, gmp_strval($q)); //flush(); $n=gmp_mul($p, $q); //printf('n is %sbr', gmp_strval($n)); $t=gmp_add(gmp_sub(gmp_sub($n, $p), $q), 1); //printf('t is %sbr', gmp_strval($t)); //printf('e is %sbr', gmp_strval($e)); $d=mod_inverse((string)gmp_strval($e), (string)gmp_strval($t)); //printf('d is %sbr', gmp_strval($d)); if(gmp_strval($d)=='1'){ /* * We dont want d to be 1 so if it is then we * generate another RSA key. */ return gen_RSA_keys ($bits, gmp_strval($e)); }else{ return(array((string)gmp_strval($n), (string)gmp_strval($e), (string)gmp_strval($d))); } } function gen_RSA_keys2 ($bits=512) { /* * $bits us the length desired for $n * ($p and $q will be half as long) * ($e, $n) is the public key * ($d, $n) id the provate key * */ $p=Null; while(empty($p)){ $p=gmp_init((string)generate_prime($bits/2)); } $q=Null; while(empty($q)){ $q=gmp_init((string)generate_prime($bits/2)); } $n=gmp_mul($p, $q); $t=gmp_add(gmp_sub(gmp_sub($n, $p), $q), 1); $e=find_e($t, $q, $q); $d=mod_inverse((string)gmp_strval($e), (string)gmp_strval($t)); if(gmp_strval($d)=='1'){ /* * We dont want d to be 1 so if it is then we * generate another RSA key. */ return gen_RSA_keys2 ($bits, gmp_strval($e)); }else{ return(array((string)gmp_strval($n), (string)gmp_strval($e), (string)gmp_strval($d))); } } function find_e ($t, $p, $q) { $great=gmp_init(0); $e=gmp_init(2); while
RE: [PHP] FORM RELATED QUESTION - I
Append '[]' to the field name, e.g., order[] = 10 order[] = 20 Then process the submitted field as an array. Kirk -Original Message- From: karthikeyan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 9:18 AM To: Jason Wong Cc: [EMAIL PROTECTED] Subject: Re: [PHP] FORM RELATED QUESTION - I Yes I did use $HTTP_POST_VARS but it removes duplicate values. Say if there are two hidden variables 1. order= 10 2. order= 20 I get order=20 the last one but i want both. I need both. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP and SQL help
All the output is generated from one big while loop. If some records have all the information displayed properly, so should the other records. I also checked the HTML output, everything seems all right. I am really puzzled. Below is part of my script that display the records. The script shows everything correctly except some records have the firstname and lastname fields empty (but they do have valid value). Please help me. ?php $dbcnx = mysql_connect(localhost, root, myfakepswd); mysql_select_db(seminardb); // The basic SELECT statement $select = SELECT * ; $from = FROM seminars; $where = WHERE id 0; if ($firstname != ) { // firstname is selected $where .= AND firstname LIKE '%$firstname'; } if ($lastname != ) { // lastname is selected $where .= AND lastname LIKE '%$lastname%'; } if ($absid != ) { // An abstract is selected $where .= AND id=$absid; } if ($searchtext != ) { // Some search text was specified $where .= AND title LIKE '%$searchtext%'; } $where .= order by datestr desc; ? table bgcolor=#00 width=450 cellpadding=3 cellspacing=1 align=center border=0 ?php $entries = mysql_query($select . $from . $where); if (!$entries) { echo(/table); echo(pError retrieving seminars from database!br /. Error: . mysql_error() . /p); exit(); } $i=0; while ($entry = mysql_fetch_array($entries)) { $id = $entry[id]; $sol=htmlspecialchars($entry[solute]); $first=htmlspecialchars($entry[firstname]); $last=htmlspecialchars($entry[lastname]); $middle=htmlspecialchars($entry[middlename]); $position=htmlspecialchars($entry[position]); $affil=htmlspecialchars($entry[affiliation]); $seminartitle = htmlspecialchars($entry[title]); $datestr=htmlspecialchars($entry[datestr]); $timestr=htmlspecialchars($entry[timestr]); $location=htmlspecialchars($entry[location]); $abs=htmlspecialchars($entry[abstract]); list($year,$month,$day)=sscanf($datestr,%d-%d-%d); $jday=GregorianToJD($month, $day, $year); $mthname=jdmonthname($jday, 0); $wkday=jddayofweek($jday, 2); $text=p$wkday, $mthname $day, $year, ; if ( ! strstr($timestr, '10:') ) { $text .=font color=\#ff\$timestr /font, . $location/p; } else { $text .=$timestr, . $location/p; } if ( !($sol) ) { $text=$text.p$sol. $first. $middle. $last,; } else { $text=$text.p$firstname. $middlename. $lastname,; } $text=$text. $affil/p; if ( $abs ) { $text=$text.pa href='seminar.php?absid=$id'$seminartitle/a/p; } else { $text=$text.p$seminartitle/p; } if ( $absid == $id ) { $abs=chop($abs).br; $text .= p$abs/p; }; echo(tr valign='baseline' ); if ( $i ) { echo(td bgcolor='#ee'$text/td\n); $i=0; } else { echo(td bgcolor='#ff'$text/td\n); $i=1; } echo(/tr\n); } ? /table -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 7:25 PM To: Yuan Lu Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PHP and SQL help Take a look at the source HTML in your browser - you may be getting some for example which would do that. I really can't tell what it is for sure, but looking at the HTML source is generally a good idea... Bogdan Yuan Lu wrote: I am new to PHP and MySQL, and appreciate your help greatly. I create a simple one table database to list the seminar list. The fields are name of the speaker and the title along with other information. I used phpMyAdmin-2.2.1 to input the data and see that all the fields , including the fields that I couldn't get the values as described below, have proper values. When I retrieve all the fields from the same database from my little PHP program and display the result on a webpage (I use select * from seminars order by datestr desc to retrieve the records), I noticed that some records missed the name of the speaker field. Of about 80 records, I have 10 records have this problems. Does anyone have any idea what's going on here? Thanks for the help. Yua Lu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to transfer letters (e.g. en-us, es, fr etc.) to full names (e.g. England, France etc.)?
The International Standards Organization may be your best bet It maintains lists of countries and country codes which can be cut and pasted Try searching for ISO language code or ISO country code Miles Thompson At 05:22 PM 3/5/2002 +, SED wrote: Hi, I'm finishing a log script which determines what country the visitors come from via language settings in the browser Now I need to transfer those letters (eg en-us, es, fr etc) to full names (eg England, France etc) Do you know where I can find an index-file that I can use to make full names? Maybe you have one already you can send me? Thanks in advance! SED -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] Re: REQUEST QUESTION
Hi Thanx, --- input type=hidden name=order [1] value=10 input type=hidden name=order [2] value=20 On the nest page you just do echo The first order is .order[1]. and the second order is .order[2]; -- But that is what I cannot do. I cannot change the name of the order to order[1] because that form is not in my control. I want both the order with its values. Any other suggestions please. Regards, karthikeyan. - Original Message - From: David Tandberg-Johansen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 05, 2002 10:09 PM Subject: [PHP] Re: REQUEST QUESTION Karthikeyan [EMAIL PROTECTED] skrev i melding 002601c1c461$cfa08580$0600a8c0@aspire006">news:002601c1c461$cfa08580$0600a8c0@aspire006... Hi Guys, I allready posted this question in detail but I believe I didn't explain it properly. There are 2 hidden variable in my FORM. 1. order = 10 and 2. order=20 I want to retrieve both the orders in the next page say somename.php. How do i do that. Regards, karthikeyan. You must put the in a array like this input type=hidden name=order [1] value=10 input type=hidden name=order [2] value=20 On the nest page you just do echo The first order is .order[1]. and the second order is .order[2]; -- 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] PHP 4.1.2 and gdbm
Hello, all! I have one problem i can't bild php --with-gdbm support I have it on my Linux: gdbm-180-10 and during install there are no errors, but when i try use function in my program (dbmopen(), dblist()) PHP write that it is undefined function Thanks! -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] Accessing Mainframe
When you say accessing, how do you mean? Access the file system? Access a service running on the Mainframe? Please be a little more specific Andrew - Original Message - From: Sridhar Moparthy [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, March 05, 2002 6:15 PM Subject: [PHP] Accessing Mainframe Hi All, Is it possible to access IBM Mainframe from PHP on Windows? Is so, do I need to install any software on Mainframe? Are there any classes available to do this? I am using PHP 4.X on Windows. Thank you in advance, Sridhar Moparthy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Verify script location...
Ok I have a question that i havent seen a tutorial on How would I go about making an included file check the host before executing? I want to make sure that any files I use as included in a php document verify the request is coming from a valid script on the same server for instance Is this possible and if so could someone give me some more insight or a tutorial on this? Thanks in advance Jas -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] Verify script location...
http://www.php.net/manual/en/language.variables.predefined.php $HTTP_HOST Contents of the Host: header from the current request, if there is one. $HTTP_REFERER The address of the page (if any) which referred the browser to the current page. This is set by the user's browser; not all browsers will set this. -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 10:50 PM To: [EMAIL PROTECTED] Subject: [PHP] Verify script location... Ok I have a question that i havent seen a tutorial on... How would I go about making an included file check the host before executing? I want to make sure that any files I use as included in a php document verify the request is coming from a valid script on the same server for instance.. Is this possible and if so could someone give me some more insight or a tutorial on this? Thanks in advance... Jas -- 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] Accessing Mainframe
Thank you Andrew for the reply! Actually I have requirements for booth. I also have a requirement to access the DB2 databases and VSAM files if possible. Thanks Again Sridhar -Original Message- From: Andrew Brampton [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 1:41 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Accessing Mainframe When you say accessing, how do you mean? Access the file system? Access a service running on the Mainframe? Please be a little more specific Andrew - Original Message - From: Sridhar Moparthy [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, March 05, 2002 6:15 PM Subject: [PHP] Accessing Mainframe Hi All, Is it possible to access IBM Mainframe from PHP on Windows? Is so, do I need to install any software on Mainframe? Are there any classes available to do this? I am using PHP 4.X on Windows. Thank you in advance, Sridhar Moparthy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to transfer letters (e.g. en-us, es, fr etc.) to full names (e.g. England, France etc.)?
Here you go: www-old.ics.uci.edu/pub/ietf/http/related/iso639.txt --- Miles Thompson [EMAIL PROTECTED] wrote: The International Standards Organization may be your best bet. It maintains lists of countries and country codes which can be cut and pasted. Try searching for ISO language code or ISO country code Miles Thompson At 05:22 PM 3/5/2002 +, SED wrote: Hi, I'm finishing a log script which determines what country the visitors come from via language settings in the browser. Now I need to transfer those letters (e.g. en-us, es, fr etc.) to full names (e.g. England, France etc.). Do you know where I can find an index-file that I can use to make full names? Maybe you have one already you can send me? Thanks in advance! SED -- 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 = Anas Mughal [EMAIL PROTECTED] [EMAIL PROTECTED] Tel: 973-249-6665 __ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Arrays/OOP
I am relatively new to PHP but have had some background in OOP. I am having some trouble with a method that for a certain class. The problem is that I can seem to read my objects from an array that I am storing them to. I keep getting the error Call to a member function on a non-object. I have attached the code that contains the error, I would appreciate any help that can be provided. function getEvents($filename) { //string $filename $event_list = array(); $event_object = new event(); $i = 0; @ $fp = fopen($filename, r); if(!$fp) { echo pstrongCannot open .$filename. for reading mode.../strong/p; exit; } while(!feof($fp)) { $temp = fgetcsv($fp, 1024, :); $event_list[$i] = $event_object-init($temp[0],$temp[1],$temp[2],$temp[3],$temp[4],$temp[5],$temp[6],$temp[7],$temp[8]); $i++; } fclose($fp); return $event_list; } P.S. Please CC it directly to me, as I will receive the reply faster that way. Joshua E Minnie CIO [EMAIL PROTECTED] Don't work for recognition, but always do work worthy of recognition.
RE: [PHP] Verify script location...
It's not possible to include() a remote file so there may be little point to this. However maybe you want to keep users on your system from including the file in their scripts. In that case I suppose you could set $PHP_SELF (of the main script) to a temporary variable for checking in the included script. -Kevin -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 11:50 PM To: [EMAIL PROTECTED] Subject: [PHP] Verify script location... Ok I have a question that i havent seen a tutorial on... How would I go about making an included file check the host before executing? I want to make sure that any files I use as included in a php document verify the request is coming from a valid script on the same server for instance.. Is this possible and if so could someone give me some more insight or a tutorial on this? Thanks in advance... Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Arrays/OOP
Joshua E Minnie wrote: while(!feof($fp)) { $temp = fgetcsv($fp, 1024, :); $event_list[$i] = $event_object-init($temp[0],$temp[1],$temp[2],$temp[3],$temp[4],$temp[5],$temp[6],$temp[7],$temp[8]); $i++; } Without seeing more of the code, I can't say for certain, but I suspect that instead of $event_object-init you need to call $this-init Does that do the trick? Wait - I looked above $event_object = new event() What is the class definition for event? Could you send more code? Michael Kimsal http://wwwphphelpdeskcom 734-480-9961 -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] Accessing Mainframe
Having a quick search through the PHP manual, I find this little note: (This is not to be confused with IBM's DB2 software, which is supported through the ODBC functions.) So I guess DB2 is supported via the ODBC functions.. As for the VSAM, I find no mention of it in the manual. Just have a search through the PHP manual, and maybe hotscript.com or other such sources, and you will most likly find what you need Andrew P.S Please note I've never done IBM work, I haven't even seen a IBM Mainframe, so I can't help much more than this :) - Original Message - From: Sridhar Moparthy [EMAIL PROTECTED] To: 'Andrew Brampton' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, March 05, 2002 6:50 PM Subject: RE: [PHP] Accessing Mainframe Thank you Andrew for the reply! Actually I have requirements for booth. I also have a requirement to access the DB2 databases and VSAM files if possible. Thanks Again Sridhar -Original Message- From: Andrew Brampton [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 1:41 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Accessing Mainframe When you say accessing, how do you mean? Access the file system? Access a service running on the Mainframe? Please be a little more specific Andrew - Original Message - From: Sridhar Moparthy [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, March 05, 2002 6:15 PM Subject: [PHP] Accessing Mainframe Hi All, Is it possible to access IBM Mainframe from PHP on Windows? Is so, do I need to install any software on Mainframe? Are there any classes available to do this? I am using PHP 4.X on Windows. Thank you in advance, Sridhar Moparthy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] REQUEST QUESTION
That is impossible. If you want to store two values you will need two variables! William. El mar, 05-03-2002 a las 11:21, karthikeyan escribió: Hi Guys, I allready posted this question in detail but I believe I didn't explain it properly. There are 2 hidden variable in my FORM. 1. order = 10 and 2. order=20 I want to retrieve both the orders in the next page say somename.php. How do i do that. Regards, karthikeyan. _ Do You Yahoo!? Get your free yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Arrays/OOP
Michael Kimsal wrote: Joshua E Minnie wrote: while(!feof($fp)) { $temp = fgetcsv($fp, 1024, :); $event_list[$i] = $event_object-init($temp[0],$temp[1],$temp[2],$temp[3],$temp[4],$temp[5],$t emp[6],$temp[7],$temp[8]); $i++; } Without seeing more of the code, I can't say for certain, but I suspect that instead of $event_object-init you need to call $this-init. Does that do the trick? Wait - I looked above. $event_object = new event(). What is the class definition for event? Could you send more code? Michael Kimsal http://www.phphelpdesk.com 734-480-9961 Attached you will find the class definition. Thanks in advance.. Joshua E Minnie CIO [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] REQUEST QUESTION
On Tuesday, March 5, 2002, at 11:21 AM, karthikeyan wrote: I allready posted this question in detail but I believe I didn't explain it properly. There are 2 hidden variable in my FORM. 1. order = 10 and 2. order=20 I want to retrieve both the orders in the next page say somename.php. How do i do that. First tell us how you can tell the two variables apart. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Verify script location...
Ok I think I am a little confused... with regards to include() and require(), if I knew the name of a file on say brownstone.com and that file was called database.inc and it contained all the connection settings for brownstone.com's database. Say I run a website called hacktheplanet.com and I wanted to include brownstones.com database.inc file in one of my own scripts so I could run searches on their inventory from my domain. Is this or is this not possible? Thanks in advance, Jas Kevin Stone [EMAIL PROTECTED] wrote in message 000301c1c477$aaf1cc10$6801a8c0@kevin..">news:000301c1c477$aaf1cc10$6801a8c0@kevin..; It's not possible to include() a remote file so there may be little point to this. However maybe you want to keep users on your system from including the file in their scripts. In that case I suppose you could set $PHP_SELF (of the main script) to a temporary variable for checking in the included script. -Kevin -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 11:50 PM To: [EMAIL PROTECTED] Subject: [PHP] Verify script location... Ok I have a question that i havent seen a tutorial on... How would I go about making an included file check the host before executing? I want to make sure that any files I use as included in a php document verify the request is coming from a valid script on the same server for instance.. Is this possible and if so could someone give me some more insight or a tutorial on this? Thanks in advance... Jas -- 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] Accessing Mainframe
http://www.e-gineer.com/instructions/installing-ibm-db2-for-php4x-with-apach e13x-on-linux.phtml I used this, and currently use PHP to AS400 DB2 everyday. Dan -Original Message- From: Sridhar Moparthy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 11:51 AM To: 'Andrew Brampton'; [EMAIL PROTECTED] Subject: RE: [PHP] Accessing Mainframe Thank you Andrew for the reply! Actually I have requirements for booth. I also have a requirement to access the DB2 databases and VSAM files if possible. Thanks Again Sridhar -Original Message- From: Andrew Brampton [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 1:41 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Accessing Mainframe When you say accessing, how do you mean? Access the file system? Access a service running on the Mainframe? Please be a little more specific Andrew - Original Message - From: Sridhar Moparthy [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, March 05, 2002 6:15 PM Subject: [PHP] Accessing Mainframe Hi All, Is it possible to access IBM Mainframe from PHP on Windows? Is so, do I need to install any software on Mainframe? Are there any classes available to do this? I am using PHP 4.X on Windows. Thank you in advance, Sridhar Moparthy -- 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] Verify script location...
Essentially what I would like to do is to prevent this kind of thing from happening to my own website, just to clear up my example. =) Jas Jas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Ok I think I am a little confused... with regards to include() and require(), if I knew the name of a file on say brownstone.com and that file was called database.inc and it contained all the connection settings for brownstone.com's database. Say I run a website called hacktheplanet.com and I wanted to include brownstones.com database.inc file in one of my own scripts so I could run searches on their inventory from my domain. Is this or is this not possible? Thanks in advance, Jas Kevin Stone [EMAIL PROTECTED] wrote in message 000301c1c477$aaf1cc10$6801a8c0@kevin..">news:000301c1c477$aaf1cc10$6801a8c0@kevin..; It's not possible to include() a remote file so there may be little point to this. However maybe you want to keep users on your system from including the file in their scripts. In that case I suppose you could set $PHP_SELF (of the main script) to a temporary variable for checking in the included script. -Kevin -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 11:50 PM To: [EMAIL PROTECTED] Subject: [PHP] Verify script location... Ok I have a question that i havent seen a tutorial on... How would I go about making an included file check the host before executing? I want to make sure that any files I use as included in a php document verify the request is coming from a valid script on the same server for instance.. Is this possible and if so could someone give me some more insight or a tutorial on this? Thanks in advance... Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Arrays/OOP
Joshua E Minnie wrote: Michael Kimsal wrote: Attached you will find the class definition. Thanks in advance.. Joshua E Minnie CIO [EMAIL PROTECTED] What version of PHP are you using? I took the file and it seemed to work OK in PHP 4.0.5. Michael Kimsal http://www.phphelpdesk.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] value of an array into a sendmail function
I want to take the value of an array and define it as $message. This variable will be called in the sendmail function mail(). Here is what I have so far. (does not work!) $automail = file(DOCUMENT_ROOT/BetterBus/1/AutoEmail.txt); $number_of_lines = count($automail); for ( $i=0; $i$number_of_lines; $i++) { $auto = explode(\n, $automail[$i]); echo $auto[0].\n; } $to = $EMAILADDRESS $subject = Thank You for your submission!; $message = eval($automail); $fromaddress = [EMAIL PROTECTED]; mail($to, $subject, $message, $fromaddress); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Verify script location...
A Mr. Sheets gave me this snippet to use... if ($_SERVER[SERVER_ADDR] != 'ip address of server') { echo You are attempted to use this file from an unauthorized host exit; } Jas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Essentially what I would like to do is to prevent this kind of thing from happening to my own website, just to clear up my example. =) Jas Jas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Ok I think I am a little confused... with regards to include() and require(), if I knew the name of a file on say brownstone.com and that file was called database.inc and it contained all the connection settings for brownstone.com's database. Say I run a website called hacktheplanet.com and I wanted to include brownstones.com database.inc file in one of my own scripts so I could run searches on their inventory from my domain. Is this or is this not possible? Thanks in advance, Jas Kevin Stone [EMAIL PROTECTED] wrote in message 000301c1c477$aaf1cc10$6801a8c0@kevin..">news:000301c1c477$aaf1cc10$6801a8c0@kevin..; It's not possible to include() a remote file so there may be little point to this. However maybe you want to keep users on your system from including the file in their scripts. In that case I suppose you could set $PHP_SELF (of the main script) to a temporary variable for checking in the included script. -Kevin -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 11:50 PM To: [EMAIL PROTECTED] Subject: [PHP] Verify script location... Ok I have a question that i havent seen a tutorial on... How would I go about making an included file check the host before executing? I want to make sure that any files I use as included in a php document verify the request is coming from a valid script on the same server for instance.. Is this possible and if so could someone give me some more insight or a tutorial on this? Thanks in advance... Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Arrays/OOP
Michael Kimsal wrote: What version of PHP are you using? I took the file and it seemed to work OK in PHP 4.0.5. Michael Kimsal http://www.phphelpdesk.com 734-480-9961 I am currently using PHP 4.1.2. Maybe it's in the file that I am using for testing, I have attached the code. Joshua E Minnie CIO [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Value of $_* variables
I'm sure this has been asked before, but at least not within the last 600 messages (i checked): I have the session variable $_SESSION['id'] set Well, I want to actually check the value of this variable, not just to check if it's set I would be doing this in a mysql query mainly Something like: $result = mysql_query(select user from users where id = $_SESSION['id], $db); That just doesn't work, so I have to first go: $sid = $_SESSION['id']; $result = mysql_query(select user from users where id = $sid, $db); Anyway to get around this? -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] PHP returns this error... (1030: Got error 28 from table handler)
I was returned this error after a mysql_query: 1030: Got error 28 from table handler What does this mean? It doesn't happen all the time and it almost random... I searched the mysql site and didn't find anything and a search on Google I found that it is a table that may have become corrupt so i have repaired the tables. Has anyone else received this error? If so, how did you solve it? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and IMAP_SSL
I am trying to force php to compile WITHOUT IMAP-SSL because TWIG cannot communicate with IMAP-SSL on port 993 I upgraded my PHP to 412 to close the security hole just recently announced I am assured that the c-clienta lib i am linking to in the configure is NOT SSL supported, yet the ocnfigure is telling me it is Perhaps there is some other file that PHP is looking at that is saying SSL support ? My apache server is running openssl-096b, but should this have an effect in the IMAP configuration? any help is much appreciated! -tom -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] PHP returns this error... (1030: Got error 28 from table handler)
More digging has turned up that the disk space is low or running out...so I will look into that. However, if anyone has any tips I'd greatly listen :) Jeff - Original Message - From: Jeff Lewis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 05, 2002 2:51 PM Subject: [PHP] PHP returns this error... (1030: Got error 28 from table handler) I was returned this error after a mysql_query: 1030: Got error 28 from table handler What does this mean? It doesn't happen all the time and it almost random... I searched the mysql site and didn't find anything and a search on Google I found that it is a table that may have become corrupt so i have repaired the tables. Has anyone else received this error? If so, how did you solve it? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Classes
Hallo! Can I from inside an Class Intialize other classes, and access them from the ordinary script? Page1php ?PHP require_once(/myclassinc); $my = new MyClass; $my-init(); $fileread-readfile($file=myfiletxt); ? myclassinc ?PHP class MyClass { var classes = Array( classname1=classkey1, classname2=classkey2, classname3=classkey3 ); function init() { foreach ($this-classes as $classname=$classkey){ require_once(/$classnameinc); eval(\$$classkey = new $classname;); } } } ? David -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] Verify script location...
On Tuesday, March 5, 2002, at 01:57 PM, Kevin Stone wrote: It's not possible to include() a remote file so there may be little point to this. However maybe you want to keep users on your system from including the file in their scripts. In that case I suppose you could set $PHP_SELF (of the main script) to a temporary variable for checking in the included script. -Kevin Or set an Apache directive (in httpd.conf or .htaccess) that prevents any .inc files from being served by the server. I'm assuming you're using apache. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Arrays/OOP
Michael Kimsal wrote: Still works - at least, I'm not getting the error you posted. Is there something else we may be missing? What line(s) are causing a problem? On line 21 of the corrected test file that I attached previously. Joshua E Minnie [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Classes
Hallo! Can I from inside an Class Intialize other classes, and access them from the ordinary script? Page1.php ?PHP require_once(./myclass.inc); $my = new MyClass; $my-init(); $fileread-readfile($file=myfile.txt); ? myclass.inc ?PHP class MyClass { var classes = Array( classname1=classkey1, classname2=classkey2, classname3=classkey3 ); function init() { foreach ($this-classes as $classname=$classkey){ require_once(./$classname.inc); eval(\$$classkey = new $classname;); } } } ? David -- 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] value of an array into a sendmail function
I want to take the value of an array and define it as $message. This variable will be called in the sendmail function mail(). Here is what I have so far. (does not work!) Can anyone help me with this problem? $automail = file(DOCUMENT_ROOT/BetterBus/1/AutoEmail.txt); $number_of_lines = count($automail); for ( $i=0; $i$number_of_lines; $i++) { $auto = explode(\n, $automail[$i]); echo $auto[0].\n; } $to = $EMAILADDRESS $subject = Thank You for your submission!; $message = eval($automail); $fromaddress = [EMAIL PROTECTED]; mail($to, $subject, $message, $fromaddress);
[PHP] OOP .. I just don't get it.
Hi I've been using php for a while now but I have not got my head around OOP (classes) Why bother using them? I've read thru a few tutorials on using classes and the examples given are quite simple This is probably the problem - I just can't see the benefit of using this style of programming Here is what I'm getting at USING A CLASS- class Table { var $rows; var $columns; function MakeTable() { draw a table with $this-columns as the number of columns and $this-rows as the number of rows } } $mytable = new Table; $mytable-rows = 5; $mytable-columns = 10; $mytable-MakeTable(); ---USING A NORMAL FUNCTION- function MakeTable($rows,$columns) { make a table with $rows as the number of rows and $columns as the number of columns } $rows = 5; $columns = 10; MakeTable($rows,$columns); --- Using a class doesn't appear to give me any benefits - in fact the code is longer I know that you can spawn more instances of the same class which sounds useful, however I can also run my function as many times as I like using different variables What am I missing here? Thanks Mojo -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] value of an array into a sendmail function
$mail=''; foreach($automail as $mailline) { $mail.=$mailline; } $to = $EMAILADDRESS $subject = Thank You for your submission!; $message = eval($automail); $fromaddress = [EMAIL PROTECTED]; mail($to, $subject, $mail, $fromaddress); that's my $.02 -Original Message- From: Kris Vose [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 12:29 PM To: [EMAIL PROTECTED] Subject: [PHP] value of an array into a sendmail function I want to take the value of an array and define it as $message. This variable will be called in the sendmail function mail(). Here is what I have so far. (does not work!) Can anyone help me with this problem? $automail = file(DOCUMENT_ROOT/BetterBus/1/AutoEmail.txt); $number_of_lines = count($automail); for ( $i=0; $i$number_of_lines; $i++) { $auto = explode(\n, $automail[$i]); echo $auto[0].\n; } $to = $EMAILADDRESS $subject = Thank You for your submission!; $message = eval($automail); $fromaddress = [EMAIL PROTECTED]; mail($to, $subject, $message, $fromaddress); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] OOP .. I just don't get it.
I've often wondered the same thing... which is why I've never moved to OOP So I'm patiently waiting for a reply to this message as well :) -Original Message- From: mojo jojo [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 12:22 PM To: [EMAIL PROTECTED] Subject: [PHP] OOP .. I just don't get it. Hi I've been using php for a while now but I have not got my head around OOP (classes). Why bother using them? I've read thru a few tutorials on using classes and the examples given are quite simple. This is probably the problem - I just can't see the benefit of using this style of programming. Here is what I'm getting at. USING A CLASS- class Table { var $rows; var $columns; function MakeTable() { draw a table with $this-columns as the number of columns and $this-rows as the number of rows } } $mytable = new Table; $mytable-rows = 5; $mytable-columns = 10; $mytable-MakeTable(); ---USING A NORMAL FUNCTION- function MakeTable($rows,$columns) { make a table with $rows as the number of rows and $columns as the number of columns } $rows = 5; $columns = 10; MakeTable($rows,$columns); --- Using a class doesn't appear to give me any benefits - in fact the code is longer. I know that you can spawn more instances of the same class which sounds useful, however I can also run my function as many times as I like using different variables. What am I missing here? Thanks Mojo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with an error I can't solve!
Hello all, I have been installing an easy webmail client (webmiau) which seems to work fine and is very light; but I keep receiving this error everytime I open a new session: Warning: Variable passed to reset() is not an array or object in /usr/..file.php on line 5 -- Line 5 of File.php: reset ($HTTP_POST_VARS); Can anybody help me solve this error? What's happening? Track vars are enabled...what else is missing? Thanks before hand... -- Lic. Carlos A. Triana Torres Webmaster. CIGET Sancti Spíritus Email: [EMAIL PROTECTED] Tel: 23956, 27958 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php