[PHP] session and mysql connection identifier

2004-07-20 Thread mukta telang
Hi,
I want to use mysql persistent connection to connect
to mysql and use the connection identifier or handle
in subsequent pages/scripts. So in script1.php I have
session_start();
session_register('conn');
HTTP_SESSION_VARS['conn']=mysql_pconnect(...);

and in script2.php I have,

echo $conn;

and I always get 1 as output and not Resource#.. as
expected..

Please help,

regards,
Mukta




__
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] fopen successful..cant write to the file though permissions are ok..

2004-06-11 Thread mukta telang
Hi,
I am facing a strange problem..When I try to create a
file in /tmp directory (using php script) as follows:

$filename/tmp/newfile);
$filehandle=fopen($filename,w);
fclose($filehandle);

I get error something like fclose(): ~not a stream~.
All routines like fwrite(), readdir() give errors.
An empty file gets created though.

Its silly, but cant find the reason..
Please help,

Mukta 




__
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Document root

2003-08-14 Thread Mukta Telang
Hi!
Is there any constant in php like $DOCUMENT_ROOT which holds path to the
Document root of the server?
I want to do something like this:
$path=$DOCUMENT_ROOT./files/one.php;
echo a href=\$path\;
Thanks in advance,
Mukta

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] fpdf

2003-07-30 Thread Mukta Telang
 Hi, 
 I want to display the results generated by the query and generate a pdf
 document (using fpdf) for the users to save. The user should be able to
save 
 it by clicking on a save button. I have a script called display.php
which
 displays the result of the query..now I want user to be able to save by
 pressing save button. That is I want to do this in the display.php
script
 itself, because the result of the query is too large to POST to another
 script. 
 If I do: 
 $pdf-Output(/tmp/new.pdf); then I can save the pdf document..but I
 want this to happen only if the user clicks on save button and he/she
 should be able to download it by doing so. 
 How to do this? 
 Thanks in advance, 
 Mukta

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Dynamically generate a drop down list

2003-07-28 Thread Mukta Telang
Hi,
I want to dynamically generate a drop down list of authors by querying
a database. What I am doing at present is:

function init_auth_list($auth_list)
{
$auth_list=select name=author option value=\\select the
name of t
he author/option\;
$query=select name from author order by name;
$result=pg_exec($GLOBALS[db],$query);
$numrows=pg_numrows($result);
$i=0;
while($i$numrows)
{
$row=pg_fetch_row($result,$i);
$auth_list=$auth_list.option
name=\$row[0]\$row[0]/option;
$i++;
}
$auth_list=$auth_list./select;
return $auth_list;
}


and then I just echo $auth_list.

Is it possible to have a function which echoes the values as they are
read from the database?

I tried doing something of this sort..but didn't work..
Any suggestions?
Thanks in advance,
Mukta

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] forms addslashes ?

2003-06-19 Thread Mukta Telang
Hi,
I want to add slashes to a string, if it contains quotation marks and
which is received as input from a form, so that I can enter it to a
database.
What I am doing is as follows:

echo input type=\text\ name=\title\;
$title=addslashes($title);

But the string that gets added has a lot of slashes!
How should this be done?
Mukta

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] string question

2003-06-11 Thread Mukta Telang
Hi,
if a string is:
$x=A.B. XYZ;
and if I post it as a hidden form control and echo $_POST['x'] then I
get:
A.B.
and not A.B. XYZ !
What should I do?
Mukta

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] determine action of a form dynamically?

2003-06-03 Thread Mukta Telang
Hi,
I want action of a form to be PHP_SELF untill user presses continue
button. 
If continue button is pressed than next.php should be the action of
the form.
how to do this?
Thanks in advance,
Mukta

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] ftp and www

2003-01-06 Thread Mukta Telang
Hi,
I am told to  merge ftp and www  !
I cant understand what it means..
May be it means that it should be possible to browse ftp directory
from a browser? 
What is php's support for ftp?
Mukta 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] public_html and httpd.conf

2002-10-29 Thread Mukta Telang
Hi,
All the (php) files that I create under public_html directory
are visible to all users...is there anything like private_html 
where I could test my code and it will not be visible to all except me?!
I am using php in solaris...
mukta



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Passing the variables ...

2002-10-28 Thread Mukta Telang
I have written followong code in hello.html:

HTML
HEAD
/HEAD
BODY
FORM ACTION=hello.php METHOD=POST
Benter your name:/B
INPUT TYPE=TEXTAREA NAME=textbox
INPUT TYPE=SUBMIT
/FORM
/BODY
/HTML

and following in hello.php:

HTML
HEAD
/HEAD
BODY
?php
printf(BRhello %s!,$textbox);
?
/BODY
/HTML


This script works fine with php in redhat 7.2 system 
but does not work in solaris 7 !

I have done the php installation...

apache version: 2.0.40
php version: 4.2.2

What are the chances that the problem is with the php-installation?
( I had to copy code from apache2filter directory of pre 4.3 version of
php to remove errors during make )

I tried using echo($_GET['$textbox']) instead of printf statement in
hello.php.. 
   
 
What could be the problem??
Please help!!
mukta




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php