[PHP] php 4.0.6, apache problem

2002-02-15 Thread Pushkar Pradhan
Hi, I've installed php 4.0.6 since I am working with mapserver which works with 4.0.6 only. This is my configuration: ./configure --prefix=/rstc/user1/erc/pushkar/php-4.0.6 --with-apxs=/rstc/user1/erc/pushkar/apache_1.3.22/bin/apxs After this I add the foll. to my httpd.conf file of apache

Re: [PHP] install php as CGI?

2002-06-04 Thread Pushkar Pradhan
./configure --prefix=/rstc/user1/erc/pushkar/php-4.0.6 --with-regex=system --enable-discard-path --enable-dbase Actually you just need one --enable-discard-path for security reasons, others are customized for my use and yes prefix is also a must. how can i install php as CGI?

Re: [PHP] PHP as HTML

2002-06-04 Thread Pushkar Pradhan
If you do a phpinfo() you get a columen Server API, mine lists CGI as it is what I installed php as. you know, that's a good question. How would I determine that on the server? Peter wrote: Tom, this does work fine... doing what Kevin says... ie the AddType application/x-httpd-php .html

Re: [PHP] Passing variable to the next page

2002-06-04 Thread Pushkar Pradhan
Tag the variables onto the url: http://mysite.com/newpage.php?firstvar=somevaluesecondvar=othervalue;. for arrays ?layer[]=alayer[]=blayer[]=c. or use sessions. Here is scenario that I am working on but have a problem. I have 10 thumbnail images on the page with information for them

Re: [PHP] Comparing array elements

2002-06-05 Thread Pushkar Pradhan
Never used those before, that's the way to do it! I think array_search and in_array are suited for looking up one or two values. Well, it sounds like something that could be done through the db query, but if you want to use arrays, it'd be something like this... $servers =

Re: [PHP] Comparing array elements

2002-06-05 Thread Pushkar Pradhan
You can use in_array or array_search. hey everyone, Does anyone have and ideas of wisdom on how to compare arrays (mysql result sets) and group items based on if they exist in two or more arrays? For example: I have a table, with a list of servers: server1 server2 server3 server4

Re: [PHP] Returnpath for mail

2002-06-06 Thread Pushkar Pradhan
I think you have to use a Reply-To header when sending your mail. The recipient's mail program will prompt him to use the reply to address rather than the from address. Hi there, I am wondering if it is possible to send email via the mail function with lets say adress_1 and then if the

Re: [PHP] matrix functions

2002-06-10 Thread Pushkar Pradhan
If there isn't one, (have you tried phpclasses.org etc.), I think the string functions are powerful enough. What kind of manipulations you need? Is it simple column/row transforms or doing all kinds of maptrix operations? hi list, i have a question regarding a class for matrix modifications so

Re: [PHP] Email with PHP.

2002-06-11 Thread Pushkar Pradhan
There's no special flag to compile the mail function. If you've installed it and it still doesn't work, try giving the path to sendmail in the line sendmail_path in php.ini In my file this line is commented out, seems like php detected the sendmail exec. at configure time. Well I have install

Re: [PHP] beginner in PHP

2002-06-12 Thread Pushkar Pradhan
Is itemcd a variable then it should be used as $itemcd? Try this: echo $catalog[unitprice]; in my experience I've only been able to use the echo() without the quotation marks if I'm calling a function, for variables you need the quotation marks. Hope this helps. Phillip Perry wrote:

Re: [PHP] Email not getting

2002-06-12 Thread Pushkar Pradhan
Yes what are your settings in php.ini, generally the default settings are sufficient? I am trying to send mail from Linux Redhat server through PHP. It is not giving me any error but I am not getting any mail too. Following is the code ? $mailBody =

RE: [PHP] Varible Varibles

2002-06-13 Thread Pushkar Pradhan
I'm trying to use variable variables to work on arrays: $forest = array(a, b, c, ...); $layer[$l]= forest; Now I want to access all array members of $forest using $$layer: e.g. for($c = 0; $c $$layer[$l]; $l++) { echo $$layer[$l][$c]; } But this doesn't work, gives syntax error, So my

[PHP] integer to string

2002-06-14 Thread Pushkar Pradhan
I generate nos. using range function, e.g. I get 0 to 40. I want to convert these nos. to string, I tried sprintf() syntax: $soils[$i] = sprintf(%d, $soils[$i]); But doesn't seem to work, my program returned an error. P.S. : I'm using 4.0.6 otherwise wouldn't have this problem. -Pushkar S.

Re: [PHP] Code Structure/Errors

2002-06-15 Thread Pushkar Pradhan
Quick soln. is to put a symbol in front of the error generating line. E.g.@$i++; actual soln. would be to do some initialization like $i = 0; outside your while loop and $last_name=; I'm just curious if there's a way to restructure my code so as to avoid getting Undefined Variable errors. I

Re: [PHP] Re: How to convert seconds to days, hours, minutes seconds?

2002-06-18 Thread Pushkar Pradhan
http://www.php.net/manual/en/function.gmdate.php You may have to look at other functions also related to this. Thanks! Fargo Lee [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... Hi, if I have a variable containing a number of seconds what function would I use to output

Re: [PHP] run commands on multiple machines

2002-06-18 Thread Pushkar Pradhan
exec() is used to run unix commands and pass results back to php. But this runs the commands on the m/c the web server is on, don't know how you can log onto other m/cs though. Hi, I want to run some unix commands on multiple machines(in a network) from my web server and display results

[PHP] setcookie(), logout

2002-06-21 Thread Pushkar Pradhan
I'm going over some code handed to me, a logout function: function user_logout() { setcookie( 'user_name', '',(time()+28800), '/', '',0); setcookie( 'id_hash', '',(time()+28800), '/', '',0); } Doesn't this mean the cookie will expire after 8 hrs? So what's this really doing? Moreover I

Re: [PHP] Limiting number of decimal places reported

2002-06-29 Thread Pushkar Pradhan
round($order_total), floor(), ceil() are some options. How do I limit the number of decimal places returned in this query? ?php $result2 = mysql_query(SELECT sum(purchase_price) as total FROM assets where order_number='$order_number'); while(list($order_total) = mysql_fetch_row($result2))

Re: [PHP] Javascript to PHP?

2002-06-29 Thread Pushkar Pradhan
I've done this stuff recently. I need to pass whole arrays betn. php and Javascript (2-way), here is some code: // PHP var. to JS function arrFromStr (str2convert) { // make an array from string arr = new Array(); var posOfQt1 = str2convert.indexOf('\'); var posOfQt2 =

Re: [PHP] extracting data from text file

2002-07-01 Thread Pushkar Pradhan
Just use file(), this is most appropriate for reading file line by line. http://www.php.net/manual/en/function.file.php On Monday, July 1, 2002, at 05:17 PM, [EMAIL PROTECTED] wrote: I have trend this but it does not work properly $fp = @fopen(file.txt,r); $line =

Re: [PHP] Function source?

2002-07-09 Thread Pushkar Pradhan
When you compile from the source (which is in c) the functions that are available are actually c executables. If I understand correctly, all php functions are written in php. If this is true, is it possible to view function source code? Thanks for any insight into this :-) -- PHP General

Re: [PHP] Creating Dynamic Variables

2002-07-17 Thread Pushkar Pradhan
Try putting around name in session_register? Hello, I have captured variables from any HTML that is POSTed to me from a 'foreach' clause. Now, possibly in this foreach clause I want to register these name/value pairs into a session var. I have tried : session_start(); foreach

[PHP] how to avoid executing whole script

2002-04-20 Thread Pushkar Pradhan
Hi, I'm new to php, I want to do the foll: in my code: display an array of names to the user, up, down, top and bottom buttons are provided so that the user can change the order of the names (e.g. if original array: a, b, c, d, e and user selects e and presses top array should become e, a, b.

[PHP] passing array as hidden field

2002-04-24 Thread Pushkar Pradhan
I want to pass a 1 dim. array through a form, I use the hidden field and do as follows: form method=POST ACTION=\updateHTML.php\ input type=hidden name=layer[] value=\; foreach($layer as $lay) { print $lay ; } print \ This generates the foll. source: form method=POST ACTION=updateHTML.php

Re: [PHP] newbie: string manipulation

2002-04-24 Thread Pushkar Pradhan
Try this, not the most efficient way. $names = explode(/, /usr/blah/); last_element = sizeof($names)-1; $name[last_element] = abigfile I need code that grabs the file at the end of a file path. I have this: /usr/blah/doh/yuck/wow/abigfile.html And would like to return this:

[PHP] redirect to new page and pass variables too?

2002-04-24 Thread Pushkar Pradhan
I am collecting some data on a page - test.php, ($layer which is an array of names). If checkbox is checked that user wants to change drawing order, I should redirect the browser to page - updateHTML.php which has necessary script to do that. I achieved redirection using header(), but can't pass

[PHP] redirect to new page and pass variables too? (fwd)

2002-04-24 Thread Pushkar Pradhan
My previous question: I am collecting some data on a page - test.php, ($layer which is an array of names). If checkbox is checked that user wants to change drawing order, I should redirect the browser to page - updateHTML.php which has necessary script to do that. I achieved redirection using

Re: [PHP] redirect to new page and pass variables too? (fwd)

2002-04-24 Thread Pushkar Pradhan
Thanks Miguel, I was just reading urlencode.php, shouldn't the complementary function be urldecode() like the document. says, well unserialize must be working too, I believe you. On Wed, 24 Apr 2002, Pushkar Pradhan wrote: I am collecting some data on a page - test.php, ($layer which

Re: [PHP] redirect to new page and pass variables too? (fwd)

2002-04-24 Thread Pushkar Pradhan
to echo the contents it's blank. On Wed, 24 Apr 2002, Miguel Cruz wrote: On Wed, 24 Apr 2002, Pushkar Pradhan wrote: I was just reading urlencode.php, shouldn't the complementary function be urldecode() like the document. says, well unserialize must be working too, I believe you. I'm

Re: [PHP] Array function to delete

2002-04-25 Thread Pushkar Pradhan
As far as I know there isn't such a function, what I do to achieve this: 1. find the position of the element you want to remove 2. slice the array into 2 arrays one contains all elements before this and one contains all elements below this, 3. use shift to remove appropriate element 4. merge both

Re: [PHP] Array function to delete

2002-04-25 Thread Pushkar Pradhan
That's neat but I just read the docs. it says unset() won't work inside a function, even if you pass by reference! Anyways as far as you don't use functions to do the delete it will work fine. On Thursday, April 25, 2002, at 03:22 PM, Liam Gibbs wrote: I've been checking the PHP

Re: [PHP] Array function to delete

2002-04-25 Thread Pushkar Pradhan
$layer is my array - $currPos = array_search($HTTP_POST_VARS[selLayer], $layer); $arrB = array_slice($layer, $currPos); $val = array_shift($arrB); $arrA = array_slice($layer, 0, $currPos); $layer = array_merge($arrA, $arrB); // I do this to

Re: [PHP] redirect to new page and pass variables too? (fwd)

2002-04-25 Thread Pushkar Pradhan
I'm trying to do urlencode/urldecode: my $layer[] contains: aban_railroads, airport_runways2001, blk_grps this is what IE shows in my address window when I do the redirection:

Re: [PHP] redirect to new page and pass variables too? (fwd)

2002-04-25 Thread Pushkar Pradhan
Regarding my previous post: I found out that $QUERY_STRING contains the query: layer=a%3A3%3A%7Bi%3A0%3Bs%3A14%3A%22aban_railroads%22%3Bi%3A1%3Bs%3A19%3A%22airport_runways2001%22%3Bi%3A2%3Bs%3A8%3A%22blk_grps%22%3B%7D Now I am doing: $layer = unserialize($QUERY_STRING); or even

Re: [PHP] Re: array - change elements position

2002-04-25 Thread Pushkar Pradhan
Have you thought about swapping the elements, it's quite simple, I don't know about more complicated methods using pointers here's the code: $layer is the array - $currPos = array_search($HTTP_POST_VARS[selLayer], $layer); $temp = $layer[$currPos]; $layer[$currPos] =

[PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan
I need to pass an array from php to javascript, change the ordering of the elements in javasc.. pass this reordered array back to php script? Is it possible to do this and if so can anyone send me the basic code, I've never written javascript? Thanks, -Pushkar S. Pradhan -- PHP General

Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan
In my php I had 4 buttons, up, down, top and bottom: After detecting which element and which button was clicked I changed the element position by using array_slice, shift, unshift, array_merge etc.. I'm not sure what I'll do it JS On Saturday 27 April 2002 00:56, Pushkar Pradhan wrote: I need

RE: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan
, 2002 1:46 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] passing vars. betn. php and javascript On Saturday 27 April 2002 01:23, Pushkar Pradhan wrote: In my php I had 4 buttons, up, down, top and bottom: After detecting which element and which button was clicked I changed the element

Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan
- From: Pushkar Pradhan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 26, 2002 11:23 AM Subject: Re: [PHP] passing vars. betn. php and javascript In my php I had 4 buttons, up, down, top and bottom: After detecting which element and which button was clicked I changed

Re: [PHP] passing vars. betn. php and javascript

2002-04-26 Thread Pushkar Pradhan
]; } header(Location: $url); You will get $_GET[myarray] on the other side. OR you can do a single comma or semicolon delimited string and then explode(',' $myarray) on the other end to reconstitue the array. Hope that helps. -Kevin - Original Message - From: Pushkar Pradhan [EMAIL

Re: [PHP] Variables not set

2002-04-26 Thread Pushkar Pradhan
On Fri, 26 Apr 2002, Liam Gibbs wrote: Shouldn't you be using GLOBAL to access $this, $that inside functions? I have a problem with my variables not being set. I have a file I use for constants and functions, structured like so: $this = this; $that = that; . . . function this() {

Re: [PHP] File uploading fails

2002-05-01 Thread Pushkar Pradhan
You haven't defined $file_name before trying to echo it, I think you'll have to create it using $HTTP_POST_...['file'] and HTT...['name'] Also check your php.ini to see if file uploads are allowed and if yes the max. limit. I have searched high and low and done everything recommended

Re: [PHP] Get Pagetitle with PHP

2002-05-02 Thread Pushkar Pradhan
Sine PHP has so many string parsing functions, you can grab the text betn. title.../title e.g. HTML code: html .. /html Read the whole file by line into an array - http://www.php.net/manual/en/function.file.php search for line containing title for($lines as $onelineatatime) {

RE: [PHP] Stupid question

2002-05-02 Thread Pushkar Pradhan
Since round() is a maths routine, it will return the most approx. value of your 0.02388.. in 3 decimal digits. If you just want to return the first 3 digits after the decimal use the string routines suggested by Rober Zwink or : $number = $number*1000; // 23.884 $number = floor($number); //

[PHP] pass. vars. betn. javascript and php

2002-05-06 Thread Pushkar Pradhan
Is it possible to pass variables from a php page to a page using javascript, and vice versa, I've the variable - an array passed in the url of the page. -Pushkar S. Pradhan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] array_search in 2-d arrays

2002-05-14 Thread Pushkar Pradhan
I've a 2 D array and would like to search for vals. in the first dimension only i.e. myArray[0][0] myArray[1][0] myArray[2][0] myArray[3][0] . . . and not in the elements myArray[0][1] CODE: for($l = 0; $l count($layer); $l++) { $key = array_search($layer[$l], $layerDes); // $layerDes

Re: [PHP] array_search in 2-d arrays

2002-05-14 Thread Pushkar Pradhan
Regarding my recent post, I am sorry $key is not undefined it is just 0 or FALSE. I've a 2 D array and would like to search for vals. in the first dimension only i.e. myArray[0][0] myArray[1][0] myArray[2][0] myArray[3][0] . . . and not in the elements myArray[0][1] CODE: for($l

[PHP] array search in 2-D arrays

2002-05-15 Thread Pushkar Pradhan
I've a 2 D array and would like to search for vals. in the first dimension only i.e. myArray[0][0] myArray[1][0] myArray[2][0] myArray[3][0] . . . and not in the elements myArray[0][1] CODE: for($l = 0; $l count($layer); $l++) { $key = array_search($layer[$l], $layerDes); // $layerDes

Re: [PHP] array search in 2-D arrays

2002-05-15 Thread Pushkar Pradhan
Oops! Sorry I got a reply for this but didn't read my mail carefully enough. Thanks to Tim Ward for pointing out the problem. I've a 2 D array and would like to search for vals. in the first dimension only i.e. myArray[0][0] myArray[1][0] myArray[2][0] myArray[3][0] . . . and not in the

Re: [PHP] PHP Tag question

2002-05-15 Thread Pushkar Pradhan
You can tell that from the php.ini file look for: ; Allow the ? tag. Otherwise, only ?php and script tags are recognized. short_open_tag = On So basically you can switch them on/off. On Wed, 15 May 2002, Matthew Walker wrote: I'm writing a coding standards document for our programmers, and

Re: [PHP] PHP Tag question

2002-05-15 Thread Pushkar Pradhan
: Pushkar Pradhan [EMAIL PROTECTED] To: Matthew Walker [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, May 15, 2002 4:49 PM Subject: Re: [PHP] PHP Tag question You can tell that from the php.ini file look for: ; Allow the ? tag. Otherwise, only ?php and script tags are recognized

[PHP] do I need sessions?

2002-05-21 Thread Pushkar Pradhan
I've an array $layer in php, I pass this to javascript, JS can then add/remove elements and I get it back in php. I do this using: layerDesStr = '?=serialize($layerDes)?'; // php to JS // JS to php for(var i = 1; i layer.length; i++) { goURL = goURL + layer[]= + layer[i]; }

[PHP] unable to register session variables

2002-05-22 Thread Pushkar Pradhan
I am following example 4 on http://www.php.net/manual/en/ref.session.php code: if(!session_is_registered(layer) ) { session_register(layer); } I tried both and ''s. Doing a phpinfo() on the pg. doesn't show any $HTTP_SESSION_VARS I've both track_vars and register_globals enabled in my

Re: [PHP] unable to register session variables

2002-05-22 Thread Pushkar Pradhan
? ? session_start(); session_register('variable'); ? Jim Lucas - Original Message - From: Pushkar Pradhan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 22, 2002 10:19 AM Subject: [PHP] unable to register session variables I am following example 4 on http

Re: [PHP] fputs() pblm how write on a new line each time ?

2002-05-22 Thread Pushkar Pradhan
How about this: fputs($fic,on a new line\n); This works in c. Hi all, I' m searching how to write in a file on a new line each times whith fputs(). Because i want read the file whith file() and so ,have one line per indice in a table. So i need to write on a new line each time. ?

Re: [PHP] passing arrays

2002-05-23 Thread Pushkar Pradhan
Yes, You have to append the array name and values to the end of the url. You've to pass each element from html to php and vice versa, another method is using input hidden http://yoururl.com/index.phpmyarray[]=onemyarray[]=twomyarray[]=three hi, is there a way to pass arrays in forms or in the

Re: [PHP] mail() function

2002-05-27 Thread Pushkar Pradhan
There is also a user note at the bottom of the documentation: I tried to put \r\n at the end of each header line and Netscape 4.7 didn't work properly. I changed to \n and it worked well. So, I tried it on Outlook Express 5.5 and Eudora 5.1 and it worked too with \n only. I hope it helps... If

Re: [PHP] mail() function

2002-05-27 Thread Pushkar Pradhan
= Give the path of your sendmail, finally if nothing works it means apache 2.0 is the problem, it means many things in php won't work with it. Alright, so it doesn't work with my version of php. How can I make it work? Jochem From: Pushkar Pradhan [EMAIL PROTECTED] To: Jochem Kempe [EMAIL

Re: [PHP] sessions

2002-07-26 Thread Pushkar Pradhan
Try removing the quotes in sessio_register ie. (valid_user2) Here is the code that starts and registers the session. It is login page that logs in to itself so the form that produces $_POST[username] is actually on the same page, but nothing happens until the user logs in. It there is

Re: [PHP] help with crash on make

2002-07-30 Thread Pushkar Pradhan
You chose to compile PHP as a DSO this requires apache to have the mod_so module, you can check this by doing a httpd -l in your apache's bin directory. I'm attempting to compile php 4.2.2 and apache 2.0.39 (both of which I downloaded today) on mandrake 8.1, mainly as part of a process to help

Re: [PHP] First Attempt to use DB failed.

2002-08-09 Thread Pushkar Pradhan
Jim, Are you using a port other than the default (3306)? If so you can specify it by localhost:3306 Is the server really running? I ran the following PHP script: ?php $die_msg = Connection to Database Failed $connect = mysql_connect(localhost,UserName,UserPW) or die(Connect Failed ):

RE: [PHP] need help

2002-08-09 Thread Pushkar Pradhan
And that is good actually since malicious users can't see your source code, variables it is difficult to hack the site. that's the nature of php. it is executed server side then disappears showing only it's results. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [PHP] Free 'search engine' code

2002-08-11 Thread Pushkar Pradhan
I just got a decent search engine from phpclasses.org ( I downloaded the one by BasicA). I modified it a little to add different page types to be returned and other directories. That would depend on what you want. What sort of counter? Hidden? Text file or database based? Images or text on

Re: [PHP] Variable naming standards???

2002-08-13 Thread Pushkar Pradhan
Samuel this is what you can use as a standard (at least for yourself): http://www.cs.msstate.edu/~cs1314/global/guide It describes how to name variables, functions, scripts etc. In short the variable names must tell the programmer what it is being used for, e.g. $countHits = 0; // initialize