php-windows Digest 15 Mar 2001 09:09:49 -0000 Issue 492
Topics (messages 6034 through 6049):
Re: How to use COM
6034 by: Phillip Bow
6038 by: Alain Samoun
Re: Mail/PHP/Apache
6035 by: Gaylen Fraley
Help!
6036 by: Robin Bolton
6037 by: Robin Bolton
6042 by: Dreamvale
Download Prompt Problem
6039 by: Daniel
6049 by: Urmil Parikh
Uninitialized Variables
6040 by: Dwight Sparling
6041 by: Olivier Hubert
6048 by: Darvin Andrioli
Email Problem....SOLVED!!!!
6043 by: OoCobra97.aol.com
News with MySQL
6044 by: Mangiola Nunzio Datavia
Mail-function! Help!
6045 by: Vegard
Re: Print variables coming from a form not controled by me...
6046 by: Dream
Help Needed on MSSQL
6047 by: R. Srinath
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]
----------------------------------------------------------------------
Actually the manual is a bit off. In order to instantiate a COM object you
need to do:
$object = new COM("adodb.recordset");
Then you should be able to call the corresponding methods and properties:
$object->property = $sumvar;
or what have you.
You might check out http://php.net/manual/en/ref.com.php as the examples are
quite useful for starting out.
--
phill
""Thomas"" <[EMAIL PROTECTED]> wrote in message
98omg2$2n4$[EMAIL PROTECTED]">news:98omg2$2n4$[EMAIL PROTECTED]...
> Hi all again,
>
> i' am a very bloody greenhorne with php and maybe i have many questions.
> Heres one another:
>
> Who can exlpain to use com in php.
> How can i execute methods and read attributes?
> I only know how i can craete an object:
>
> $object = new ("adodb.recordset") for exsample, is it not so?
> But how can i get the attributes and execute the methods?
> And why the Documentation speaks from com_load,com_invoke and so on.
> No once of them are working. I only get the message:
>
> Call to undefined function.... and so on..
>
> Thanks for Help,
>
> Thomas
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
Check:
http://www.phpbuilder.com/columns/alain20001003.php3
Author should be updating it somedays ;)
Alain
On Wed, Mar 14, 2001 at 10:07:55PM -0000, Thomas wrote:
> Hi all again,
>
> i' am a very bloody greenhorne with php and maybe i have many questions.
> Heres one another:
>
> Who can exlpain to use com in php.
> How can i execute methods and read attributes?
> I only know how i can craete an object:
>
> $object = new ("adodb.recordset") for exsample, is it not so?
> But how can i get the attributes and execute the methods?
> And why the Documentation speaks from com_load,com_invoke and so on.
> No once of them are working. I only get the message:
>
> Call to undefined function.... and so on..
>
> Thanks for Help,
>
> Thomas
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
Tried all that -- still no go. Thanks.
--
Gaylen
[EMAIL PROTECTED]
http://home.earthlink.net/~gfraley5/
"Fernando Madruga" <[EMAIL PROTECTED]> wrote in message
3685A91F554BD411BA310008C759B6CC02527B34@MAIL_CBR">news:3685A91F554BD411BA310008C759B6CC02527B34@MAIL_CBR...
You need to use mod_php:
uncomment the line on your httpd.conf that refers to LoadModule
php4_module; on my setup is
'LoadModule php4_module modules/ApacheModulePHP4.dll'
then add the following lines to your httpd.conf inside the <IfModule
mod_mime.c> so as to register .php files with the module:
<IfModule mod_php4.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>
I think that you may have to copy php4dllts.dll to your apache/modules
directory.
After restarting apache, test that it's working with <? phpinfo() ?>
If this fails, you'll have to check http://www.php4win.de/ or somewhere else
for a more detailed explanation...
HTH,
Fernando Madruga
-----Original Message-----
From: Gaylen Fraley [mailto:[EMAIL PROTECTED]]
Sent: quarta-feira, 14 de Março de 2001 11:32
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Mail/PHP/Apache
I have placed my answers beneath your questions. The answers to all are YES
except the module vs. executable. How do I control that? In Apache the PHP
file that is called is php.exe.
--
Gaylen
[EMAIL PROTECTED]
"Fernando Madruga" <[EMAIL PROTECTED]> wrote in message
3685A91F554BD411BA310008C759B6CC02527B1D@MAIL_CBR">news:3685A91F554BD411BA310008C759B6CC02527B1D@MAIL_CBR...
>
> I'm also running Apache+PHP4+xtras on a Win98SE machine and have NO
problems
> sending mail; in fact, I use it on my 404.php error generator to send an
> email to the webmaster (me!) whenever a broken link is requested and it
> works absolutely fine!
> Hints:
> - Have you tried using the IP of your ISP's mail server?
YES.
> - Do you have a permanent link to it?
YES.
> - Can you use an email program on that machine (look for freeware,
> no-install email programs on tucows) and send mail from it?
YES
> - Are you running php as an executable or as a module? I'm using it as a
> module without any problems.
HOW DO I KNOW?
> - Did you check for multiple copies of PHP.INI?
YES
> - Is PHP.INI in your C:\Windows\ folder?
YES
>
> Just a few thinks to check for...
>
> HTH,
> Fernando Madruga
>
> > I am experiencing technical difficulties! I have Apache and PHP 4
> installed
> > on a Windows 98SE machine. Everything is working perfectly except the
> mail
> > function. I have updated the ini file to use my ISP's mail SMTP server.
> I
> > have even tried installing an e-mail server on my machine, which works,
> but
> > I still get the following (not so helpful) error:
>
> > Warning: Unknown error in e:\apache\htdocs\main\send_simpleform.php on
> line 10.
>
> > Here is line 10:
> > mail("$to", "$subject", "$msg", "$mailheaders");
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Ok, I've managed to get pretty far stuck using MySQL 3.22 and PHP 4.0b2
for a project I'm working on, however I was hoping someone could help me
with a problem that's probably really simple to fix, just can't get my
head around it right now.
I need to pull 25 items out of a database randomly with no repeats. Since
I'm using MySQL 3.22 I can't use 'ORDER BY RAND()' and PHP4.0b2 doesn't
support the 'shuffle()' function (which apparently doesn't work too well
anyways.)
What I've got so far is:
for($i = 1; $i < 26; $i++) {
$rArray[$i] = rand(1,count(range(1,25)));
}
however, that causes repeats. So the bottom line is I need an array with
25 values (1 to 25) sorted randomly without repeats, and only using PHP
4.0b2 and earlier functions.
Thanks in advance,
Robin Bolton
Lone Pine Publishing
www.lonepinepublishing.com
[EMAIL PROTECTED]
[EMAIL PROTECTED]
smime.p7s
Oops, I just realized that range() doesn't even work in PHP 4.0b2. Ack!
> -----Original Message-----
> From: Robin Bolton [mailto:[EMAIL PROTECTED]]
> Sent: March 14, 2001 3:53 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Help!
>
>
> Ok, I've managed to get pretty far stuck using MySQL 3.22 and PHP 4.0b2
> for a project I'm working on, however I was hoping someone could help me
> with a problem that's probably really simple to fix, just can't get my
> head around it right now.
>
> I need to pull 25 items out of a database randomly with no repeats.
Since
> I'm using MySQL 3.22 I can't use 'ORDER BY RAND()' and PHP4.0b2 doesn't
> support the 'shuffle()' function (which apparently doesn't work too well
> anyways.)
>
> What I've got so far is:
>
> for($i = 1; $i < 26; $i++) {
> $rArray[$i] = rand(1,count(range(1,25)));
> }
>
> however, that causes repeats. So the bottom line is I need an array with
> 25 values (1 to 25) sorted randomly without repeats, and only using PHP
> 4.0b2 and earlier functions.
>
>
> Thanks in advance,
>
> Robin Bolton
> Lone Pine Publishing
> www.lonepinepublishing.com
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
smime.p7s
Perhaps try creating 25 uniq random numbers which correspond to the row
numbers, with upper limit tied to the number of rows.
----- Original Message -----
From: "Robin Bolton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 15, 2001 6:52 AM
Subject: [PHP-WIN] Help!
> Ok, I've managed to get pretty far stuck using MySQL 3.22 and PHP 4.0b2
> for a project I'm working on, however I was hoping someone could help me
> with a problem that's probably really simple to fix, just can't get my
> head around it right now.
>
> I need to pull 25 items out of a database randomly with no repeats. Since
> I'm using MySQL 3.22 I can't use 'ORDER BY RAND()' and PHP4.0b2 doesn't
> support the 'shuffle()' function (which apparently doesn't work too well
> anyways.)
>
> What I've got so far is:
>
> for($i = 1; $i < 26; $i++) {
> $rArray[$i] = rand(1,count(range(1,25)));
> }
>
> however, that causes repeats. So the bottom line is I need an array with
> 25 values (1 to 25) sorted randomly without repeats, and only using PHP
> 4.0b2 and earlier functions.
>
>
> Thanks in advance,
>
> Robin Bolton
> Lone Pine Publishing
> www.lonepinepublishing.com
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
I am very new to php, but i tried to install it and i followed the
directions i think... But everytime i try to view a .php document in IE it
prompts me to download the file instead of viewing it in the browser. And
when I do download the file and run it, it opens it up in a "Command Prompt"
and runs a bunch of html syntax really fast, I am thinking that is my php
configuration that i am supposed to see in my browser. Is there an extension
problem or something? .php extensions are set to run the /php/php.exe file
but I cant figure anything out. I am running apache on windows 2000.
It seems that your web server doesn't recognize .php extension. Read the
installation notes (of php) for your web server. It will help you solve the
problem.
Regards, | Linux
Urmil Parikh | It is now safe to turn on your computer
-----Original Message-----
I am very new to php, but i tried to install it and i followed the
directions i think... But everytime i try to view a .php document in IE it
prompts me to download the file instead of viewing it in the browser. And
when I do download the file and run it, it opens it up in a "Command Prompt"
and runs a bunch of html syntax really fast, I am thinking that is my php
configuration that i am supposed to see in my browser. Is there an extension
problem or something? .php extensions are set to run the /php/php.exe file
but I cant figure anything out. I am running apache on windows 2000.
Can PHP deal with variables that are not initialized? It is kicking out an
error when it runs into something that is not defined yet.
mysql_select_db("mydb",$db);
if ($id) { <=========Not initialized and PHP
kicks an error?
// query the DB
Thanks!
Dwight
What exactly is the error message? I know this sounds stupid, but are you
sure it isn't just a warning? By default, PHP will output all warnings and
errors to standard output (e.g. the browser).
Olivier
>Can PHP deal with variables that are not initialized? It is kicking out an
>error when it runs into something that is not defined yet.
>
>mysql_select_db("mydb",$db);
>
>if ($id) { <=========Not initialized and PHP
>kicks an error?
>
> // query the DB
>
>
>Thanks!
>Dwight
You may use the function isset.
Try this code:
if (!isset($id)) { // variable not set
}
Regards
Darvin
-----Original Message-----
From: Dwight Sparling [SMTP:[EMAIL PROTECTED]]
Sent: Thursday, March 15, 2001 3:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Uninitialized Variables
Can PHP deal with variables that are not initialized? It is kicking out an
error when it runs into something that is not defined yet.
mysql_select_db("mydb",$db);
if ($id) { <=========Not initialized and PHP
kicks an error?
// query the DB
Thanks!
Dwight
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hello,
I've been seeing quite a few e-mails about the mail() function not
working...well mine worked fine until today i believe, but it looks like it
has to do with the php ini setting, althoug Ive changed my ini, it still
didnt work, so heres a workaround I found on php.net that works great. In
the script your working on right before the mail function, put the following
variables
ini_set("SMTP", "your.smtp.server");
(i used localhost, thats where my server is)
ini_set("sendmail_from", "[EMAIL PROTECTED]");
(i used postmaster@localhost)
now my script works great, and hopefully everyone else's will
~Jeff
Hi
What I would like to do is save a news
item as a html or text file. Then place it into
a MySQL database. Afterwards I would like
to display the fist paragraph of each news
posting on a site in a summary format.
If the user would like to see more all
he has to do is click on the corresponding
link and it will take him to the full story.
Now I know how to upload files and download
full files from the database. I also
know how to strip the first paragraph of an
HTML file. But how to put them
together?
Anybody got any pointers?
I have php4 and Apache running on Windows 2000, and Im not able to get the
mail-function to work. The mailsystem is on an other PC, and so I added
SMTP=<mailservers IP-address> in the php.ini file. But still I get "Failed
to connect" when I run mail().
I have heard that there can be a problem if the mailserver is separated from
the webserver and you have a firewall?
Do I have to do anything in the mailsystem? Or maybe in httpd.conf ??
I'v also tryed to add:
ini_set("SMTP", "<ip-address>");
ini_set("sendmail_from", "[EMAIL PROTECTED]");
in the script, but still I get: "Failed to Connect" :-(
Please enlighten me!
Vegard.
Hi Michael,
Also, when I run the page, it give me a parse error in line 22, that is:
while ( list ( $key, $val ) = each ( $HTTP_GET_VARS ) )
Any idea?
Here's the complete page
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?
function DumpHttpGetVars()
{
global $HTTP_GET_VARS;
if( $HTTP_GET_VARS )
{
reset ( $HTTP_GET_VARS );
while ( list ( $key, $val ) = each ( $HTTP_GET_VARS ) )
{
echo "$key => $val<br>\n";
if ( "array" == GetType( $val ) )
{
while ( list ( $key_child, $val_child ) = each
$HTTP_GET_VARS ) )
{
echo "|--> $key => $val<br>\n";
}
}
}
}
}
?>
<p>
<? echo $SERVER_ADDR; ?>
</p>
<p>
<? echo $REMOTE_ADDR; ?>
</p>
<p>
<? echo $HTTP_USER_AGENT; ?>
</p>
</body>
</html>
""Michael Rudel"" <[EMAIL PROTECTED]> escribió en el mensaje
002001c0aba9$4fc50ab0$[EMAIL PROTECTED]">news:002001c0aba9$4fc50ab0$[EMAIL PROTECTED]...
> // Dumps out all HTTP_GET_VARS:
> function DumpHttpGetVars()
> {
> global $HTTP_GET_VARS;
>
> if( $HTTP_GET_VARS )
> {
> reset ( $HTTP_GET_VARS );
> while ( list ( $key, $val ) = each ( $HTTP_GET_VARS ) )
> {
> echo "$key => $val<br>\n";
> if ( "array" == GetType( $val ) )
> {
> while ( list ( $key_child, $val_child ) = each
> $HTTP_GET_VARS ) )
> {
> echo "|--> $key => $val<br>\n";
> }
> }
> }
> }
> }
>
> So you just call the function 'DumpHttpGetVars()'
> and all of them will be printed out.
>
> Greetinx,
> Mike
>
> Michael Rudel
> - Web-Development, Systemadministration -
> _______________________________________________________________
>
> Suchtreffer AG
> Bleicherstraße 20
> D-78467 Konstanz
> Germany
> fon: +49-(0)7531-89207-17
> fax: +49-(0)7531-89207-13
> e-mail: mailto:[EMAIL PROTECTED]
> internet: http://www.suchtreffer.de
> _______________________________________________________________
""Michael Rudel"" <[EMAIL PROTECTED]> escribió en el mensaje
002001c0aba9$4fc50ab0$[EMAIL PROTECTED]">news:002001c0aba9$4fc50ab0$[EMAIL PROTECTED]...
> // Dumps out all HTTP_GET_VARS:
> function DumpHttpGetVars()
> {
> global $HTTP_GET_VARS;
>
> if( $HTTP_GET_VARS )
> {
> reset ( $HTTP_GET_VARS );
> while ( list ( $key, $val ) = each ( $HTTP_GET_VARS ) )
> {
> echo "$key => $val<br>\n";
> if ( "array" == GetType( $val ) )
> {
> while ( list ( $key_child, $val_child ) = each
> $HTTP_GET_VARS ) )
> {
> echo "|--> $key => $val<br>\n";
> }
> }
> }
> }
> }
>
> So you just call the function 'DumpHttpGetVars()'
> and all of them will be printed out.
>
> Greetinx,
> Mike
>
> Michael Rudel
> - Web-Development, Systemadministration -
> _______________________________________________________________
>
> Suchtreffer AG
> Bleicherstraße 20
> D-78467 Konstanz
> Germany
> fon: +49-(0)7531-89207-17
> fax: +49-(0)7531-89207-13
> e-mail: mailto:[EMAIL PROTECTED]
> internet: http://www.suchtreffer.de
> _______________________________________________________________
>
>
>
> -----Original Message-----
> From: Tom Mathews [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 13, 2001 10:38 AM
> Cc: PHP Windows lista
> Subject: Re: [PHP-WIN] Print variables coming from a form not controled
> by me...
>
>
> Anything in the querystring can be translated as a php variable.
>
> Say you have the string coming in as
> ...?result=1&age=23...
> then in the called page/script, the querystring are already variables.
> eg $result will have the value 1, $age will have the value 23...
>
> Hope this is what you're after
>
> Tom
> Dream wrote:
>
> > Any idea of how to get information from a form (not a form controlled by
> me,
> > through GET method, i.e. info coming with the URL, like this
> > http://www.xxx.com/xxx.cgi?result=1&age=23&name=john) and print it
> through
> > php v.3?
> >
> > I don't know how to get the info (coming from an outside form) and pass
it
> > throught the php3 variables......
> >
> > Thanks,
> >
> > marc
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>Dear Sir
>I installed PHP (Latest version) on my machine which runs on WIN 2000
>Advanced server and as MSSql 7.0 but as given in the site if I take
>comment from the extension file that is in the PHP.INI file I have all the
>Dlls but it is telling the Dll is not found. I copied the Dll and pasted
>it in the WINNT directory itself it didnt work and also copied the file
>and pasted inot the PHP directory then also it didnt work it is always
>showing a alert that the Dll is not to be found what should I do further.
>PHP is executing correctly only the Database couldnt be connected. Please
>help me in this regard as soon as possible
>thanks
>srinath