php-windows Digest 29 Jan 2005 07:42:50 -0000 Issue 2555
Topics (messages 25475 through 25482):
Re: Has anyone seen this error before?
25475 by: Charles P. Killmer
25476 by: The Disguised Jedi
25480 by: DvDmanDT
basic mysql question:
25477 by: Patrick Roane
25478 by: Patrick Roane
user login/password
25479 by: Patrick Roane
Re: From Browser to Print - ?????
25481 by: MikeA
Re: NT username detectable?
25482 by: SargeTron
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 ---
Try not echoing the word FORM.
change
</form>
FORM';
to this
</form>';
Charles
-----Original Message-----
From: Patrick Roane [mailto:[EMAIL PROTECTED]
Sent: Friday, January 28, 2005 1:34 PM
To: [email protected]
Subject: Re: [PHP-WIN] Has anyone seen this error before?
This worked! Thank you. Now, my question is why it worked. Also, the
word FORM shows up at the bottom of the browser window ...is there
anything I can do to make that go away?
--- The Disguised Jedi <[EMAIL PROTECTED]>
wrote:
> 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
>
=====
----------------
"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
--- End Message ---
--- Begin Message ---
just take the word FORM out of the echo statement, but don't delete
the closing quote...
On Fri, 28 Jan 2005 11:34:02 -0800 (PST), Patrick Roane
<[EMAIL PROTECTED]> wrote:
> This worked! Thank you. Now, my question is why it
> worked. Also, the word FORM shows up at the bottom of
> the browser window ...is there anything I can do to
> make that go away?
>
> --- The Disguised Jedi <[EMAIL PROTECTED]>
> wrote:
>
> > 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
> >
>
>
> =====
>
> ----------------
> "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
--- End Message ---
--- Begin Message ---
Ermm.. Change
<form method="post" action="{' . $_SERVER['PHP_SELF'] . '}">
to
<form method="post" action="' . $_SERVER['PHP_SELF'] . '">
as well.. otherwise you'll have <form method="post" action="{filename.php}">
in your result..
--
// DvDmanDT
MSN: dvdmandt�hotmail.com
Mail: dvdmandt�telia.com
"The Disguised Jedi" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> 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 was wondering if there is a quick way to change the
value of my VARCHAR from 10 to 30 characters w/out
having to drop and recreate the column?
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 ---
Thanks for the tip:
ALTER TABLE specs MODIFY food CHAR(30);
does the trick!
--- Thomas Vanhal <[EMAIL PROTECTED]> wrote:
> Did you try a ALTER table?
> ----- Original Message -----
> From: "Patrick Roane" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Friday, January 28, 2005 11:50 AM
> Subject: [PHP-WIN] basic mysql question:
>
>
> >I was wondering if there is a quick way to change
> the
> > value of my VARCHAR from 10 to 30 characters w/out
> > having to drop and recreate the column?
> >
> >
> >
> > 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
> >
>
>
=====
----------------
"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 ---
Can anyone suggest a good tutorial on creating a user
login screen?
=====
----------------
"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 ---
Carsten,
Thank you for that URL. WOW - I never realized all that was available. I had
not heard about it.
I've been getting some great help on this subject. Glad to see you guys
keeping up on it.
Mike
"Carsten Gehling" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
You can define different style sheets based on the media that the HTML page
is rendered on:
<link rel="stylesheet" type="text/css" media="screen"
href="styles_screen.css">
<link rel="stylesheet" type="text/css" media="print"
href="styles_print.css">
Now use CSS to position your form feed as you like.
Read more here:
http://www.w3.org/TR/REC-CSS2/media.html
- Carsten
> -----Oprindelig meddelelse-----
> Fra: news [mailto:[EMAIL PROTECTED] vegne af MikeA
> Sendt: 28. januar 2005 04:24
> Til: [email protected]
> Emne: [PHP-WIN] From Browser to Print - ?????
>
>
> 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
>
> --
> 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 ---
<offtopic>rofl... security hole</offtopic>
You could use a database having all the users on the system (sha-1
passwords) and make them login. Then set a cookie with username and password
and check them on every page.... ooooops ignore that: it wouldn't work
unless you checked who was online and added it to the database.
"Christian Fersch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> [EMAIL PROTECTED] wrote:
>
> > In the html headers, the server sees the clients OS, user agent, IP
> > address etc. Is there a way on a local LAN a server might be able to
know
> > the username of the client that sends a request?
> >
> > I've checked all $_SERVER variables, PHP_AUTH_USER etc require the auth
> > box to be displayed. I'm thinking it might be possible to know which
user
> > is logged in when the request is made, possibly by using COM or even
> > (gasp) .NET, without having to ask the user his username.
> >
> > Any ideas if this can be accomplished at all?
> >
> > Right now we have Firefox clients and Apache with PHP in an Active
> > Directory domain with NT4 compatibility, but we can move to IE6 with
> > IIS+PHP if that will work.
>
>
> This isn't possible with php on its own (would be deep impact into your
> privacy if it could, wouldn't it?). So you've got 2 choices:
> switch to IE and use a security hole :>
> Or just stay with the better browser and write a little extension.
> The easiest way should be a little extensions, that checks if the url of
> your site is opened and if it is, fills a hidden field with the
> username. Or even easier: an extension, that sets a cookie for your site
> with the username as its content.
>
> extensions aren't that hard to write, for they are just javascript.
>
> greetings, Christian
--- End Message ---