php-windows Digest 19 Nov 2002 14:48:58 -0000 Issue 1448

Topics (messages 17020 through 17035):

Re: parse error
        17020 by: Howard, Robert P
        17024 by: zeus
        17025 by: Dash McElroy
        17032 by: Charles P. Killmer
        17033 by: zeus
        17034 by: Stephen Edmonds
        17035 by: Cam Dunstan

Web Crawler
        17021 by: Jeremy Wilson
        17022 by: Jeremy Wilson

Re: w2k + sp3 + php 4.2.3
        17023 by: Jeremy Wilson

What's wrong ;(
        17026 by: _GeS_
        17027 by: Steel

Have fun! 3 Days for free!  or for one month! every day 24 hours!
        17028 by: hotstuff.jonnycam.zapto.org

PHP variable
        17029 by: F.Anneveld
        17030 by: George Nicolae
        17031 by: Stephen Edmonds

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 ---
change your else($submit) statement to else

-----Original Message-----
From: zeus [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 20 November 2002 4:25 AM
To: phpwin
Subject: [PHP-WIN] parse error


i get parse error with this code, what's wrong with the code? i think i 
have give the "else" statement  in ther right way.
help,neet it so bad.....

Thanks....

===========================================
<form action="<? echo $PHP_SELF ?>" method="post">

<?PHP
/////////////////////
//configure       ///
/////////////////////
require("config.php");

/////////////////////
//connect ke mysql///
/////////////////////
mysql_connect($db_host,$db_user,$db_pass) or die ("cannot connect");
@mysql_select_db($db_base) or die ("cannot select db");


if($submit)//kalo tombol submit belum di tekan
{
    $result=mysql_query("SELECT * from balon_chara");
    while($r=mysql_fetch_array($result))//loop
    {
    $chara_id=$r["chara_id"];
    $judul=$r["judul"];
    ?>
           <input type="radio" name="chara_id" value="<? echo $id; ?>">
           <? echo $id; ?>
           <? echo $judul; ?><br>
    <?}?>
           <input type="submit" name="submit" value="submit"></form>
    <?}?>

<?
else($submit)
    {
    $sql = "DELETE FROM balon_chara WHERE chara_id='$chara_id'";
    $result = mysql_query($sql);
    echo "recold deleted";
    }
?>



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

#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal
#####################################################################################
--- End Message ---
--- Begin Message ---
Nope! i try that one too, but  the parse error thing still exist....


Howard, Robert P wrote:

change your else($submit) statement to else

-----Original Message-----
From: zeus [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 20 November 2002 4:25 AM
To: phpwin
Subject: [PHP-WIN] parse error


i get parse error with this code, what's wrong with the code? i think i have give the "else" statement in ther right way.
help,neet it so bad.....

Thanks....

===========================================
<form action="<? echo $PHP_SELF ?>" method="post">

<?PHP
/////////////////////
//configure ///
/////////////////////
require("config.php");

/////////////////////
//connect ke mysql///
/////////////////////
mysql_connect($db_host,$db_user,$db_pass) or die ("cannot connect");
@mysql_select_db($db_base) or die ("cannot select db");


if($submit)//kalo tombol submit belum di tekan
{
$result=mysql_query("SELECT * from balon_chara");
while($r=mysql_fetch_array($result))//loop
{
$chara_id=$r["chara_id"];
$judul=$r["judul"];
?>
<input type="radio" name="chara_id" value="<? echo $id; ?>">
<? echo $id; ?>
<? echo $judul; ?><br>
<?}?>
<input type="submit" name="submit" value="submit"></form>
<?}?>

<?
else($submit)
{
$sql = "DELETE FROM balon_chara WHERE chara_id='$chara_id'";
$result = mysql_query($sql);
echo "recold deleted";
}
?>






--- End Message ---
--- Begin Message ---
What line number are you getting the parse error at? It's amazing what
that can tell you.

-Dash

On Tue, 19 Nov 2002, zeus wrote:

> Nope! i try that one too, but  the parse error thing still exist....
>
>
> Howard, Robert P wrote:
>
> >change your else($submit) statement to else
> >
> >-----Original Message-----
> >From: zeus [mailto:[EMAIL PROTECTED]]
> >Sent: Wednesday, 20 November 2002 4:25 AM
> >To: phpwin
> >Subject: [PHP-WIN] parse error
> >
> >
> >i get parse error with this code, what's wrong with the code? i think i
> >have give the "else" statement  in ther right way.
> >help,neet it so bad.....
> >
> >Thanks....
> >
> >===========================================
> ><form action="<? echo $PHP_SELF ?>" method="post">
> >
> ><?PHP
> >/////////////////////
> >//configure       ///
> >/////////////////////
> >require("config.php");
> >
> >/////////////////////
> >//connect ke mysql///
> >/////////////////////
> >mysql_connect($db_host,$db_user,$db_pass) or die ("cannot connect");
> >@mysql_select_db($db_base) or die ("cannot select db");
> >
> >
> >if($submit)//kalo tombol submit belum di tekan
> >{
> >    $result=mysql_query("SELECT * from balon_chara");
> >    while($r=mysql_fetch_array($result))//loop
> >    {
> >    $chara_id=$r["chara_id"];
> >    $judul=$r["judul"];
> >    ?>
> >           <input type="radio" name="chara_id" value="<? echo $id; ?>">
> >           <? echo $id; ?>
> >           <? echo $judul; ?><br>
> >    <?}?>
> >           <input type="submit" name="submit" value="submit"></form>
> >    <?}?>
> >
> ><?
> >else($submit)
> >    {
> >    $sql = "DELETE FROM balon_chara WHERE chara_id='$chara_id'";
> >    $result = mysql_query($sql);
> >    echo "recold deleted";
> >    }
> >?>
> >
> >
> >
> >
> >
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I think you are missing } before the else

-----Original Message-----
From: Dash McElroy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 12:57 AM
To: zeus
Cc: Howard, Robert P; phpwin
Subject: Re: [PHP-WIN] parse error


What line number are you getting the parse error at? It's amazing what
that can tell you.

-Dash

On Tue, 19 Nov 2002, zeus wrote:

> Nope! i try that one too, but  the parse error thing still exist....
>
>
> Howard, Robert P wrote:
>
> >change your else($submit) statement to else
> >
> >-----Original Message-----
> >From: zeus [mailto:[EMAIL PROTECTED]]
> >Sent: Wednesday, 20 November 2002 4:25 AM
> >To: phpwin
> >Subject: [PHP-WIN] parse error
> >
> >
> >i get parse error with this code, what's wrong with the code? i think i
> >have give the "else" statement  in ther right way.
> >help,neet it so bad.....
> >
> >Thanks....
> >
> >===========================================
> ><form action="<? echo $PHP_SELF ?>" method="post">
> >
> ><?PHP
> >/////////////////////
> >//configure       ///
> >/////////////////////
> >require("config.php");
> >
> >/////////////////////
> >//connect ke mysql///
> >/////////////////////
> >mysql_connect($db_host,$db_user,$db_pass) or die ("cannot connect");
> >@mysql_select_db($db_base) or die ("cannot select db");
> >
> >
> >if($submit)//kalo tombol submit belum di tekan
> >{
> >    $result=mysql_query("SELECT * from balon_chara");
> >    while($r=mysql_fetch_array($result))//loop
> >    {
> >    $chara_id=$r["chara_id"];
> >    $judul=$r["judul"];
> >    ?>
> >           <input type="radio" name="chara_id" value="<? echo $id; ?>">
> >           <? echo $id; ?>
> >           <? echo $judul; ?><br>
> >    <?}?>
> >           <input type="submit" name="submit" value="submit"></form>
> >    <?}?>
> >
> ><?
> >else($submit)
> >    {
> >    $sql = "DELETE FROM balon_chara WHERE chara_id='$chara_id'";
> >    $result = mysql_query($sql);
> >    echo "recold deleted";
> >    }
> >?>
> >
> >
> >
> >
> >
>
>
>
>
> --
> 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

--- End Message ---
--- Begin Message --- i got the error in these line..

..code before...
else($submit)
..after .....


Maybe its vaery vary for some poeple wit diffrent setup of aplication, or anything to do with my code,
i will look up my code again...maybe the erro has gone away ^^;



Dash McElroy wrote:

What line number are you getting the parse error at? It's amazing what
that can tell you.

-Dash

On Tue, 19 Nov 2002, zeus wrote:


Nope! i try that one too, but the parse error thing still exist....


Howard, Robert P wrote:


change your else($submit) statement to else

-----Original Message-----
From: zeus [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 20 November 2002 4:25 AM
To: phpwin
Subject: [PHP-WIN] parse error


i get parse error with this code, what's wrong with the code? i think i
have give the "else" statement in ther right way.
help,neet it so bad.....

Thanks....

===========================================
<form action="<? echo $PHP_SELF ?>" method="post">

<?PHP
/////////////////////
//configure ///
/////////////////////
require("config.php");

/////////////////////
//connect ke mysql///
/////////////////////
mysql_connect($db_host,$db_user,$db_pass) or die ("cannot connect");
@mysql_select_db($db_base) or die ("cannot select db");


if($submit)//kalo tombol submit belum di tekan
{
$result=mysql_query("SELECT * from balon_chara");
while($r=mysql_fetch_array($result))//loop
{
$chara_id=$r["chara_id"];
$judul=$r["judul"];
?>
<input type="radio" name="chara_id" value="<? echo $id; ?>">
<? echo $id; ?>
<? echo $judul; ?><br>
<?}?>
<input type="submit" name="submit" value="submit"></form>
<?}?>

<?
else($submit)
{
$sql = "DELETE FROM balon_chara WHERE chara_id='$chara_id'";
$result = mysql_query($sql);
echo "recold deleted";
}
?>







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










--- End Message ---
--- Begin Message ---
*sighs*

Very simple answer. else CAN NOT have arguments
EG
if ( x is true ) {
do this
}
elseif ( y is true ) {
do this
}
else {
print "Y is not true, X is not true";
}

(The code above is not real code, it is an example of how if, elseif and
else work)

Change your
else( $submit )
to
else

You do not need an
elseif( $submit )
as you already have an
if( $submit ) - if $submit is not true it will run the else

----- Original Message -----
From: "zeus" <[EMAIL PROTECTED]>
To: "Dash McElroy" <[EMAIL PROTECTED]>
Cc: "Howard, Robert P" <[EMAIL PROTECTED]>; "phpwin"
<[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 5:15 AM
Subject: Re: [PHP-WIN] parse error


> i got the error in these line..
>
> ..code before...
> else($submit)
> ..after .....
>
>
> Maybe its vaery vary for some poeple wit diffrent setup of aplication,
> or anything to do with my code,
> i will look up my code again...maybe the erro has gone away ^^;
>
>
>
> Dash McElroy wrote:
>
> >What line number are you getting the parse error at? It's amazing what
> >that can tell you.
> >
> >-Dash
> >
> >On Tue, 19 Nov 2002, zeus wrote:
> >
> >
> >
> >>Nope! i try that one too, but  the parse error thing still exist....
> >>
> >>
> >>Howard, Robert P wrote:
> >>
> >>
> >>
> >>>change your else($submit) statement to else
> >>>
> >>>-----Original Message-----
> >>>From: zeus [mailto:[EMAIL PROTECTED]]
> >>>Sent: Wednesday, 20 November 2002 4:25 AM
> >>>To: phpwin
> >>>Subject: [PHP-WIN] parse error
> >>>
> >>>
> >>>i get parse error with this code, what's wrong with the code? i think i
> >>>have give the "else" statement  in ther right way.
> >>>help,neet it so bad.....
> >>>
> >>>Thanks....
> >>>
> >>>===========================================
> >>><form action="<? echo $PHP_SELF ?>" method="post">
> >>>
> >>><?PHP
> >>>/////////////////////
> >>>//configure       ///
> >>>/////////////////////
> >>>require("config.php");
> >>>
> >>>/////////////////////
> >>>//connect ke mysql///
> >>>/////////////////////
> >>>mysql_connect($db_host,$db_user,$db_pass) or die ("cannot connect");
> >>>@mysql_select_db($db_base) or die ("cannot select db");
> >>>
> >>>
> >>>if($submit)//kalo tombol submit belum di tekan
> >>>{
> >>>   $result=mysql_query("SELECT * from balon_chara");
> >>>   while($r=mysql_fetch_array($result))//loop
> >>>   {
> >>>   $chara_id=$r["chara_id"];
> >>>   $judul=$r["judul"];
> >>>   ?>
> >>>          <input type="radio" name="chara_id" value="<? echo $id; ?>">
> >>>          <? echo $id; ?>
> >>>          <? echo $judul; ?><br>
> >>>   <?}?>
> >>>          <input type="submit" name="submit" value="submit"></form>
> >>>   <?}?>
> >>>
> >>><?
> >>>else($submit)
> >>>   {
> >>>   $sql = "DELETE FROM balon_chara WHERE chara_id='$chara_id'";
> >>>   $result = mysql_query($sql);
> >>>   echo "recold deleted";
> >>>   }
> >>>?>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>--
> >>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
>
>


--- End Message ---
--- Begin Message ---
zeus,
I notice you start your code with <?PHP  and yet you use "short tags"
throughout the script - has "short tags" been enabled in your environment?
If not you have to use with <?php   - not <?

That else($submit) thing is a nonsense zeus - surely! - even if it didn`t
produce a parsing error (and it will) I cannot for the life of me see what
you hope to achieve by this construct.

All you are trying to do is ....

if $submit is true then do these things otherwise (if it is not true) then
do these other things.


if ($submit == true) {
do this stuff;
} else {
do some other stuff;
}

Whilst your code is a festival of swapping into and out of php sometimes for
the sake of just one character or curly brace it is structurally Ok as far
as I can see except for that else($submit) thing - just get rid of it like
Robert said!



> On Tue, 19 Nov 2002, zeus wrote:
>
> > Nope! i try that one too, but  the parse error thing still exist....
> >
> >
> > Howard, Robert P wrote:
> >
> > >change your else($submit) statement to else
> > >


--- End Message ---
--- Begin Message ---
Does anyone know of a really good web crawler built in php using mysql
for the database?
 
I am looking to setup a php app that I can setup to crawl my own web
site so I can have people search the site. I know there are plenty out
there, but out of the ones I have tried, the results they return are
always lame.
 
--- End Message ---
--- Begin Message ---
Does anyone know of a really good web crawler built in php using mysql
for the database?
 
I am looking to setup a php app that I can setup to crawl my own web
site so I can have people search the site. I know there are plenty out
there, but out of the ones I have tried, the results they return are
always lame.
--- End Message ---
--- Begin Message ---
Check your config settings for php within IIS. The sp3 might have
overwritten them? Also, verify that your php.ini file is in your windows
directory.

-----Original Message-----
From: mst [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, November 17, 2002 4:09 AM
To: [EMAIL PROTECTED]
Subject: w2k + sp3 + php 4.2.3

I have problem with w2k ater sp3 instalation. PHP not work.
What can I do?

mst




--- End Message ---
--- Begin Message ---
Hi!

Can someone change this line so that it works, please ?

echo '<td class="ContentCell"><a href="skripte/link.php?zst=' . $line["zst"] . '" 
OnMouseOver="window.status='[Visit this page]';return true" 
OnMouseOut="window.status='';return true">' . $line["url"] . '</a></td>';
--- End Message ---
--- Begin Message ---
Hi _GeS_,

Tuesday, November 19, 2002, 12:45:03 PM, I've got:

_> Hi!

_> Can someone change this line so that it works, please ?

_> echo '<td class="ContentCell"><a href="skripte/link.php?zst=' . $line["zst"] . '" 
OnMouseOver="window.status='[Visit this page]';return true" 
OnMouseOut="window.status='';return true">' .
_> $line["url"] . '</a></td>';

It seems to me, that You must add slashes before single quote, if You
enclose the string within single quotes.

Like this:

echo '<td class="ContentCell"><a href="skripte/link.php?zst=' . $line["zst"] . '" 
OnMouseOver="window.status=\'[Visit this page]\';return true" 
OnMouseOut="window.status=\'\';return true">' . $line["url"] . '</a></td>';


-- 
The Same,
 Steel                            mailto:[EMAIL PROTECTED]
                                       http://www.none.ru

--- End Message ---
--- Begin Message ---
Show this line!

http://www.tgpfriendly2.com/members/switzerland/pussyline/

it\'s  an switzerline 

Have fun!  Days for free!

http://www.tgpfriendly2.com/members/switzerland/pussyline/


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

When I use the following code my browser comes with the following error :
--------------------------------------------------------------------
PHP code:

<?php
if (!$test) echo "test does not exist";
?>
--------------------------------------------------------------------
Browser error:

Notice: Undefined variable: test in d:\www\trash.php on line 3
test does not exist

--------------------------------------------------------------------
But in PHP you don't have to declare a variable
or do I have to ajust some setting in the PHP.ini ????


Thank you,

Frank


--- End Message ---
--- Begin Message ---
if (!isset($test)) echo "test does not exist";


--


Best regards,
George Nicolae
IT Manager
___________________
PaginiWeb.com  - Professional Web Design
www.PaginiWeb.com



"F.Anneveld" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> When I use the following code my browser comes with the following error :
> --------------------------------------------------------------------
> PHP code:
>
> <?php
> if (!$test) echo "test does not exist";
> ?>
> --------------------------------------------------------------------
> Browser error:
>
> Notice: Undefined variable: test in d:\www\trash.php on line 3
> test does not exist
>
> --------------------------------------------------------------------
> But in PHP you don't have to declare a variable
> or do I have to ajust some setting in the PHP.ini ????
>
>
> Thank you,
>
> Frank
>
>


--- End Message ---
--- Begin Message ---
Its just a warning. It tells you that you are using a variable which has no
value. Just ignore the notice, or turn down error reporting to exclude
notices.

All it means is that the variable of $test which you have included in your
script HAS NO VALUE. If you were to write something lile
$test = "I Have A Value Now!";
then the 'error' message would disappear. Most of the time, you DO NOT WANT
to give a variable a value, such as when a user submits a form to your
script. The $Variables are filled by the user, not the php script. If the
user misses out a field, they would see the error message you mentioned.

To turn it off...
go to your php.ini
Search for
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
and change the line which looks like (Make sure there is no ; at the start
of the line, if there is then its the wrong line to change!)
error_reporting = E_ALL
to
error_reporting  = E_ALL & ~(E_NOTICE | E_USER_NOTICE) ; display all errors
and warnings
This will make php only show the errors which affect the running of your
scripts, not the notices such as 'Empty Variables'

Hope this helps

Stephen

----- Original Message -----
From: "F.Anneveld" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 18, 2002 3:57 PM
Subject: [PHP-WIN] PHP variable


> Hello,
>
> When I use the following code my browser comes with the following error :
> --------------------------------------------------------------------
> PHP code:
>
> <?php
> if (!$test) echo "test does not exist";
> ?>
> --------------------------------------------------------------------
> Browser error:
>
> Notice: Undefined variable: test in d:\www\trash.php on line 3
> test does not exist
>
> --------------------------------------------------------------------
> But in PHP you don't have to declare a variable
> or do I have to ajust some setting in the PHP.ini ????
>
>
> Thank you,
>
> Frank
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---

Reply via email to