php-general Digest 12 Oct 2002 23:46:08 -0000 Issue 1640

Topics (messages 119728 through 119751):

Re: An small SQL problem
        119728 by: Davy Obdam
        119731 by: Brad Bulger
        119736 by: Davy Obdam

Re: Odd request
        119729 by: Noodle Snacks

Re: fgetcsv or other
        119730 by: . Edwin

Re: WinAMP Plugin Question
        119732 by: Andrew Brampton

PHP caching ideas?
        119733 by: Hans Himmel

User Upload
        119734 by: tony.tabzilla.com
        119741 by: Stephen

$html_code .= include ("filetoinclude.txt");
        119735 by: Research and Development
        119737 by: CJ
        119738 by: John W. Holmes
        119739 by: .: B i g D o g :.

High-Res Images
        119740 by: Oscar F
        119744 by: Marek Kilimajer

Re: how to configure with ldap?
        119742 by: Tony Earnshaw
        119743 by: Ray Hunter

getimagesize() with ftp-url?
        119745 by: Stefan Wessman
        119746 by: nicos.php.net
        119750 by: Marek Kilimajer

trying to get a certain num of rows in mysql
        119747 by: Pablo Oliva
        119748 by: Timothy J Hitchens
        119749 by: Marek Kilimajer

POST and GET variables don't work
        119751 by: Andres Olarte

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 ---
Hi Christian,

I am not 100% sure cos i am doing this from my head but your SELECT 
query would have to look like this:

SELECT TableA.FieldA2 FROM TableA, TableB WHERE TableA.FieldA1 != 
TableB.FieldB2

btw. Wouldn`t be easier to use more informative Table and Field names..?
Hope it works,

Best regards,

Davy Obdam
mailto:[EMAIL PROTECTED]

Christian Ista wrote:

>Hello,
>
>I'm probably sleepy because I can't do a very easy query. :(
>
>I have 2 tables TableA(FieldA1, FieldA2, FieldA3) and TableB(FieldB1,
>FieldB2, FieldB3).
>
>I'd like to see the TableA records (FieldA2) where the FieldA1(Primary
>key) not exist in TableB(FieldB2). I tried "not exists" without success.
>
>Could you help me ?
>
>Christian,
>
>
>  
>


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

what database are you using? because the answer is different, depending.

on postgres, for example, which supports subselects, you can do

select * from TableA where FieldA1 not in (select FieldB2 from TableB)

with mysql, there are no subselects, so you'd have to do something like

select TableA.*, TableB.FieldB1
from TableA left join TableB on TableA.FieldA1 = TableB.FieldB1
having FieldB1 is null

PS the one thing that for sure will not work is

select TableA.* from TableA, TableB where TableA.FieldA1 != TableB.FieldB2

that will just give you a cartesian product, returning a copy of
every row in TableA for every row in TableB that doesn't match its key

On Sat, 12 Oct 2002, Christian Ista wrote:

> Hello,
>
> I'm probably sleepy because I can't do a very easy query. :(
>
> I have 2 tables TableA(FieldA1, FieldA2, FieldA3) and TableB(FieldB1,
> FieldB2, FieldB3).
>
> I'd like to see the TableA records (FieldA2) where the FieldA1(Primary
> key) not exist in TableB(FieldB2). I tried "not exists" without success.
>
> Could you help me ?
>
> Christian,
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi Brad,

Oooops. I think i better go and  read your excelent book MySQL/PHP 
database applications agian......
Best regards,

Davy Obdam
mailto:[EMAIL PROTECTED]

Brad Bulger wrote:

>what database are you using? because the answer is different, depending.
>
>on postgres, for example, which supports subselects, you can do
>
>select * from TableA where FieldA1 not in (select FieldB2 from TableB)
>
>with mysql, there are no subselects, so you'd have to do something like
>
>select TableA.*, TableB.FieldB1
>from TableA left join TableB on TableA.FieldA1 = TableB.FieldB1
>having FieldB1 is null
>
>PS the one thing that for sure will not work is
>
>select TableA.* from TableA, TableB where TableA.FieldA1 != TableB.FieldB2
>
>that will just give you a cartesian product, returning a copy of
>every row in TableA for every row in TableB that doesn't match its key
>
>On Sat, 12 Oct 2002, Christian Ista wrote:
>
>  
>
>>Hello,
>>
>>I'm probably sleepy because I can't do a very easy query. :(
>>
>>I have 2 tables TableA(FieldA1, FieldA2, FieldA3) and TableB(FieldB1,
>>FieldB2, FieldB3).
>>
>>I'd like to see the TableA records (FieldA2) where the FieldA1(Primary
>>key) not exist in TableB(FieldB2). I tried "not exists" without success.
>>
>>Could you help me ?
>>
>>Christian,
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>    
>>
>
>
>  
>


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

"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Probably a question for the php dev team, but here it goes.  I want to
> display an external page in an iframe and have the iframe auto sized to
fit
> the content without having scroll bars.  I've tried javascript to no
avail.
> So here's my idea:
>
> 1.  Instead of iframe: $string = file_get_contents("http://somwhere.com";);
> to load page into string and then echo $string; use javascript to detect
> onclick, get href of anchor, load page into string and echo again.  Works
> O.K. unless there are relative paths in document.
>
> 2. What I want to do:  $string = file_get_contents("http://somwhere.com";);
> and determine the height that this page ($string) would render in a
browser.
> Render iframe at determined height with src = "http://somwhere.com";.
>
> Any way in php to determine at what height html content will render???  If
> not, should there be?

Probably Not. It depends on the UA completly. eg screen res, font size,
browser incompatibilty etc...

Why the iframe? couldn't you just include/fopen it?


--
JJ Harrison
[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Hello,

Just remember that fgetcsv() returns an array. So the first column is

  $thearray[0];

You can just pass it to the function that generates the image BEFORE you go
to the next line of your csv file.

Or, am I missing something?

- E

On Saturday, October 12, 2002 2:05 AM
Bryan Koschmann wrote:

> Hi,
>
> I need to read from a csv file (with quotes). I use the example from the
> manual, and it does spit it out how I want it, but I need to access one of
> the fields and pass that data to something else.
>
> So it's like this, I need my csv file to be displayed in a table, but the
> last column will contain an image generate using data from the first
> column.
>
> Does anyone have any examples? I've been searching the net, but haven't
> really found much.
>
> Thanks!
>
> Bryan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
You could create a PHP script on your webserver that pulls the info from
your machine, parses it and then re-displays it in the way you like. This
way people won't actually know your IP,. and all the processsing will be
done on your webserver. If you want to allow them to download your MP3s, you
can either do it via your webserver, it just let your webserver link
straight to your SpyAmp page.

Andrew
----- Original Message -----
From: "eriol" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 12, 2002 8:06 AM
Subject: [PHP] WinAMP Plugin Question


> I was wondering if anyone has tried or would know how to take my mp3
> collection listing from SpyAMP (http://spyamp.sf.net) and incorporate it
> into my site (which is on a different server and not on my home network)
> and have guests be able to download songs assuming I have it running?
>
> I want to change the HTML layout, the order the songs are listed
> (alphabetical vs. random, etc.), and have them in categories instead of
> being all in one long list.. I don't know if this is possible, but I
> figure it wouldn't hurt to ask..
>
> SpyAMP, for those unfamiliar with it, basically sets up a small mp3
> server on your local machine and allows anyone who knows your IP address
> (or visits the SA server page if you're listed) to download songs if
> you've chosen to allow it.. I have no clue where to begin as I'm a php
> newbie.. Any ideas, tutorials, code or function names to help me on my
> way would be appreciated..
>
> TIA..
>
> Take care.. peace..
> eriol
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hello there,

How do most people here create their caching logic for PHP scripts? The 
problem is that most PHP scripts have some part of the page that is unique 
to each request (let it be current time, e-mail list in an e-mail reading 
application, session IDs on some servers, or whatever).

Is the general logic to slice the page into some general pieces. For example 
ones that have always general data and those that change. Then the ones that 
don't change are streamed to the user using passthrough and the rest of the 
page is generated dynamically with the newest relevant data.

Or are there any other good ideas to solve PHP caching problems?

Thanks,
Hans

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

--- End Message ---
--- Begin Message ---
How would I go about allowing a user to upload a file which I then read and
store its contents in a mysql database and then delete the file, or any more
efficient method.

Any help at all would be great.

--- End Message ---
--- Begin Message ---
There are many ways. I'd suggest setting up a folder where the user uploads
the file (using the FTP commands in PHP) then setting up some sort of admin
cp that gets a list of the files from the folder, displays them, then you
click it. If you like it or whatever, you can click a save link which copies
the contents and saves it into a MySQL table. The code would be too long to
put in for this list though...

Thanks,
Stephen Craton
http://www.melchior.us

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 12, 2002 11:31 AM
Subject: [PHP] User Upload


> How would I go about allowing a user to upload a file which I then read
and
> store its contents in a mysql database and then delete the file, or any
more
> efficient method.
>
> Any help at all would be great.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Should this work?

$html_code .= include ("filetoinclude.txt");

I am populating a variable with html to be printred later as usual: 
$html_code .= "html....".

But I have some static html files that I want included in the html that 
I am storing in the variable. The HTML is in text files. The above code 
obviously does not work. I want to know if there is another way.

Thanks.
--- End Message ---
--- Begin Message ---

$html_code = $html_code.include("filetoinclude.txt");


Research And Development wrote:
> Should this work?
> 
> $html_code .= include ("filetoinclude.txt");
> 
> I am populating a variable with html to be printred later as usual: 
> $html_code .= "html....".
> 
> But I have some static html files that I want included in the html that 
> I am storing in the variable. The HTML is in text files. The above code 
> obviously does not work. I want to know if there is another way.
> 
> Thanks.
> 

--- End Message ---
--- Begin Message ---
No. That will not work. Include does not return the text to a variable.
Please read the manual page on include. You have to use file, fopen, or
include() _with_ output buffering in order for this to work.

---John Holmes...

> -----Original Message-----
> From: CJ [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, October 12, 2002 3:09 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: $html_code .= include ("filetoinclude.txt");
> 
> 
> $html_code = $html_code.include("filetoinclude.txt");
> 
> 
> Research And Development wrote:
> > Should this work?
> >
> > $html_code .= include ("filetoinclude.txt");
> >
> > I am populating a variable with html to be printred later as usual:
> > $html_code .= "html....".
> >
> > But I have some static html files that I want included in the html
that
> > I am storing in the variable. The HTML is in text files. The above
code
> > obviously does not work. I want to know if there is another way.
> >
> > Thanks.
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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

Your email is not 100% totally clear with what you are actually trying
to accomplish, however, here is an example of how i like to get html
source code into a variable from a file.

$html_code = implode( '', file( 'filetoinclude.txt' ) );

or append it...

$html_code .= implode( '', file( 'filetoinclude.txt' ) );

Hope that helps you out.

On Sat, 2002-10-12 at 09:50, Research and Development wrote:
> Should this work?
> 
> $html_code .= include ("filetoinclude.txt");
> 
> I am populating a variable with html to be printred later as usual: 
> $html_code .= "html....".
> 
> But I have some static html files that I want included in the html that 
> I am storing in the variable. The HTML is in text files. The above code 
> obviously does not work. I want to know if there is another way.
> 
> Thanks.

-- 
.: B i g D o g :.


--- End Message ---
--- Begin Message ---
Hello,

I have a script that process images sent by users, but I'm having some 
problems here.

1) Does anybody know if there is any problem with hi-res images (300 
DPI), because when I try to use them with PHP to resize/copy them, all I 
get is a black box.

2) Is there any way, with GD/PHP to get the DPI value of an image, 
because the image they submit has to be 300 dpi.

In short, I need the user to upload the file, and the script to verify 
it is 300 DPI and to resize it to its equivalent size with 72 DPI.

ANY help would be really appreciated.
 
    Oscar F.-

--- End Message ---
--- Begin Message ---
You might have memory limit problem, try setting it higher. And as far 
as I know, there is no function in gd to tell you DPI, try imlib extension.

Oscar F wrote:

> Hello,
>
> I have a script that process images sent by users, but I'm having some 
> problems here.
>
> 1) Does anybody know if there is any problem with hi-res images (300 
> DPI), because when I try to use them with PHP to resize/copy them, all 
> I get is a black box.
>
> 2) Is there any way, with GD/PHP to get the DPI value of an image, 
> because the image they submit has to be 300 dpi.
>
> In short, I need the user to upload the file, and the script to verify 
> it is 300 DPI and to resize it to its equivalent size with 72 DPI.
>
> ANY help would be really appreciated.
>
>    Oscar F.-
>
>

--- End Message ---
--- Begin Message ---
fre, 2002-10-11 kl. 20:11 skrev Jody Cleveland:

> Well, I installed openldap, and it tests out good. Now, I want to configure
> php to work with it. My question now is, where exactly is ldap located? I
> tried a few paths:
> ./configure --with-mysql --with-apxs2=/www/bin/apxs
> --with-ldap=/usr/local/etc/openldap
> ./configure --with-mysql --with-apxs2=/www/bin/apxs
> --with-ldap=/usr/local/libexec

> And, I get this error:
> checking for LDAP support... yes
> configure: error: Cannot find ldap.h

> So, I searched for ldap.h and used that path:
> ./configure --with-mysql --with-apxs2=/www/bin/apxs --with-ldap=/usr/include
> Same thing, cannot find.

> Any ideas?

Using LDAP needs specialist knowledge - you can't just bung it in and
expect it to work. You can't really compare it to SQL in that respect,
it's a niche - like PHP :-)

ftp://kalamazoolinux.org/pub/pdf/ldapv3.pdf
http://www.redbooks.ibm.com/pubs/pdfs/redbooks/sg244986.pdf
http://www.redbooks.ibm.com/pubs/pdfs/redbooks/sg245110.pdf

Best,

Tony

-- 

Tony Earnshaw

"There are many people who can't face the truth ... If you rob a
normal person of life's lies, at the same time you'll be robbing
him of his happiness."

>From Henrik Ibsen's "Vildanden", "The wild Duck."

e-post:         [EMAIL PROTECTED]
www:            http://www.billy.demon.nl




--- End Message ---
--- Begin Message ---
Tony's right on this one. 

1. Read all the instructions from the PHP documentation on setting up
LDAP. (From the last time i set this up you need to do some thing.)

2. After you have read that and then messed with it a while and you
still do not have all it working then you can post. (RTM).

3. Then you need to know how to run an LDAP server or you are going to
have a pain in the ass trying to connect and pulling data.  It took me
about 2 days to figure how to work with Exchange..

And do a search on how to configure PHP with extensions.  I have asked
this question more than once.  PHP's makefile search in specific
locations when configuring.


On Sat, 2002-10-12 at 14:50, Tony Earnshaw wrote:
> fre, 2002-10-11 kl. 20:11 skrev Jody Cleveland:
> 
> > Well, I installed openldap, and it tests out good. Now, I want to configure
> > php to work with it. My question now is, where exactly is ldap located? I
> > tried a few paths:
> > ./configure --with-mysql --with-apxs2=/www/bin/apxs
> > --with-ldap=/usr/local/etc/openldap
> > ./configure --with-mysql --with-apxs2=/www/bin/apxs
> > --with-ldap=/usr/local/libexec
> 
> > And, I get this error:
> > checking for LDAP support... yes
> > configure: error: Cannot find ldap.h
> 
> > So, I searched for ldap.h and used that path:
> > ./configure --with-mysql --with-apxs2=/www/bin/apxs --with-ldap=/usr/include
> > Same thing, cannot find.
> 
> > Any ideas?
> 
> Using LDAP needs specialist knowledge - you can't just bung it in and
> expect it to work. You can't really compare it to SQL in that respect,
> it's a niche - like PHP :-)
> 
> ftp://kalamazoolinux.org/pub/pdf/ldapv3.pdf
> http://www.redbooks.ibm.com/pubs/pdfs/redbooks/sg244986.pdf
> http://www.redbooks.ibm.com/pubs/pdfs/redbooks/sg245110.pdf
> 
> Best,
> 
> Tony
> 
> -- 
> 
> Tony Earnshaw
> 
> "There are many people who can't face the truth ... If you rob a
> normal person of life's lies, at the same time you'll be robbing
> him of his happiness."
> 
> >From Henrik Ibsen's "Vildanden", "The wild Duck."
> 
> e-post:               [EMAIL PROTECTED]
> www:          http://www.billy.demon.nl
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Thank you,

Ray Hunter


--- End Message ---
--- Begin Message ---
Hi!

Can anyone tell me if the getimagesize() function is supposed to work with
ftp-url's?
The PHP Manual states "URL support was added in PHP 4.0.5", but maby that is
supposed to mean http-url's only?

The following is an expample of how i would like to be able to use
getimagesize():

<?php
    $size =
getimagesize("ftp://user:[EMAIL PROTECTED]/pictures/image.jpg";);

    echo '<pre>';
    print_r($size);
    echo '</pre>';
?>

This code yields the following errors in my log:

[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(): php_hostconnect:
connect failed in getimagesize.php on line 2
[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(...): failed to create
stream: FTP server reports 227 Entering Passive Mode (194.236.xxx.xxx in
getimagesize.php on line 2

Is this a bug, or is it a missing feature, or maby a documentation issue?
I've tried it on a few different ftp-servers, so i don't think that is the
problem.. but who knows?

Any thoghts would be appreciated.

/OnionMan


--- End Message ---
--- Begin Message ---
getimagesize isn't remote.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Stefan Wessman" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Hi!
>
> Can anyone tell me if the getimagesize() function is supposed to work with
> ftp-url's?
> The PHP Manual states "URL support was added in PHP 4.0.5", but maby that
is
> supposed to mean http-url's only?
>
> The following is an expample of how i would like to be able to use
> getimagesize():
>
> <?php
>     $size =
> getimagesize("ftp://user:[EMAIL PROTECTED]/pictures/image.jpg";);
>
>     echo '<pre>';
>     print_r($size);
>     echo '</pre>';
> ?>
>
> This code yields the following errors in my log:
>
> [12-Oct-2002 23:32:14] PHP Warning:  getimagesize(): php_hostconnect:
> connect failed in getimagesize.php on line 2
> [12-Oct-2002 23:32:14] PHP Warning:  getimagesize(...): failed to create
> stream: FTP server reports 227 Entering Passive Mode (194.236.xxx.xxx in
> getimagesize.php on line 2
>
> Is this a bug, or is it a missing feature, or maby a documentation issue?
> I've tried it on a few different ftp-servers, so i don't think that is the
> problem.. but who knows?
>
> Any thoghts would be appreciated.
>
> /OnionMan
>
>


--- End Message ---
--- Begin Message ---
I remember I got these kinds of "errors" when I wanted to connect to a 
slow server, the last message was always something like "port command 
successfull", and that was it. Try connection to localhost, if that works?

Stefan Wessman wrote:

>Hi!
>
>Can anyone tell me if the getimagesize() function is supposed to work with
>ftp-url's?
>The PHP Manual states "URL support was added in PHP 4.0.5", but maby that is
>supposed to mean http-url's only?
>
>The following is an expample of how i would like to be able to use
>getimagesize():
>
><?php
>    $size =
>getimagesize("ftp://user:[EMAIL PROTECTED]/pictures/image.jpg";);
>
>    echo '<pre>';
>    print_r($size);
>    echo '</pre>';
>?>
>
>This code yields the following errors in my log:
>
>[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(): php_hostconnect:
>connect failed in getimagesize.php on line 2
>[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(...): failed to create
>stream: FTP server reports 227 Entering Passive Mode (194.236.xxx.xxx in
>getimagesize.php on line 2
>
>Is this a bug, or is it a missing feature, or maby a documentation issue?
>I've tried it on a few different ftp-servers, so i don't think that is the
>problem.. but who knows?
>
>Any thoghts would be appreciated.
>
>/OnionMan
>
>
>
>  
>

--- End Message ---
--- Begin Message ---
When doing a select query, is there any way to specify which rows you
want "selected", as in rows 1 through 40, and then 40 - 80 on the next
query.  I've been searching through the manual but can't find anything.
Should this be done through a php script instead, or is there a native
(mysql) command/clause for this?
--- End Message ---
--- Begin Message ---
Look at limit... eg Select * from xyz limit 1,5


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-----Original Message-----
From: Pablo Oliva [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, 13 October 2002 8:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] trying to get a certain num of rows in mysql


When doing a select query, is there any way to specify which rows you
want "selected", as in rows 1 through 40, and then 40 - 80 on the next
query.  I've been searching through the manual but can't find anything.
Should this be done through a php script instead, or is there a native
(mysql) command/clause for this?

--- End Message ---
--- Begin Message ---
Look for LIMIT in the manual

Pablo Oliva wrote:

>When doing a select query, is there any way to specify which rows you
>want "selected", as in rows 1 through 40, and then 40 - 80 on the next
>query.  I've been searching through the manual but can't find anything.
>Should this be done through a php script instead, or is there a native
>(mysql) command/clause for this?
>
>  
>

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



I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with

configure --with-java --with-apxs=/usr/local/apache/bin/apx

It's running with Apache 1.3.26

PHP work ok, even Java works, but if I try to pass variables from a form 
with either POST or GET, the variables don't get through.  This is the code 
I'm using:

index.html:
...
<form action="php.php" method="post">
     Name: <input type="text" name="name"><br>
      <input type="submit">
  </form>
...

php.php:

<?php
echo "*";
echo $name;
echo "*";
?>

The variable $name is always empty.  I tried this same scripts on the RPM 
version installed with Mandrake 7.2 and it worked fine, so it shouldn't be 
the scripts.  What could be wrong? Maybe I missed a ./configure option?

Thanks in advance,


Andres



_________________________________________________________________
Únase al mayor servicio mundial de correo electrónico: 
http://www.hotmail.com/es

--- End Message ---

Reply via email to