[PHP] Parsing out numbers from a string

2001-12-30 Thread John Weez


Hi all

I have a small program which captures the output of a webpage and puts the
data in to a string variable.
I then use teh strip tags function of php to clean it up a bit.

then i want to use regular expressions to extract all the numbers from the
page ..they are like this usually numbers.numbers (IE: 40.40 ).

For some reason my expressions are not matching anything in the string
unless i type exactly what i am looking for... could the fact that there
are line reurns in the string be causing a problem? or do i need to
somehow tell php to goto the next line?

I had an older version of the program which saved teh data to a file and
then PhP scanned the file line by line..this worked...but i'm trying to
make a more elegant solution that won;t kill my hard drive faster ;)

Any tips appreciated...

John
[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] index.php

2001-12-30 Thread Caleb Carvalho

Hi all,

all the sudden my apache 1.3.22 is not showing my index.php page
php-4.0.6, i have added the addtype .php inside httpd.conf

not only that, i have also noticed that the  is not
working also, this is  not displaying the test page,

I am using netscape as a browser, do you guys know about any issue related 
to this?

many thanks and happy x-mas/happy new year



_
Join the world’s largest e-mail service with MSN Hotmail. 
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]




RE: [PHP] index.php

2001-12-30 Thread scott

well... a good first step is to think about what has
changed with your configuration.  did you turn on
any output handlers/buffering?  Compile a new
version?  Modify apache in any way?



> -Original Message-
> From: Caleb Carvalho [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, December 30, 2001 4:40 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] index.php
>
>
> Hi all,
>
> all the sudden my apache 1.3.22 is not showing my index.php page
> php-4.0.6, i have added the addtype .php inside httpd.conf
>
> not only that, i have also noticed that the  is not
> working also, this is  not displaying the test page,
>
> I am using netscape as a browser, do you guys know about any issue related
> to this?
>
> many thanks and happy x-mas/happy new year
>
>
>
> _
> Join the world’s largest e-mail service with MSN Hotmail.
> 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]
>
>



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




Re: [PHP] index.php

2001-12-30 Thread Rambo Amadeus

you can make .htacces file and put

DirectoryIndex  /index.php

That will work

- Original Message -
From: Caleb Carvalho <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 30. prosinac 2001 10:40
Subject: [PHP] index.php


> Hi all,
>
> all the sudden my apache 1.3.22 is not showing my index.php page
> php-4.0.6, i have added the addtype .php inside httpd.conf
>
> not only that, i have also noticed that the  is not
> working also, this is  not displaying the test page,
>
> I am using netscape as a browser, do you guys know about any issue related
> to this?
>
> many thanks and happy x-mas/happy new year
>
>
>
> _
> Join the world’s largest e-mail service with MSN Hotmail.
> 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]
>


-- 
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] Re: index.php

2001-12-30 Thread Daniel Urstöger

I am not sure if this is the problem. but why don´t just do something like
this:

DirectoryIndex index.html index.php index.cgi

Search the httpd.conf, there is surely already for the index.html ! ;)
Ehm, yeah, and this is one is ordered in priority from the left to right ..

Hope it helps !

Cya !

"Caleb Carvalho" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> all the sudden my apache 1.3.22 is not showing my index.php page
> php-4.0.6, i have added the addtype .php inside httpd.conf
>
> not only that, i have also noticed that the  is not
> working also, this is  not displaying the test page,
>
> I am using netscape as a browser, do you guys know about any issue related
> to this?
>
> many thanks and happy x-mas/happy new year
>
>
>
> _
> Join the world's largest e-mail service with MSN Hotmail.
> 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]




[PHP] Re: array in email

2001-12-30 Thread Jordan

Thanks George...that did the trick...sometimes I want to smack myself for
not seeing the obvious.  Thanks for the help.

-Jordan


George Nicolae <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> the mail function looks like : mail($to,$subject,$body) ("in a simplistic
> manner")
> you can use
>
> $to="[EMAIL PROTECTED]";
> $subject="test";
> for ($i=0;i $body.=a[i];
>
> file://and then, of course
> mail($to,$subject,$body);
> --
>
>
> Best regards,
> George Nicolae
> IT Manager
> ___
> X-Playin - Professional Web Design
> www.x-playin.f2s.com
>
>
>
> "Jordan" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I've searched the archive but can't seem to find anything on the mail()
> > function of PHP.  I've got the whole function working in a simplistic
> manner
> > but I can't do one thing.  How is it possible to print arrays inside the
> > body of the message.  I can't seem to run a loop or anything and all I
> have
> > are session variables to use.  Thanks in advance for the help.
> >
> > -Jordan
> >
> >
>
>



-- 
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 Digest 30 Dec 2001 17:22:27 -0000 Issue 1082

2001-12-30 Thread php-general-digest-help


php-general Digest 30 Dec 2001 17:22:27 - Issue 1082

Topics (messages 79043 through 79065):

Re: could not create new mailbox: Permission denied
79043 by: Brian Clark

Quiz script
79044 by: Indera
79046 by: Bogdan Stancescu

Re: Which is which??
79045 by: Brian Clark

Re: Control Panel , Webmin or similar Written in PHP
79047 by: Brian Clark

Re: WYSIWYG editors for HTML
79048 by: Brian Clark

Handling checkboxs (MySQL+PHP)
79049 by: David Jackson
79051 by: Brian Clark
79054 by: David Jackson
79056 by: Brian Clark
79059 by: George Nicolae

Re: Real Simple, but i'm new!!
79050 by: Brian Clark
79055 by: scott

Re: Session troubles
79052 by: Sean LeBlanc
79053 by: David Jackson

array in email
79057 by: Jordan
79058 by: George Nicolae
79065 by: Jordan

Parsing out numbers from a string
79060 by: John Weez

index.php
79061 by: Caleb Carvalho
79062 by: scott
79063 by: Rambo Amadeus
79064 by: Daniel Urstöger

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

--- Begin Message ---

* gaukia 345 ([EMAIL PROTECTED]) [Dec 28. 2001 23:04]:

> The error message was
> Newname will be 'phpnewbox'
> could not create new mailbox: Permission denied

Looks like the user doesn't have write permission to the mailbox directory. 

> I logged in as cyrus on the server I'm working on. I typed "cyradm" but this
> error message came out

> Can't locate Cyrus/IMAP/Shell.pm in @INC (@INC contains:
> /usr/lib/perl5/5.6.0/i5
> 86-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i586-linux
> /usr/lib
> /perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .).
> BEGIN failed--compilation aborted.

That tool is written in Perl. If you need that tool, you need to get 
the IMAP::Shell module from somewhere and install it. You might
already have it, but it's not in your perl include path. 

> Could the problem be the misconfig of IMAP server. Pls advise. Thanx.

It's likely it's just a permissions problem..

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
10 out of 5 doctors feel it's OK to be skitzo!


--- End Message ---
--- Begin Message ---

Hello,

I have been looking for a script that I can use to create online quizzes. I also need 
to be able to
score them online, save the results to a database, as well as, email the results to 
the student and
teacher. The ideal option would use php and a mysql database.

Any suggestions would be greatly appreciated.

Thanks
Indera



--- End Message ---
--- Begin Message ---

Hello!

Check these out -- they're not filtered as to only search PHP projects:
http://freshmeat.net/search/?site=Freshmeat&q=quiz§ion=projects

The only PHP project in there is Duck.

HTH

Bogdan

Indera wrote:

> I have been looking for a script that I can use to create online quizzes. I also 
>need to be able to
> score them online, save the results to a database, as well as, email the results to 
>the student and
> teacher. The ideal option would use php and a mysql database.
>
> Any suggestions would be greatly appreciated.


--- End Message ---
--- Begin Message ---

* Gerard Samuel ([EMAIL PROTECTED]) [Dec 29. 2001 00:35]:

> I got a fairly big script with a lot of functions.
> Which is more effiecient to pass global information to functions

> ie
> 50 variables
> 50 constants
> or 1 array with 50 values

I'm not sure I'm the right person to answer this, but if I had to
give answer, I'd say they're all equal. You're going to have to 
define them _somewhere_. I mean, if they're global, right? So how 
much difference could one or the other make? 

If there is any huge difference, I'd love to know as well.

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Job Placement: Telling your boss what he can do with your job.


--- End Message ---
--- Begin Message ---

* rick ([EMAIL PROTECTED]) [Dec 29. 2001 03:18]:

>  I was Wondering if it would be possible to write a proyect like Control 
> Panel , WebMin (both are in Perl ) using PHP instead of PERL ? 

> Would it be possible ? 

Sure, why not?

> PHP has the power and flexibility like Perl to write TRUE Systems programs that
> could be able to manage all the aspects related to System Administration ?? 

> If there any proyect I would like to hear about it and join it . 

Don't know of any, but check here

or maybe here


-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint

Re: [PHP] Session troubles

2001-12-30 Thread Sean LeBlanc

On 12-29 22:27, David Jackson wrote:
> Sean --
> 
> Does you standard (non session) seem to work ok? Such as:
>  // basic echo of var from form
> echo "We've just echoed var from form\n";
> echo "$stuff";
> echo "$more_stuff";
> echo "$still_more_stuff";
> ?>

Yes, this works fine. I should have said that before...

> Did you compile Apache and PHP from source? If so
> could you provide me with the ./configure --options you used?
> This is sound like a config/compile problem to me. 

This is what phpinfo() reports for PHP:

'./configure' '--with-apxs=/usr/local/sbin/apxs'
'--with-config-file-path=/usr/local/etc' '--enable-versioning'
'--with-system-regex' '--disable-debug' '--enable-track-vars' '--without-gd'
'--without-mysql' '--enable-session' '--with-zlib' '--with-mysql=/usr/local'
'--with-pgsql=/usr/local' '--with-openssl=/usr' '--with-session'
'--prefix=/usr/local' 'i386--freebsd4.4'

I built PHP from the FreeBSD ports collection. When I ran make, in the menu that
comes up, I selected "transparent session", among other options.

As for Apache...I forget how I installed it. It doesn't appear that I built
it from the ports section, so it was either via a package or a tarball - so
I'm doing it from ports right now to be sure. We'll see how that goes.

> You might also want to cross-post to linux-admin mail list?

I'm using FreeBSD. :) I may post to one of the FreeBSD lists eventually, but
they can sometimes get irritatable when it's not on-topic...

-- 
Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
We are born to action; and whatever is capable of suggesting and guiding 
action has power over us from the first. 
-Charles Horton Cooley 
Management QOTD:It's an orthogonal issue to identify the core product families
and staff appropriately for the process innovation, etc.


-- 
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] how long will REGISTERED GLOBALS be around?

2001-12-30 Thread PHP freak

About PHP 4.1

What I can't tell from the PHP announcement is how long they plan to keep 
register_globals around.

In ONE place it says something like "We have no plans to discontinue 
register_globals", but in another place it says it might be
discontinued or devalued soon.

It'd be a REAL drag to have to go audit everything I've ever written in PHP to change 
all my global variables.
(Especially since I'd been so careful about security while writing them.)

Anyone know what the internal PHP/Zend plans are for it?


-- 
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] Deleting files?

2001-12-30 Thread Matt Moreton

Hey guys.  Any insight into this problem im experiencing would be much appriciated...

I installed some software on my web space a while back, I ran a script and it 
extracted some files from a tar ball I had uploaded.  This was all designed to make 
the package easy to install and set up.  The idea being you just uploaded the tarball 
and a script to set it all up.  The web server does the rest.

Well now I have a problem that I am trying to delete them.  I cant delete them using 
my FTP access to my web space, because I dont have the right permissions.  I wrote a 
script to tell me information about these files, it reports back that the owner is 
"apache" and the group is "apache".  

I wrote a simple script something like this:



This doesnt work on files that I own, let alone files that the web server owns in my 
user space.  What am I doing wrong?

Thanks in advanced.

Matt



[PHP] Including images from Internet

2001-12-30 Thread Gaylen Fraley

Obviously, including an image from another page can be accomplished with an
HTML tag.  However, it seems that there are some inherent issues with doing
this.

How do you keep someone from linking a hi-res image and causing your browser
to take forever to return, if you're on a dial-up?  Is there someway that
PHP can determine the size, via an fopen("http://a.c.com";) call or a socket?
Or am I totally off base with the need/approach?  I'm not looking to pilfer
here.  I want to allow people to leave a link to their image and then
display their picture, as opposed to an icon that links to their picture.
Since there may be several different ones on a page, I would expect that
you'd have to pre-assemble your page and use PHP to determine size,
validity, etc., if that is possible?

Is this possible or do the pictures need to exist on the server?

Thanks,

--
Gaylen




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




Re: [PHP] Including images from Internet

2001-12-30 Thread Bogdan Stancescu

If you're really serious about implementing this, it can be done using socket
functions and basically creating a crippled browser's functions to only retrieve
files.

If you want to go on in this direction, I'm able to help -- just let me know
what details you need.

Bogdan

Gaylen Fraley wrote:

> Obviously, including an image from another page can be accomplished with an
> HTML tag.  However, it seems that there are some inherent issues with doing
> this.


-- 
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] graphics libraries on windows

2001-12-30 Thread Arvydas V.

Has anybody succesfully installed all graphic libraries on windows platform ? Maybe 
you can sent me some links for step by step installation or help any way ?
Thnx



[PHP] Bit shifting conversion (Delphi -> PHP)

2001-12-30 Thread Stefan Pettersson

Hello all,

I'm trying to convert a function done in Delphi (pascal) to PHP. This
function is part of simple text encryption/decryption method. However, I
have a really hard time to make this work in PHP. This is the Delphi code:

Function RotateBits(C: Char; Bits: Integer): Char;
var
  SI : Word;
begin
  Bits := Bits mod 8;
  // Are we shifting left?
  if Bits < 0 then
begin
  // Put the data on the right half of a Word (2 bytes)
  SI := MakeWord(Byte(C),0);
  // Now shift it left the appropriate number of bits
  SI := SI shl Abs(Bits);
end
  else
begin
  // Put the data on the left half of a Word (2 bytes)
  SI := MakeWord(0,Byte(C));
  // Now shift it right the appropriate number of bits
  SI := SI shr Abs(Bits);
end;
  // Finally, Swap the bytes
  SI := Swap(SI);
  // And OR the two halves together
  SI := Lo(SI) or Hi(SI);
  Result := Chr(SI);
end;

and this the beginning of my attempt to do the same thing in PHP:

 function RotateBits($C, $Bits) {
  $Bits = $Bits % 8;

  if ($Bits < 0 ) {
   $C = $C << abs($Bits);
  } else {
   $C = $C >> abs($Bits);
  }

  return chr($C);
 }

In the Delphi code the MakeWord function is a macro:
#define MAKEWORD(a, b) \ ((WORD) (((BYTE) (a)) | ((WORD) ((BYTE) (b))) <<
8))
And Swap exchanges the high order byte with the low order byte of the word.

Now my question is, how can I work with bytes and words in PHP? The closest
I've found is just the integer, that may be of different sizes depending on
system. Or, as a workaround, is there any way to detect the number of bytes
an integer is on the current system?

Thanks in advance.

Best regards,
Stefan Pettersson





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

2001-12-30 Thread Greg Sidelinger

Ok I have use mysql_fetch_array to dump the results of a select query with a
join in it.
if my tables contain a column with the same name how can I distinguish from
them.  I'm used to
table_name.value method in other languages but when I tried
$row['table_name.value'] I don't get any values.
can anyone point me in the right direction.



-- 
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] Need some Linux/Apache help

2001-12-30 Thread Todd Cary

Coming from a Windows background, I am having difficulty understanding
rpm's, compiling, and making packages.  My hope is that someone will
have the patience to take me through the steps, since the HowTo's are
out of date and do not address my current Red Hat 7.2 environment.

With Red Hat 7.2 installed, Apache is installed along with PHP 4.0.6,
however, Interbase is not installed   Here is what I have done so far:

I did a "rpm -qa | grep php" and found the rpm that was
installed.(php-4.0.6-7).  When I tried "rpm -e php-4.0.6-7", I received
a list of php modules that were dependent on it.  So, I "erased" each of
those and finally did the "rpm -e php-4.0.6-7".  Then I put
php-4.0.6-7.src.rpm into /tmp and did a "rpm -i php-4.0.6-7.rpm" which
put a tar'd file into /usr/src/redhat/SOURCES.

I did "tar -xzvf /usr/src/redhat/SOURCES/php-4.0.6pl1.tar.gz" which
created a directory /tmp/php-4.0.6.  I cd'd into that directory and did
a ./configure --with-interbase=/opt/interbase
--with-apache=/usr/include/apache

After quite a period, I received a "Thank you for using PHP" message.  I
followed this with a "make" and a "make install".

Now Apache does not respond to a "testphp.php" script that contains
"phoinfo()" and it use to.

What have I missed.

Todd

--
Todd Cary
Ariste Software
[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]




Re: [PHP] mysql_fetch_array

2001-12-30 Thread Bogdan Stancescu

If everything else fails, you should consider using mysql_fetch_row() instead.

Bogdan

Greg Sidelinger wrote:

> Ok I have use mysql_fetch_array to dump the results of a select query with a
> join in it.
> if my tables contain a column with the same name how can I distinguish from
> them.


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




Re: [PHP] Bit shifting conversion (Delphi -> PHP)

2001-12-30 Thread Bogdan Stancescu

Why do you need word specifically? I personally had a hard time with PHP in the
beginning exactly because I migrated from the Turbo Pascal/Dephi environment.
Just learn how to deal with the new environment: use larger data types and
shift right the byte in order to create a word and use logical "and" with 65535
in order to mask larger-than-word values.

Bogdan

Stefan Pettersson wrote:

> Hello all,
>
> I'm trying to convert a function done in Delphi (pascal) to PHP. This
> function is part of simple text encryption/decryption method. However, I
> have a really hard time to make this work in PHP. This is the Delphi code:
>
> Function RotateBits(C: Char; Bits: Integer): Char;
> var
>   SI : Word;
> begin
>   Bits := Bits mod 8;
>   // Are we shifting left?
>   if Bits < 0 then
> begin
>   // Put the data on the right half of a Word (2 bytes)
>   SI := MakeWord(Byte(C),0);
>   // Now shift it left the appropriate number of bits
>   SI := SI shl Abs(Bits);
> end
>   else
> begin
>   // Put the data on the left half of a Word (2 bytes)
>   SI := MakeWord(0,Byte(C));
>   // Now shift it right the appropriate number of bits
>   SI := SI shr Abs(Bits);
> end;
>   // Finally, Swap the bytes
>   SI := Swap(SI);
>   // And OR the two halves together
>   SI := Lo(SI) or Hi(SI);
>   Result := Chr(SI);
> end;
>
> and this the beginning of my attempt to do the same thing in PHP:
>
>  function RotateBits($C, $Bits) {
>   $Bits = $Bits % 8;
>
>   if ($Bits < 0 ) {
>$C = $C << abs($Bits);
>   } else {
>$C = $C >> abs($Bits);
>   }
>
>   return chr($C);
>  }
>
> In the Delphi code the MakeWord function is a macro:
> #define MAKEWORD(a, b) \ ((WORD) (((BYTE) (a)) | ((WORD) ((BYTE) (b))) <<
> 8))
> And Swap exchanges the high order byte with the low order byte of the word.
>
> Now my question is, how can I work with bytes and words in PHP? The closest
> I've found is just the integer, that may be of different sizes depending on
> system. Or, as a workaround, is there any way to detect the number of bytes
> an integer is on the current system?
>
> Thanks in advance.
>
> Best regards,
> Stefan Pettersson
>
> --
> 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]




Re: [PHP] mysql_fetch_array

2001-12-30 Thread Mehmet Kamil ERISEN


 Hi,
In your SQL, you can say
select t1.col colt1, t2.col colt2
from table1 t1, table2 t2
where t1.something = t2.samething
In other words, you can name your columns differently in your select clause.
I
  Bogdan Stancescu <[EMAIL PROTECTED]> wrote: If everything else fails, you should consider 
using mysql_fetch_row() instead.

Bogdan

Greg Sidelinger wrote:

> Ok I have use mysql_fetch_array to dump the results of a select query with a
> join in it.
> if my tables contain a column with the same name how can I distinguish from
> them.


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


Mehmet Erisen
http://www.erisen.com


-
Do You Yahoo!?
Send your FREE holiday greetings online at Yahoo! Greetings.


Re: [PHP] Including images from Internet

2001-12-30 Thread Bogdan Stancescu

Gaylen wrote:

> Check the validity of the link.

This is inherent to the process -- no need to worry - you just have to include
some error fallback code in the process.

> Check the size.  If less than a particular size, then PHP will
> resize/resample it and display a stndard Avatar sized icon.
> If too large, then disallow it.

Ok, seems like I've got it right.

> Can this be done without having to d/l the picture first?

Obviously not -- how could you possibly resize an image you don't have?!

> Can the Windoze
> PHP implementation handle it, as well as the *nix?

Yes, but if you intend to run the same code for both you'll have to either make
sure you have gd installed on both or that you run distinct programs for
resizing based on the OS.

So, what you have to code is:
1. Send a HTTP request to the server the user is pointing to in order to
retrieve the image;
2. Retrieve the image;
3. Check the image size;
4. Resample the image;
5. Store the image in a database/directory;
6. Display the image.

Technical details:
You'll have to separate the link the user passes in two parts: the server and
the path within the server. I suggest using function parse_URL (under "URL
Functions" in the manual) for this job.

Then you'll have to send the actual request. You should use a piece of code
similar to the one below for this job:


So, we've solved point (2) in the process -- we now have the image file! All you
have to check the size of the string returned by this function, store it,
resample the image if needed and display it.

Let me know if I can be of further assistance.

Bogdan


-- 
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] PHP GuestBook - KISGB (Keep It Simple Guestbook) Version 3.0 Released

2001-12-30 Thread Gaylen Fraley

I have released version 3.0 of my KISGB.

KISGB is a PHP guestbook program that does not require sessions, cookies, or
an rdbms. Can be Public or Private through HTTP Authentication. Automated
install script, fully customizable, clean, and fast. Separate multiple
logging capabilty for tracking anything! Includes web-based password
protected Admin functionality, along with email notification, greeting, ip
logging, ip banning, bad word filter, smileys, allowable html tags in
comments, next/previous, etc. Themes for controlling appearance that allow
for background colors, images, animations, etc. Language support for Dutch,
English, French, German, Polish, Portuguese, Spanish, and Surinam.

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com/
PHP KISGB v3.0 Guest Book http://www.gaylenandmargie.com/phpwebsite/




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

2001-12-30 Thread Good Fella

Hello,

I am extremely new to MySQL and have never managed to get working
smoothly with PHP before. I am trying really hard to understand
how to work it, and am almost there.

I have a problem which I do not know how to resolve and was
wondering if anybody could help me. I have no idea what is wrong
with the code and why I am getting the error message;

Warning: Supplied argument is not a valid MySQL result resource in 
C:\apache\htdocs\sams\chapter10\results.php on line 47

I am currently using a book to aid me with MySQL, and this is an
example from the book. It does not seem to work and I have no idea
what I may have done wrong to obtain this warning.

I have changed my login and password to question marks.

Number of books found: ".$num_results."";

  for ($i=0; $i <$num_results; $i++)

  {

 $row = mysql_fetch_array($result);

 echo "".($i+1).". Title: ";

 echo stripslashes($row["title"]);

 echo "Author: ";

 echo stripslashes($row["author"]);

 echo "ISBN: ";

 echo stripslashes($row["isbn"]);

 echo "Price: ";

 echo stripslashes($row["price"]);

 echo "";

  }

?>

The problem seems to be around the lines of code;

$result = mysql_query($query);

$num_results = mysql_num_rows($result);

Any assistance is appreciated.

Yours,

GF.

_
Chat with friends online, try MSN Messenger: http://messenger.msn.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]




Re: [PHP] Need some Linux/Apache help

2001-12-30 Thread Brian Clark

* Todd Cary ([EMAIL PROTECTED]) [Dec 30. 2001 19:22]:

> I did "tar -xzvf /usr/src/redhat/SOURCES/php-4.0.6pl1.tar.gz" which
> created a directory /tmp/php-4.0.6.  I cd'd into that directory and did
> a ./configure --with-interbase=/opt/interbase
> --with-apache=/usr/include/apache

Are you sure the entire Apache source code is in /usr/include/apache? 

I believe you wanted --with-apxs rather than --with-apache. If you
really wanted --with-apache, and you know the difference, then you will
also need to cd into the apache source directory, and configure apache
with --activate-module=src/modules/php4/libphp4.a, then make and install
Apache again.

Using --with-apache builds PHP as a static module. --with-apxs builds
PHP as a DSO -- a shared module that can be loaded and unloaded via
httpd.conf using the LoadModule directive.

If you use --with-apxs, when configuring PHP, after you make install, it
will install a PHP module in your *current* Apache install's modules
directory, and it may attempt to update your httpd.conf with the correct
LoadModule line if needed.

> After quite a period, I received a "Thank you for using PHP" message.  I
> followed this with a "make" and a "make install".

That "prepped" the PHP module to be included into httpd when you build
Apache. You installed PHP into /usr/local/apache/src (or a similar
path).

> Now Apache does not respond to a "testphp.php" script that contains
> "phoinfo()" and it use to.

That's because PHP isn't installed as an Apache module yet, or you
haven't rebuilt Apache yet.

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Imminent Death of the Net Predicted. GIFs at 11.


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




Re: [PHP] MySQL problem

2001-12-30 Thread David Jackson

Here's the example from the PHP manual:
The tutorial here are very helpfull: 
http://www.melonfire.com/community/columns/trog/

-- David

\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t\n";
foreach ($line as $col_value) {
print "\t\t$col_value\n";
}
print "\t\n";
}
print "\n";

// Closing connection
mysql_close($link);
?>




> Hello,
> 
> I am extremely new to MySQL and have never managed to get working
> smoothly with PHP before. I am trying really hard to understand
> how to work it, and am almost there.
> 
> I have a problem which I do not know how to resolve and was
> wondering if anybody could help me. I have no idea what is wrong
> with the code and why I am getting the error message;
> 
> Warning: Supplied argument is not a valid MySQL result resource in 
> C:\apache\htdocs\sams\chapter10\results.php on line 47
> 
> I am currently using a book to aid me with MySQL, and this is an
> example from the book. It does not seem to work and I have no idea what
> I may have done wrong to obtain this warning.
> 
> I have changed my login and password to question marks.
> 
>  
>  if (!$searchtype || !$searchterm)
> 
>  {
> echo "You have not entered search details.  Please go back and try 
> again.";
> 
> exit;
> 
>  }
> 
> 
>  $searchtype = addslashes($searchtype);
> 
>  $searchterm = addslashes($searchterm);
> 
>  @ $db = mysql_pconnect("mesh", "bookorama", "bookorama123");
> 
>  if (!$db)
> 
>  {
> echo "Error: Could not connect to database.  Please try again
> later.";
> 
> exit;
> 
>  }
> 
>  mysql_select_db("booktest");
> 
>  $query = "select * from booktest where ".$searchtype." like 
> '%".$searchterm."%'";
> 
>  $result = mysql_query($query);
> 
>  $num_results = mysql_num_rows($result);
> 
>  echo "Number of books found: ".$num_results."";
> 
>  for ($i=0; $i <$num_results; $i++)
> 
>  {
> 
> $row = mysql_fetch_array($result);
> 
> echo "".($i+1).". Title: ";
> 
> echo stripslashes($row["title"]);
> 
> echo "Author: ";
> 
> echo stripslashes($row["author"]);
> 
> echo "ISBN: ";
> 
> echo stripslashes($row["isbn"]);
> 
> echo "Price: ";
> 
> echo stripslashes($row["price"]);
> 
> echo "";
> 
>  }
> 
> ?>
> 
> The problem seems to be around the lines of code;
> 
> $result = mysql_query($query);
> 
> $num_results = mysql_num_rows($result);
> 
> Any assistance is appreciated.
> 
> Yours,
> 
> GF.
> 
> _
> Chat with friends online, try MSN Messenger: http://messenger.msn.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]


-- 



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




Re: [PHP] MySQL problem

2001-12-30 Thread GoodFella

Hiya,

Thanks for the quick reply. I used the PHP manual example and it connects
to the database successfully but cannot select the database.

I'm not sure why this is? I've looked hard at it and I cannot see where I have
gone wrong.

Thanks.

GF.
  - Original Message - 
  From: David Jackson 
  To: [EMAIL PROTECTED] 
  Cc: [EMAIL PROTECTED] 
  Sent: Monday, December 31, 2001 1:48 AM
  Subject: Re: [PHP] MySQL problem


  Here's the example from the PHP manual:
  The tutorial here are very helpfull:
  http://www.melonfire.com/community/columns/trog/

  -- David

  \n";
  while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
  print "\t\n";
  foreach ($line as $col_value) {
  print "\t\t$col_value\n";
  }
  print "\t\n";
  }
  print "\n";

  // Closing connection
  mysql_close($link);
  ?>




  > Hello,
  >
  > I am extremely new to MySQL and have never managed to get working
  > smoothly with PHP before. I am trying really hard to understand
  > how to work it, and am almost there.
  >
  > I have a problem which I do not know how to resolve and was
  > wondering if anybody could help me. I have no idea what is wrong
  > with the code and why I am getting the error message;
  >
  > Warning: Supplied argument is not a valid MySQL result resource in
  > C:\apache\htdocs\sams\chapter10\results.php on line 47
  >
  > I am currently using a book to aid me with MySQL, and this is an
  > example from the book. It does not seem to work and I have no idea what
  > I may have done wrong to obtain this warning.
  >
  > I have changed my login and password to question marks.
  >
  > 
  >  if (!$searchtype || !$searchterm)
  >
  >  {
  > echo "You have not entered search details.  Please go back and try
  > again.";
  >
  > exit;
  >
  >  }
  >
  >
  >  $searchtype = addslashes($searchtype);
  >
  >  $searchterm = addslashes($searchterm);
  >
  >  @ $db = mysql_pconnect("mesh", "bookorama", "bookorama123");
  >
  >  if (!$db)
  >
  >  {
  > echo "Error: Could not connect to database.  Please try again
  > later.";
  >
  > exit;
  >
  >  }
  >
  >  mysql_select_db("booktest");
  >
  >  $query = "select * from booktest where ".$searchtype." like
  > '%".$searchterm."%'";
  >
  >  $result = mysql_query($query);
  >
  >  $num_results = mysql_num_rows($result);
  >
  >  echo "Number of books found: ".$num_results."";
  >
  >  for ($i=0; $i <$num_results; $i++)
  >
  >  {
  >
  > $row = mysql_fetch_array($result);
  >
  > echo "".($i+1).". Title: ";
  >
  > echo stripslashes($row["title"]);
  >
  > echo "Author: ";
  >
  > echo stripslashes($row["author"]);
  >
  > echo "ISBN: ";
  >
  > echo stripslashes($row["isbn"]);
  >
  > echo "Price: ";
  >
  > echo stripslashes($row["price"]);
  >
  > echo "";
  >
  >  }
  >
  > ?>
  >
  > The problem seems to be around the lines of code;
  >
  > $result = mysql_query($query);
  >
  > $num_results = mysql_num_rows($result);
  >
  > Any assistance is appreciated.
  >
  > Yours,
  >
  > GF.
  >
  > _
  > Chat with friends online, try MSN Messenger: http://messenger.msn.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]


  --






Re: [PHP] Parsing out numbers from a string

2001-12-30 Thread Brian Clark

* John Weez ([EMAIL PROTECTED]) [Dec 30. 2001 03:23]:

> I have a small program which captures the output of a webpage and puts the
> data in to a string variable.
> I then use teh strip tags function of php to clean it up a bit.

> then i want to use regular expressions to extract all the numbers from the
> page ..they are like this usually numbers.numbers (IE: 40.40 ).

> For some reason my expressions are not matching anything in the string
> unless i type exactly what i am looking for... could the fact that there
> are line reurns in the string be causing a problem? or do i need to
> somehow tell php to goto the next line?

How are you grabbing all the data from the page?

> I had an older version of the program which saved teh data to a file and
> then PhP scanned the file line by line..this worked...but i'm trying to
> make a more elegant solution that won;t kill my hard drive faster ;)

It's going to use a bit of memory to search an entire page with a
regular expression. It's probably going to be slow(er) no matter how you
slice it.

I would use the PCRE functions; preg_match_all() probably..

Look over these:
 

I think you'll want to use m (and g is default, as the comment says).

Something like this may work:



-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Recursive: Adj. See Recursive.


-- 
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] How to convert integers representations of a date to a date format variable

2001-12-30 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I would like to convert integers like the day, month and year to a date representation 
to store it in a session variable.

There's a form where the user posts day, month and year. So then I run 
checkdate($month,$day,$year) and make sure the date is valid.

So, let's say I have 12 for month, 30 for day and 2001 as year. Do I have to create a 
timestamp? How to create a
TimeStamp?

I need to store it as 30/12/2001 (but not a string) not only on a session variable but 
also to make it easier to work with a MySQL table.

After that I want to play with it as a string so I will use the date() function, 
that's why it is important to save it as a validade date format value.

Any sugestions?

Thank you in advance,

Carlos Fernando.
Linux User #207984




Re: [PHP] how long will REGISTERED GLOBALS be around?

2001-12-30 Thread Brian Clark

* PHP freak ([EMAIL PROTECTED]) [Dec 30. 2001 15:01]:

[...]

> In ONE place it says something like "We have no plans to discontinue 
>register_globals", but in another place it says it might be
> discontinued or devalued soon.

I take it as being depreciated and as something we're all going to have
to face with older code as progress is made with PHP. It's probably not
the last time something like this will happen. Happens with Perl, too.
:-\

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Variables won't; constants aren't.


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




Re: [PHP] How to convert integers representations of a date to a date format variable

2001-12-30 Thread Brian Clark

* Carlos Fernando Scheidecker Antunes ([EMAIL PROTECTED]) [Dec 30. 2001 21:11]:

> So, let's say I have 12 for month, 30 for day and 2001 as year. Do I have to create 
>a timestamp? How to create a
> TimeStamp?

strtotime() can convert it into a unix timestamp. 

> I need to store it as 30/12/2001 (but not a string) not only on a session variable 
>but also to make it easier to work with a MySQL table.

For MySQL, this may help:



-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Never try to out stare a cat. They've got no eyelids.


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




Re: [PHP] MySQL problem

2001-12-30 Thread Brian Clark

* GoodFella ([EMAIL PROTECTED]) [Dec 30. 2001 21:10]:

> Thanks for the quick reply. I used the PHP manual example and it connects
> to the database successfully but cannot select the database.

So you are using this line:

>   >  mysql_select_db("booktest");

Correct? What does the server "say" in return? What is the error
message?

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
You can't put a bag over someone's personality.


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




Re: [PHP] MySQL problem

2001-12-30 Thread David Jackson

I almost forgot add a or mysql_error() for each line like this:


This will return "human readable error messges"
Can you onto mysql database from command.
mysql -u root -p mysql
or mysql -u root mysql # A root password isn't usally get during install.

if so:
>select user,host,password from user;

then:
select user,host,db from db;

My quesss you don't have any permission for the databases or to connect
to local host. If this is correct do:

GRANT ALL on db_name.* TO you@local host idendified by 'your_password';


> Hiya,
> 
> Thanks for the quick reply. I used the PHP manual example and it
> connects to the database successfully but cannot select the database.
> 
> I'm not sure why this is? I've looked hard at it and I cannot see where
> I have gone wrong.
> 
> Thanks.
> 
> GF.
>  - Original Message - 
>  From: David Jackson 
>  To: [EMAIL PROTECTED] 
>  Cc: [EMAIL PROTECTED] 
>  Sent: Monday, December 31, 2001 1:48 AM
>  Subject: Re: [PHP] MySQL problem
> 
> 
>  Here's the example from the PHP manual:
>  The tutorial here are very helpfull:
>  http://www.melonfire.com/community/columns/trog/
> 
>  -- David
> 
>// Connecting, selecting database
>  $link = mysql_connect("mysql_host", "mysql_login", "mysql_password")
>  or die("Could not connect");
>  print "Connected successfully";
>  mysql_select_db("my_database")
>  or die("Could not select database");
> 
>  // Performing SQL query
>  $query = "SELECT * FROM my_table";
>  $result = mysql_query($query)
>  or die("Query failed");
> 
>  // Printing results in HTML
>  print "\n";
>  while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
>  print "\t\n";
>  foreach ($line as $col_value) {
>  print "\t\t$col_value\n";
>  }
>  print "\t\n";
>  }
>  print "\n";
> 
>  // Closing connection
>  mysql_close($link);
>  ?>
> 
> 
> 
> 
>  > Hello,
>  >
>  > I am extremely new to MySQL and have never managed to get working
>  > smoothly with PHP before. I am trying really hard to understand how
>  > to work it, and am almost there.
>  >
>  > I have a problem which I do not know how to resolve and was
>  > wondering if anybody could help me. I have no idea what is wrong
>  > with the code and why I am getting the error message;
>  >
>  > Warning: Supplied argument is not a valid MySQL result resource in
>  > C:\apache\htdocs\sams\chapter10\results.php on line 47
>  >
>  > I am currently using a book to aid me with MySQL, and this is an
>  > example from the book. It does not seem to work and I have no idea
>  > what I may have done wrong to obtain this warning.
>  >
>  > I have changed my login and password to question marks.
>  >
>  >   >
>  >  if (!$searchtype || !$searchterm)
>  >
>  >  {
>  > echo "You have not entered search details.  Please go back and
>  > try
>  > again.";
>  >
>  > exit;
>  >
>  >  }
>  >
>  >
>  >  $searchtype = addslashes($searchtype);
>  >
>  >  $searchterm = addslashes($searchterm);
>  >
>  >  @ $db = mysql_pconnect("mesh", "bookorama", "bookorama123");
>  >
>  >  if (!$db)
>  >
>  >  {
>  > echo "Error: Could not connect to database.  Please try again
>  > later.";
>  >
>  > exit;
>  >
>  >  }
>  >
>  >  mysql_select_db("booktest");
>  >
>  >  $query = "select * from booktest where ".$searchtype." like
>  > '%".$searchterm."%'";
>  >
>  >  $result = mysql_query($query);
>  >
>  >  $num_results = mysql_num_rows($result);
>  >
>  >  echo "Number of books found: ".$num_results."";
>  >
>  >  for ($i=0; $i <$num_results; $i++)
>  >
>  >  {
>  >
>  > $row = mysql_fetch_array($result);
>  >
>  > echo "".($i+1).". Title: ";
>  >
>  > echo stripslashes($row["title"]);
>  >
>  > echo "Author: ";
>  >
>  > echo stripslashes($row["author"]);
>  >
>  > echo "ISBN: ";
>  >
>  > echo stripslashes($row["isbn"]);
>  >
>  > echo "Price: ";
>  >
>  > echo stripslashes($row["price"]);
>  >
>  > echo "";
>  >
>  >  }
>  >
>  > ?>
>  >
>  > The problem seems to be around the lines of code;
>  >
>  > $result = mysql_query($query);
>  >
>  > $num_results = mysql_num_rows($result);
>  >
>  > Any assistance is appreciated.
>  >
>  > Yours,
>  >
>  > GF.
>  >
>  > _
>  > Chat with friends online, try MSN Messenger:
>  > http://messenger.msn.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]
> 
> 
>  --


-- 



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




Re: [PHP] how long will REGISTERED GLOBALS be around?

2001-12-30 Thread PHP freak

For what it's worth - casting my vote - I would vote that the PHP/Zend people keep 
REGISTER_GLOBALS as an option for one main reason:

NEWBIES!

Think of how nice it is for the total newbies to be able to have this first tutorial:




what is your name?





Think of how many PHP-CURIOUS people it'd turn off if you could ONLY do it with 
$_REQUEST["myname"]

Hell - I *still* have to go to the php.net announcement page to remember the syntax of 
the new type.  It doesn't come naturally.  Nothing like $variablename.

I think the EASE of the form example, above, is what got me into PHP in the first 
place.


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




Re: [PHP] how long will REGISTERED GLOBALS be around?

2001-12-30 Thread Brian Clark

* PHP freak ([EMAIL PROTECTED]) [Dec 30. 2001 21:45]:

> Think of how many PHP-CURIOUS people it'd turn off if you could ONLY do it with 
>$_REQUEST["myname"]

Hell, I have to admit, that is pretty darn ugly.

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Sure FAT32 corrupts your files, but look how fast it is.


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




Re: [PHP] MySQL problem

2001-12-30 Thread GoodFella

Thanks so much guys,

It was my user permissions all along. Funnily enough the book 
gives you guidelines on how to set them up, and sets up a fair 
few... but for some reason they selected the wrong user to use.

Thanks very much for your help David and Brian- much appreciated.

Yours,

GF
  - Original Message - 
  From: David Jackson 
  To: [EMAIL PROTECTED] 
  Cc: [EMAIL PROTECTED] ; [EMAIL PROTECTED] 
  Sent: Monday, December 31, 2001 2:41 AM
  Subject: Re: [PHP] MySQL problem


  I almost forgot add a or mysql_error() for each line like this:
  

  This will return "human readable error messges"
  Can you onto mysql database from command.
  mysql -u root -p mysql
  or mysql -u root mysql # A root password isn't usally get during install.

  if so:
  >select user,host,password from user;

  then:
  select user,host,db from db;

  My quesss you don't have any permission for the databases or to connect
  to local host. If this is correct do:

  GRANT ALL on db_name.* TO you@local host idendified by 'your_password';


  > Hiya,
  >
  > Thanks for the quick reply. I used the PHP manual example and it
  > connects to the database successfully but cannot select the database.
  >
  > I'm not sure why this is? I've looked hard at it and I cannot see where
  > I have gone wrong.
  >
  > Thanks.
  >
  > GF.
  >  - Original Message -
  >  From: David Jackson
  >  To: [EMAIL PROTECTED]
  >  Cc: [EMAIL PROTECTED]
  >  Sent: Monday, December 31, 2001 1:48 AM
  >  Subject: Re: [PHP] MySQL problem
  >
  >
  >  Here's the example from the PHP manual:
  >  The tutorial here are very helpfull:
  >  http://www.melonfire.com/community/columns/trog/
  >
  >  -- David
  >
  >// Connecting, selecting database
  >  $link = mysql_connect("mysql_host", "mysql_login", "mysql_password")
  >  or die("Could not connect");
  >  print "Connected successfully";
  >  mysql_select_db("my_database")
  >  or die("Could not select database");
  >
  >  // Performing SQL query
  >  $query = "SELECT * FROM my_table";
  >  $result = mysql_query($query)
  >  or die("Query failed");
  >
  >  // Printing results in HTML
  >  print "\n";
  >  while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
  >  print "\t\n";
  >  foreach ($line as $col_value) {
  >  print "\t\t$col_value\n";
  >  }
  >  print "\t\n";
  >  }
  >  print "\n";
  >
  >  // Closing connection
  >  mysql_close($link);
  >  ?>
  >
  >
  >
  >
  >  > Hello,
  >  >
  >  > I am extremely new to MySQL and have never managed to get working
  >  > smoothly with PHP before. I am trying really hard to understand how
  >  > to work it, and am almost there.
  >  >
  >  > I have a problem which I do not know how to resolve and was
  >  > wondering if anybody could help me. I have no idea what is wrong
  >  > with the code and why I am getting the error message;
  >  >
  >  > Warning: Supplied argument is not a valid MySQL result resource in
  >  > C:\apache\htdocs\sams\chapter10\results.php on line 47
  >  >
  >  > I am currently using a book to aid me with MySQL, and this is an
  >  > example from the book. It does not seem to work and I have no idea
  >  > what I may have done wrong to obtain this warning.
  >  >
  >  > I have changed my login and password to question marks.
  >  >
  >  >   >
  >  >  if (!$searchtype || !$searchterm)
  >  >
  >  >  {
  >  > echo "You have not entered search details.  Please go back and
  >  > try
  >  > again.";
  >  >
  >  > exit;
  >  >
  >  >  }
  >  >
  >  >
  >  >  $searchtype = addslashes($searchtype);
  >  >
  >  >  $searchterm = addslashes($searchterm);
  >  >
  >  >  @ $db = mysql_pconnect("mesh", "bookorama", "bookorama123");
  >  >
  >  >  if (!$db)
  >  >
  >  >  {
  >  > echo "Error: Could not connect to database.  Please try again
  >  > later.";
  >  >
  >  > exit;
  >  >
  >  >  }
  >  >
  >  >  mysql_select_db("booktest");
  >  >
  >  >  $query = "select * from booktest where ".$searchtype." like
  >  > '%".$searchterm."%'";
  >  >
  >  >  $result = mysql_query($query);
  >  >
  >  >  $num_results = mysql_num_rows($result);
  >  >
  >  >  echo "Number of books found: ".$num_results."";
  >  >
  >  >  for ($i=0; $i <$num_results; $i++)
  >  >
  >  >  {
  >  >
  >  > $row = mysql_fetch_array($result);
  >  >
  >  > echo "".($i+1).". Title: ";
  >  >
  >  > echo stripslashes($row["title"]);
  >  >
  >  > echo "Author: ";
  >  >
  >  > echo stripslashes($row["author"]);
  >  >
  >  > echo "ISBN: ";
  >  >
  >  > echo stripslashes($row["isbn"]);
  >  >
  >  > echo "Price: ";
  >  >
  >  > echo stripslashes($row["price"]);
  >  >
  >  > echo "";
  >  >
  >  >  }
  >  >
  >  > ?>
  >  >
  >  > The problem seems to be around the lines of code;
  >  >
  >  > $result = mysql_query($query);
  >  >
  >  > $num_results = mysql_num_rows($result);
  >  >
  >  > Any assistance is appreciated.
  >  >
  >  > Yours,
  >  >
  >  > GF.
  >

[PHP] php4 and PHPLib

2001-12-30 Thread Gerard Samuel

I came across an application "sourcewell" and it requires PHPLib.
My server has php4 on it.  I never played with php3 before (dont know if 
I want to), and I didn't see anything in its docs about php4
Is it possible to run this thing on a box with php4??

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]




[PHP] good php sites

2001-12-30 Thread Dennis Gearon

other than putting the 'next question' link too far from the question
selection zone, this is a cool php site.

http://verticalmove.bpnetworks.com/module.php?jobID=68689&modNum=13
-- 
-
Look lovingly upon the present,
for it holds the only things that are forever true.
-
How many Microsoft programmers does it take to screw in a light bulb?
None. Let's define darkness as the new industry standard
-
Sincerely, Dennis Gearon (Kegley)

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




Re: [PHP] another tomcat 4.01 problem

2001-12-30 Thread Vincent Stoessel

OK, here is a little more data:
my system is running redhat (i386 )6.2 with glibc 2.1.3
I have the latest jdk 1.3.1 from  java.sun.com
Tomcat seems to load and set up my php servlet context just fine:

XmlMapper: pop org.apache.catalina.core.StandardWrapper
XmlMapper: org.apache.catalina.core.StandardContext.addServletMapping( *.php, php)
XmlMapper: org.apache.catalina.core.StandardContext.addServletMapping( *.phps, 
php-formatter)


but when I try accessing a php script, tomcat crashes:


An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x36a573fe
Function name=Java_net_php_reflect_setEnv
Library=/usr/local/phpservlet/lib/php/libphp4.so

Current Java thread:
at net.php.servlet.send(Native Method)
at net.php.servlet.service(servlet.java:162)
at net.php.servlet.service(servlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

Has anyone gotten php-4.10 + tomcat 4.0.1 to work together yet?
Thanks.

Vincent Stoessel wrote:

> 
> 
> 
> Subject:
> 
> [PHP] another tomcat 4.01 problem
> From:
> 
> Vincent Stoessel <[EMAIL PROTECTED]>
> Date:
> 
> Sat, 29 Dec 2001 17:37:26 -0500
> To:
> 
> Php General Mailing List <[EMAIL PROTECTED]>
> 
> To:
> 
> Php General Mailing List <[EMAIL PROTECTED]>
> 
> 
> I got php4.1.0 sucessfully compiled in and now I get these
> exceptions when I try to run the test php scripts.
> 
> java.lang.UnsatisfiedLinkError: send
> at net.php.servlet.send(Native Method)
> at net.php.servlet.service(servlet.java:162)
> at net.php.servlet.service(servlet.java:180)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 
> I know that I am very close now. Any hints?



-- 
Vincent Stoessel [EMAIL PROTECTED]
Java Linux Apache Mysql Php (JLAMP) Engineer
(301) 362-1750 Mobile (410) 419-8588
AIM, MSN: xaymaca2020 , Yahoo Messenger: vks_jamaica


-- 
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 Digest 31 Dec 2001 07:50:30 -0000 Issue 1083

2001-12-30 Thread php-general-digest-help


php-general Digest 31 Dec 2001 07:50:30 - Issue 1083

Topics (messages 79066 through 79095):

Re: Session troubles
79066 by: Sean LeBlanc

how long will REGISTERED GLOBALS be around?
79067 by: PHP freak
79086 by: Brian Clark
79090 by: PHP freak
79091 by: Brian Clark

Deleting files?
79068 by: Matt Moreton

Including images from Internet
79069 by: Gaylen Fraley
79070 by: Bogdan Stancescu
79078 by: Bogdan Stancescu

graphics libraries on windows
79071 by: Arvydas V.

Bit shifting conversion (Delphi -> PHP)
79072 by: Stefan Pettersson
79076 by: Bogdan Stancescu

mysql_fetch_array
79073 by: Greg Sidelinger
79075 by: Bogdan Stancescu
79077 by: Mehmet Kamil ERISEN

Need some Linux/Apache help
79074 by: Todd Cary
79081 by: Brian Clark

PHP GuestBook - KISGB (Keep It Simple Guestbook) Version 3.0 Released
79079 by: Gaylen Fraley

MySQL problem
79080 by: Good Fella
79082 by: David Jackson
79083 by: Good Fella
79088 by: Brian Clark
79089 by: David Jackson
79092 by: Good Fella

Re: Parsing out numbers from a string
79084 by: Brian Clark

How to convert integers representations of a date to a date format variable
79085 by: Carlos Fernando Scheidecker Antunes
79087 by: Brian Clark

php4 and PHPLib
79093 by: Gerard Samuel

good php sites
79094 by: Dennis Gearon

Re: another tomcat 4.01 problem
79095 by: Vincent Stoessel

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

--- Begin Message ---

On 12-29 22:27, David Jackson wrote:
> Sean --
> 
> Does you standard (non session) seem to work ok? Such as:
>  // basic echo of var from form
> echo "We've just echoed var from form\n";
> echo "$stuff";
> echo "$more_stuff";
> echo "$still_more_stuff";
> ?>

Yes, this works fine. I should have said that before...

> Did you compile Apache and PHP from source? If so
> could you provide me with the ./configure --options you used?
> This is sound like a config/compile problem to me. 

This is what phpinfo() reports for PHP:

'./configure' '--with-apxs=/usr/local/sbin/apxs'
'--with-config-file-path=/usr/local/etc' '--enable-versioning'
'--with-system-regex' '--disable-debug' '--enable-track-vars' '--without-gd'
'--without-mysql' '--enable-session' '--with-zlib' '--with-mysql=/usr/local'
'--with-pgsql=/usr/local' '--with-openssl=/usr' '--with-session'
'--prefix=/usr/local' 'i386--freebsd4.4'

I built PHP from the FreeBSD ports collection. When I ran make, in the menu that
comes up, I selected "transparent session", among other options.

As for Apache...I forget how I installed it. It doesn't appear that I built
it from the ports section, so it was either via a package or a tarball - so
I'm doing it from ports right now to be sure. We'll see how that goes.

> You might also want to cross-post to linux-admin mail list?

I'm using FreeBSD. :) I may post to one of the FreeBSD lists eventually, but
they can sometimes get irritatable when it's not on-topic...

-- 
Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome 
ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome 
We are born to action; and whatever is capable of suggesting and guiding 
action has power over us from the first. 
-Charles Horton Cooley 
Management QOTD:It's an orthogonal issue to identify the core product families
and staff appropriately for the process innovation, etc.


--- End Message ---
--- Begin Message ---

About PHP 4.1

What I can't tell from the PHP announcement is how long they plan to keep 
register_globals around.

In ONE place it says something like "We have no plans to discontinue 
register_globals", but in another place it says it might be
discontinued or devalued soon.

It'd be a REAL drag to have to go audit everything I've ever written in PHP to change 
all my global variables.
(Especially since I'd been so careful about security while writing them.)

Anyone know what the internal PHP/Zend plans are for it?


--- End Message ---
--- Begin Message ---

* PHP freak ([EMAIL PROTECTED]) [Dec 30. 2001 15:01]:

[...]

> In ONE place it says something like "We have no plans to discontinue 
>register_globals", but in another place it says it might be
> discontinued or devalued soon.

I take it as being depreciated and as something we're all going to have
to face with older code as progress is made with PHP. It's probably not
the last time something like this will happen. Happens with Perl, too.
:-\

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Variables won't; constants aren't.


--- End Message ---
--- Begin Message -