php-general Digest 9 Oct 2006 12:30:31 -0000 Issue 4391

2006-10-09 Thread php-general-digest-help
php-general Digest 9 Oct 2006 12:30:31 - Issue 4391 Topics (messages 242831 through 242839): Re: Apply the hyper link ( javascript functon ) with php 242831 by: J R 242838 by: edwardspl.ita.org.mo Re: guess documentroot 242832 by: Ivo F.A.C. Fokkema Re: FTP

Re: [PHP] guess documentroot

2006-10-09 Thread Ivo F.A.C. Fokkema
On Thu, 05 Oct 2006 16:35:04 +0200, Javier Ruiz wrote: Perfect! got it using the following: /* 1 - remove the query string just in case it contains a '/' in it 2 - like Clive said, substr() and strrpos() 'clean' the path to provide the directories only */ $aPath =

Re: [PHP] FTP

2006-10-09 Thread Chris
Stut wrote: Raphael Martins wrote: I will be sending files over my php script... One client asked me for a project where he allow clients to send some large files (like 50mb)...I thought that FTP (via PHP) will allow that. Today he just give the FTP server user and password to his clients,

[PHP] ereg_replace with unser defined function?

2006-10-09 Thread Frank Arensmeier
Hello all. Is it possible to have a user defined function for the replacement within an ereg_replace (like preg_replace_callback)? I am working on a script that converts html pages with metric data into imperial data. My script takes text strings containing one or more instances of e.g.

[PHP] POPUP window in PHP

2006-10-09 Thread Captain
hi, i want to do YES/NO confirmation (like POPUP). If YES, it will upload a file into server. Otherwise, it won't do anything. In JavaScript, i can get using confirm(); But i am not able to do manipulation from that javascript variable. My Code(partial): ? if (file_exists($fullPath)) {

Re: [PHP] POPUP window in PHP

2006-10-09 Thread Max Belushkin
Captain wrote: hi, i want to do YES/NO confirmation (like POPUP). If YES, it will upload a file PHP is server-side, not client-side. You can have the confirmation passed as a GET variable in a two-step process for example, i.e. first show a confirmation form if $_GET[confirm] is not set,

Re: [PHP] POPUP window in PHP

2006-10-09 Thread Captain
hi dude, actually, i am new to php. i am not understanding clearly. plz explain it clearly. My requirement is, i want to upload one file. i am checking whether it exists or not in Server side. If it exists, i am popping up a window that Do u want to have Duplication of this file?.If YES, i sud

Re: [PHP] Apply the hyper link ( javascript functon ) with php

2006-10-09 Thread edwardspl
Hello, Sorry... If the hyper link is : a href=javascript:popup('/$dir/index.htm') Test /a So, how to apply the echo tag for it ? Remark: $dir is php variable... Edward. J R wrote: echo 'a href=javascript:popup(\'index.htm\') Test /a'; On 10/9/06, [EMAIL PROTECTED] [EMAIL PROTECTED]

Re: [PHP] ereg_replace with unser defined function?

2006-10-09 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-09 09:46:01 +0200: Is it possible to have a user defined function for the replacement within an ereg_replace (like preg_replace_callback)? I am working on a script that converts html pages with metric data into imperial data. My script takes text strings

[PHP] Re: [BULK] Re: [PHP] Apply the hyper link ( javascript functon ) with php

2006-10-09 Thread clive
[EMAIL PROTECTED] wrote: Hello, Sorry... If the hyper link is : a href=javascript:popup('/$dir/index.htm') Test /a you want to use double quotes echo ; instead of single quotes echo ' '; the double quotes will parse any variables it finds, where as the single quotes will simply just echo

Re: [PHP] if(), else() problem!

2006-10-09 Thread Rahul S. Johari
Well actually, all 80 fields (not records) that I'm displaying out of the row (matched by phone number) have to be displayed on the page. Non-Editable. Just displayed for viewing. I am certainly using the query to search dbase and display the results. So technically nothing that I'm doing is

Re: [PHP] POPUP window in PHP

2006-10-09 Thread Max Belushkin
Captain wrote: My requirement is, i want to upload one file. i am checking whether it exists or not in Server side. Your script will have to work in stages, generating a page and sending to the browser on each stage: 1. Make a form to upload a file for the user to submit - this is just

Re: [PHP] Re: [BULK] Re: [PHP] Apply the hyper link ( javascript functon ) with php

2006-10-09 Thread edwardspl
Hello Clive, Would you mind to help to modify the hyper link with php ( apply echo tag ) ? Sorry... I don't quite to know the php command Many thank for your help ! Edward. clive wrote: [EMAIL PROTECTED] wrote: Hello, Sorry... If the hyper link is : a

Re: [PHP] Re: [BULK] Re: [PHP] Apply the hyper link ( javascript functon ) with php

2006-10-09 Thread edwardspl
Hello Clive, I just modified the php program code : echo 'a href=javascript:popup(\'/$dir/index.htm\') Test /a'; But the page is error result (Display on the menu bar)! Edward. clive wrote: [EMAIL PROTECTED] wrote: Hello, Sorry... If the hyper link is : a

Re: [PHP] ereg_replace with unser defined function?

2006-10-09 Thread Ilaria De Marinis
Hi Frank, I think preg_replace_callback is a good solution for you. If you don't want to use it, you can construct two arrays defining matches and replacements. For example: $matches [230] [120] [340] $replacements [9.1] [replace2] [replace3] After you stored matches in $matches using

[PHP] Date verification

2006-10-09 Thread Ron Piggott (PHP)
Is there a PHP function which verifies a valid date has been entered (-MM-DD)? Ron

Re: [PHP] Date verification

2006-10-09 Thread Arpad Ray
Ron Piggott (PHP) wrote: Is there a PHP function which verifies a valid date has been entered (-MM-DD)? Ron preg_match('/^(\d{4})-(\d\d)-(\d\d)\z/', $s, $m) checkdate($m[2], $m[3], $m[1]) Arpad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Date verification

2006-10-09 Thread Max Belushkin
Ron Piggott (PHP) wrote: Is there a PHP function which verifies a valid date has been entered (-MM-DD)? Ron http://www.php.net/manual/en/function.checkdate.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Date verification

2006-10-09 Thread Richard Lynch
On Mon, October 9, 2006 11:26 am, Ron Piggott (PHP) wrote: Is there a PHP function which verifies a valid date has been entered (-MM-DD)? Ron Note that both solutions so far are only partial solutions for most real world scenarios. For example: 0001-12-25 will pass both, and would appear

[PHP] PHP solution for virtual folder management

2006-10-09 Thread Angelo Zanetti
Hi all, WE are developing a system and now we have to create our own folder management system, it however wont be physical folders on the hard drive but more database entries and then the user will view the output as if they were directories. So Im looking for possibly and open source

Re: [PHP] POPUP window in PHP

2006-10-09 Thread Richard Lynch
On Mon, October 9, 2006 6:22 am, Captain wrote: hi dude, actually, i am new to php. i am not understanding clearly. plz explain it clearly. You can't do what you want. More importantly, you should not even WANT to do what you want! There are several reasons for this, and they are rather

[PHP] Re: PHP solution for virtual folder management

2006-10-09 Thread Colin Guthrie
Angelo Zanetti wrote: Hi all, WE are developing a system and now we have to create our own folder management system, it however wont be physical folders on the hard drive but more database entries and then the user will view the output as if they were directories. So Im looking for

Re: [PHP] Apply the hyper link ( javascript functon ) with php

2006-10-09 Thread Richard Lynch
On Sun, October 8, 2006 6:53 pm, [EMAIL PROTECTED] wrote: How to apply the following function with php ? a href=javascript:popup('index.htm') Test /a If you're new to PHP, be a minimalist, and pull out PHP only when you absolutely have to: a href=javascript:popup('?php echo $dir?/index.htm')

Re: [PHP] $_SERVER['HTTP_REFERER']

2006-10-09 Thread Richard Lynch
On Sun, October 8, 2006 1:05 pm, Peter Lauri wrote: I am trying to track where the people entered a unique page from (developing an affiliate system). I have been using the $_SERVER['HTTP_REFERER'] to track this and record it on a affiliate entrance of the web site. However, that is not

Re: [PHP] Uploading files / processing with a PHP script

2006-10-09 Thread Richard Lynch
On Sun, October 8, 2006 7:47 am, Ron Piggott (PHP) wrote: When I upload a file into an application I am writing with the HTML form command INPUT NAME=userfile TYPE=file and then give the PHP command move_uploaded_file( $userfile , $destination_file_name); the owner of the file is 'www'.

Re: [PHP] Uploading files / processing with a PHP script

2006-10-09 Thread Richard Lynch
On Sun, October 8, 2006 2:49 pm, Larry Garfield wrote: The owner of a file can change ownership of the file, too, I believe, essentially willing it to someone else. I sure hope not... Cuz then I could chmod 4777 a file to make it execute as owner, then I could will it to 'root' owner, and then

Re: [PHP] PHP solution for virtual folder management

2006-10-09 Thread Richard Lynch
On Mon, October 9, 2006 12:32 pm, Angelo Zanetti wrote: to an exisisting folder. The moving folder part is not easy. the other functions like add, edit and delete and list sub folders is pretty easy with the parentID pointing to the parent directory. To move a folder, you just change its

Re: [PHP] ECHO $variable

2006-10-09 Thread Richard Lynch
On Sun, October 8, 2006 1:39 am, Ron Piggott (PHP) wrote: In one of my scripts I have input type=text name=message_title size=40 maxlength=80 value=?echo $saved_message_title;? where $saved_message_title is 1 Peter 5:7 Cast all your cares on Him for He cares about you --- note the

Re: [PHP] ECHO $variable

2006-10-09 Thread Richard Lynch
On Mon, October 9, 2006 7:45 am, benifactor wrote: the way i posted worked fine with out either... he doesn't need to use these to format the way his output is displayed, he only needs to use the proper php syntax if i am correct. You were wrong, and you're still wrong. :-) Try it and see.

Re: [PHP] FTP

2006-10-09 Thread Richard Lynch
On Sat, October 7, 2006 6:50 pm, Raphael Martins wrote: When I send files via FTP, the file size is limited to the php.ini max upload value? Yes. :-) -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch

Re: [PHP] FTP

2006-10-09 Thread Richard Lynch
Uploading huge files via HTTP is generally problematic. Set up FTP usernames/passwords/directories for each of his clients is probably the best answer. On Sun, October 8, 2006 6:05 am, Raphael Martins wrote: I will be sending files over my php script... One client asked me for a project where

Re: [PHP] set cookie with non-english

2006-10-09 Thread Richard Lynch
On Sat, October 7, 2006 4:10 pm, Ahmad Al-Twaijiry wrote: BTW I want to access the (cookie or session) variable from php javascript, so I don't think session is a solution so again, does anyone know how to resolve the problem so I can write the cookie output to UTF-8 html page ? I don't

Re: [PHP] Re: Separate PHP Code From HTML || Pros Cons?

2006-10-09 Thread Richard Lynch
On Sat, October 7, 2006 4:24 pm, sit1way wrote: I would dearly love to have a base CMS repository that all sites would draw on, extending the base CMS in the event that a particular client has need of customization. Some combo of Linux and Apache would do the trick; e.g. PHP requests for

Re: [PHP] Re: set cookie with non-english

2006-10-09 Thread Richard Lynch
On Sun, October 8, 2006 12:51 am, Nisse Engström wrote: * I use META http-equiv=Content-Type content=text/html; charset=utf-8 in my page The META thing might be good for storing pages on disk, but on the web you should use real HTTP headers. Except IE will *ignore* your HTTP headers.

RE: [PHP] Re: Understanding persistent connections with oci8

2006-10-09 Thread Mendonce, Kiran (STSD)
I did some checking on the web and noticed that another user encountered a similar problem and even reported it as a bug (#36634). The documentation is misleading here with the intent of the persistent_timeout setting not clearly explained. If the behavior is as designed, can someone please

[PHP] Using mysql_real_escape_string

2006-10-09 Thread Alan Milnes
OK this should be really obvious but I just can't figure it out. I have a script that opens a file, reads it line by line and inserts the contents into a database. I know I need to use mysql_real_escape_string to properly escape the contents but I don't know where exactly to place it in

Re: [PHP] Using mysql_real_escape_string

2006-10-09 Thread tg-php
mysql_real_escape_string() is a function that returns the post-processed value. So you can either do it like this: $safe_value = mysql_real_escape_string($unsafe_value); then use $safe_value in your query, or put the function right into your query: $myQY = INSERT INTO sometable (value) values

Re: [PHP] Using mysql_real_escape_string

2006-10-09 Thread Eric Butera
On 10/9/06, Alan Milnes [EMAIL PROTECTED] wrote: $query = insert into invw2wcheck ( UNIQUEID, ASSETID , CNF ) values ( '$UNIQUEID', '$ASSETID ', '$CNF' ); Wrap escaping functions around the values you are sticking in the DB. Escaping is only needed at the time you are using

[PHP] need help to build a query

2006-10-09 Thread afan
hi to all, I have table orders with primary key order_id. I have table uploaded_files with primary key ufid and uploaded files are linked to orders by order_id column. I have to list all orders and uploaded files. this works fine: $query = mysql_query( select order_id, order_date,

Re: [PHP] need help to build a query

2006-10-09 Thread John Wells
On 10/9/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: but I know there must be much better solution then this one. You're right: Simply JOIN your queries... SELECT order_id, order_date, order_status, file_name FROM orders JOIN uploaded_files AS uf ON orders.order_id = uf.order_id

Re: [PHP] need help to build a query

2006-10-09 Thread Brad Bonkoski
[EMAIL PROTECTED] wrote: hi to all, I have table orders with primary key order_id. I have table uploaded_files with primary key ufid and uploaded files are linked to orders by order_id column. I have to list all orders and uploaded files. this works fine: $query = mysql_query( select

Re: [PHP] ereg_replace with user defined function?

2006-10-09 Thread Frank Arensmeier
Thank you Ilaria and Roman for your input. I did not know that preg is able to deal with PCRE patterns. As a matter of fact I came up with the following solution (if someone is interested): the function takes a text and an array with converters like: $converters[] = array ( metric = mm,

Re: [PHP] need help to build a query

2006-10-09 Thread afan
But, in this case I will have repeating order_date and order_status info? idorder_datestatusfile_name 122006-10-09live file1.jpg 122006-10-09live file2.jpg 122006-10-09live file3.jpg 132006-10-09live file1.jpg 142006-10-09

Re: [PHP] need help to build a query

2006-10-09 Thread afan
while I was trying again I did something wrong (?) and my server is now busy and looks like it went down?!? The qestion is how can I check first query before I apply it to be sure I'm not goig to read every record in my DB or get into loop? thanks. -afan On 10/9/06, [EMAIL PROTECTED] [EMAIL

Re: [PHP] need help to build a query

2006-10-09 Thread John Wells
Yes you are right, but I guess you can decide which is worse: sending extra data in one query or send extra queries. I guess it depends on how many records we're talking about... Brad also brings up a good point I hadn't considered. I do think an OUTER join is possible, perhaps depending on

Re: [PHP] Re: set cookie with non-english

2006-10-09 Thread Nisse Engström
On Mon, 9 Oct 2006 13:17:37 -0500 (CDT), Richard Lynch wrote: On Sun, October 8, 2006 12:51 am, Nisse Engström wrote: The META thing might be good for storing pages on disk, but on the web you should use real HTTP headers. Except IE will *ignore* your HTTP headers. You need real

Re: [PHP] set cookie with non-english

2006-10-09 Thread Nisse Engström
On Sun, 8 Oct 2006 00:10:49 +0300, Ahmad Al-Twaijiry wrote: BTW I want to access the (cookie or session) variable from php javascript, so I don't think session is a solution so again, does anyone know how to resolve the problem so I can write the cookie output to UTF-8 html page ?

Re: [PHP] need help to build a query

2006-10-09 Thread Larry Garfield
On Monday 09 October 2006 16:50, John Wells wrote: Yes you are right, but I guess you can decide which is worse: sending extra data in one query or send extra queries. I guess it depends on how many records we're talking about... It will vary with your problem, but in general, fewer queries

[PHP] Working with overly aggressive anti-spam measures

2006-10-09 Thread Dave M G
PHP List, I run a few various social groups, and with each one I keep in contact with members by emailing them short newsletters. All my user information is stored in a MySQL database. I use PHP to get the relevant contact information, and use the mail() command to send out the emails one

Re: [PHP] Working with overly aggressive anti-spam measures

2006-10-09 Thread Chris
Dave M G wrote: PHP List, I run a few various social groups, and with each one I keep in contact with members by emailing them short newsletters. All my user information is stored in a MySQL database. I use PHP to get the relevant contact information, and use the mail() command to send out

Re: [PHP] ftp_put and ftp_chmod does not work

2006-10-09 Thread Chris
João Cândido de Souza Neto wrote: Hello everyone. I have got some parts of my system where some files are sent and i use ftp functions to save suche files. When i run it in my local machine, it works fine but, when it is on the server i got some errors. I was using ftp_put to copy such