php-windows Digest 3 Oct 2002 10:08:00 -0000 Issue 1369

Topics (messages 16134 through 16141):

Re: i need help with an undefined variable
        16134 by: Luis Ferro
        16138 by: Anyang
        16139 by: Uttam

Number of bytes in a field?
        16135 by: Kieran Hall
        16136 by: Cam Dunstan

Re: PHP & sendmail
        16137 by: Manuel Lemos

Re: apche loadmodule php help.
        16140 by: Seung Hwan Kang

Re: Connecting to MS SQLserver problem??
        16141 by: M.B.

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 ---
You should test first for the existence of the var before using it...

a better code would be:

<?php

@include("head.html");

if (!isset($_GET["game"])) {
    @include("public.html");
}

?>

You should test for the existence of the var instead of using it's value 
in a condition... otherwise you will get a warning for each that you use 
without a previous definition...

Cheers...
Luis Ferro



<?php

>>>include("head.html");
>>>      
>>>
if (isset()

>>>if (!$_GET["game"]) {
>>>include("public.html");
>>>}
>>>if ($_GET["game"] != NULL && $op != NULL) {
>>>include("http://mywebsite.com/example/"; . "$game" . ".html");
>>>}
>>>



Peter Houchin wrote:

>have u tried using $_GET["game"] or $_POST["game"] ? so your code is
>
><?php
>  
>
>>>>include("head.html");
>>>>
>>>>if (!$_GET["game"]) {
>>>>include("public.html");
>>>>}
>>>>if ($_GET["game"] != NULL && $op != NULL) {
>>>>include("http://mywebsite.com/example/"; . "$game" . ".html");
>>>>}
>>>>        
>>>>
>
>or post instead of get in there?
>
>  
>
>>-----Original Message-----
>>From: Anyang [mailto:[EMAIL PROTECTED]]
>>Sent: Wednesday, 2 October 2002 1:43 PM
>>To: [EMAIL PROTECTED]
>>Subject: Re: [PHP-WIN] i need help with an undefined variable
>>
>>
>>Like i said, the other server understood it at a function of the
>>address bar
>>so if index.php?game=foobar then $game = foobar and it would refresh the
>>page with the foobar page in the center.  This is what I want to do.
>>
>>"Peter Houchin" <[EMAIL PROTECTED]> wrote in message
>>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>    
>>
>>>how r u getting $game? that's the undefind var.
>>>
>>>      
>>>
>>>>-----Original Message-----
>>>>From: Anyang [mailto:[EMAIL PROTECTED]]
>>>>Sent: Wednesday, 2 October 2002 11:38 AM
>>>>To: [EMAIL PROTECTED]
>>>>Subject: [PHP-WIN] i need help with an undefined variable
>>>>
>>>>
>>>>I wrote a php script for a page that I hosted on a separate
>>>>        
>>>>
>>host and it
>>    
>>
>>>>worked perfectly.  I recently installed php 4 onto my windows XP Pro
>>>>        
>>>>
>>build
>>    
>>
>>>>2600 computer and it seems to work until I try to use varuables
>>>>that look to
>>>>the address bar for reference.
>>>>
>>>>I wanted to make it so that when somebody clicks "game" it would go to
>>>>www.mywebsite.com/index.php?game=example and that would merely replace
>>>>        
>>>>
>>the
>>    
>>
>>>>body with the example page.  It worked on my other host but when
>>>>I tried it
>>>>on my computer it says:
>>>>
>>>>Notice: Undefined variable: game in
>>>>        
>>>>
>>C:\Xitami\webpages\index.php on line
>>5
>>    
>>
>>>>Notice: Undefined variable: game in
>>>>        
>>>>
>>C:\Xitami\webpages\index.php on line
>>8
>>    
>>
>>>>My script says:
>>>>
>>>><?php
>>>>
>>>>include("head.html");
>>>>
>>>>if (!$game) {
>>>>include("public.html");
>>>>}
>>>>if ($game != NULL && $op != NULL) {
>>>>include("http://mywebsite.com/example/"; . "$game" . ".html");
>>>>}
>>>>
>>>>
>>>>any ideas?  please help.  if there's any script i can type and
>>>>have all the
>>>>pages require it so that this can be defined that would work great.
>>>>
>>>>
>>>>
>>>>--
>>>>PHP Windows Mailing List (http://www.php.net/)
>>>>To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>>>        
>>>>
>>
>>--
>>PHP Windows Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>    
>>
>
>
>  
>



---
[This E-mail scanned for viruses by Declude Virus]

--- End Message ---
--- Begin Message ---
thanks for the help.  got it to work
"Brother - Martin Bagge" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Anyang:
>
> > it's giving me this now:
> > Notice: Undefined index: game in C:\Xitami\webpages\index.php on line
> > 5 Notice: Undefined index: game in C:\Xitami\webpages\index.php on
> > line 8
> >
> > because i'm opening index.php without using ?game=
> > is there anything I can do to not get it to say that?  it's not
> > reading $_GET["game"] as NULL but as undefined instead.
>
>
> if (!isset($_GET["game"])) {
> $game = "?"; //well what was an expected situation for requests without
game
> var?
> } else {
> $game = $_GET["game"];
> }
>
> then carry on with the code.
>


--- End Message ---
--- Begin Message ---
this is due to 'register_globals' is off by default in php 4.  this is for
security reasons.  pls. use $game as $_GET['game'].  alternatively you can
turn on 'register_globals' in php.ini (not recommended).

regds,

-----Original Message-----
From: Anyang [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 02, 2002 07:08
To: [EMAIL PROTECTED]
Subject: i need help with an undefined variable


I wrote a php script for a page that I hosted on a separate host and it
worked perfectly.  I recently installed php 4 onto my windows XP Pro
build
2600 computer and it seems to work until I try to use varuables that
look to
the address bar for reference.

I wanted to make it so that when somebody clicks "game" it would go to
www.mywebsite.com/index.php?game=example and that would merely replace
the
body with the example page.  It worked on my other host but when I tried
it
on my computer it says:

Notice: Undefined variable: game in C:\Xitami\webpages\index.php on line
5

Notice: Undefined variable: game in C:\Xitami\webpages\index.php on line
8

My script says:

<?php

include("head.html");

if (!$game) {
include("public.html");
}
if ($game != NULL && $op != NULL) {
include("http://mywebsite.com/example/"; . "$game" . ".html");
}


any ideas?  please help.  if there's any script i can type and have all
the
pages require it so that this can be defined that would work great.



--- End Message ---
--- Begin Message ---
Does anyone know of a way to get the number of bytes from a mysql field?
 
 
*********************************************************************
Kieran Hall 
********************************************************************* 
 
--- End Message ---
--- Begin Message ---
kieran, try this ...


$fieldresult =  mysql_list_fields($some_database, $some_table); 
$fieldcount =  mysql_num_fields($fieldresult);

for ($my_counter = 0; $my_counter < $fieldcount; $my_counter++} {
$fieldsize = mysql_field_len($fieldresult, $my_counter); 

echo "fieldsize = ".$fieldsize;
echo "<br>";

}

other useful field informatiomn functions are ...

$fieldname = mysql_field_name($fieldresult, $my_counter);    
$fieldtype = mysql_field_type($fieldresult, $my_counter); 





----- Original Message ----- 
From: "Kieran Hall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 03, 2002 7:26 AM
Subject: [PHP-WIN] Number of bytes in a field?


> Does anyone know of a way to get the number of bytes from a mysql field?
>  
>  
> *********************************************************************
> Kieran Hall 
> ********************************************************************* 
>  
> 

--- End Message ---
--- Begin Message ---
On 10/02/2002 06:22 PM, Nicole wrote:
> Hello,
> 
> Would someone give me an example of using sendmail from PHP instead of the
> usual mail() function.

Here you may find a PHP class that does that. It even comes with 
functions that emulate mail() using the sendmail program directly, 
qmail-inject program or an SMTP server.

http://www.phpclasses.org/mimemessage

-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
If your PHP is located to c:\php, you can do this way to configue httpd.conf

using apache 1.3.x
LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c

# To use PHP scripts
#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Using apache 2.0.x

LoadModule php4_module c:/php/sapi/php4apache2.dll

# To use PHP scripts
#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

If it doesn't work you need to (fresh) install your apache  (please do not
reinstall it over your old apache configures).  Make sure you make a backup
for htdocs directory, and delete all other directories by yourself
(manually).  Then replace back your htdocs to your new apache.

That's it.

"Steve Bradwell" <[EMAIL PROTECTED]> wrote in message
57A1618E7109D311A97D0008C7EBB3A10132B144@KITCHENER">news:57A1618E7109D311A97D0008C7EBB3A10132B144@KITCHENER...
> Hello all,
>
> I am in the process of changing my win 98 box to a 2000 box and am also
> upgrading from apache 1.3.23 to 1.3.26. Unfortunatly I took the easy route
> and simply copied my old httpd.conf file over the existing httpd.conf. All
> is fine except Apache has a problem with the line:
>
> "LoadModule php4_module c:/Program
> Files/Apache/Apache/php/sapi/php4apache.dll"
>
> Apache says "Load module takes 2 arguments..."
>
> Can anyone help me with what I have done wrong? This works with 1.3.23 but
> not with 1.3.26, do I need some kind of seperator in this line to specify
> that it is 2 arguments?
>
> Thanks alot,
> Steve.
>


--- End Message ---
--- Begin Message ---
Are you shore you database is running correctly at the time you are using
the script, beacuse I had a problemm with that too.
I changed my ini.php and after I changed it back, my mysql databse would
give green light (working) but when I toke a closer look, there was no
database to be found and so on.
I got the same message as you got.

M.B.
"Gard RøDahl" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Well, I got to the point now where it loads the DLL.
> But in the script page when i try to connect to a MS SQL server I get the
> error message:
>     Fatal error: Call to undefined function: mssql_connect()
>
> Know any reasons why the function call fails?
>
> Thanks, Gard
>
>
> "Lukas Boldrino" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > try ODBC or set a timeout spezifikation in your scripts
> > "Gard RøDahl" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I'm trying to connect to a mssqlserver from PHP, i have got the
> > > php_mssql.dll and this one has
> > > also been untagged in the php.ini file.
> > > But for some reason does ALL the php scripts timeout when the
> > php_mssql.dll
> > > is being setup in
> > > the .ini file. I'm running the php.exe from c:/PHP through ISAPI in
> IIS5,
> > > and i've put the php_mssql.dll file in the same dir.
> > > The ntwdblib.dll is also present in the system32 folder.
> > >
> > > Any ideas? Have I missed something here?
> > >
> > > Gard
> > >
> > >
> > >
> >
> >
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.393 / Virus Database: 223 - Release Date: 30.09.2002
>
>


--- End Message ---

Reply via email to