php-windows Digest 5 Nov 2004 19:54:55 -0000 Issue 2456

Topics (messages 24892 through 24910):

Re: How do I unsub. on this list WAS: RE: [PHP-WIN] Re: Headers A lready Sent - How To 
Overcome????
        24892 by: Svensson, B.A.T. (HKG)

POST/GET problem
        24893 by: Martyn Kinder
        24894 by: Rafael Soares
        24896 by: Martyn Kinder
        24897 by: Luis Moreira

running an exe
        24895 by: duncan
        24908 by: Jason Barnett

Re: PHP e file zip
        24898 by: zyp
        24900 by: Raul IONESCU

2 sites accessing 1 db - problem
        24899 by: George Pitcher

Server-level redirect?
        24901 by: Anne Shroeder
        24902 by: Murray . PlanetThoughtful

Apache, PHP4, MySQL installation
        24903 by: Jeroen
        24904 by: phpWalter
        24905 by: Alejandro C�sar Garrammone
        24906 by: Rafael Soares
        24907 by: Janet Valade

Re: Headers Already Sent - How To Overcome????
        24909 by: Jason Barnett

Re: exec() IIS 5 php
        24910 by: Jason Barnett

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 ---
By learning to read the signature of every single mail posted here: 

    ---> "To unsubscribe, visit: http://www.php.net/unsub.php";


-----Original Message-----
From: Andres Mora
To: MikeA
Cc: [EMAIL PROTECTED]
Sent: 5-11-2004 7:16
Subject: Re: [PHP-WIN] Re: Headers Already Sent - How To Overcome????

how can I unsubscribe from this service????

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

--- End Message ---
--- Begin Message ---
Hi,

I am not sure if this is the correct group for this problem, so apologies if
I have got this totally wrong.
I have just installed PHP5 on a Windows XP machine with IIS (PWS).

phpinfo() seems OK.

However, when I try the following test script:

name.html looks like:

<html>
<body>
<center>
<FORM METHOD="POST" ACTION="name2.php">
 <table>
        <tr>
                <th width="15%" nowrap><b>First Name</b></th>
                <td width="35%"><input type=text name = "name"></td>

                <th width="15%" nowrap><b>Last Name</b></th>
                <td width="35%"><input type=text name = "surname"></td>
        </tr>
 </table>
 <table>
   <INPUT TYPE="SUBMIT" VALUE="Submit" NAME="Submit">
   <INPUT TYPE="RESET" VALUE="Reset" NAME="Reset">
 </table>
</Form>
</center>
</body>
</html>

 and

name2.php looks like:
<html>
<body>
<?php

$surname=strtoupper($surname);

?>
<?php echo("<h3>Hello"),  $name, (" "), $surname, ("</h3>");?>
</body>
</html>

When I run the name.html script:

I get

Notice: Undefined variable: surname in c:\Inetpub\wwwroot\name2.php on line
5

Hello
Notice: Undefined variable: name in c:\Inetpub\wwwroot\name2.php on line 9

I think this works OK on PHP4 and Apache.

I have looked through the FAQ's etc. But I'm not sure if this is an idiot
fault or a configuration fault.

Is there a requirement to declare variables in PHP5 now?

Any suggestions please!

Thanks

Martyn

--- End Message ---
--- Begin Message ---
You probably have register_globals turned off (this is a question of
security and performance).

You can turn it on changing your php.ini file, it's probably located in
C:\WINDOWS

Or try this in the beginning of your PHP file:

<?php

$name = $_POST['name'];
$surname = $_POST['surname'];

?>

Rafael Soares - Ag�nciaM
Fone:  +55 11 4616-1394
 
-----Mensagem original-----
De: Martyn Kinder [mailto:[EMAIL PROTECTED] 
Enviada em: sexta-feira, 5 de novembro de 2004 07:25
Para: [EMAIL PROTECTED]
Assunto: [PHP-WIN] POST/GET problem

Hi,

I am not sure if this is the correct group for this problem, so apologies if
I have got this totally wrong.
I have just installed PHP5 on a Windows XP machine with IIS (PWS).

phpinfo() seems OK.

However, when I try the following test script:

name.html looks like:

<html>
<body>
<center>
<FORM METHOD="POST" ACTION="name2.php">
 <table>
        <tr>
                <th width="15%" nowrap><b>First Name</b></th>
                <td width="35%"><input type=text name = "name"></td>

                <th width="15%" nowrap><b>Last Name</b></th>
                <td width="35%"><input type=text name = "surname"></td>
        </tr>
 </table>
 <table>
   <INPUT TYPE="SUBMIT" VALUE="Submit" NAME="Submit">
   <INPUT TYPE="RESET" VALUE="Reset" NAME="Reset">
 </table>
</Form>
</center>
</body>
</html>

 and

name2.php looks like:
<html>
<body>
<?php

$surname=strtoupper($surname);

?>
<?php echo("<h3>Hello"),  $name, (" "), $surname, ("</h3>");?>
</body>
</html>

When I run the name.html script:

I get

Notice: Undefined variable: surname in c:\Inetpub\wwwroot\name2.php on line
5

Hello
Notice: Undefined variable: name in c:\Inetpub\wwwroot\name2.php on line 9

I think this works OK on PHP4 and Apache.

I have looked through the FAQ's etc. But I'm not sure if this is an idiot
fault or a configuration fault.

Is there a requirement to declare variables in PHP5 now?

Any suggestions please!

Thanks

Martyn

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

--- End Message ---
--- Begin Message ---
Thanks to Rafael and George (replied off list).

Problem sorted. There is absolutely *nothing* to beat community support.

Regards

Martyn
"Rafael Soares" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
You probably have register_globals turned off (this is a question of
security and performance).

You can turn it on changing your php.ini file, it's probably located in
C:\WINDOWS

Or try this in the beginning of your PHP file:

<?php

$name = $_POST['name'];
$surname = $_POST['surname'];

?>

Rafael Soares - Ag�nciaM
Fone:  +55 11 4616-1394

-----Mensagem original-----
De: Martyn Kinder [mailto:[EMAIL PROTECTED]
Enviada em: sexta-feira, 5 de novembro de 2004 07:25
Para: [EMAIL PROTECTED]
Assunto: [PHP-WIN] POST/GET problem

Hi,

I am not sure if this is the correct group for this problem, so apologies if
I have got this totally wrong.
I have just installed PHP5 on a Windows XP machine with IIS (PWS).

phpinfo() seems OK.

However, when I try the following test script:

name.html looks like:

<html>
<body>
<center>
<FORM METHOD="POST" ACTION="name2.php">
 <table>
        <tr>
                <th width="15%" nowrap><b>First Name</b></th>
                <td width="35%"><input type=text name = "name"></td>

                <th width="15%" nowrap><b>Last Name</b></th>
                <td width="35%"><input type=text name = "surname"></td>
        </tr>
 </table>
 <table>
   <INPUT TYPE="SUBMIT" VALUE="Submit" NAME="Submit">
   <INPUT TYPE="RESET" VALUE="Reset" NAME="Reset">
 </table>
</Form>
</center>
</body>
</html>

 and

name2.php looks like:
<html>
<body>
<?php

$surname=strtoupper($surname);

?>
<?php echo("<h3>Hello"),  $name, (" "), $surname, ("</h3>");?>
</body>
</html>

When I run the name.html script:

I get

Notice: Undefined variable: surname in c:\Inetpub\wwwroot\name2.php on line
5

Hello
Notice: Undefined variable: name in c:\Inetpub\wwwroot\name2.php on line 9

I think this works OK on PHP4 and Apache.

I have looked through the FAQ's etc. But I'm not sure if this is an idiot
fault or a configuration fault.

Is there a requirement to declare variables in PHP5 now?

Any suggestions please!

Thanks

Martyn

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

--- End Message ---
--- Begin Message ---
Sorry, there was an error...

  if (!empty($_POST['surname']))
      $surname=strtoupper( $_POST['surname'] );
  else
     echo "Empty name";


Luis Moreira wrote:

Try reading the variable before you use it :-)
For best protection, see first if something went through...

   if (!empty($_POST['surname']))
       $surname=strtoupper($surname);
   else
      echo "Empty name";

Luis


Martyn Kinder wrote:

Hi,

I am not sure if this is the correct group for this problem, so apologies if
I have got this totally wrong.
I have just installed PHP5 on a Windows XP machine with IIS (PWS).


phpinfo() seems OK.

However, when I try the following test script:

name.html looks like:

<html>
<body>
<center>
<FORM METHOD="POST" ACTION="name2.php">
<table>
       <tr>
               <th width="15%" nowrap><b>First Name</b></th>
               <td width="35%"><input type=text name = "name"></td>

               <th width="15%" nowrap><b>Last Name</b></th>
               <td width="35%"><input type=text name = "surname"></td>
       </tr>
</table>
<table>
  <INPUT TYPE="SUBMIT" VALUE="Submit" NAME="Submit">
  <INPUT TYPE="RESET" VALUE="Reset" NAME="Reset">
</table>
</Form>
</center>
</body>
</html>

and

name2.php looks like:
<html>
<body>
<?php

$surname=strtoupper($surname);

?>
<?php echo("<h3>Hello"),  $name, (" "), $surname, ("</h3>");?>
</body>
</html>

When I run the name.html script:

I get

Notice: Undefined variable: surname in c:\Inetpub\wwwroot\name2.php on line
5


Hello
Notice: Undefined variable: name in c:\Inetpub\wwwroot\name2.php on line 9


I think this works OK on PHP4 and Apache.

I have looked through the FAQ's etc. But I'm not sure if this is an idiot
fault or a configuration fault.


Is there a requirement to declare variables in PHP5 now?

Any suggestions please!

Thanks

Martyn




--- End Message ---
--- Begin Message ---
Hey

 

I would like to run  "./beta/x.exe" on local machine using php

 

Ie have a link "click to install locally" which points to the file and runs
it(without bringing up the download or save as dialog).

 

Thanks


--- End Message ---
--- Begin Message --- Why would you want to do this? Blindly installing applications from web links is *a bad idea* and dialog boxes are there to help protect users. Heck from the way you asked your question I'm not even sure - are you the user or the provider? Give us a little more than this to go on and we'll see if we can't help you out more.
--- End Message ---
--- Begin Message ---
PclZip
http://www.phpconcept.net/pclzip/index.en.php


Barbablu wrote:

Mauro Griffa ha scritto:
Ciao,
qualcuno sa come si pu� decomprimere un file zip presente sul server usando
uno script PHP?

grazie per l'aiuto
Mauro

Ciao,
per php5(come modulo)+apache2
1. guarda nella sottocartella '/ext' della tua distribuzione di php per file php_zip.dll

2. se fosse necessario scarica 'collection of PECL modules for php5.x.x' dalla pagina di download 'http://it.php.net/downloads.php' e decomprimi php_zip.dll nella tua cartella delle estensioni

3. aggiungi stringa extension=php_zip.dll (c:windowsphp.ini)

4. riavvia apache

5. pronto, MA:

6. nel caso pi� comune tuo_script.php e tuo_arcivio.zip si trovano nella stessa cartella. funzione zip_open('tuo_arcivio.zip') ti communica 'Warning: zip_open() [function.zip-open]: Cannot open zip archive...'

7. devi usare zip_open(getcwd().'tuo_arcivio.zip')

funziona:)

--- End Message ---
--- Begin Message ---
   IN ENGLISH PLEASE!!!!!!!
 
   .PclZip
   .http://www.phpconcept.net/pclzip/index.en.php
 
   .Barbablu wrote:
 
   .> Mauro Griffa ha scritto:
   .>> Ciao,
   .>> qualcuno sa come si pu? decomprimere un file zip presente sul server
   usando
   .>> uno script PHP?
   .>>
   .>> grazie per l'aiuto
   .>> Mauro
 
   .> Ciao,
   .> per php5(come modulo)+apache2
   .> 1. guarda nella sottocartella '/ext' della tua distribuzione di php per
   .> file php_zip.dll
 
   .> 2. se fosse necessario scarica 'collection of PECL modules for
   php5.x.x'
   .> dalla pagina di download 'http://it.php.net/downloads.php' e decomprimi
   .> php_zip.dll nella tua cartella delle estensioni
 
   .> 3. aggiungi stringa extension=php_zip.dll (c:windowsphp.ini)
 
   .> 4. riavvia apache
 
   .> 5. pronto, MA:
 
   .> 6. nel caso pi? comune tuo_script.php e tuo_arcivio.zip si trovano
   nella
   .> stessa cartella. funzione zip_open('tuo_arcivio.zip') ti communica
   .> 'Warning: zip_open() [function.zip-open]: Cannot open zip archive...'
 
   .> 7. devi usare zip_open(getcwd().'tuo_arcivio.zip')
 
   .> funziona:)
 
   .--
   .PHP Windows Mailing List (http://www.php.net/)
   .To unsubscribe, visit: http://www.php.net/unsub.php
 
   .---------------------------------------------------------------
   .Castiga un telefon cu Personalitate! Exclusiv pentru femei, exclusiv pe
   ele.ro!


---------------------------------------------------------------
Castiga un telefon cu Personalitate! Exclusiv pentru femei, exclusiv pe ele.ro!

--- End Message ---
--- Begin Message ---
Hi,

I have a master database and a customer-facing website and a staff-facing
website - both connecting to the same database. I use Smarty and PEAR::DB
and PHP5.

I have no problem connecting from one site, but the other just generates
'could not open database' on the home page. This is happening on the log-in
page.

I've checked the code and its virtually identical, except for the different
tables being queried. One works, one doesn't.

I use a config file to ease development/deployment:

"Config.php"
<?php
        if($_SERVER['SERVER_NAME']=='myserversite'){
                $incloc="c:\\inetpub\\wwwroot\\egret\\includes\\";
                $smartyloc="c:\\php\\Smarty\\";
                $incloc="c:\\inetpub\\wwwroot\\egret\\includes\\";
                $server_url="http://myserversite/egret/";;
        } else {
                $incloc="c:\\inetpub\\wwwroot\\egret\\includes\\";
                $smartyloc="c:\\php\\";
                $server_url="http://localhost/egret/";;
        }
        if((isset($_COOKIE['access'])&&$_COOKIE['access']=='')||(isset($_POST['acce
ss'])&&$_POST['access']=='')){
                header("Location: ".$server_url."home.php");
        }elseif(isset($_COOKIE['access'])&&$_COOKIE['access']!='') {
                $access = $_COOKIE['access'];
        }
        $dbhost = 'localhost';
        $dbuser = 'root';
        $dbpass = '';
        $dbname = 'egret';
        require_once( 'DB.php' );
        $db =& DB::connect( "mysql://$dbuser:[EMAIL PROTECTED]/$dbname" );
?>
============================================================================
======================
"home.php"
<?php
        include("includes/config.php");
        require $smartyloc."Smarty.class.php";
        $smarty    = new Smarty;

        $sql = "SELECT account_id, nickname FROM account";
        $loginResult = $db->query($sql);
        $recCount = $loginResult->numRows();
        $i=0;
        $results=array();
        while ($loginRow = $loginResult->fetchRow()) {
                        $tmp = array(
                        'id' => $loginRow[0],
                        'hei'=> $loginRow[1]
                        );
                        $results[$i++] = $tmp;
        }
        $db->disconnect();
        $smarty->assign('results', $results);
        $smarty->display('home.tpl');
?>
======================================================================
Am I missing something obvious?

Cheers

George in Oxford

--- End Message ---
--- Begin Message ---
I'm converting an entire site from .html and .shtml files to .php.
Unfortunately a lot of the internal pages have been bookmarked by users, and
so what I'd like to do is have a script that checks for the existence of a
.php file with the same name (e.g. the file used to be contacts.shtml and
now it is contacts.php) and redirects automatically.    I actually need to
do this both on an IIS machine as well as Linux - and presumably the method
will be different for each.

Anne

--- End Message ---
--- Begin Message ---
> I'm converting an entire site from .html and .shtml files to .php.
> Unfortunately a lot of the internal pages have been bookmarked by users,
> and
> so what I'd like to do is have a script that checks for the existence of a
> .php file with the same name (e.g. the file used to be contacts.shtml and
> now it is contacts.php) and redirects automatically.    I actually need to
> do this both on an IIS machine as well as Linux - and presumably the
> method
> will be different for each.

Hi Anne,

This probably isn't a terribly helpful suggestion, but one way of achieving
this would be to set your servers up so that .html and .shtml pages are
parsed as PHP and simply use a standard header("Location: etc") statement in
these pages to redirect to the new PHP page in question.

Much warmth,

Murray
http://www.planetthoughtful.org
Building a thoughtful planet,
One quirky comment at a time.

--- End Message ---
--- Begin Message ---
Hello,

I installed Apache 2.0.52 en PHP4.3.9 on a Windows XP SP2 machine.
Everything runs fine.
I also installed MySQL 4.1 and it also runs fine.

However when I try to connect to a exisiting database from within a PHP 
script it fails.

I followed several installation tutorials on the net but nu success sofar.

Any ideas?

Regards,

Jeroen 

--- End Message ---
--- Begin Message ---
> Hello,
>
> I installed Apache 2.0.52 en PHP4.3.9 on a Windows XP SP2 machine.
> Everything runs fine.
> I also installed MySQL 4.1 and it also runs fine.
>
> However when I try to connect to a exisiting database from within a PHP
> script it fails.
>
> I followed several installation tutorials on the net but nu success
> sofar.

#1 - what errors, if any are you getting

#2 - what kind of display ar you getting?

#3 - try this install dox
     http://web.torres.ws/dev/php/walters_way

     Works every time.

Walter

--- End Message ---
--- Begin Message ---
I don't know what problem could you have...please put some code, or error.
You can access to the database using the console of mysql?

Best Regards,

Alex
----- Original Message ----- 
From: "Jeroen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 05, 2004 2:52 PM
Subject: [PHP-WIN] Apache, PHP4, MySQL installation


> Hello,
>
> I installed Apache 2.0.52 en PHP4.3.9 on a Windows XP SP2 machine.
> Everything runs fine.
> I also installed MySQL 4.1 and it also runs fine.
>
> However when I try to connect to a exisiting database from within a PHP
> script it fails.
>
> I followed several installation tutorials on the net but nu success sofar.
>
> Any ideas?
>
> Regards,
>
> Jeroen
>
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I had a trouble involving MySQL 4.1.7 and PHP few days ago and received an
observation that may interest to you. 

Marc Lewis [mailto:[EMAIL PROTECTED] wrote:
> You need PHP5 to be able to access MySQL 4.1 - and you must use the 
> "mysqli" extension, not the "mysql" extension.
>
> Marc 

Note: I still using the mysql extensions/functions and it still working

Rafael Soares

--- End Message ---
--- Begin Message ---
Jeroen wrote:

Hello,

I installed Apache 2.0.52 en PHP4.3.9 on a Windows XP SP2 machine.
Everything runs fine.
I also installed MySQL 4.1 and it also runs fine.

However when I try to connect to a exisiting database from within a PHP script it fails.

I followed several installation tutorials on the net but nu success sofar.


If you received the error "Call to undefined function" when trying to use a mysql function in your PHP script, it probably means that your MySQL support is not enabled. To enable MySQL support, you need to:


1) Activate the extension. Find the line

extension=php_mysql.dll

in your php.ini file. If there is a ; in front of the line, remove it.

2) PHP needs to be able to find two files for MySQL support: php_mysql.dll and libmysql.dll. The simplest, if not most elegant, way to be sure PHP can find these files is to copy them into your system32 directory.

Janet



Any ideas?

Regards,

Jeroen



--
Janet Valade -- janet.valade.com

--- End Message ---
--- Begin Message ---
Warren Vail wrote:

Mike,

While that's not the only way to go somewhere else, if it is the way the
other guy wrote the code to get around, ripping it out an replacing it with
something else could be a problem.  The error message you are referring to
indicates that something was sent to the browser before it attempted to send
a header (usually used to get around).  One line number in the message
refers to a line of code that output something before the header function
was executed, the other to the line number of the header statement itself.

Most common causes of this is a debug message designed to show values of
variables during debug was executed before the header statement.  Solution:
either fix the bug and remove the debug display (usually an echo), or remove

Good suggestion here. I'd also add that you can set up error logs, automated email messages (send these in batches, you just never know when one error is going to send 1,000 messages to you) and such to keep yourself informed whenever there are errors.

--- End Message ---
--- Begin Message ---
My script is like this
*****************************************************
<?php
echo "Starting the program!!!";

$cmd = "\"C:\MATLAB6p5\bin\win32\matlab.exe\" /nosplash /nodesktop /r -c
E:\\SSN\\cognetics\\amp_fit_power_with_mex\\test2.m";
exec($cmd,$output,$rv);

echo "program started!!!";
?>
******************************************************

I have never used Matlab (sorry), but I'm guessing Matlab requires interactive usage? If the answer to this question is "yes", then PHP is going to hang because it's waiting on Matlab to finish exec()'ing, but Matlab will be waiting for PHP to interact with it. I'm not aware of a solution to this problem.


Or is this more like a filter in the pipeline and $cmd should be producing some kind of output for the browser?
--- End Message ---

Reply via email to