php-windows Digest 28 Jan 2005 03:24:30 -0000 Issue 2553

Topics (messages 25466 through 25469):

Re: Strange CGI Timeout
        25466 by: Eric Spies

Has anyone seen this error before?
        25467 by: Patrick Roane
        25468 by: The Disguised Jedi

>From Browser to Print - ?????
        25469 by: MikeA

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 ---
I just noticed it works in Mozilla and Netscape but not IE.

"Eric Spies" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello.
>
> I recently moved my web server to a new machine.  The operating system has
> stayed the same (Windows 2000 server), the IIS version (IIS5) has stayed
the
> same.  I am using the same version of php (4.3.6) and copied over the same
> php.ini file.  The directory structure I used is exactly the same with
file
> permissions given to all the proper directories.
>
> The php pages are the same exact files that were used on the old server
and
> had worked there flawlessly for 2 years.
> I have gone through and made sure all the IIS settings are the same as
they
> used to be, and checked php.ini about a billion times.  I've also googled
on
> this problem for a few days now and nothing I've found has been able to
> help.
>
> I am having a problem whenever IE tries to post to any php page when the
> form being posted includes a textarea with what seems like anything over
50
> characters.
> I can create forms from scratch and repeat this error with any form I make
> posting to any existing or brand new php pages.
> If I make a new php page that consists only of <? die("got here"); ?> it
> will never even get that far.
>
> I know the post is getting up to IIS, since IIS does load php.exe and then
> begins to wait for it where I get the usual CGI Timeout error as php.exe
> appears to hang.
>
> I can test with the exact same pages, with the exact same php.ini, with
the
> exact same data, with the exact same ISS setup, with the exact same file
> permissions set, on my old machine and it works just fine.
>
> I have done phpinfo() on both machines and compared the results of each.
> The only differences seem to be in the IP and computer names which of
course
> would make sense.
>
>
> Any ideas? :)

--- End Message ---
--- Begin Message ---
Parse error: syntax error, unexpected $end in
c:\wamp\www\php_excercises\schedule.php on line 81:

line 81 is all the way at the bottom.

Here is my code:

<!DOCTYPE html PUBLIC
        "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html>
<head>
<title>Listing 13.1 Opening a Connection to a
Database</title>
</head>
<body>
<?php

if ( ! empty( $_REQUEST['sound'] )&&
        ! empty( $_REQUEST['equip'] )&&
        ! empty( $_REQUEST['food'] )&&
        ! empty( $_REQUEST['drink'] )&&
        ! empty( $_REQUEST['comp'] ) ){
                // check user imput here!
                $dberror = "";
                $ret = add_to_database( $_REQUEST['sound'],
                  $_REQUEST['equip'],
                              $_REQUEST['food'],
                              $_REQUEST['drink'],
                              $_REQUEST['comp'], $dberror );
                if ( ! $ret ) {
                        print "Error: $dberror<br />\n";
                } else {
                  print "Thank you very much<br />\n";
                }
} else {
  write_form();
}
function add_to_database( $sound, $equip, $food,
$drink, $comp, &$dberror ) {
        $sound = mysql_real_escape_string( $sound );
    $equip = mysql_real_escape_string( $equip );
        $food = mysql_real_escape_string( $food );
        $drink = mysql_real_escape_string( $drink );
        $comp = mysql_real_escape_string( $comp );
    $link = mysql_pconnect( "localhost", "", "" );
    if ( ! $link ) {
                $dberror = mysql_error();
                return false;
        }
    if ( ! mysql_select_db( "schedule05", $link ) ) {
                $dberror = mysql_error();
            return false;
        }
    $query = "INSERT INTO specs( sound, equip, food,
drink, comp )
                values('$sound', '$equip', '$food', '$drink',
'$comp' )";
    if ( ! mysql_query( $query, $link ) ) {
                $dberror = mysql_error();
                return false;
  }
  return true;
}

function write_form() {
        print <<<EOF
                <form method="post" action="{$_SERVER['PHP_SELF']}">

                <p><input type="text" name="sound" />
                Does venue have mixer?</p>

                <p><input type="text" name="equip" />
                Does venue have its own equipment?</p>

                <p><input type="text" name="food" />
                What kind of food deal?</p>
                
                <p><input type="text" name="drink" />
                What kind of drink deal?</p>
                
                <p><input type="text" name="comp" />
                What is our compensation?</p>
                
                <p><input type="submit" value="submit!" /></p>
                </form>
                
        FORM;
}
?>
</BODY>
</HTML>

Thanks-

=====

----------------
"forget your lust for the rich man's gold. All that you need, is in your soul. 
You can do this if you try. All that I want for you my son, is to be satisfied"

  ~ Lynard Skynard

--- End Message ---
--- Begin Message ---
it means php was looking for the end of file marker, and didn't find
it before the $end (end of php parser "?>")

just use this new version of 'write_form()' and it should work...

//==new function ... do not include this line....==

function write_form() {
       print '
               <form method="post" action="{' . $_SERVER['PHP_SELF'] . '}">

               <p><input type="text" name="sound" />
               Does venue have mixer?</p>

               <p><input type="text" name="equip" />
               Does venue have its own equipment?</p>

               <p><input type="text" name="food" />
               What kind of food deal?</p>

               <p><input type="text" name="drink" />
               What kind of drink deal?</p>

               <p><input type="text" name="comp" />
               What is our compensation?</p>

               <p><input type="submit" value="submit!" /></p>
               </form>

       FORM';
}

//==end of new function...do not include this line....==


On Thu, 27 Jan 2005 18:20:18 -0800 (PST), Patrick Roane
<[EMAIL PROTECTED]> wrote:
> Parse error: syntax error, unexpected $end in
> c:\wamp\www\php_excercises\schedule.php on line 81:
>
> line 81 is all the way at the bottom.
>
> Here is my code:
>
> <!DOCTYPE html PUBLIC
>         "-//W3C//DTD XHTML 1.0 Strict//EN"
>         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> <html>
> <head>
> <title>Listing 13.1 Opening a Connection to a
> Database</title>
> </head>
> <body>
> <?php
>
> if ( ! empty( $_REQUEST['sound'] )&&
>         ! empty( $_REQUEST['equip'] )&&
>         ! empty( $_REQUEST['food'] )&&
>         ! empty( $_REQUEST['drink'] )&&
>         ! empty( $_REQUEST['comp'] ) ){
>                 // check user imput here!
>                 $dberror = "";
>                 $ret = add_to_database( $_REQUEST['sound'],
>                   $_REQUEST['equip'],
>                               $_REQUEST['food'],
>                               $_REQUEST['drink'],
>                               $_REQUEST['comp'], $dberror );
>                 if ( ! $ret ) {
>                         print "Error: $dberror<br />\n";
>                 } else {
>                   print "Thank you very much<br />\n";
>                 }
> } else {
>   write_form();
> }
> function add_to_database( $sound, $equip, $food,
> $drink, $comp, &$dberror ) {
>         $sound = mysql_real_escape_string( $sound );
>     $equip = mysql_real_escape_string( $equip );
>         $food = mysql_real_escape_string( $food );
>         $drink = mysql_real_escape_string( $drink );
>         $comp = mysql_real_escape_string( $comp );
>     $link = mysql_pconnect( "localhost", "", "" );
>     if ( ! $link ) {
>                 $dberror = mysql_error();
>                 return false;
>         }
>     if ( ! mysql_select_db( "schedule05", $link ) ) {
>                 $dberror = mysql_error();
>             return false;
>         }
>     $query = "INSERT INTO specs( sound, equip, food,
> drink, comp )
>                 values('$sound', '$equip', '$food', '$drink',
> '$comp' )";
>     if ( ! mysql_query( $query, $link ) ) {
>                 $dberror = mysql_error();
>                 return false;
>   }
>   return true;
> }
>
> function write_form() {
>         print <<<EOF
>                 <form method="post" action="{$_SERVER['PHP_SELF']}">
>
>                 <p><input type="text" name="sound" />
>                 Does venue have mixer?</p>
>
>                 <p><input type="text" name="equip" />
>                 Does venue have its own equipment?</p>
>
>                 <p><input type="text" name="food" />
>                 What kind of food deal?</p>
>
>                 <p><input type="text" name="drink" />
>                 What kind of drink deal?</p>
>
>                 <p><input type="text" name="comp" />
>                 What is our compensation?</p>
>
>                 <p><input type="submit" value="submit!" /></p>
>                 </form>
>
>         FORM;
> }
> ?>
> </BODY>
> </HTML>
>
> Thanks-
>
> =====
>
> ----------------
> "forget your lust for the rich man's gold. All that you need, is in your 
> soul. You can do this if you try. All that I want for you my son, is to be 
> satisfied"
>
>   ~ Lynard Skynard
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
The Disguised Jedi
[EMAIL PROTECTED]

PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored.
This message is Certified Virus Free


-- 
The Disguised Jedi
[EMAIL PROTECTED]

PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored.
This message is Certified Virus Free

--- End Message ---
--- Begin Message ---
I have some PHP scripts that put output to the browser. I can then print them. 
However, I want to 
have the pages form feed at specific places so the printouts look nice.  How 
can I do that?

Thanks.

Mike

--- End Message ---

Reply via email to