php-windows Digest 13 Apr 2001 16:57:35 -0000 Issue 542

Topics (messages 6688 through 6709):

Funny errors with IF
        6688 by: Howard Picken
        6690 by: Olivier Hubert
        6706 by: John Lim

Re: php 4 crashes apache for windows
        6689 by: Yasuo Ohgaki

MSSQL + IIS
        6691 by: André M.S.
        6702 by: Johannes Janson

headers
        6692 by: lars Eirik Rønning
        6693 by: Plutarck
        6700 by: Piotr Pluciennik

Re: pb with register_globals
        6694 by: Plutarck

Session Variables With Spaces
        6695 by: Eric Pankoke
        6697 by: Eric Pankoke

A sendmail for local testing?
        6696 by: Plutarck

Re: cgi error solved
        6698 by: Ivan Pavlovic
        6709 by: Rehuel Lobato

mysql & ODBC Data source
        6699 by: Ivan Pavlovic
        6705 by: John Lim
        6707 by: John Lim

Re: Exec()
        6701 by: Patrick
        6708 by: Helmut Himmelstoss

Re: I want create a FLASH file (swf) with PHP with EasyPhp win WINDOWS98
        6703 by: Johannes Janson

Re: PHP Editor
        6704 by: Nasko

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]


----------------------------------------------------------------------


Just starting to learn PHP/MySQL and having problems with "undefined
variable" errors.

All the pages I've created from tutorials give me errors on "some" of the if
statements.

Example 1

<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);

if ($submit) {
  // here if no ID then adding else we're editing
  if ($id) {...

where id is the first field of  mydb. Using other pages I can see that the
id is there in the mydb file. I also get the same error for "if ($submit..."

Example 2

<?php

$seperator = stripslashes($seperator);
$seperator = stripcslashes($seperator);
if (!$seperator)
   $seperator = ",";


if (!$send) {
?>

....etc

I get errors on if (!$sep...  etc and on if (!$send... etc

Running Win98SE, Apache 1.3.x, MySQL 3.xx and PHP 4.04

Anyone have any ideas?






Hi,

>if ($submit) {
>  // here if no ID then adding else we're editing
>  if ($id) {...
>
>where id is the first field of  mydb. Using other pages I can see that the
>id is there in the mydb file. I also get the same error for "if ($submit..."

        Ok, I may be wrong here as I'm no PHP expert, but from my limited
experience with MySQL I know you can't just reference fields in the
database like this. You have to first fetch them using mysql_fetch_array or
mysql_fetch_row (or something equivalent). And then you can use/call them
with the appropriate array index (e.g. Array[0] or Array["Key"] depending
on the type of array you choose)

Hope this helps,

Olivier




Before you can use any variable, you need to set it to value first. I don't
know where you got these examples from, but I believe the authors presume
that you have initialised the variables somewhere else.

If you are learning php, i suggest you use simpler examples, as these
examples probably assume advanced knowledge. I like the tutorials at
http://devshed.com/ myself.


""Howard Picken"" <[EMAIL PROTECTED]> wrote in message
9b5f1s$9j3$[EMAIL PROTECTED]">news:9b5f1s$9j3$[EMAIL PROTECTED]...
> Just starting to learn PHP/MySQL and having problems with "undefined
> variable" errors.
>
> All the pages I've created from tutorials give me errors on "some" of the
if
> statements.
>
> Example 1
>
> <?php
> $db = mysql_connect("localhost", "root");
> mysql_select_db("mydb",$db);
>
> if ($submit) {
>   // here if no ID then adding else we're editing
>   if ($id) {...
>
> where id is the first field of  mydb. Using other pages I can see that the
> id is there in the mydb file. I also get the same error for "if
($submit..."
>
> Example 2
>
> <?php
>
> $seperator = stripslashes($seperator);
> $seperator = stripcslashes($seperator);
> if (!$seperator)
>    $seperator = ",";
>
>
> if (!$send) {
> ?>
>
> ....etc
>
> I get errors on if (!$sep...  etc and on if (!$send... etc
>
> Running Win98SE, Apache 1.3.x, MySQL 3.xx and PHP 4.04
>
> Anyone have any ideas?
>
>
>
> --
> 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]
>






How about re-install them? PHP4.0.5RC(SAPI)/Apahce1.3.19/W2K works fine for me. I guess you skipped some step during installation. Regards, -- Yasuo Ohgaki ""Darren"" <[EMAIL PROTECTED]> wrote in message 9b2447$406$[EMAIL PROTECTED]">news:9b2447$406$[EMAIL PROTECTED]... > Hi all. I have a problem with apache running PHP. I config it as stated in > the instructions but when i boot apache, i get a > > APACHE caused an invalid page fault in module APACHECORE.DLL at > 0167:10010d35. > > this disappears when i comment out the > "LoadModule php4_module /perl/bin/sapi/php4apache.dll" > > and yet reappears when i remove the comment. Any ideas? > Thanks > > > > > -- > 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] >



How can i use MSSQL + IIS?
i´m having some problems...

tks








<André M.S. <[EMAIL PROTECTED] ( )> schrieb im Newsbeitrag
9b5fv9$il6$[EMAIL PROTECTED]">news:9b5fv9$il6$[EMAIL PROTECTED]...
> How can i use MSSQL + IIS?
> i´m having some problems...
>
well then describe the problems. it's hard to
solve one if you don't know what it is.

Johannes






I was wondering if anyone knows about any good links to both email headers as well as 
document headers to be used with a php script. Mime types would also be appreciated

Thanks 
Lars E




I'd really like a list of headers for mail :)

But at least I found this:

http://www.shopthenet.net/publiclibrary/CIE/RFC/index.htm

It's a list of RFCs. The one of interest to your query, that I know of at
the moment:

http://www.shopthenet.net/publiclibrary/CIE/RFC/2068/155.htm


--
Plutarck
Should be working on something...
...but forgot what it was.


"lars Eirik Rønning" <[EMAIL PROTECTED]> wrote in message
000e01c0c3b3$344e8fa0$d8eed9c1@default">news:000e01c0c3b3$344e8fa0$d8eed9c1@default...
I was wondering if anyone knows about any good links to both email headers
as well as document headers to be used with a php script. Mime types would
also be appreciated

Thanks
Lars E







Hi,

you can find this informations in RFC's - especially
concerning HTTP headers in rfc2616 at:
http://www.w3.org/Protocols/rfc2616/rfc2616

You can download all RFCs you want from
http://www.rfc-editor.org/download.html

Greetings

Piotr


--- lars_Eirik_Rønning <[EMAIL PROTECTED]> wrote: >
I was wondering if anyone knows about any good links
> to both email headers as well as document headers to
> be used with a php script. Mime types would also be
> appreciated
> 
> Thanks 
> Lars E
> 


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie




Not dirrectly related to sessions, but you might enjoy the following piece
of code:

$f = 'HTTP_' . $HTTP_SERVER_VARS["REQUEST_METHOD"] . '_VARS';


Then if someone submits the field "username" you can refer to it as
${$f}["username"], and it will work if they used POST or GET.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Barraud, Stéphane"" <[EMAIL PROTECTED]> wrote in
message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> I'm using PHP 4.0.4pl1 on windows as CGI.
> I try to avoid to use register_globals = On.
> In my script I use only $HTTP_*_VARS variables to access forms fields.
>
> The problem is when I set register_globals = Off in php.ini, the session
is
> not working any more, loosing session variables content.
>
> Should I consider this as a bug ?
>
> Steph
>
>






I have two php pages using session variables.  One redirects to itself 
after refreshing the variables, and the other redirects to a second php 
page, retrieves some values into the session variables, and then returns to 
the first page.  The one that redirects to itself works fine.  The one that 
calls an intermediate page truncates session variables at the first space 
when returning back to the original page.  Any thoughts on what causes this 
would be much appreciated.


Eric Pankoke
Point Of Light Software
"Lighting The Path To Glory"
http://www.polsoftware.com/





My mistake.  I should have looked into this a little bit more before I 
posted a message about it.  It turns out that my HTML was the problem, not 
the PHP session variables.  When I was writing out the text controls I was 
writing the tag as value=variable instead of value="variable", which was 
causing the display to cut off at the first space.

At 10:24 PM 4/12/01 -0500, Eric Pankoke wrote:
>I have two php pages using session variables.  One redirects to itself 
>after refreshing the variables, and the other redirects to a second php 
>page, retrieves some values into the session variables, and then returns 
>to the first page.  The one that redirects to itself works fine.  The one 
>that calls an intermediate page truncates session variables at the first 
>space when returning back to the original page.  Any thoughts on what 
>causes this would be much appreciated.
>
>
>Eric Pankoke
>Point Of Light Software
>"Lighting The Path To Glory"
>http://www.polsoftware.com/
>
>
>--
>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]





I have PHP (as CGI) setup with Apache on my Windows 98 system to test out my
applications locally, and I would like to be able to test out my uses of the
mail functions too.

Could someone please point me in the direction of what software I have to
get/use/enable to use sendmail locally? I know about the php.ini directives
and all, but that's not very useful if you don't have anything for it to
point too :)


--
Plutarck
Should be working on something...
...but forgot what it was.








I found the problem. When I installed the php for the first time, i set in
php.ini file under the line (doc_root ), root to the local site
directory(e:\\..........). Thanks for help.


I have another question. When I open the page in  IE the page seem's to be
locked and I can't edit it or do anything.
Changing to another site in IE do the trick.
Can I do something to keep files from locking. ??


----- Original Message -----
From: "Rehuel Lobato de Mesquita" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 12, 2001 1:52 PM
Subject: Re: [PHP-WIN] cgi error


> Hey Ivan, I had the same problem less then 24 hours ago!
>
> first, I think you need my submission of yesterday (5 messages down) look
at
> the replies.
> Make sure the properties of the folder you change to are changed too.
>
> 1. The url needs to be correct
>
> 2. Make sure the path is correctly changed to the new location in the
sites
> properties in IIS (Site properties, virtual directory tab, local path!!)
>
> 3. Same window--> click on Configuration.... Make sure .php is in the
list.
>
> 4. The permissions should be in place (IUSR_MACHINE may not have
sufficient
> rights to access the "new" directory!) So, Select the "Directory
structure"
> Tab, click on edit for Anonymous access and autentication control. The you
> edit anonymous access. I personlally chose the username I use to log on to
> the computer, and then allow IIS to control Password.
>
> I think that should do the trick! At least, it did the trick for me!!
>
> I like to hear back from you!
>
> Rehuel
>






Hey Ivan,

Most programs don't allow you to edit programs that are already open, or "in
use".When you are viewing a page in IE, that file is "In Use", so your
editor will usually not save the file. Most of the time, you can edit the
file, but you cannot save it, cause it's open! That explains "unlocking" it
when browsing to another page!

Hope that answers your question!
:-)

Rehuel






Hi
I need to install mysql but I have the problem. On the same computer I have some web 
aplications and they use only the ODBC Data Sources from Windows NT.
For example when I install Office 2000, ODBC Data Source  has been upgraded and the 
aplications didn't work anymore. 
My question is will the instalation of Mysql do something to ODBC Data Source  ??




Hi ivan,

No mysql does not modify odbc.

But you can download the mysql odbc driver from http://mysql.com if u need
such a driver.

Regards, John

""Ivan Pavlovic"" <[EMAIL PROTECTED]> wrote in message
006001c0c3f4$bc2323f0$[EMAIL PROTECTED]">news:006001c0c3f4$bc2323f0$[EMAIL PROTECTED]...
Hi
I need to install mysql but I have the problem. On the same computer I have
some web aplications and they use only the ODBC Data Sources from Windows
NT.
For example when I install Office 2000, ODBC Data Source  has been upgraded
and the aplications didn't work anymore.
My question is will the instalation of Mysql do something to ODBC Data
Source  ??







Oh forgot to mention that you don't need ODBC to connect PHP to MySQL. The
MySQL client libraries are built into PHP already.

Regards, John

""Ivan Pavlovic"" <[EMAIL PROTECTED]> wrote in message
006001c0c3f4$bc2323f0$[EMAIL PROTECTED]">news:006001c0c3f4$bc2323f0$[EMAIL PROTECTED]...
Hi
I need to install mysql but I have the problem. On the same computer I have
some web aplications and they use only the ODBC Data Sources from Windows
NT.
For example when I install Office 2000, ODBC Data Source  has been upgraded
and the aplications didn't work anymore.
My question is will the instalation of Mysql do something to ODBC Data
Source  ??








""Guido E. Smit"" <[EMAIL PROTECTED]> wrote in message
9b4tur$6ah$[EMAIL PROTECTED]">news:9b4tur$6ah$[EMAIL PROTECTED]...
> I have the same problem, running W2K and IIS5:
> print "<HTML>\n";
>  exec('LUII.exe rpc3.ingrammicro.com 058DY12 1', $returnstring,
$returnvar);
>  print "Return var: ".$returnvar."<BR>\n";
>  print "Printing output ".count($returnstring)." lines:<BR>\n";
>  print "<PRE>\n";
>  while (list($line, $text) = each($returnstring))
>  {
>   print "$line $text<BR>\n";
>  }
>  print "</PRE>\n";
>
> works fine on the commandline. In a browser no value returned at all. Even
> the array stays empty (0).
> Logs are clean. No errors, nothing. I'm allmost desperate.
>
>
> --
Guido Smit
while I dont have IIS this sounds like a permission problem because
you can run it from the command prompt.
However you may want to try full tags if using NS it will not load the page
unless the <html><body></body></html> tags are there.

<?
print "<HTML>\r\n";
print "<HEAD>\r\n";
print "<TITLE> New Document </TITLE>\r\n";
print "</HEAD>\r\n";
print "<BODY>\r\n";

 exec('copy c:\\monsys.zip d:\\', $returnstring, $returnvar);
 print "Return var: ".$returnvar."<BR>\r\n";
 print "Printing output ".count($returnstring)." lines:<BR>\r\n";
 print "<PRE>\r\n";
 while (list($line, $text) = each($returnstring))
 {
  print "[$line] $text<BR>\r\n";
 }
 print "</PRE>\r\n";
print "</BODY>\r\n";
print "</HTML>\r\n";
?>

output...
Return var: 0
Printing output 1 lines:

[0]         1 file(s) copied

Have fun I am








I think, it is a problem of my Win2k and IIS5.

Wenn i use the script

<?
 system('ping 127.0.01 >c:\\ping.txt' , $returnstring);
?>

then I get a textfile with the right result:
---------------------------------------------
    Ping wird ausgefhrt fr 127.0.0.1 mit 32 Bytes Daten:
    Antwort von 127.0.0.1: Bytes=32 Zeit<10ms TTL=128
    Antwort von 127.0.0.1: Bytes=32 Zeit<10ms TTL=128
    Antwort von 127.0.0.1: Bytes=32 Zeit<10ms TTL=128
    Antwort von 127.0.0.1: Bytes=32 Zeit<10ms TTL=128

    Ping-Statistik fr 127.0.0.1:
        Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0 (0% Verlust),
        Ca. Zeitangaben in Millisek.:
        Minimum = 0ms, Maximum =  0ms, Mittelwert =  0ms
---------------------------------------------

THX for your help, but i must live with this f*** result.








Hi,

I think the source of the libswf is not free and thus there ist
no version for windows. but at http://www.opaque.net/ming/
you can find a c library which is *supposed* to do the same
thing like the libswf. I didn't try it.

cheers
Johannes

""cecchini"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
9b2il1$ept$[EMAIL PROTECTED]">news:9b2il1$ept$[EMAIL PROTECTED]...
> I want create a FLASH file (swf) with PHP with EasyPhp win WINDOWS98.
>
> I don't use the swf functions (I tried to find php_swf.dll but i don't
found
> it).
>
> Can someone help me?
>
> Thanks a lot from ITALY near VENICE.
>
> Alex
>
>
>
> --
> 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]
>






Well, it's good but doesn't have as many features as the other editors
have - for example I cannot search in files in a given directory, i
cannot perform a regex search etc. EditPlus has these all. One thing
phped is better at is that when you type the name of a variable in a
string it "knows" when to extend it and when not to - most of the
other editors never extend variables inside strings.
Currently i'm using editplus but thanks to this discussion i noticed
the names of several other programs which i never heard of and since
i'm not stating that editplus is the best there can be i'll give them
a try ;-)


""Jude Sanglitan"" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
>
>
> I am using PHPEd, is it good? Well for me it is good. But still I
need your
> advice too!.
>





Reply via email to