php-general Digest 12 Aug 2002 09:21:24 -0000 Issue 1520

Topics (messages 112050 through 112103):

Re: Pictures and sound in MySQL and access via PHP
        112050 by: danny
        112056 by: David Freeman
        112058 by: RPS Internet
        112061 by: danny

Re: Cookie array
        112051 by: Maxim Maletsky

Re: Best way to read file
        112052 by: Maxim Maletsky
        112053 by: Pushkar Pradhan
        112055 by: Maxim Maletsky

Re: why true?
        112054 by: Maxim Maletsky

Hacker?
        112057 by: RPS Internet
        112059 by: Tyler Longren
        112060 by: RPS Internet
        112064 by: Tyler Longren
        112088 by: Julio Nobrega

mkdate error?
        112062 by: jc
        112063 by: RPS Internet
        112065 by: chyunj.uci.edu
        112066 by: Bas Jobsen
        112069 by: chyunj.uci.edu

Free 'search engine' code
        112067 by: Edgard Berendsen
        112070 by: Justin French
        112071 by: Pushkar Pradhan
        112072 by: Edgard Berendsen
        112074 by: salamander

Re: creating files in OS X
        112068 by: David Rice

Re: Random mirrors and download quota
        112073 by: Julio Nobrega
        112079 by: B.C. Lance

Case Sensitivity
        112075 by: Rich Hutchins
        112076 by: Andrew Brampton
        112080 by: Rasmus Lerdorf
        112084 by: Bogdan Stancescu

Re: Newbie question about UNIX command-line directives
        112077 by: Al
        112081 by: Rasmus Lerdorf

Stoopid Question - PHP.ini path?
        112078 by: Wee Keat

Re: passing an array in a link
        112082 by: Bogdan Stancescu

mysql_fetch_array problem
        112083 by: Jonni
        112086 by: Bogdan Stancescu

POST fields through CURL
        112085 by: Mike Mannakee
        112087 by: Bogdan Stancescu
        112090 by: Jonathan Rosenberg
        112092 by: Bogdan Stancescu

Please someone help me!
        112089 by: Gandalf
        112094 by: Rasmus Lerdorf
        112096 by: Rasmus Lerdorf

including a php file in an html doc
        112091 by: Alexander Ross
        112093 by: Bogdan Stancescu

Re: use data-ba_se
        112095 by: David Robley

Re: Win PHP Editor...
        112097 by: Lord Loh.

Scheduler, Staff Directory, Work tracker
        112098 by: Paul Dionne
        112103 by: Justin French

Installin PHP as a module
        112099 by: Carl Brandenburg
        112100 by: RPS Internet

Form variables not passed: register_globals = On
        112101 by: Petre Agenbag

Form variables not passing: globals IS on
        112102 by: Petre Agenbag

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
thank you for your answer

How do you make a link in MySQL?

I tried following code were the field "geluid" contains a link to a mp3
format of field geluid = varchar(250). The problem is that i just get plain
text instead of a link to the MP3. Even better would be to have a button to
clicjk if you want to hear the sound.


echo  "<table width=\"90%\" border=1><tr><td>";
echo "Nederlands</td><td>Oostends</td><td>Uitleg</td></tr>";

while ($row=mysql_fetch_array($result))
{
echo "<tr><td>";
echo $row[woord_nl]. "</td><td>"
. $row[woord_ost]. "</td><td>"
. $row[betekenis_nl]. "</td><td>"
. $row[geluid];
echo "</td></tr>";
}

Danny
Rodolfo Gonzalez <[EMAIL PROTECTED]> schreef in berichtnieuws
[EMAIL PROTECTED]
> On Sat, 10 Aug 2002, lallous wrote:
> > > I'm making a on-line dictionary. I use PHP and a MySQL Database.
> > > Now I want to add audio-streaming (MP3) and pictures (JPG) to the
database
> > > and retrieve it true PHP. Can sombody help me out with a little
>
> If the files are not "secret" or "for members only", you should better
> store them somewhere under your http document tree, and store *only* their
> filenames in the database, then you could provide a link to the file. I
> think this would be the faster. Or if you want to "protect" the files, you
> could place them outside your document tree, and then use fileread or
> something similar to read them. But I'd suggest you to keep only the
> filenames on the database, and store the files in the filesystem, it'd
> better for the performance and integrity of the files.
>
> Good luck.
>
>
>


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

 > How do you make a link in MySQL?
 > 
 > I tried following code were the field "geluid" contains a 
 > link to a mp3

 > while ($row=mysql_fetch_array($result))
 > {
 > echo "<tr><td>";
 > echo $row[woord_nl]. "</td><td>"
 > . $row[woord_ost]. "</td><td>"
 > . $row[betekenis_nl]. "</td><td>"
 > . $row[geluid];
 > echo "</td></tr>";
 > }

I'd do something like this:

  . "<a href=\"" . $row[geluid] . "\">" . $row[geluid] . "</a>"

To get you link - basically, just put your link into the appropriate
html tags.  If you prefer a button or something else then apply the html
you'd use and go with it.

CYA, Dave



--- End Message ---
--- Begin Message ---
The way I always store links in the database is in the format of varchar,
but if a file is stored in a mp3 folder to follow your example I would list
it in the database as /mp3/sound.mp3. Then list your code like this:
echo  "<table width=\"90%\" border=1><tr><td>";
echo "Nederlands</td><td>Oostends</td><td>Uitleg</td></tr>";

while ($row=mysql_fetch_array($result))
{
echo "<tr><td>";
echo $row[woord_nl]. "</td><td>"
. $row[woord_ost]. "</td><td>"
. $row[betekenis_nl]. "</td><td>"
. "<a href =\"" .$row[geluid] ."/">link name</a>";
echo "</td></tr>";
}

Hope this hleps and works in your situation,
Josh Thomas
Administrator
RPS Internet Services

-----Original Message-----
From: danny [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 11, 2002 3:33 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Pictures and sound in MySQL and access via PHP


thank you for your answer

How do you make a link in MySQL?

I tried following code were the field "geluid" contains a link to a mp3
format of field geluid = varchar(250). The problem is that i just get plain
text instead of a link to the MP3. Even better would be to have a button to
clicjk if you want to hear the sound.


echo  "<table width=\"90%\" border=1><tr><td>";
echo "Nederlands</td><td>Oostends</td><td>Uitleg</td></tr>";

while ($row=mysql_fetch_array($result))
{
echo "<tr><td>";
echo $row[woord_nl]. "</td><td>"
. $row[woord_ost]. "</td><td>"
. $row[betekenis_nl]. "</td><td>"
. $row[geluid];
echo "</td></tr>";
}

Danny
Rodolfo Gonzalez <[EMAIL PROTECTED]> schreef in berichtnieuws
[EMAIL PROTECTED]
> On Sat, 10 Aug 2002, lallous wrote:
> > > I'm making a on-line dictionary. I use PHP and a MySQL Database.
> > > Now I want to add audio-streaming (MP3) and pictures (JPG) to the
database
> > > and retrieve it true PHP. Can sombody help me out with a little
>
> If the files are not "secret" or "for members only", you should better
> store them somewhere under your http document tree, and store *only* their
> filenames in the database, then you could provide a link to the file. I
> think this would be the faster. Or if you want to "protect" the files, you
> could place them outside your document tree, and then use fileread or
> something similar to read them. But I'd suggest you to keep only the
> filenames on the database, and store the files in the filesystem, it'd
> better for the performance and integrity of the files.
>
> Good luck.
>
>
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
thanks it works fine! :-)))


Danny <[EMAIL PROTECTED]> schreef in berichtnieuws
[EMAIL PROTECTED]
> hi,
>
> I already posted this message but the time on my computer was wrong (26/07
> so i post it again).
>
> I am new on MySQL and PHP.
> I'm making a on-line dictionary. I use PHP and a MySQL Database.
> Now I want to add audio-streaming (MP3) and pictures (JPG) to the database
> and retrieve it true PHP. Can sombody help me out with a little
> example-code?
> The database is working well (only text).
>
> Danny
>
>
>
>


--- End Message ---
--- Begin Message ---
It is way smarter storing serialized array in one cookie. And, if you
get length problems then only store SESSID in cookie and the rest in
session or database.


Sincerely,

Maxim Maletsky

PHP Beginner
www.phpbeginner.com


> -----Original Message-----
> From: B.C. Lance [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 11, 2002 6:11 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Cookie array
> 
> to store:
> 
> setcookie ("TestCookie[0]", "zero", time() + 3600);
> setcookie ("TestCookie[1]", "one", time() + 3600);
> setcookie ("TestCookie[2]", "two", time() + 3600);
> 
> or
> 
> setcookie ("TestCookie[one]", "1", time() + 3600);
> setcookie ("TestCookie[two]", "2", time() + 3600);
> setcookie ("TestCookie[three]", "3", time() + 3600);
> 
> 
> to retrieve:
> 
> foreach($_COOKIE["TestCookie"] as $key => $value) {
>    echo "{$value}<br>";
> }
> 
> or
> 
> echo $_COOKIE["TestCookie"]["one"];
> echo $_COOKIE["TestCookie"][1];
> 
> 
> Jan - Cwizo wrote:
> > Hi !
> >
> > How can I stoor array in to a cookie ?
> >
> > Do I just define an array and stoore it in a cookie ?
> > How do I access the data in the array then ?
> >
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
readfile() is good enough


Sincerely,

Maxim Maletsky

PHP Beginner
www.phpbeginner.com


> -----Original Message-----
> From: César Aracena [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 11, 2002 6:36 PM
> To: PHP General List
> Subject: [PHP] Best way to read file
> 
> Hi all.
> 
> I am using readfile() to read and print the entire content of a .txt
> file into a site, but need to use </p> tags to break down the lines.
I
> intend to be able, as an Administrator, to edit these text files
later.
> What is the best way to accomplish this? Should I keep using
readfile()
> or should I use any ther better way of doing this?
> 
> Thanks in advance,
> 
> Cesar Aracena
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
How about file() since it returns each line in the file as an array?
It seems like he wants to do some processing on each line of the file.

> readfile() is good enough
>
>
> Sincerely,
>
> Maxim Maletsky
>
> PHP Beginner
> www.phpbeginner.com
>
>
> > -----Original Message-----
> > From: César Aracena [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, August 11, 2002 6:36 PM
> > To: PHP General List
> > Subject: [PHP] Best way to read file
> >
> > Hi all.
> >
> > I am using readfile() to read and print the entire content of a .txt
> > file into a site, but need to use </p> tags to break down the lines.
> I
> > intend to be able, as an Administrator, to edit these text files
> later.
> > What is the best way to accomplish this? Should I keep using
> readfile()
> > or should I use any ther better way of doing this?
> >
> > Thanks in advance,
> >
> > Cesar Aracena
> > CE / MCSE+I
> > Neuquen, Argentina
> > +54.299.6356688
> > +54.299.4466621
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-Pushkar S. Pradhan

--- End Message ---
--- Begin Message ---
Whatever saves you lines of code, difference is not any big.


Sincerely,

Maxim Maletsky

PHP Beginner
www.phpbeginner.com


> -----Original Message-----
> From: Pushkar Pradhan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 12, 2002 12:06 AM
> To: Maxim Maletsky
> Cc: 'César Aracena'; 'PHP General List'
> Subject: RE: [PHP] Best way to read file
> 
> How about file() since it returns each line in the file as an array?
> It seems like he wants to do some processing on each line of the file.
> 
> > readfile() is good enough
> >
> >
> > Sincerely,
> >
> > Maxim Maletsky
> >
> > PHP Beginner
> > www.phpbeginner.com
> >
> >
> > > -----Original Message-----
> > > From: César Aracena [mailto:[EMAIL PROTECTED]]
> > > Sent: Sunday, August 11, 2002 6:36 PM
> > > To: PHP General List
> > > Subject: [PHP] Best way to read file
> > >
> > > Hi all.
> > >
> > > I am using readfile() to read and print the entire content of a
.txt
> > > file into a site, but need to use </p> tags to break down the
lines.
> > I
> > > intend to be able, as an Administrator, to edit these text files
> > later.
> > > What is the best way to accomplish this? Should I keep using
> > readfile()
> > > or should I use any ther better way of doing this?
> > >
> > > Thanks in advance,
> > >
> > > Cesar Aracena
> > > CE / MCSE+I
> > > Neuquen, Argentina
> > > +54.299.6356688
> > > +54.299.4466621
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> -Pushkar S. Pradhan
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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

echo ('test'=='0');

and you'll see what Rasmus meant.




Sincerely,

Maxim Maletsky

PHP Beginner
www.phpbeginner.com


> -----Original Message-----
> From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 11, 2002 4:56 PM
> To: PHP General
> Subject: [PHP] why true?
> 
> 
> echo ('test'==0);
> gives 1 why?
> 
> Thanks,
> 
> Bas
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
My server is getting odd request form an outside computer. Upon looking into
the requests I have found his PHP Config file is point to my server as the
HTTP_VIA and other vars. I am wondering how I can deny him access since he
is forwarding all request through my server with these settings. My server
is only running ports 22, 25 and 110 so will his requests still run php
since it is installed?


Thanks,
Josh Thomas


--- End Message ---
--- Begin Message ---
block his ip at the router.

tyler

On Sun, 11 Aug 2002 16:21:07 -0600
"RPS Internet" <[EMAIL PROTECTED]> wrote:

> My server is getting odd request form an outside computer. Upon
> looking into the requests I have found his PHP Config file is point to
> my server as the HTTP_VIA and other vars. I am wondering how I can
> deny him access since he is forwarding all request through my server
> with these settings. My server is only running ports 22, 25 and 110 so
> will his requests still run php since it is installed?
> 
> 
> Thanks,
> Josh Thomas
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
What about all the users of his web site that are requesting his php scrpts
that are compiling through my server?

-----Original Message-----
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 11, 2002 4:15 PM
To: RPS Internet
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Hacker?


block his ip at the router.

tyler

On Sun, 11 Aug 2002 16:21:07 -0600
"RPS Internet" <[EMAIL PROTECTED]> wrote:

> My server is getting odd request form an outside computer. Upon
> looking into the requests I have found his PHP Config file is point to
> my server as the HTTP_VIA and other vars. I am wondering how I can
> deny him access since he is forwarding all request through my server
> with these settings. My server is only running ports 22, 25 and 110 so
> will his requests still run php since it is installed?
>
>
> Thanks,
> Josh Thomas
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
So what?  You don't want him using your stuff anyway do you?

tyler

On Sun, 11 Aug 2002 16:33:17 -0600
"RPS Internet" <[EMAIL PROTECTED]> wrote:

> What about all the users of his web site that are requesting his php
> scrpts that are compiling through my server?
> 
> -----Original Message-----
> From: Tyler Longren [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 11, 2002 4:15 PM
> To: RPS Internet
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Hacker?
> 
> 
> block his ip at the router.
> 
> tyler
> 
> On Sun, 11 Aug 2002 16:21:07 -0600
> "RPS Internet" <[EMAIL PROTECTED]> wrote:
> 
> > My server is getting odd request form an outside computer. Upon
> > looking into the requests I have found his PHP Config file is point
> > to my server as the HTTP_VIA and other vars. I am wondering how I
> > can deny him access since he is forwarding all request through my
> > server with these settings. My server is only running ports 22, 25
> > and 110 so will his requests still run php since it is installed?
> >
> >
> > Thanks,
> > Josh Thomas
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
> What about all the users of his web site that are requesting his php
scrpts
> that are compiling through my server?

  Contact him and ask to stop. If he doesn't, block. It will be him that
will lose customers, not you.

--
Julio Nobrega
Pode acessar:
http://www.inerciasensorial.com.br


"Rps Internet" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What about all the users of his web site that are requesting his php
scrpts
> that are compiling through my server?
>
> -----Original Message-----
> From: Tyler Longren [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 11, 2002 4:15 PM
> To: RPS Internet
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Hacker?
>
>
> block his ip at the router.
>
> tyler
>
> On Sun, 11 Aug 2002 16:21:07 -0600
> "RPS Internet" <[EMAIL PROTECTED]> wrote:
>
> > My server is getting odd request form an outside computer. Upon
> > looking into the requests I have found his PHP Config file is point to
> > my server as the HTTP_VIA and other vars. I am wondering how I can
> > deny him access since he is forwarding all request through my server
> > with these settings. My server is only running ports 22, 25 and 110 so
> > will his requests still run php since it is installed?
> >
> >
> > Thanks,
> > Josh Thomas
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>


--- End Message ---
--- Begin Message ---
The following bit of code completely baffles me as to why it doesn't work.
I am doing a very simple validation where I check to see if the "end date"
field of an inputted record is an older date than the "start date".

I checked this by putting in the same date for both end and start dates. Yet
mkdate gives me a different value for each even though since they are both
the same date, I should get the same value returned.  Right?

//notice the start and end date is the same.  Therefore, you should get the
same value for each, right?
<START LITTLE CODE SNIPPET>
 $parsed_start_date=split("/", "08/02/2002");
 $parsed_end_date=split("/", "08/02/2002");
 $start_dts = mktime("", "", "", $parsed_start_date[0],
$parsed_start_date[1], $parsed_start_date[2]);
 $end_dts = mktime("", "", "", $parsed_end_date[0], $parsed_end_date[1],
$parsed_date[2]);
 if ($start_dts > $end_dts) {
   echo "This function thinks the end date is older than the start date.";
 }
 else {
   echo "Whoah, it actually worked.";
 }
<END LITTLE CODE SNIPPET>

What am I not seeing?
Thanks in advance,
J. Chyun




--- End Message ---
--- Begin Message ---
Your working with strings right? Would your if command be:
if ($start_dts gt $end_dts) {
   echo "This function thinks the end date is older than the start date.";
 }
 else {
   echo "Whoah, it actually worked.";
 }

In string you should use the gt comparitive instead of the >.

See if this works for you,

Josh Thomas
RPS Internet Services
-----Original Message-----
From: jc [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 11, 2002 4:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mkdate error?


The following bit of code completely baffles me as to why it doesn't work.
I am doing a very simple validation where I check to see if the "end date"
field of an inputted record is an older date than the "start date".

I checked this by putting in the same date for both end and start dates. Yet
mkdate gives me a different value for each even though since they are both
the same date, I should get the same value returned.  Right?

//notice the start and end date is the same.  Therefore, you should get the
same value for each, right?
<START LITTLE CODE SNIPPET>
 $parsed_start_date=split("/", "08/02/2002");
 $parsed_end_date=split("/", "08/02/2002");
 $start_dts = mktime("", "", "", $parsed_start_date[0],
$parsed_start_date[1], $parsed_start_date[2]);
 $end_dts = mktime("", "", "", $parsed_end_date[0], $parsed_end_date[1],
$parsed_date[2]);
 if ($start_dts > $end_dts) {
   echo "This function thinks the end date is older than the start date.";
 }
 else {
   echo "Whoah, it actually worked.";
 }
<END LITTLE CODE SNIPPET>

What am I not seeing?
Thanks in advance,
J. Chyun





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
At 05:08 PM 8/11/2002 -0600, RPS Internet wrote:
>Your working with strings right? Would your if command be:
>if ($start_dts gt $end_dts) {
>    echo "This function thinks the end date is older than the start date.";
>  }
>  else {
>    echo "Whoah, it actually worked.";
>  }
>
>In string you should use the gt comparitive instead of the >.
>
>See if this works for you,
>
>Josh Thomas
>RPS Internet Services
>-----Original Message-----
>From: jc [mailto:[EMAIL PROTECTED]]
>Sent: Sunday, August 11, 2002 4:01 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] mkdate error?
>
>
>The following bit of code completely baffles me as to why it doesn't work.
>I am doing a very simple validation where I check to see if the "end date"
>field of an inputted record is an older date than the "start date".
>
>I checked this by putting in the same date for both end and start dates. Yet
>mkdate gives me a different value for each even though since they are both
>the same date, I should get the same value returned.  Right?
>
>//notice the start and end date is the same.  Therefore, you should get the
>same value for each, right?
><START LITTLE CODE SNIPPET>
>  $parsed_start_date=split("/", "08/02/2002");
>  $parsed_end_date=split("/", "08/02/2002");
>  $start_dts = mktime("", "", "", $parsed_start_date[0],
>$parsed_start_date[1], $parsed_start_date[2]);
>  $end_dts = mktime("", "", "", $parsed_end_date[0], $parsed_end_date[1],
>$parsed_date[2]);
>  if ($start_dts > $end_dts) {
>    echo "This function thinks the end date is older than the start date.";
>  }
>  else {
>    echo "Whoah, it actually worked.";
>  }
><END LITTLE CODE SNIPPET>
>
>What am I not seeing?
>Thanks in advance,
>J. Chyun
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
YOU use $parsed_date[2] in stead of $parsed_end_date[2]

Op maandag 12 augustus 2002 00:01, schreef jc:
> The following bit of code completely baffles me as to why it doesn't work.
> I am doing a very simple validation where I check to see if the "end date"
> field of an inputted record is an older date than the "start date".
>
> I checked this by putting in the same date for both end and start dates.
> Yet mkdate gives me a different value for each even though since they are
> both the same date, I should get the same value returned.  Right?
>
> //notice the start and end date is the same.  Therefore, you should get the
> same value for each, right?
> <START LITTLE CODE SNIPPET>
>  $parsed_start_date=split("/", "08/02/2002");
>  $parsed_end_date=split("/", "08/02/2002");
>  $start_dts = mktime("", "", "", $parsed_start_date[0],
> $parsed_start_date[1], $parsed_start_date[2]);
>  $end_dts = mktime("", "", "", $parsed_end_date[0], $parsed_end_date[1],
> $parsed_date[2]);
>  if ($start_dts > $end_dts) {
>    echo "This function thinks the end date is older than the start date.";
>  }
>  else {
>    echo "Whoah, it actually worked.";
>  }
> <END LITTLE CODE SNIPPET>
>
> What am I not seeing?
> Thanks in advance,
> J. Chyun
--- End Message ---
--- Begin Message ---
Oh my God.  I had redone and ripped this apart for hours.  Errors like this 
make me realize how stupid I truly am.

Thank you for your help. :)  I can go on with life now.

J. Chyun

At 12:30 AM 8/12/2002 +0200, Bas Jobsen wrote:
>YOU use $parsed_date[2] in stead of $parsed_end_date[2]

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

where can I find the best source for a search engine and
a counter in PHP ?

thanks.


--- End Message ---
--- Begin Message ---
That would depend on what you want.

What sort of counter?
Hidden? Text file or database based?  Images or text on screen?  Per page?
Per site?


What sort of search engine?
Are you searching and indexing text files or text in a databases?  Are there
categories and search methods, or just something simple?


Really, if you ask an open question, you get an open answer.

There are hundreds of sources for free PHP scripts... there's no way we can
recommend something until we know what you want.  Perhaps you should search
them to try and find something that suits your needs, or to build up a
wish-list.


Justin




on 12/08/02 9:43 AM, Edgard Berendsen ([EMAIL PROTECTED]) wrote:

> Hello,
> 
> where can I find the best source for a search engine and
> a counter in PHP ?
> 
> thanks.
> 
> 

--- End Message ---
--- Begin Message ---
I just got a decent search engine from phpclasses.org ( I downloaded the
one by BasicA).
I modified it a little to add different page types to be returned and
other directories.
> That would depend on what you want.
>
> What sort of counter?
> Hidden? Text file or database based?  Images or text on screen?  Per page?
> Per site?
>
>
> What sort of search engine?
> Are you searching and indexing text files or text in a databases?  Are there
> categories and search methods, or just something simple?
>
>
> Really, if you ask an open question, you get an open answer.
>
> There are hundreds of sources for free PHP scripts... there's no way we can
> recommend something until we know what you want.  Perhaps you should search
> them to try and find something that suits your needs, or to build up a
> wish-list.
>
>
> Justin
>
>
>
>
> on 12/08/02 9:43 AM, Edgard Berendsen ([EMAIL PROTECTED]) wrote:
>
> > Hello,
> >
> > where can I find the best source for a search engine and
> > a counter in PHP ?
> >
> > thanks.
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-Pushkar S. Pradhan

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

> What sort of counter?
> Hidden? Text file or database based?  Images or text on screen?  Per page?
> Per site?

Hidden or not hidden, database or no database based, with or wtithout
images, per page or per site.

> What sort of search engine?
> Are you searching and indexing text files or text in a databases?  Are
there
> categories and search methods, or just something simple?

For searching HTML files, with cateogries.

Thanks




--- End Message ---
--- Begin Message ---
Edgard,

Check www.hotscripts.com for your needs - there is usually something 
there you can use or modify.

Best regards,
Andrew

On Sunday, August 11, 2002, at 08:24 PM, Edgard Berendsen wrote:

>
>> What sort of counter?
>> Hidden? Text file or database based?  Images or text on screen?  Per 
>> page?
>> Per site?
>
> Hidden or not hidden, database or no database based, with or wtithout
> images, per page or per site.
>
>> What sort of search engine?
>> Are you searching and indexing text files or text in a databases?  Are
> there
>> categories and search methods, or just something simple?
>
> For searching HTML files, with cateogries.
>
> Thanks
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hi Paul:

Thanks, that worked.

Cheers,
David
On Sunday, August 11, 2002, at 07:11 PM, Paul Colcutt wrote:

> Hi,
>
> you need to set the permissions for the directory youre creating the 
> file in.
> Try typing (or copy and paste):
>
> chmod  777  /Library/WebServer/Documents/dev
> into Terminal... should do the trick.
>
> Two neat apps you can use for setting permissions and ownership via a 
> GUI:
> 'Super GetInfo' by BareBones Software http://www.barebones.com/  and
> 'BatChmod' Freeware by Renaud Boisjoly  
> http://www.macchampion.com/arbysoft
>
>> Hi:
>>
>> I'm new to PHP.
>> I'm running Apache/PHP/MySQL on Mac OS X 10.1.5 (PHP 4.1.2) and 
>> everything is working well except that I cannot create a file through 
>> PHP. If I create a file I can subsequently read/write from PHP, but 
>> only after I change its file permissions to read/write for everyone.
>>
>> When I run the code:
>>
>> if (!file_exists($filename)) {
>>
>>      if (touch ($filename)) {
>>              print "$filename created";
>>      } else {
>>              die( "Sorry Could Not create $filename");
>>      }
>> }
>>
>> I get the following:
>>
>> Warning: unable to create file test.text because Permission denied in 
>> /Library/WebServer/Documents/dev/testcreate.php on line 10
>>
>> It's obviously a permissions problem but do not know what exactly to 
>> change nor where/how to change it.
>>
>> Thanks for any help.
>>
>> David
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> -- =======================
> Paul Colcutt
> http://www.paulcolcutt.co.uk

--- End Message ---
--- Begin Message ---
Seems good to me, only this part:

> and it will be checked if the mirror is randomly selected and
> if it is above 1200, will randomly select another server

  It's better to select those under 1200 right from the start. If you have
10 servers, you might make 9 checks before selecting the last one.

--
Julio Nobrega
Pode acessar:
http://www.inerciasensorial.com.br


"Andrew Conner" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
> I have a script (at bottom) that, upon loading, will randomly select a
> mirror or primary server (on average, the primary servers will be selected
> twice as much). It all works good, but now, I have to add a "quota
manager"
> that will, for both mirrors, limit the times the file can be downloaded to
> 1200 times (there is only one file being downloaded). I have thought about
> storing a text file for each of the two mirrors that shows the current
count
> of downloads, and it will be checked if the mirror is randomly selected
and
> if it is above 1200, will randomly select another server, and if it isn't,
> will just add one to it and update the file. How would I go about this, or
> is there a better way to do this?
> Thanks in advance.
> Andrew Conner
>
> The script (I know it doesn't use the best design, but it works, any
better
> ways of doing this?):
> ----------------
> <?
>
> // This array holds the servers, and has a double entry for the primary
> servers
>
> $adArr = array("http://www.someprimaryserver.com/file.exe";,
>
> "http://www.someprimaryserver.com/file.exe";,
>
> "http://www.someprimaryserver2.com/file.exe";,
>
> "http://www.someprimaryserver2.com/file.exe";,
>
> "http://www.someprimaryserver3.com/file.exe";,
>
> "http://www.someprimaryserver3.com/file.exe";,
>
> "http://www.someprimaryserver4.com/file.exe";,
>
> "http://www.someprimaryserver4.com/file.exe";,
>
> "http://www.somemirror.com/file.exe";,
>
> "http://www.somemirror2.com/file.exe";);
>
> // This randomly gets a server...
>
> srand((double)microtime()*1000000);
>
> $wOne = rand(0, 9);
>
> $choice = $adArr[$wOne];
>
> // This fwds the user to the server picked.
>
> // Somewhere in here needs to be the mirror stuff...
>
> header("Location: $choice");
>
> ?>
>
>
>


--- End Message ---
--- Begin Message ---
how about using the counter to store an id of the mirrors instead of 
randomly picking one? this will provide you a sequential traverse 
through all mirror sites.

if there are 10 sites, the counter will always be from 0 -> 9. this way 
each mirror site will have equal share on hits. so if the counter == 2, 
your script will know that the next hit will be to mirror site 2.

$_nextSite = (isset($_nextSite))?++$_nextSite % 10:0;

the above code will always ensure the counter counts from:
0 -> 9 -> 0 -> ...

this way, you can store all counters (into database?) on the main site 
for all mirrors.

> 
> "Andrew Conner" <[EMAIL PROTECTED]> escreveu na mensagem
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 
>>Hello,
>>I have a script (at bottom) that, upon loading, will randomly select a
>>mirror or primary server (on average, the primary servers will be selected
>>twice as much). It all works good, but now, I have to add a "quota
> 
> manager"
> 
>>that will, for both mirrors, limit the times the file can be downloaded to
>>1200 times (there is only one file being downloaded). I have thought about
>>storing a text file for each of the two mirrors that shows the current
> 
> count
> 
>>of downloads, and it will be checked if the mirror is randomly selected
> 
> and
> 
>>if it is above 1200, will randomly select another server, and if it isn't,
>>will just add one to it and update the file. How would I go about this, or
>>is there a better way to do this?
>>Thanks in advance.
>>Andrew Conner
>>
>>The script (I know it doesn't use the best design, but it works, any
> 
> better
> 
>>ways of doing this?):
>>----------------
>><?
>>
>>// This array holds the servers, and has a double entry for the primary
>>servers
>>
>>$adArr = array("http://www.someprimaryserver.com/file.exe";,
>>
>>"http://www.someprimaryserver.com/file.exe";,
>>
>>"http://www.someprimaryserver2.com/file.exe";,
>>
>>"http://www.someprimaryserver2.com/file.exe";,
>>
>>"http://www.someprimaryserver3.com/file.exe";,
>>
>>"http://www.someprimaryserver3.com/file.exe";,
>>
>>"http://www.someprimaryserver4.com/file.exe";,
>>
>>"http://www.someprimaryserver4.com/file.exe";,
>>
>>"http://www.somemirror.com/file.exe";,
>>
>>"http://www.somemirror2.com/file.exe";);
>>
>>// This randomly gets a server...
>>
>>srand((double)microtime()*1000000);
>>
>>$wOne = rand(0, 9);
>>
>>$choice = $adArr[$wOne];
>>
>>// This fwds the user to the server picked.
>>
>>// Somewhere in here needs to be the mirror stuff...
>>
>>header("Location: $choice");
>>
>>?>
>>
>>
>>
> 
> 

--- End Message ---
--- Begin Message ---
I've had a web site under development on my Win2k box at home. I built and
tested everything with PHP 4.2.2 and Apache 1.3.24.

Now, I have transitioned everything up to my host who is using a Linux box,
PHP 4.2.2 and Apache 1.3.26.

One of the pages I designed has code that retrieves a list of thumbnails
from a directory name passed into the page then embeds a hyperlink to a full
size version of the thumbnail. Incidentally, the full size version is in the
same directory as the thumbnail and has a very similar filename:
tn_000001.jpg and 000001.jpg (guess which one's the thumbnail).

Here's the problem:
When I run the page on the web host's server, the link to the full size
image dies. I've tracked the problem to the case of the linked filename.
Basically, unless the filename in the href matches the case of the target
file, the link dies and I get that nice, little red X indicating the link to
the image is broken.

For example, the target image DSC000001.JPG _MUST_ be referenced in the href
as: href='../path/to/resource/DSC000001.JPG' If I reference it as
href='../path/to/resource/dsc000001.jpg' the target image won't show up.

I have temporarily resolved the issue by designating the filename used in
the href as upper case using the strtoupper() function, but I can't believe
that's the way it's SUPPOSED to be done.

What I'd like to know is does the Linux server introduce case-sensitivity
issues? It doesn't seem to matter with the elements of the path, just the
target filename.

Help is appreciated.

Rich

--- End Message ---
--- Begin Message ---
Linux file systems are case sensitive... So the file Hello.php is different
to hello.php... Both can exist at the same time and contain different
content, but they are different...On the windows file system files aren't
case sensitive so Hello.php would be the same as hello.php...

So I suggest in your PHP coding that you get all the cases (of files) the
same throughout your app, or if you want to be lazy do what you are doing at
the moment (ie changing the case with strtoupper())

Andrew
----- Original Message -----
From: "Rich Hutchins" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 12, 2002 2:20 AM
Subject: [PHP] Case Sensitivity


> I've had a web site under development on my Win2k box at home. I built and
> tested everything with PHP 4.2.2 and Apache 1.3.24.
>
> Now, I have transitioned everything up to my host who is using a Linux
box,
> PHP 4.2.2 and Apache 1.3.26.
>
> One of the pages I designed has code that retrieves a list of thumbnails
> from a directory name passed into the page then embeds a hyperlink to a
full
> size version of the thumbnail. Incidentally, the full size version is in
the
> same directory as the thumbnail and has a very similar filename:
> tn_000001.jpg and 000001.jpg (guess which one's the thumbnail).
>
> Here's the problem:
> When I run the page on the web host's server, the link to the full size
> image dies. I've tracked the problem to the case of the linked filename.
> Basically, unless the filename in the href matches the case of the target
> file, the link dies and I get that nice, little red X indicating the link
to
> the image is broken.
>
> For example, the target image DSC000001.JPG _MUST_ be referenced in the
href
> as: href='../path/to/resource/DSC000001.JPG' If I reference it as
> href='../path/to/resource/dsc000001.jpg' the target image won't show up.
>
> I have temporarily resolved the issue by designating the filename used in
> the href as upper case using the strtoupper() function, but I can't
believe
> that's the way it's SUPPOSED to be done.
>
> What I'd like to know is does the Linux server introduce case-sensitivity
> issues? It doesn't seem to matter with the elements of the path, just the
> target filename.
>
> Help is appreciated.
>
> Rich
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Filesystems are meant to be case-sensitive, and yes, URL's are as well.
It's an abomination that Windows and old-style Mac filesystems are not.
You need to keep track of that in your code.  'a' and 'A' are just as
different as 'a' and 'b'.

-Rasmus

On Sun, 11 Aug 2002, Rich Hutchins wrote:

> I've had a web site under development on my Win2k box at home. I built and
> tested everything with PHP 4.2.2 and Apache 1.3.24.
>
> Now, I have transitioned everything up to my host who is using a Linux box,
> PHP 4.2.2 and Apache 1.3.26.
>
> One of the pages I designed has code that retrieves a list of thumbnails
> from a directory name passed into the page then embeds a hyperlink to a full
> size version of the thumbnail. Incidentally, the full size version is in the
> same directory as the thumbnail and has a very similar filename:
> tn_000001.jpg and 000001.jpg (guess which one's the thumbnail).
>
> Here's the problem:
> When I run the page on the web host's server, the link to the full size
> image dies. I've tracked the problem to the case of the linked filename.
> Basically, unless the filename in the href matches the case of the target
> file, the link dies and I get that nice, little red X indicating the link to
> the image is broken.
>
> For example, the target image DSC000001.JPG _MUST_ be referenced in the href
> as: href='../path/to/resource/DSC000001.JPG' If I reference it as
> href='../path/to/resource/dsc000001.jpg' the target image won't show up.
>
> I have temporarily resolved the issue by designating the filename used in
> the href as upper case using the strtoupper() function, but I can't believe
> that's the way it's SUPPOSED to be done.
>
> What I'd like to know is does the Linux server introduce case-sensitivity
> issues? It doesn't seem to matter with the elements of the path, just the
> target filename.
>
> Help is appreciated.
>
> Rich
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Subscribing 100% to the reply you got from Rasmus above, I'll just add 
that typically that's not a problem anyway because the files are 
generally created programatically (by the code) and once you set it 
right, you don't have to bother - although yes, it does seem odd when 
you first bump into this when migrating from Windows.

Just my 2c

Bogdan

--- End Message ---
--- Begin Message ---
The problem may be due to the fact that my environment is Apache Unix.

I spent about two hours today pouring over the php on-line manual 
"include" spec and trying dozens of combinations. 
http://www.php.net/manual/en/function.include.php

There must be at least 20 user contributed notes at the bottom.

It is incredible that such a basic php function should be so obtuse and 
ill defined.

I'm going to give your other suggestion a try tomorrow.

Thanks again....

Analysis & Solutions wrote:
> On Sun, Aug 11, 2002 at 12:33:55PM -0400, Al wrote:
> 
>>The .htaccess approach appears to fit my situation best; but, I've not 
>>been able to get it to work.
> 
> 
> I wondered about the DirectoryIndex directive's ability to utilize files 
> in other directories, so did a little test, which is what you indicated 
> you tried in your initial email:
> 
>    DirectoryIndex ../index.htm
> 
> Worked fine.  Apache 1.3.26.  Windows NT.
> 
> So, your problem could be a web server configuration thing, as Rasmus 
> hinted at.
> 
> Beyond the things already discussed, I'm at a loss.
> 
> Good luck,
> 
> --Dan
> 

--- End Message ---
--- Begin Message ---
What does include have to do with DirectoryIndex?  And what exactly is
your problem with include?  The only trick is setting the include_path
which doesn't seem all that obtuse to me.

-Rasmus

On Sun, 11 Aug 2002, Al wrote:

> The problem may be due to the fact that my environment is Apache Unix.
>
> I spent about two hours today pouring over the php on-line manual
> "include" spec and trying dozens of combinations.
> http://www.php.net/manual/en/function.include.php
>
> There must be at least 20 user contributed notes at the bottom.
>
> It is incredible that such a basic php function should be so obtuse and
> ill defined.
>
> I'm going to give your other suggestion a try tomorrow.
>
> Thanks again....
>
> Analysis & Solutions wrote:
> > On Sun, Aug 11, 2002 at 12:33:55PM -0400, Al wrote:
> >
> >>The .htaccess approach appears to fit my situation best; but, I've not
> >>been able to get it to work.
> >
> >
> > I wondered about the DirectoryIndex directive's ability to utilize files
> > in other directories, so did a little test, which is what you indicated
> > you tried in your initial email:
> >
> >    DirectoryIndex ../index.htm
> >
> > Worked fine.  Apache 1.3.26.  Windows NT.
> >
> > So, your problem could be a web server configuration thing, as Rasmus
> > hinted at.
> >
> > Beyond the things already discussed, I'm at a loss.
> >
> > Good luck,
> >
> > --Dan
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi..

Sorry to ask such a stoopid question here... but I really could not find anything on 
this...

How do I change the path of the php.ini file on Windows XP pro? I'm using IIS...

I just installed PHP on my web server and the path of the php.ini is c:\winnt but my 
is on c:\WINDOWS . So, how do I do this?

I tried searching over the web.... most of them talk about configuration.. I can't 
seemed to find anything on changing the path of the PHP.ini file.


THank you so much in advance.



Yours,
Wee Keat
--- End Message ---
--- Begin Message ---
Ok, I don't know if you already solved this, but you might want to do 
something like

$SerKeylist=rawurlencode(serialize($keylist));
print "<a href=\"/myscript.php?SerKeylist=$SerKeylist\">link</a>";

on the source end and

$keylist=unserialize($_GET["SerKeylist"]);

at the destination. This of course will build quite an URL for large 
arrays, so you might consider using a bit of JavaScript and a form at 
the source end in order to use POST instead of GET if needed.

HTH

Bogdan

David T-G wrote:
> Hi, all --
> 
> I collect field keys in an array that looks like
> 
>   $keylist = array('comment','job','spaced out key name','foo',...) ;
> 
> and would like to pass the array to myself in a call like
> 
>   print "<a href=\"/myscript.php?keylist=$keylist\">link</a>" ;
> 
> but when it's actually run it of course says
> 
>   ...keylist=Array...
> 
> which is quite bad.  I'd use a simple scalar
> 
>   $keylist = "comment job spaced out key name foo ..." ;
> 
> but, of course, those darned fields which have spaces embedded in the
> names will really mess that up.
> 
> How can I pass myself an array -- and recognize it on the receiving end?
> 
> 
> TIA & HAND
> 
> :-D

--- End Message ---
--- Begin Message ---
hi everyone!  i'm new here (and new to php) and have a question.  i'm trying
to run a simple blogger type script but am running into a problem i can't
seem to troubleshoot.  first, the three items i put into the database aren't
showing up on my page and then when i try to go to the archive for the
month, i get the following:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in /home/blar/public_html/inc/main_inc.php on line 11

here's a part of my code of main_inc (first line is line 11):
function showPosts($result,$page)
{
 if ($myrow = mysql_fetch_array($result))
 {
  do
  {
   $rawdate = $myrow["postDate"];
   $formdate = date("l, F j, Y",
(strtotime(ereg_replace('([0-9]*)-([0-9]*)-([0-9]*)','\2/\3/\1',
$rawdate))));
   if ($date != $formdate)
   {
    $date = $formdate;
    ?>

    <!-- Formatting for date -->
    <b><?=$formdate;?></b><br>
    &nbsp;<br>

    <?
   }
   if ($page == 1)
   {
    showArchivePost($myrow);
   }
   else
   {
    showMainPost($myrow);
   }
  }
  while ($myrow = mysql_fetch_array($result));
 }
}
/code

thank in advance for any help.  :)

jonni b.
http://blar.org
http://uglypropaganda.com

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

You should consider wrapping mysql_fetch_*() functions into a 
personalized function which also takes care of errors - at least for 
debugging. Your problem is typical - your query has some problems and 
mysql_run_query() returns a null result, which is indeed not a valid 
MySQL result resource. What you should do is to run something like

$result=mysql_run_query(<your SQL here>);
if (!$result) {
   echo("<B>MySQL query error in query </B><I>".
     <your SQL here>."</I><BR />\n");
   echo(mysql_error());
}

and debug the SQL. Now that's tedious to write for every, and that's why 
I was suggesting wrapping the thing into a function - but that's 
obviously not mandatory as long as you can debug it, right? :-)

Another idea while I'm on the topic, if you do create a wrapper, you may 
also consider sending yourself an e-mail if an error occurs after 
everything works right - that way you'll be able to track errors quickly 
- and impress your customers!

HTH

Bogdan

Jonni wrote:
> hi everyone!  i'm new here (and new to php) and have a question.  i'm trying
> to run a simple blogger type script but am running into a problem i can't
> seem to troubleshoot.  first, the three items i put into the database aren't
> showing up on my page and then when i try to go to the archive for the
> month, i get the following:
> 
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
> resource in /home/blar/public_html/inc/main_inc.php on line 11
> 
> here's a part of my code of main_inc (first line is line 11):
> function showPosts($result,$page)
> {
>  if ($myrow = mysql_fetch_array($result))
>  {
>   do
>   {
>    $rawdate = $myrow["postDate"];
>    $formdate = date("l, F j, Y",
> (strtotime(ereg_replace('([0-9]*)-([0-9]*)-([0-9]*)','\2/\3/\1',
> $rawdate))));
>    if ($date != $formdate)
>    {
>     $date = $formdate;
>     ?>
> 
>     <!-- Formatting for date -->
>     <b><?=$formdate;?></b><br>
>     &nbsp;<br>
> 
>     <?
>    }
>    if ($page == 1)
>    {
>     showArchivePost($myrow);
>    }
>    else
>    {
>     showMainPost($myrow);
>    }
>   }
>   while ($myrow = mysql_fetch_array($result));
>  }
> }
> /code
> 
> thank in advance for any help.  :)
> 
> jonni b.
> http://blar.org
> http://uglypropaganda.com
> 
> 

--- End Message ---
--- Begin Message ---
Hi all,

I'm setting up a curl operation with post fields, and I'm hoping someone can
tell me how the post fields are formatted.  I'm looking to pass a string to
curl_setopt( $ch, CURLOPT_POSTFIELDS, $string), but the specifications don't
tell one HOW to format the string.  Is it just like a GET string or what?
Anyone know?

Thanks,

Mike


--- End Message ---
--- Begin Message ---
Yes, the strings are formatted exactly like GET strings, but you'll have 
to build the whole HTTP header in front of them in order to get a valid 
HTTP request. So then, your code should look something like

$myvar1=rawurlencode($myvar1);
$myvar2=rawurlencode($myvar2);
$parsed="myvar1=$myvar1&myvar2=$myvar2";
$len=strlen($parsed)
$request="POST $request_path HTTP/1.0\r\n".
          "Content-Type: application/x-www-form-urlencoded\r\n".
          "User-Agent: My PHP application v1.0\r\n".
          "Host: $host\r\n".
          "Content-Length: $len\r\n".
          "Connection: Keep-Alive\r\n".
          "\r\n".         // This separates the header from the content
          $parsed;

After that, you send $request.

Bogdan

Mike Mannakee wrote:
> Hi all,
> 
> I'm setting up a curl operation with post fields, and I'm hoping someone can
> tell me how the post fields are formatted.  I'm looking to pass a string to
> curl_setopt( $ch, CURLOPT_POSTFIELDS, $string), but the specifications don't
> tell one HOW to format the string.  Is it just like a GET string or what?
> Anyone know?
> 
> Thanks,
> 
> Mike
> 
> 

--- End Message ---
--- Begin Message ---
Are you sure that the HTTP header should be on there?  I don't believe that
is correct.  It is the use of CURLOPT_POSTFIELDS with the curl_setopt
function that indicates that a POST is being made.

I just checked the code I used for credit card clearing & it does NOT
include the HTTP headers.  Just the POST data.

> -----Original Message-----
> From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 11, 2002 22:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: POST fields through CURL
>
>
> Yes, the strings are formatted exactly like GET strings, but you'll have
> to build the whole HTTP header in front of them in order to get a valid
> HTTP request. So then, your code should look something like
>
> $myvar1=rawurlencode($myvar1);
> $myvar2=rawurlencode($myvar2);
> $parsed="myvar1=$myvar1&myvar2=$myvar2";
> $len=strlen($parsed)
> $request="POST $request_path HTTP/1.0\r\n".
>           "Content-Type: application/x-www-form-urlencoded\r\n".
>           "User-Agent: My PHP application v1.0\r\n".
>           "Host: $host\r\n".
>           "Content-Length: $len\r\n".
>           "Connection: Keep-Alive\r\n".
>           "\r\n".         // This separates the header from the content
>           $parsed;
>
> After that, you send $request.
>
> Bogdan
>
> Mike Mannakee wrote:
> > Hi all,
> >
> > I'm setting up a curl operation with post fields, and I'm
> hoping someone can
> > tell me how the post fields are formatted.  I'm looking to pass
> a string to
> > curl_setopt( $ch, CURLOPT_POSTFIELDS, $string), but the
> specifications don't
> > tell one HOW to format the string.  Is it just like a GET
> string or what?
> > Anyone know?
> >
> > Thanks,
> >
> > Mike
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Duh, yes, of course, I'm stupid - I forgot you were talking about Curl - 
I never used it so it may be the way you say it is. The piece of code I 
sent you was a part of what I used to build a full HTTP request 
(connecting to the server and sending it - everything done by hand), and 
Curl may be building the header instead.

Curl *should* typically get the string preparsed though, so I may not be 
completely off with the code - but then again, I can't be certain.

Sorry for the mishap!

Bogdan

Jonathan Rosenberg wrote:
> Are you sure that the HTTP header should be on there?  I don't believe that
> is correct.  It is the use of CURLOPT_POSTFIELDS with the curl_setopt
> function that indicates that a POST is being made.
> 
> I just checked the code I used for credit card clearing & it does NOT
> include the HTTP headers.  Just the POST data.
> 
> 
>>-----Original Message-----
>>From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
>>Sent: Sunday, August 11, 2002 22:36 PM
>>To: [EMAIL PROTECTED]
>>Subject: [PHP] Re: POST fields through CURL
>>
>>
>>Yes, the strings are formatted exactly like GET strings, but you'll have
>>to build the whole HTTP header in front of them in order to get a valid
>>HTTP request. So then, your code should look something like
>>
>>$myvar1=rawurlencode($myvar1);
>>$myvar2=rawurlencode($myvar2);
>>$parsed="myvar1=$myvar1&myvar2=$myvar2";
>>$len=strlen($parsed)
>>$request="POST $request_path HTTP/1.0\r\n".
>>          "Content-Type: application/x-www-form-urlencoded\r\n".
>>          "User-Agent: My PHP application v1.0\r\n".
>>          "Host: $host\r\n".
>>          "Content-Length: $len\r\n".
>>          "Connection: Keep-Alive\r\n".
>>          "\r\n".         // This separates the header from the content
>>          $parsed;
>>
>>After that, you send $request.
>>
>>Bogdan
>>
>>Mike Mannakee wrote:
>>
>>>Hi all,
>>>
>>>I'm setting up a curl operation with post fields, and I'm
>>
>>hoping someone can
>>
>>>tell me how the post fields are formatted.  I'm looking to pass
>>
>>a string to
>>
>>>curl_setopt( $ch, CURLOPT_POSTFIELDS, $string), but the
>>
>>specifications don't
>>
>>>tell one HOW to format the string.  Is it just like a GET
>>
>>string or what?
>>
>>>Anyone know?
>>>
>>>Thanks,
>>>
>>>Mike
>>>
>>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
> 
> 

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


Hello!

First of all, i am trying to solve this problem for more then a week now, i 
looked through php.net for hours and have posted on numerous boards but 
nobody could come up and tell me what is going wrong.

Basically, i have two multidimensional arrays, and i want to compare those 
two using array_diff().

The problem is, that the output given is ecxactly the opposite of what i want.

To make it easier for those willing to help, i placed the sample code in a 
textfile so you can view it there.

http://www.thebounceroom.com/problem.txt

PLEASE, if you have some spare time have a look and tell me why this is not 
working as it should, as by now i am really frustrated, ive lost a whole week
by now and everybody else has to wait just because of me.

Thanks a lot in advance for your time reading this!

With best regards from Vienna,
Jürgen




--- End Message ---
--- Begin Message ---
First of all, which OS and PHP version?

On Mon, 12 Aug 2002, Gandalf wrote:

>
>
> Hello!
>
> First of all, i am trying to solve this problem for more then a week now, i
> looked through php.net for hours and have posted on numerous boards but
> nobody could come up and tell me what is going wrong.
>
> Basically, i have two multidimensional arrays, and i want to compare those
> two using array_diff().
>
> The problem is, that the output given is ecxactly the opposite of what i want.
>
> To make it easier for those willing to help, i placed the sample code in a
> textfile so you can view it there.
>
> http://www.thebounceroom.com/problem.txt
>
> PLEASE, if you have some spare time have a look and tell me why this is not
> working as it should, as by now i am really frustrated, ive lost a whole week
> by now and everybody else has to wait just because of me.
>
> Thanks a lot in advance for your time reading this!
>
> With best regards from Vienna,
> Jürgen
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
You really should also do a bit of work to make it easy for people to help
you.  I just spent 5 minutes decyphering your text file so I could
reproduce your problem using this script:

<?
  $array1 = array( array("aus_name"=>"Videografik",  "aus_id"=>"1"),
                   array("aus_name"=>"Webdesign",    "aus_id"=>"2"),
                   array("aus_name"=>"gfg fd",       "aus_id"=>"3"),
                   array("aus_name"=>"df fds dfsdf", "aus_id"=>"4"),
                   array("aus_name"=>"fdf'' dfd fds","aus_id"=>"5"));

  $array2 = array( array("aus_name"=>"Webdesign",    "aus_id"=>"2"),
                   array("aus_name"=>"Videografik",  "aus_id"=>"1"));

  $n=0;
  foreach ($array2 as $diff) {
    $diff[$n]=array_diff($array1[$n], $array2[$n]);
    $all[] = array ("aus_name" => $diff[$n][aus_name], "aus_id" => $diff[$n][aus_id]);
    $n++;
  }

  var_dump ($all);
?>

This is 5 minutes I normally wouldn't have spent and would just have
skipped over your question because there was too much work for me.

So, looking at this code, let's manually look at what happens in that
foreach() loop of yours.  You end up comparing the first element in array1
with the first element of array2 and on the second iteration you compare
the second element of array1 with the second element of array2.  Like
this:

array("aus_name"=>"Videografik",  "aus_id"=>"1") vs.
array("aus_name"=>"Webdesign",    "aus_id"=>"2")

and

array("aus_name"=>"Webdesign",    "aus_id"=>"2") vs.
array("aus_name"=>"Videografik",  "aus_id"=>"1")

Now, the documentation for array_diff() states:

 array_diff() returns an array containing all the values of array1  that
 are not present in any of the other arguments. Note that keys are
 preserved.

So, by looking at what you are comparing, and keeping what the
array_diff() function is documented to do in mind, we would expect an
output of:

array("aus_name"=>"Videografik",  "aus_id"=>"1") the first time through
the loop as neither "Videografik" nor "1" appears in the second array
which consists of array("aus_name"=>"Webdesign",    "aus_id"=>"2") and the
same goes for the second iteration.

So, the output you are getting is exactly what you coded.

Your main mistake:

 You forgot that PHP arrays are ordered.  That is, the order by which
 elements are inserted is the order in which they appear when you loop
 through them with foreach.  This resulted in you not comparing
 equivalent aus_id elements with each other.

 You also don't seem to handle the difference in the number of elements
 anywhere.  If both sets starts with aus_id at 1 and go up from there, it
 is clear that if array1 has 5 elements and array2 only has 2, then aus_id
 3, 4 and 5 from array1 are the different without even checking.  You
 probably did realize this, and that is why you are doing the foreach()
 over array2, but nowhere do you put these last 3 elements into your
 difference array.

I think the easiest way to handle this is to rethink your problem.
Assuming you won't always have incrementing aus_id's the way you do and
you don't know whether array1 or array2 will have more elements, I would
suggest making a temp array keyed on the aus_id sorted correctly.  Not
very hard to do, just do this:

  foreach($array1 as $elem) $ar1[$elem['aus_id']] = $elem['aus_name'];
  foreach($array2 as $elem) $ar2[$elem['aus_id']] = $elem['aus_name'];
  ksort($ar1); ksort($ar2);

Now, the real benefit of this approach is that you just need to call
array_diff() once to get the diff you want.  So here is the rewritten test
script:

  $array1 = array( array("aus_name"=>"Videografik",  "aus_id"=>"1"),
                   array("aus_name"=>"Webdesign",    "aus_id"=>"2"),
                   array("aus_name"=>"gfg fd",       "aus_id"=>"3"),
                   array("aus_name"=>"df fds dfsdf", "aus_id"=>"4"),
                   array("aus_name"=>"fdf'' dfd fds","aus_id"=>"5"));

  $array2 = array( array("aus_name"=>"Webdesign",    "aus_id"=>"2"),
                   array("aus_name"=>"Videografik",  "aus_id"=>"1"));

  foreach($array1 as $elem) $ar1[$elem['aus_id']] = $elem['aus_name'];
  foreach($array2 as $elem) $ar2[$elem['aus_id']] = $elem['aus_name'];
  ksort($ar1); ksort($ar2);

  $diff = array_diff($ar1,$ar2);

  var_dump($diff);

It's shorter, faster and it works.

-Rasmus


On Mon, 12 Aug 2002, Gandalf wrote:

> Win2k Pro and the latest PHP Version
>
> At 21:17 11.08.2002 -0700, you wrote:
> >First of all, which OS and PHP version?
> >
> >On Mon, 12 Aug 2002, Gandalf wrote:
> >
> > >
> > >
> > > Hello!
> > >
> > > First of all, i am trying to solve this problem for more then a week now, i
> > > looked through php.net for hours and have posted on numerous boards but
> > > nobody could come up and tell me what is going wrong.
> > >
> > > Basically, i have two multidimensional arrays, and i want to compare those
> > > two using array_diff().
> > >
> > > The problem is, that the output given is ecxactly the opposite of what
> > i want.
> > >
> > > To make it easier for those willing to help, i placed the sample code in a
> > > textfile so you can view it there.
> > >
> > > http://www.thebounceroom.com/problem.txt
> > >
> > > PLEASE, if you have some spare time have a look and tell me why this is not
> > > working as it should, as by now i am really frustrated, ive lost a
> > whole week
> > > by now and everybody else has to wait just because of me.
> > >
> > > Thanks a lot in advance for your time reading this!
> > >
> > > With best regards from Vienna,
> > > Jürgen
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
> Jürgen (aka. Frodo the scribe
> ======================
> Visit the MECCG Forums at
> http://www.coen.at.tf

--- End Message ---
--- Begin Message ---
I have a .php file whose purpose, ultimately, is to set one variable;
$hotspot.  Now I want to include that var in a bunch of places in my html
page (it must remain html).  So this was my thought.  In the <head> include
the following:

<script language="php" src="hotspot.php"></script>

and then anywhere in the html doc I want to print the value of $hotspot I
type:

<?=$hotspot?>

but it doesn't work.  I have a feeling I cant include a php script that way
because in trying to debug the problem I made the first line of hotspot.php
= echo "test"; and the word test never shows.  What am I missing?

Thnks
Alex




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

You're missing the distinction between a server-side script (PHP) and a 
client-side script (JavaScript, VB etc). When you use the syntax you 
used, the browser attempts to download the src and execute it - and it 
can't do that, because in the best case the php code runs on the server 
and returns "test" (your echo()) and then it "tries" to run that as php 
code, which again it doesn't know how. It does work for JavaScript 
however, because it downloads the JavaScript file (which is plain text) 
and then executes the code (because it knows how to execute JavaScript).

What you should do would be write
<? include("hotspot.php"); ?>
instead of "<script language... etc".

Bogdan

Alexander Ross wrote:
> I have a .php file whose purpose, ultimately, is to set one variable;
> $hotspot.  Now I want to include that var in a bunch of places in my html
> page (it must remain html).  So this was my thought.  In the <head> include
> the following:
> 
> <script language="php" src="hotspot.php"></script>
> 
> and then anywhere in the html doc I want to print the value of $hotspot I
> type:
> 
> <?=$hotspot?>
> 
> but it doesn't work.  I have a feeling I cant include a php script that way
> because in trying to debug the problem I made the first line of hotspot.php
> = echo "test"; and the word test never shows.  What am I missing?
> 
> Thnks
> Alex
> 
> 
> 
> 

--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, list+php-
[EMAIL PROTECTED] says...
> Hi,
> 
> I just noticed a little problem(?) while using databases.
> 
> Some time ago I wrote myself a little class that made it easier to
> handly my mysql-tasks. The class connected to a database and used a
> query like "use $database" to switch to the given database.
> 
> This worked without a problem just as in the command-line tool "mysql",
> today however I had a database called like "data-ba_se". 
> 
> "use"ing it gave me a note "cannot use database data-ba_se" as result.
> However it worked in the command-line mysql and it works using
> mysql_select_db(). Login, Database and password were checked for typo's
> of course.
> 
> PHP is 4.1.2, default woody-package.
> 
> Any idea what can be the reason for this?
> 
>      Balu
> 

The underscore is a mysql wildcard for a single character; it may be that 
mysql is attempting to treat it as a wildcard rather than a literal in the 
circumstances in which you are using it.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
www.phpide.de

An excellent PHP IDE for windows. Color coding, Syntax hints(tool tips
type), auto indent etc...

Lord Loh.


--- End Message ---
--- Begin Message ---
Good morning everyone!

Our organization is in need of a Scheduling program for meeting rooms.  The 
program doesn't need to be very complicated...five or six rooms, outputs a 
list of rooms available for the time the user enters.  We would put it on 
our intranet.

We could also use a basic staff directory program: Outputs Name, Extension, 
email, position... maybe even a picture.  We would put it on our web site.

Lastly, we could use something to keep track of our workflow program 
otherwise referred to as a strategic plan.  

Does anyone have some code laying around or know where I could find some.  
I see no need to recreate something that I am confident many organizations 
have.

Thanks in advance,
Paul
--- End Message ---
--- Begin Message ---
on 12/08/02 5:59 PM, Paul Dionne ([EMAIL PROTECTED]) wrote:

> Good morning everyone!
> 
> Our organization is in need of a Scheduling program for meeting rooms.  The
> program doesn't need to be very complicated...five or six rooms, outputs a
> list of rooms available for the time the user enters.  We would put it on
> our intranet.

see below

> We could also use a basic staff directory program: Outputs Name, Extension,
> email, position... maybe even a picture.  We would put it on our web site.

This is just a modification of a contact database.  Nearly every PHP & MySQL
beginners tutorial starts with a simple contact database which you can
modify to suit.

I'd really advise actually learning a bit of this stuff, rather than
grabbing something pre-built.  End of the day, nothing will have *exactly*
the features you need (now, or the future), and learning a little about the
two languages will help you build the meeting room program, which no harder
to build than the contact database.

I think phpbuilder.net, sitepoint.com, phpbeginner.com and a few others are
bound to have something you should use as a starting point.


> Lastly, we could use something to keep track of our workflow program
> otherwise referred to as a strategic plan.

Workflow IS a more complex application.


Have a look around at places like sourceforge.net for simular applications.
Again, having a little bit of knowledge from your work with contact database
and meeting room schedules will help you to modify these apps to suit.


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

First off, I've tried every option to get this working I could find in the
past few days. I am trying to use the php4apache2.dll as a module in apache.
I've tried changing the quotations and the direction of the slashes on the
LoadModule line in the httpd.conf file. I've also tried copying the
php4apache2.dll into the \apache2\modules\ directory and changing the
httpd.conf file appropriately. Still no joy. What pisses me off is I have
the same setup at my workstation at work and everything is fine. The only
difference is that everything is loaded on the C drive. Is that what is
causing the problem by chance?
Any help would be greatly appreciated.

Versions:
Windows 2000 SP2
PHP 4.2.2
Apache 2.0.40

The error message I get is as follows:
D:\Program Files\Apache Group\Apache2\bin>apache -t
Syntax error on line 173 of D:/Program Files/Apache
Group/Apache2/conf/httpd.conf:
Cannot load D:/php/sapi/php4apache2.dll into server: The specified procedure
could not be found.

My install paths are:
PHP:    d:\php\
Apache:         d:\program files\apache group\apache2\

I've added the following lines in my httpd.conf file:
LoadModule php4module d:/php/sapi/php4apache2.dll
AddModule mod_php.c
AddType application/x-httpd-php .php

I've also put the php.ini and php4ts.dll files in c:\winnt.


--- End Message ---
--- Begin Message ---
I have had the sam problem in the past and have found out that it was a
space in the path to the file. Try renameing the folder to apache_groups and
see if that helps. My problem wasen't exactly the same as yours it did deal
with another module that I was installing.

Josh Thomas
RPS Internet Services

-----Original Message-----
From: Carl Brandenburg [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 12, 2002 2:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Installin PHP as a module


Hello everyone,

First off, I've tried every option to get this working I could find in the
past few days. I am trying to use the php4apache2.dll as a module in apache.
I've tried changing the quotations and the direction of the slashes on the
LoadModule line in the httpd.conf file. I've also tried copying the
php4apache2.dll into the \apache2\modules\ directory and changing the
httpd.conf file appropriately. Still no joy. What pisses me off is I have
the same setup at my workstation at work and everything is fine. The only
difference is that everything is loaded on the C drive. Is that what is
causing the problem by chance?
Any help would be greatly appreciated.

Versions:
Windows 2000 SP2
PHP 4.2.2
Apache 2.0.40

The error message I get is as follows:
D:\Program Files\Apache Group\Apache2\bin>apache -t
Syntax error on line 173 of D:/Program Files/Apache
Group/Apache2/conf/httpd.conf:
Cannot load D:/php/sapi/php4apache2.dll into server: The specified procedure
could not be found.

My install paths are:
PHP:    d:\php\
Apache:         d:\program files\apache group\apache2\

I've added the following lines in my httpd.conf file:
LoadModule php4module d:/php/sapi/php4apache2.dll
AddModule mod_php.c
AddType application/x-httpd-php .php

I've also put the php.ini and php4ts.dll files in c:\winnt.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Hi
I have posted here about session problems etc, but I think I found the
problem:
My Form variables are not passed at all!

Look at this:

index.php

<form action="page2.php" method="POST" enctype="multipart/form-data">
  <input type="text" name="test"><input type="submit" name="submit">
</form>


page2.php

<?php
echo " HTTP_POST_VARS :".$_HTTP_POST_VARS["test"]."<br>";
echo " POST_VARS: ".$_POST["test"]."<br>";
echo " normal test :".$test."<br>";
?>

I have installed a "everything" RedHat 7.3 installation, and changed
NOTHING to the default php.ini...


Can anyone help?




--- End Message ---
--- Begin Message ---
Sorry, posted with the wrong address, here it is again:

I have RH 7.3 with "everything" install, and I didn't make ANY changes
to the default php.ini, and have checked it and register_global = On

Now, when I make a simple form and action page combo, the variables are
not passed:
You can see from this example that I use to test that I use all methods
possible to check where the values are, but all return blank...




index.php
<form action="page2.php" method="POST" >
  <input type="text" name="test"><input type="submit" name="submit">
</form>

page2.php
<?php
echo " HTTP_POST_VARS :".$_HTTP_POST_VARS["test"]."<br>";
echo " POST_VARS: ".$_POST["test"]."<br>";
echo " normal test :".$test."<br>";
?>

What could cause this?


--- End Message ---

Reply via email to