php-general Digest 10 Apr 2001 01:19:52 -0000 Issue 618

Topics (messages 47775 through 47910):

Re: isset() VS if($var)
        47775 by: Jesper Blomström
        47776 by: Phil Driscoll
        47779 by: PHPBeginner.com
        47783 by: Jesper Blomström

Re: URL FROM IP
        47777 by: trogers
        47781 by: Renzi, Sebastian
        47786 by: trogers

PHP compile error with LDAP
        47778 by: Miguel Carvalho

Re: URL w/o script name
        47780 by: PHPBeginner.com
        47782 by: PHPBeginner.com

Re: newbie question about variables
        47784 by: PHPBeginner.com
        47803 by: Cheng, Kynan (London)

Re: Why a javascript have problem if it is dynamic load?
        47785 by: Jean-Arthur Silve

Can't make apache with PHP and mysql!!
        47787 by: Mohamed Ould

Script FLOW-- branching and subroutines/functions
        47788 by: Chris Worth
        47793 by: Michael Hall
        47796 by: Michael Hall
        47808 by: Chris Worth

Real Problem: Accessing Array In A Class
        47789 by: DELAP, SCOTT F (SBCSI)
        47791 by: Taylor, Stewart
        47792 by: Rasmus Lerdorf
        47794 by: Morgan Curley
        47795 by: PHPBeginner.com

How can I pass Javascript variables to PHP?
        47790 by: David Phillips
        47811 by: Johnson, Kirk

Upload file from my local C:
        47797 by: HK Woo
        47799 by: Johnson, Kirk
        47802 by: HK Woo
        47805 by: Michael Hall
        47814 by: HK Woo
        47816 by: Augusto Cesar Castoldi
        47819 by: Christian Reiniger
        47820 by: HK Woo

URL Encode >
        47798 by: info
        47807 by: Christopher Allen
        47824 by: info

recording time of entry
        47800 by: george
        47801 by: Johnson, Kirk
        47804 by: george
        47806 by: Michael Hall
        47809 by: Johnson, Kirk

Re: php-general Digest 7 Apr 2001 12:32:53 -0000 Issue 613
        47810 by: jvoth.mobiltex.com

HELP...Installation of PHP on Debian Linux!
        47812 by: Frank K
        47813 by: Kurth Bemis

list files in a diretory
        47815 by: Augusto Cesar Castoldi
        47817 by: Boget, Chris

Passing variables,,, I know its not this hard.
        47818 by: Curtis
        47821 by: Rudolf Visagie
        47822 by: Jon Haworth
        47823 by: Mark Maggelet

Count function.  (Newbie Question)
        47825 by: Michael O'Neal
        47827 by: Dell Coleman
        47828 by: Rodney J. Woodruff
        47830 by: Lindsay Adams
        47831 by: Michael O'Neal
        47838 by: Dell Coleman
        47874 by: Lindsay Adams

Re: Where to get php_pdf.so?
        47826 by: Lindsay Adams

Re: Row colors
        47829 by: Jerry Lake

login & security
        47832 by: kaab kaoutar
        47849 by: Kath

Sorry - Way OT but I need help
        47833 by: Andy Woolley
        47835 by: Jon Haworth
        47837 by: Andy Woolley
        47853 by: Boget, Chris
        47854 by: Mark Roedel
        47857 by: Les Neste

Can I detect 128 biit encryption with php
        47834 by: Nick

sockets
        47836 by: Matthias Winkelmann
        47872 by: Lindsay Adams
        47891 by: Matthias Winkelmann
        47892 by: Lindsay Adams

Flash XMLSocket object and the PHP socket functions
        47839 by: Frank Joerdens

Threading code
        47840 by: Ashley M. Kirchner
        47841 by: Joe Stump
        47843 by: Matt Friedman
        47844 by: Richard Scott Crawford
        47845 by: Joe Stump
        47850 by: Richard Scott Crawford

how to search the list's archives?
        47842 by: PeterOblivion.aol.com
        47846 by: Philip Olson

HTML front end for building page logic online
        47847 by: Dennis Gearon

Finer points of debugging: vardump vs. print_r
        47848 by: John Lim
        47868 by: Philip Olson
        47884 by: Morgan Curley
        47904 by: Plutarck

Where does apache call call php
        47851 by: Shashi Kumar

Re: Print or Echo.
        47852 by: Sterling

Adding GD for win PHP
        47855 by: Brandon Orther

populating dropdown list problems
        47856 by: Jason Dulberg

Need a functional equivilant to the ASP QueryString collection
        47858 by: Daniel
        47860 by: Alexander Wagner
        47861 by: Daniel

MySQL broken in 4.0.5RC6
        47859 by: Jon Rosenberg
        47867 by: B. van Ouwerkerk
        47873 by: Jon Rosenberg
        47889 by: B. van Ouwerkerk

shared memory
        47862 by: Stephen Haberman

Parse error after end of file
        47863 by: DRN
        47864 by: Alexander Wagner
        47865 by: Kurth Bemis
        47890 by: DRN

passing string variables in url
        47866 by: Claudia Smith
        47871 by: Alexander Wagner

list all parameters
        47869 by: Keith Wolters

Install problem
        47870 by: Johan Barelds

<?xml version="1.0"?> & PHP
        47875 by: Gary
        47887 by: Brian Clark
        47898 by: Gary
        47905 by: Brian Clark
        47908 by: Philip Olson
        47910 by: osium.rio.bravo.net

.htpasswd encryption
        47876 by: Brandon Orther
        47877 by: Kurth Bemis
        47879 by: Lindsay Adams

Shared Memory weiredness
        47878 by: Alexander Skwar

Re: This loop is screwed up totally. Why o why o why....
        47880 by: Yo Bro
        47881 by: Yo Bro

link variable to an html page...
        47882 by: Curtis
        47885 by: Alexander Skwar
        47886 by: Lindsay Adams

problem with ftp-support from php
        47883 by: Dennis Schulz

Re: putting a list of data into 3 columns?
        47888 by: DRN
        47896 by: Lindsay Adams
        47897 by: DRN

Controlling just size with regular expressions
        47893 by: Jorge Alvarez
        47895 by: Johnson, Kirk

Supplied argument is not a valid MySQL result resource
        47894 by: Nathan Roberts

L?
        47899 by: Kurth Bemis
        47900 by: Opec Kemp \( Ozemail \)
        47903 by: Philip Olson

Array Sort?
        47901 by: Chris Anderson
        47906 by: David Robley

huge PHP file, hardcore processing
        47902 by: Christian Dechery

Encoding
        47907 by: Kevin Pate
        47909 by: Yasuo Ohgaki

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]


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


Okey, thanks for your help Adam!

Let us assume that we have a page which processes a
form-submit:

Ex: page with form

<form method="post" name="myform" action="xyz.php3">
<input type="text" name="a">Write your name
</form>

Ex: page xyz.php3

if ($a) // I have seen such examples but what does it
mean? Does it mean the same as isset-method?



Thx!


/ Jeppe




Adam Wright wrote:
> 
> isset actually sees if the variable exists, and has been assigned a value
> (where if is obviously checking for boolean truthfulness). Thus...
> 
> $a = 0;
> 
> if (isSet($a))
>   print "A is set"; //This line will execute
> 
> if (isSet($b))
>   print "B is set"; //This line never will, as B has not been set to
> anything every in this script
> 
> And...
> 
> if ($a)
>   print "A is true"; //This line won't execute, A is false
> 
> if ($b)
>   print "B is true"; //Because B has never been set, $b = 0, and this will
> never execute
> 
> Hope that helps
> 
> adamw
> 
> ----- Original Message -----
> From: "Jesper Blomström" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 09, 2001 1:56 PM
> Subject: [PHP] isset() VS if($var)
> 
> > Hi!
> >
> > Is there any difference between writing:
> >
> > isset($my_var)
> >
> > and...
> >
> > if ($my_var)
> >
> >
> > ??
> >
> >
> > Thanks!
> >
> >
> >
> > / Jesper Blomstroem
> >
> > --
> > Jesper Blomström
> > [EMAIL PROTECTED]
> > Arbete: 08-566 280 08
> > Hem:    08-669 23 10
> > Mobil:  070-30 24 911
> >
> > --
> > 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]
> >
> >

-- 
Jesper Blomström
[EMAIL PROTECTED]
Arbete: 08-566 280 08
Hem:    08-669 23 10
Mobil:  070-30 24 911




Bear in mind that writing
if($b)
when there is a chance that $b is undefined, is poor programming practice
and can allow scope for harmful exploits of your code.

In general, you should run your development machine with an error reporting
level of E_ALL, and you should not be happy with your code if any warning
messages are ever displayed.

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





It is really a long discussion (check the archives of the last month - two)

Basically, isset() will tell you if the variable is declared, in other words
it is set. It can still be empty but declared, and that will return you
true;

        if($var)

will return false only if
1. variable is not declared,
2. variable contains an empty string or 0.

the best (or at least my favorite) way to see if the variable contains
anything is

        if(isset($var) and $var!='')

this excludes every possibility of variable being empty or containing an
empty string in it.

hope this helps.

Truly, check the archives, there so many things were said on this issue.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com






-----Original Message-----
From: Jesper Blomström [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 9:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP] isset() VS if($var)


Hi!

Is there any difference between writing:

isset($my_var)

and...

if ($my_var)


??


Thanks!



/ Jesper Blomstroem

--
Jesper Blomström
[EMAIL PROTECTED]
Arbete: 08-566 280 08
Hem:    08-669 23 10
Mobil:  070-30 24 911

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







This cleared up the difficulties!

I will look deep into the archive, now and forever.


Thanks from Stockholm, Sweden.


/ Jeppe

"PHPBeginner.com" wrote:
> 
> It is really a long discussion (check the archives of the last month - two)
> 
> Basically, isset() will tell you if the variable is declared, in other words
> it is set. It can still be empty but declared, and that will return you
> true;
> 
>         if($var)
> 
> will return false only if
> 1. variable is not declared,
> 2. variable contains an empty string or 0.
> 
> the best (or at least my favorite) way to see if the variable contains
> anything is
> 
>         if(isset($var) and $var!='')
> 
> this excludes every possibility of variable being empty or containing an
> empty string in it.
> 
> hope this helps.
> 
> Truly, check the archives, there so many things were said on this issue.
> 
> Sincerely,
> 
>  Maxim Maletsky
>  Founder, Chief Developer
> 
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
> 
> -----Original Message-----
> From: Jesper Blomström [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 9:57 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] isset() VS if($var)
> 
> Hi!
> 
> Is there any difference between writing:
> 
> isset($my_var)
> 
> and...
> 
> if ($my_var)
> 
> ??
> 
> Thanks!
> 
> / Jesper Blomstroem
> 
> --
> Jesper Blomström
> [EMAIL PROTECTED]
> Arbete: 08-566 280 08
> Hem:    08-669 23 10
> Mobil:  070-30 24 911
> 
> --
> 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]

-- 
Jesper Blomström
[EMAIL PROTECTED]
Arbete: 08-566 280 08
Hem:    08-669 23 10
Mobil:  070-30 24 911




Hi

Try

$url = getHostByAddr($REMOTE_ADDR);

Tom

At 10:17 AM 9/04/01 -0300, Renzi, Sebastian wrote:
>Having the ip i want to obtain de URL (www.renzi.com.ar)
>
>Thank You very much !
>
>Sebastián Renzi
>Consultoría & Desarrollo de Sistemas.
>CODES S.A
>
>
>--
>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]





this code returns the ip too ! i dont know why !!

> -----Mensaje original-----
> De:   trogers [SMTP:[EMAIL PROTECTED]]
> Enviado el:   lunes 9 de abril de 2001 10:41
> Para: [EMAIL PROTECTED]
> Asunto:       Re: [PHP] URL FROM IP
> 
> Hi
> 
> Try
> 
> $url = getHostByAddr($REMOTE_ADDR);
> 
> Tom
> 
> At 10:17 AM 9/04/01 -0300, Renzi, Sebastian wrote:
> >Having the ip i want to obtain de URL (www.renzi.com.ar)
> >
> >Thank You very much !
> >
> >Sebastián Renzi
> >Consultoría & Desarrollo de Sistemas.
> >CODES S.A
> >
> >
> >--
> >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
That means there is no reverse dns setup for that ip so it just returns the 
ip number again.
Try with a few other ip's and it will work (try 129.250.16.102 for example)
Tom

At 10:43 AM 9/04/01 -0300, Renzi, Sebastian wrote:
>this code returns the ip too ! i dont know why !!
>
> > -----Mensaje original-----
> > De:   trogers [SMTP:[EMAIL PROTECTED]]
> > Enviado el:   lunes 9 de abril de 2001 10:41
> > Para: [EMAIL PROTECTED]
> > Asunto:       Re: [PHP] URL FROM IP
> >
> > Hi
> >
> > Try
> >
> > $url = getHostByAddr($REMOTE_ADDR);
> >
> > Tom
> >
> > At 10:17 AM 9/04/01 -0300, Renzi, Sebastian wrote:
> > >Having the ip i want to obtain de URL (www.renzi.com.ar)
> > >
> > >Thank You very much !
> > >
> > >Sebastián Renzi
> > >Consultoría & Desarrollo de Sistemas.
> > >CODES S.A
> > >
> > >
> > >--
> > >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]





i, i'm sorry if this has been discussed in the list... but i have
searched the entire list's archive.... but i have not found no
solution/hint for the problem.

I have PHP compiled with imap support. I works just fine.

I have recompiled PHP to add ldap support.

The configure and make  runs fine, but when i start apache, i get this
error:

    Syntax error on line 205 of /usr/local/apache/conf/httpd.conf:
    Cannot load /usr/local/apache/libexec/libphp4.so into server:
undefined symbol: ldap_value_free
    /usr/local/apache/bin/apachectl start: httpd could not be started

I have also run a ldd on /usr/local/apache/libexec/libphp4.so and i get
this output.

     libpam.so.0 => /lib/libpam.so.0 (0x401e3000)
     libdl.so.2 => /lib/libdl.so.2 (0x401eb000)
     libresolv.so.2 => /lib/libresolv.so.2 (0x401ee000)
     libm.so.6 => /lib/libm.so.6 (0x40200000)
     libcrypt.so.1 => /lib/libcrypt.so.1 (0x40220000)
     libnsl.so.1 => /lib/libnsl.so.1 (0x4024d000)
     libc.so.6 => /lib/libc.so.6 (0x40264000)
     /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)


My /etc/ld.so.conf

    /usr/X11R6/lib
    /usr/kerberos/lib
    /usr/lib
    /usr/lib/qt-2.2.0/lib
    /usr/local/lib
    /lib

Thank's
Miguel





just to add : The error you mentioned was detected on Netscape <6 browsers.
I myself have had hard time with this long ago.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


 

-----Original Message-----
From: Jason Lotito [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 12:28 AM
To: [EMAIL PROTECTED]; elias
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] URL w/o script name


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 4:50 AM
> To: elias
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] URL w/o script name
> >
> > and sometimes i see:
> >
> > www.site.com/?asdasdf=adasd
> >
> > can someone please explain me this process.
>
> the server looks in its configuration (for example Apache: DirectoryIndex
> index.php) and returns this page - with the GET-Varaibales as well (your
> Browser doesn't have to know, what this page's name is!)
>
> But I'm sure you can configure your webserver (or put it in your
> script) to
> make a 301/2/3 and redirect to the full URL!
>
> witty

Just to point out, the /?asdf=asdf style is poor in my opinion, more so
because I have experienced errors (well, visitors have experienced errors)
with links that were linked like that.  I believe it was a Lynx user, or
maybe Opera, don't remember.  However, the fact is that I suggest actually
putting the script name in there. =)

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


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






Another thing to add:

by using apache's mod_rewrite you can have your variables (as witty
suggested) in the/very/elegant/and/search-engines-readable/way.php

I have it working on PHPBeginner.com and several other sites.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-----Original Message-----
From: Jason Lotito [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 12:28 AM
To: [EMAIL PROTECTED]; elias
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] URL w/o script name


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 4:50 AM
> To: elias
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] URL w/o script name
> >
> > and sometimes i see:
> >
> > www.site.com/?asdasdf=adasd
> >
> > can someone please explain me this process.
>
> the server looks in its configuration (for example Apache: DirectoryIndex
> index.php) and returns this page - with the GET-Varaibales as well (your
> Browser doesn't have to know, what this page's name is!)
>
> But I'm sure you can configure your webserver (or put it in your
> script) to
> make a 301/2/3 and redirect to the full URL!
>
> witty

Just to point out, the /?asdf=asdf style is poor in my opinion, more so
because I have experienced errors (well, visitors have experienced errors)
with links that were linked like that.  I believe it was a Lynx user, or
maybe Opera, don't remember.  However, the fact is that I suggest actually
putting the script name in there. =)

Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.


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






Yes, you were right, this works just the way you wrote.

And yes, there is a JavaScript way to do it, but I guess PHP is better for
this kind of jobs. JavaScript is using your browser as it's 'server' while
PHP uses your remote server. Therefore, all PHP will do is generate HTML
code to send to client. Make a way it dynamically assigns you the right
image and, vuala! Just if you would have coded that HTML page yourself. No
JavaScript.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com







-----Original Message-----
From: Cheng, Kynan (London) [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 5:37 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP] newbie question about variables


Hi,

I have not coded script in html before, so I was wondering if someone could
look this over briefly:

I'm a bit confused as to how variables are passed/stored.  Do the variables
get saved on the client machine? Do they have to be specifically passed from
page to page and back?  Are they automatically returned to the calling page?


If I have a page with thumbnail, and I'd like to call a page that
dynamically places the original photo into it (based on the thumbnail
clicked) does it go a little something like this?

in index.html:
<a href="picture.html?var=pictureone.jpg"><img src="thumbnail.gif"></a>

in picture.html
<a href="index.html"><img src="<?php print $var ?>"</a>


Is there a similar javascript method?

Thanks
Kynan


> -----Original Message-----
> From: Philip Olson [SMTP:[EMAIL PROTECTED]]
> Sent: Sunday, April 08, 2001 10:52 PM
> To:   Victor
> Cc:   [EMAIL PROTECTED]
> Subject:      Re: [PHP] newbie question about variables
>
>
> Something like the following HTML :
>
>   <a href="foo.php?var=1"><img src="img1.gif"></a>
>   <a href="foo.php?var=2"><img src="img2.gif"></a>
>   <a href="foo.php?var=3"><img src="img3.gif"></a>
>
> And in foo.php have :
>
>   print $var; // 1 or 2 or 3
>
> Also consider the following :
>
>   <a href="<?php echo $PHP_SELF; ?>?var=1"><img src="img1.gif"></a>
>
> To have it load the current page rather then foo.php.
>
> regards,
> philip
>
>
> On Mon, 9 Apr 2001, Victor wrote:
>
> > Hello,
> >
> >  Is there any (easy) way to let a user to set the value of a
> >  variable by simply clicking on a hyperlink on a web page?
> >  I mean if I have a 3 links on a page if the user clicks on image1 to
> >  set a variable $var=1,if clicks on image2 to set it as
> >  $var=2,etc.
> >
> >  Any suggestions (including RTFMs ;-)) are wellcome.
> >
> >
> > Best regards,
> >   Victor
> >
> >
> >
> > --
> > 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]






Thanks Maxim for your help,

If you have a sec could you also please tell me how PHP does the variables?
When you say JS uses your browser as it's server and PHP uses the remote
server, are you referring to the way they call their functions?


Thanks
Kynan

> -----Original Message-----
> From: PHPBeginner.com [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 3:00 PM
> To:   Cheng, Kynan (London); [EMAIL PROTECTED]
> Subject:      RE: [PHP] newbie question about variables
> 
> Yes, you were right, this works just the way you wrote.
> 
> And yes, there is a JavaScript way to do it, but I guess PHP is better for
> this kind of jobs. JavaScript is using your browser as it's 'server' while
> PHP uses your remote server. Therefore, all PHP will do is generate HTML
> code to send to client. Make a way it dynamically assigns you the right
> image and, vuala! Just if you would have coded that HTML page yourself. No
> JavaScript.
> 
> 
> Sincerely,
> 
>  Maxim Maletsky
>  Founder, Chief Developer
> 
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
> 
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Cheng, Kynan (London) [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 5:37 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: [PHP] newbie question about variables
> 
> 
> Hi,
> 
> I have not coded script in html before, so I was wondering if someone
> could
> look this over briefly:
> 
> I'm a bit confused as to how variables are passed/stored.  Do the
> variables
> get saved on the client machine? Do they have to be specifically passed
> from
> page to page and back?  Are they automatically returned to the calling
> page?
> 
> 
> If I have a page with thumbnail, and I'd like to call a page that
> dynamically places the original photo into it (based on the thumbnail
> clicked) does it go a little something like this?
> 
> in index.html:
> <a href="picture.html?var=pictureone.jpg"><img src="thumbnail.gif"></a>
> 
> in picture.html
> <a href="index.html"><img src="<?php print $var ?>"</a>
> 
> 
> Is there a similar javascript method?
> 
> Thanks
> Kynan
> 
> 
> > -----Original Message-----
> > From:       Philip Olson [SMTP:[EMAIL PROTECTED]]
> > Sent:       Sunday, April 08, 2001 10:52 PM
> > To: Victor
> > Cc: [EMAIL PROTECTED]
> > Subject:    Re: [PHP] newbie question about variables
> >
> >
> > Something like the following HTML :
> >
> >   <a href="foo.php?var=1"><img src="img1.gif"></a>
> >   <a href="foo.php?var=2"><img src="img2.gif"></a>
> >   <a href="foo.php?var=3"><img src="img3.gif"></a>
> >
> > And in foo.php have :
> >
> >   print $var; // 1 or 2 or 3
> >
> > Also consider the following :
> >
> >   <a href="<?php echo $PHP_SELF; ?>?var=1"><img src="img1.gif"></a>
> >
> > To have it load the current page rather then foo.php.
> >
> > regards,
> > philip
> >
> >
> > On Mon, 9 Apr 2001, Victor wrote:
> >
> > > Hello,
> > >
> > >  Is there any (easy) way to let a user to set the value of a
> > >  variable by simply clicking on a hyperlink on a web page?
> > >  I mean if I have a 3 links on a page if the user clicks on image1 to
> > >  set a variable $var=1,if clicks on image2 to set it as
> > >  $var=2,etc.
> > >
> > >  Any suggestions (including RTFMs ;-)) are wellcome.
> > >
> > >
> > > Best regards,
> > >   Victor
> > >
> > >
> > >
> > > --
> > > 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 !

don't you think that the problem comes from : window.history.go(0); located 
in your populateTown function ?
I guess that Netscape reload you page when you tell "history.go(0)"


jean-arthur


>I have a page with javascript which is dynamic generated by php. That
>page is quite large and run ok with IE. But it netscape, I don't know
>why that it will reload every time when I select an option. If I save
>the resulting php page in HTML file and run it is netscape, no problem
>at all. Can anyone tell me how to solve?
>
>The pages are:
>http://203.169.148.213/coachquote/coach_req_form.html
>http://203.169.148.213/coachquote/coach_req_form.php
>
>
>--
>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]

----------------------------------------------------------------
EuroVox
4, place Félix Eboue
75583 Paris Cedex 12
Tel : 01 44 67 05 05
Fax : 01 44 67 05 19
Web : http://www.eurovox.fr
----------------------------------------------------------------





Hi,

I goot this error when "make" apache after configurating it with php:

usr/local/mysql/lib/libmysqlclient.a(my_compress.o): In function
`my_uncompress':
my_compress.o(.text+0x9a): undefined reference to `uncompress'
/usr/local/mysql/lib/libmysqlclient.a(my_compress.o): In function
`my_compress_alloc':
my_compress.o(.text+0x12a): undefined reference to `compress'
collect2: ld returned 1 exit status
make[2]: *** [target_static] Erreur 1
make[2]: Quitte le répertoire `/usr/local/etc/apache_1.3.14/src'
make[1]: *** [build-std] Erreur 2
make[1]: Quitte le répertoire `/usr/local/etc/apache_1.3.14'
make: *** [build] Erreur 2

Can anyone helps.

Thanks






Hello all.

I'm relatively new to the world of PHP, but I've programmed in C, C++, Rexx, in the 
past.

What I'm working on is this and I wanted to clarify some things about how PHP "runs"

I've got a function that contains a form and depending on the entry to the form, which 
is 
then checked against a database(to avoid duplicates in the list).  once a non 
duplicate 
is determined it advances to the next form for data entry.  I had the whole thing in a 
while 
loop but that was a disaster.

I pass $PHP_SELF to the functions, am I to understand that once the script returns 
from 
the function it starts executing at the beginning?


While( Not stopping)
{

do first form()
check against database()

if(above check is OK)
        do the information form()


if(form entered)
        put data into database()




}


as it is structured above it just runs and runs through the first form.

I put a break into the while loop, but the script still seems to run right to the end.

I suppose to phrase another way. 

how do I do this

call form
        wait there until it is completed
call check
        look for duplicate

then if ok
        I then commit to database after entereing data


PHP doesn't seem to stop execution and wait for user input. it seems to merrily plug 
away.


thanks for any input gang,

Chris







Here's what I'd do (pseudocode):

<?php

if ($submit) {
        check for duplicate;
        if (everything OK) {
                commit to db;
        }
}
else {
        display form with submit button named 'submit';
}

?>

Mick

> how do I do this
> 
> call form
>       wait there until it is completed
> call check
>       look for duplicate
> 
> then if ok
>       I then commit to database after entereing data








Lets try that again:

> <?php
> 
> if ($submit) {
>       if (data already in db) {
                reject data;
        }
        else {
>               commit data to db;
>       }
> }
> else {
>       display form with submit button named 'submit';
> }
> 
> ?>
> 
> 

A bit of a mud map ... hope it helps

Mick





Thanks, Michael


You've reinforced how I've come learn that php does things.  When I first tried the 
script 
it simply printed the first form over and over. it was kind of funny in a way.  I'll 
restructure 
my program now to account for how PHP does things.  thanks again,

chris



On Mon, 9 Apr 2001 22:34:36 +0930 (CST), Michael Hall wrote:

>
>Here's what I'd do (pseudocode):
>
><?php
>
>if ($submit) {
>       check for duplicate;
>       if (everything OK) {
>               commit to db;
>       }
>}
>else {
>       display form with submit button named 'submit';
>}
>
>?>
>
>Mick
>
>> how do I do this
>> 
>> call form
>>      wait there until it is completed
>> call check
>>      look for duplicate
>> 
>> then if ok
>>      I then commit to database after entereing data
>
>
>






I've been trying to figure this out for a day or so now.  Someone needs to
do a concise tutorial with arrays, references, etc. with PHP.  I've got a
class that has a member variable that is an array.  When I try to access it
in a function like this:

print "blah blah blah $this->arrayname['value'] blah";

$this->arrayname evaluates to an array object and ['value'] comes out as a
string.  If I assign it to a variable first like so:

$arraytemp = $this->arrayname; 
print "blah blah blah $arraytemp['value'] blah";

it works fine.  However, I know there should be a way to reference it
directly.  Any suggestions on what I have do to as far as brackets, etc. to
force php to evaluate it they way I want?


Scott Delap
SBC Services, Inc.
[EMAIL PROTECTED]
314-235-6216





Try,
 
print "blah blah blah {$this->arrayname['value']} blah";

-Stewart

-----Original Message-----
From: DELAP, SCOTT F (SBCSI) [mailto:[EMAIL PROTECTED]]
Sent: 09 April 2001 15:28
To: [EMAIL PROTECTED]
Subject: [PHP] Real Problem: Accessing Array In A Class


I've been trying to figure this out for a day or so now.  Someone needs to
do a concise tutorial with arrays, references, etc. with PHP.  I've got a
class that has a member variable that is an array.  When I try to access it
in a function like this:

print "blah blah blah $this->arrayname['value'] blah";

$this->arrayname evaluates to an array object and ['value'] comes out as a
string.  If I assign it to a variable first like so:

$arraytemp = $this->arrayname; 
print "blah blah blah $arraytemp['value'] blah";

it works fine.  However, I know there should be a way to reference it
directly.  Any suggestions on what I have do to as far as brackets, etc. to
force php to evaluate it they way I want?


Scott Delap
SBC Services, Inc.
[EMAIL PROTECTED]
314-235-6216


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




Don't put complex variables inside quoted strings like that.  Simply break
out of your quoted string and do:

print "blah blah blah " . $this->arrayname['value'] . " blah";

-Rasmus

On Mon, 9 Apr 2001, DELAP, SCOTT F (SBCSI) wrote:

> I've been trying to figure this out for a day or so now.  Someone needs to
> do a concise tutorial with arrays, references, etc. with PHP.  I've got a
> class that has a member variable that is an array.  When I try to access it
> in a function like this:
>
> print "blah blah blah $this->arrayname['value'] blah";
>
> $this->arrayname evaluates to an array object and ['value'] comes out as a
> string.  If I assign it to a variable first like so:
>
> $arraytemp = $this->arrayname;
> print "blah blah blah $arraytemp['value'] blah";
>
> it works fine.  However, I know there should be a way to reference it
> directly.  Any suggestions on what I have do to as far as brackets, etc. to
> force php to evaluate it they way I want?
>
>
> Scott Delap
> SBC Services, Inc.
> [EMAIL PROTECTED]
> 314-235-6216
>
>
> --
> 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]
>





Use the string concat operator

print "blah blah blah ".$this->arrayname['value']." blah";


Morgan


At 10:27 AM 4/9/2001, you wrote:
>I've been trying to figure this out for a day or so now.  Someone needs to
>do a concise tutorial with arrays, references, etc. with PHP.  I've got a
>class that has a member variable that is an array.  When I try to access it
>in a function like this:
>
>print "blah blah blah $this->arrayname['value'] blah";
>
>$this->arrayname evaluates to an array object and ['value'] comes out as a
>string.  If I assign it to a variable first like so:
>
>$arraytemp = $this->arrayname;
>print "blah blah blah $arraytemp['value'] blah";
>
>it works fine.  However, I know there should be a way to reference it
>directly.  Any suggestions on what I have do to as far as brackets, etc. to
>force php to evaluate it they way I want?
>
>
>Scott Delap
>SBC Services, Inc.
>[EMAIL PROTECTED]
>314-235-6216
>
>
>--
>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]




strange...

echo 'blah blah blah ' . $this->arrayname['value'] . ' blah';

should work just as fine.

I think you are confused with strings.



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-----Original Message-----
From: DELAP, SCOTT F (SBCSI) [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 11:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Real Problem: Accessing Array In A Class


I've been trying to figure this out for a day or so now.  Someone needs to
do a concise tutorial with arrays, references, etc. with PHP.  I've got a
class that has a member variable that is an array.  When I try to access it
in a function like this:

print "blah blah blah $this->arrayname['value'] blah";

$this->arrayname evaluates to an array object and ['value'] comes out as a
string.  If I assign it to a variable first like so:

$arraytemp = $this->arrayname; 
print "blah blah blah $arraytemp['value'] blah";

it works fine.  However, I know there should be a way to reference it
directly.  Any suggestions on what I have do to as far as brackets, etc. to
force php to evaluate it they way I want?


Scott Delap
SBC Services, Inc.
[EMAIL PROTECTED]
314-235-6216


-- 
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 create an array (of over 100 elements) in Javascript, collected from
client-side interaction. Now I want to pass that information to PHP to
update a MySQL database. I'm guessing I would encode the information into a
data structure to pass to a page via POST. But I don't know how to do that
(or something better?). Can someone please point me in the right direction?

Thanks.
  --David







Create a FORM with HIDDEN fields, then pass the JS values to the HIDDEN
fields inside a JS function. Make your PHP script the target of the ACTION
attribute in the FORM tag, and grab the variables there.

jsFunction {
  document.forms[0].hiddenFieldName.value = (JS variable value);
}

<FORM action="yourPHPscript.php" method="post">
<INPUT TYPE="hidden" NAME="hiddenFieldName">


Kirk

> -----Original Message-----
> From: David Phillips [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 8:32 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How can I pass Javascript variables to PHP?
> 
> 
> I create an array (of over 100 elements) in Javascript, collected from
> client-side interaction. Now I want to pass that information to PHP to
> update a MySQL database. I'm guessing I would encode the 
> information into a
> data structure to pass to a page via POST. But I don't know 
> how to do that
> (or something better?). Can someone please point me in the 
> right direction?
> 
> Thanks.
>   --David
> 
> 
> 
> 
> -- 
> 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 use a command "copy" to upload a file from my local win machine to
webserver. However, it is not successful. It prompts that "Warning: Unable
to open 'D:\\PHP\\upload1.php' for reading:". I would like to know what is
the problem

Thank You!

HK  Woo






Are the permissions set OK?

Kirk

> -----Original Message-----
> From: HK Woo [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 9:01 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Upload file from my local C:
> 
> 
> Hi,
> 
> I use a command "copy" to upload a file from my local win machine to
> webserver. However, it is not successful. It prompts that 
> "Warning: Unable
> to open 'D:\\PHP\\upload1.php' for reading:". I would like to 
> know what is
> the problem
> 
> Thank You!
> 
> HK  Woo
> 
> 
> 
> -- 
> 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, Johnson

The file is located at my local WIN ME machine. The file is set to R/W

HK Woo
""Johnson, Kirk"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Are the permissions set OK?
>
> Kirk
>
> > -----Original Message-----
> > From: HK Woo [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, April 09, 2001 9:01 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Upload file from my local C:
> >
> >
> > Hi,
> >
> > I use a command "copy" to upload a file from my local win machine to
> > webserver. However, it is not successful. It prompts that
> > "Warning: Unable
> > to open 'D:\\PHP\\upload1.php' for reading:". I would like to
> > know what is
> > the problem
> >
> > Thank You!
> >
> > HK  Woo
> >
> >
> >
> > --
> > 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]
>







Is the file on your win machine on C: or D: ? There seems to be some
confusion about that. Also, how are you using 'copy' to upload the file?
Are you using a form with a 'file' input type and
ENCTYPE="multipart/form-data" in the FORM tag, etc?

Just some ideas.

Mick

On Mon, 9 Apr 2001, HK Woo wrote:

> Hi, Johnson
> 
> The file is located at my local WIN ME machine. The file is set to R/W
> 
> HK Woo
> ""Johnson, Kirk"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Are the permissions set OK?
> >
> > Kirk
> >
> > > -----Original Message-----
> > > From: HK Woo [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, April 09, 2001 9:01 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] Upload file from my local C:
> > >
> > >
> > > Hi,
> > >
> > > I use a command "copy" to upload a file from my local win machine to
> > > webserver. However, it is not successful. It prompts that
> > > "Warning: Unable
> > > to open 'D:\\PHP\\upload1.php' for reading:". I would like to
> > > know what is
> > > the problem
> > >
> > > Thank You!
> > >
> > > HK  Woo
> > >
> > >
> > >
> > > --
> > > 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]
> 
> 





I have tried to add ENCTYPE as you suggested. However, it still can't work.
The file is located in my D:

Any more idea?

Thank You!

HK Woo
"Michael Hall" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Is the file on your win machine on C: or D: ? There seems to be some
> confusion about that. Also, how are you using 'copy' to upload the file?
> Are you using a form with a 'file' input type and
> ENCTYPE="multipart/form-data" in the FORM tag, etc?
>
> Just some ideas.
>
> Mick
>
> On Mon, 9 Apr 2001, HK Woo wrote:
>
> > Hi, Johnson
> >
> > The file is located at my local WIN ME machine. The file is set to R/W
> >
> > HK Woo
> > ""Johnson, Kirk"" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Are the permissions set OK?
> > >
> > > Kirk
> > >
> > > > -----Original Message-----
> > > > From: HK Woo [mailto:[EMAIL PROTECTED]]
> > > > Sent: Monday, April 09, 2001 9:01 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] Upload file from my local C:
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I use a command "copy" to upload a file from my local win machine to
> > > > webserver. However, it is not successful. It prompts that
> > > > "Warning: Unable
> > > > to open 'D:\\PHP\\upload1.php' for reading:". I would like to
> > > > know what is
> > > > the problem
> > > >
> > > > Thank You!
> > > >
> > > > HK  Woo
> > > >
> > > >
> > > >
> > > > --
> > > > 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]
>






what`s the error message now? Can be something like "permission denied"...

You should create a diretory and do "chmod 666 dir_name", than you'll have
the right permission to write in this diretory.

regards,

Augusto

On Tue, 10 Apr 2001, HK Woo wrote:

> I have tried to add ENCTYPE as you suggested. However, it still can't work.
> The file is located in my D:
> 
> Any more idea?
> 
> Thank You!
> 
> HK Woo
> "Michael Hall" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > Is the file on your win machine on C: or D: ? There seems to be some
> > confusion about that. Also, how are you using 'copy' to upload the file?
> > Are you using a form with a 'file' input type and
> > ENCTYPE="multipart/form-data" in the FORM tag, etc?
> >
> > Just some ideas.
> >
> > Mick
> >
> > On Mon, 9 Apr 2001, HK Woo wrote:
> >
> > > Hi, Johnson
> > >
> > > The file is located at my local WIN ME machine. The file is set to R/W
> > >
> > > HK Woo
> > > ""Johnson, Kirk"" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > Are the permissions set OK?
> > > >
> > > > Kirk
> > > >
> > > > > -----Original Message-----
> > > > > From: HK Woo [mailto:[EMAIL PROTECTED]]
> > > > > Sent: Monday, April 09, 2001 9:01 AM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: [PHP] Upload file from my local C:
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > I use a command "copy" to upload a file from my local win machine to
> > > > > webserver. However, it is not successful. It prompts that
> > > > > "Warning: Unable
> > > > > to open 'D:\\PHP\\upload1.php' for reading:". I would like to
> > > > > know what is
> > > > > the problem
> > > > >
> > > > > Thank You!
> > > > >
> > > > > HK  Woo
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > 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]
> >
> 
> 
> 
> -- 
> 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]
> 





On Monday 09 April 2001 17:00, you wrote:
> Hi,
>
> I use a command "copy" to upload a file from my local win machine to
> webserver. However, it is not successful. It prompts that "Warning:
> Unable to open 'D:\\PHP\\upload1.php' for reading:". I would like to
> know what is the problem

show us some code. The warning should also print the line number where 
the problem occurs, What does that line do? what do you do in the 5 lines 
before that?

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"World domination. Fast." (Linus Torvalds about Linux)




Augusto
NO,

An error message is "Warning: Unable
to open 'D:\\PHP\\upload1.php' for reading:"

"Augusto Cesar Castoldi" <[EMAIL PROTECTED]> wrote in message
Pine.GSO.4.10.10104091306290.171-100000@venus">news:Pine.GSO.4.10.10104091306290.171-100000@venus...
> what`s the error message now? Can be something like "permission denied"...
>
> You should create a diretory and do "chmod 666 dir_name", than you'll have
> the right permission to write in this diretory.
>
> regards,
>
> Augusto
>
> On Tue, 10 Apr 2001, HK Woo wrote:
>
> > I have tried to add ENCTYPE as you suggested. However, it still can't
work.
> > The file is located in my D:
> >
> > Any more idea?
> >
> > Thank You!
> >
> > HK Woo
> > "Michael Hall" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > >
> > > Is the file on your win machine on C: or D: ? There seems to be some
> > > confusion about that. Also, how are you using 'copy' to upload the
file?
> > > Are you using a form with a 'file' input type and
> > > ENCTYPE="multipart/form-data" in the FORM tag, etc?
> > >
> > > Just some ideas.
> > >
> > > Mick
> > >
> > > On Mon, 9 Apr 2001, HK Woo wrote:
> > >
> > > > Hi, Johnson
> > > >
> > > > The file is located at my local WIN ME machine. The file is set to
R/W
> > > >
> > > > HK Woo
> > > > ""Johnson, Kirk"" <[EMAIL PROTECTED]> wrote in message
> > > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > > Are the permissions set OK?
> > > > >
> > > > > Kirk
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: HK Woo [mailto:[EMAIL PROTECTED]]
> > > > > > Sent: Monday, April 09, 2001 9:01 AM
> > > > > > To: [EMAIL PROTECTED]
> > > > > > Subject: [PHP] Upload file from my local C:
> > > > > >
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I use a command "copy" to upload a file from my local win
machine to
> > > > > > webserver. However, it is not successful. It prompts that
> > > > > > "Warning: Unable
> > > > > > to open 'D:\\PHP\\upload1.php' for reading:". I would like to
> > > > > > know what is
> > > > > > the problem
> > > > > >
> > > > > > Thank You!
> > > > > >
> > > > > > HK  Woo
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > 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]
> > >
> >
> >
> >
> > --
> > 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]
>






Hey there,

does anybody have any info regarding urlencode and rawurlencode - I
understand that raw is supposed to be used with directory structures and
urlencode with appended vars but when I ran a test I could use either.  Does
anybody have any info or examples which demonstrate which should be used
where and why.

Thanks





In one page from a series of pages where I am building arrays for future
use:

$item4_array = urlencode (serialize ($item4_array));
echo "<input type=hidden name=item4_array value=$item4_array>";
---
On my last page I send an email so I need the info that was stored:



$item4_array = unserialize(urldecode($item4_array));
$message .=" DIMS: L $item4_array[2] W $item4_array[3] H $item4_array[4]
\n";
$message .="Item Weight $item4_array[1] \n";


> Hey there,
>
> does anybody have any info regarding urlencode and rawurlencode


HTH--

ccma





Thanks Chris,

but I understand urlenconde and urldecode - what I need to see in an example
where rawurlencode as opposed to urlencode is used and why.

Thanks,
Abe
----- Original Message -----
From: "Christopher Allen" <[EMAIL PROTECTED]>
To: "info" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, April 09, 2001 4:12 PM
Subject: Re: [PHP] URL Encode >


> In one page from a series of pages where I am building arrays for future
> use:
>
> $item4_array = urlencode (serialize ($item4_array));
> echo "<input type=hidden name=item4_array value=$item4_array>";
> ---
> On my last page I send an email so I need the info that was stored:
>
>
>
> $item4_array = unserialize(urldecode($item4_array));
> $message .=" DIMS: L $item4_array[2] W $item4_array[3] H $item4_array[4]
> \n";
> $message .="Item Weight $item4_array[1] \n";
>
>
> > Hey there,
> >
> > does anybody have any info regarding urlencode and rawurlencode
>
>
> HTH--
>
> ccma
>





How can I store the time an entry was made into the db in a field.

  TIA

George






If you are using MySQL, add a "timestamp" field to the table. The first
timestamp in a table gets stamped everytime a record is modified.

Kirk

> -----Original Message-----
> From: george [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 9:05 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] recording time of entry
> 
> 
> How can I store the time an entry was made into the db in a field.
> 
>   TIA
> 
> George
> 
> 
> 
> -- 
> 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]
> 





  Will that work if I have for instance 100 entries, each entry recording
the time it was made then I would be able to pull that info out of the db
and display the record and time made  at a later date.
george







Yes ... 100 entries or 100 x 100 entries! :-)

Mick

On Mon, 9 Apr 2001, george wrote:

> 
>   Will that work if I have for instance 100 entries, each entry recording
> the time it was made then I would be able to pull that info out of the db
> and display the record and time made  at a later date.
> george
> 
> 
> 
> -- 
> 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]
> 
> 





It will work if you are creating a new record for each entry (an INSERT for
each entry). It will not work if you are UPDATE'ing an existing record for
each entry. In this case, only the time of the most recent UPDATE would be
recorded.

> -----Original Message-----
> From: george [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 9:16 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] recording time of entry
> 
> 
> 
>   Will that work if I have for instance 100 entries, each 
> entry recording
> the time it was made then I would be able to pull that info 
> out of the db
> and display the record and time made  at a later date.
> george




Hi Yasuo,

> Subject: Re: [PHP] Nested for() loops? -> Now Multi Dimension Arrays
> Date: Sat, 7 Apr 2001 12:57:02 +0900
> From: "Yasuo Ohgaki" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> 
> Simple to fix it. You just need to resolve ambiguity with {}.
> 
> >      $res = $i * $j;
> >      $target_array[$i][$j] = $res;
> >      print("result = $target_array[$i][$j] <br>");
> 
> print("result = {$target_array[$i][$j]} <br>");
> 
> Regards,
> --
> Yasuo Ohgaki

Nope. Those curly brackets broke the code.

<?
 error_reporting(E_ALL);

 $target_array = array();

 echo "starting <br>";

  for( $i=0; $i<5; $i++ )
   for( $j=0; $j<5; $j++ )
   {
     $res = $i * $j;
     $target_array[] = $res;
     print("result = {$target_array[$i][$j]} <br>");
   }

  echo "done<br>";
?>

This is the output without the curly brackets:
starting 
result = 0[0] 
result = 0[1] 
result = 0[2] 
result = 0[0] 
result = 0[1] 
result = 0[2] 
done

This is the output with the curly brackets:

starting 
result = 
result = 
result = 
result = 
result = 
result = 
done

Anyone have any ideas on how to make this work?

Thanks in advance!!

John





I am having trouble installing PHP4 on my linux machine. I downloaded to source
and i did a ./configure then a make then a make install. That all went good.
Now i am trying to find the libphp4.so file. I did a couple search commands but
it could not find it. Can anyone help me with finding this file...like where it
was installed on your machine. I uncompressed it in my home directory
/home/username 

Thanks,
-Frank




At 12:48 PM 4/9/2001, Frank K wrote:

RTFM!!!!!!!!!!!!!

read the fscking manual...it explains everything in the "installation" section

~kurth


>I am having trouble installing PHP4 on my linux machine. I downloaded to 
>source
>and i did a ./configure then a make then a make install. That all went good.
>Now i am trying to find the libphp4.so file. I did a couple search 
>commands but
>it could not find it. Can anyone help me with finding this file...like 
>where it
>was installed on your machine. I uncompressed it in my home directory
>/home/username
>
>Thanks,
>-Frank
>
>--
>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]





How can I list the files in a diretory?

Something like, get the files name in an array...

thanks,

Augusto Cesar Castoldi





> How can I list the files in a diretory?
> Something like, get the files name in an array...

http://www.php.net/manual/en/class.dir.php

Chris




Hello,
Could someone please tell me where I am going wrong here.
I have an HTML form and I want to past the input from a text box to the
next page url to connect
to my mysql database.

Here is where I am at now....

<form name="myEditForm" action="edit.phtml?number=<? '$exedit' ?>"
method="post" onsubmit="return validate()">
<input type="text" name="exedit" size="20">
<input type="submit" value="Submit" name="submit">
</form>

the onsubmit is a javascript for validation.

I have tried this every which way, but the correct way.

Could someone point me in the right direction.

Thanks
Curtis






Hi

Pass the variable as a parameter (without quotes):

<form name="myEditForm" action="edit.phtml?number=<?echo $exedit?>"
method="post" onsubmit="return validate()">

and then in the next page refer to the variable $number, OR

in the next page just refer to the variable $exedit (which gets posted as a
form variable) - This in PHP4

Cheers

Rudolf Visagie
[EMAIL PROTECTED]

-----Original Message-----
From: Curtis [mailto:[EMAIL PROTECTED]]
Sent: 09 April 2001 06:09
To: php
Subject: [PHP] Passing variables,,, I know its not this hard.


Hello,
Could someone please tell me where I am going wrong here.
I have an HTML form and I want to past the input from a text box to the
next page url to connect
to my mysql database.

Here is where I am at now....

<form name="myEditForm" action="edit.phtml?number=<? '$exedit' ?>"
method="post" onsubmit="return validate()">
<input type="text" name="exedit" size="20">
<input type="submit" value="Submit" name="submit">
</form>

the onsubmit is a javascript for validation.

I have tried this every which way, but the correct way.

Could someone point me in the right direction.

Thanks
Curtis



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




Try this:

<form name="myEditForm" action="edit.phtml?number=<?php echo $exedit; ?>"
method="post" onsubmit="return validate()">

This should display ?number correctly (I take it that's the problem).

You may also need to use "return validate();" or "javascript: return
validate();", not too sure about this though. 


HTH
Jon


-----Original Message-----
From: Curtis [mailto:[EMAIL PROTECTED]]
Sent: 09 April 2001 17:09
To: php
Subject: [PHP] Passing variables,,, I know its not this hard.


Hello,
Could someone please tell me where I am going wrong here.
I have an HTML form and I want to past the input from a text box to the
next page url to connect
to my mysql database.

Here is where I am at now....

<form name="myEditForm" action="edit.phtml?number=<? '$exedit' ?>"
method="post" onsubmit="return validate()">
<input type="text" name="exedit" size="20">
<input type="submit" value="Submit" name="submit">
</form>

the onsubmit is a javascript for validation.

I have tried this every which way, but the correct way.

Could someone point me in the right direction.

Thanks
Curtis



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



**********************************************************************
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or
confidentiality'

**********************************************************************




On Mon, 09 Apr 2001 12:08:48 -0400, Curtis ([EMAIL PROTECTED])
wrote:
>Hello,
>Could someone please tell me where I am going wrong here.
>I have an HTML form and I want to past the input from a text box to
>the
>next page url to connect
>to my mysql database.
>
>Here is where I am at now....
>
><form name="myEditForm" action="edit.phtml?number=<? '$exedit' ?>"

hehe, you need echo:  <?echo $exedit?>


>method="post" onsubmit="return validate()">
><input type="text" name="exedit" size="20">
><input type="submit" value="Submit" name="submit">
></form>
>
>the onsubmit is a javascript for validation.
>
>I have tried this every which way, but the correct way.
>
>Could someone point me in the right direction.
>
>Thanks
>Curtis
>
>
>
>--
>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]






Hi,

I'm trying to display a record count of some sort on a page I'm working 
on.  For example, "Record 1 of 15".  I can display the 1st number ok, but 
I'm a bit confused on what the count function should look like for the 
2nd number (15, in this case).  Here is my current (not working) code.

>  <?php
>
>   $query = "SELECT count(*) FROM mango_pr";
>   $result = mysql_query($query);
>   $record_count = mysql_fetch_row($result);
> 
>
>?>


And then I'm calling the code with an "echo"  later on:

><b><?php echo $record_count ?> </b></font>


This obviously isn't right...can anyone offer any suggestions?

Thanks,

mto



Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
---------------------
 M   A   N   G   O
B  O  U  L  D  E  R 
---------------------
http://www.thinkmango.com
[EMAIL PROTECTED]
p-303.442.1821
f-303.938.8507






Hi

There are 2 issues:

You need to maintain a page counter

You need to pass the page counter and the total page count from page to page

You can do this via url params
(xxx.html?page=$page_count&record_count=$record_count), sessions or cookies
depending

HTH


-----Original Message-----
From: Michael O'Neal [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 9:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Count function. (Newbie Question)


Hi,

I'm trying to display a record count of some sort on a page I'm working
on.  For example, "Record 1 of 15".  I can display the 1st number ok, but
I'm a bit confused on what the count function should look like for the
2nd number (15, in this case).  Here is my current (not working) code.

>  <?php
>
>   $query = "SELECT count(*) FROM mango_pr";
>   $result = mysql_query($query);
>   $record_count = mysql_fetch_row($result);
>
>
>?>


And then I'm calling the code with an "echo"  later on:

><b><?php echo $record_count ?> </b></font>


This obviously isn't right...can anyone offer any suggestions?

Thanks,

mto



Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
---------------------
 M   A   N   G   O
B  O  U  L  D  E  R
---------------------
http://www.thinkmango.com
[EMAIL PROTECTED]
p-303.442.1821
f-303.938.8507



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





Look here as a starting point:

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

I don't know the exact answer to your question but I hope that this helps.

-- Rodney

Michael O'Neal wrote:

> Hi,
>
> I'm trying to display a record count of some sort on a page I'm working
> on.  For example, "Record 1 of 15".  I can display the 1st number ok, but
> I'm a bit confused on what the count function should look like for the
> 2nd number (15, in this case).  Here is my current (not working) code.
>
> >  <?php
> >
> >   $query = "SELECT count(*) FROM mango_pr";
> >   $result = mysql_query($query);
> >   $record_count = mysql_fetch_row($result);
> >
> >
> >?>
>
> And then I'm calling the code with an "echo"  later on:
>
> ><b><?php echo $record_count ?> </b></font>
>
> This obviously isn't right...can anyone offer any suggestions?
>
> Thanks,
>
> mto
>
> Michael O'Neal
> Web Producer/ Autocrosser
> ST 28 '89 Civic Si
> ---------------------
>  M   A   N   G   O
> B  O  U  L  D  E  R
> ---------------------
> http://www.thinkmango.com
> [EMAIL PROTECTED]
> p-303.442.1821
> f-303.938.8507
>
> --
> 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]





Well, in this code, you are going to receive one line from your table that
displays the total number of records. And that is it. Here is a sample from
one of my tables, using the MySQL CLI:

mysql> select count(*) from locker;
+----------+
| count(*) |
+----------+
|       47 |
+----------+
1 row in set (1.65 sec)



If you can be a little more specific about what you want, maybe type up what
you expect out, we can fix your query statement.


Also, in this line:
>> <b><?php echo $record_count ?> </b></font>

You should put a ';' after the variable, just to save yourself the hassle of
a parse error, when you get working code.

On 4/9/01 9:32 AM, "Michael O'Neal" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I'm trying to display a record count of some sort on a page I'm working
> on.  For example, "Record 1 of 15".  I can display the 1st number ok, but
> I'm a bit confused on what the count function should look like for the
> 2nd number (15, in this case).  Here is my current (not working) code.
> 
>>  <?php
>> 
>>   $query = "SELECT count(*) FROM mango_pr";
>>   $result = mysql_query($query);
>>   $record_count = mysql_fetch_row($result);
>> 
>> 
>> ?>
> 
> 
> And then I'm calling the code with an "echo"  later on:
> 
>> <b><?php echo $record_count ?> </b></font>
> 
> 
> This obviously isn't right...can anyone offer any suggestions?
> 
> Thanks,
> 
> mto
> 
> 
> 
> Michael O'Neal
> Web Producer/ Autocrosser
> ST 28 '89 Civic Si
> ---------------------
> M   A   N   G   O
> B  O  U  L  D  E  R
> ---------------------
> http://www.thinkmango.com
> [EMAIL PROTECTED]
> p-303.442.1821
> f-303.938.8507
> 
> 





>Hi
>
>There are 2 issues:
>
>You need to maintain a page counter
>
>You need to pass the page counter and the total page count from page to page
>
>You can do this via url params
>(xxx.html?page=$page_count&record_count=$record_count), sessions or cookies
>depending
>
>HTH


Let me elaborate a little bit more.  I don't think I explained myself 
very well.  Sorry to waste the bandwidth.

I am building a little press-release administration for our sales 
department.  There is a single page that contains form fields where they 
can input thier data.  I want the users/admins to be able to see what 
record number they are editing, and how many total records there are in 
the db.  I have figured out the record number by echoing the "ID" of the 
record.  I can't figure out how to display how many *total* records there 
are in that db.  Does your tip still apply?

Thanks again,

mto

Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
---------------------
 M   A   N   G   O
B  O  U  L  D  E  R 
---------------------
http://www.thinkmango.com
[EMAIL PROTECTED]
p-303.442.1821
f-303.938.8507






No, this is different - try

 $query = "SELECT id,count(*) as result_count FROM mango_pr";
   $result = mysql_query($query);
   $row = mysql_fetch_array($result);
   $id=$row['id'];
   $result_count=$row['result_count'];

   echo "$id,$result_count";


You might need to make the form action=$PHP_SELF  if you want the form to
loop

Also you can use a progream structure like

if ($submit) {
  // validate and update  new stuff
  }
else
{
  // display the form action=$PHP_SELF
}

to display and validate the form

-----Original Message-----
From: Michael O'Neal [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 9:53 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Count function. (Newbie Question)


>Hi
>
>There are 2 issues:
>
>You need to maintain a page counter
>
>You need to pass the page counter and the total page count from page to
page
>
>You can do this via url params
>(xxx.html?page=$page_count&record_count=$record_count), sessions or cookies
>depending
>
>HTH


Let me elaborate a little bit more.  I don't think I explained myself
very well.  Sorry to waste the bandwidth.

I am building a little press-release administration for our sales
department.  There is a single page that contains form fields where they
can input thier data.  I want the users/admins to be able to see what
record number they are editing, and how many total records there are in
the db.  I have figured out the record number by echoing the "ID" of the
record.  I can't figure out how to display how many *total* records there
are in that db.  Does your tip still apply?

Thanks again,

mto

Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
---------------------
 M   A   N   G   O
B  O  U  L  D  E  R
---------------------
http://www.thinkmango.com
[EMAIL PROTECTED]
p-303.442.1821
f-303.938.8507



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





Ya know, you don't even have to go that far.

Now thati know more what you were looking for, after submitting a query
like: SELECT * FROM table

You will get all the data in your table.

In php, you will have a $result to access that array of data
(mysql_fetch_array(), mysql_fetch_row(),mysql_fetch_object() )

Using php, $number_of_records = mysql_num_rows_affected($result);
Will return the number of records retrieved, in this case, the total amount.
Don't need two queries, don't need put the count() function in the query.

There are a lot of pieces of information regarding your query, that can be
returned, without additional queries or extra statements in mysql.

Take aminute to look at the names of ALL the mysql functions in PHP
http://www.php.net/manual/en/ref.mysql.php





On 4/9/01 10:30 AM, "Dell Coleman" <[EMAIL PROTECTED]> wrote:

> No, this is different - try
> 
> $query = "SELECT id,count(*) as result_count FROM mango_pr";
>  $result = mysql_query($query);
>  $row = mysql_fetch_array($result);
>  $id=$row['id'];
>  $result_count=$row['result_count'];
> 
>  echo "$id,$result_count";
> 
> 
> You might need to make the form action=$PHP_SELF  if you want the form to
> loop
> 
> Also you can use a progream structure like
> 
> if ($submit) {
> // validate and update  new stuff
> }
> else
> {
> // display the form action=$PHP_SELF
> }
> 
> to display and validate the form
> 
> -----Original Message-----
> From: Michael O'Neal [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 9:53 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Count function. (Newbie Question)
> 
> 
>> Hi
>> 
>> There are 2 issues:
>> 
>> You need to maintain a page counter
>> 
>> You need to pass the page counter and the total page count from page to
> page
>> 
>> You can do this via url params
>> (xxx.html?page=$page_count&record_count=$record_count), sessions or cookies
>> depending
>> 
>> HTH
> 
> 
> Let me elaborate a little bit more.  I don't think I explained myself
> very well.  Sorry to waste the bandwidth.
> 
> I am building a little press-release administration for our sales
> department.  There is a single page that contains form fields where they
> can input thier data.  I want the users/admins to be able to see what
> record number they are editing, and how many total records there are in
> the db.  I have figured out the record number by echoing the "ID" of the
> record.  I can't figure out how to display how many *total* records there
> are in that db.  Does your tip still apply?
> 
> Thanks again,
> 
> mto
> 
> Michael O'Neal
> Web Producer/ Autocrosser
> ST 28 '89 Civic Si
> ---------------------
> M   A   N   G   O
> B  O  U  L  D  E  R
> ---------------------
> http://www.thinkmango.com
> [EMAIL PROTECTED]
> p-303.442.1821
> f-303.938.8507
> 
> 
> 
> --
> 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 too, am trying to get this module, so that it will load with dl()

On unix, it is libpdf.so

So, if anyone can answer me this:
How do you compile a module under unix/linux for use with dl()?

Anyone, anyone?
Fry? Fry? Fry?
(sorry, little ferris buehler ref there.)



On 4/8/01 7:00 PM, "Jochen Kaechelin" <[EMAIL PROTECTED]> wrote:

> Where can I get a php_pdf.so file
> for trying the dl-function on our server?
> 
> I locally use a Win-System and therfore only
> have a php_pdf.dll!
> 
> --
> Jochen Kaechelin - Ihr WEBberater
> Stuttgarter Str.3, D-73033 Goeppingen
> Tel. 07161-92 95 94, Fax 07161-92 95 98
> http://www.wa-p.de, mailto:[EMAIL PROTECTED] 





Someone on the list posted this a while back
it is the easiest method I've seen to alternate
row colors (of course this code is abridged)

<snip>
$colors = array( '#e4e4e4', '#ffffff' );

$i = 0;
//start loop
while (whatever)
{
echo "<tr bgcolor=" . $colors[ $i ++ % count( $colors ) ] . ">";
}
</snip>

Jerry Lake            - [EMAIL PROTECTED]
Web Designer
Europa Communications - http://www.europa.com
Pacifier Online     - http://www.pacifier.com


-----Original Message-----
From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 08, 2001 10:43 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Row colors


Hello Mike,

On 08-Apr-01 21:08:17, you wrote:

>I can change the column sof a table with the following code but how do I
>change the row colors instead.With the columns I have "i" to manipulate but
>not with rows.

>while ($row = mysql_fetch_row($result))
>{{
>       echo "<TR>\n";
>       for ($i =1;$i<mysql_num_fields($result);$i++)
>               {$cell_color = "#C0C0C0";
>       $i % 2  ? 0: $cell_color = "#CCCCCC";
>       echo "<td bgcolor=\"$cell_color\">$row[$i]</td>";

What you need to do is very simple.  Just echo the <TR> inside your
for loop and make it BGCOLOR attribute change according to the row number.

While you are at it, maybe you would like to try this PHP table listing
class that not only lets you iterate and change colors for each row but it
also lets you change the highlighting color that the row will have when the
mouse is over them.

http://phpclasses.UpperDesign.com/browse.html/package/120


For display database query results, you may want to try this PHP class
based on the previous that is also able to display links to go between any
pages that the results may be split.

http://phpclasses.UpperDesign.com/browse.html/package/130



Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


--
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 have developped a site using php, but i'd like to add a login acess
for private pages, i mean only subscribed epople are allowed to access 
certain pages , how can i do that and how can i overpass the problem of 
showing the url , knowing that if someone saw the url he  may open it 
without loging
Thanks
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





Sessions would do this.

- Kath

----- Original Message ----- 
From: "kaab kaoutar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 09, 2001 1:00 PM
Subject: [PHP] login & security


> Hi!
> i have developped a site using php, but i'd like to add a login acess
> for private pages, i mean only subscribed epople are allowed to access 
> certain pages , how can i do that and how can i overpass the problem of 
> showing the url , knowing that if someone saw the url he  may open it 
> without loging
> Thanks
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> 
> -- 
> 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]
> 





Guys,

I know this has nowt to do with PHP so I'll keep it as short as possible.

My problem is, I'd like to get 404 error redirecting to work in IE under
Apache. I've set the ErrorDocument in apache.conf and in .htaccess. It works
in Netscape et al but not in IE.

IE seems to be issuing it's own error page. I know there must be a config
somewhere other than the client side "Show friendly error messages", but
can't seem to find it. I have RTFM and scanned the Web but still not found
it. Hope you can help.

Once again I apologize for being Off Topic.

Kind Regards

Andy Woolley
www.databasewatch.com

ps if you want to test it try www.databasewatch.com/noexist





Your custom 404 is probably less than 512 bytes. This causes IE to display
its own inbuilt error page (don't ask me why :-) Push it over that and all
should be well.

HTH
Jon


-----Original Message-----
From: Andy Woolley [mailto:[EMAIL PROTECTED]]
Sent: 09 April 2001 18:00
To: [EMAIL PROTECTED]
Subject: [PHP] Sorry - Way OT but I need help


Guys,

I know this has nowt to do with PHP so I'll keep it as short as possible.

My problem is, I'd like to get 404 error redirecting to work in IE under
Apache. I've set the ErrorDocument in apache.conf and in .htaccess. It works
in Netscape et al but not in IE.

IE seems to be issuing it's own error page. I know there must be a config
somewhere other than the client side "Show friendly error messages", but
can't seem to find it. I have RTFM and scanned the Web but still not found
it. Hope you can help.

Once again I apologize for being Off Topic.

Kind Regards

Andy Woolley
www.databasewatch.com

ps if you want to test it try www.databasewatch.com/noexist


**********************************************************************
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**********************************************************************




Jon, your a star.......Thanks alot

How rediculous is that of MS to do it that way. I really did try and find
out what was going on and knew it had to be something simple, but I never
expected it be that stupid.

Thanks Again
Andy Woolley
www.databasewatch.com

ps. If you ever visit the Midlands, I'll by you a beer :-)

----- Original Message -----
From: "Jon Haworth" <[EMAIL PROTECTED]>
To: "'Andy Woolley'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, April 09, 2001 6:09 PM
Subject: RE: [PHP] Sorry - Way OT but I need help


> Your custom 404 is probably less than 512 bytes. This causes IE to display
> its own inbuilt error page (don't ask me why :-) Push it over that and all
> should be well.
>
> HTH
> Jon
>
>
> -----Original Message-----
> From: Andy Woolley [mailto:[EMAIL PROTECTED]]
> Sent: 09 April 2001 18:00
> To: [EMAIL PROTECTED]
> Subject: [PHP] Sorry - Way OT but I need help
>
>
> Guys,
>
> I know this has nowt to do with PHP so I'll keep it as short as possible.
>
> My problem is, I'd like to get 404 error redirecting to work in IE under
> Apache. I've set the ErrorDocument in apache.conf and in .htaccess. It
works
> in Netscape et al but not in IE.
>
> IE seems to be issuing it's own error page. I know there must be a config
> somewhere other than the client side "Show friendly error messages", but
> can't seem to find it. I have RTFM and scanned the Web but still not found
> it. Hope you can help.
>
> Once again I apologize for being Off Topic.
>
> Kind Regards
>
> Andy Woolley
> www.databasewatch.com
>
> ps if you want to test it try www.databasewatch.com/noexist
>
>
> **********************************************************************
> 'The information included in this Email is of a confidential nature and is
> intended only for the addressee. If you are not the intended addressee,
> any disclosure, copying or distribution by you is prohibited and may be
> unlawful. Disclosure to any party other than the addressee, whether
> inadvertent or otherwise is not intended to waive privilege or
confidentiality'
>
> **********************************************************************
>





> I know this has nowt to do with PHP so I'll keep it as short 
> as possible.
> My problem is, I'd like to get 404 error redirecting to work 
> in IE under Apache. I've set the ErrorDocument in apache.conf 
> and in .htaccess. It works in Netscape et al but not in IE.
> IE seems to be issuing it's own error page. I know there must 
> be a config somewhere other than the client side "Show friendly 
> error messages", but can't seem to find it. I have RTFM and 
> scanned the Web but still not found it. Hope you can help.
> Once again I apologize for being Off Topic.

Does someone have an example of how to do this within .htaccess?
I've tried everything and all I ever get is an Internal Server Error
when the .htaccess file is in place... :/

Chris




> -----Original Message-----
> From: Boget, Chris [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 1:57 PM
> To: 'Andy Woolley'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Sorry - Way OT but I need help
> 
> 
> > I know this has nowt to do with PHP so I'll keep it as short 
> > as possible.
> > My problem is, I'd like to get 404 error redirecting to work 
> > in IE under Apache. I've set the ErrorDocument in apache.conf 
> > and in .htaccess. It works in Netscape et al but not in IE.
> > IE seems to be issuing it's own error page. I know there must 
> > be a config somewhere other than the client side "Show friendly 
> > error messages", but can't seem to find it. I have RTFM and 
> > scanned the Web but still not found it. Hope you can help.
> > Once again I apologize for being Off Topic.

MSIE will always (and there doesn't seem to be any way around it)
display its own error page if the error page returned by the server is
smaller than (if I'm remembering correctly) 512 bytes.

(The theory, presumably, being that if you're not going to offer at
least half a kilobyte back, then the browser's built-in error page is
probably more useful.)
 
> Does someone have an example of how to do this within .htaccess?
> I've tried everything and all I ever get is an Internal Server Error
> when the .htaccess file is in place... :/

I've found that my web server's error logs usually say interesting and
useful things when i get an "Internal Server Error" message.  Any clues
there?


---
Mark Roedel ([EMAIL PROTECTED])  ||  "There cannot be a crisis next week.
Systems Programmer / WebMaster  ||   My schedule is already full."
     LeTourneau University      ||                    -- Henry Kissinger





Check out my site, I just did the same thing.

http://www.lesneste.com

I used to have a bunch of personal info out there for the world to see, but
I decided it was invitation to identity theft so I put it behind a
password.  Now, to get access, you have to reveal an email address to which
your password will be mailed, which I think is a reasonable tradeoff.

I decided I wanted to stay with HTML files as much as possible so I could
develop most of my pages on my local hard drive without an HTTP server in
the loop.  This mandated no sessions, just .htaccess.  I use one PHP page
that lets users request their password.

I found something bizarre (unexpected in a way that makes no sense to me)
with Apache ErrorDocuments, namely, that you can specify an ErrorDocument
in another directory besides the one containing the file that generated the
error, and that ErrorDocument will be loaded, but all relative URLs within
that page will be resolved relative to the original directory (the one
containing the .htaccess file).  My solution to this was to use absolute
URLs instead of relative in the ErrorDocument for things like specifying
IMGs.  I don't like using absolute URLs, but it worked.

Here's the .htaccess that gets the job done.  Notice I care about a 401
(authorization) and not 404.

=========================================================

AuthUserFile /yourpathhere/.htpasswd
AuthGroupFile /dev/null
AuthName "Personal"
AuthType Basic
ErrorDocument 401 /requestpwd.php?func=intro&secn=photos

<Limit GET POST>
require valid-user
</Limit>

===================================================

Hope that helps.

At 01:57 PM 4/9/2001 -0500, Boget, Chris wrote:
>> I know this has nowt to do with PHP so I'll keep it as short 
>> as possible.
>> My problem is, I'd like to get 404 error redirecting to work 
>> in IE under Apache. I've set the ErrorDocument in apache.conf 
>> and in .htaccess. It works in Netscape et al but not in IE.
>> IE seems to be issuing it's own error page. I know there must 
>> be a config somewhere other than the client side "Show friendly 
>> error messages", but can't seem to find it. I have RTFM and 
>> scanned the Web but still not found it. Hope you can help.
>> Once again I apologize for being Off Topic.
>
>Does someone have an example of how to do this within .htaccess?
>I've tried everything and all I ever get is an Internal Server Error
>when the .htaccess file is in place... :/
>
>Chris
>

............................................................................
Les Neste  678-778-0382  http://www.lesneste.com




Hi

Is there a function in PHP that will tell me if the the users browser is
using 128 bit encryption or not.

Thanks

Nick Steele





Hi!

I'm trying to speed up a big application by splitting it into a codebase
acting as a server and the actual scripts communicating with the server
using sockets.

I got the server working, at least it works when I send a request via
telnet. When I try to let a script act as the client I get no response. I
think the problem is the length parameter in the read()-function.
Not all requests and results are 2048 bytes, but I have no idea what to use
as a delimiter instead.
Here are the scripts so far:

Server:

// Socket was created, bind & listen executed
do {
    if (($msgsock = accept_connect($sock)) < 0) { // wait for request
        echo "accept_connect() failed: reason: " . strerror ($msgsock) .
"\n";
        break;
    }
    do {
        $buf = '';
        $ret = read ($msgsock, $buf, 2048);         // read request
        echo "request: $ret <br>";
        if ($ret < 0) {
            echo "read() failed: reason: " . strerror ($ret) . "\n";
            break 2;
        }
        if ($ret == 0) {
            break 2;
        }
        $buf = trim ($buf);

        $talkback = eval($buf);                                    //
request verabeiten
        write ($msgsock, $talkback, strlen ($talkback)); // write result to
socket
        echo "$buf\n";
    } while (true);
    close ($msgsock);
} while (true);



Client:


// Socket was created; submitting request

write ($socket, $in, strlen ($in));
         while (read ($socket, $out, 2048))  // reading response. what if
the response is < 2048 bytes?
               {
               echo $out;
               }


As I said: The server works perfectly using telnet, but the script-client
does not give any output, allthough the connection was created successfully.

Thanks in advance for any answers. I hope I was able to describe the problem
well enough.

Matt





No, your problem is most likely that you didn't do anything with the telnet
negotiation phase.

Read the RFC on telnet, and you will find that there is a whole
client-server negotiation phase going on. Kinda like a modem handshake.
It is really quite difficult, and no one has ported a Telnet class to PHP
yet. (big big task)

There is a Net::Telnet class in perl that I ended up using to write a script
to do something similar, and pass results back to the php script that called
it.

Telnet is simply not as easy as opening a socket. If you don't send the
right set of characters as the first block, it won't work.


On 4/9/01 10:16 AM, "Matthias Winkelmann" <[EMAIL PROTECTED]> wrote:

> Hi!
> 
> I'm trying to speed up a big application by splitting it into a codebase
> acting as a server and the actual scripts communicating with the server
> using sockets.
> 
> I got the server working, at least it works when I send a request via
> telnet. When I try to let a script act as the client I get no response. I
> think the problem is the length parameter in the read()-function.
> Not all requests and results are 2048 bytes, but I have no idea what to use
> as a delimiter instead.
> Here are the scripts so far:
> 
> Server:
> 
> // Socket was created, bind & listen executed
> do {
>   if (($msgsock = accept_connect($sock)) < 0) { // wait for request
>       echo "accept_connect() failed: reason: " . strerror ($msgsock) .
> "\n";
>       break;
>   }
>   do {
>       $buf = '';
>       $ret = read ($msgsock, $buf, 2048);         // read request
>       echo "request: $ret <br>";
>       if ($ret < 0) {
>           echo "read() failed: reason: " . strerror ($ret) . "\n";
>           break 2;
>       }
>       if ($ret == 0) {
>           break 2;
>       }
>       $buf = trim ($buf);
> 
>       $talkback = eval($buf);                                    //
> request verabeiten
>       write ($msgsock, $talkback, strlen ($talkback)); // write result to
> socket
>       echo "$buf\n";
>   } while (true);
>   close ($msgsock);
> } while (true);
> 
> 
> 
> Client:
> 
> 
> // Socket was created; submitting request
> 
> write ($socket, $in, strlen ($in));
>        while (read ($socket, $out, 2048))  // reading response. what if
> the response is < 2048 bytes?
>              {
>              echo $out;
>              }
> 
> 
> As I said: The server works perfectly using telnet, but the script-client
> does not give any output, allthough the connection was created successfully.
> 
> Thanks in advance for any answers. I hope I was able to describe the problem
> well enough.
> 
> Matt
> 







> -----Original Message-----
> From: Lindsay Adams [mailto:[EMAIL PROTECTED]]
>
> No, your problem is most likely that you didn't do anything with
> the telnet
> negotiation phase.
[..]

That doesn't sound very encouraging :-(

Anyway, I got that idea of splitting an application into a codebase
listening on a port and a frontend connecting with it in the zend tips
section http://www.zend.com/tips/tips.php?id=169&single=1 .

It seems as if somebody got it to work (in 15 min as he writes).
Unfortunately, I couldn't find his email adress anywhere. Therefore: If
anybody has done this before, has an idea how it could work or knows this
author 'npeen', it could really save me a lot of time.

Thanks for all ideas,

Matt





well, if they did, and they made a full telnet class, then great!! give us
all the class!!

BUT, if they wrote their own socket listener, essentially their own
protocol, then it would work.

but if you are using sockets to connect to a real telnet server (as it were)
then you MUST have the negotiation part.

http (port 80) is just raw socket transport. telnet (port 23) is not.
so, communication like you want is possible, just don't count on a real
telnet connection right yet.

On 4/9/01 3:27 PM, "Matthias Winkelmann" <[EMAIL PROTECTED]> wrote:

> 
> 
>> -----Original Message-----
>> From: Lindsay Adams [mailto:[EMAIL PROTECTED]]
>> 
>> No, your problem is most likely that you didn't do anything with
>> the telnet
>> negotiation phase.
> [..]
> 
> That doesn't sound very encouraging :-(
> 
> Anyway, I got that idea of splitting an application into a codebase
> listening on a port and a frontend connecting with it in the zend tips
> section http://www.zend.com/tips/tips.php?id=169&single=1 .
> 
> It seems as if somebody got it to work (in 15 min as he writes).
> Unfortunately, I couldn't find his email adress anywhere. Therefore: If
> anybody has done this before, has an idea how it could work or knows this
> author 'npeen', it could really save me a lot of time.
> 
> Thanks for all ideas,
> 
> Matt
> 





I am currently thinking about how to implement a realtime chat using the
XMLSocket functionality in Macromedia Flash 5 using the PHP socket
functions. Here's a quote from the Flash 5 online help:

----------------------- begin quote -----------------------
Using the XMLSocket object

To use the XMLSocket object, the server computer must run a daemon that
understands the protocol used by the XMLSocket object. The protocol is
as follows: 

 XML messages are sent over a full-duplex TCP/IP stream socket
connection. 
 Each XML message is a complete XML document, terminated by
a zero byte. 
 An unlimited number of XML messages can be sent and
received over a single XMLSocket connection. 

The XMLSocket object is useful for client-server applications that
require low latency, such as real-time chat systems. A traditional
HTTP-based chat solution frequently polls the server and downloads new
messages using an HTTP request. In contrast, an XMLSocket chat solution
maintains an open connection to the server, which allows the server to
immediately send incoming messages without a request from the client. 

Setting up a server to communicate with the XMLSocket object can be
challenging. If your application does not require real-time
interactivity, use the loadVariables action, or Flash's HTTP-based XML
server connectivity (XML.load, XML.sendAndLoad, XML.send), instead of
the XMLSocket object. 

To use the methods of the XMLSocket object, you must first use the
constructor, new XMLSocket, to create a new XMLSocket object. 
----------------------- end quote -----------------------

Does anyone have any knowledge of similar projects/attempts to create a
server in PHP that would be able to talk to a client that uses the Flash
5 XMLSocket object, or would anyone care to provide some pointers to
other resources about it? I've never tried to write a server, but this
might solve quite a few problems that I encounter on a day-to-day basis.
Http really sucks when you try to do anything vaguely more complicated
than a mailto form, seeing that it is a stateless protocol . . . and
Flash 5 could fill that gap for the stuff I'd like to do at least.

Regards, Frank





    Does anyone have 'plug-in' message threading code?  I see several
PHP sites with some sort of message threading going on, and I'd hate to
reinvent the wheel.  I'd like to have that type of ability built into a
project I'm working on.

    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






You should check into forums ...

--Joe

On Mon, Apr 09, 2001 at 11:57:45AM -0600, Ashley M. Kirchner wrote:
> 
>     Does anyone have 'plug-in' message threading code?  I see several
> PHP sites with some sort of message threading going on, and I'd hate to
> reinvent the wheel.  I'd like to have that type of ability built into a
> project I'm working on.
> 
>     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]


/******************************************************************************\
 *                    Joe Stump - PHP/SQL/HTML Developer                      *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\******************************************************************************/





Check out: http://www.phorum.org/

We use phorum at: http://www.theparentreport.com/community/discussion/

Takes a bit of work to install and configure but it's worth it; Check out
the link and you'll see it can be fully integrated into your site.

Let me know if you have more questions.

Matt Friedman
Spry New Media
http://www.sprynewmedia.com



----- Original Message -----
From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>
To: "PHP-General List" <[EMAIL PROTECTED]>
Sent: Monday, April 09, 2001 10:57 AM
Subject: [PHP] Threading code


>
>     Does anyone have 'plug-in' message threading code?  I see several
> PHP sites with some sort of message threading going on, and I'd hate to
> reinvent the wheel.  I'd like to have that type of ability built into a
> project I'm working on.
>
>     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]
>
>
>





Phorum is indeed a good product.  And when you've had enough fun playing 
around with Phorum, you ought to get involved in the process of 
rebuilding Phorum to fit into an entirely new database schema.  Ugh.


>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 4/9/01, 11:12:39 AM, "Matt Friedman" <[EMAIL PROTECTED]> wrote regarding Re: 
[PHP] Threading code:


> Check out: http://www.phorum.org/

> We use phorum at: http://www.theparentreport.com/community/discussion/

> Takes a bit of work to install and configure but it's worth it; Check out
> the link and you'll see it can be fully integrated into your site.

> Let me know if you have more questions.

> Matt Friedman
> Spry New Media
> http://www.sprynewmedia.com



> ----- Original Message -----
> From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>
> To: "PHP-General List" <[EMAIL PROTECTED]>
> Sent: Monday, April 09, 2001 10:57 AM
> Subject: [PHP] Threading code


> >
> >     Does anyone have 'plug-in' message threading code?  I see several
> > PHP sites with some sort of message threading going on, and I'd hate to
> > reinvent the wheel.  I'd like to have that type of ability built into a
> > project I'm working on.
> >
> >     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]
> >
> >
> >


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




> Phorum is indeed a good product.  And when you've had enough fun playing 
> around with Phorum, you ought to get involved in the process of 
> rebuilding Phorum to fit into an entirely new database schema.  Ugh.

A much needed upgrade - the db schemas and searching technique (like '%foo%' 
last time I checked) was the reason I didn't go with it.

--Joe


> 
> 
> >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
> 
> On 4/9/01, 11:12:39 AM, "Matt Friedman" <[EMAIL PROTECTED]> wrote regarding Re: 
> [PHP] Threading code:
> 
> 
> > Check out: http://www.phorum.org/
> 
> > We use phorum at: http://www.theparentreport.com/community/discussion/
> 
> > Takes a bit of work to install and configure but it's worth it; Check out
> > the link and you'll see it can be fully integrated into your site.
> 
> > Let me know if you have more questions.
> 
> > Matt Friedman
> > Spry New Media
> > http://www.sprynewmedia.com
> 
> 
> 
> > ----- Original Message -----
> > From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>
> > To: "PHP-General List" <[EMAIL PROTECTED]>
> > Sent: Monday, April 09, 2001 10:57 AM
> > Subject: [PHP] Threading code
> 
> 
> > >
> > >     Does anyone have 'plug-in' message threading code?  I see several
> > > PHP sites with some sort of message threading going on, and I'd hate to
> > > reinvent the wheel.  I'd like to have that type of ability built into a
> > > project I'm working on.
> > >
> > >     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]
> > >
> > >
> > >
> 
> 
> > --
> > 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]


/******************************************************************************\
 *                    Joe Stump - PHP/SQL/HTML Developer                      *
 * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net   *
 * "Better to double your money on mediocrity than lose it all on a dream."   * 
\******************************************************************************/




Our DBA idn't like the way that Phorum creates new tables willy-nilly for 
each new forum that is created, so we have a new schema in place that 
utilizes a few tables that are updated with each new message.  We don't, 
right now, have any plans to update the search engine.  FWIW, we're 
building it for use with our in-house Oracle database, utilizing stored 
procedures to actually insert the data into the tables.  Our select 
queries are still hard-coded into the Phorum source code, but all inserts 
and updates are being handled by our Oracle sp's.


>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 4/9/01, 11:11:44 AM, Joe Stump <[EMAIL PROTECTED]> wrote regarding Re: 
[PHP] Threading code:


> > Phorum is indeed a good product.  And when you've had enough fun playing
> > around with Phorum, you ought to get involved in the process of
> > rebuilding Phorum to fit into an entirely new database schema.  Ugh.

> A much needed upgrade - the db schemas and searching technique (like 
'%foo%'
> last time I checked) was the reason I didn't go with it.

> --Joe


> >
> >
> > >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
> >
> > On 4/9/01, 11:12:39 AM, "Matt Friedman" <[EMAIL PROTECTED]> wrote regarding Re:
> > [PHP] Threading code:
> >
> >
> > > Check out: http://www.phorum.org/
> >
> > > We use phorum at: http://www.theparentreport.com/community/discussion/
> >
> > > Takes a bit of work to install and configure but it's worth it; Check out
> > > the link and you'll see it can be fully integrated into your site.
> >
> > > Let me know if you have more questions.
> >
> > > Matt Friedman
> > > Spry New Media
> > > http://www.sprynewmedia.com
> >
> >
> >
> > > ----- Original Message -----
> > > From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>
> > > To: "PHP-General List" <[EMAIL PROTECTED]>
> > > Sent: Monday, April 09, 2001 10:57 AM
> > > Subject: [PHP] Threading code
> >
> >
> > > >
> > > >     Does anyone have 'plug-in' message threading code?  I see several
> > > > PHP sites with some sort of message threading going on, and I'd hate to
> > > > reinvent the wheel.  I'd like to have that type of ability built into a
> > > > project I'm working on.
> > > >
> > > >     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]
> > > >
> > > >
> > > >
> >
> >
> > > --
> > > 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]


> 
/*************************************************************************
*****\
>  *                    Joe Stump - PHP/SQL/HTML Developer                  
    *
>  * http://www.care2.com - http://www.miester.org - 
http://gtk.php-coder.net   *
>  * "Better to double your money on mediocrity than lose it all on a 
dream."   *
> 
\*************************************************************************
*****/




I asked a few questions a few weeks ago, and got some very good anwers. too 
bad i didnt save them.

Anyone know how to search the archives of this list (if there are any) ?

Thanks




Quite a few resources are available, I usually go through marc :

  http://marc.theaimsgroup.com/?l=php-general

Also, news.php.net has it all and several other archives exist.  Since the
archives are so valuable, consider following the php tips section :

  http://www.php.net/tips.php

And create a shortcut to archives.  Also have a look here :

  http://php.net/support.php

Note the "Archive" column, click on those links.  Google also archives
everything ;-)  The php.net search feature also has a mailing list
search option.

Regards,
Philip


On Mon, 9 Apr 2001 [EMAIL PROTECTED] wrote:

> I asked a few questions a few weeks ago, and got some very good anwers. too 
> bad i didnt save them.
> 
> Anyone know how to search the archives of this list (if there are any) ?
> 
> Thanks
> 
> -- 
> 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 want to build a STATE - EVENT mapping tool for pages, in PHP, which
allows the selection of various functions in a page object depending on
what part of a mulitipart transaction between a page(application) has
been returned by a user.

I.E., a user information page, credit card verification, user page
layout preferences, primary interests from site obviously related to
gettting a new customer, and all off of one URL with a session keeping
track of where the customer is in getting all this information. The
pages generated all contain hidden variables or cookies from the user
explain where the user was last in the sequences of interactions for
this page/application.

('visual' replies to view for the page designer)

If the user backs up 3 pages, what to do? Have a visually, premapped
response.
If the user comes back after session expires, but session has not been
flushed yet,
        have a visually premapped response.
If the user page gets corrupted and doesn't have the hidden variable, or
somebody
        tries something funny, have a visually premapped response.
If the user submits the credit card purchase twice, have a visually
premapped response.


I envision doing this with a forms input, HTML page. Each of the sets of
'CURRENT CUSTOMER INTERACTION STATE' and 'PAGE EVENT RETURNED' would be
mapped to a set of functions, including the order they were to be
executed in. These functions could process data, clear fields in
databases, requery, generate different page layouts, update different
parts of a frame, etc. . The layout of this page for designing this
page/application would be like Harel's STATE-CHART(tm) or like an
excel(tm) page on a web page.

You can see some preliminary work, (just display, no functionality) at:
http://64.177.230.204/PAGE_STATES.htm.

=====================================================================================
My question:
If this 'page builder' has been given the names of various local or
remote files containing individually edited functions to assemble into
an object, how can this script running on the remote server either
upload all the local files, or access all the remote files (local to the
script) and assemble them into a complete PHP script?

I.E., how do the write permissions of the script/server/etc allow the
script to delete, create, or edit a file on the server?

I plan on doing a non JAVA version first, but this practically cries out
for some JAVA to speed it up.




Just a question that has been besetting me for a while:

which is better for debugging -- vardump( ) or print( ) ?

Does anyone have a preference? Why? Is one better than the other?
Thanks for answering this prickly question!

John Lim







Here's some info about the two functions.

Descriptions (from manual)     :
--------------------------------
  print_r  -- Prints human-readable information about a variable
              (PHP 4)

  var_dump -- Dumps information about a variable
              (PHP 3 >= 3.0.5, PHP 4)

An example                     :
--------------------------------
<pre>
<?php
  $example = array ('str'           => 'is good',    
                    'letters'       => array ('a','b','c'),
                    'integer'       => 31,
                    'float/double'  => 35.3787,
                     24             => 'hello');

  echo 'print_r  :'. "\n\n";
  print_r  ($example);

  echo 'var_dump :'. "\n\n";
  var_dump ($example);
?> 
</pre>

Output (layout altered)         :
---------------------------------

print_r  :

Array
(
    [str]           => is good
    [letters]       => Array
                       (
                           [0] => a
                           [1] => b
                           [2] => c
                       )
    [integer]       => 31
    [float/double]  => 35.3787
    [24]            => hello

)

var_dump :

array(4) 
{
    ["str"]         => string(7) "is good"
    ["letters"]     => array(3) 
                       {
                           [0] => string(1) "a"
                           [1] => string(1) "b"
                           [2] => string(1) "c"
                       }
   ["integer"]      => int(31)
   ["float/double"] => float(35.3787)
   [24]             => string(5) "hello"

}

Manual Entries                 :
--------------------------------
  http://www.php.net/manual/en/function.print-r.php
  http://www.php.net/manual/en/function.var-dump.php


Regards,
Philip 


(test: print var dump faq8490)

On Tue, 10 Apr 2001, John Lim wrote:

> Just a question that has been besetting me for a while:
> 
> which is better for debugging -- vardump( ) or print( ) ?
> 
> Does anyone have a preference? Why? Is one better than the other?
> Thanks for answering this prickly question!
> 
> John Lim
> 
> 
> 
> -- 
> 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]
> 


Philip Olson
http://www.cornado.com/





I generally include the following function:
         function dump( $label, $input ){
                 echo( "<PRE>" );
                 echo( "<H2>$label</H2>\n" );
                 print_r( $input );
                 echo( "</PRE>" );
                 return 1;
         }

or if you like javascript this pops up an alert wherever you insert the 
dump call in your page
         function dump( $label, $input ){
                 ob_start();
                 print_r( $input );
                 $gc     = ob_get_contents();
                 ob_end_clean();

                 $gc = preg_replace( "/'/", "\\'", $gc );
                 $gc = preg_replace( '/\n/', '\\n', $gc );
                 echo( "<script>alert( '$label\\n".$gc."' );</script>" );
                 return 1;
         }

then for simple debugging I call
dump( "My Label", $my_var );

With the javascript you can do some cool things like having divs generated 
per $label.

morgan



At 02:26 PM 4/9/2001, you wrote:
>Just a question that has been besetting me for a while:
>
>which is better for debugging -- vardump( ) or print( ) ?
>
>Does anyone have a preference? Why? Is one better than the other?
>Thanks for answering this prickly question!
>
>John Lim
>
>
>
>--
>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 use print_r on arrays, and var_dump on everything else.

print_r will not tell you if a variable is NULL, but var_dump will. So I
usually use both.


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


""John Lim"" <[EMAIL PROTECTED]> wrote in message
9asuq0$f1n$[EMAIL PROTECTED]">news:9asuq0$f1n$[EMAIL PROTECTED]...
> Just a question that has been besetting me for a while:
>
> which is better for debugging -- vardump( ) or print( ) ?
>
> Does anyone have a preference? Why? Is one better than the other?
> Thanks for answering this prickly question!
>
> John Lim
>
>
>
> --
> 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,

I am stuck at figuring out a couple issues I am facing.

1. Does apache and PHP run as one process?
2. When does PHP initialize? I guess apache calls some specific PHP function 
and I am not sure where in Apache code PHP initialization is done.

Thanks a lot in advance.
Shashi
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com





H-

Thanks to all that wrote in. 

Appreciate the information and have learned much, the links were most
helpful.

Happy coding everyone. 

Sincerely,
-Sterling


Sterling wrote:
> 
> H-
> 
> Just a quick question.
> 
> Is there any difference between using print or echo?
> 
> >From what I have read and seen there isn't any.
> Than why the two different commands?
> 
> Thanks.
> -Sterling
> 
> --
> 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]




Hello,

I am running PHP4, Apache 1.3, on Win2000.  Can I download a dll and put
that in a directory to get GD working?  Or what would I have to do to add it
to my PHP?

ThankZ
Brandon





I would like to populate a dropdown list from a particular field of a bunch
of records.
Here's what I have so far on the modify page but it doesn't list stuff from
the database, all it prints is the number 1 which isn't in any of the
records.

One version of this will be on an add page and another will be on a modify
page which has the current field selected. For the add script, I'd just lose
all the selected stuff that's on there now.

print "<select name=\"owner\">";
$result = mysql_query("SELECT owner,agent FROM homes;");
while($a_row = mysql_fetch_array($result))
{
        printf('<option name="owner"
value="'.$a_row[owner].'">'.$a_row[owner].'</option>', $a_row[owner],
($owner == $a_row[owner]) ? "selected" : "", $a_row[owner]);
}
print "</select>";

What am I doing wrong in this code? Even when I take out the selected stuff,
I still get a value of 1 in the list instead of the actual contents of the
field.

Any help is greatly appreciated!
__________________
Jason Dulberg
Extreme MTB
http://extreme.nas.net





I'm writting a web application that is building a web form dynamically, and
upon submission by the user, it needs to save all of the user inputs to a
database.

The problem is, I don't know what the names of the input elements will be.
In ASP, I would iterate through the QueryString collection (e.g. For Each
item In Request.QueryString), but unless I am missing it in the
documentation, I don't see an equivalent in PHP.

I have considered using a javascript function to iterate through the form
collection on the client side, and store an array of all the form items in a
hidden input, but this seems like too much of a hack.

Does anyone have any better ideas?








Daniel wrote:
> The problem is, I don't know what the names of the input elements
> will be. In ASP, I would iterate through the QueryString collection
> (e.g. For Each item In Request.QueryString), but unless I am missing
> it in the documentation, I don't see an equivalent in PHP.

You should find all you need in the global variables $HTTP_POST_VARS 
and $HTTP_GET_VARS (depending on whether you use GET or POST), as long 
as track_vars is enabled (default since PHP 4.03).

regards
Wagner

-- 
"I haven't committed a crime. What I did was fail to comply with the 
law." 
David Dinkins, New York City Mayor




Way to easy.  I should have investigated further. :/

Thanks!

Daniel


"Alexander Wagner" <[EMAIL PROTECTED]> wrote in message
01040921221307.02806@zahna">news:01040921221307.02806@zahna...
> You should find all you need in the global variables $HTTP_POST_VARS
> and $HTTP_GET_VARS (depending on whether you use GET or POST), as long
> as track_vars is enabled (default since PHP 4.03).
>
> regards
> Wagner







I know this belongs in the developers list..but for some reason, it's not
allowing me to subscribwe, so I'm posting it here.

When I upgrade to 4.0.5rc6, i get the following error:

Warning: MySQL Connection Failed: Can't connect to local MySQL server
through socket '/tmp/mysql.sock' (111) in
/home/sites/site1/web/intranet/main.php on line 309

When I reinstall 4.0.4pl1, all works perfectly.  I'm using RH Linux 6.2,
Mysql 3.23.36 from RPMs on mysql.com.
Here is my configure line I used for both 4.0.4pl1 and 4.0.5rc6
./configure --with-mysql --with-imap=/usr/lib --enable-trans-sid --with-apxs
=/usr/sbin/apxs

Here is the code it chokes on when using RC6, but not 4.0.4pl1
303 - function pull_emp_db($username,$password)
304        {
305        $user = "***";   //username needed to access db
306        $pass = "****";   //password needed to access db
307        $db_server = "localhost";   //the mysql db server
308        $db = "lrefined";    //Name of the database where information is
stored
309        $db_connect = mysql_connect("$db_server", "$user", "$pass");
310              if (! $db_connect)
etc.....






>Warning: MySQL Connection Failed: Can't connect to local MySQL server
>through socket '/tmp/mysql.sock' (111) in
>/home/sites/site1/web/intranet/main.php on line 309

This sounds A LOT like the problem when you need to change the location of 
the mysql.sock in your php.ini.. you did check that.. right??

I think Redcrap puts it in another place..

I noticed you compiled php --with-mysql without specifying a location.. You 
SHOULD compile with the location like
--with-mysql=/usr/local/mysql or something simular.

You see, the bug you think you have found could as well be a configuration 
mistake..

Bye,


B.





True...but I used the same php.ini as with php4.0.4pl1, so the location of
all files is identical.  If I don't specify a location in 4.0.4pl1, why
should i need one in 4.0.5rc6?  In theory if it's been working with no
change since 4.0.3, I don't see why once again compiling with identical
options would make a difference.  But, yes, changing the sock location does
fix the problem, I just wonder why it is only rearing it's head in the new
version.  Thanks!

Jon


----- Original Message -----
From: "B. van Ouwerkerk" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 09, 2001 3:59 PM
Subject: Re: [PHP] MySQL broken in 4.0.5RC6


>
> >Warning: MySQL Connection Failed: Can't connect to local MySQL server
> >through socket '/tmp/mysql.sock' (111) in
> >/home/sites/site1/web/intranet/main.php on line 309
>
> This sounds A LOT like the problem when you need to change the location of
> the mysql.sock in your php.ini.. you did check that.. right??
>
> I think Redcrap puts it in another place..
>
> I noticed you compiled php --with-mysql without specifying a location..
You
> SHOULD compile with the location like
> --with-mysql=/usr/local/mysql or something simular.
>
> You see, the bug you think you have found could as well be a configuration
> mistake..
>
> Bye,
>
>
> B.
>
>
> --
> 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]
>






>True...but I used the same php.ini as with php4.0.4pl1, so the location of
>all files is identical.  If I don't specify a location in 4.0.4pl1, why
>should i need one in 4.0.5rc6?

Dunno, I don't have 4.0.5rc6 here, only 4.0.4pl1 so no change to test it.. 
or to take a look at the code.. It's past midnight so I think I'm going to 
catch some sleep before I even think about downloading the latest release.

>But, yes, changing the sock location does
>fix the problem, I just wonder why it is only rearing it's head in the new
>version.  Thanks!
>
>Jon

<wild guess>
Perhaps the default location in the code has changed in php source.
</wild guess>

You could try to recompile 405 with a correct ./configure so that means 
--with-mysql=/usr/local/mysql just to see if PHP finds your MYSQL. You need 
to change the line in php.ini back to empty.

Bye,



B.





Hello,

I've recently started PHP development after a few years of working with ASP.
So far I really like PHP, but am having trouble using some of the techniques
I had in ASP.  For example, I really like using ASP's Application object to
cache data in, but I can't seem to have an equivalent in PHP.

(Due note that I'm also new to the Unix/Linux environment, so if I have any
concepts glaringly wrong, please correct me).

I've read over the System V shared memory functions, but I can't tell if
these would accomplish what I'm looking to do?

I guess what I really need to learn is how threading and synchronization
works in Apache/PHP.  I had just mastered COM/ASP's
single-thread/multi-threaded design and could write shared, multi-threaded
ATL components that all the ASP pages could read from marshalling and all
that.

Are there any good resources/docs on the type of architecture PHP uses and
how to accomplish the above in the Apache/PHP environment?  I've looked
around at some books, but all I can find is basic
here's-how-to-do-a-web-page type stuff.

Ideally what I'd like would be an object that would stay loaded in memory
(in-process) so that PHP scripts could call functions and variables against
it with minimal overhead (specifically an object that could cache query
results instead of each page requerying the database).  Is such a thing
possible?  Or do I have to move over to Servlets/JSP to find this
functionality?

Thanks!

- Stephen






Hi, I am trying to include a header to my document, I my problem is I
keep getting a parse error on the line after the header ends. I cannot
see what is causing this, can someone see what I have done wrong, the
code is below.

Cheers for your help, Donald

<html>
<head>
<title>Accessible Computers <?="$page_title"?></title>
<meta name=keywords content="stuff">
<meta name=description content='<?
   if ($description) {
      echo "$description";
   } else {
     echo "Accessible Computers";
   ?>'>
<meta name=Robots content="index, follow">
<link rel=stylesheet href="/files/ac_style.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#660099"
alink="#FF00FF">
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#99CCFF" align=left valign=top rowspan=2><?
    if ($no_menu_link==Home) {
    echo "<img src='/images/logo.gif' width=250 height=60 align=top
alt='accessible computers' border=0>";
    } else {
       echo "<a href='/index.php'><img src='/images/logo.gif'
width=250 height=60 align=top alt='accessible computers' border=0
title='Accessible Computers, Home'></a>";
    } ?></td>
 <td bgcolor="#99CCFF" width=20 rowspan=2>&nbsp;</td>
 <td bgcolor="#99CCFF" align=center rowspan=2>
 <? if ($no_menu_link==Home) {
    echo "<b>Home</b> | ";
    } else {
    echo "<a class=menu href='/index.php'>Home</a> | ";
    }

    if ($no_menu_link==Catalogue) {
    echo "<b>Catalogue</b> | ";
    } else {
       echo "<a class=menu
href='/pages/catalogue/index.php'>Catalogue</a> | ";
    }

    if ($no_menu_link==Information) {
    echo "<b>Information</b> | ";
    } else {
    echo "<a class=menu href='/pages/info/index.php'>Information</a> |
";
    }

    if ($no_menu_link==Search) {
    echo "<b>Search</b> | ";
    } else {
    echo "<a class=menu href='/pages/search.php'>Search</a> | ";
    }

    if ($no_menu_link==Contact) {
    echo "<b>Contact</b> | ";
    } else {
    echo "<a class=menu href='/pages/contact.php'>Contact</a>";
    }
    ?></td>
 <td bgcolor="#99CCFF" align=right valign=top><img
src="/images/borders/btr.gif" width=20 height=20 alt=""></td>
  </tr>
  <tr>
 <td bgcolor="#99CCFF" align=right valign=bottom><img
src="/images/borders/bbr.gif" width=20 height=20 alt=""></td>
  </tr>
</table>


ps. the no_menu_link variable is defined on the page calling the
include so that the page does not have a link to itself.






> <title>Accessible Computers <?="$page_title"?></title>
> <DEFANGED_meta name=keywords content="stuff">
> <DEFANGED_meta name=description content='<?
>    if ($description) {
>       echo "$description";
>    } else {
>      echo "Accessible Computers";
>    ?>'>

Looks like you're missing a } here.

regards
Wagner

-- 
"I haven't committed a crime. What I did was fail to comply with the 
law." 
David Dinkins, New York City Mayor




At 03:59 PM 4/9/2001, DRN wrote:
you need to make sure that ALL your curly brackets are closed and that all 
lines that require semi-colons have them....

~kurth

>Hi, I am trying to include a header to my document, I my problem is I
>keep getting a parse error on the line after the header ends. I cannot
>see what is causing this, can someone see what I have done wrong, the
>code is below.
>
>Cheers for your help, Donald
>
>< '>
><? if ($no_menu_link==Home) { echo ""; } else { echo ""; } ?>   <? if 
>($no_menu_link==Home) { echo "Home | "; } else { echo "Home | "; } if 
>($no_menu_link==Catalogue) { echo "Catalogue | "; } else { echo "Catalogue 
>| "; } if ($no_menu_link==Information) { echo "Information | "; } else { 
>echo "Information | "; } if ($no_menu_link==Search) { echo "Search | "; } 
>else { echo "Search | "; } if ($no_menu_link==Contact) { echo "Contact | 
>"; } else { echo "Contact"; } ?>
>ps. the no_menu_link variable is defined on the page calling the include 
>so that the page does not have a link to itself. -- 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]






Kurth Bemis <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| At 03:59 PM 4/9/2001, DRN wrote:
| you need to make sure that ALL your curly brackets are closed and
that all
| lines that require semi-colons have them....
|
| ~kurth

D'oh, I don't know how I didn't see that, but it had been annoying me
for ages.

Cheers for your help once again, Donald






I am passing a string value via a url to be used for printing on a page and
for sending info via email.

 I first encode the string before passing it.

The issue I have is for strings that contain single or double quotes.  When
I print the value that has been passed in the url the \ is printed.  For
example:  A Golfer\'s Paradise

I have to tried to decode the string before printing it -- but the \ still
prints.

Here is the code:

$url_title = rawurlencode( $headline );
  print "<tr><td><font face='arial' size='1'><font face='arial' size='1'><a
href='javascript:openQuote(\"http://www.aboutgolf.com/guide/miniquote_form.i
nc.php3?site=$site&ad=$ad&region=$region&header=$url_title\",
\"helpWin\");'><b>Contact us for more information</b></a></font>";

And the in the miniquote_form.inc.php3 file:

<?php
  $headertitle = rawURLdecode( $header );
  print "$headertitle"; ?>






Claudia Smith wrote:
> I am passing a string value via a url to be used for printing on a
> page and for sending info via email.
>
>  I first encode the string before passing it.

This is correct, but you should be using urlencode() instead of 
rawurlencode(). To be frank, I don't know what the difference is, 
exactly (never used the raw ones), but I think urlencode() is more 
appropriate here.

> I have to tried to decode the string before printing it -- but the \
> still prints.

You don't need to decode. This is done automatically. The "problem" is 
that the so called "magic quotes" are active. These do an addslashes() 
on all GET, POST... data. You can undo this with stripslashes().

regards
Wagner

-- 
"I haven't committed a crime. What I did was fail to comply with the 
law." 
David Dinkins, New York City Mayor




How can I get PHP (version 3) to list all the CGI parameters it was passed?





Hi all,


I installed the following php rpm's  from the SuSe distribution v7.0:
mod_php-3.0.16-52
mod_php4-4.0.0-31
I already had installed apache (apache-1.3.12.97)

After i installed the php rpm my apache webserver won't startup anymore.
in the logfile from apache i found the following messages:

PHP Warning:  Function registration failed - duplicate name - define in
Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - defined in
Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - each in Unknown
on line 0
PHP Warning:  Function registration failed - duplicate name - strlen in
Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - strcmp in
Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - strcasecmp in
Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - error_reporting
in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - leak in Unknown
on line 0
PHP Warning:  Function registration failed - duplicate name - function_exists
in Unknown on line 0
PHP Warning:  Basic Functions:  Unable to register functions, unable to load
in Unknown on line 0

Does anyone has a clue what is causing this problem and more interesting: how
to solve it :-)

Thanks in advance for your reply!

Gretings,
Johan Barelds

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

-- 
Met vriendelijke groet,

Johan Barelds




Hi All,
   When using the dtd below on a page that has a form with php. I get a 
parser error for <?xml version="1.0"?> am I going to have to go back to 
a HTML 4.01 dtd or can I do something like escape the ? ?

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

TIA
Gary






Hi Gary,

@ 4:38:17 PM on 4/9/2001, Gary wrote:

> When using the dtd below on a page that has a form with php. I get a
> parser error for <?xml version="1.0"?> am I going to have to go back
> to a HTML 4.01 dtd or can I do something like escape the ? ?

> <?xml version="1.0"?>
...

http://www.php.net/manual/en/configuration.php#ini.short-open-tag

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please do not carbon copy me on list replies.






Brian Clark wrote:

> Hi Gary,
> 
> @ 4:38:17 PM on 4/9/2001, Gary wrote:
> 
> 
>> When using the dtd below on a page that has a form with php. I get a
>> parser error for <?xml version="1.0"?> am I going to have to go back
>> to a HTML 4.01 dtd or can I do something like escape the ? ?
> 
> 
>> <?xml version="1.0"?>
> 
> ....
> 
> http://www.php.net/manual/en/configuration.php#ini.short-open-tag
> 
> -Brian
> --
>  PGP is spoken here: 0xE4D0C7C8
>  Please do not carbon copy me on list replies.

Thanks Brian,
  I was afraid it would turn out like that. I hope our host will disable 
the short tags for us.

Thank
Gary






Hi Gary,

@ 8:13:49 PM on 4/9/2001, Gary wrote:

...
> I was afraid it would turn out like that. I hope our host will
> disable the short tags for us.

I'm not sure, but you may be able to specify that in an .htaccess
file. Check the docs on that (maybe search for htaccess).

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please do not carbon copy me on list replies.






> @ 8:13:49 PM on 4/9/2001, Gary wrote:
> 
> ...
> > I was afraid it would turn out like that. I hope our host will
> > disable the short tags for us.

 
> I'm not sure, but you may be able to specify that in an .htaccess
> file. Check the docs on that (maybe search for htaccess).

Yes it can, like :

  php_flag short_open_tag off


Regards,
Philip






I dunno if this is of any help, but when I use XML and php on the same page, 
what I do to bypass that is just have php echo the XML.

echo "<?xml version="1.0"?>";

> Hi All,
>    When using the dtd below on a page that has a form with php. I get a
> parser error for <?xml version="1.0"?> am I going to have to go back to
> a HTML 4.01 dtd or can I do something like escape the ? ?
>
> <?xml version="1.0"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
>
> TIA
> Gary




Hello,

I am trying to make a script that creates .htpasswd files.  Does anyone know
what encryption is used?

Thanks
Brandon





At 04:39 PM 4/9/2001, Brandon Orther wrote:

i believe that the scheme is md5

~kurth

>Hello,
>
>I am trying to make a script that creates .htpasswd files.  Does anyone know
>what encryption is used?
>
>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]





It can really depend on your system.

On mine, for instance, it uses regular crypt() with a 2 character salt
So, you can generate a random 2 character string to pass as the salt
argument in php, and create it that way.
IF that is the method used by your system

Wanna test it?

Peek inside etc/passwd and copy out the encrypted string that represents
your password.

Take the first two characters of that string and use that as the salt on
your test page. (say for instance the salt is xT)

In your test page, use the following code

<? Echo crypt("your unencrypted password"."xT"); ?>

That's all you need.
Call it from your browser.
Is the encrypted value the same as in etc/passwd?
If so, then crypt is what you use for .htpasswd file

You can also check against an existing .htpqsswd entry, if you exist in an
.htpasswd file on your system.


On 4/9/01 1:39 PM, "Kurth Bemis" <[EMAIL PROTECTED]> wrote:

> At 04:39 PM 4/9/2001, Brandon Orther wrote:
> 
> i believe that the scheme is md5
> 
> ~kurth
> 
>> Hello,
>> 
>> I am trying to make a script that creates .htpasswd files.  Does anyone know
>> what encryption is used?
>> 
>> 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]
> 





Hello.

I don't understand it at all.  I'm trying to cache some data in a shared
memory segment with PHP 4.0.4pl1's shm functions.

I do this like this:

<?php
$key["shm"] = 0x4711;
$key["var"] = 0x0815;

$file = "services";
$size = filesize( $file );
$fd = fopen( $file, "r" );
$data = fread( $fd, $size );
fclose( $fd );

$magic_size_shm = 42; /********* ?????????????? WHY ????????? *********/

$size_data = strlen( $data );
$size_shm  = strlen( serialize( $data ) ) + $magic_size_shm;

$shm = shm_attach( $key["shm"], $size_shm );

$data_shm = @shm_get_var( $shm, $key["var"] );

if( ! $data_shm ){
  shm_put_var( $shm, $key["var"], $data );
  $data_shm = shm_get_var( $shm, $key["var"] );
}

shm_detach( $shm );
?>

What I don't understand at all is, why I need to add this "$magic_size_shm"
to the "strlen( serialize( $data ) )" value.  The value I need to add seems
to be always between 41 and 49, but it varies depending on the data I want
to store.

According to the manual and the comments there, I'd have thought that it is
enough to just alloc "strlen( serialize( $data ) )" - why is that not so?

Now, before someone suggest to try shmop instead - this is not working at
all.  I've tried the example from the shmop manual page on php.net, and this
totally breaks.  These lines don't work at all on my system:

$shm_size = shmop_size($shm_id);
echo "SHM Block Size: ".$shm_size. " has been created.\n";

For my system, it returns totally varying values which are all WAY below 0,
like -1072562176, or -722337792 or -914554880 ....  Because of that, PHP
cannot access the shmop segment.

This is on a current Mandrake Cooker (beta) system with glibc 2.2.2, kernel
2.4.2 (also tried 2.4.3). PHP was compiled with gcc 2.96.

Someone please help me!

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 day 8 hours 43 minutes




Thanks for your answer.

I tried what you suggested and got the result I expected. They all appear
fine. It is only when i loop the array after exploding it, and then
attempting to get it to load an image that it doesn't show the last value.

The code I have got here works, but the else statement I need to use for
something else.
For this example the feild in the DB is - FULL|DOHC|EFI to make life easy.

$specs = $myrow[features];

   echo " echoing specs - $specs"; //This echos FULL|DOHC|EFI

    $features = explode('|',$specs); //What the feild is delimited by '|'
    reset ($features);

   print_r ($features); //This prints Array ( [0] => FULL [1] => DOHC [2] =>
EFI )

      while (list(, $feature) = each ($features)) {

    if (file_exists("features/$feature.gif")){
    echo "<img src=\"features/$feature.gif\"><br>";
     }     //This displays FILL.gif & DOHC.gif but not EFI.gif

   } //End While

If the example was FILL|DOHC|EFI|SP
All images would display except SP.gif
this is weird.

"Philip Olson" <[EMAIL PROTECTED]> wrote in message
Pine.BSF.4.10.10104090640130.46638-100000@localhost">news:Pine.BSF.4.10.10104090640130.46638-100000@localhost...
: What does this do?
:
: > $specs = $myrow['features'];
:
: print $specs;
:
: >     $features = explode('|',$specs); //What the feild is delimited by
'|'
:
: print_r($features);
:
: Does it include the missing last value within the $features array?  Does
: $specs look okay?
:
: Regards,
: Philip
:
:
: --
: 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]
:






> The code I have got here works
Sorry that last message was wrong. The code doesn't work, it misses the last
value in the loop.


""Yo Bro"" <[EMAIL PROTECTED]> wrote in message
9at7b4$ruq$[EMAIL PROTECTED]">news:9at7b4$ruq$[EMAIL PROTECTED]...
: Thanks for your answer.
:
: I tried what you suggested and got the result I expected. They all appear
: fine. It is only when i loop the array after exploding it, and then
: attempting to get it to load an image that it doesn't show the last value.
:
: The code I have got here works, but the else statement I need to use for
: something else.
: For this example the feild in the DB is - FULL|DOHC|EFI to make life easy.
:
: $specs = $myrow[features];
:
:    echo " echoing specs - $specs"; //This echos FULL|DOHC|EFI
:
:     $features = explode('|',$specs); //What the feild is delimited by '|'
:     reset ($features);
:
:    print_r ($features); //This prints Array ( [0] => FULL [1] => DOHC [2]
=>
: EFI )
:
:       while (list(, $feature) = each ($features)) {
:
:     if (file_exists("features/$feature.gif")){
:     echo "<img src=\"features/$feature.gif\"><br>";
:      }     //This displays FILL.gif & DOHC.gif but not EFI.gif
:
:    } //End While
:
: If the example was FILL|DOHC|EFI|SP
: All images would display except SP.gif
: this is weird.
:
: "Philip Olson" <[EMAIL PROTECTED]> wrote in message
: Pine.BSF.4.10.10104090640130.46638-100000@localhost">news:Pine.BSF.4.10.10104090640130.46638-100000@localhost...
: : What does this do?
: :
: : > $specs = $myrow['features'];
: :
: : print $specs;
: :
: : >     $features = explode('|',$specs); //What the feild is delimited by
: '|'
: :
: : print_r($features);
: :
: : Does it include the missing last value within the $features array?  Does
: : $specs look okay?
: :
: : Regards,
: : Philip
: :
: :
: : --
: : 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]
:






Hello,
I have one that I am stuck on.

I have a link, with a variable attached to it.

The link is to a picture that will open when the new html page opens.
I need to pass this variable to an HTML page,,,
The only way I can see to do this is through Javascript.

Is there a way using PHP?

Also, can I pass more than one variable?       use GET?

Thanks in advance
Curtis






So sprach Curtis am Mon, Apr 09, 2001 at 05:03:14PM -0400:
> I have a link, with a variable attached to it.

So, just a random string.

> I need to pass this variable to an HTML page,,,

<?php
        echo 'page.php?link=' . rawurlencode( $link );
?>

> Also, can I pass more than one variable?       use GET?

Possibly with get, if you have a form, yes.  Else:

<?php
        echo 'page.php?v1=' . $value1 . '&v2=' . $value2;
?>

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 day 9 hours 22 minutes




use a get encoded string. as many variables as you can fit inside the limits
of a get string.

script.php?variable1=something&variable2=somethingelse&...

On 4/9/01 2:03 PM, "Curtis" <[EMAIL PROTECTED]> wrote:

> Hello,
> I have one that I am stuck on.
> 
> I have a link, with a variable attached to it.
> 
> The link is to a picture that will open when the new html page opens.
> I need to pass this variable to an HTML page,,,
> The only way I can see to do this is through Javascript.
> 
> Is there a way using PHP?
> 
> Also, can I pass more than one variable?       use GET?
> 
> Thanks in advance
> Curtis
> 
> 





When i try to connect to an server with my php-skript I get the error
message: "Warning: Unable to find ftpbuf 0 in
/home/ftpcenter/html/Anmelden/schritt2.php on line 194"
But this is not ever. Only on special servers. With some it goes with
problems.

Can somebody tell me what this errormessage mean and why i get this message
not on all servers ???








Lindsay Adams <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| This is exactly what I sent you.
| You have to realize that you can't print down one column, and then
start a
| new one.
| You have to print across, left to right before you go down.
| You have to modify the print statement to put it into a table, but
that is
| easy:
|

I have been playing about with this problem and I have come up with
the following code. I know it is not right, because it isn't working
:) but I think it is nearly what I want to do. I only want to have 3
cells in the table, with a third of the data in each.

Cheers for your help, Donald

<? $db = mysql_connect("localhost", "user","pass");
 mysql_select_db("database",$db);

 $query = "SELECT * FROM TYPES";
 $result = mysql_query($query);
 $num_rows = mysql_num_rows($result);

 if ($result){
     $i=0;
  echo "<table border=1>\n<tr>\n<td width='30%'>";
  $r = mysql_fetch_array($result);
  $type_name = $r["type_name"];

  while ( $i < ($num_rows/3) ){
     echo "$type_name[$i] <br>\n"; $i++;
  }
  echo "</td><td width='30%'>\n";
  while ($i <= (2*$num_rows/3) ){
     echo "$type_name[$i] <br>\n"; $i++;
  }
  echo "</td><td width='30%'>\n";
  while ($i <= $num_rows ){
     echo "$type_name[$i] <br>\n"; $i++;
  }
  echo "</tr></table>\n";

 } else {
 echo " sorry no data found ";
 }
?>


--
Cheers,  Donald  :)
__________________________________________
As well as learning more,
I learn that there is even more I don't know

http://www.donaldrnoble.f2s.com
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ






okay. your solution is not going to scale well, is it. if you have more than
nine items, you have to rewrite your code.

here is what I did:
I created this table in mysql from the command line as follows:
mysql> create table  tabletest (
    -> id int unsigned primary key not null auto_increment);
Query OK, 0 rows affected (0.47 sec)

mysql> desc tabletest;
+-------+------------------+------+-----+---------+----------------+
| Field | Type             | Null | Key | Default | Extra          |
+-------+------------------+------+-----+---------+----------------+
| id    | int(10) unsigned |      | PRI | 0       | auto_increment |
+-------+------------------+------+-----+---------+----------------+
1 row in set (0.73 sec)

mysql> insert into tabletest values  (NULL),(NULL), (NULL), (NULL), (NULL),
(NULL), (NULL),(NULL);
Query OK, 8 rows affected (0.48 sec)
Records: 8  Duplicates: 0  Warnings: 0

mysql> select * from tabletest;
+----+
| id |
+----+
|  1 |
|  2 |
|  3 |
|  4 |
|  5 |
|  6 |
|  7 |
|  8 |
+----+
8 rows in set (0.29 sec)

Then, I copy and pasted the script I wrote earlier to the list, made some
changes to match the database and got this:

<?


$link=mysql_connect();
mysql_select_db('tester',$link);
$query = 'SELECT* FROM tabletest';
$result = mysql_query($query,$link);

print <<<EOF
<html>
<head>
</head>
<body>
<table width="400" border=1>
EOF;

while(list($id)=mysql_fetch_row($result)) {
$items[]=$id;
}
reset($items);



For($i = 0; $i< (count($items)/3); $i +=1){
    
printf("<tr><td>%s</td><td>%s</td><td>%s</td></tr>",$items[$i],$items[$i+3],
$items[$i+6]);
}

?>
</table></body></html>

I put that into tabletest.php
view results at www.dingos.net/test/tabletest.php

this script will scale to ANY size listing. Here, the 3 stands for number of
columns. it can easily be cleaned up so that the number of columns is
dynamic, and I am sure there is a cleaner way of doing multiple columns,
without putting all the database stuff into an array, BUT, this shows you
how the code works, and what it looks like


On 4/9/01 3:06 PM, "DRN" <[EMAIL PROTECTED]> wrote:

> 
> Lindsay Adams <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> | This is exactly what I sent you.
> | You have to realize that you can't print down one column, and then
> start a
> | new one.
> | You have to print across, left to right before you go down.
> | You have to modify the print statement to put it into a table, but
> that is
> | easy:
> |
> 
> I have been playing about with this problem and I have come up with
> the following code. I know it is not right, because it isn't working
> :) but I think it is nearly what I want to do. I only want to have 3
> cells in the table, with a third of the data in each.
> 
> Cheers for your help, Donald
> 
> <? $db = mysql_connect("localhost", "user","pass");
> mysql_select_db("database",$db);
> 
> $query = "SELECT * FROM TYPES";
> $result = mysql_query($query);
> $num_rows = mysql_num_rows($result);
> 
> if ($result){
>    $i=0;
> echo "<table border=1>\n<tr>\n<td width='30%'>";
> $r = mysql_fetch_array($result);
> $type_name = $r["type_name"];
> 
> while ( $i < ($num_rows/3) ){
>    echo "$type_name[$i] <br>\n"; $i++;
> }
> echo "</td><td width='30%'>\n";
> while ($i <= (2*$num_rows/3) ){
>    echo "$type_name[$i] <br>\n"; $i++;
> }
> echo "</td><td width='30%'>\n";
> while ($i <= $num_rows ){
>    echo "$type_name[$i] <br>\n"; $i++;
> }
> echo "</tr></table>\n";
> 
> } else {
> echo " sorry no data found ";
> }
> ?>
> 
> 
> --
> Cheers,  Donald  :)
> __________________________________________
> As well as learning more,
> I learn that there is even more I don't know
> 
> http://www.donaldrnoble.f2s.com
> ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
> 
> 






Lindsay Adams <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
okay. your solution is not going to scale well, is it. if you have
more than
nine items, you have to rewrite your code.

I (sort of) understand your solution, but I don't see how my solution
is not going to scale well? I am trying to count the number of items,
then list until I get to 1/3 then start a new cell and list until I
get to 2/3, then new cell, then finish table. The reason for doing it
this way is that this will produce a valid table. It will also allow
me to add in another 2 cells to give vertical lines separating the
columns, but I missed this out originally for clarity.


--
Cheers,  Donald  :)
__________________________________________
As well as learning more,
I learn that there is even more I don't know

http://www.donaldrnoble.f2s.com
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ






Hi there,

I need a regular expression that accepts *anything* without restrictions,
only that the size of the string should be between (for instance) 0 and 9
characters. I know the {0,9} trick, but how do I accept *anything* in a form
field?

TIA,

Jorge








I think [.]{0,9} will get it.

Kirk

> -----Original Message-----
> From: Jorge Alvarez [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 09, 2001 3:38 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Controlling just size with regular expressions
> 
> 
> Hi there,
> 
> I need a regular expression that accepts *anything* without 
> restrictions,
> only that the size of the string should be between (for 
> instance) 0 and 9
> characters. I know the {0,9} trick, but how do I accept 
> *anything* in a form
> field?
> 
> TIA,
> 
> Jorge
> 
> 
> 
> 
> 
> -- 
> 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 am trying to get to grips with managing data in mysql, am am currentky
working on deleting records

I have worked through a turorial - no problems, but now I am trying to apply
it to my own database, I am getting the error
Warning: Supplied argument is not a valid MySQL result resource in .... on
line 14

I cannot see what is causing it - if anyone can it would be much
appreciated.

thanks

Nathan

For clarity/brevity I have cut the page back to what i beleive to be the
relivant part. Code for page is:-

<html>

<body>

<?php

$db = mysql_connect("localhost", "username", "pasword");

mysql_select_db("catalogue",$db);


    $result = mysql_query("SELECT * FROM SECTIONS",$db);

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

      printf("<a href=\"%s?section_id=%s\">%s %s</a> \n", $PHP_SELF,
$myrow["section_id"], $myrow["section_name"], $myrow["section"]);

   printf("<a href=\"%s?id=%s&delete=yes\">(DELETE)</a><br>", $PHP_SELF,
$myrow["section_id"]);

    }


  ?>



</body>

</html>


SQL for the table is

CREATE TABLE SECTIONS (
   section_name varchar(25) NOT NULL,
   section_id tinyint(3) unsigned DEFAULT '0' NOT NULL auto_increment,
   section char(1) NOT NULL,
   PRIMARY KEY (section_id),
   UNIQUE section (section_name, section_id, section)







what does the roman numeral L mean?

can someone point me to a page that has all of the roman numerals and their 
English equivlents?

i forgot?

~kurth





Try this site

http://www.cod.edu/people/faculty/lawrence/romaindx.htm



> -----Original Message-----
> From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 10, 2001 10:14 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] L?
> 
> 
> what does the roman numeral L mean?
> 
> can someone point me to a page that has all of the roman 
> numerals and their 
> English equivlents?
> 
> i forgot?
> 
> ~kurth
> 
> 
> -- 
> 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 may want to look at class : Numbers_Roman  which can be viewed here :

  http://cvs.php.net/viewcvs.cgi/php4/pear/Numbers/Roman.php

regards,
philip


On Tue, 10 Apr 2001, Opec Kemp ( Ozemail ) wrote:

> Try this site
> 
> http://www.cod.edu/people/faculty/lawrence/romaindx.htm
> 
> 
> 
> > -----Original Message-----
> > From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, April 10, 2001 10:14 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] L?
> > 
> > 
> > what does the roman numeral L mean?
> > 
> > can someone point me to a page that has all of the roman 
> > numerals and their 
> > English equivlents?
> > 
> > i forgot?
> > 
> > ~kurth
> > 
> > 
> > -- 
> > 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]
> 





Currently I am using the sort() command to sort an array. Unfortunately it uses the 
ascii number so all words starting with uppercase are before lowercase. Is there a 
case insensitive alphabetical sort that I don't know of? Thanks in advance ^_^




On Fri,  6 Apr 2001 18:33, Chris Anderson wrote:
> Currently I am using the sort() command to sort an array. Unfortunately
> it uses the ascii number so all words starting with uppercase are
> before lowercase. Is there a case insensitive alphabetical sort that I
> don't know of? Thanks in advance ^_^

You might have to use usort and build a little case-insensitive sort 
routine yourself. Remember that ASCII A + 32 = ASCII a and so forth.
-- 
David Robley                        | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet                            | http://auseinet.flinders.edu.au/
            Flinders University, ADELAIDE, SOUTH AUSTRALIA




I have a huge (at least I think, for a script anyway) PHP script... it is 
over 1.000 lines of code.
And it updates (do an entire DELETE-ALL / LOAD-ALL) an SQL Server database 
(over 35MB). It runs for over an hour (sometimes 2hs)... and I divided it 
into steps... so each step is a function in the script that when is over 
calls a javascript function that reloads the script to the next step.

I was wondering if this is enough to get a good 'memory-cleaning'. Or it 
would be better to have lots of files (in total, there are 27 separate 
steps). I began noticing some processing slowness after the first 35 
mins... it get's 'tired'. The script starts running and with 
ob_implicit_flush() on, the output is flushed almost at real time... but 
after 10 or 12 steps it starts to get slow and do NO FLUSHING at all... 
only showing the entire output at once after the whole step has ended. 
Should I split it into files? Is because it's running on (eek!) IIS? Maybe 
the size of the file is getting in the way?

Can someone help me out?

Ah... one other thing. Has anybody experienced very weird behaviours of PHP 
with IIS? Sometimes I press 'stop' at the browser but PHP is still running. 
I can see it eating up memory in the TaskManager. And it won't stop until I 
kill it. And the most weird part is, as soon as I call a script (any 
script) PHP returns to the TaskManager with the same amount of memory it 
had when it was running tha massive script mentioned above. Does IIS really 
suck, or is there something very wrong with my config?
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer





I am creating a PHP/Apache/PostgreSQL project for a client and I want to
keep them from "prying" at my source code.  How can I encode or compile the
PHP source code into a binary format?

Kevin Pate
RHCE / MCSE / CCNA
Pate Consulting
[EMAIL PROTECTED]
www.pateconsulting.com
main 832.237.5920
fax 832.237.5924
mobile 713.823.8845
pager 713.608.3936





Take a look at

www.zend.com for Zend Encoder
or
http://apc.communityconnect.com/ and get 1.0.9 source. Look for file name like
README.Compiler.

Regards,
--
Yasuo Ohgaki


""Kevin Pate"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am creating a PHP/Apache/PostgreSQL project for a client and I want to
> keep them from "prying" at my source code.  How can I encode or compile the
> PHP source code into a binary format?
>
> Kevin Pate
> RHCE / MCSE / CCNA
> Pate Consulting
> [EMAIL PROTECTED]
> www.pateconsulting.com
> main 832.237.5920
> fax 832.237.5924
> mobile 713.823.8845
> pager 713.608.3936
>
>
> --
> 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]
>



Reply via email to