php-general Digest 24 Aug 2003 06:42:26 -0000 Issue 2255
Topics (messages 160518 through 160567):
Expiration time of a cookie
160518 by: Stevie D Peele
160527 by: Matthias Nothhaft
Re: user-defined superglobals?
160519 by: Matthias Nothhaft
160522 by: Tom Rogers
160524 by: Matthias Nothhaft
160528 by: Jim Lucas
160550 by: Curt Zirzow
160551 by: Jason Sheets
160553 by: Matthias Nothhaft
160554 by: Mike Migurski
Need help om screen display error
160520 by: Gloria L. McMillan
file upload problem
160521 by: Matthias Wulkow
160529 by: Jim Lucas
160532 by: Matthias Wulkow
160534 by: Jim Lucas
160537 by: Matthias Wulkow
160538 by: Catalin Trifu
160539 by: Jim Lucas
160540 by: Matthias Nothhaft
sdfdsafasdf
160523 by: macromaniac
Re: Easy XML & PHP tutorials ?????
160525 by: Boaz Yahav
Re: google style paginating
160526 by: Boaz Yahav
timing a session
160530 by: Damian Brown
160535 by: Matthias Nothhaft
160536 by: John W. Holmes
Re: 2 questions
160531 by: Thomas Hochstetter
PHP connection
160533 by: Dennis Dujan - Partycult.de
loading extension in script
160541 by: andu
Re: Need help on screen display error
160542 by: Gloria L. McMillan
Re: Problem with the post variables.
160543 by: chris
160544 by: Jim Lucas
Tips on print to screen debugging
160545 by: Gloria L. McMillan
160546 by: John W. Holmes
160547 by: Gloria L. McMillan
160548 by: Gloria L. McMillan
160549 by: John W. Holmes
160552 by: Jim Lucas
sqlite
160555 by: Kevin Waterson
160561 by: andu
160563 by: Kevin Waterson
160566 by: andu
Using PHP on an .html file
160556 by: Pag
160557 by: Kevin Waterson
160559 by: Chan Hong Guan
160560 by: Mike Migurski
parse error with mysql_connect
160558 by: Mjec
Re: '&' Sign in _GET Parameter
160562 by: AciD
finding out localhost :-P
160564 by: Pag
160565 by: Ray Hunter
homepage script..
160567 by: Dasmeet
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
What is the longest expiration time of a cookie?
Thanks
________________________________________________________________
The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!
--- End Message ---
--- Begin Message ---
Stevie D Peele wrote:
What is the longest expiration time of a cookie?
Hm, good question ;-)
A day has 86400 seconds.
Multiply it by 'enough' days (eg 365) and always refresh
your cookie's expiration. This might solve your problem.
Regards,
Matthias
Thanks
________________________________________________________________
The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!
--- End Message ---
--- Begin Message ---
Hi Ray Hunter, you wrote:
you can define your own superglobals by defining the vars first then
accessing them thru the $GLOBALS var.
example:
<?php
// file1.php
$var1 = "test1\n";
$var2 = "test2\n";
?>
<?php
// file2.php
include( 'file1.php' );
function test() {
echo $GLOBALS['var1'];
echo $GLOBALS['var2'];
echo "Test\n"
}
test();
?>
That should get you started with globals.
Well, this is clear, (I'm only new in the list - not in PHP ;-) )
but I want it in a better/shorter way
for the "master var" of a big project!
Is there a way to request such a feature and where?
I think this would be nice for application frameworks!?
Maybe also for PEAR...
Regards,
Matthias
--
BigDog
On Sat, 2003-08-23 at 11:45, Matthias Nothhaft wrote:
Hi List,
is there a way (mybe in php5?) to define/declare a global var as a
superglobal, so that I can use this var like the known superglobals
($_GET, $_SESSION, etc.) ???
If not, is there a list for "feature requests"?
Regards,
Matthias
--- End Message ---
--- Begin Message ---
Hi,
Sunday, August 24, 2003, 3:45:33 AM, you wrote:
MN> Hi List,
MN> is there a way (mybe in php5?) to define/declare a global var as a
MN> superglobal, so that I can use this var like the known superglobals
MN> ($_GET, $_SESSION, etc.) ???
MN> If not, is there a list for "feature requests"?
MN> Regards,
MN> Matthias
You can always add to one of the superglobals, remembering not to have
a name clash with get or post variables.
$_GET['test'] = 'Hi";
now that will be available in all functions.
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Sorry this all is not what I'm looking for.
I see it is not possible at the moment.
It would be nice to have a php-function like
declare_superglobal($_MYFRAMEWORK);
And then use $_MYFRAMEWORK like $_GET.
Thanks nevertheless.
Regards,
Matthias
Ray Hunter wrote:
Well, this is clear, (I'm only new in the list - not in PHP ;-) )
but I want it in a better/shorter way
for the "master var" of a big project!
Yes you can set up a master file that includes all your master
vars...many php developers call this a configuration script and name it
config.php.
This allows users to set up global variables that are used through out
the application.
Is there a way to request such a feature and where?
I think this would be nice for application frameworks!?
Maybe also for PEAR...
There are implementations of this all thru PEAR.
--
BigDog
--- End Message ---
--- Begin Message ---
I have been wanting the same thing, but I too have not found a solution, and
do not know if it will come around.
Being able to create your own super-global would be a very nice feature.
Jim Lucas
----- Original Message -----
From: "Matthias Nothhaft" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 11:44 AM
Subject: Re: [PHP] user-defined superglobals?
> Sorry this all is not what I'm looking for.
> I see it is not possible at the moment.
>
> It would be nice to have a php-function like
>
> declare_superglobal($_MYFRAMEWORK);
>
> And then use $_MYFRAMEWORK like $_GET.
>
> Thanks nevertheless.
>
> Regards,
> Matthias
>
> Ray Hunter wrote:
> >>Well, this is clear, (I'm only new in the list - not in PHP ;-) )
> >>but I want it in a better/shorter way
> >>for the "master var" of a big project!
> >
> >
> > Yes you can set up a master file that includes all your master
> > vars...many php developers call this a configuration script and name it
> > config.php.
> >
> > This allows users to set up global variables that are used through out
> > the application.
> >
> >
> >>Is there a way to request such a feature and where?
> >>I think this would be nice for application frameworks!?
> >>Maybe also for PEAR...
> >
> >
> > There are implementations of this all thru PEAR.
> >
> > --
> > BigDog
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
* Thus wrote Matthias Nothhaft ([EMAIL PROTECTED]):
> Hi List,
>
> is there a way (mybe in php5?) to define/declare a global var as a
> superglobal, so that I can use this var like the known superglobals
> ($_GET, $_SESSION, etc.) ???
>
> If not, is there a list for "feature requests"?
You can request features at bugs.php.net. there is a type of bug
called 'Feature/Change Request'.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
Someone wrote a php module that did this around 6 to 9 months ago. It
was easy to install but you needed access to php.ini.
Try using extract with the option to use references so you don't create
a copy of the variable just a pointer to it.
Jason
Matthias Nothhaft wrote:
Sorry this all is not what I'm looking for.
I see it is not possible at the moment.
It would be nice to have a php-function like
declare_superglobal($_MYFRAMEWORK);
And then use $_MYFRAMEWORK like $_GET.
Thanks nevertheless.
Regards,
Matthias
Ray Hunter wrote:
Well, this is clear, (I'm only new in the list - not in PHP ;-) )
but I want it in a better/shorter way
for the "master var" of a big project!
Yes you can set up a master file that includes all your master
vars...many php developers call this a configuration script and name it
config.php.
This allows users to set up global variables that are used through out
the application.
Is there a way to request such a feature and where?
I think this would be nice for application frameworks!?
Maybe also for PEAR...
There are implementations of this all thru PEAR.
--
BigDog
--- End Message ---
--- Begin Message ---
Hi Jason Sheets, you wrote:
Someone wrote a php module that did this around 6 to 9 months ago. It
was easy to install but you needed access to php.ini.
Do you know where to get/download this module?
Regards,
Matthias
Try using extract with the option to use references so you don't create
a copy of the variable just a pointer to it.
Jason
Matthias Nothhaft wrote:
Sorry this all is not what I'm looking for.
I see it is not possible at the moment.
It would be nice to have a php-function like
declare_superglobal($_MYFRAMEWORK);
And then use $_MYFRAMEWORK like $_GET.
Thanks nevertheless.
Regards,
Matthias
Ray Hunter wrote:
Well, this is clear, (I'm only new in the list - not in PHP ;-) )
but I want it in a better/shorter way
for the "master var" of a big project!
Yes you can set up a master file that includes all your master
vars...many php developers call this a configuration script and name it
config.php.
This allows users to set up global variables that are used through out
the application.
Is there a way to request such a feature and where?
I think this would be nice for application frameworks!?
Maybe also for PEAR...
There are implementations of this all thru PEAR.
--
BigDog
--- End Message ---
--- Begin Message ---
>It would be nice to have a php-function like
>
>declare_superglobal($_MYFRAMEWORK);
>
>And then use $_MYFRAMEWORK like $_GET.
You have a few options: if you are looking to set variables that are
static and atomic, you can use environmental variables in an .htaccess
file (getenv() to access them) or you can use read-only constants
(define() to create them).
If you need a global read-write or array variable, just use $_GLOBALS:
use $_GLOBALS['_MYFRAMEWORK'] like $_GET, etc.
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html
--- End Message ---
--- Begin Message ---
Hi, all!
I have a working database at:
http://dakotacom.net/~glomc/forms/CAT.html
It does send info to the database, but only shows "[" at the upper left of screen
when it is supposed to print to screen.
Could somebody help me find what is wrong in my .php file? Thanks,
Gloria
--- End Message ---
--- Begin Message ---
Hi ,
I try to upload a file with such an input type = 'file' field.
My form looks like:
echo "<form action = '". $_SERVER["PHP_SELF"]."' method = 'GET' enctype
= 'multipart/form-data'>\n";
...
echo "<td><input type = 'file' name = 'newtextupload'
accept='text/*'></td>\n";
...
echo "<td><input type = 'submit' name = 'submit' value =
'ändern'></td>\n";
echo "</form>\n";
After submition, I can't find the file on the server. Nowhere.
In php.ini, I have /tmp as upload-directory.
I'm using apache2 on linux.
Can somebody tell me why the file is not uploaded?
Thx for answering
SvT
--
Who is the ennemy?
--- End Message ---
--- Begin Message ---
when you are uploading files via a form, you must use the POST method.
Jim Lucas
----- Original Message -----
From: "Matthias Wulkow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 11:16 AM
Subject: [PHP] file upload problem
> Hi ,
>
> I try to upload a file with such an input type = 'file' field.
> My form looks like:
>
> echo "<form action = '". $_SERVER["PHP_SELF"]."' method = 'GET' enctype
> = 'multipart/form-data'>\n";
>
> ...
>
> echo "<td><input type = 'file' name = 'newtextupload'
> accept='text/*'></td>\n";
>
> ...
>
> echo "<td><input type = 'submit' name = 'submit' value =
> 'ändern'></td>\n";
>
> echo "</form>\n";
>
> After submition, I can't find the file on the server. Nowhere.
> In php.ini, I have /tmp as upload-directory.
>
> I'm using apache2 on linux.
>
> Can somebody tell me why the file is not uploaded?
>
> Thx for answering
>
> SvT
>
>
> --
> Who is the ennemy?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hallo Jim,
am Samstag, 23. August 2003 um 21:16 hast Du Folgendes gekritzelt:
JL> when you are uploading files via a form, you must use the POST method.
well, I tried the example from
http://de.php.net/manual/de/features.file-upload.php#features.file-upload.post-method
and that doesn't work neither... no files are uploaded...
SvT
PS: In between I tried with POST and no success
--
Who is the ennemy?
mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "Matthias Wulkow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Jim Lucas" <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 12:27 PM
Subject: Re: [PHP] file upload problem
> Hallo Jim,
>
> am Samstag, 23. August 2003 um 21:16 hast Du Folgendes gekritzelt:
>
> JL> when you are uploading files via a form, you must use the POST method.
>
> well, I tried the example from
http://de.php.net/manual/de/features.file-upload.php#features.file-upload.post-method
> and that doesn't work neither... no files are uploaded...
>
>
> SvT
>
> PS: In between I tried with POST and no success
>
>
>
> --
> Who is the ennemy?
>
> mailto:[EMAIL PROTECTED]
>
>
how are you checking to see if the files are getting uploaded?
Jim Lucas
--- End Message ---
--- Begin Message ---
Hallo Jim,
am Samstag, 23. August 2003 um 21:32 hast Du Folgendes gekritzelt:
JL> how are you checking to see if the files are getting uploaded?
JL> Jim Lucas
I'm looking in /tmp for new files... but there are none. I'm also
looking in the Apache-RootDirectory. No files neither.
SvT
--
Who is the ennemy?
mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi,
> echo "<form action = '". $_SERVER["PHP_SELF"]."' method = 'GET' enctype
> = 'multipart/form-data'>\n";
I think that the methos should be POST not GET
Second, you may want to save the file first with,
move_uploaded_file (see
http://de.php.net/manual/en/function.move-uploaded-file.php),
then you will be able to see it.
Of course you will first check it's in order to save it.
Third: it might be a good idea to check your php.ini and
see if you allow file uploads and also the httpd.conf
cheers,
Catalin
--- End Message ---
--- Begin Message ---
ok. the key here then is that php is going to erase the uploaded file after
the script has finished processing.
What you have to do is move the file to a different location before the
script ends.
This is the normal behavor for PHP.
More then likely the file is getting transmitted to the server, but when the
script ends php automatically does some cleanup and erases any leftover
files. Since you didn't move the file, it thinks that it is leftover and
just erases it.
Try moving the file or renaming it in some mannor and you will notice that
the file stays on the server even after the script ends.
Jim Lucas
----- Original Message -----
From: "Matthias Wulkow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Jim Lucas" <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 12:43 PM
Subject: Re: [PHP] file upload problem
> Hallo Jim,
>
> am Samstag, 23. August 2003 um 21:32 hast Du Folgendes gekritzelt:
>
>
> JL> how are you checking to see if the files are getting uploaded?
>
> JL> Jim Lucas
>
>
> I'm looking in /tmp for new files... but there are none. I'm also
> looking in the Apache-RootDirectory. No files neither.
>
> SvT
>
>
>
> --
> Who is the ennemy?
>
> mailto:[EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Did you get any error (displayed/logged) ?
Test it like that:
print_r($_FILES) // with php < 4.1 use $HTTP_POST_FILES
Now you can find your file at ...['tmp_name']
See also the php manual ;-)
Regards,
Matthias
Matthias Wulkow wrote:
Hallo Jim,
am Samstag, 23. August 2003 um 21:32 hast Du Folgendes gekritzelt:
JL> how are you checking to see if the files are getting uploaded?
JL> Jim Lucas
I'm looking in /tmp for new files... but there are none. I'm also
looking in the Apache-RootDirectory. No files neither.
SvT
--- End Message ---
--- Begin Message ---
sdfsdf
--- End Message ---
--- Begin Message ---
Try this too : http://www.sitepoint.com/article/1165
Sincerely
berber
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com
-----Original Message-----
From: Joe Harman [mailto:[EMAIL PROTECTED]
Sent: Friday, August 22, 2003 1:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Easy XML & PHP tutorials ?????
Hello all. does anyone have any very easy XML tutorials . I have a
simple weather feed I want to implement. but no XML experience
thanks
Joe Harman
--- End Message ---
--- Begin Message ---
Try this :
Paginator - a class that can help you to split MySQL database query result sets to
pages.
http://www.weberdev.com/get_example.php3?count=3707
Sincerely
berber
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com
-----Original Message-----
From: Ted Conn [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 11:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] google style paginating
Hi I am new to this newsgroup and I plan on replying to all the posts I can for now...
but Id like to start out by asking a question. I am trying to paginate my sql results
in 10 by 10, which I have been able to do no problem. but what I want to do is have
the pages layed out in google style with (1)(2)(3)(4) etc etc and each one is
clickeable that will take you to that page. I'll show you the code I am using now for
next and back buttons...
//located at top of page
<?php
include("include/conex.php");
$link=Conectarse();
?>
//start of body, this verifies that so is numeric, divisible by 10, and a valid number
<?php $q="SELECT id FROM tblNoticias ORDER BY id "; $result=MYSQL_QUERY("$q",$link);
$num_rows=(MYSQL_NUM_ROWS($result));
if ( isset($_GET['so']) && is_numeric($_GET['so']) )
{
if ( ($_GET['so'] > $num_rows) || ($_GET['so'] < 0) )
$so='0';
else
{
if ($_GET['so'] % 10)
$so='0';
else
$so=$_GET['so'];
}
}
else
$so='0';
?>
//return results
<?php
$q="SELECT id,titulo,texto,img1_data FROM tblNoticias ORDER BY id DESC LIMIT $so,10";
$result=(MYSQL_QUERY("$q",$link));
while ($row=(MYSQL_FETCH_ARRAY($result))){
?>
// next and back buttons
<?PHP
if ( $so >=10)
{
$sortback= $so-10;
echo "<A HREF=\"noticias_historia.php?so=$sortback\" class=\"mainText\"><<
Atras</A>" ;
}
?>
<?PHP
$sortforth=$so + 10;
$existencias=MYSQL_QUERY("SELECT id FROM tblNoticias LIMIT $sortforth,10",$link);
$existencias=MYSQL_NUM_ROWS($existencias);
if ( $existencias > 0 )
echo " <A HREF =\"noticias_historia.php?so=$sortforth\"
class=\"mainText\"> Siguiente >> </A>";
?>
DID I PUT WAY TO MUCH CODE?? Sorry, and I apreciate your help.
How can I implement the google style paging into this code?
Thank you...
Ted Conn Lider de Proyectos [EMAIL PROTECTED] Scinet México S.A. de C.V.
+52 (222) 294-05-95 al 97 Sin costo: 01-8000-DOTCOM Puebla · DF ·
+Monterrey
www.scinet.com.mx
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
i haven't looked into it properly yet,
but is there a way in PHP of recording
the length of time a visitor stays on
your website
i can record the entry, but i don't know how to
record the exit time
Regards,
Damian
www.phpexpert.org
UK FREEphone 0800 019 0924
--- End Message ---
--- Begin Message ---
Damian Brown wrote:
Hi,
i haven't looked into it properly yet,
but is there a way in PHP of recording
the length of time a visitor stays on
your website
i can record the entry, but i don't know how to
record the exit time
There is no way to get this exactly!
You cannot record the time a user
is really reading a single page.
It has to do something with the http protocol
being 'connectionless'!
I heared/read that there's a standard
of the 'advertisment-industry' saying
that a visit ends after 30 minutes after
the last (session-)request.
(A bad method if you really must have this
very exact is to do a short http-refresh,
eg every minute.)
I also think, this is no php problem
but a common problem of the http protocol
which wasn't designed to hold a connection
over a user's session - that's why session
management had to be invented ;-)
Regards,
Matthias
Regards,
Damian
www.phpexpert.org
UK FREEphone 0800 019 0924
--- End Message ---
--- Begin Message ---
Damian Brown wrote:
i haven't looked into it properly yet,
but is there a way in PHP of recording
the length of time a visitor stays on
your website
i can record the entry, but i don't know how to
record the exit time
There's really no way to do this, only ways to estimate the time.
Assign each user a unique id (session_id or a username) and record the
time during each request. After there are no more requests for X minutes
(your choice), then consider the session terminated.
If you are using session, one possibility may be to use your own handler
and write a garbage collection routine that records the "age" of the
session file as it's cleaned up. You can consider the age of the session
file as the time that the user was on your site.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
The register globals is on with the live server, and off at home (my version
is 4.3.2, the other is 4.1.2). does that matter?
Thanks for the other tip, shall try that ...
Thomas
----- Original Message -----
From: "Thomas Hochstetter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 5:33 PM
Subject: [PHP] 2 questions
> Hi guys.
>
> I have two questions for you today:
>
> 1. Weired login problem
> I am developinig a site for a conference where i have a login page for
> members. This page is called index.php and includes different types of
modules,
> according to the type of user logged on. The problem is now following:
> i have a login function hidden in a class, this function registers a bunch
> of variables. After the user has submited the details, index.php (which
calls
> the session_start()) calls the login function. Then i check whether a
session
> variable is present ($_SESSION['name']). If yes, we include the members
> area, otherwise we include the login table again. Now: on my test server
> (XP/Apache/php4.3.2) all is well. However, on the real server
(Linux/Apache/php4.0.x)
> it just includes the login table anyway, even if the login was successful.
I
> then have to click on the menu link again to include the member script.
> Why is that?
Check your register_globals setting in both ur test server and real server
and let me know.
>
> 2. Save a large amount of text to a file
> On the same page i have some type of cms going. The admin users can change
> txt files which relate to text on some of the general pages. I have now
found
> that it is only transmits a certain amount of text via GET to the function
> that writs to the files. Is there a restriction on passing text via url?
If yes
> (which will be the case), how could i do this otherwise?
Use POST instead of GET method... POST method allows u to even extend the
size of data being posted.
Hope this helps...
>
> Thanks so long...
>
> Thomas
> P.S: this list still rocks
>
> --
> COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
> --------------------------------------------------
> 1. GMX TopMail - Platz 1 und Testsieger!
> 2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
> 3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8.
e-Post
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post
--- End Message ---
--- Begin Message ---
I want to connect with my PHP - script to a shell that is located on another
Server.
Is there a command to connect via a PHP script to the shell? Perhaps over
IP…
It would be very nice if you can help me because
I don´t know how to do it
With best regards
Dennis Dujan
--- End Message ---
--- Begin Message ---
Ok, I learned I can load extensions in script using ld(), is there a way
to load extensions from a different directory (i.e.$HOME) in a
case where I don't have access to /php/extensions/?
--
Regards, Andu Novac
--- End Message ---
--- Begin Message ---
I see a couple have tried my poll.
Please ask and I will send that php file...
Gloria
"Gloria L. McMillan" wrote:
> Hi, all!
>
> I have a working database at:
> http://dakotacom.net/~glomc/forms/CAT.html
>
> It does send info to the database, but only shows "[" at the upper left of screen
> when it is supposed to print to screen.
>
> Could somebody help me find what is wrong in my .php file? Thanks,
>
> Gloria
--- End Message ---
--- Begin Message ---
On Mon, 18 Aug 2003 18:35:09 +0200, Wouter Van Vliet <[EMAIL PROTECTED]>
wrote:
The problem is probably in the 'enctype="multipart/form-data"'. You
should
only use this enctype if you're gonna upload a file through the form. If
not, just leave it away or use text/plain
Wouter
Why would that be the problem? Regardless of the enctype, it should still
create POST/GET data for whatever else was in the form. Yes,
multipart/form-data *should* only be used if they are uploading a file.
That doesn't mean PHP should ignore additional POST/GET data from the
form, which it has had a history of doing, depending on which way the wind
blows or the price of tea in China.
-----Oorspronkelijk bericht-----
Van: Klaus Kaiser Apolinário [mailto:[EMAIL PROTECTED]
Verzonden: maandag 18 augustus 2003 16:04
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] Problem with the post variables.
Guys I have a problem here.
I'm using PHP 4.3.2 and httpd 1.3.28.
Look my exemple.
I have a page whith a Form method post, and I submit this page to
teste2.php, but I dont can request de data from the text box...
#######################
This is the test page
<html>
<body>
<form action="teste2.php" method="post" enctype="multipart/form-data">
<input type="text" name="texto">
<input type="submit" value="ok">
</form>
</body>
</html>
#####################
Teste2.php
<?php
$string = $_POST['texto'];
echo "Var em post: ".$string."<br>";
echo "Var em get: ".$_GET['texto']."<br>";
//phpinfo();
?>
############################################
Some one can help me...???
Klaus Kaiser Apolinário
Curitiba online
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--- End Message ---
--- Begin Message ---
You need to take a second look at the way you are refering to the
varialbles in the process page.
You are using the POST method in the method='POST' in the form, but on the
process page you are refering to it via $_GET['...'] change this to
$_POST['...'] and you should be fine.
Jim Lucas
----- Original Message -----
From: "chris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 1:34 PM
Subject: Re: [PHP] Problem with the post variables.
> On Mon, 18 Aug 2003 18:35:09 +0200, Wouter Van Vliet <[EMAIL PROTECTED]>
> wrote:
>
> > The problem is probably in the 'enctype="multipart/form-data"'. You
> > should
> > only use this enctype if you're gonna upload a file through the form. If
> > not, just leave it away or use text/plain
> >
> > Wouter
>
> Why would that be the problem? Regardless of the enctype, it should still
> create POST/GET data for whatever else was in the form. Yes,
> multipart/form-data *should* only be used if they are uploading a file.
> That doesn't mean PHP should ignore additional POST/GET data from the
> form, which it has had a history of doing, depending on which way the wind
> blows or the price of tea in China.
>
> > -----Oorspronkelijk bericht-----
> > Van: Klaus Kaiser Apolinário [mailto:[EMAIL PROTECTED]
> > Verzonden: maandag 18 augustus 2003 16:04
> > Aan: [EMAIL PROTECTED]
> > Onderwerp: [PHP] Problem with the post variables.
> >
> >
> > Guys I have a problem here.
> > I'm using PHP 4.3.2 and httpd 1.3.28.
> > Look my exemple.
> > I have a page whith a Form method post, and I submit this page to
> > teste2.php, but I dont can request de data from the text box...
> >
> >
> > #######################
> > This is the test page
> >
> > <html>
> > <body>
> > <form action="teste2.php" method="post" enctype="multipart/form-data">
> > <input type="text" name="texto">
> > <input type="submit" value="ok">
> > </form>
> > </body>
> > </html>
> >
> > #####################
> > Teste2.php
> >
> > <?php
> > $string = $_POST['texto'];
> > echo "Var em post: ".$string."<br>";
> > echo "Var em get: ".$_GET['texto']."<br>";
> >
> >
> > //phpinfo();
> > ?>
> > ############################################
> >
> > Some one can help me...???
> >
> > Klaus Kaiser Apolinário
> > Curitiba online
> >
> >
>
>
>
> --
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I have always had problems in cutting and pasting new forms off old ones.
Often the problem is in the communication that makes the form allow repliers
to view results on screen. This is good to do with opinion polls to start
discussions.
I have a *terrible* time locating the source of the error.
Do experienced .php users have a method for finding errors in the print
to screen?
I will send the culprit .php file to anybody who is willing to look it over.
Thanks,
Gloria McMillan
--- End Message ---
--- Begin Message ---
Gloria L. McMillan wrote:
I have always had problems in cutting and pasting new forms off old ones.
Often the problem is in the communication that makes the form allow repliers
to view results on screen. This is good to do with opinion polls to start
discussions.
I have a *terrible* time locating the source of the error.
Do experienced .php users have a method for finding errors in the print
to screen?
I will send the culprit .php file to anybody who is willing to look it over.
This is a pretty vague question. Provide some more detail as to the
exact problem that you're having, post a bit of the relavant file, and
the exact error message. :)
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Here is the URL of the poll form.
http://dakotacom.net/~glomc/forms/CAT.html
When you do this poll it immiediately attempts to print to screen.
There's also a "VIEW RESPONSES" button so ppl don't have to
answer the poll to view reponses. You can see now that there
is just a little jumble of letters at upper left of the screen.
Something is wrong in the .php file.
One member of this group gave a working routine to me to
choose among three select calls for the display. Maybe that has
been corrupted by losing a letter or something. I cut and paste
new forms off the old.
I am willing to send the .php file backchannel. I have deleted the personal
addresses from it.
Thanks,
Gloria
"John W. Holmes" wrote:
> Gloria L. McMillan wrote:
>
> > I have always had problems in cutting and pasting new forms off old ones.
> > Often the problem is in the communication that makes the form allow repliers
> > to view results on screen. This is good to do with opinion polls to start
> > discussions.
> >
> > I have a *terrible* time locating the source of the error.
> >
> > Do experienced .php users have a method for finding errors in the print
> > to screen?
> >
> > I will send the culprit .php file to anybody who is willing to look it over.
>
> This is a pretty vague question. Provide some more detail as to the
> exact problem that you're having, post a bit of the relavant file, and
> the exact error message. :)
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> PHP|Architect: A magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
One other thing I noticed:
If you click source code, you get the input replies and the formatting.
None of it shows on screen where I want it, though.
Gloria
"Gloria L. McMillan" wrote:
> Here is the URL of the poll form.
> http://dakotacom.net/~glomc/forms/CAT.html
>
> When you do this poll it immiediately attempts to print to screen.
> There's also a "VIEW RESPONSES" button so ppl don't have to
> answer the poll to view reponses. You can see now that there
> is just a little jumble of letters at upper left of the screen.
>
> Something is wrong in the .php file.
>
> One member of this group gave a working routine to me to
> choose among three select calls for the display. Maybe that has
> been corrupted by losing a letter or something. I cut and paste
> new forms off the old.
>
> I am willing to send the .php file backchannel. I have deleted the personal
> addresses from it.
> Thanks,
>
> Gloria
>
> "John W. Holmes" wrote:
>
> > Gloria L. McMillan wrote:
> >
> > > I have always had problems in cutting and pasting new forms off old ones.
> > > Often the problem is in the communication that makes the form allow repliers
> > > to view results on screen. This is good to do with opinion polls to start
> > > discussions.
> > >
> > > I have a *terrible* time locating the source of the error.
> > >
> > > Do experienced .php users have a method for finding errors in the print
> > > to screen?
> > >
> > > I will send the culprit .php file to anybody who is willing to look it over.
> >
> > This is a pretty vague question. Provide some more detail as to the
> > exact problem that you're having, post a bit of the relavant file, and
> > the exact error message. :)
> >
> > --
> > ---John Holmes...
> >
> > Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
> >
> > PHP|Architect: A magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Gloria L. McMillan wrote:
Here is the URL of the poll form.
http://dakotacom.net/~glomc/forms/CAT.html
When you do this poll it immiediately attempts to print to screen.
There's also a "VIEW RESPONSES" button so ppl don't have to
answer the poll to view reponses. You can see now that there
is just a little jumble of letters at upper left of the screen.
I don't see this. Everything appears fine in Mozilla when I supply
answers or if I just click on "view responses"...
Something is wrong in the .php file.
Or poor HTML that is not formatting correctly?
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
it is your <title> tag. You are missing the closing '>' on the openning
title tag.
Fix that and see what happens
Jim Lucas
----- Original Message -----
From: "Gloria L. McMillan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 2:00 PM
Subject: Re: [PHP] Tips on print to screen debugging
> Here is the URL of the poll form.
> http://dakotacom.net/~glomc/forms/CAT.html
>
> When you do this poll it immiediately attempts to print to screen.
> There's also a "VIEW RESPONSES" button so ppl don't have to
> answer the poll to view reponses. You can see now that there
> is just a little jumble of letters at upper left of the screen.
>
> Something is wrong in the .php file.
>
> One member of this group gave a working routine to me to
> choose among three select calls for the display. Maybe that has
> been corrupted by losing a letter or something. I cut and paste
> new forms off the old.
>
> I am willing to send the .php file backchannel. I have deleted the
personal
> addresses from it.
> Thanks,
>
> Gloria
>
> "John W. Holmes" wrote:
>
> > Gloria L. McMillan wrote:
> >
> > > I have always had problems in cutting and pasting new forms off old
ones.
> > > Often the problem is in the communication that makes the form allow
repliers
> > > to view results on screen. This is good to do with opinion polls to
start
> > > discussions.
> > >
> > > I have a *terrible* time locating the source of the error.
> > >
> > > Do experienced .php users have a method for finding errors in the
print
> > > to screen?
> > >
> > > I will send the culprit .php file to anybody who is willing to look it
over.
> >
> > This is a pretty vague question. Provide some more detail as to the
> > exact problem that you're having, post a bit of the relavant file, and
> > the exact error message. :)
> >
> > --
> > ---John Holmes...
> >
> > Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
> >
> > PHP|Architect: A magazine for PHP Professionals - www.phparch.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I am writing an admin for sqlite but have struck a
problem with exporting data. I wish to simply
get a dump of the current sql database. from
the commandline this would be done with .dump
however this causes an error when used with
sqlite_query()
Is there any other method to get a sqlite dump?
Kind regards
kevin
--
______
(_____ \
_____) ) ____ ____ ____ ____
| ____/ / _ ) / _ | / ___) / _ )
| | ( (/ / ( ( | |( (___ ( (/ /
|_| \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia
--- End Message ---
--- Begin Message ---
On Sun, 24 Aug 2003 13:09:55 +1000
Kevin Waterson <[EMAIL PROTECTED]> wrote:
> I am writing an admin for sqlite but have struck a
> problem with exporting data. I wish to simply
> get a dump of the current sql database. from
> the commandline this would be done with .dump
> however this causes an error when used with
> sqlite_query()
>
> Is there any other method to get a sqlite dump?
I just installed the sqlite extension today myself and was looking for
all those dot commands but I don't think they are supported by the
extension unfortunately. My suggestion is to call sqlite with exec() in
order to get the .dump.
$command="sqlite db_name '.dump'";
exec($command,$result);
print_r( $result);// shows the dump array
>
> Kind regards
> kevin
>
> --
> ______
> (_____ \
> _____) ) ____ ____ ____ ____
> | ____/ / _ ) / _ | / ___) / _ )
> | | ( (/ / ( ( | |( (___ ( (/ /
> |_| \____) \_||_| \____) \____)
> Kevin Waterson
> Port Macquarie, Australia
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
Andu
--- End Message ---
--- Begin Message ---
This one time, at band camp, andu <[EMAIL PROTECTED]> wrote:
> $command="sqlite db_name '.dump'";
> exec($command,$result);
> print_r( $result);// shows the dump array
As sqlite is bundled with php5, I guess command line type commands
are not available because it is compiled in.
Kevin
--
______
(_____ \
_____) ) ____ ____ ____ ____
| ____/ / _ ) / _ | / ___) / _ )
| | ( (/ / ( ( | |( (___ ( (/ /
|_| \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia
--- End Message ---
--- Begin Message ---
On Sun, 24 Aug 2003 14:44:19 +1000
Kevin Waterson <[EMAIL PROTECTED]> wrote:
> This one time, at band camp, andu <[EMAIL PROTECTED]> wrote:
>
> > $command="sqlite db_name '.dump'";
> > exec($command,$result);
> > print_r( $result);// shows the dump array
>
> As sqlite is bundled with php5, I guess command line type commands
> are not available because it is compiled in.
Something like that, I use it as a separately compiled dynamic library
with php4 though.
>
> Kevin
>
>
> --
> ______
> (_____ \
> _____) ) ____ ____ ____ ____
> | ____/ / _ ) / _ | / ___) / _ )
> | | ( (/ / ( ( | |( (___ ( (/ /
> |_| \____) \_||_| \____) \____)
> Kevin Waterson
> Port Macquarie, Australia
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
Andu
--- End Message ---
--- Begin Message ---
I looked everywhere for the answer to this dilemma, and i know there is a
way around it, maybe something about the headers, cant really remember how
it was, but can someone please tell me how i can use PHP code on a file
with an extension of .html?
For example, on a file called info.html, i want to have some PHP code that
actually gets executed.
Thanks.
Pag
--- End Message ---
--- Begin Message ---
This one time, at band camp, Pag <[EMAIL PROTECTED]> wrote:
>
> I looked everywhere for the answer to this dilemma, and i know there is a
> way around it, maybe something about the headers, cant really remember how
> it was, but can someone please tell me how i can use PHP code on a file
> with an extension of .html?
>
> For example, on a file called info.html, i want to have some PHP code that
> actually gets executed.
In your httpd.conf add the line
AddType application/x-httpd-php html
Kind regards
Kevin
--
______
(_____ \
_____) ) ____ ____ ____ ____
| ____/ / _ ) / _ | / ___) / _ )
| | ( (/ / ( ( | |( (___ ( (/ /
|_| \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia
--- End Message ---
--- Begin Message ---
Kevin Waterson wrote:
This one time, at band camp, Pag <[EMAIL PROTECTED]> wrote:
I looked everywhere for the answer to this dilemma, and i know there is a
way around it, maybe something about the headers, cant really remember how
it was, but can someone please tell me how i can use PHP code on a file
with an extension of .html?
For example, on a file called info.html, i want to have some PHP code that
actually gets executed.
In your httpd.conf add the line
AddType application/x-httpd-php html
You forgot your dot
AddType application/x-httpd-php .html
Kind regards
Kevin
--- End Message ---
--- Begin Message ---
>> For example, on a file called info.html, i want to have some PHP
>> code that actually gets executed.
>
>In your httpd.conf add the line
>
>AddType application/x-httpd-php html
Better to do this in an .htaccess file, so you don't incur PHP processing
overhead on the entire server (if there are others using it).
http://httpd.apache.org/docs/configuring.html#htaccess
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html
--- End Message ---
--- Begin Message ---
Hi,
I keep getting Parse Error on line 36, but I can't figure out why...
relevant code:
35: // Initialize MySQL database
36: $h =
mysql_connect('localhost','localhost',constant("mysql_user"),constant("mysql
_password"));
37: mysql_select_db('mjec_mjecnet', $h);
using PHP v. 4.3.2
Thanks,
Mjec
--- End Message ---
--- Begin Message ---
Try this :
$link = $row[company];
echo ("<a href='full_profile_1.php?name=".urlencode($link)."'>");
--------------
www.cpm-fr.com
Thanks for the link,
$link = $row['company'];\00\00
<a href=\"full_profile_1.php?name=', urlencode($link),' \"\00\00>
However this does not seem to work / what am I missing ?
Thanks
-Pushpinder
On Friday, August 22, 2003, at 03:23 PM, CPT John W. Holmes wrote:
From: "Pushpinder Singh Garcha" <[EMAIL PROTECTED]>
I am using an application where I retrieve user profile from a MySQL
DB using the Company Name . I pass the name of the company to the PHP
script as a '$_GET' parameter. e.g. when the name of the company is
'IBM'. , the URL with the query string would look like :
http://masterstream.com/CRM/full_profile_1.php?name=IBM
Now one of the records had a name : PSG & Inc. , in this case the URL
with the query string would look like
http://masterstream.com/CRM/full_profile_1.php?name=PSG%20&%20Inc.
However in the case of the latter I am not able to pull out any records
from the MySQL database. It says that "no records with the name were
found". I went ahead and tweaked the name of the company, to remove
the "&" sign in 'PSG & Inc.' Now the query works fine. Can some one
throw some light here. I am sure something minor is to be done when
passing the name of the company in the parent script.
The & character separates variables in the query string, so it must be
encoded if it appears in the data. Take a look at
http://us2.php.net/urlencode
---John Holmes...
--- End Message ---
--- Begin Message ---
Heres the problem. I have one of my client's site hosted on a crappy
server, and i have it running with php+mysql ok, the thing is i need to
connect to that site's mysql's database from a different site to get data.
The problem is that on the origin site (the crappy server), to connect to
the database, i use "localhost". How can i find out the real server to
connect to from the other site? I tried using the whole domain, like
www.crappyserver.com, but doesnt work. :-P
Thanks.
Pag
--- End Message ---
--- Begin Message ---
Make sure that the user that you are connecting with has permissions to
connect to mysql from that computer. You can check the user table in the
mysql database to see the user and their associated permissions.
I would suggest checking out mysql.com for additional information.
--
BigDog
On Sat, 2003-08-23 at 22:00, Pag wrote:
> Heres the problem. I have one of my client's site hosted on a crappy
> server, and i have it running with php+mysql ok, the thing is i need to
> connect to that site's mysql's database from a different site to get data.
> The problem is that on the origin site (the crappy server), to connect to
> the database, i use "localhost". How can i find out the real server to
> connect to from the other site? I tried using the whole domain, like
> www.crappyserver.com, but doesnt work. :-P
> Thanks.
>
> Pag
--- End Message ---
--- Begin Message ---
Hi!,
I am developing a web site for an ISP.. They want to add homepage
functionality.. that is their subscribers can have thier homepage (say
with 2MB space each).
Is there any script (free or paid) for such system.. to manage, create
accounts etc...
Any information would be of great help!
Thanks
Dasmeet
--
--
Domainwala.com
Domain Names from $7.99 at http://www.domainwala.com
--- End Message ---