php-general Digest 15 Apr 2001 05:42:17 -0000 Issue 628

Topics (messages 48556 through 48618):

Re: W2K Install Problem
        48556 by: Long Lam

Javascript in a header
        48557 by: Dan Harrington

strange error
        48558 by: n e t b r a i n
        48560 by: Phil Driscoll

Re: PHP & MySQL Search Results
        48559 by: Jason Caldwell

Re: Do any of you provide hosting?
        48561 by: Manuel Lemos

Using gnupg with php - errors
        48562 by: sohara.sohara.com

Re: PHP without a webserver
        48563 by: Brian Clark
        48566 by: Jeroen Wesbeek
        48568 by: Les Neste
        48570 by: Plutarck
        48573 by: Brian Clark
        48575 by: Plutarck
        48584 by: Brian Clark
        48591 by: Plutarck
        48616 by: Markus Fischer

Supplied argument is not a valid MS SQL-Link resource
        48564 by: davek
        48571 by: Plutarck
        48572 by: Brian Clark

Re: HTML and PHP?
        48565 by: Brian Clark
        48567 by: Les Neste
        48579 by: Brian Clark
        48592 by: Jason Caldwell

Red Hat 7.0
        48569 by: Mauricio Junqueira

Re: user info?
        48574 by: Brian Clark

Re: Any one have PHP voteBOOTH source code...?!?
        48576 by: Brian Clark

Re: Forcing Case
        48577 by: Brian Clark

Re: antifraud logic for voting poll, banner clicks
        48578 by: Brian Clark

A tricky problem
        48580 by: David Tandberg-Johansen
        48585 by: Brian Clark

R: [PHP] CLASSES AND OBJECTS..
        48581 by: alberto

What's XML's Purpose??
        48582 by: Chris Anderson
        48586 by: Brian Clark
        48588 by: Chris Anderson
        48589 by: Brian Clark
        48590 by: Plutarck
        48593 by: phpman
        48594 by: Jason Caldwell
        48600 by: Michael Kimsal
        48618 by: Plutarck

Re: Selected Radio Buttons
        48583 by: Jordan Elver

setuid
        48587 by: Ulysses Almeida

Re: Extract from string
        48595 by: Steve Edberg

Secure Sockets
        48596 by: phpman

2 Different Mysql Server Connection Problem
        48597 by: Mesut TUNGA
        48605 by: Brian Clark

Sorry :(
        48598 by: Chris Anderson
        48599 by: Richard
        48603 by: Brian Clark
        48604 by: Chris Anderson

Re: Extract from string, version 2.0
        48601 by: Steve Edberg

next release?
        48602 by: Michael Kimsal

Re: session
        48606 by: Yasuo Ohgaki

converting DATETIME to a readable date.
        48607 by: DRN
        48608 by: Brian Clark
        48611 by: Chris Adams
        48612 by: DRN

Display Formatted Query Results
        48609 by: Jeff Holzfaster
        48610 by: Brian Clark
        48614 by: Jeff Holzfaster
        48615 by: Jeff Holzfaster

Re: Extract from string, version 3.0
        48613 by: Steve Edberg

limiting page for printing
        48617 by: Fabian Fabela

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]


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


Win2k's command prompt is located under the start 
button/programs/accessories/command prompt.


At 09:53 AM 4/14/2001 -0500, Jeff Oien wrote:
>I got it to work. I would still like to know how to open a command
>window in W2K though.
>
>I had a reference to d:/php4/ instead of d:/php/ which is where I
>have it.
>Jeff Oien
>
> > When I try to run a PHP script through a Web browser it just
> > displays the code. I did a clean install of W2K and installed
> > Apache. I copied the php.ini to the WINNT and system folders.
> > Not sure where to go from here.
> >
> > BTW how do you open a command window in W2K? Thanks.
> > Jeff Oien
> >
> > --
> > 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,
Am I brain damaged or will something like this work?

header("Location:javascript:window.open('http://login.php?arg1&arg2','','windowname')");

I want to popup a login script in a sub-browser window, and then pass
the results back to the main window.  Someone told me that the javascript
in the header would work but so far it won't.

However, that javascript typed into the browser "location" field
does work as  I want it to.

ideas?
Thanks
Dan






Hi all,
I don't know why this (quick & dirty) small function:

function esiste_url($file){
        @$fp=fopen($file,"r");
        if(!$fp){return false;}else{return true;}
        @fclose($fp);
}
//it checks if a url submit via form client exist

in two different pages:

a.php3 ---> works fine
b.php3 ---> produce an Internal Error Server

In both file, it's used like this:
if(esiste_url($url)==false){ etc. etc.

I'm sure (?!) that in b.php3 the error is due to this function 'cause w/o
it, the page b.php3 works fine ...

(I'm on linux box,apache,php3)

Any ideas??
Many thanks in advance
max





It may not be responsible for the error, but you ought to move your fclose
to before your return(true) statement, as it never gets executed at all in
your code.

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





Hi Jason,

Say you have a search form that says search for "searchbox" and the search
box has a variable name of "search":

<?

/* Include connection details, with a variable of $connection */

if (!$page) {
    $page = 1;
}

$limit = $page * 25;
$limit = $limit - 25;

$sql = "SELECT FROM table WHERE searchdata LIKE '$search' ORDER BY
searchdata DESC LIMIT $limit,25";

$result = @mysql_query($sql, $connection)
    or die (mysql_error());

$num = mysql_num_rows($result);

if ($num == 0) {

?>

NO Valid search results.

<?

} else {

    while($row = mysql_fetch_array($result)) {
        $url = $row['url'];
        $name = $row['name'];

?>

<a href="<? echo "$url"; ?>"><? echo "$name"; ?><BR>

<? }

if ($page > 1) {
echo "<a
href=\"search.php?search=".$search."&page=".(page -1)."\">Previous</a>";
}

if (($num > 25) && (($limit + 25) < $num)) {
echo "<a href=\"search.php?search=".$search."&page=".($page +
1)."\">Next</a>.";
}

/* End the initial "Else" */
}

?>


__________________________________________

Here you will see that if no page is assigend as a variable, it is force
assigned to 1.  The limit is the number of results the search is limited to.
If you do some mathematics (ouch) you will see that the limit works like
this:

if the page is equal to 1:
limit is 1 * 25 = 25.
limit = 25 - 25 = 0

The limit in the sql query limits 0,25 (first 25 matches).

if the page is equal to 2:
limit is 2 * 25 = 50
limit is 50 - 25 = 25

The limit in the sql query limits 25,25 (25 matches After the first 25
matches).

if the page is equal to 3:
limit is 3 * 25 = 75
limit = 75 - 50

The limit in the sql query is 50,25 (next 25 matches after the first 50).


Now, towards the bottom of the code I have supplied, I have next and
previous links:

if page is greater than 1, you can show a link to a previous page:
search.php?search=".$search."&page=".($page - 1)

This links back to the search page with the searchg criteria, and the page -
1.

if there are more than 25 results ($num) and the (limit + 25) is less than
the total number of pages, we can add a next link.

If you wanted to add page numbers as links, you could do a while or for
loop, but I'd have to use my brain a little more to try and explain that to
you.

I hope that makes a little sense, I'm not very good at explaining these
things.  There's a really good tutorial on this at devshed.com

James.






Hello Chris,

On 12-Apr-01 14:05:38, you wrote:


>I currently am using Thehostpros.com for my hosting, but I can't say its been
>a pleasant experience. I had to have them install PHP because they are more
>ASP oriented. So that cost me more. Then I wanted MySQL and they have spent 3
>months saying they'll install that. Basicly here's what I need: Someone who
>can host my domain (I own the domain already) Can provide MySQL and PHP. Both
>up-to-date. Can give around 60 meg of space (ballpark, less should be fine)
>Also a way to set up subdomains without needing to go through the admin (some
>hosts can do his). But this isn't necessary. Can anyone help with that?

For about 3 years I have been hosting my sites at my ISP (
http://phphosting.adgrafix.com/ ) mostly because it provides flexibility
like what you and more.  One of my sites is the popular PHP Classes site
that has now over 30.000 subscribers ( http://phpclasses.UpperDesign.com/ ).

If I need I can ask for human support, but most things like sub-domain and
e-mail account creation (extra subdomains and e-mail accounts are free) can
be configured on demand via a Web interface (give it a try in the address
above).

Even though I am on a virtual server, I can have the database servers I
want provided there is enough space and, except for dedicated servers, it
doesn't require a root account to install the software.

So, in my virtual server account I have a MySQL server, a PostgreSQL
server and a CVS server.  I even had a IRC server although I am not using
it.

I also have PHP and Apache compiled with modules and extensions I need
because I can choose what I want.

To keep all my sites automatic I even have access to my account crontab to
execute periodic operations or verify if all the servers are working ok.

I also have telnet/ssh account access so I can configure things on my own
when I want, but the good part is that when you need help or don't have the
time and patience to do it by yourself, my account manager can do it for
me.  He is very skilled and quick to assist me.

He doesn't work for the hosting company.  He just gets a commission from
them.  So it is in the best of his interest to serve me and other clients
well.  If you are interested in get such 5 stars support service, just mail
me back and I'll orient you to sign-in making sure you get my account
manager as yours too.

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





Hello all,

This has been covered before, but I can't get it to work and I've searched 
all the archives already.

I am trying to encrypt a small string of data. I am using a script by 
Richard Lynch as my starting point. I found it here:
http://www.weberdev.com/get_example.php3?count=1379

Now, I am on MacOSX trying to get this thing to work. I installed an OSX 
version of gnupg 1.04, without any problems, and created to sets of keys. 
My idea is to get this to work on my local machine first, then eventually 
get it to work on my web hosting account.

Here is the code I am using:

>       putenv("HOME=/Users/sohara/");
>       
> // Explanation follows...
> $command = "echo '$data' | /usr/local/bin/gpg -a --batch 
> --no-secmem-warning -e -u '[EMAIL PROTECTED]' -r 'alien8@alien8recordings.
> com'" ;
>       
>       // Actually execute the command
>       $result = exec($command, $encrypted, $errorcode);
>
>       if ($errorcode)
>               {
>               echo "Error $errorcode encrypting your data.<br>\n";
>               exit;
>               }
>
>       $encrypteddata = implode("\n", $encrypted);
        echo "This is the encrypted data:<br> $encrypted \n";

And this always gives returns an error number 2. I can't find a list of 
error numbers at gnupg, so the error number isn't very helpful so far. 
Does anyone know about the gnupg error numbers, or just using gnupg with 
php?

Thanks,
Sean




Hi Plutarck,

@ 11:37:09 AM on 4/14/2001, Plutarck wrote:

> I've heard much about how PHP is far more than just a language for
> web programming, and I agree. I agree enough that I would like to
> actually try it. I'd like to use PHP scripting in a C/C++ program
> that doesn't need a webserver as an intermediary.

It doesn't. You don't have to have a web server installed in order to
use PHP.

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






well actually you could compile php4
on it's own so you get a php executable which
you can use as an interpreter for php4 scripts...
no webserver needed


dowebwedo
Jeroen Wesbeek
.programming
Nieuwekade 213 | 3511 RW Utrecht
The Netherlands
p 030 2380544 | f 020 8632045


[roses are red, violets are blue,
         I am schizophrenic and so am I ]


-----Original Message-----
From: Brian Clark [mailto:[EMAIL PROTECTED]]
Sent: zaterdag 14 april 2001 19:53
To: PHP is not a drug.
Subject: Re: [PHP] PHP without a webserver


Hi Plutarck,

@ 11:37:09 AM on 4/14/2001, Plutarck wrote:

> I've heard much about how PHP is far more than just a language for
> web programming, and I agree. I agree enough that I would like to
> actually try it. I'd like to use PHP scripting in a C/C++ program
> that doesn't need a webserver as an intermediary.

It doesn't. You don't have to have a web server installed in order to
use PHP.

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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Can anybody comment on PHPTriad?  This appears to be PHP+MySQL+Apache for
the Windows desktop.  

At 07:51 PM 4/14/2001 +0200, Jeroen Wesbeek wrote:
>well actually you could compile php4
>on it's own so you get a php executable which
>you can use as an interpreter for php4 scripts...
>no webserver needed
>
>
>dowebwedo
>Jeroen Wesbeek
>.programming
>Nieuwekade 213 | 3511 RW Utrecht
>The Netherlands
>p 030 2380544 | f 020 8632045
>
>
>[roses are red, violets are blue,
>         I am schizophrenic and so am I ]
>
>
>-----Original Message-----
>From: Brian Clark [mailto:[EMAIL PROTECTED]]
>Sent: zaterdag 14 april 2001 19:53
>To: PHP is not a drug.
>Subject: Re: [PHP] PHP without a webserver
>
>
>Hi Plutarck,
>
>@ 11:37:09 AM on 4/14/2001, Plutarck wrote:
>
>> I've heard much about how PHP is far more than just a language for
>> web programming, and I agree. I agree enough that I would like to
>> actually try it. I'd like to use PHP scripting in a C/C++ program
>> that doesn't need a webserver as an intermediary.
>
>It doesn't. You don't have to have a web server installed in order to
>use PHP.
>
>-Brian
>--
> PGP is spoken here: 0xE4D0C7C8
> Please do not carbon copy me on list replies.
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>-- 
>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]
>
>

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




Ah, even better. However, how would the script be passed to PHP? As a
command line argument?


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


"Jeroen Wesbeek" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> well actually you could compile php4
> on it's own so you get a php executable which
> you can use as an interpreter for php4 scripts...
> no webserver needed
>
>
> dowebwedo
> Jeroen Wesbeek
> .programming
> Nieuwekade 213 | 3511 RW Utrecht
> The Netherlands
> p 030 2380544 | f 020 8632045
>
>
> [roses are red, violets are blue,
>          I am schizophrenic and so am I ]
>
>
> -----Original Message-----
> From: Brian Clark [mailto:[EMAIL PROTECTED]]
> Sent: zaterdag 14 april 2001 19:53
> To: PHP is not a drug.
> Subject: Re: [PHP] PHP without a webserver
>
>
> Hi Plutarck,
>
> @ 11:37:09 AM on 4/14/2001, Plutarck wrote:
>
> > I've heard much about how PHP is far more than just a language for
> > web programming, and I agree. I agree enough that I would like to
> > actually try it. I'd like to use PHP scripting in a C/C++ program
> > that doesn't need a webserver as an intermediary.
>
> It doesn't. You don't have to have a web server installed in order to
> use PHP.
>
> -Brian
> --
>  PGP is spoken here: 0xE4D0C7C8
>  Please do not carbon copy me on list replies.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> 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 Plutarck,

@ 2:11:35 PM on 4/14/2001, Plutarck wrote:

> Ah, even better. However, how would the script be passed to PHP? As
> a command line argument?

Install the CGI executable of PHP in c:\php

In your autoexec.bat:

SET PATH=c:\php;%PATH%

Reboot.

>From the command line:

php -q script.php

And read about $argc and $argv. If you're familiar with C, those
shouldn't be a problem.

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






Ahh, so it's the location of the script that get's passed.

Now, if the script was coming from a program, is there a way to hand the
file directly to PHP, or will a temporary file have to be used?

So if a user filled in a form and clicked a button in the program, the
program would toy with the form a little, then send the form to PHP. Is that
possible using the CGI executible?


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


"Brian Clark" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Plutarck,
>
> @ 2:11:35 PM on 4/14/2001, Plutarck wrote:
>
> > Ah, even better. However, how would the script be passed to PHP? As
> > a command line argument?
>
> Install the CGI executable of PHP in c:\php
>
> In your autoexec.bat:
>
> SET PATH=c:\php;%PATH%
>
> Reboot.
>
> From the command line:
>
> php -q script.php
>
> And read about $argc and $argv. If you're familiar with C, those
> shouldn't be a problem.
>
> -Brian
> --
>  PGP is spoken here: 0xE4D0C7C8
>  Please, DO NOT carbon copy me on list replies.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Hi Plutarck,

@ 2:40:28 PM on 4/14/2001, Plutarck wrote:

> Ahh, so it's the location of the script that get's passed.

Yes:

% cat test.php
<?php

while(list($i,$arg) = each($argv))
{
  print "$i: $arg\n";
}

?>

% php -q test.php a b c d e f g
0: test.php
1: a
2: b
3: c
4: d
5: e
6: f
7: g
%

> Now, if the script was coming from a program, is there a way to hand the
> file directly to PHP, or will a temporary file have to be used?

I have no idea. What language? Using system() in C and Perl, I'm
sure you could concoct something. Why would you want to do that?

> So if a user filled in a form and clicked a button in the program, the
> program would toy with the form a little, then send the form to PHP. Is that
> possible using the CGI executible?

I have no idea what you're talking about here, but if you're wanting
to build some type of GUI based application you might as well either
use PHP-GTK (http://gtk.php.net) or just use a HTML, PHP and a web
server.

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






Btw, thanks for all your answers to far ;)

> I have no idea. What language? Using system() in C and Perl, I'm
> sure you could concoct something. Why would you want to do that?


A move recently being made by game programmers has been to move an
increasing amount of work into a scripting engine. My idea is to jump ahead
of the slow move, so that the program is far more abstracted.

The program, written in C/C++ (or Java, or any language really), is
basically turned into a dumb bot. It's a mindless intermediary. The outer
layer is the Display Engine, which could be a Quake Engine or an MFC style
GUI, which takes all of it's commands from the intermediary layer.

The final layer is the scripting engine. In the script if a move_elevator()
function is called, the script interpreter bundles up some commands and
passes it over to the intermediary layer. The intermediary looks at the
display engine, figures out what commands must be called to fufill the
wishes of the script, and passes over the commands.

This would allow the vast majority of the real "content" of a game or
application to be written in a scripting language, much like web apps are
now. The script would run just as well on Linux as it would on windows.

The intermediary understands the universally written script, and figures out
how to actually do what the script asks it to. So an entire application
could be written to run using OpenGL, DirectX, and a selection of different
engines. So you could switch from using a Quake engine to a Midtown Madness
engine for maximum effectiveness, only by tweaking the intermediary level.
Since there are only so many ways to "rotate camera", code could be reused
to the point that the intermediary level comes packaged with all it needs to
know. And thus the sheer amount of people who have the ability to run such
applications skyrockets.


The creators of the Dark Forces star wars game (correct name?) created a
specific programming language for doing things like moving elevators,
dialog, etc. Now adays everyone has their own script.

Asheron's Call has their own little internal quest scripting, and Ever Quest
made their own, Doom has one, Daggerfall has some, et al. But why go to the
trouble of making a whole stinking language, reinventing the wheel, when
thousands of people have spent years to develop a versitile and extensible
scripting engine in PHP?


Anyway, that's my idea. I'd just be happy to outsource some of my C++ work
to PHP. If I use MFC, goodbye platform independence. If I don't use it, it's
a huge pain in the butt to do heavy string manipulation. So I figure, why
not just have PHP do it, since I already know the language?



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



"Brian Clark" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Plutarck,
>
> @ 2:40:28 PM on 4/14/2001, Plutarck wrote:
>
> > Ahh, so it's the location of the script that get's passed.
>
> Yes:
>
> % cat test.php
> <?php
>
> while(list($i,$arg) = each($argv))
> {
>   print "$i: $arg\n";
> }
>
> ?>
>
> % php -q test.php a b c d e f g
> 0: test.php
> 1: a
> 2: b
> 3: c
> 4: d
> 5: e
> 6: f
> 7: g
> %
>
> > Now, if the script was coming from a program, is there a way to hand the
> > file directly to PHP, or will a temporary file have to be used?
>
> I have no idea. What language? Using system() in C and Perl, I'm
> sure you could concoct something. Why would you want to do that?
>
> > So if a user filled in a form and clicked a button in the program, the
> > program would toy with the form a little, then send the form to PHP. Is
that
> > possible using the CGI executible?
>
> I have no idea what you're talking about here, but if you're wanting
> to build some type of GUI based application you might as well either
> use PHP-GTK (http://gtk.php.net) or just use a HTML, PHP and a web
> server.
>
> -Brian
> --
>  PGP is spoken here: 0xE4D0C7C8
>  Please, DO NOT carbon copy me on list replies.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






On Sat, Apr 14, 2001 at 03:34:32PM -0500, Plutarck wrote : 
> The final layer is the scripting engine. In the script if a move_elevator()
[...]
> This would allow the vast majority of the real "content" of a game or
> application to be written in a scripting language, much like web apps are
> now. The script would run just as well on Linux as it would on windows.
[...]

This is not only true since now or since quake but also sicne the
early days of Sierra On-Line games / Lucasmfilm Games. All their
games were built on a particular Scripting Engine. For Lucasfilm,
this was SCUMM[tm] and for Sierra it was SCI (Sierra Creative
Interpreter).

This is why those games also run nowadays on Linux (see
http://freesci.linuxgames.com/ ).
Ok now this is hell Offtopic ;-)


But, yes, gtk+ rocks.

And, for me, I removed perl and also use now PHP as my day to day
scripting language. Its behaviour of hashes is much more
intuitive for me than perl's way (every used nested hashes ?
you're getting crazy doing so :). But, after all maybe i'm just
too dump for perl then. But hey its ok :) I've much joy and fun
working with PHP :-)


cheers,

        Markus




Does anybody know how to fix this error?  "Supplied argument is not a valid
MS SQL-Link resource"  I am running:

NT4
MSSQL7.0
IIS4
PHP 4.0.4pl1

I've been running php3 for some time now without any problems but want to
upgrade to 4.  This error seems to be occuring at the mssql_query()
function.

$Conn=mssql_connect('192.168.1.20','username','password');
$ThisConnect=mssql_select_db('My_Database',$Conn);
$QueryString="select id, name from my_table";
$Test=mssql_query($QueryString, $ThisConnect);

Please help! Thanks.
Dave










http://us.php.net/manual/en/function.mssql-select-db.php

*_select_db does not return a connection id, it returns true or false.

Just change your script like this:

$Conn=mssql_connect('192.168.1.20','username','password');
mssql_select_db('My_Database',$Conn);
$QueryString="select id, name from my_table";
$Test=mssql_query($QueryString, $Conn);


That should work just fine.


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




""davek"" <[EMAIL PROTECTED]> wrote in message
9ba2po$jnb$[EMAIL PROTECTED]">news:9ba2po$jnb$[EMAIL PROTECTED]...
> Does anybody know how to fix this error?  "Supplied argument is not a
valid
> MS SQL-Link resource"  I am running:
>
> NT4
> MSSQL7.0
> IIS4
> PHP 4.0.4pl1
>
> I've been running php3 for some time now without any problems but want to
> upgrade to 4.  This error seems to be occuring at the mssql_query()
> function.
>
> $Conn=mssql_connect('192.168.1.20','username','password');
> $ThisConnect=mssql_select_db('My_Database',$Conn);
> $QueryString="select id, name from my_table";
> $Test=mssql_query($QueryString, $ThisConnect);
>
> Please help! Thanks.
> Dave
>
>
>
>
>
>
>
> --
> 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 davek,

@ 1:50:14 PM on 4/14/2001, davek wrote:

> Does anybody know how to fix this error? "Supplied argument is not a
> valid MS SQL-Link resource" I am running:

...
> $Conn=mssql_connect('192.168.1.20','username','password')

or die("Could not connect to the mssql server");

> $ThisConnect=mssql_select_db('My_Database',$Conn)

or die("Could not select My_Database");

> $QueryString="select id, name from my_table";
> $Test=mssql_query($QueryString, $ThisConnect)

or die("Could query mssql server");

> Please help! Thanks.
> Dave


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






Hi Steve,

@ 11:34:26 PM on 4/13/2001, Steve Werby wrote:

...
> <?
> echo <<<STOP

> <html>
> Yes, echo can use here-docs!  Is it really that *hard* to take 1 minute to
> test for yourself? ;-)
> And you can use whatever marker (the 'STOP' above and below) you choose.
> Just make sure you don't indent the closing marker or the parser will miss
> it!
> </html>

> STOP;
?>>

Why even bother? Why not just do this?

?>

<html>
  Boo
</html>

<?php

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






I think the echo approach is pretty handy if you want a subroutine to spit
out a common chunk of HTML which is less than an entire page.  And the
here-doc marker lets you just paste existing HTML in place without having
to escape all the quotation marks.  To me, this is a Good Thing.

At 01:56 PM 4/14/2001 -0400, Brian Clark wrote:
>Hi Steve,
>
>@ 11:34:26 PM on 4/13/2001, Steve Werby wrote:
>
>...
>> <?
>> echo <<<STOP
>
>> <html>
>> Yes, echo can use here-docs!  Is it really that *hard* to take 1 minute to
>> test for yourself? ;-)
>> And you can use whatever marker (the 'STOP' above and below) you choose.
>> Just make sure you don't indent the closing marker or the parser will miss
>> it!
>> </html>
>
>> STOP;
>?>>
>
>Why even bother? Why not just do this?
>
>?>
>
><html>
>  Boo
></html>
>
><?php
>
>-Brian
>--
> PGP is spoken here: 0xE4D0C7C8
> Please do not carbon copy me on list replies.
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>

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




Hi Les,

@ 2:09:01 PM on 4/14/2001, Les Neste wrote:

> I think the echo approach is pretty handy if you want a subroutine
> to spit out a common chunk of HTML which is less than an entire
> page. And the here-doc marker lets you just paste existing HTML in
> place without having to escape all the quotation marks. To me, this
> is a Good Thing.

And you can do the exact same thing with what I posted.

<?php

function foo()
{
   ?>
   bar. didn't "example.com" ain't aren't
   <?php
}


foo();

?>

Granted, one wouldn't bother when only one string needed to be
printed, but it works just fine for large amounts of HTML.

If you needed to interpolate variables, then you'd probably want to
print(), echo() or use here-doc.

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






> > Just make sure you don't indent the closing marker or the parser will
miss
> > it!

YES!! -- I struggled with that one for a long time... (at least a couple of
hours, before I said, hmmm... let me [for giggles] remove the TABS before
the closing marker... -- bam... Parser Error went away...)

FYI to other readers: you can indent (or Tab) the leading marker, but the
trailing maker cannot have tabs infront of it.

for example

<?

        print <<<SOMESTUFF     // leading marker

        here is a line of text and HTML
        <html>
        <head>

SOMESTUFF;     // notice no tabs here on the end marker "SOMESTUFF"

?>

Jason


"Brian Clark" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Steve,
>
> @ 11:34:26 PM on 4/13/2001, Steve Werby wrote:
>
> ...
> > <?
> > echo <<<STOP
>
> > <html>
> > Yes, echo can use here-docs!  Is it really that *hard* to take 1 minute
to
> > test for yourself? ;-)
> > And you can use whatever marker (the 'STOP' above and below) you choose.
> > Just make sure you don't indent the closing marker or the parser will
miss
> > it!
> > </html>
>
> > STOP;
> ?>>
>
> Why even bother? Why not just do this?
>
> ?>
>
> <html>
>   Boo
> </html>
>
> <?php
>
> -Brian
> --
>  PGP is spoken here: 0xE4D0C7C8
>  Please do not carbon copy me on list replies.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






I am trying to start the server and it returns the following in the
interbase.log.

ns1.mautec.com (Client) Sat Apr 14 22:06:05 2001
        INET/inet_error: connect errno = 111
 
ns1.mautec.com (Client) Sat Apr 14 22:06:05 2001
        /opt/interbase/bin/ibguard: guardian starting bin/ibserver
 
 
ns1.mautec.com (Client) Sat Apr 14 22:06:20 2001
        INET/inet_error: read errno = 104
 
ns1.mautec.com (Client) Sat Apr 14 22:06:20 2001
        INET/inet_error: receive in try_connect errno = 104
 
ns1.mautec.com (Client) Sat Apr 14 22:06:20 2001
        /opt/interbase/bin/ibguard: bin/ibserver normal shutdown.

I have been using interbase super server before but in the
SuSe 7.1 with 2.2.18 without any problems.

I have tried the rpm and the tar installation with the
same results...

Can anyone help me out?




Hi Ramiro,

@ 6:48:38 AM on 4/14/2001, Ramiro Radjiman wrote:

...
> I'm just wondering if there is a method to extract user specific
> info when this user connects to the site.

http://www.php.net/manual/nl/function.getenv.php

May be what you're looking for.

> U user must have a handle, but i don't want him to login. So i
> thaught if i can get specific userinfo from the client, this info
> would be his handle to walk trough the site.

> If he logs in it aint a problem :-)

I'd use sessions:

http://www.php.net/manual/nl/ref.session.php

Because you can't depend on something like IP addresses or hostnames
to build Unique IDs because of things like proxies. And I wouldn't
depend solely on cookies either.

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







@ 6:50:49 AM on 4/14/2001, news.php.net wrote:

> hello... anyone know where i can downlaod voteBOOTH.php w/ the image
> viewer....?! or does anyone have it that you can send to me..?

I don't know anything about a poll type script with an image viewer,
but look around here:

http://www.hotscripts.com/

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






Hi James,

@ 6:44:08 AM on 4/14/2001, James Moore wrote:

...
> http://www.php.net/manual/en/function.strtoupper.php
> http://www.php.net/manual/en/function.strtolower.php
> http://www.php.net/manual/en/function.ucfirst.php

Another extremely useful one is ucwords()

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

:)

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






Hi Keyur,

@ 2:57:56 AM on 4/14/2001, Keyur Kalaria wrote:

...
> Can anyone suggest me how to avoid the fraud rating and fraud banner clicks.
> What all things we need to take care for the same etc.

Have a look at how those are implemented in phpAds and phpPolls:

http://www.phpwizard.net/

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






This is maybe of topic, but I try.

I have this site where the user first selects a langueage, and then i use
session_register() to register the information.
Then I use the the registered onformatin to dispaly the site text in the
user selected language.

The user put the selected things in a temp TABLE and when they are finnished
the info in the temp TABLE transfere over to a real TABLE. This isn't the
problem

The problem is:
If a user leaves the site because the user doesn't want to go thrue with the
order, or if the user closes the broser, then the recods of the selected
info are still in the temp TABLE. How can I delete this info when the user
leaves or close the browser?

Thanks!

David






Hi David,

@ 3:06:19 PM on 4/14/2001, David Tandberg-Johansen wrote:

...
> The problem is:
> If a user leaves the site because the user doesn't want to go thrue with the
> order, or if the user closes the broser, then the recods of the selected
> info are still in the temp TABLE. How can I delete this info when the user
> leaves or close the browser?

You don't. Just store the age of the session (date,time,whatever) in
the table along with the other information. Then, when someone visits
the site, the dates are checked in the table and the old entries are
cleared.

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






Yes...
Becouse in some large projects, it's very hard to wok with a single level
inheritance...
i think that PHP is a very good language and come better every day... so i
hope in the future programmers can use multiple inheritante with classes in
PHP.

Thank for the answer
Alberto


"Plutarck" <[EMAIL PROTECTED]> wrote in message
9b9ih0$81h$[EMAIL PROTECTED]
> Nope, I'm afraid not.
>
> Currently PHP will support single level inheritance only. So A can extend
B,
> but C cannot extend B. You will need to create a class of B to extend it
> with C.
>
> I suppose PHP may one day support it, but I am guessing that the Zend API
> can't currently handle it. I think it will need to be retooled.
>
>
> Sounds like a nice thing to shoot for for PHP5, perhaps?
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
> ""alberto"" <[EMAIL PROTECTED]> wrote in message
> 9b9eu7$s6n$[EMAIL PROTECTED]">news:9b9eu7$s6n$[EMAIL PROTECTED]...
> > Anyone know if one day PHP will support multiple inheritance?
> > I think it's very important...
> >
> > For example, will PHP support this code:
> >
> > class A extends B,  extends C   {
> > ....
> > }
> >
> > where B and C are classes?
> >
> > Thanks!
> > Alberto
> >
> >
> >
> > --
> > 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]
>






Alright I'll start this out by saying I have a subscription to "Visual Basic 
Programmers Journal". Before I converted and realized that I loved PHP so much I used 
ASP. Well it seems that in this magazine that XML is a hot topic in the MS world. I 
know XML can be used by PHP, but is there a point? I only know 2 things about it:
1) You can make your own tags:
            <mytag>    </mytag>
2) It's supposedly good for databasing?

If its for databasing, why not just use MySQL( or a variation). Am I missing something 
here?




Hi Chris,

@ 12:01:45 AM on 4/14/2001, Chris Anderson wrote:

> Am I missing something here?

This has been discussed many times. There was an extremely long thread
last year about XML, but I can't find it in the archives.

Here's a good start:

http://marc.theaimsgroup.com/?l=php-general&m=97969195010857&w=2

Use the 'next in thread' link to follow the thread.

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






thanks that helped
I stll think it sounds like its more geared for the MS crowd
----- Original Message ----- 
From: "Brian Clark" <[EMAIL PROTECTED]>
To: "PHP is not a drug." <[EMAIL PROTECTED]>
Sent: Saturday, April 14, 2001 3:29 PM
Subject: Re: [PHP] What's XML's Purpose??


> Hi Chris,
> 
> @ 12:01:45 AM on 4/14/2001, Chris Anderson wrote:
> 
> > Am I missing something here?
> 
> This has been discussed many times. There was an extremely long thread
> last year about XML, but I can't find it in the archives.
> 
> Here's a good start:
> 
> http://marc.theaimsgroup.com/?l=php-general&m=97969195010857&w=2
> 
> Use the 'next in thread' link to follow the thread.
> 
> -Brian
> --
>  PGP is spoken here: 0xE4D0C7C8
>  Please, DO NOT carbon copy me on list replies.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





Hi Chris,

@ 1:17:25 PM on 4/14/2001, Chris Anderson wrote:

...
> I stll think it sounds like its more geared for the MS crowd

No way.

"XML is a set of rules, guidelines, conventions, whatever you want to
call them, for designing text formats for such data, in a way that
produces files that are easy to generate and read (by a computer),
that are unambiguous, and that avoid common pitfalls, such as lack of
extensibility, lack of support for internationalization/localization,
and platform-dependency."

http://www.w3.org/XML/


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






I use to be really enthusiastically pro-XML just as I was getting into PHP,
but now I've basically taken a "XML shmexXML" approach. I get the initial
attraction, but I would think the love would fade off a bit.

The key that so many people seem to forget is the best way to do HTML is
with, *gasp*, HTML!

If you just want a webpage, XML is using a canon to kill a fly. It's like
creating classes and objects in PHP for sending text emails.

Sure you can do it...but why?

XML is new. Common society doesn't do well with new. They always manage to
screw it up somehow.

XML started as an extensible markup language...that's it. That's all it was
supposed to do! Now people are using it to query databases, and concoct
entire search engines, and they are trying to use it to control access to
restricted data, etc etc.

It's the same thing that happened with Java. People just aren't good with
"new".


XML is nice, and for some things it's even great. But it's not the death of
plain old HTML, just like ISDN didn't kill POTS (remember when ISDN was "the
future of telecom"?).

I fear that there are too many cooks in the kitchen on XML, all with a
seasoning all their own that they are dead set on adding to the broth.


But for me, I say let people play with their Java and XML and new fangled
widgets. I'll take my PHP and plain-old HTML, and I'll create twice as much
material with just as high a quality, and I won't need to spend an extra
minute learning a bleeding-edge technology.

Life's too short to spend it learning how to live it. Translation: Better to
program than to learn yet _another_ language.


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


""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message
002001c0c506$c70d7f00$0d1012d1@null">news:002001c0c506$c70d7f00$0d1012d1@null...
> thanks that helped
> I stll think it sounds like its more geared for the MS crowd
> ----- Original Message -----
> From: "Brian Clark" <[EMAIL PROTECTED]>
> To: "PHP is not a drug." <[EMAIL PROTECTED]>
> Sent: Saturday, April 14, 2001 3:29 PM
> Subject: Re: [PHP] What's XML's Purpose??
>
>
> > Hi Chris,
> >
> > @ 12:01:45 AM on 4/14/2001, Chris Anderson wrote:
> >
> > > Am I missing something here?
> >
> > This has been discussed many times. There was an extremely long thread
> > last year about XML, but I can't find it in the archives.
> >
> > Here's a good start:
> >
> > http://marc.theaimsgroup.com/?l=php-general&m=97969195010857&w=2
> >
> > Use the 'next in thread' link to follow the thread.
> >
> > -Brian
> > --
> >  PGP is spoken here: 0xE4D0C7C8
> >  Please, DO NOT carbon copy me on list replies.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






hold on here,
XML and HTML have, as far as I'm concerned, nothing to do with each other.
I'm using XML to link databases
on the sites I write (with PHP) with disparate databases on other Inernet
servers. A good example would be linking
up with UPS's online rates application server. I send an XML request with
shipment info and get a response XML
file with the pricing, time to delivery, etc..

The tags just tell you what the info between them is. XML is awesome, and
will become very big in the next couple years. You can write all kinds of
business 2 business appz with it.

-dave





""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message
000201c0c501$50264b60$0d1012d1@null">news:000201c0c501$50264b60$0d1012d1@null...
Alright I'll start this out by saying I have a subscription to "Visual Basic
Programmers Journal". Before I converted and realized that I loved PHP so
much I used ASP. Well it seems that in this magazine that XML is a hot topic
in the MS world. I know XML can be used by PHP, but is there a point? I only
know 2 things about it:
1) You can make your own tags:
            <mytag>    </mytag>
2) It's supposedly good for databasing?

If its for databasing, why not just use MySQL( or a variation). Am I missing
something here?







amen brother!


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








Plutarck wrote:

> I use to be really enthusiastically pro-XML just as I was getting into PHP,
> but now I've basically taken a "XML shmexXML" approach. I get the initial
> attraction, but I would think the love would fade off a bit.
>
> The key that so many people seem to forget is the best way to do HTML is
> with, *gasp*, HTML!
>
> If you just want a webpage, XML is using a canon to kill a fly. It's like
> creating classes and objects in PHP for sending text emails.
>

Agreed, but if you have a set of data that you'd like to be able to
"fairly easily" convert into multiple presentation systems (HTML, PDF
and WAP spring to mind), then taking a more structured data and
abstraction approach can pay off quite handsomely on larger projects.


>
> Sure you can do it...but why?
>

Because what you need to do might change some in the future.  Yes,
use mail() all you want, but when you start needing to send attachments,
already you need a class of some sort.   - Aha - I see you qualified and said
'text' attachments.  OK...


>
> XML is new. Common society doesn't do well with new. They always manage to
> screw it up somehow.
>

Depends on what you mean by 'screw it up'.  The notion of a commercial
internet, to me, seems to have been adopted QUITE quickly - even my
parents have coped quite well with this 'new' stuff, and they STILL
can't set their VCR clocks.

>
> XML started as an extensible markup language...that's it. That's all it was
> supposed to do! Now people are using it to query databases, and concoct
> entire search engines, and they are trying to use it to control access to
> restricted data, etc etc.
>

I don't know what you're talking about here.  I've not heard of anyone using
XML to 'control access' to 'restricted data'.  The XML itself IS the data.


>
> It's the same thing that happened with Java. People just aren't good with
> "new".
>

Don't lump Java in with other 'new' technology wholesale.  Sun has made,
imo, a HUGE number of mistakes pushing Java out, so the
less-than-stellar adoption of Java has as much or more to do with Sun themselves

rather than people's ability to adopt to 'new' things.  Again, imo.


>
> XML is nice, and for some things it's even great. But it's not the death of
> plain old HTML, just like ISDN didn't kill POTS (remember when ISDN was "the
> future of telecom"?).
>
> I fear that there are too many cooks in the kitchen on XML, all with a
> seasoning all their own that they are dead set on adding to the broth.
>
> But for me, I say let people play with their Java and XML and new fangled
> widgets. I'll take my PHP and plain-old HTML, and I'll create twice as much
> material with just as high a quality, and I won't need to spend an extra
> minute learning a bleeding-edge technology.
>

Twice as much material?  Is there a contest going on?  Some of us are trying
to use PHP to create advanced applications where we exchange data with
disparate parties.  Having a common standard by which we can exchange
data is a necessity - XML can be that commonality in many cases.

Keep making your HTML webpages - no one is trying to convert you.  Realize
2 things:

1.  The impact and use of 'internet' and related technologies are much larger
than you or I alone can grasp.
2.  New things can come along that don't disrupt your world - you don't need to
come down so heavily on something you don't need or use.

>
> Life's too short to spend it learning how to live it. Translation: Better to
> program than to learn yet _another_ language.
>

Go back to VIC-20 BASIC then.  Things change, and eventually you need to adapt.
At one point you didn't know PHP.  Why did you learn it?  Why not stick
with what you were using before?  Because PHP offered you benefits
you couldn't get elsewhere for the same effort.  SAME thing with XML.  There are

growing pains, yes, and political pissing matches between the "big boys" but
all in all it's a good idea that some of us have a use for.

:)







I agree with most of your points actually. That's why I said I thought the
love would "fade off a bit".

For some things I agree that XML really is quite excellant.

But what I meant about people not being good with "new" on Java and XML, is
that when people (including myself) get a new toy they try and do everything
with it. People get a VCR, and now they want it to program itself and set
it's own clock. Thus came for horrible implementation of "VCR+".

Java was originally made to work in little widgets like blenders and
microwaves. Then it made sense to work on computers too...it's still a very
good idea. But then people instantly tried to do everything with it, and
complained loudly when they couldn't. So Sun bowed to their wishes and
started forcing Java to do things it wasn't yet ready to do.

And now Java applets are quite secure for the user, but the ease with which
they can be decompiled is gastly.

And with XML it's the same way, for now. They want it to do _everything_.
Now when you mix XML with a little javascript and a server-side language
like PHP or *cough* ASP (or any of the others), it really is a pretty nifty
widget.


But here is my problem. For instance with Java, people tend to get really
excited about doing something that they could of done with C/C++. But in
reality, it's a feature only a mother (or programmer, as the case may be),
could love.

So my whole POV is when you want to open a can, use a can opener. So please
put the VCR back under the TV.


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

"Michael Kimsal" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> Plutarck wrote:
>
> > I use to be really enthusiastically pro-XML just as I was getting into
PHP,
> > but now I've basically taken a "XML shmexXML" approach. I get the
initial
> > attraction, but I would think the love would fade off a bit.
> >
> > The key that so many people seem to forget is the best way to do HTML is
> > with, *gasp*, HTML!
> >
> > If you just want a webpage, XML is using a canon to kill a fly. It's
like
> > creating classes and objects in PHP for sending text emails.
> >
>
> Agreed, but if you have a set of data that you'd like to be able to
> "fairly easily" convert into multiple presentation systems (HTML, PDF
> and WAP spring to mind), then taking a more structured data and
> abstraction approach can pay off quite handsomely on larger projects.
>
>
> >
> > Sure you can do it...but why?
> >
>
> Because what you need to do might change some in the future.  Yes,
> use mail() all you want, but when you start needing to send attachments,
> already you need a class of some sort.   - Aha - I see you qualified and
said
> 'text' attachments.  OK...
>
>
> >
> > XML is new. Common society doesn't do well with new. They always manage
to
> > screw it up somehow.
> >
>
> Depends on what you mean by 'screw it up'.  The notion of a commercial
> internet, to me, seems to have been adopted QUITE quickly - even my
> parents have coped quite well with this 'new' stuff, and they STILL
> can't set their VCR clocks.
>
> >
> > XML started as an extensible markup language...that's it. That's all it
was
> > supposed to do! Now people are using it to query databases, and concoct
> > entire search engines, and they are trying to use it to control access
to
> > restricted data, etc etc.
> >
>
> I don't know what you're talking about here.  I've not heard of anyone
using
> XML to 'control access' to 'restricted data'.  The XML itself IS the data.
>
>
> >
> > It's the same thing that happened with Java. People just aren't good
with
> > "new".
> >
>
> Don't lump Java in with other 'new' technology wholesale.  Sun has made,
> imo, a HUGE number of mistakes pushing Java out, so the
> less-than-stellar adoption of Java has as much or more to do with Sun
themselves
>
> rather than people's ability to adopt to 'new' things.  Again, imo.
>
>
> >
> > XML is nice, and for some things it's even great. But it's not the death
of
> > plain old HTML, just like ISDN didn't kill POTS (remember when ISDN was
"the
> > future of telecom"?).
> >
> > I fear that there are too many cooks in the kitchen on XML, all with a
> > seasoning all their own that they are dead set on adding to the broth.
> >
> > But for me, I say let people play with their Java and XML and new
fangled
> > widgets. I'll take my PHP and plain-old HTML, and I'll create twice as
much
> > material with just as high a quality, and I won't need to spend an extra
> > minute learning a bleeding-edge technology.
> >
>
> Twice as much material?  Is there a contest going on?  Some of us are
trying
> to use PHP to create advanced applications where we exchange data with
> disparate parties.  Having a common standard by which we can exchange
> data is a necessity - XML can be that commonality in many cases.
>
> Keep making your HTML webpages - no one is trying to convert you.  Realize
> 2 things:
>
> 1.  The impact and use of 'internet' and related technologies are much
larger
> than you or I alone can grasp.
> 2.  New things can come along that don't disrupt your world - you don't
need to
> come down so heavily on something you don't need or use.
>
> >
> > Life's too short to spend it learning how to live it. Translation:
Better to
> > program than to learn yet _another_ language.
> >
>
> Go back to VIC-20 BASIC then.  Things change, and eventually you need to
adapt.
> At one point you didn't know PHP.  Why did you learn it?  Why not stick
> with what you were using before?  Because PHP offered you benefits
> you couldn't get elsewhere for the same effort.  SAME thing with XML.
There are
>
> growing pains, yes, and political pissing matches between the "big boys"
but
> all in all it's a good idea that some of us have a use for.
>
> :)
>
>
>
>
> --
> 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,
The $article_active comes from a session and I want be able to select the 
radio button (which ever one, yes or no) when the user comes back to the page.

I think thats a bit clearer :-)

Jord

On Saturday 14 April 2001 15:12, you wrote:
> I'm not sure I understand. In the first loop you are seing if
> $article_active equals y. And no where in the code do you set
> $article_active to anything else.
>
> Why would you think $article_active would be anything but "y" or "n"?
>
>
> --
> Plutarck
> Should be working on something...
> ....but forgot what it was.
>
>
> "Jordan Elver" <[EMAIL PROTECTED]> wrote in message
> 01041415474000.10298@localhost">news:01041415474000.10298@localhost...
>
> > Hi,
> > I think I'm being stupid. Why won't this code work. The $article_active
> > variable is showing y when I echo it?
> >
> >
> > if($article_active == 'y') {
> > echo"<INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"y\" SELECTED>Yes";
> > } else {
> > echo"<INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"y\">Yes";
> > }
> >
> > if($article_active == 'n') {
> > echo"<INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"n\" SELECTED>No";
> > } else {
> >         echo"<INPUT TYPE=\"radio\" NAME=\"active\" VALUE=\"n\">No";
> > }
> >
> >
> > Thanks,
> >
> > Jord
> >
> > --
> > 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...
 
   Is there a way to use posix_setuid without set Apache to run as root?
   Or, is there some other function to do the same thing?


  []s

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





At 11:07 PM +0200 4/14/01, n e t b r a i n wrote:
>Hi all,
>anyone have or know where I can find a small function in order to extract
>from a string the most relevant words in it?
>
>something like this:
>
>$var="I love coffe ... Coffe is from Brazil and coffe with milk ..";
>$occurence=2;
>//$occurence means word that are repeat 2 or more times
>my_dream_funct($var,$occurence);
>//the funct now return the word _ coffe _
>
>many thanks in advance
>max
>
>ps.plz note: I need that it works on php3
>


Well, just offthetopofmyhead:

function word_occurrence($word,$phrase) {
    $word = strtolower($word);     # this way,
    $phrase = strtolower($phrase); # case is irrelevant

    $Bits = split($word.'[^[:alnum:]]*', $phrase);

    return (count($Bits)-1);
}

I tested this, and it works fine (php 3.0.12) EXCEPT it counts 
'coffecoffe' as TWO words, not zero. If that's the behavior you want, 
then it's fine. Now I'm intrigued...I want to find a single regular 
expression that will NOT match 'coffecoffe'. Perhaps preg_ functions 
(available on PHP >= 3.0.9).

And, I tried things like

        split('[^[:alnum:]]*'.$word.'[^[:alnum:]]*', " $phrase ")

...didn't work.

-steve

-- 
+----------- 12 April 2001: Forty years of manned spaceflight -----------+
| Steve Edberg                           University of California, Davis |
| [EMAIL PROTECTED]                               Computer Consultant |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+-------------------------- www.yurisnight.net --------------------------+




do the socket functions built into PHP work with SSL? Do I need to add some
sort of encryption to get them to?

-dave






Hi All,

we have 2 mysql server located two dfiferent iss. one of them compiled
latin1 with php-4.0.4pl1  and other one compiled latin5 with
php-4.0.3.pl1. when we tried to connect from latin1 compiled one to
latin5 compiled one, it gives this error:

Warning: MySQL Connection Failed: Can't initialize character set 30
(path: default) in /home/user/public_html/createtable.php on line 2

on createtable.php line 2 there is mysql_connection command.

Is it a bug of php or there would a mistake. if it is a bug is there any
patch to solve it?

Regards,
Mesut Tunga...







Hi Mesut,

@ 6:19:04 PM on 4/14/2001, Mesut TUNGA wrote:

...
> Warning: MySQL Connection Failed: Can't initialize character set 30
> (path: default) in /home/user/public_html/createtable.php on line 2


http://www.mysql.com/doc/C/a/Cannot_initialize_character_set.html


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






I realized that'll that I don't do much to help this community. I rarely reply to 
people's questions. Mainly because I have 56.6 and when I get mail people answered 
already. I also ask alot of questions. Just saying thanks for putting up with me.
                                Chris, The 17 yr Old Php Coder




Hey, take it easy, I started like that too, I think we all did.

- Richard

""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message
001301c0c51c$3cb49e40$0d1012d1@null">news:001301c0c51c$3cb49e40$0d1012d1@null...
I realized that'll that I don't do much to help this community. I rarely
reply to people's questions. Mainly because I have 56.6 and when I get mail
people answered already. I also ask alot of questions. Just saying thanks
for putting up with me.
                                Chris, The 17 yr Old Php Coder







Hi Chris,

@ 3:51:02 PM on 4/14/2001, Chris Anderson wrote:

> I realized that'll that I don't do much to help this community. I
> rarely reply to people's questions. Mainly because I have 56.6 and
> when I get mail people answered already. I also ask alot of
> questions. Just saying thanks for putting up with me. Chris, The 17
> yr Old Php Coder

As far as I'm concerned, you don't have a thing to be sorry about.

There isn't a thing wrong with asking questions here. In fact, if you
have a good book and this list to get help from, you're far more
likely to become successful with PHP.

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






Well thanks everyone, don't feel like I'm "leeching" from the community
anymore. Now when it comes to me and napster, thats another story....
----- Original Message -----
From: "Brian Clark" <[EMAIL PROTECTED]>
To: "PHP is not a drug." <[EMAIL PROTECTED]>
Sent: Saturday, April 14, 2001 7:47 PM
Subject: Re: [PHP] Sorry :(


> Hi Chris,
>
> @ 3:51:02 PM on 4/14/2001, Chris Anderson wrote:
>
> > I realized that'll that I don't do much to help this community. I
> > rarely reply to people's questions. Mainly because I have 56.6 and
> > when I get mail people answered already. I also ask alot of
> > questions. Just saying thanks for putting up with me. Chris, The 17
> > yr Old Php Coder
>
> As far as I'm concerned, you don't have a thing to be sorry about.
>
> There isn't a thing wrong with asking questions here. In fact, if you
> have a good book and this list to get help from, you're far more
> likely to become successful with PHP.
>
> -Brian
> --
>  PGP is spoken here: 0xE4D0C7C8
>  Please, DO NOT carbon copy me on list replies.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





OK, this is less elegant (to me, anyway), and probably a bit slower, but:

function word_occurrence($word,$phrase) {
    $word = strtolower($word);     # this way,
    $phrase = strtolower($phrase); # case is irrelevant

    $Bits = split('[^[:alnum:]]+', $phrase);
    $count = 0;
    for ($i=0; $i<count($Bits); $i++) {
       if ($Bits[$i] == $word) { $count++; }
    }

    return ($count);
}

It should also handle hyphenated & apostrophied (is that a word?) 
words correctly, such as

        coffe's a drag
or
        coffe-heads are strange

If you want to count words that INCLUDE dashes or apostrophes, you'd 
have to use "[^[:alnum:]'-]+" in the split() function. Or, just break 
the string up by whitespace, and use '[[:space:]]+'.

        -steve



---Original Message ---
At 11:07 PM +0200 4/14/01, n e t b r a i n wrote:
>Hi all,
>anyone have or know where I can find a small function in order to extract
>from a string the most relevant words in it?
>
>something like this:
>
>$var="I love coffe ... Coffe is from Brazil and coffe with milk ..";
>$occurence=2;
>//$occurence means word that are repeat 2 or more times
>my_dream_funct($var,$occurence);
>//the funct now return the word _ coffe _
>
>many thanks in advance
>max
>
>ps.plz note: I need that it works on php3
>


Well, just offthetopofmyhead:

function word_occurrence($word,$phrase) {
    $word = strtolower($word);     # this way,
    $phrase = strtolower($phrase); # case is irrelevant

    $Bits = split($word.'[^[:alnum:]]*', $phrase);

    return (count($Bits)-1);
}

I tested this, and it works fine (php 3.0.12) EXCEPT it counts 
'coffecoffe' as TWO words, not zero. If that's the behavior you want, 
then it's fine. Now I'm intrigued...I want to find a single regular 
expression that will NOT match 'coffecoffe'. Perhaps preg_ functions 
(available on PHP >= 3.0.9).

And, I tried things like

        split('[^[:alnum:]]*'.$word.'[^[:alnum:]]*', " $phrase ")

...didn't work.

-steve

-- 
+----------- 12 April 2001: Forty years of manned spaceflight -----------+
| Steve Edberg                           University of California, Davis |
| [EMAIL PROTECTED]                               Computer Consultant |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+-------------------------- www.yurisnight.net --------------------------+




I'm seeing references to functions that 'are' in 4.0.6, but I wasn't
even
aware that 4.0.5 was released yet.  I've seen references to RCs for
4.0.5,
but nothing's on the php.net page.  Did I miss something?







I guess you are using "files" session module. If you take a look at note in PHP Manual, there is my note why your session files are not deleted. (See Session reference) Hope this helps. -- Yasuo Ohgaki ""E K L"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > Is there anybody can help to do this: > > My web site has 3 pages :a.php, b.php and c.php. I want to capture the > session in those 3 pages. Without an id, visitor can't view my page. When > visitors leave the site, thier session should be removed. > > The problem is how to remove the session. I have tried several function > of session such as session_destroy(), session_unregister. But, i still faild > to clear the session. What should i do? > > For ur information, the session.cookie_lifetime is set to 0 in my server. > Should i change the value? If yes, then how to do it? Please give me your > hands, thank you.... > > E K > _________________________________________________________________________ > 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] >



Hi, I have a MySQL table recording errors, 1 of the fields is a
DATETIME, to give me the time of the error.
I have made a file which will then display a table of errors.

I would like to display the date and time in a more readable format,
even just with spaces between the years & months etc.

Having a look through the php online documentation I found this
example:

~~
If you have a MySQL column with of the DATETIME type, and you want to
format the values to a different representation, use this code:

$date = $row["date"];

$new_date = date("l, j M Y, G:i:s", strtotime($date));
~~

but I cannot get this to work :(, I get an "unexpected error in
date()"

I don't (yet) know enough about php to work out what this error is,
could someone help.


Cheers for your help,  Donald
__________________________________________
As well as learning more,
I learn that there is even more I don't know

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






Hi DRN,

@ 8:34:08 PM on 4/14/2001, DRN wrote:

...
> $date = $row["date"];

> $new_date = date("l, j M Y, G:i:s", strtotime($date));
> ~~

> but I cannot get this to work :(, I get an "unexpected error in
> date()"
...

Try this and see if it functions correctly:

<?php

$date = str_replace('-','/',$row["date"]);
$new_date = date("l, j M Y, G:i:s", strtotime($date));

?>

Your original code gives me the same error, but the above code
functions normally for me.

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






On 14 Apr 2001 17:31:02 -0700, DRN <[EMAIL PROTECTED]> wrote:
>$date = $row["date"];
>
>$new_date = date("l, j M Y, G:i:s", strtotime($date));
>~~
>
>but I cannot get this to work :(, I get an "unexpected error in
>date()"

At a guess strtotime() is choking on the format MySQL used to return the date,
which would lead date() to fail as well.

The best way of handling this is to eliminate the need for your program to
worry about the day formats. Modify your mysql query so that instead of "SELECT
date" you have something like "SELECT UNIX_TIMESTAMP(date) AS date". Then you
can simply use date($row["date"]) directly. Alternately, you could use MySQL's
date formatting function to return the desired format directly. In either case,
you'll save a great deal of trouble by avoiding the need for PHP and MySQL to
be parsing each other's human-readable date formats.





Brian Clark <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| Hi DRN,
| Try this and see if it functions correctly:
|
| <?php
|
| $date = str_replace('-','/',$row["date"]);
| $new_date = date("l, j M Y, G:i:s", strtotime($date));
|
| ?>
|
That works great, thanks Donald






Hi All,

My apologies if this is too wordy.

This is driving me nuts.  I have very little experience or knowledge of PHP
and MySQL but have been put in a position that requires me to build several
applications that require me to figure them out.  I am making progress,
though.  Here is my first delimit:

I have a form page that looks like this:
http://www.webtinker.com/fran_info.htm This form has several things going
on.  1st, the first pull down list needs to reflect the same info as the two
location descriptions.  2nd, the two locations "Round Table Discussion" will
grow to an unknown number of entries over time so the two may become 6 or 8
or...  My first big (for me) hurdle is to figure out how to get these to
show up at the top of this form in order of the date with the closest one
first.  They need to be in the same format as they appear but with
additional rows showing as more entries are made.  The ones showing can't be
past due, or, don't show past dates.

What I have figured out so far is how to populate the pull down, how to make
the admin form to fill in the needed info into the MySQL table and I have
had limited success in displaying the meeting info at the top of the form.
I just can't figure out how to make them wrap into groups of info, say with
5 entries of different meetings.  Do I need a separate query for each row of
info using the limit statement in the query or is there a way to do this
using <gulp> arrays?  I have just about every book available and just can't
find a good example of this type of formatted query results.  How do I
approach this?

Here is the table I am using:

CREATE TABLE rnd_tbl (
   id tinyint(10) DEFAULT '0' NOT NULL auto_increment,
   location varchar(100) NOT NULL,
   address varchar(45) NOT NULL,
   address2 varchar(45) NOT NULL,
   city varchar(50) NOT NULL,
   state char(2) NOT NULL,
   zip varchar(14) NOT NULL,
   day char(3) NOT NULL,
   date varchar(25) NOT NULL,
   time varchar(25) NOT NULL,
   phone varchar(15) NOT NULL,
   PRIMARY KEY (id)
);

Many Thanks!!
Short Circuit





Hi Jeff,

@ 8:52:10 PM on 4/14/2001, Jeff Holzfaster wrote:

...
> My apologies if this is too wordy.

A little confusing, but here we go. If this makes no sense what so
ever, maybe someone else can provide a better way of doing what you're
describing here.

...
> I have a form page that looks like this:
> http://www.webtinker.com/fran_info.htm This form has several things
> going on. 1st, the first pull down list needs to reflect the same
> info as the two location descriptions.

That's easy. If you're getting the two locations' data from a mysql
table, just reuse the same information for the pull down.

Is 'location' in your table the 'label' for that meeting? Ie., is
'location' in your SQL below going to be something like "Chicogo Round
Table Discussion"?

If not, add another column for that label and use that for the
listings above the form, and use that again for the select.

> 2nd, the two locations "Round Table Discussion" will grow to an
> unknown number of entries over time so the two may become 6 or 8
> or... My first big (for me) hurdle is to figure out how to get these
> to show up at the top of this form in order of the date with the
> closest one first. They need to be in the same format as they appear
> but with additional rows showing as more entries are made. The ones
> showing can't be past due, or, don't show past dates.

For the date column in your SQL below, use either the value of time()
from PHP, or use one of the built in mysql date functions like
DATETIME.

Then you'll just need to compare the current date to the ones listed
in the table and only show the meetings dated for the current day or
greater. If the expired meetings won't change, you could leave them in
the table and only modify the date down the road. If they're a one
time thing, you can drop the expired listings as you're doing your
date check for the current/future meetings to extract from the table.

Since you're reusing the 'location,' your drop down matching the top
listings should already be taken care of.

> What I have figured out so far is how to populate the pull down, how
> to make the admin form to fill in the needed info into the MySQL
> table and I have had limited success in displaying the meeting info
> at the top of the form.

You'll just need to read the data using mysql_fetch_array() or
mysql_fetch_object(). There are examples of those in the manual at
http://www.php.net. (enough to do what you're wanting to do.)

As you read the data, you can print rows with two cells. If you have 5
meeting entries, you'll end up with a 2 x 3 table with the 2nd cell in
the last row being empty.

Since you'll be reusing the 'location label' from the rows' printing,
your select should be populated with the same information.

> I just can't figure out how to make them wrap into groups of info

No idea what you mean by 'groups of info' unless you mean rows from
the table.

> , say with 5 entries of different meetings. Do I need a separate
> query for each row of info using the limit statement in the query or
> is there a way to do this using <gulp> arrays?

Grabbing the data into an array is going to be a lot quicker than
making several separate queries, probably. If you're having trouble
with arrays, there are lots of folks here willing to help to clarify
them when you get into trouble.

...
> Here is the table I am using:

> CREATE TABLE rnd_tbl (
>    id tinyint(10) DEFAULT '0' NOT NULL auto_increment,
>    location varchar(100) NOT NULL,
>    address varchar(45) NOT NULL,
>    address2 varchar(45) NOT NULL,
>    city varchar(50) NOT NULL,
>    state char(2) NOT NULL,
>    zip varchar(14) NOT NULL,
>    day char(3) NOT NULL,
>    date varchar(25) NOT NULL,
>    time varchar(25) NOT NULL,

time and date could be combined. You can use PHP's date conversion
functions to convert the date and time into any format you'd like, or
vise versa.

>    phone varchar(15) NOT NULL,
>    PRIMARY KEY (id)
> );


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






Thanks for the help, Brian.  That'll give me something to go on.  I
definitely will need some assistance with this array stuff.  I was actually
able to do this (below) which got everything to a page - unformatted in any
way - but when I tried moving it around (the arrays??) such as $my_row .=
"$row[state]<br>"; to something like $my_row .=
"$row[city][state][zip]<br>"; it obviously failed.  Is there something I
need to do with the output of the while statement beyond what I have done or
is there a simple way to get that info formatted to look like the current
page?

Thanks

<?

include ("../config/common.inc.php");

        # connect database
        $link = mysql_connect($host, $user, $pass)
                or die("Connection failed: " . mysql_error());

        # select table
        mysql_select_db($db_name)
                or die("Database selection failed [$db_name]: " . mysql_error());

        # send query
        $sql = "SELECT * FROM rnd_tbl ORDER BY date";
        $result = mysql_query($sql)
                or die("Query failed: " . mysql_error());


?>
<html>
<head>
        <title></title>
</head>

<body>

<?

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

                $my_row = "<div align=\"center\">\n";
                $my_row .= "Round Table Discussion<br>";
                $my_row .= "$row[day]<br>";
                $my_row .= "$row[address] [address2]<br>";
                $my_row .= "$row[address2]<br>";
                $my_row .= "$row[location]<br>";
                $my_row .= "$row[city]<br>";
                $my_row .= "$row[state]<br>";
                $my_row .= "$row[city]<br>";
                $my_row .= "$row[zip]<br>";
                $my_row .= "$row[date]<br>";
                $my_row .= "$row[time]<br>";
                $my_row .= "$row[phone]<br>";
                $my_row .= "</div><br>";
                echo "$my_row\n";
                }
?>

</body>
</html>






Hi Jeff,

@ 8:52:10 PM on 4/14/2001, Jeff Holzfaster wrote:

....
> My apologies if this is too wordy.

A little confusing, but here we go. If this makes no sense what so
ever, maybe someone else can provide a better way of doing what you're
describing here.

....
> I have a form page that looks like this:
> http://www.webtinker.com/fran_info.htm This form has several things
> going on. 1st, the first pull down list needs to reflect the same
> info as the two location descriptions.

That's easy. If you're getting the two locations' data from a mysql
table, just reuse the same information for the pull down.

Is 'location' in your table the 'label' for that meeting? Ie., is
'location' in your SQL below going to be something like "Chicogo Round
Table Discussion"?

If not, add another column for that label and use that for the
listings above the form, and use that again for the select.

> 2nd, the two locations "Round Table Discussion" will grow to an
> unknown number of entries over time so the two may become 6 or 8
> or... My first big (for me) hurdle is to figure out how to get these
> to show up at the top of this form in order of the date with the
> closest one first. They need to be in the same format as they appear
> but with additional rows showing as more entries are made. The ones
> showing can't be past due, or, don't show past dates.

For the date column in your SQL below, use either the value of time()
from PHP, or use one of the built in mysql date functions like
DATETIME.

Then you'll just need to compare the current date to the ones listed
in the table and only show the meetings dated for the current day or
greater. If the expired meetings won't change, you could leave them in
the table and only modify the date down the road. If they're a one
time thing, you can drop the expired listings as you're doing your
date check for the current/future meetings to extract from the table.

Since you're reusing the 'location,' your drop down matching the top
listings should already be taken care of.

> What I have figured out so far is how to populate the pull down, how
> to make the admin form to fill in the needed info into the MySQL
> table and I have had limited success in displaying the meeting info
> at the top of the form.

You'll just need to read the data using mysql_fetch_array() or
mysql_fetch_object(). There are examples of those in the manual at
http://www.php.net. (enough to do what you're wanting to do.)

As you read the data, you can print rows with two cells. If you have 5
meeting entries, you'll end up with a 2 x 3 table with the 2nd cell in
the last row being empty.

Since you'll be reusing the 'location label' from the rows' printing,
your select should be populated with the same information.

> I just can't figure out how to make them wrap into groups of info

No idea what you mean by 'groups of info' unless you mean rows from
the table.

> , say with 5 entries of different meetings. Do I need a separate
> query for each row of info using the limit statement in the query or
> is there a way to do this using <gulp> arrays?

Grabbing the data into an array is going to be a lot quicker than
making several separate queries, probably. If you're having trouble
with arrays, there are lots of folks here willing to help to clarify
them when you get into trouble.

....
> Here is the table I am using:

> CREATE TABLE rnd_tbl (
>    id tinyint(10) DEFAULT '0' NOT NULL auto_increment,
>    location varchar(100) NOT NULL,
>    address varchar(45) NOT NULL,
>    address2 varchar(45) NOT NULL,
>    city varchar(50) NOT NULL,
>    state char(2) NOT NULL,
>    zip varchar(14) NOT NULL,
>    day char(3) NOT NULL,
>    date varchar(25) NOT NULL,
>    time varchar(25) NOT NULL,

time and date could be combined. You can use PHP's date conversion
functions to convert the date and time into any format you'd like, or
vise versa.

>    phone varchar(15) NOT NULL,
>    PRIMARY KEY (id)
> );


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



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






Teemu, thanks for the input.  I tried this with somewhat modified code
(added all the fields) and perhaps you saw what I did on my last post to the
list.  I have actually been able to get the same results as this.  I'm a
little confused about how to get the info in the 'for' section to format to
look the way I need it and to 'wrap' with only two sets of results to a row.
Using the way you show has the disadvantage of leaving blank rows if data is
not available for that row plus, I don't see how to rearrange the results to
look right.  I mean, how do you put city, state, zip on the same line or how
do you get "$city Round Table Discussion" in there?  Are

Thanks!!

Here is yours after I made my attempt:

while( $row = mysql_fetch_array( $result )){
         $data[] = array(
                 location           => $row[1],
                 address            => $row[2],
                 address2           => $row[3],
                     city                       => $row[4],
                     state                    => $row[5],
                     zip                      => $row[6],
                     day                      => $row[7],
                     date                     => $row[8],
                     time                     => $row[9],
                     phone                    => $row[10]

         );
}

for ( $i = 0; $i < count( $data ); $i++ ){

         print("<br><br>Set $i:<br>");
         print( $data[$i][location]."<br>");
         print( $data[$i][address]."<br>");
         print( $data[$i][address2]."<br>");
           print( $data[$i][city]." "."Round Table Discussion"."<br>");
         print( $data[$i][city]."<br>");
           print( $data[$i][state]."<br>");
           print( $data[$i][zip]."<br>");
           print( $data[$i][day]."<br>");
           print( $data[$i][date]."<br>");
           print( $data[$i][time]."<br>");
           print( $data[$i][phone]."<br>");

}





try something like this...

$db = "database_name";
$q = "select * from md_tbl";
$rs = mysql_query( $db, $q );
while( $row = mysql_fetch_array( $rs )){
         $data[] = array(
                 LOCATION        => $row[1],
                 ADDR            => $row[2],
                 ADDR2           => $row[3]
         );
}

for ( $i = 0; $i < count( $data ); $i++ ){
         print("Set $i:<br>");
         print( $data[$i][LOCATION]."<br>");
         print( $data[$i][ADDR]."<br>");
         print( $data[$i][ADDR2]."<br>");
}

sorry 'bout typos , it's getting late here ;-)
Hope this helps.

cheers

Teemu Pentinsaari

At 19:52 14.4.2001 -0500, you wrote:
>Hi All,
>
>My apologies if this is too wordy.
>
>This is driving me nuts.  I have very little experience or knowledge of PHP
>and MySQL but have been put in a position that requires me to build several
>applications that require me to figure them out.  I am making progress,
>though.  Here is my first delimit:
>
>I have a form page that looks like this:
>http://www.webtinker.com/fran_info.htm This form has several things going
>on.  1st, the first pull down list needs to reflect the same info as the
two
>location descriptions.  2nd, the two locations "Round Table Discussion"
will
>grow to an unknown number of entries over time so the two may become 6 or 8
>or...  My first big (for me) hurdle is to figure out how to get these to
>show up at the top of this form in order of the date with the closest one
>first.  They need to be in the same format as they appear but with
>additional rows showing as more entries are made.  The ones showing can't
be
>past due, or, don't show past dates.
>
>What I have figured out so far is how to populate the pull down, how to
make
>the admin form to fill in the needed info into the MySQL table and I have
>had limited success in displaying the meeting info at the top of the form.
>I just can't figure out how to make them wrap into groups of info, say with
>5 entries of different meetings.  Do I need a separate query for each row
of
>info using the limit statement in the query or is there a way to do this
>using <gulp> arrays?  I have just about every book available and just can't
>find a good example of this type of formatted query results.  How do I
>approach this?
>
>Here is the table I am using:
>
>CREATE TABLE rnd_tbl (
>    id tinyint(10) DEFAULT '0' NOT NULL auto_increment,
>    location varchar(100) NOT NULL,
>    address varchar(45) NOT NULL,
>    address2 varchar(45) NOT NULL,
>    city varchar(50) NOT NULL,
>    state char(2) NOT NULL,
>    zip varchar(14) NOT NULL,
>    day char(3) NOT NULL,
>    date varchar(25) NOT NULL,
>    time varchar(25) NOT NULL,
>    phone varchar(15) NOT NULL,
>    PRIMARY KEY (id)
>);
>
>Many Thanks!!
>Short Circuit
>
>
>--
>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]







Sheesh! No one should let me reply to email without sufficient 
caffiene! Now, I actually just read and grokked your question...

I haven't tested this. And, I included a line that removes 
apostrophes (eg; "steve's" becomes "steve"). You can comment that 
line out if this doesn't suit your needs. The function returns an 
array of all words that meet or exceed your threshold count, sorted 
by decreasing frequency (you can remove the sort section too, if you 
don't need it).

Sorry about the previous two messages...


function your_dream_function($phrase, $threshold) {
    $phrase = strtolower(trim($phrase));
    $WordList = $Temp = array();

    $Bits = split('[[:space:]]+', $phrase);

    for ($i=0; $i<count($Bits); $i++) {
       $Bits[$i] = ereg_replace("'.*", '', $Bits[$i]); # Apostrophe removal
       $Temp[$Bits[$i]]++;
    }

    arsort($Temp); # Sorts in descending arder

    reset($Temp);
    for ($i=0; $i<count($Temp); $i++) {
       if ($Temp[$i] >= $threshold) { $WordList[] = $Temp[$i]; }
    }

    return ($WordList);
}

Some notes:

(1) I can't recall if PHP3's arsort() would treat the array value as 
a string or as a numeric. I think it would always treat the value as 
a string (meaning that '2' would come before '12' in an descending 
sort), so in that case you would have to modify the function above in 
one place (only if you wanted the sort):

    Replace

       $Temp[$Bits[$i]]++;

    in the first for loop with

       $x = $Temp[$Bits[$i]]++;
       $Temp[$Bits[$i]] = substr(10000+$x, 1);

This should left-pad the number with zeros (for up to 9999 
occurrences found), so that the ASCII sort sequence is in numeric 
order. Using PHP4's arsort($Temp, SORT_NUMERIC) would be much handier!

(2) Iff (if and ONLY if) you are using the sort, you could get a 
slight speed improvement by modifying the second for loop as follows; 
replace

       if ($Temp[$i] >= $threshold) { $WordList[] = $Temp[$i]; }

with

       if ($Temp[$i] >= $threshold) {
          $WordList[] = $Temp[$i];
       } else {
          break; # all subsequent words will be below the threshold
       }



Again, this is all untested code.

        -steve



At 3:43 PM -0700 4/14/01, Steve Edberg wrote:
>OK, this is less elegant (to me, anyway), and probably a bit slower, but:
>
>function word_occurrence($word,$phrase) {
>    $word = strtolower($word);     # this way,
>    $phrase = strtolower($phrase); # case is irrelevant
>
>    $Bits = split('[^[:alnum:]]+', $phrase);
>    $count = 0;
>    for ($i=0; $i<count($Bits); $i++) {
>       if ($Bits[$i] == $word) { $count++; }
>    }
>
>    return ($count);
>}
>
>It should also handle hyphenated & apostrophied (is that a word?) 
>words correctly, such as
>
>       coffe's a drag
>or
>       coffe-heads are strange
>
>If you want to count words that INCLUDE dashes or apostrophes, you'd 
>have to use "[^[:alnum:]'-]+" in the split() function. Or, just 
>break the string up by whitespace, and use '[[:space:]]+'.
>
>       -steve
>
>
>
>---Original Message ---
>At 11:07 PM +0200 4/14/01, n e t b r a i n wrote:
>>Hi all,
>>anyone have or know where I can find a small function in order to extract
>>from a string the most relevant words in it?
>>
>>something like this:
>>
>>$var="I love coffe ... Coffe is from Brazil and coffe with milk ..";
>>$occurence=2;
>>//$occurence means word that are repeat 2 or more times
>>my_dream_funct($var,$occurence);
>>//the funct now return the word _ coffe _
>>
>>many thanks in advance
>>max
>>
>>ps.plz note: I need that it works on php3
>>
>
>
>Well, just offthetopofmyhead:
>
>function word_occurrence($word,$phrase) {
>    $word = strtolower($word);     # this way,
>    $phrase = strtolower($phrase); # case is irrelevant
>
>    $Bits = split($word.'[^[:alnum:]]*', $phrase);
>
>    return (count($Bits)-1);
>}
>
>I tested this, and it works fine (php 3.0.12) EXCEPT it counts 
>'coffecoffe' as TWO words, not zero. If that's the behavior you 
>want, then it's fine. Now I'm intrigued...I want to find a single 
>regular expression that will NOT match 'coffecoffe'. Perhaps preg_ 
>functions (available on PHP >= 3.0.9).
>
>And, I tried things like
>
>       split('[^[:alnum:]]*'.$word.'[^[:alnum:]]*', " $phrase ")
>
>...didn't work.
>
>-steve
>
>--
>+----------- 12 April 2001: Forty years of manned spaceflight -----------+
>| Steve Edberg                           University of California, Davis |
>| [EMAIL PROTECTED]                               Computer Consultant |
>| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
>+-------------------------- www.yurisnight.net --------------------------+
>
>--
>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]

-- 
+----------- 12 April 2001: Forty years of manned spaceflight -----------+
| Steve Edberg                           University of California, Davis |
| [EMAIL PROTECTED]                               Computer Consultant |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+-------------------------- www.yurisnight.net --------------------------+




Hello,

I have a page with a lot of data, all of this data is formated in that page to be 
printed, in a table with 500 px width, but how can I messure the length of the page 
with my results, for example a query can give me exactly the height of the page, but 
other queries can give me more of the height of the page and the results are cutted at 
the end when I send the page to the printer.

How can I solve this problem?

Thank you in advance for your help.


Fabian Fabela
[EMAIL PROTECTED]
www.vacagorda.com




Reply via email to