php-general Digest 17 Apr 2001 06:35:37 -0000 Issue 632

Topics (messages 48788 through 48902):

How do i include ASP script into PHP...??!
        48788 by: Joe Truong
        48813 by: Plutarck
        48814 by: Kurth Bemis
        48817 by: Phil Driscoll
        48833 by: Seung-woo Nam
        48835 by: Richard
        48843 by: Phil Driscoll
        48864 by: Joe Truong
        48866 by: Jason Murray

Re: Link to a html in PHP Code
        48789 by: Ulf Wendel

function to add %20 in place of blank  spaces
        48790 by: Nando2
        48791 by: Boget, Chris
        48798 by: Felix Kronlage

Re: Storing User Info
        48792 by: Ashley M. Kirchner
        48867 by: Chris Anderson

Re: fwrite not writing
        48793 by: CC Zona
        48801 by: Szii

siimple cookie problem
        48794 by: kmurrah
        48872 by: Chris Anderson
        48874 by: Chris Anderson

set_error_handler()
        48795 by: Boget, Chris
        48797 by: Morgan Curley
        48802 by: Boget, Chris
        48815 by: Boget, Chris

Re: What's XML's Purpose??
        48796 by: Szii

compile Modules
        48799 by: Yurais Fernández Leal

Re: session variable problem
        48800 by: Mesut TUNGA

var question
        48803 by: Jeroen Geusebroek
        48804 by: Jeroen Geusebroek
        48812 by: Plutarck
        48824 by: Aemuli
        48826 by: Plutarck
        48840 by: Steve Edberg

Re: is it safe to stripslashes() on all form variables?
        48805 by: Yasuo Ohgaki
        48852 by: Noah Spitzer-Williams
        48854 by: Alexander Skwar
        48865 by: Yasuo Ohgaki

fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14
        48806 by: CC Zona
        48868 by: Chris Anderson
        48869 by: CC Zona
        48870 by: Chris Anderson
        48871 by: Chris Anderson
        48873 by: CC Zona
        48875 by: Chris Anderson

php like cgi
        48807 by: Ulysses Almeida
        48816 by: Dddogbruce \(.home.com\)

include files with PHP 3.0.16
        48808 by: Tim Thorburn
        48809 by: James Atkinson
        48810 by: CC Zona
        48811 by: Stefan Kostopoulos

cookies
        48818 by: Pat Hanna
        48820 by: Brian Clark
        48823 by: Pat Hanna
        48825 by: Brian Clark

Re: is it safe to stripslashes() on all form variables? [ s ecurity hole !!! ]
        48819 by: Johnson, Kirk

PHP3 & PHP4 in apache?
        48821 by: Matthew Mueller
        48822 by: Brian Clark

Speed of MySQL connections - Socket vs. Non-Socket
        48827 by: Alexander Skwar
        48828 by: Brian Clark
        48831 by: Alexander Skwar
        48837 by: Brian Clark
        48841 by: eschmid+sic.s.netic.de
        48842 by: Joe Sheble \(Wizaerd\)
        48844 by: Brian Clark
        48845 by: Alexander Skwar
        48847 by: Alexander Skwar
        48848 by: Alexander Skwar

File open Question?
        48829 by: David Serrano
        48830 by: Brian Clark
        48836 by: David Serrano
        48839 by: Brian Clark
        48850 by: David Serrano

Site Sessions: Online/Offline - help?
        48832 by: Richard

Re: Blur some text please
        48834 by: Richard
        48838 by: Mark Maggelet

Populating HTML List boxes From DB
        48846 by: Peter Houchin
        48851 by: Alexander Skwar
        48853 by: Peter Houchin
        48855 by: Peter Houchin
        48857 by: Jason Murray
        48858 by: Peter Houchin
        48859 by: Shaun
        48860 by: Jason Murray
        48861 by: Brett
        48862 by: Jason Murray
        48863 by: Peter Houchin

Job in Whistler, BC
        48849 by: Colin Putney
        48877 by: Dddogbruce \(.home.com\)
        48881 by: Mark Maggelet
        48890 by: John Monfort

Re: sessions problem (and spec. Mozilla vs Opera)
        48856 by: trogers

Parse error - script help.
        48876 by: Dddogbruce \(.home.com\)
        48878 by: Brian Clark
        48879 by: Dan Lowe
        48880 by: Brian Clark

Wrong parameter count
        48882 by: Peter Houchin
        48884 by: Brian Clark
        48885 by: Jason Murray
        48886 by: Frank M. Kromann

Re: ldap_search...no results!
        48883 by: Dan Lowe

IGNORE " Wrong parameter count Please"
        48887 by: Peter Houchin

cgi vs. module
        48888 by: Franklin Hays
        48895 by: Manisha

PHP3 and PHP_SELF
        48889 by: Alan Ward

array_push but with key, value pairs
        48891 by: Joseph Blythe
        48894 by: Peter Houchin
        48896 by: Joseph Blythe
        48897 by: Peter Houchin
        48899 by: Joseph Blythe

ZOPE PHP
        48892 by: Romulo Roberto Pereira

ooops PHP for Zope
        48893 by: Romulo Roberto Pereira

baffled :<:<
        48898 by: Peter Houchin
        48900 by: Rasmus Lerdorf
        48901 by: Peter Houchin

Telnet from PHP
        48902 by: Warren Vail

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]


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


How can i include ASP scripts into PHP files or is it posible?
thanxz
-Joe






Doesn't work.

ASP scripts require an ASP interpreter. If you stick it in a PHP file, PHP
will try to interpret the ASP code. PHP can't do that.



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


""Joe Truong"" <[EMAIL PROTECTED]> wrote in message
9bfd8q$gum$[EMAIL PROTECTED]">news:9bfd8q$gum$[EMAIL PROTECTED]...
> How can i include ASP scripts into PHP files or is it posible?
> thanxz
> -Joe
>
>
>
> --
> PHP General 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]
>






At 05:45 PM 4/16/2001, Plutarck wrote:

plus - why would you want to :-)

>Doesn't work.
>
>ASP scripts require an ASP interpreter. If you stick it in a PHP file, PHP
>will try to interpret the ASP code. PHP can't do that.
>
>
>
>--
>Plutarck
>Should be working on something...
>...but forgot what it was.
>
>
>""Joe Truong"" <[EMAIL PROTECTED]> wrote in message
>9bfd8q$gum$[EMAIL PROTECTED]">news:9bfd8q$gum$[EMAIL PROTECTED]...
> > How can i include ASP scripts into PHP files or is it posible?
> > thanxz
> > -Joe
> >
> >
> >
> > --
> > PHP General 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]
> >
>
>
>
>--
>PHP General 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]





There may be some perverse way of getting php and asp to parse the same
page, but I;m sure you don't want to go there.

If you have a legacy ASP script which you need to access, you can call it
from within PHP using something like:

$f=fopen('http://your.server/legacyscript.asp"), "r");
if($f)
{
 /*read the data from the file handle and deal with it as you wish - you
might want to process it somehow, or just output it as part of the current
page*/
 fclose($fp);
}

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org






ASP scripts require .asp extension and PHP scripts require .php
extension. That's how a webserver invokes the right interpreter for the
script. I suppose you could use ASP pages and PHP pages on the same
server if you have something like MS IIS with php or Apache on *NIX with
php and chillisoft asp interpreter but mixing both scripts on a same
page is just pushing it. Maybe you could configure the webserver the way
that it invokes both interpreters whenever it sees .php or .asp
extensions but why on earth would you even want to try that kind of
stuff?

Seung-woo Nam

Joe Truong wrote:
> 
> How can i include ASP scripts into PHP files or is it posible?
> thanxz
> -Joe
> 
> --
> PHP General 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]




ASP is a pathetic framwork.

""Phil Driscoll"" <[EMAIL PROTECTED]> wrote in message
005f01c0c6c2$ad8a2200$0c01a8c0@philsntserver">news:005f01c0c6c2$ad8a2200$0c01a8c0@philsntserver...
> There may be some perverse way of getting php and asp to parse the same
> page, but I;m sure you don't want to go there.
>
> If you have a legacy ASP script which you need to access, you can call it
> from within PHP using something like:
>
> $f=fopen('http://your.server/legacyscript.asp"), "r");
> if($f)
> {
>  /*read the data from the file handle and deal with it as you wish - you
> might want to process it somehow, or just output it as part of the current
> page*/
>  fclose($fp);
> }
>
> Cheers
> --
> Phil Driscoll
> Dial Solutions
> +44 (0)113 294 5112
> http://www.dialsolutions.com
> http://www.dtonline.org
>
>
>
> --
> PHP General 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]
>






Richard wrote:
>ASP is a pathetic framwork.

So it's a good idea to give people ways of migrating from it to PHP :)
-- 
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org





i found it..... some one else sent it to me... thanxz n e wayz guys....


$f=fopen('http://your.server/legacyscript.asp"), "r");
if($f)
{
 /*read the data from the file handle and deal with it as you wish - you
might want to process it somehow, or just output it as part of the current
page*/
 fclose($fp);
}

Cheers



"Kurth Bemis" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 05:45 PM 4/16/2001, Plutarck wrote:
>
> plus - why would you want to :-)
>
> >Doesn't work.
> >
> >ASP scripts require an ASP interpreter. If you stick it in a PHP file,
PHP
> >will try to interpret the ASP code. PHP can't do that.
> >
> >
> >
> >--
> >Plutarck
> >Should be working on something...
> >...but forgot what it was.
> >
> >
> >""Joe Truong"" <[EMAIL PROTECTED]> wrote in message
> >9bfd8q$gum$[EMAIL PROTECTED]">news:9bfd8q$gum$[EMAIL PROTECTED]...
> > > How can i include ASP scripts into PHP files or is it posible?
> > > thanxz
> > > -Joe
> > >
> > >
> > >
> > > --
> > > PHP General 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]
> > >
> >
> >
> >
> >--
> >PHP General 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]
>
>
> --
> PHP General 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]
>






> $f=fopen('http://your.server/legacyscript.asp"), "r");
> if($f)
> {
>  /*read the data from the file handle and deal with it as you 
> wish - you
> might want to process it somehow, or just output it as part 
> of the current
> page*/
>  fclose($fp);
> }

This won't include the ASP script.

It will include the OUTPUT of the ASP script, just like hitting
a web page run by PHP will produce the OUTPUT of the PHP script.

It also won't work at all well currently because your fopen 
filename quote starts with a ' and ends with a "...

Jason






Johannes Rumpf schrieb:
> I'm a pretty newby, so I have a question: How can I make a link to html
> or php or any other page in the internet in my PHP code? should be like
> Command ( "Http://www.xyz.com") Just like a link in a html site would be
> clicked.

print '<a href="http://www.circle.ch">The engaged PHP portal of Urs
Gehring</a>';

BTW Johannes, there's a german language mailinglist on
http://www.php-center.de and - what I preferr cause it's better ;) - the
newsgroup de.comp.lang.php . 

Ulf

-- 
Neu: PEAR Menu 3 - Navigationsstrukturen dynamisch dargestellt
http://www.ulf-wendel.de/projekte/menu/tutorial.php |
http://www.phpdoc.de




I'm trying to remember what is the function to replace blank spaces with %20.

Can anyone remind me of that?

Thanks, 

C.F.




> I'm trying to remember what is the function to replace blank 
> spaces with %20.
> Can anyone remind me of that?

urlencode();

Chris




On Mon, Apr 16, 2001 at 03:28:11PM -0300, Nando2 wrote:

> I'm trying to remember what is the function to replace
> blank spaces with %20.
> Can anyone remind me of that?

urlencode()
urldecode()

-fkr
-- 
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0 
  |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE  |
  |all your base are belong to us  |  shame on me  | fkr@IRCnet | 






    I'm looking for comments on this one.  I'm developing a site that
will have user logins on it.  What's the best way to do this?  What to
store, and how?

    - Are people more inclined to use a username when they need to log
      in to something, or would asking for an email (as the userID) be
      better?

    - How about storing passwords?  All of this info will be stored in
      an MySQL DB.  How do admins generally do this type of stuff?
      Encrypt the password stored in the DB, and decrypt it on the fly
      to compare?  Store it in plain text?  Or store it encrypted,
      and when the user logs in, encrypt that passwd (from the form)
      and compare the strings?  (not sure if the latter would work)

    - What about sending people passwords through email?  Like when
      someone signs up the first time, they supply a passwd.  How do
      people feel about sending that login information to the user in
      plain text via email?  Or do you?

    - What about when the user forgets their login?  Just fetch the
      info from DB and mail it out to the (registered) email address?
      Or, generate a new, generic one, mail that one out, and tell the
      user to login and change it again?

    Suggestions please.

    AMK4

--
W |
  |  I haven't lost my mind; it's backed up on tape somewhere.
  |____________________________________________________________________
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
  SysAdmin / Websmith                           .     800.441.3873 x130
  Photo Craft Laboratories, Inc.             .        eFax 248.671.0909
  http://www.pcraft.com                  .         3550 Arapahoe Ave #6
  .................. .  .  .     .               Boulder, CO 80303, USA






As far as decryption goes, ignore that. When they choose as password Crypt()
it with a seed. Then when the login, Crypt() what they type in with the same
seed and compare to 2. Decrypting means you have the dcryption source lying
around somewhere. A definite scurity problem. Crypt does a great job by
being just a one-way
street

----- Original Message -----
From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>
To: "PHP-General List" <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 2:41 PM
Subject: [PHP] RFC: Storing User Info


>
>     I'm looking for comments on this one.  I'm developing a site that
> will have user logins on it.  What's the best way to do this?  What to
> store, and how?
>
>     - Are people more inclined to use a username when they need to log
>       in to something, or would asking for an email (as the userID) be
>       better?
>
>     - How about storing passwords?  All of this info will be stored in
>       an MySQL DB.  How do admins generally do this type of stuff?
>       Encrypt the password stored in the DB, and decrypt it on the fly
>       to compare?  Store it in plain text?  Or store it encrypted,
>       and when the user logs in, encrypt that passwd (from the form)
>       and compare the strings?  (not sure if the latter would work)
>
>     - What about sending people passwords through email?  Like when
>       someone signs up the first time, they supply a passwd.  How do
>       people feel about sending that login information to the user in
>       plain text via email?  Or do you?
>
>     - What about when the user forgets their login?  Just fetch the
>       info from DB and mail it out to the (registered) email address?
>       Or, generate a new, generic one, mail that one out, and tell the
>       user to login and change it again?
>
>     Suggestions please.
>
>     AMK4
>
> --
> W |
>   |  I haven't lost my mind; it's backed up on tape somewhere.
>   |____________________________________________________________________
>   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
>   SysAdmin / Websmith                           .     800.441.3873 x130
>   Photo Craft Laboratories, Inc.             .        eFax 248.671.0909
>   http://www.pcraft.com                  .         3550 Arapahoe Ave #6
>   .................. .  .  .     .               Boulder, CO 80303, USA
>
>
>
> --
> PHP General 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]
>
>





In article <9bejks$gl6$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("Plutarck") wrote:

> I'm not sure why it suddenly stopped working, but let's see if you actually
> need it to work.
> 
> First of all, I take it that you have content which you want to write into a
> file. Correct?
> 
> If so, why does it matter if the file you want to write it to has data
> anyway? If you are just going to add data into it, isn't it ok that it is a
> zerolength file?

It is needed.  I have a dynamically generated page.  Most of the content 
needs to be re-generated with every request.  But some of it needs to be 
re-generated far less often.  Rather than unnecessarily hit the db every 
time to get the exact same content, that content gets cached to an include 
file.  This function checks whether that file needs to get a content 
refresh, and if so rewrites that content.  (I'm not adding data to the 
file, I'm overwriting it.)

> Or is the problem that the file is _not_ actually zerolength, but PHP says
> it's zerolength anyway?

Nope, it's really zero length.  The filesystem agrees with PHP, and when I 
open it in a text editor the file is empty.

> Just try removing the !filesize() part, and then try executing the function.

I commented out the entire if() condition, it makes no difference.  Maybe I 
have not made this clear enough: the problem is not in getting inside the 
loop.  The function *is* executing the loop, and *is* reaching the fwite() 
line as well as continuing without error past that line.  The frustrating 
part is that fwrite() is writing an empty string to the file instead of 
using the $content variable (which, when echoed immediately before that 
line, is definitely not empty/null).

> But maybe I just don't understand what you are trying to write and why.
> Could you be a little more specific what data is being saved in the file,
> and what is in the file already?

Sometimes the file has data, sometimes it doesn't; sometimes the file 
exists, sometimes it does.  Right now, unfortunately, the file remains 
empty. I'm trying to fill it with a large block of dynamically generated 
HTML which will then be used as a static include file for current and 
subsequent requests.



> "CC Zona" <[EMAIL PROTECTED]> wrote in message
> 9bebi3$133$[EMAIL PROTECTED]">news:9bebi3$133$[EMAIL PROTECTED]...
> > > > This function suddenly stopped working, and I just can't seem to
> figure
> > > out
> > > > why.  The only change made recently is that now the value of $force at
> > > > calltime is sometimes true instead of being undefined or null.
> > > >
> > > > build_file("file_content","/path/to/file.inc","w",TRUE);
> > > >
> > > > function build_file($func_name,$filepath,$mode="w",$force=FALSE)
> > > >    {
> > > >    if($force or !file_exists($filepath) or !filesize($filepath))
> //echo
> > > > filesize($filepath) shows '0'
> > > >       {
> > > >       $content=$func_name(); //echo $content shows it's all there
> > > >        $fp=fopen($filepath,$mode);
> > > >        fwrite($fp,$content);
> > > >        rewind($fp); #temp test
> > > >       $read_back=fread($fp,100000); #temp test
> > > >       echo "<p>file content:</p>\n $read_back"; #temp test, displays
> > > nothing
> > > >      fclose($fp);
> > > >       }
> > > >    }
> > > >
> > > > I've tried putting echoes and "or die('Error on __LINE__')" on every
> line,
> > > > checked all the variable values, and found no answers from that.
> > > > Everything shows exactly as it should be except that the content that
> > > > echoes out so nicely *doesn't ever get written to the file*.  The
> function
> > > > runs to the end without error and the file's modification date is even
> > > > updated.  But the file remains empty. I'm probably missing something
> > > > ridiculously obvious, but would someone please be kind enough to point
> out
> > > > what it is?  Thank you!!
> >
> > > What is this:
> > >
> > > !filesize($filepath)
> >
> > If filesize is zero (which it is <groan>), then do the rest (which it
> > does--except the content it fetches never makes it into the file it writes
> > to.  How that can be, I dunno, but that apparently is what it's doing...)
> >
> > > Add this above your if loop:
> > >
> > > $filesize = filesize($filepath);
> > > echo $filesize;
> >
> > Already tried echoing that and all the other values.  Filesize is 0.
> >
> > > That might be causing your loop not to execute...if not, I'm not sure
> what's
> > > wrong.
> >
> > I don't get it.  It should work.  It did work.  Suddenly it's not.

-- 
CC




> if($force or !file_exists($filepath) or !filesize($filepath))

May I suggest

if ($force || (!file_exists($filepath)) || (!filesize($filepath)))

Probably won't make much difference, but I've never used the "or"
clause and cannot vouch for it's effectiveness.

Also, put a check in after the fopen() call and make sure you're
able to open up the file correctly.

Perhaps and fflush() call before the rewind() call to ensure that
the file buffer's actually written to disk before you try to re-read it?

'Luck

-Szii


----- Original Message -----
From: CC Zona <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 12:06 PM
Subject: Re: [PHP] fwrite not writing


> In article <9bejks$gl6$[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] ("Plutarck") wrote:
>
> > I'm not sure why it suddenly stopped working, but let's see if you
actually
> > need it to work.
> >
> > First of all, I take it that you have content which you want to write
into a
> > file. Correct?
> >
> > If so, why does it matter if the file you want to write it to has data
> > anyway? If you are just going to add data into it, isn't it ok that it
is a
> > zerolength file?
>
> It is needed.  I have a dynamically generated page.  Most of the content
> needs to be re-generated with every request.  But some of it needs to be
> re-generated far less often.  Rather than unnecessarily hit the db every
> time to get the exact same content, that content gets cached to an include
> file.  This function checks whether that file needs to get a content
> refresh, and if so rewrites that content.  (I'm not adding data to the
> file, I'm overwriting it.)
>
> > Or is the problem that the file is _not_ actually zerolength, but PHP
says
> > it's zerolength anyway?
>
> Nope, it's really zero length.  The filesystem agrees with PHP, and when I
> open it in a text editor the file is empty.
>
> > Just try removing the !filesize() part, and then try executing the
function.
>
> I commented out the entire if() condition, it makes no difference.  Maybe
I
> have not made this clear enough: the problem is not in getting inside the
> loop.  The function *is* executing the loop, and *is* reaching the fwite()
> line as well as continuing without error past that line.  The frustrating
> part is that fwrite() is writing an empty string to the file instead of
> using the $content variable (which, when echoed immediately before that
> line, is definitely not empty/null).
>
> > But maybe I just don't understand what you are trying to write and why.
> > Could you be a little more specific what data is being saved in the
file,
> > and what is in the file already?
>
> Sometimes the file has data, sometimes it doesn't; sometimes the file
> exists, sometimes it does.  Right now, unfortunately, the file remains
> empty. I'm trying to fill it with a large block of dynamically generated
> HTML which will then be used as a static include file for current and
> subsequent requests.
>
>
>
> > "CC Zona" <[EMAIL PROTECTED]> wrote in message
> > 9bebi3$133$[EMAIL PROTECTED]">news:9bebi3$133$[EMAIL PROTECTED]...
> > > > > This function suddenly stopped working, and I just can't seem to
> > figure
> > > > out
> > > > > why.  The only change made recently is that now the value of
$force at
> > > > > calltime is sometimes true instead of being undefined or null.
> > > > >
> > > > > build_file("file_content","/path/to/file.inc","w",TRUE);
> > > > >
> > > > > function build_file($func_name,$filepath,$mode="w",$force=FALSE)
> > > > >    {
> > > > >    if($force or !file_exists($filepath) or !filesize($filepath))
> > file://echo
> > > > > filesize($filepath) shows '0'
> > > > >       {
> > > > >       $content=$func_name(); file://echo $content shows it's all
there
> > > > >        $fp=fopen($filepath,$mode);
> > > > >        fwrite($fp,$content);
> > > > >        rewind($fp); #temp test
> > > > >       $read_back=fread($fp,100000); #temp test
> > > > >       echo "<p>file content:</p>\n $read_back"; #temp test,
displays
> > > > nothing
> > > > >      fclose($fp);
> > > > >       }
> > > > >    }
> > > > >
> > > > > I've tried putting echoes and "or die('Error on __LINE__')" on
every
> > line,
> > > > > checked all the variable values, and found no answers from that.
> > > > > Everything shows exactly as it should be except that the content
that
> > > > > echoes out so nicely *doesn't ever get written to the file*.  The
> > function
> > > > > runs to the end without error and the file's modification date is
even
> > > > > updated.  But the file remains empty. I'm probably missing
something
> > > > > ridiculously obvious, but would someone please be kind enough to
point
> > out
> > > > > what it is?  Thank you!!
> > >
> > > > What is this:
> > > >
> > > > !filesize($filepath)
> > >
> > > If filesize is zero (which it is <groan>), then do the rest (which it
> > > does--except the content it fetches never makes it into the file it
writes
> > > to.  How that can be, I dunno, but that apparently is what it's
doing...)
> > >
> > > > Add this above your if loop:
> > > >
> > > > $filesize = filesize($filepath);
> > > > echo $filesize;
> > >
> > > Already tried echoing that and all the other values.  Filesize is 0.
> > >
> > > > That might be causing your loop not to execute...if not, I'm not
sure
> > what's
> > > > wrong.
> > >
> > > I don't get it.  It should work.  It did work.  Suddenly it's not.
>
> --
> CC
>
> --
> PHP General 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]





Can someone help me with an elementary cookie problem?

I want to capture a variable, write to a cookie, and be able to access it
from other pages.

I've done that, and it works well....

BUT, if I capture the same variable a second time (with a different value),
it still remembers the first value, not the second.  The only way I can get
it to understand the second value is to exit my browser and start over.

What am I doing wrong?

Thanks in advance,

KennM






Each time you change the value you need to re-set the cookie using
SetCookie() again
----- Original Message -----
From: "kmurrah" <[EMAIL PROTECTED]>
To: "PHP-GENERAL" <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 3:15 PM
Subject: [PHP] siimple cookie problem


> Can someone help me with an elementary cookie problem?
>
> I want to capture a variable, write to a cookie, and be able to access it
> from other pages.
>
> I've done that, and it works well....
>
> BUT, if I capture the same variable a second time (with a different
value),
> it still remembers the first value, not the second.  The only way I can
get
> it to understand the second value is to exit my browser and start over.
>
> What am I doing wrong?
>
> Thanks in advance,
>
> KennM
>
>
>
> --
> PHP General 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]
>





Also, try deleting the cookie:
Setcookie("name")
then setting it again. Some browsers all have cookie problems I've heard
also. Have you hit refresh?
----- Original Message -----
From: "kmurrah" <[EMAIL PROTECTED]>
To: "PHP-GENERAL" <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 3:15 PM
Subject: [PHP] siimple cookie problem


> Can someone help me with an elementary cookie problem?
>
> I want to capture a variable, write to a cookie, and be able to access it
> from other pages.
>
> I've done that, and it works well....
>
> BUT, if I capture the same variable a second time (with a different
value),
> it still remembers the first value, not the second.  The only way I can
get
> it to understand the second value is to exit my browser and start over.
>
> What am I doing wrong?
>
> Thanks in advance,
>
> KennM
>
>
>
> --
> PHP General 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]
>





Can you use the above function to set the error
handler to a custom class?  If so, how?  I've been
having no luck no matter what I do...

Chris




If I'm not mistaken set_error_handler() takes a string that is the name of 
a function, I am sure in that function you can instantiate whatever class 
you want.

morgan

At 03:57 PM 4/16/2001, Boget, Chris wrote:
>Can you use the above function to set the error
>handler to a custom class?  If so, how?  I've been
>having no luck no matter what I do...
>
>Chris




> If I'm not mistaken set_error_handler() takes a string that 
> is the name of a function, I am sure in that function you can 
> instantiate whatever class you want.

I thought about that.  But ideally, what I'm trying to do is
trap the errors with a class method (after instantiating) 
then print out or handle the errors all at once.  
Kind of like this:

<pseudocode>

$myErrors = new ErrorClass;

$old_error_handler = set_error_handler( "myErrors->handler" );

// all of these will be caught with my class' method
trigger_error( "Error 1", E_USER_WARNING );
trigger_error( "Error 2", E_USER_WARNING );
trigger_error( "Error 3", E_USER_WARNING );

$myErrors->printAllErrors();

</pseudocode>

Or something along those lines.  Using the function to instiate the
class and process the error basically makes the class moot.  Why
would you really need the class in the first place?  You would just
have the function do all the work.

Chris




> If I'm not mistaken set_error_handler() takes a string that 
> is the name of a function, I am sure in that function you 
> can instantiate whatever class you want.

After thinking about it some more, I'm doing this.  Not sure
if this is the best way to go about it, but it allows me to do
what I want:

<?

function errorWrapperFunction( ... error_handler_vars ... ) {
  
  global $ErrorClassName;

  $ErrorClassName->errorHandlerMethod( ... error_handler_vars ... );

}

class ErrorHandlerClass {

  // constructor
  function ErrorHandlerClass() {

    $GLOBALS["ErrorClassName"] = get_class( $this );

  }
}

$old_error_handler = set_error_handler( "errorWrapperFunction" );

?>

That way, I can still use my class to do everything else and handle
the errors when and where I need/want.

Chris




Do realize, of course, that you can return a dataset from a database in XML,
and store it client side.  Wanna sort by name?  Reorg the dataset.  In HTML
you'll have to make another round trip.  Wanna see your data sorted by time?
Reorg the dataset.  XML, while a little more tricky, does have some cool
features
that HTML just doesn't have.

Also, have you ever done inter-company data transfers?  How about to 8
different
people?  You write an XSL sheet for each one, and and XSLT.  Save yourself
days on import/export/data conversion routines, as well as validation of
"good"
data across the link.

True, XML's not the end-all be-all technology, but just another tool.
You choose not to learn it, that's all good; maybe you'll never use it.
But if you don't know it, at least a little bit, you may end up doing more
work in the long run because you won't recognize the instances where
XML will fit in beautifully and save you time.

Sure, you(generic form) can code PHP without any other programming knowledge
at all.
Sure, you(generic form) can even do it well without any other programming
knowledge.
But I guarantee you that even 1 "C" class, or better yet, a few programming
classes
will make a huge difference in your coding style, your ability, and your
knowledge of
what's "really going on" and how to optimise it.

XML, like the above example, is just another tool - just like a programming
language.
Sure, you may not need it, but once you have it, you'll find uses for it.

Peace, love, code.
-Szii


----- Original Message -----
From: Jason Caldwell <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 14, 2001 2:44 PM
Subject: Re: [PHP] What's XML's Purpose??


> amen brother!
>
>
> ""Plutarck"" <[EMAIL PROTECTED]> wrote in message
> 9baam8$6sh$[EMAIL PROTECTED]">news:9baam8$6sh$[EMAIL PROTECTED]...
> > I use to be really enthusiastically pro-XML just as I was getting into
> PHP,
> > but now I've basically taken a "XML shmexXML" approach. I get the
initial
> > attraction, but I would think the love would fade off a bit.
> >
> > The key that so many people seem to forget is the best way to do HTML is
> > with, *gasp*, HTML!
> >
> > If you just want a webpage, XML is using a canon to kill a fly. It's
like
> > creating classes and objects in PHP for sending text emails.
> >
> > Sure you can do it...but why?
> >
> > XML is new. Common society doesn't do well with new. They always manage
to
> > screw it up somehow.
> >
> > XML started as an extensible markup language...that's it. That's all it
> was
> > supposed to do! Now people are using it to query databases, and concoct
> > entire search engines, and they are trying to use it to control access
to
> > restricted data, etc etc.
> >
> > It's the same thing that happened with Java. People just aren't good
with
> > "new".
> >
> >
> > XML is nice, and for some things it's even great. But it's not the death
> of
> > plain old HTML, just like ISDN didn't kill POTS (remember when ISDN was
> "the
> > future of telecom"?).
> >
> > I fear that there are too many cooks in the kitchen on XML, all with a
> > seasoning all their own that they are dead set on adding to the broth.
> >
> >
> > But for me, I say let people play with their Java and XML and new
fangled
> > widgets. I'll take my PHP and plain-old HTML, and I'll create twice as
> much
> > material with just as high a quality, and I won't need to spend an extra
> > minute learning a bleeding-edge technology.
> >
> > Life's too short to spend it learning how to live it. Translation:
Better
> to
> > program than to learn yet _another_ language.
> >
> >
> > --
> > Plutarck
> > Should be working on something...
> > ...but forgot what it was.
> >
> >
> > ""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message
> > 002001c0c506$c70d7f00$0d1012d1@null">news:002001c0c506$c70d7f00$0d1012d1@null...
> > > thanks that helped
> > > I stll think it sounds like its more geared for the MS crowd
> > > ----- Original Message -----
> > > From: "Brian Clark" <[EMAIL PROTECTED]>
> > > To: "PHP is not a drug." <[EMAIL PROTECTED]>
> > > Sent: Saturday, April 14, 2001 3:29 PM
> > > Subject: Re: [PHP] What's XML's Purpose??
> > >
> > >
> > > > Hi Chris,
> > > >
> > > > @ 12:01:45 AM on 4/14/2001, Chris Anderson wrote:
> > > >
> > > > > Am I missing something here?
> > > >
> > > > This has been discussed many times. There was an extremely long
thread
> > > > last year about XML, but I can't find it in the archives.
> > > >
> > > > Here's a good start:
> > > >
> > > > http://marc.theaimsgroup.com/?l=php-general&m=97969195010857&w=2
> > > >
> > > > Use the 'next in thread' link to follow the thread.
> > > >
> > > > -Brian
> > > > --
> > > >  PGP is spoken here: 0xE4D0C7C8
> > > >  Please, DO NOT carbon copy me on list replies.
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General 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]
> > > >
> > >
> > >
> > > --
> > > PHP General 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]
> > >
> >
> >
> >
> > --
> > PHP General 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]
> >
>
>
>
> --
> PHP General 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]





Hi there

Could someone tell me how do I compile a php module.

look, I mean compile fro example the imap module as an external module so I can call 
it from php.ini

Yes yes yes I know I can compile it inside the PHP binary, but I need to know how to 
make the mod_imap.so mod_mysql.co, etc
any idea ?

Please e-mail me directly I'm not subscribed to the list

---------------------------------------------------------------------
Yurais Fernández Leal 
Systems Administrator & Web Developer
Medical University - Santiago de Cuba
[EMAIL PROTECTED]
http://facimed.scu.sld.cu/
Phone: +53(226)-654204
(home) +53(226)-651556
ICQ: 33792610






Merhabalar,

firstly do you use windows or linux?
id you use windows you shoul give the session_save_path to the script. (
session_save_path("c:\\user\\tmp");  )

if you use linux and no changes in your .ini files, your sessions store
in /tmp
directory...

<?php
session_start();
$id = 123;
session_register('id');
?>
<html>
<head>
 <title></title>
</head>
<body>
<?php
 echo $id;
?>
</body>
</html>

Kolay Gele...
Mesut...



SERKAN BALKANLI (EBÝ Bþk.-Analist Prog.) wrote:

>  i am starting and registering session variable succesfully  that i can see
> the file on the server ,  but when it comes to use or display i can not ,
> the variable has no value ... the "session.save_handler      = files"  is in
> php.ini , i tried to change it to user but that occured a fatal error etc..
> So shortly what is the thing that i am missing
> thanks alot
>
> --
> PHP General 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]




Hi Guys,

I have a question about the way PHP handles var/strings.

Let's say i have this URL: http://foo.bar.com/?login.
And in my script i have this code:

if($login) { echo "blab"; } or 
if(isset($login)) { echo "blab"; }

It always returns FALSE. I think that is because the string
is empty. Shouldn't PHP, even if a var is empty, put it in
his var-list?

Is there another way to do what i want?

Thanks,

Jeroen Geusebroek






Hi Guys,

I have a question about the way PHP handles var/strings.

Let's say i have this URL: http://foo.bar.com/?login.
And in my script i have this code:

if($login) { echo "blab"; } or 
if(isset($login)) { echo "blab"; }

It always returns FALSE. I think that is because the string
is empty. Shouldn't PHP, even if a var is empty, put it in
his var-list?

Is there another way to do what i want?

Thanks,

Jeroen Geusebroek






Add an "=" on the end of your url. Viola.


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


""Jeroen Geusebroek"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Guys,
>
> I have a question about the way PHP handles var/strings.
>
> Let's say i have this URL: http://foo.bar.com/?login.
> And in my script i have this code:
>
> if($login) { echo "blab"; } or
> if(isset($login)) { echo "blab"; }
>
> It always returns FALSE. I think that is because the string
> is empty. Shouldn't PHP, even if a var is empty, put it in
> his var-list?
>
> Is there another way to do what i want?
>
> Thanks,
>
> Jeroen Geusebroek
>
>
>
> --
> PHP General 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]
>






Actually, I meant the instrument LOL ;)

So as I would pronounce it IRL, "vee-O-luh". I use to spell it wrong, and
was notified of it, but I've decided to just use viola on purpose. I
actually litterally pronounce it "viola".

Some would argue that the majority of people think I just do it to annoy
them. I just like the way "viola" sounds :)

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


----- Original Message -----
From: "Brian Clark" <[EMAIL PROTECTED]>
To: "Plutarck" <[EMAIL PROTECTED]>
Sent: Monday, 16. April 2001 16:54
Subject: Re: [PHP] var question


> Hi Plutarck,
>
> @ 5:43:35 PM on 4/16/2001, Plutarck wrote:
>
> > Add an "=" on the end of your url. Viola.
>
> Heheh, I think you meant Voila which is like "there you are" in
> French?
>
> Viola is either a) Any of the numerous plants of the genus Viola, or
> b) Slightly larger than a violin, tuned a fifth lower.
>
> ;-)
>
> -Brian
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com





Note: Yes, I meant string instrument. Any references to YoYo Ma will be
dealt with swiftly and severly.


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


""Plutarck"" <[EMAIL PROTECTED]> wrote in message
9bfp5e$169$[EMAIL PROTECTED]">news:9bfp5e$169$[EMAIL PROTECTED]...
> Add an "=" on the end of your url. Viola.
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
> ""Jeroen Geusebroek"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi Guys,
> >
> > I have a question about the way PHP handles var/strings.
> >
> > Let's say i have this URL: http://foo.bar.com/?login.
> > And in my script i have this code:
> >
> > if($login) { echo "blab"; } or
> > if(isset($login)) { echo "blab"; }
> >
> > It always returns FALSE. I think that is because the string
> > is empty. Shouldn't PHP, even if a var is empty, put it in
> > his var-list?
> >
> > Is there another way to do what i want?
> >
> > Thanks,
> >
> > Jeroen Geusebroek
> >
> >
> >
> > --
> > PHP General 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]
> >
>
>
>
> --
> PHP General 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]
>






You can also look at environment variable $QUERY_STRING. For example,

         if ($HTTP_SERVER_VARS['QUERY_STRING'] == 'login') {
                 ...do log in procedure

If register_globals is on, all you need is

         if ($QUERY_STRING == 'login')

If you might be passing other parameters in the URL, and want to ignore 
case, you could use something like:

         if (eregi('login', $QUERY_STRING)) {

This would match

         www.blah.com?login
         www.blah.com?LogIn
         www.blah.com?login&user=herman_hollerith

but it would also match

         www.blah.com?sloginthemud
         www.blah.com?login0

So, a little regular expression twiddling might be in order.

For more info, see:

http://www.php.net/manual/en/language.variables.predefined.php
http://www.php.net/manual/en/ref.regex.php
http://www.php.net/manual/en/ref.pcre.php


         -steve



At 02:43 PM 4/16/01 , Plutarck wrote:
>Add an "=" on the end of your url. Viola.
>
>
>--
>Plutarck
>Should be working on something...
>...but forgot what it was.
>
>
>""Jeroen Geusebroek"" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi Guys,
> >
> > I have a question about the way PHP handles var/strings.
> >
> > Let's say i have this URL: http://foo.bar.com/?login.
> > And in my script i have this code:
> >
> > if($login) { echo "blab"; } or
> > if(isset($login)) { echo "blab"; }
> >
> > It always returns FALSE. I think that is because the string
> > is empty. Shouldn't PHP, even if a var is empty, put it in
> > his var-list?
> >
> > Is there another way to do what i want?
> >
> > Thanks,
> >
> > Jeroen Geusebroek
> >


+------------------------------------------------------------------------+
| Steve Edberg                           University of California, Davis |
| [EMAIL PROTECTED]                                     (530)754-9127 |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+---------------------- Gort, Klaatu barada nikto! ----------------------+





If you strip slashes, it will make a security hole. For example, SELECT * FROM tablename WHERE name = '$name'; what if $name is \'garbage\';DROP TABLE tablename;SELECT \'something After stripslashes($name) SELECT * FROM table WHERE name = 'garbage';DROP TABLE tablename;SELECT 'something'; Regards, -- Yasuo Ohgaki ""Noah Spitzer-Williams"" <[EMAIL PROTECTED]> wrote in message 9bf7ec$m1m$[EMAIL PROTECTED]">news:9bf7ec$m1m$[EMAIL PROTECTED]... > would there be any problems caused if i used the stripslashes() function on > all posted variables from a form to eliminate sql query errors? > > - Noah > > > > -- > PHP General 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] >



Jesus that's pretty scary! So how should i go about doing this?


""Yasuo Ohgaki"" <[EMAIL PROTECTED]> wrote in message
9bflce$9p5$[EMAIL PROTECTED]">news:9bflce$9p5$[EMAIL PROTECTED]...
> If you strip slashes, it will make a security hole.
>
> For example,
>
> SELECT * FROM tablename WHERE name = '$name';
> what if $name is
> \'garbage\';DROP TABLE tablename;SELECT \'something
>
> After stripslashes($name)
> SELECT * FROM table WHERE name = 'garbage';DROP TABLE tablename;SELECT
> 'something';
>
> Regards,
> --
> Yasuo Ohgaki
>
>
> ""Noah Spitzer-Williams"" <[EMAIL PROTECTED]> wrote in message
> 9bf7ec$m1m$[EMAIL PROTECTED]">news:9bf7ec$m1m$[EMAIL PROTECTED]...
> > would there be any problems caused if i used the stripslashes() function
on
> > all posted variables from a form to eliminate sql query errors?
> >
> >  - Noah
> >
> >
> >
> > --
> > PHP General 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]
> >
>
>
> --
> PHP General 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]
>






So sprach Noah Spitzer-Williams am Mon, Apr 16, 2001 at 12:45:43PM -0400:
> would there be any problems caused if i used the stripslashes() function on
> all posted variables from a form to eliminate sql query errors?

Uhm, why stripslashes() the values?  Wouldn't it be better to addslashes()
the value, and then when retrieving the values from the database to
stripslashes() the value?

With addslashes(), you'd be sure that everything is properly escaped.

BTW: Where's the difference between addslashes() and the undocumented
function mysql_escape_string()? ( see http://php.net/ChangeLog-4.php#4.0.3 )

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 2 hours 13 minutes




If you strip slashes, it will make a security hole. For example, SELECT * FROM tablename WHERE name = '$name'; what if $name is \'garbage\';DROP TABLE tablename;SELECT \'something After stripslashes($name) SELECT * FROM table WHERE name = 'garbage';DROP TABLE tablename;SELECT 'something'; Regards, -- Yasuo Ohgaki ""Noah Spitzer-Williams"" <[EMAIL PROTECTED]> wrote in message 9bf7ec$m1m$[EMAIL PROTECTED]">news:9bf7ec$m1m$[EMAIL PROTECTED]... > would there be any problems caused if i used the stripslashes() function on > all posted variables from a form to eliminate sql query errors? > > - Noah > > > > -- > PHP General 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] >



Suggestions so far have focused on parts of the function other than fwrite, 
so I'm trying again with a stripped-down example.  After spending many 
hours trying to make this very simple function work again, I'm beginning to 
think fwrite in broken--either in 4.0.4pl1 (?!) or in my build of it (it 
was working fine before...).  Before filing a bug report, would a few 
people test whether this fails to write on their system too? Thank you!


function build_file()
   {
   $fp=fopen("/path/to/directory/test.inc","w") or die("ERROR on fopen" . 
$php_errormsg); 
   fwrite($fp,"<p>Hi, I'm some test content</p>",100000000) or die("ERROR: 
fwrite " . $php_errormsg);
   fclose($fp) or die("ERROR: fclose" . $php_errormsg);
   }

build_file(); //no errors and file modification date is updated

echo "<p>Begin include...<p>"; //ok
include("/path/to/directory/test.inc"); //NOTHING!
echo "<p>...End include<p>"; //ok

(Checking from the commandline, the file is definitely being set to empty.  
It's writing an empty string to the file instead of writing the specified 
content.)

-- 
CC




Have you checked the following things:
A) if the file is actually there?
B)Is it an include error
C)Do you have the required permissions for write access and for including
from that directory?
----- Original Message -----
From: "CC Zona" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 5:34 PM
Subject: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1,
Apache/1.3.14


> Suggestions so far have focused on parts of the function other than
fwrite,
> so I'm trying again with a stripped-down example.  After spending many
> hours trying to make this very simple function work again, I'm beginning
to
> think fwrite in broken--either in 4.0.4pl1 (?!) or in my build of it (it
> was working fine before...).  Before filing a bug report, would a few
> people test whether this fails to write on their system too? Thank you!
>
>
> function build_file()
>    {
>    $fp=fopen("/path/to/directory/test.inc","w") or die("ERROR on fopen" .
> $php_errormsg);
>    fwrite($fp,"<p>Hi, I'm some test content</p>",100000000) or die("ERROR:
> fwrite " . $php_errormsg);
>    fclose($fp) or die("ERROR: fclose" . $php_errormsg);
>    }
>
> build_file(); //no errors and file modification date is updated
>
> echo "<p>Begin include...<p>"; //ok
> include("/path/to/directory/test.inc"); //NOTHING!
> echo "<p>...End include<p>"; //ok
>
> (Checking from the commandline, the file is definitely being set to empty.
> It's writing an empty string to the file instead of writing the specified
> content.)
>
> --
> CC
>
> --
> PHP General 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]
>





In article <002b01c0c697$9628ee00$8b1412d1@null>,
 [EMAIL PROTECTED] ("Chris Anderson") wrote:

> Have you checked the following things:
> A) if the file is actually there?

Yes.  (And even when the file is not there,  fopen() correctly re-creates 
it.  And fwrite continued to write the wrong--empty--string to it.)

> B)Is it an include error

Checked, and no.  The file is being included.  It just doesn't have any 
content to display.

> C)Do you have the required permissions for write access and for including
> from that directory?

Permissions: yes (the file is updating, just with the wrong content)
Including: yes (it's in the include path too)

I've also checked that no other fuction is writing to the same file and 
that the function is not recursing (to, say, write the correct content on 
one pass then overwrite with empty string on the next pass).  No to those 
too. 


> ----- Original Message -----
> From: "CC Zona" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 16, 2001 5:34 PM
> Subject: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1,
> Apache/1.3.14
> 
> 
> > Suggestions so far have focused on parts of the function other than
> fwrite,
> > so I'm trying again with a stripped-down example.  After spending many
> > hours trying to make this very simple function work again, I'm beginning
> to
> > think fwrite in broken--either in 4.0.4pl1 (?!) or in my build of it (it
> > was working fine before...).  Before filing a bug report, would a few
> > people test whether this fails to write on their system too? Thank you!
> >
> >
> > function build_file()
> >    {
> >    $fp=fopen("/path/to/directory/test.inc","w") or die("ERROR on fopen" .
> > $php_errormsg);
> >    fwrite($fp,"<p>Hi, I'm some test content</p>",100000000) or die("ERROR:
> > fwrite " . $php_errormsg);
> >    fclose($fp) or die("ERROR: fclose" . $php_errormsg);
> >    }
> >
> > build_file(); //no errors and file modification date is updated
> >
> > echo "<p>Begin include...<p>"; //ok
> > include("/path/to/directory/test.inc"); //NOTHING!
> > echo "<p>...End include<p>"; //ok
> >
> > (Checking from the commandline, the file is definitely being set to empty.
> > It's writing an empty string to the file instead of writing the specified
> > content.)

-- 
CC




come to think of it, why are you passing 3 arguements to fwrite()?
----- Original Message -----
From: "CC Zona" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 5:34 PM
Subject: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1,
Apache/1.3.14


> Suggestions so far have focused on parts of the function other than
fwrite,
> so I'm trying again with a stripped-down example.  After spending many
> hours trying to make this very simple function work again, I'm beginning
to
> think fwrite in broken--either in 4.0.4pl1 (?!) or in my build of it (it
> was working fine before...).  Before filing a bug report, would a few
> people test whether this fails to write on their system too? Thank you!
>
>
> function build_file()
>    {
>    $fp=fopen("/path/to/directory/test.inc","w") or die("ERROR on fopen" .
> $php_errormsg);
>    fwrite($fp,"<p>Hi, I'm some test content</p>",100000000) or die("ERROR:
> fwrite " . $php_errormsg);
>    fclose($fp) or die("ERROR: fclose" . $php_errormsg);
>    }
>
> build_file(); //no errors and file modification date is updated
>
> echo "<p>Begin include...<p>"; //ok
> include("/path/to/directory/test.inc"); //NOTHING!
> echo "<p>...End include<p>"; //ok
>
> (Checking from the commandline, the file is definitely being set to empty.
> It's writing an empty string to the file instead of writing the specified
> content.)
>
> --
> CC
>
> --
> PHP General 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]
>





alright try removing the byte length identifier
----- Original Message -----
From: "Chris Anderson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 1:20 PM
Subject: Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1,
Apache/1.3.14


> come to think of it, why are you passing 3 arguements to fwrite()?
> ----- Original Message -----
> From: "CC Zona" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 16, 2001 5:34 PM
> Subject: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1,
> Apache/1.3.14
>
>
> > Suggestions so far have focused on parts of the function other than
> fwrite,
> > so I'm trying again with a stripped-down example.  After spending many
> > hours trying to make this very simple function work again, I'm beginning
> to
> > think fwrite in broken--either in 4.0.4pl1 (?!) or in my build of it (it
> > was working fine before...).  Before filing a bug report, would a few
> > people test whether this fails to write on their system too? Thank you!
> >
> >
> > function build_file()
> >    {
> >    $fp=fopen("/path/to/directory/test.inc","w") or die("ERROR on fopen"
.
> > $php_errormsg);
> >    fwrite($fp,"<p>Hi, I'm some test content</p>",100000000) or
die("ERROR:
> > fwrite " . $php_errormsg);
> >    fclose($fp) or die("ERROR: fclose" . $php_errormsg);
> >    }
> >
> > build_file(); //no errors and file modification date is updated
> >
> > echo "<p>Begin include...<p>"; //ok
> > include("/path/to/directory/test.inc"); //NOTHING!
> > echo "<p>...End include<p>"; //ok
> >
> > (Checking from the commandline, the file is definitely being set to
empty.
> > It's writing an empty string to the file instead of writing the
specified
> > content.)
> >
> > --
> > CC
> >
> > --
> > PHP General 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]
> >
>
>
> --
> PHP General 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]
>
>





In article <006701c0c699$ad65cdc0$8b1412d1@null>,
 [EMAIL PROTECTED] ("Chris Anderson") wrote:

> come to think of it, why are you passing 3 arguements to fwrite()?

Whoops!  That's a typo left over from the last round of tests,  adding 
every optional argument just in case something wasn't really optional.  Of 
course the third argument actually belongs to fopen().  Though it shouldn't 
be needed there either.  (And yup, I just double-checked and it doesn't 
work without the typo either. <sigh>)

-- 
CC




I tried it, even with the byte length identifer it worked perfectly for me.
As a last ditch effort try changing the w to w+. If not then it sounds like
a configuration issue for the webserver or php. Dunno what settings though,
sorry couldn't be of more help.
----- Original Message -----
From: "CC Zona" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 10:48 PM
Subject: Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1,
Apache/1.3.14


> In article <006701c0c699$ad65cdc0$8b1412d1@null>,
>  [EMAIL PROTECTED] ("Chris Anderson") wrote:
>
> > come to think of it, why are you passing 3 arguements to fwrite()?
>
> Whoops!  That's a typo left over from the last round of tests,  adding
> every optional argument just in case something wasn't really optional.  Of
> course the third argument actually belongs to fopen().  Though it
shouldn't
> be needed there either.  (And yup, I just double-checked and it doesn't
> work without the typo either. <sigh>)
>
> --
> CC
>
> --
> PHP General 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]
>







Hi..

  I'm tring to use a php-script like cgi, but the only thing i got is
"Internal Server Error..."

 That's my test-script..
-----------------------------------------------------------
#!/bin/php -q

<?php
 echo "Content-type: text/html\n\n";

 echo "Hello World!\n";

?>
----------------------------------------------------

  I tried whithout "-q" and "echo "Content-....", but i got the same
error!

  That's my httpd_error.log
-----------------------------------------------------
[Mon Apr 16 17:19:24 2001] [error] [client 127.0.0.1] Premature end of
script headers: /home/httpd/cgi-bin/teste.cgi
----------------------------------------------------

  How can i do it? I have bash, perl, C, cgis working here, just my
php-script dosn't work.

  Before asking, Yeah, i need to exec it like cgi, 'cos that was the only
way that i find to use posix_setuid().

  Thanks...

     []s
    .~.  Ulysses Almeida
   / V \  [EMAIL PROTECTED]
 / (   ) \  Seja livre, use GNU/Linux! 
   ^^-^^





<?
$greeting = "Hello!"
echo "$greeting"
?>

<g>





Hi,

I'm currently working on a rather large site and have just completed the 
navigation portion of it.  I'd like to make use of server side includes so 
that if I have to make changes down the road, I won't have to chance 
potentially 100s of files.  Normally I use <!--#include 
file="filename.inc"--> with .asp and .shtml files, however, this does not 
seem to work for me using PHP 3.0.16 (the version my web host uses).

Is there an equivalent to <!--#include file="filename.inc"--> in PHP?  And 
will it work in version 3.0.16.  I've gone through the online manual but 
found nothing that would help in this situation.

Thanks
-Tim





> Is there an equivalent to <!--#include file="filename.inc"--> in 
> PHP?  And 
> will it work in version 3.0.16.  I've gone through the online manual but 
> found nothing that would help in this situation.

include("filename.inc");

or

require("filename.inc");

http://www.php.net/include
http://www.php.net/require

Enjoy,

James 'theFinn' Atkinson
http://www.phpbb.com




In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Tim Thorburn) wrote:

> Is there an equivalent to <!--#include file="filename.inc"--> in PHP?  And 
> will it work in version 3.0.16.  I've gone through the online manual but 
> found nothing that would help in this situation.

http://php.net/manual/en/function.virtual.php

-- 
CC




Tim,

Check out the include() and require() function of php.

Stefan

-----Original Message-----
From: Tim Thorburn [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 5:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] include files with PHP 3.0.16


Hi,

I'm currently working on a rather large site and have just completed the 
navigation portion of it.  I'd like to make use of server side includes so 
that if I have to make changes down the road, I won't have to chance 
potentially 100s of files.  Normally I use <!--#include 
file="filename.inc"--> with .asp and .shtml files, however, this does not 
seem to work for me using PHP 3.0.16 (the version my web host uses).

Is there an equivalent to <!--#include file="filename.inc"--> in PHP?  And 
will it work in version 3.0.16.  I've gone through the online manual but 
found nothing that would help in this situation.

Thanks
-Tim


-- 
PHP General 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'm setting cookies for a shopping cart and they are setting fine but they
will not delete. I've tried every way of deleting them and they just won't
go away. Someone please help.
--
Patrick Hanna
Database integration--E-commerce solutions
The Wentworth Company




Hi Pat,

@ 6:13:20 PM on 4/16/2001, Pat Hanna wrote:

> I'm setting cookies for a shopping cart and they are setting fine
> but they will not delete. I've tried every way of deleting them and
> they just won't go away. Someone please help.

http://www.php.net/manual/en/function.setcookie.php

Read Example 2.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.






I've tried that but they still don't go away.
----- Original Message ----- 
From: "Brian Clark" <[EMAIL PROTECTED]>
To: "PHP is not a drug." <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 6:23 PM
Subject: Re: [PHP] cookies


> Hi Pat,
> 
> @ 6:13:20 PM on 4/16/2001, Pat Hanna wrote:
> 
> > I'm setting cookies for a shopping cart and they are setting fine
> > but they will not delete. I've tried every way of deleting them and
> > they just won't go away. Someone please help.
> 
> http://www.php.net/manual/en/function.setcookie.php
> 
> Read Example 2.
> 
> -Brian
> --
>  PGP is spoken here: 0xE4D0C7C8
>  Please, DO NOT carbon copy me on list replies.
> 
> 
> 
> -- 
> PHP General 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]
> 





Hi Pat,

@ 6:21:59 PM on 4/16/2001, Pat Hanna wrote:

> I've tried that but they still don't go away.

Look for the cookie on your disk and remove it manually then. Look in
(making assumptions again that you're using Windows and IE)
c:\windows\cookies

In Netscape it's a single file, I believe, called cookies.txt in
a sub-directory of Netscape's installation directory.

In Opera, I have no idea.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.






Yasuo, I didn't quite follow this. What are those special characters below in your $name example? TIA Kirk > -----Original Message----- > If you strip slashes, it will make a security hole. > > For example, > > SELECT * FROM tablename WHERE name = '$name'; > what if $name is > \'garbage\';DROP TABLE tablename;SELECT \'something > > After stripslashes($name) > SELECT * FROM table WHERE name = 'garbage';DROP TABLE tablename;SELECT > 'something'; > > Regards, > -- > Yasuo Ohgaki



Hi,

Can anyone tell me if it is possible to statically build php3 and php4
modules into an apache binary?  I tried, but kept getting all these
errors from ld about multiply-defined functions such as:

        ld: fatal: symbol `second_arg_allow_ref' is multiply-defined:
                (file modules/php3/libphp3.a(internal_functions.o) and file
modules/php4/libphp4.a(zend_builtin_functions.o));

Thanks for any help...

Matt




Hi Matthew,

@ 6:24:49 PM on 4/16/2001, Matthew Mueller wrote:

> Can anyone tell me if it is possible to statically build php3 and
> php4 modules into an apache binary? I tried, but kept getting all
> these errors from ld about multiply-defined functions such as:

> ld: fatal: symbol `second_arg_allow_ref' is multiply-defined:
> (file modules/php3/libphp3.a(internal_functions.o) and file
> modules/php4/libphp4.a(zend_builtin_functions.o));

I could be wrong, but I don't think it's possible. You may have to
build them as DSOs.

http://www.php.net/manual/en/migration.php#migration.php4.with-php3

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.






Hello!

In a mysql_connect() it is possible to specify a path to the socket which
should be used for communicating with MySQL.

Now, when I connect thru a socket, is the datatransfer between PHP and MySQL
faster than when I connect via a (loop-)network?  I would assume so, because
with a socket, there's not the network layer in the way which has to be
taken care of.

Is this correct?

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 0 hours 45 minutes




Hi Alexander,

@ 6:55:58 PM on 4/16/2001, Alexander Skwar wrote:

...
> In a mysql_connect() it is possible to specify a path to the socket
> which should be used for communicating with MySQL.

Yes, it's in the documentation.

int mysql_connect ([string hostname [:port] [:/path/to/socket]
                   [, string username [, string password]]])

http://www.php.net/manual/en/function.mysql-connect.php

> Now, when I connect thru a socket, is the datatransfer between PHP
> and MySQL faster than when I connect via a (loop-)network? I would
> assume so, because with a socket, there's not the network layer in
> the way which has to be taken care of.

> Is this correct?

No earthly idea.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.






So sprach Brian Clark am Mon, Apr 16, 2001 at 07:17:43PM -0400:
> > In a mysql_connect() it is possible to specify a path to the socket
> > which should be used for communicating with MySQL.
> 
> Yes, it's in the documentation.

Please read again what I wrote....

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 1 hour 21 minutes




Hi Alexander,

@ 7:29:45 PM on 4/16/2001, Alexander Skwar wrote:

...
> Please read again what I wrote....

OK.

> In a mysql_connect() it is possible to specify a path to the socket
> which should be used for communicating with MySQL.

Yes. [string hostname [:port] [:/path/to/socket]

> Now, when I connect thru a socket, is the datatransfer between PHP
> and MySQL faster than when I connect via a (loop-)network?

No idea.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.






On Tue, Apr 17, 2001 at 01:29:45AM +0200, Alexander Skwar wrote:
> So sprach Brian Clark am Mon, Apr 16, 2001 at 07:17:43PM -0400:
> > > In a mysql_connect() it is possible to specify a path to the socket
> > > which should be used for communicating with MySQL.
> > 
> > Yes, it's in the documentation.
> 
> Please read again what I wrote....

I haven't to read the manual again. This is very well documented in the
manual. If I remember correctly, I have put this lines into the PHP
manual. 

-Egon

-- 
LinuxTag, Stuttgart, Germany: July 5-8 2001: http://www.linuxtag.de/
All known books about PHP and related books: http://php.net/books.php 
Concert Band of the University of Hohenheim: http://www.concert-band.de/
First and second bestselling book in German: http://www.php-buch.de/




> > Please read again what I wrote....
>
> OK.
>
> > In a mysql_connect() it is possible to specify a path to the socket
> > which should be used for communicating with MySQL.
>
> Yes. [string hostname [:port] [:/path/to/socket]

It's not a question.  It is a statement prefecaing the real question, which
was is connecting directly to a socket faster.





Hi Joe,

@ 8:04:08 PM on 4/16/2001, Joe Sheble (Wizaerd) wrote:

...
>> > In a mysql_connect() it is possible to specify a path to the socket
                          ^^^^^^^^^^^^^^

>> > which should be used for communicating with MySQL.
>>
>> Yes. [string hostname [:port] [:/path/to/socket]

> It's not a question. It is a statement prefecaing the real question,
> which was is connecting directly to a socket faster.

Ahhh, yes, I see that was stupid. Sorry, Alexander. :)

I guess it's time to go back into hibernation.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.






So sprach [EMAIL PROTECTED] am Tue, Apr 17, 2001 at 01:55:01AM +0200:
> I haven't to read the manual again. This is very well documented in the
> manual. If I remember correctly, I have put this lines into the PHP
> manual. 

Pardon me, but where is it very well documented what I asked about? 
Certainly not in the manual I always use:
http://php.net/manual/en/function.mysql-connect.php 

Just to clarify: I did not ask if it is possible to do so.  I've read this
myself in the very good manual and would certainly not ask such a question
here.

But maybe I'm wrong:  Where is the answer to my question "well documented"?

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 1 hour 55 minutes




So sprach Brian Clark am Mon, Apr 16, 2001 at 07:37:54PM -0400:
> > In a mysql_connect() it is possible to specify a path to the socket
> > which should be used for communicating with MySQL.
> 
> Yes. [string hostname [:port] [:/path/to/socket]

And again: There's no question in the sentence above, is there?  If I had
questions about this, I'd have said something like:

| In a mysql_connect(), is it possible to specify a path to the socket
| which should be used for communicating with MySQL?

> > Now, when I connect thru a socket, is the datatransfer between PHP
> > and MySQL faster than when I connect via a (loop-)network?
> 
> No idea.

Yes, I got that :))

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 1 hour 59 minutes




So sprach Brian Clark am Mon, Apr 16, 2001 at 08:01:04PM -0400:
> Ahhh, yes, I see that was stupid. Sorry, Alexander. :)

Ah, thanks Joe for clearing up this confusion :))

Now that this is sorted out:  What might be the best way to do some
benchmarking wrt. this?  (Links are fine)

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 2 hours 1 minute




Can you open a simple text file and store each line of that file in it's own
part of an array?

-David Serrano








Hi David,

@ 7:21:15 PM on 4/16/2001, David Serrano wrote:

> Can you open a simple text file and store each line of that file in it's own
> part of an array?

<?php
if(! $array = @file('/usr/local/src/fdiff.c'))
     die("can't read diff.c");

while(list($i,$line) = each($array))
{
   print "$i: $line\n";
}
?>

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.






Ok, I think I get it, though I have one more question to access a specific
line of that array would it just be as simple as $array[2]?

-David Serrano

"Brian Clark" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

> <?php
> if(! $array = @file('/usr/local/src/fdiff.c'))
>      die("can't read diff.c");
>
> while(list($i,$line) = each($array))
> {
>    print "$i: $line\n";
> }
> ?>







Hi David,

@ 7:35:06 PM on 4/16/2001, David Serrano wrote:

> Ok, I think I get it, though I have one more question to access a specific
> line of that array would it just be as simple as $array[2]?

Yes. Otherwise these may be of some help:

http://www.php.net/manual/en/function.fopen.php
http://www.php.net/manual/en/function.fgets.php
http://www.php.net/manual/en/function.fread.php


-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.






Ok thats what I though. Thanks for your time

-David Serrano

"Brian Clark" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi David,
>
> @ 7:35:06 PM on 4/16/2001, David Serrano wrote:
>
> > Ok, I think I get it, though I have one more question to access a
specific
> > line of that array would it just be as simple as $array[2]?
>
> Yes. Otherwise these may be of some help:
>
> http://www.php.net/manual/en/function.fopen.php
> http://www.php.net/manual/en/function.fgets.php
> http://www.php.net/manual/en/function.fread.php
>
>
> -Brian
> --
>  PGP is spoken here: 0xE4D0C7C8
>  Please, DO NOT carbon copy me on list replies.
>
>
>
> --
> PHP General 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]
>






Greetings.

    Some of you are familiar with my latest project, a smaller community. I
have implemented almost everything I need, and I wish to thank those of you
who helped me with "which mail is new" and so forth. However, this problem
is quite worse I suppose, but I hope some of you has done something like
this before:

    Sessions.

I wish to keep track of every visitor. Not a counter or anything, but more
of when a person signs in, the users nickname will be bound to this session
ID which will keep track of the person is online or offline. I have solved
it like so:

    Whenever a person loggs in, I add it's name to a online.dat file. When
the user signs of, I remove the nickname thus the login time from the file.

PROBLEMS?? First one: User must click on "logout" to remove itself. Second:
It does not always remove itself.

Therefore, I ask: How can I create a new session for every visitor (so I
know how many are online at the time), bind this ID to its nickname (so one
row in a file would be: NICKNAME|SESSION_ID|DATE), and how can I make sure
that whenever the browser is closed or whatever, or after a certain time of
inactivity (3 minutes), the user is removed from the file.

All help is greatly appriciated and your name will be on the credits list
too.

- Richard






Nah... It's up to the browser. 8-bit text cannot be given any effects using
PHP.

- Richard

"Brandon Orther" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> Does anyone know of an image library that plugs right into php that has a
> blur function so I can create a drop shadow effect for text?
>
> Thanks
> Brandon
>
>
> --
> PHP General 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]
>






check the projects page on php.net for an extension called php_imlib.

On Tue, 17 Apr 2001 01:28:02 +0200, Richard ([EMAIL PROTECTED])
wrote:
>Nah... It's up to the browser. 8-bit text cannot be given any
>effects using
>PHP.
>
>- Richard
>
>"Brandon Orther" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> Hello,
>>
>> Does anyone know of an image library that plugs right into php
>>that has a
>> blur function so I can create a drop shadow effect for text?
>>
>> Thanks
>> Brandon
>>
>>
>> --
>> PHP General 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: php-list-
>>[EMAIL PROTECTED]
>>
>
>
>
>--
>PHP General 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: php-list-
>[EMAIL PROTECTED]






Hiya, 

I was wondering 

1: is there a way to populate a list box from a db?

2: if some one could point me in the right direction, with out actually giving a 
example, as to how to go about it as i've 
   got no idea

Thanks

Peter Houchin
[EMAIL PROTECTED]
=========================================================
     _____                              __   /\
    /_/_/_\                            /  |_/  \
   /_/_/_    __  __  __   __          /         \
   \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
 ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
 \_//_/_/ /_/_/_/ /_/ \/_/                    v
     ________   ________________________________________
    /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
   /_/_ _/_/ ______  __   __  /_/ ____      __     ______
  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
 /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
/_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
=========================================================
Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
************* We rent the dot in .COM!  **************
 




So sprach Peter Houchin am Tue, Apr 17, 2001 at 10:08:36AM +1000:
> 1: is there a way to populate a list box from a db?

Sure.

> 
> 2: if some one could point me in the right direction, with out actually giving a 
>example, as to how to go about it as i've 
>    got no idea

Uhm, no example?  I'll try.  ... failed *G*

<select name="Listbox" size="42"><?php
  $query = "SELECT ListboxText, ListboxValue FROM Table";
  $rs = mysql_select( $query );
  while( $row = mysql_fetch_object( $rs ) ){
    echo '<option value="';
    echo htmlentities( $row->ListboxValue );
    echo '">';
    echo htmlentities( $row->ListboxText );
  }
?></select>

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 2 hours 3 minutes




lol,  Thanks for your help Alexander :)

-----Original Message-----
From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 10:17 AM
To: Peter Houchin
Cc: Php-General@Lists. Php. Net
Subject: Re: [PHP] Populating HTML List boxes From DB


So sprach Peter Houchin am Tue, Apr 17, 2001 at 10:08:36AM +1000:
> 1: is there a way to populate a list box from a db?

Sure.

> 
> 2: if some one could point me in the right direction, with out actually giving a 
>example, as to how to go about it as i've 
>    got no idea

Uhm, no example?  I'll try.  ... failed *G*

<select name="Listbox" size="42"><?php
  $query = "SELECT ListboxText, ListboxValue FROM Table";
  $rs = mysql_select( $query );
  while( $row = mysql_fetch_object( $rs ) ){
    echo '<option value="';
    echo htmlentities( $row->ListboxValue );
    echo '">';
    echo htmlentities( $row->ListboxText );
  }
?></select>

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 2 hours 3 minutes




One thing I've come across and forgot to mention is

say in my db i have multiple values that are the same as well as different values... 
how can i restrict it to showing each value just once?

-----Original Message-----
From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 10:17 AM
To: Peter Houchin
Cc: Php-General@Lists. Php. Net
Subject: Re: [PHP] Populating HTML List boxes From DB


So sprach Peter Houchin am Tue, Apr 17, 2001 at 10:08:36AM +1000:
> 1: is there a way to populate a list box from a db?

Sure.

> 
> 2: if some one could point me in the right direction, with out actually giving a 
>example, as to how to go about it as i've 
>    got no idea

Uhm, no example?  I'll try.  ... failed *G*

<select name="Listbox" size="42"><?php
  $query = "SELECT ListboxText, ListboxValue FROM Table";
  $rs = mysql_select( $query );
  while( $row = mysql_fetch_object( $rs ) ){
    echo '<option value="';
    echo htmlentities( $row->ListboxValue );
    echo '">';
    echo htmlentities( $row->ListboxText );
  }
?></select>

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 2 hours 3 minutes




> say in my db i have multiple values that are the same as well 
> as different values... how can i restrict it to showing each 
> value just once?

Sounds like you want a "SELECT DISTINCT".

You might want to have a look at www.sqlcourse.com.

Jason




Thanks Jason... I've used SELECT DISTINCT ... now i doubt this has anything to do with 
SELECT DISTINCT as such but for some reason its only displaying the last vaule entered

<select name="device">
<?php
  $query ="SELECT DISTINCT device FROM 3backup ORDER BY device";
  $rs =mysql_query($query);
  $device = mysql_result($rs, 'device');
  while($row = mysql_fetch_object($rs)){
    echo '<option value="';
    echo $device;
    echo '">';
    echo $device;
        echo '</option>\n';
  }
?>
</select>

Any suggestions? 

Peter
-----Original Message-----
From: Jason Murray [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 11:12 AM
To: 'Peter Houchin'; Php-General@Lists. Php. Net
Subject: RE: [PHP] Populating HTML List boxes From DB


> say in my db i have multiple values that are the same as well 
> as different values... how can i restrict it to showing each 
> value just once?

Sounds like you want a "SELECT DISTINCT".

You might want to have a look at www.sqlcourse.com.

Jason




this 
while($row = mysql_fetch_object($rs)){ 
     echo '<option value="'; 
     echo $device; 
     echo '">'; 
     echo $device; 
        echo '</option>\n'; 
   } 

should be

  $query ="SELECT DISTINCT device FROM 3backup ORDER BY device"; 
  $rs =mysql_query($query); 
  while($row = mysql_fetch_row($rs)){ 
    echo '<option value="'; 
    echo $row[0]; 
    echo '">'; 
    echo $row[0]; 
    echo '</option>\n'; 
   } 

of course this is just one of many ways to do it

-- Shaun

On Monday 16 April 2001 20:48, Peter Houchin wrote:
> Thanks Jason... I've used SELECT DISTINCT ... now i doubt this has anything
> to do with SELECT DISTINCT as such but for some reason its only displaying
> the last vaule entered
 
> <select name="device">
> <?php
>   $query ="SELECT DISTINCT device FROM 3backup ORDER BY device";
>   $rs =mysql_query($query);
>   $device = mysql_result($rs, 'device');
>   while($row = mysql_fetch_object($rs)){
>     echo '<option value="';
>     echo $device;
>     echo '">';
>     echo $device;
>       echo '</option>\n';
>   }
> ?>
> </select>
> 
> Any suggestions? 
> 
> Peter
> -----Original Message-----
> From: Jason Murray [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 17, 2001 11:12 AM
> To: 'Peter Houchin'; Php-General@Lists. Php. Net
> Subject: RE: [PHP] Populating HTML List boxes From DB
> 
> 
>
> > say in my db i have multiple values that are the same as well 
> > as different values... how can i restrict it to showing each 
> > value just once?
>
> 
> Sounds like you want a "SELECT DISTINCT".
> 
> You might want to have a look at www.sqlcourse.com.
> 
> Jason




> <select name="device">
> <?php
>   $query ="SELECT DISTINCT device FROM 3backup ORDER BY device";
>   $rs =mysql_query($query);

$rs is now the result set for your SQL.

>   $device = mysql_result($rs, 'device');

This is wrong. Check the manual page for how you use mysql_result.
http://www.php.net/mysql-result

>   while($row = mysql_fetch_object($rs)){
>     echo '<option value="';
>     echo $device;
>     echo '">';
>     echo $device;
>       echo '</option>\n';
>   }

This is odd. Having pulled out the device (or tried to), you're now creating

an object and then not using it.

Try this:

<select name="device">
<?php
  $query = "SELECT DISTINCT device FROM 3backup ORDER BY device";
  $rs    = mysql_query($query);
  while($row = mysql_fetch_row($rs))
  {
    echo '<option value="'.$row[device].'">'.$row[device].'</option>\n';
  }
?>
</select>

Now, in order for this to produce more than one option in the
dropdown box, you have to be sure that your SELECT DISTINCT does
in fact return more than one row.

Jason




Try using $row->device instead of $divice in your while statement.

Brett

> Thanks Jason... I've used SELECT DISTINCT ... now i doubt this has
anything to do with SELECT DISTINCT as such but for some reason its only
displaying the last vaule entered
>
> <select name="device">
> <?php
>   $query ="SELECT DISTINCT device FROM 3backup ORDER BY device";
>   $rs =mysql_query($query);
>   $device = mysql_result($rs, 'device');
>   while($row = mysql_fetch_object($rs)){
>     echo '<option value="';
>     echo $device;
>     echo '">';
>     echo $device;
> echo '</option>\n';
>   }
> ?>
> </select>
>
> Any suggestions?
>
> Peter
> -----Original Message-----
> From: Jason Murray [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 17, 2001 11:12 AM
> To: 'Peter Houchin'; Php-General@Lists. Php. Net
> Subject: RE: [PHP] Populating HTML List boxes From DB
>
>
> > say in my db i have multiple values that are the same as well
> > as different values... how can i restrict it to showing each
> > value just once?
>
> Sounds like you want a "SELECT DISTINCT".
>
> You might want to have a look at www.sqlcourse.com.
>
> Jason
>





Brief correction.

>   while($row = mysql_fetch_row($rs))

                             ^^^ should be "array".

Jason




Thanks Every one it now works like a charm (o:

-----Original Message-----
From: Jason Murray [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 11:55 AM
To: 'Peter Houchin'; Jason Murray; Php-General@Lists. Php. Net
Subject: RE: [PHP] Populating HTML List boxes From DB


> <select name="device">
> <?php
>   $query ="SELECT DISTINCT device FROM 3backup ORDER BY device";
>   $rs =mysql_query($query);

$rs is now the result set for your SQL.

>   $device = mysql_result($rs, 'device');

This is wrong. Check the manual page for how you use mysql_result.
http://www.php.net/mysql-result

>   while($row = mysql_fetch_object($rs)){
>     echo '<option value="';
>     echo $device;
>     echo '">';
>     echo $device;
>       echo '</option>\n';
>   }

This is odd. Having pulled out the device (or tried to), you're now creating

an object and then not using it.

Try this:

<select name="device">
<?php
  $query = "SELECT DISTINCT device FROM 3backup ORDER BY device";
  $rs    = mysql_query($query);
  while($row = mysql_fetch_row($rs))
  {
    echo '<option value="'.$row[device].'">'.$row[device].'</option>\n';
  }
?>
</select>

Now, in order for this to produce more than one option in the
dropdown box, you have to be sure that your SELECT DISTINCT does
in fact return more than one row.

Jason

-- 
PHP General 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]





Hi all,

Whistler.com is looking for a new permanent PHP and MySQL programmer. 
The company is based in Whistler, British Columbia, Canada. We work in 
the destination travel industry.

Our primary business is making accommodation reservations through our 
web site, www.whistler.com. We develop web-based reservation software to 
interface hotel reservation systems with our web sites and call-center.

We need someone with a solid grounding in the use of PHP4 and MySQL for 
developing web applications. This means:
        - Understanding of relational databases, and practical experience 
with SQL
        - Understanding of OO design and experience coding and debugging in PHP
        - Understanding of HTTP, session management, cookies, 
authentication etc.
        - Familarity with UI issues, working knowledge of HTML and CSS, 
particularly complex tables
        
The development team works closely together, and we often meet with 
clients and business partners, so communication skills are important.

Initially, the position would involve work on client sites that we host 
and in-house tools for our own site. As you become familiar with our 
development environment and methodologies, you'll take a more active 
role in developing our central reservation systems.

Whistler.com is a small company at the moment. We have 12 employees, 4 
of which are on the technical team. We have been growing steadily for 
the last several years, however, and expect to expand into other markets 
in the next year.

We have a friendly and relaxed office environment, and flexible 
scheduling. Whistler is the top ski-resort in North America, and our 
office is located immediately opposite the gondola. We offer an 
attractive benefits package including medical coverage, dental insurance 
and a season pass. ;-)

Feel free to browse our website (www.whistler.com) and submit your 
resume to [EMAIL PROTECTED]

Cheers,
Colin

-----------------------------------------------------------------
Colin Putney                    Whistler.com




Whistler's cool!





On Mon, 16 Apr 2001 20:00:27 -0700, Dddogbruce \(@home.com\)
([EMAIL PROTECTED]) wrote:
>Whistler's cool!

Yeah, and a php job at a ski resort?! Hmm, that's way too good to be
true.







  You'll probably won't get to see the now :-<.


__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-

On Mon, 16 Apr 2001, Mark Maggelet wrote:

> On Mon, 16 Apr 2001 20:00:27 -0700, Dddogbruce \(@home.com\)
> ([EMAIL PROTECTED]) wrote:
> >Whistler's cool!
>
> Yeah, and a php job at a ski resort?! Hmm, that's way too good to be
> true.
>
>
> --
> PHP General 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]
>
>





HI
Opers has a nasty caching behaviour which can cause problems with sessions 
and having different entry points on the same index page. To overcome some 
of the problems any hrefs that don't contain  get variables should be set 
up as:

<a href="index.php?entered=yes">....</a>

Even if you never use the variable "entered" it will stop opera from 
caching the page.
(you can't just use index.php? as this will screw sessions without cookies)

This may or may not be your problem :)
Tom




At 10:41 AM 15/04/01 +0200, Martin =?ISO-8859-4?Q?Skj=F6ldebrand?= wrote:
>On my login page (index.php) I have at the top
>
><?
>   session_start();
>   session_destroy();
>
>The intended function of which is to stop people from hitting the Back
>button to reenter the site after having logged out (which bring people to
>the page index.php).
>
>Now, hitting BACK on Mozilla results in failed authentication and the app
>closes. Hitting BACK on Opera (5.0b7 Linux) you get into the app again but
>selecting anything from the menus results in failed authentication.
>
>Which one is behaving correctly? Is it a bug in Opera (hopefully).
>
>If, when logged in you go somewhere else, e.g. www.sunet.se, THEN hit back
>you get back in. Is there a way of stopping this?
>
>Martin S.
>
>--
>PHP General 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]





Ok, I know it's messy - no, I don't care.  :P

Parse error: parse error in C:/XITAMI/owen/website/tss/guestbookSG.php
on line 43

<html>
<head>
<title>the southern side : owen : mmmHm</title>
<style>
<!--
A:hover { color:rgb(215,152,1); cursor:hand-il; }
A:link { font-style:normal; font-weight:normal; text-decoration:none;
cursor:hand-il; }
A:visited { font-style:normal; font-weight:normal; text-decoration:none;
cursor:hand-il; }
-->
</style>
</head>

<body bgcolor="white" text="black" link="black" vlink="black"
alink="black">

<p align="center">&nbsp;
<div align="center"><table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td width="304"><p><img src="top.gif" width="302" height="18"
border="0"></td>
    </tr>
</table></div>
<div align="center"><table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td width="87" valign="top" bgcolor="white"
background="bg1.gif"><p align="center"><font
             face="Verdana" size="1">tss menu</font></p>
            <? include("tssmenu.txt") ?>
            <p>&nbsp;</p>
            <p>&nbsp;</p>
            <p>&nbsp;</td>
        <td width="219" valign="top"><p><font face="Verdana"
size="1"><b>guestbook
            signed</b></font><font face="Verdana" size="1">: </font><a
href="mailto:[EMAIL PROTECTED]"><font
             face="Verdana" size="1">Owen</font></a></p>
            <p><font face="Verdana" size="1">
<?
$space = " ";
if( $submitfrm )
 {
echo "your entry will be added shortly.";
$submitmsg = file( "gb.txt" );
$fp = fopen( "gb.txt", 'a' );
rewind($fp);
fwrite( $fp, "fwrite( $fp, "<table border=\"0\" cellpadding=\"0\"
cellspacing=\"0\"> <tr> <td width=\"236\"><p><font
size=\"1\"><b>$subject</b> :  <a href=\"mailto:$email\">$name</a></td>
</tr> <tr> <td width=\"236\"><font size=\"1\"><p>$submition</td> </tr>
</table><br>" );
fclose( $fp );
 }
else
 {
include ( "guestbooks.php" );
 }
?>
</font></td>
    </tr>
</table></div>
<div align="center"><table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td width="300"><p align="center"><img src="bottom.gif"
width="281" height="8"
             border="0"></td>
    </tr>
</table></div>
<p>&nbsp;</p>
</body>

</html>

It isn't working.  Pfft!

-Owen





Hi Dddogbruce,

@ 10:58:47 PM on 4/16/2001, Dddogbruce (@home.com) wrote:

> Ok, I know it's messy - no, I don't care.  :P

> Parse error: parse error in C:/XITAMI/owen/website/tss/guestbookSG.php
> on line 43

...
> <?
> $space = " ";
> if( $submitfrm )
>  {
> echo "your entry will be added shortly.";
> $submitmsg = file( "gb.txt" );
> $fp = fopen( "gb.txt", 'a' );
> rewind($fp);
> fwrite( $fp, "fwrite( $fp, "<table border=\"0\" cellpadding=\"0\"

              ^^^

              Remove the quotation mark.

> cellspacing=\"0\"> <tr> <td width=\"236\"><p><font
> size=\"1\"><b>$subject</b> :  <a href=\"mailto:$email\">$name</a></td>
> </tr> <tr> <td width=\"236\"><font size=\"1\"><p>$submition</td> </tr>
> </table><br>" );
> fclose( $fp );
>  }
> else
>  {
> include ( "guestbooks.php" );
>  }
?>>
...

> It isn't working.  Pfft!

> -Owen


-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.






Previously, Dddogbruce (@home.com) said:
> 
> fwrite( $fp, "fwrite( $fp, "<table border=\"0\" cellpadding=\"0\"

Looks like you have the "fwrite( $fp," bit in there one too many times.

    fwrite( $fp, "<table border=\"0\" cellpadding=\"0\"
    ....

 -dan

-- 
Age is a very high price to pay for maturity.  -George Carlin




Hi Brian,

@ 11:14:55 PM on 4/16/2001, Brian Clark wrote:

>> fwrite( $fp, "fwrite( $fp, "<table border=\"0\" cellpadding=\"0\"

>               ^^^

>               Remove the quotation mark.

Duh, Brian. You have an extra fwrite($fp) in there.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.






Hi, can some one please help me figure out why the value $device isn't being passed on 
out of the select box? i keep getting this message when i view the source 

Wrong parameter count for mysql_result() in D:\erentals/1.php on line 19



<form name="select" method="post" action="1.php">
<select name="device"><?
  $query ="SELECT DISTINCT device FROM 3backup";
  $result = mysql_query($query);
  $device = mysql_result($rs); // line 19 
  while($row = mysql_fetch_array($result)){
    echo '<option value="'.$row[device].'">'.$row[device].'</option><br>';
  }
?>
</select>

           
<input type="submit" name="select" value="select">                      
</form>   <!-- end Select form-->

<?
echo mysql_error();?>

<? if($select){
?>         

<!-- Update form start -->


<?
$foo = "SELECT * FROM 3backup WHERE device='$device' ORDER BY device";

 $result = mysql_query($foo,$db); 
//$result = mysql_db_query('test',$foo);
echo "$foo";
echo mysql_error();
}
?>

Peter Houchin
[EMAIL PROTECTED]
=========================================================
     _____                              __   /\
    /_/_/_\                            /  |_/  \
   /_/_/_    __  __  __   __          /         \
   \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
 ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
 \_//_/_/ /_/_/_/ /_/ \/_/                    v
     ________   ________________________________________
    /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
   /_/_ _/_/ ______  __   __  /_/ ____      __     ______
  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
 /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
/_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
=========================================================
Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
************* We rent the dot in .COM!  **************
 




Hi Peter,

@ 11:40:06 PM on 4/16/2001, Peter Houchin wrote:

> Hi, can some one please help me figure out why the value $device
> isn't being passed on out of the select box? i keep getting this
> message when i view the source

(OK, lets try this again)

> Wrong parameter count for mysql_result() in D:\erentals/1.php on line 19

> <form name="select" method="post" action="1.php">
> <select name="device"><?
>   $query ="SELECT DISTINCT device FROM 3backup";
>   $result = mysql_query($query);
>   $device = mysql_result($rs); // line 19 

Two parameters are required, the third is optional.

mixed mysql_result (int result, int row [, mixed field])

So you're just getting one row with mysql_result(). You probably want
mysql_fetch_array() or mysql_fetch_object() if you want more than one
row.

If you don't, you'll need to use mysql_result($rs,$i) where $i is a
row number.


-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.






>   $device = mysql_result($rs); // line 19 

mysql_result expects the result set, the row number and the field name.

You should not need this, anyway.

Jason




According to the documentation http://php.net/manual/en/function.mysql-result.php 
mysql_result takes 2 and an optional third parameter. The second parameter should be 
the row number.

- Frank

> Hi, can some one please help me figure out why the value $device isn't being passed 
>on out of the select box? i keep getting this message when i view the source 
> 
> Wrong parameter count for mysql_result() in D:\erentals/1.php on line 19
> 
> 
> 
> <form name="select" method="post" action="1.php">
> <select name="device"><?
>   $query ="SELECT DISTINCT device FROM 3backup";
>   $result = mysql_query($query);
>   $device = mysql_result($rs); // line 19 
>   while($row = mysql_fetch_array($result)){
>     echo '<option value="'.$row[device].'">'.$row[device].'</option><br>';
>   }
> ?>
> </select>
> 
>            
> <input type="submit" name="select" value="select">                    
> </form>   <!-- end Select form-->
> 
> <?
> echo mysql_error();?>
> 
> <? if($select){
> ?>       
> 
> <!-- Update form start -->
> 
> 
> <?
> $foo = "SELECT * FROM 3backup WHERE device='$device' ORDER BY device";
> 
>  $result = mysql_query($foo,$db); 
> //$result = mysql_db_query('test',$foo);
> echo "$foo";
> echo mysql_error();
> }
> ?>
> 
> Peter Houchin
> [EMAIL PROTECTED]
> =========================================================
>      _____                              __   /    /_/_/_\                            
>/  |_/     /_/_/_    __  __  __   __          /            \_/_/_\  /_/ /_/ /_/  /_/  
>        \   _     /
>  ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
>  \_//_/_/ /_/_/_/ /_/ \/_/                    v
>      ________   ________________________________________
>     /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>    /_/_ _/_/ ______  __   __  /_/ ____      __     ______
>   /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
>  /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_/_/    \_\/_/_/_/ /_/ \/_/ /_/ 
>/_/    \_\/_/_/_//_/_/_/
> =========================================================
> Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
> ************* We rent the dot in .COM!  **************
> 







Previously, Miguel Carvalho said:
> if a do
>     ldapsearch -o ",o=xyz" "ent=entry1,uid=ldap,ou=People,o=xyz", it
> works just fine.
> 
> How can i access the entry  "ent=entry1,uid=ldap,ou=People,o=xyz" using
> ldap_search/ldap_list or ldap_read?
> 
> I have tried ldap_search... but i can not find how to write the filter.

    $host = 'localhost';

    $bindcred = 'uid=admin';    // adjust for your system
    $bindpass = 'somepasswd';   // adjust for your system

    $base = 'o=xyz';                            // where to start in tree

    //$base = 'uid=ldap,ou=People,o=xyz';       // more specific... and
                                                // probably faster too

    $filter = 'ent=entry1';             // what to search on

    $conn = ldap_connect($host);
    if (! $conn)
        die('LDAP connection failed!');

    $result = ldap_bind($conn, $bindcred, $bindpass);
    if (! $result)
        die('LDAP BIND failed!');

    $result = ldap_search($conn, $base, $filter);
    if (! $result)
        die('LDAP SRCH failed!');

    $numentries = ldap_count_entries($conn, $result);
    print 'Found ' . $numentries . 'matches<br>';

    if ($numentries > 0)
        $info = ldap_get_entries($conn, $result);

    for ($i = 0; $i < $info['count']; $i++) {
        print $info[$i]['uid'][0];
    }

    // $info is a multidimensional array with your result set.
    // you can use another attribute name in place of 'uid'...
    // for multivalued attributes (such as 'objectclass') you can use
    // numbers higher than 0 in the last set of brackets to see the
    // other values... i.e.
    //
    // $info[$i]['objectclass'][0];
    // $info[$i]['objectclass'][1];
    // $info[$i]['objectclass'][2];
    //
    // .. etc

-- 
Why don't sheep shrink when it rains?  -George Carlin






Hits my head over walls bench tops thru doors....


Sorry every one for waisting ur time ... i found my mistake & what a silly mistake it 
was too

.. continuing to hit my head over hard objects

Peter





RE: PHP as a CGI or Module

This has been discussed some but I am interested to see if one is more
popular then the other.  My experience has been most people run PHP as a
apache module but is there a specific benefit to run it as a cgi
program?  What about very large servers such as web hosts?  I am currently
wrestling with some issues (apaches global variables) that aren't working
with php -cgi and wonder if this is a common occurance with php-cgi or
just a misconfiguration on the hosts end.  Does one version serve the
pages faster or provide less overhead on the server?

I have read a few FAQ's on this but interested to see what is happening in
the real world.  Is one form more popular then the other?

//frank





I do not know much about the PHP, but somewhere I remember reading following :

' If there is no specific reason to use PHP as CGI and web server which you 
are using is supporting PHP as module then go for  'Module' . This gives 
better performance'

manisha







Does the variable $php_self work in PHP3? I am helping a friend with some
forms, and their host still uses PHP3.
Thanks.






Hey all,

I was just trying to figure out something that should be quite simple 
but seems to be eluding me,

consider the following:

$input = array();
while ( list($key, $val) = each($HTTP_POST_VARS) ) {
   if ( $key != "Submit" )  {
   array_push($input, $val);
   }

}

Ok fine, I now have an associative array with a numeric index, but 
hangon I wanted to push the key => value into the array. How would I do 
this, I have tried a couple of things but am having some really crazy 
results ;-)

What I am really trying to do is create a new array from the 
HTTP_POST_VARS while excluding certain fields, like Submit or the X and 
Y values from a image button.

Any ideas/suggestions are very welcomed,

Regards

Joseph,







maybe tring this ...
$input = array();

reset ($HTTP_POST_VARS);

while ( list($key, $val) = each($HTTP_POST_VARS) ) {
   if ( $key != "Submit" )  {
   array_push($input, $val);
   }

}

Peter
-----Original Message-----
From: Joseph Blythe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 3:13 PM
To: [EMAIL PROTECTED]
Subject: [PHP] array_push but with key, value pairs


Hey all,

I was just trying to figure out something that should be quite simple 
but seems to be eluding me,

consider the following:

$input = array();
while ( list($key, $val) = each($HTTP_POST_VARS) ) {
   if ( $key != "Submit" )  {
   array_push($input, $val);
   }

}

Ok fine, I now have an associative array with a numeric index, but 
hangon I wanted to push the key => value into the array. How would I do 
this, I have tried a couple of things but am having some really crazy 
results ;-)

What I am really trying to do is create a new array from the 
HTTP_POST_VARS while excluding certain fields, like Submit or the X and 
Y values from a image button.

Any ideas/suggestions are very welcomed,

Regards

Joseph,



-- 
PHP General 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]






Peter Houchin wrote:

> maybe tring this ...
> $input = array();
> 
> reset ($HTTP_POST_VARS);
> 
> while ( list($key, $val) = each($HTTP_POST_VARS) ) {
>    if ( $key != "Submit" )  {
>    array_push($input, $val);
>    }
> 
> }


Hmm, as far as I can see this will just reset the internal pointer back 
to the start of the HTTP_POST_VAR array, I suppose this should be done   
in case I have called 'each' on the array before, but it does not answer 
my question being: I want to push the key and value into an array not 
just the value. I basically need array_push functionality but with the 
ablility to use your own index values.

I hope this is more clear.

Regards

Joseph






what about if you assign the key to = the id (if in a data base)?

maybe like

while (list ($key, $val) = each ($id)) { 
 if ( $key != "Submit" )  {
>    array_push($input, $val);
>    }
> 
> }

-----Original Message-----
From: Joseph Blythe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 3:40 PM
To: Peter Houchin
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] array_push but with key, value pairs



Peter Houchin wrote:

> maybe tring this ...
> $input = array();
> 
> reset ($HTTP_POST_VARS);
> 
> while ( list($key, $val) = each($HTTP_POST_VARS) ) {
>    if ( $key != "Submit" )  {
>    array_push($input, $val);
>    }
> 
> }


Hmm, as far as I can see this will just reset the internal pointer back 
to the start of the HTTP_POST_VAR array, I suppose this should be done   
in case I have called 'each' on the array before, but it does not answer 
my question being: I want to push the key and value into an array not 
just the value. I basically need array_push functionality but with the 
ablility to use your own index values.

I hope this is more clear.

Regards

Joseph






Peter Houchin wrote:

> what about if you assign the key to = the id (if in a data base)?
> 
> maybe like
> 
> while (list ($key, $val) = each ($id)) { 
>  if ( $key != "Submit" )  {
> 
>>    array_push($input, $val);
>>    }
>> 
>> }
> 
I am not using a database for this part as I am just collecting the data 
to validate. I really want to know how to create a new array in a while 
loop, which contains the key and value pairs of the array passed to 
each. So lets say the above code would output:

0 => value1
1 => value2
2 => value 3
4 = value4

But I want to create:

keyname1 => value1
keyname2 => value2
keyname3 => value3
keyname4 => value4

Does anyone understand what I am on about?

Regards,

Joseph






Hello!

Any comments in PHP for Zope? I don't know much thought... Some people told
me that Zope is good a while ago... And I saw that know they have a PHP
layer... How good is this?

Thank you,

Rom





ooops - sorry about the other e-mail... I am sleeping here... heheheeh

Hello!

Any comments in PHP for Zope? I don't know much though... Some people told
me that Zope is good a while ago... And I saw that now they have a PHP
layer... How good is zope?

Thank you,

Rom




can any one see a problem with this loop?

  <?
$db = include"connect.inc";
$foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";

 $result = mysql_query($foo,$db); 


while ( ($myrow = mysql_fetch_array($result) ) ) {

$id = $myrow["id"];
$card = $myrow["card"];
$serial = $myrow["serial"];
$avail = $myrow["avail"];
$pn = $myrow["pn"];
$cat = $myrow["cat"];
$box = $myrow["box"];
$quote = $myrow["quote"];
}
?>

if i call say just $card it only displays the one record (the last one), the minute i 
try to call $myrow["card"]; i get nothing at all... any idea's?

I have script identical to this that works perfectly .. only difference is this one 
has different names for the values

Peter Houchin
[EMAIL PROTECTED]
=========================================================
     _____                              __   /\
    /_/_/_\                            /  |_/  \
   /_/_/_    __  __  __   __          /         \
   \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
 ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
 \_//_/_/ /_/_/_/ /_/ \/_/                    v
     ________   ________________________________________
    /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
   /_/_ _/_/ ______  __   __  /_/ ____      __     ______
  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
 /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
/_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
=========================================================
Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
************* We rent the dot in .COM!  **************
 




> $db = include"connect.inc";

includes do not return anything useful, so this is a bogus statement.

> $foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
>
>  $result = mysql_query($foo,$db);

An include certainly cannot return a database handle.  Included files
operate in the same variable scope as the script doing the inclusion.  So
simply set $db in your connect.inc file and it will automatically be
available to you after the include.

-Rasmus





yes i know it was mearly there to show i had it in my script as i said in my initial 
post i could get info from the db, just not in the while loop

-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 4:08 PM
To: Peter Houchin
Cc: Php-General@Lists. Php. Net
Subject: Re: [PHP] baffled :<:<


> $db = include"connect.inc";

includes do not return anything useful, so this is a bogus statement.

> $foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card";
>
>  $result = mysql_query($foo,$db);

An include certainly cannot return a database handle.  Included files
operate in the same variable scope as the script doing the inclusion.  So
simply set $db in your connect.inc file and it will automatically be
available to you after the include.

-Rasmus





I've seen a number of requests for info on this subject with no answers.

Is anyone working on a tn (Telnet) screen scrapper connectivity toolset for
PHP?
How about tn3270?

Warren Vail
Availabletech.com



Reply via email to