[PHP] call a website from a php script

2003-02-16 Thread christian tischler
can anybody tell me please how to "call" a website from a php script.

meaning
if (something happens) {goto www.google.com} else {goto www.yahoo.com}

tanks,

christian



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




php-general Digest 16 Feb 2003 10:40:57 -0000 Issue 1886

2003-02-16 Thread php-general-digest-help

php-general Digest 16 Feb 2003 10:40:57 - Issue 1886

Topics (messages 135707 through 135730):

Re: Variables from the Form wouldn't transfer to my process page
135707 by: Jason Wong
135714 by: Geckodeep
135724 by: Jason Wong

processing status page
135708 by: Brendon
135710 by: Ray Hunter
135712 by: Brendon
135713 by: Ray Hunter

Re: Compiling php 4.3.0 and oracle
135709 by: Bradley C. Goldsmith

changing table  column height in xml
135711 by: Sunfire

Re: Delivery Status Notification (Failure)]
135715 by: Geckodeep

Re: permissions to work with fopen
135716 by: Nicholas Wieland

Re: Block direct image loads but allow them in PHP
135717 by: Justin French

forking sendmail
135718 by: Brendon
135719 by: Manuel Lemos

Re: HTML Mail problem
135720 by: Manuel Lemos

Forms Help (continued)
135721 by: Beauford.2002
135722 by: Kevin Waterson
135725 by: Ray Hunter
135726 by: Beauford.2002
135727 by: Kevin Waterson

PHP error messages
135723 by: Brad Esclavon

Duh uuh ?
135728 by: John Taylor-Johnston
135729 by: Manuel Lemos

call a website from a php script
135730 by: christian tischler

Administrivia:

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

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

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


--

--- Begin Message ---
On Sunday 16 February 2003 03:37, Geckodeep wrote:
> I have these forms with one having pull down menu having data coming from a
> table which is working and I have set two variables one for ID and the
> other for the TEXT.
> The problem that I am facing is that when the form is submitted the ID
> variable is well taken into consideration and can see the value on the
> process page which is then inserted into the table. The TEXT variable which
> I set apparently for some reason it wouldn't show up.

Which is the TEXT variable that you're referring to? And where does 
$rubriqueid come from? 

[snip]

> Her is the part of the code from the first Form submit page
>  action="../form_pro.php">
> 
> Please choose your category
>  while ($row = mysql_fetch_array($result_cat)){
>  $catid = $row["cat_id"];
>  $catname = $row["cat_text"];
>  echo("$catname\n");
> }
> ?>
> 
> html code
>
> 
> 
> 
> 
>
> code on the Form process page
>
> Catagory 

Have you looked at the HTML source to see whether it looks OK?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I don't have any solution but I certainly admire the problem.
-- Ashleigh Brilliant
*/


--- End Message ---
--- Begin Message ---
hi Jason
The TEXT variable is $catname and the $rubriqueid is a mistake it is
actually $catid but it is not that giving the problem. It is an error from
my part when I posted it.

My html looks ok.

I should tell you though that this page is on the admin section which is
under a login session script I use, which was recommended by some one on the
forum.

The script is in the include folder and the file is called access.php and I
include this file in every Php files found in the admin folder.

So if I have to think of using the session for my problem in passing the
variables, can I use session_register("$catid") in the forum page to
register and start new session or should I include it in the login script
where there is already password, userid and the user name registered.

Is it possible to start a new session for these two form pages and register
the variables, will it co-habit with the existing session? I am pretty
confused with session; I've checked the Php manual and couldn't really get
the gist of it.



Thanks for any help in advance.

gd



"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Sunday 16 February 2003 03:37, Geckodeep wrote:
> > I have these forms with one having pull down menu having data coming
from a
> > table which is working and I have set two variables one for ID and the
> > other for the TEXT.
> > The problem that I am facing is that when the form is submitted the ID
> > variable is well taken into consideration and can see the value on the
> > process page which is then inserted into the table. The TEXT variable
which
> > I set apparently for some reason it wouldn't show up.
>
> Which is the TEXT variable that you're referring to? And where does
> $rubriqueid come from?
>
> [snip]
>
> > Her is the part of the code from the first Form submit page
> >  > action="../form_pro.php">
> > 
> > P

Re: [PHP] call a website from a php script

2003-02-16 Thread Ernest E Vogelsinger
At 11:40 16.02.2003, christian tischler said:
[snip]
>can anybody tell me please how to "call" a website from a php script.
>
>meaning
>if (something happens) {goto www.google.com} else {goto www.yahoo.com}
[snip] 

I believe you mean to redirect the browser to a website?

header('Location: http://www.google.com/');

Or to "incorporate" (speak steal) the website?

readfile('http://www.google.com');

Or to fetch the site to analyze it?

$hf = fopen('http://www.google.com/') or die('Cannot open google');
$buffer = null;
while ($chunk = fread($hf, 4096))
$buffer .= $chunk;
fclose($hf);
// analyze and process buffer

Enjoy :)


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




[PHP] htDig on PHP pages

2003-02-16 Thread David McInnis
Most of the content on my site is generated dynamically by PHP out of a
MySQL database.  This is causing me problems when indexing the site.
Since pages are created dynamically htDig records the current date as
the date the document was created.  I need the create date to be the
create date from the date recorded in the database when the document /
record was added and NOT the date/time that PHP generates the document.

I am hoping that I can pass a date / timestamp in the header.

Any ideas?  Or did I confuse everyone.

David McInnis



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




Re: [PHP] permissions to work with fopen

2003-02-16 Thread qt
Tahnk you,

but I don't want to let web user see the log file


"Nicholas Wieland" <[EMAIL PROTECTED]> wrote in message
20030216011528.GA1411@localhost">news:20030216011528.GA1411@localhost...
> On 2003.02.15 20:11 qt wrote:
> > I am planning to make a log file with fopen command.
> >
> > I am succesfully read and write the file with fopen. But as I see
> > fopen is requiring a file with read and write permission for public.
>
> Not for public, for your webserver user, www-data or another similar
> name.
>
> > I was using same method with perl in cgi-bin directory; but I was
> > giving read and write permission for only owner.
> >
> > If I give write and read permission for only owner; fopen command can
> > not read the file.
> >
> > Do you have any idea, how can I make log file with protecting from
> > public?
>
> Give pemissions to your web server user.
>
> Cheers
> Nicholas



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




[PHP] date calculation

2003-02-16 Thread qt
Dear Sirs,

How can I add or subtract two date easily. Is therea any lib or function
about this. I can not find any easy way in the manual

Best Regards



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




[PHP] database selection

2003-02-16 Thread H Prins
Hello,

Im trying to select only one row in a mysql database (in this case a poll
with the smallest pollID)...
Each row has a field called "pollID" which is the primary key and is auto
incremented when a new row is inserted.

I could possible do the following but I think its a bit extensive:

$query = "SELECT * FROM polls ORDER BY pollID ASC";
$result = mysql_query($query);
for ($count = 0; $count < 1 $count++) {
$data = mysql_fetch_array($result);
$pollID = $data['pollID'];
}
$query = "SELECT * FROM polls WHERE pollID = $pollID";

Does anyone now a solution for this that requires less code?

Thx


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




Re: [PHP] Variables from the Form wouldn't transfer to my process page

2003-02-16 Thread Geckodeep
Hi Jason

Man you are great, well indeed I stumbled on my stupidity by putting the
hidden name instead of making it unique I've rectified it.

The reason for passing this variable to the next page is the cats table is
only needed in the first form and the name of the cat is just printed on the
following page untill the final result page. I could have looked it up again
on the table on my next form part but thinking of saving the resource I
thought of going for the option of passing the variable.



Well I managed to do by passing the variable enclosing it in the Php tag
like this soloution found on the Forum:

 at least
t is getting transferred but I have the problem like you mentioned, it is
only showing the last element on the table no matter what is selected on the
drop down menu. I didn't know that I could pass two values together inside
the option tag like you've shown . If I
choose this would I need to do a while loop to get the catname or will it
find it along the catid.

Let me try without the while loop.



Thanks again Jason.



gd


"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Sunday 16 February 2003 09:21, Geckodeep wrote:
>
> > My html looks ok.
>
> Are you sure?
>
> > The TEXT variable is $catname and the $rubriqueid is a mistake it is
> > actually $catid but it is not that giving the problem. It is an error
from
> > my part when I posted it.
>
> How are you passing $catname onto the next page? I presume via the hidden
> input element? AFAICS from your code (and you can spot this straight away
> from the HTML source) you only have a hidden input element for the last
value
> of $catname retrieved from the DB. Thus you need to move them inside the
> while-loop. However your hidden input elements are all named 'hidden'
which
> isn't very helpful -- give them unique names.
>
> The real question is why /are/ you passing $catname to the next page?
$catid
> is the unique identifier so why do you need $catname on the next page? You
> can always lookup $catname from the DB on the next page if you need it. If
> you don't want to look it up again then I suggest putting both $catid and
> $catname into the option value ...
>
>   $catname
>
> ... then extract the two parts on the following page.
>
> Depending on what characters gets stored in $catname you may need to run
it
> through htmlspecialchars().
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Q: How did you get into artificial intelligence?
> A: Seemed logical -- I didn't have any real intelligence.
> */
>



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




[PHP] database selection

2003-02-16 Thread Hans Prins
Hello,

Im trying to select only one row in a mysql database (in this case a poll
with the smallest pollID)...
Each row has a field called "pollID" which is the primary key and is auto
incremented when a new row is inserted.

I could possible do the following but I think its a bit extensive:

$query = "SELECT * FROM polls ORDER BY pollID ASC";
$result = mysql_query($query);
for ($count = 0; $count < 1 $count++) {
$data = mysql_fetch_array($result);
$pollID = $data['pollID'];
}
$query = "SELECT * FROM polls WHERE pollID = $pollID";

Does anyone now a solution for this that requires less code?

Thx



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




Re: [PHP] database selection

2003-02-16 Thread Kevin Waterson
This one time, at band camp,
"H Prins" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> Im trying to select only one row in a mysql database (in this case a poll
> with the smallest pollID)...


$query = "SELECT * FROM polls ORDER BY pollID ASC LIMIT 1";

Kevin

-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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




[PHP] Re: date calculation

2003-02-16 Thread Fred Merritt
Qt,
	The easiest way is to convert your dates into a serial day number(i.e. 
the number of days that have elapsed between your date, and some 
arbitrary date in the dim and distant past - I think PHP uses 25th 
November, -4714).  There are some calendar functions in php that will do 
this for you.  Once you have your dates as a numeric offset, you can 
subtract them to get a the number of days between the dates, or you can 
add or subtract a number of days to get a new offset.  Once you have the 
new offset, there are reverse calendar functions in php, to convert your 
new offset back to a calendar date.

Check out the functions GregorianToJD(), and JDToGregorian(), in the 
Calendar functions of the PHP manual.  If you do not have access to the 
calendar functions in your version of php, there are also a couple of 
examples how to do one of the conversions written in PHP, in the user 
contributed notes of the manual.  There are also many published articles 
describing algorithms on how to do this.  I can remember implementing 
these functions in 1977(Not in PHP of course), from an article published 
in the journal of the ACM, in 1963.

Hope this helps. . . Fred

Qt wrote:
Dear Sirs,

How can I add or subtract two date easily. Is therea any lib or function
about this. I can not find any easy way in the manual

Best Regards





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




Re: [PHP] date calculation

2003-02-16 Thread Kevin Waterson
This one time, at band camp,
"qt" <[EMAIL PROTECTED]> wrote:

> Dear Sirs,
> 
> How can I add or subtract two date easily. Is therea any lib or function
> about this. I can not find any easy way in the manual

if the dates are timestamps, simply

$new = $timestamp2 - $timestamp1;

cheers
Kevin

-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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




[PHP] Re: [PHP-DEV] how to call a website from within a php script

2003-02-16 Thread Sebastian Bergmann
christian tischler wrote:
> Can anybody tell me how to call a website from within a php script.

  Please ask user questions on the [EMAIL PROTECTED] list.

-- 
  Sebastian Bergmann
  http://sebastian-bergmann.de/ http://phpOpenTracker.de/

  Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

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




[PHP] Re: [PHP-DEV] database select

2003-02-16 Thread Sebastian Bergmann
Hans Prins wrote:
> [...]

  Please ask user questions on the [EMAIL PROTECTED] list.

-- 
  Sebastian Bergmann
  http://sebastian-bergmann.de/ http://phpOpenTracker.de/

  Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

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




[PHP] Re: database selection

2003-02-16 Thread Thomas Seifert
On Sun, 16 Feb 2003 12:51:58 +0100 [EMAIL PROTECTED] (Hans Prins) wrote:

> Hello,
> 
> Im trying to select only one row in a mysql database (in this case a poll
> with the smallest pollID)...
> Each row has a field called "pollID" which is the primary key and is auto
> incremented when a new row is inserted.
> 
> I could possible do the following but I think its a bit extensive:
> 
> $query = "SELECT * FROM polls ORDER BY pollID ASC";
> $result = mysql_query($query);
> for ($count = 0; $count < 1 $count++) {
> $data = mysql_fetch_array($result);
> $pollID = $data['pollID'];
> }
> $query = "SELECT * FROM polls WHERE pollID = $pollID";
> 
> Does anyone now a solution for this that requires less code?
> 
> Thx
> 
> 

$query = "SELECT * FROM polls ORDER BY pollID ASC LIMIT 1";


Thats the only row.



Regards,
-- 
Thomas Seifert

mailto:[EMAIL PROTECTED]
http://www.MyPhorum.de 

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




[PHP] Fw: Help Needed for Beginners trying to configure Correctly

2003-02-16 Thread D'habi Arabians

- Original Message -
From: "Gabor Hojtsy" <[EMAIL PROTECTED]>
To: "D'habi Arabians" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; "Northwind Arabians" <[EMAIL PROTECTED]>
Sent: Sunday, February 16, 2003 2:14 AM
Subject: Re: Help Needed for Beginners trying to configure Correctly


> Please forward user questions to [EMAIL PROTECTED]
>
> Goba
>
>
> D'habi Arabians wrote:
> > We are using ISS server and using Dreamweaver with the php
> >
> > We cannot get our test message to come up unless we go around msql.dll
> >
> > We have reinstalled everything.  We believe the problem is in
> > The problem is in line 1 of php.exe but we do not know how to comply.
> >
> >
> >
> > WE would really appreciate your help.
> >
> > Liz Kirmis and Pat Hampton
> >
> > This is the error message:
> >
> > X-Powered-By: PHP/4.2.3^C
> >
> > C:\PHP>php.exe
> >
> > Content-type: text/html
> >
> > PHP Warning: Unable to load dynamic library './extensions/msql.dll' -
The speci
> >
> > fied module could not be found.
> >
> > in Unknown on line 0
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>


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




Re: [PHP] date calculation

2003-02-16 Thread qt
Dear Kevin,

I used timestamp allready as following;

$today = strtotime ("1 february 2003");
$enddate = strtotime ("1 march 2003");

$diff = $enddate - $today;

But result comes as

2419200

How can I convert that numbers to days

Best Regards



"Kevin Waterson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This one time, at band camp,
> "qt" <[EMAIL PROTECTED]> wrote:
>
> > Dear Sirs,
> >
> > How can I add or subtract two date easily. Is therea any lib or function
> > about this. I can not find any easy way in the manual
>
> if the dates are timestamps, simply
>
> $new = $timestamp2 - $timestamp1;
>
> cheers
> Kevin
>
> --
>  __
> (_ \
>  _) )           
> |  /  / _  ) / _  | / ___) / _  )
> | |  ( (/ / ( ( | |( (___ ( (/ /
> |_|   \) \_||_| \) \)
> Kevin Waterson
> Port Macquarie, Australia



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




[PHP] Re: database selection

2003-02-16 Thread Hans Prins
thank you,

that did the trick :)

"Thomas Seifert" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Sun, 16 Feb 2003 12:51:58 +0100 [EMAIL PROTECTED] (Hans Prins) wrote:
>
> > Hello,
> >
> > Im trying to select only one row in a mysql database (in this case a
poll
> > with the smallest pollID)...
> > Each row has a field called "pollID" which is the primary key and is
auto
> > incremented when a new row is inserted.
> >
> > I could possible do the following but I think its a bit extensive:
> >
> > $query = "SELECT * FROM polls ORDER BY pollID ASC";
> > $result = mysql_query($query);
> > for ($count = 0; $count < 1 $count++) {
> > $data = mysql_fetch_array($result);
> > $pollID = $data['pollID'];
> > }
> > $query = "SELECT * FROM polls WHERE pollID = $pollID";
> >
> > Does anyone now a solution for this that requires less code?
> >
> > Thx
> >
> >
>
> $query = "SELECT * FROM polls ORDER BY pollID ASC LIMIT 1";
>
>
> Thats the only row.
>
>
>
> Regards,
> --
> Thomas Seifert
>
> mailto:[EMAIL PROTECTED]
> http://www.MyPhorum.de



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




Re: [PHP] Block direct image loads but allow them in PHP

2003-02-16 Thread Michael Mulligan
Thank you, this looks like the kind of thing I'm looking for. I'll have to
give this a shot and see how it goes. :-)

On 02/15/03 8:44 PM, "Justin French" <[EMAIL PROTECTED]> wrote:

> Using Apache's main config file (or at a per-directory level using a
> .htaccess file), you need to black all .jpg, .jpeg, .gif, .png, .bmp, etc
> etc files from being *directly* served via http.
> 
> I'm not too good with Apache yet, but an example would be:
> 
> 
>   Order Allow,Deny
>   Deny from all
> 
> 
>   Order Allow,Deny
>   Deny from all
> 
> 
>   Order Allow,Deny
>   Deny from all
> 
> 
>   Order Allow,Deny
>   Deny from all
> 
> 
> (you might also choose to block everything in imageDir/, which would also
> include the xml file)
> 
> 
> 
> Then you need to create a script called image.php which:
> 
> a) accepts file=.xxx in the URL ($_GET)
> b) sets the appropriate image header
> c) passes the image file though
> 
> Instead of you calling
> 
> 
> You would call
> 
> 
> 
> You also need to ensure that users can't directly call image.php?file=
> picture.jpg in the browser, which can also be done with apache / .htaccess
> files.
> 
> 
> 
>   Order Allow,Deny
>   Deny from all
> 
> 
> 
> 
> There's plenty of examples of passing images through in the manual... in
> particular one of the user-contributed notes by "lists at darkcore dot net
> 08-Aug-2002 03:24" at http://php.net/header looks about right.
> 
> 
> Justin
> 
> 
> on 16/02/03 3:24 AM, Michael Mulligan ([EMAIL PROTECTED]) wrote:
> 
>> Perhaps you could further describe such a method? I'm sorry, I just don't
>> quite see how this will block the files. Perhaps I should further explain my
>> situation.
>> 
>> The script that I will distribute will always make use of a very particular
>> directory structure. In "imageDir", there will always be a specifically
>> named XML file that points to a bunch of images in the directory. However,
>> given security checks that I put in my script, not all of those images
>> should be publicly viewable. However, if a savvy user were to just load this
>> XML doc up in their web browser, they will have a complete listing of URLs
>> to all of my images. I cannot modify this XML file.  (which is why I want to
>> block a user from loading, say myserver.com/imageDir/picture.jpg)
>> 
>> Will your proposed idea still work in this situation?
>> 
>> Thanks for your help and patience in this matter. :-)
>> 
>> On 02/15/03 11:09 AM, "Marco Tabini" <[EMAIL PROTECTED]> wrote:
>>> Only if you let them. The PHP script allows to put the appropriate
>>> checks in place. For example, if you use sessions, you can verify that
>>> the session is still valid and that the user has, indeed, the right to
>>> access that image. At a later time, even if another user types in the
>>> same URL but does not have a valid session (or a variable inside the
>>> session that contains the right data), you would be able to block him
>>> from reading the image.
>>> 
>>> Cheers,
>>> 
>>> 
>>> Marco
>> 
>> 
>> -m^2
>> 
>> __
>> Hi! I'm a .signature virus! Copy me into your ~/.signature to help me
>> spread!
>> __ 
>> 
>> 
> 


-m^2

__
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me
spread!
__ 



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




Re: [PHP] date calculation

2003-02-16 Thread Stephen Willcock
Try:

$today = strtotime ("1 february 2003");
$enddate = strtotime ("2 february 2003");
$diff = $enddate - $today;

Should give you a clue!

SW


"Qt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dear Kevin,
>
> I used timestamp allready as following;
>
> $today = strtotime ("1 february 2003");
> $enddate = strtotime ("1 march 2003");
>
> $diff = $enddate - $today;
>
> But result comes as
>
> 2419200
>
> How can I convert that numbers to days
>
> Best Regards
>
>
>
> "Kevin Waterson" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > This one time, at band camp,
> > "qt" <[EMAIL PROTECTED]> wrote:
> >
> > > Dear Sirs,
> > >
> > > How can I add or subtract two date easily. Is therea any lib or
function
> > > about this. I can not find any easy way in the manual
> >
> > if the dates are timestamps, simply
> >
> > $new = $timestamp2 - $timestamp1;
> >
> > cheers
> > Kevin
> >
> > --
> >  __
> > (_ \
> >  _) )           
> > |  /  / _  ) / _  | / ___) / _  )
> > | |  ( (/ / ( ( | |( (___ ( (/ /
> > |_|   \) \_||_| \) \)
> > Kevin Waterson
> > Port Macquarie, Australia
>
>



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




Re: [PHP] Forms Help (continued)

2003-02-16 Thread Beauford.2002
Globals are turned on

- Original Message -
From: "Ray Hunter" <[EMAIL PROTECTED]>
To: "Beauford.2002" <[EMAIL PROTECTED]>
Cc: "PHP General" <[EMAIL PROTECTED]>
Sent: Sunday, February 16, 2003 12:15 AM
Subject: Re: [PHP] Forms Help (continued)


> Do you have globals turned on or off?
>
> Ray
>
> On Sat, 2003-02-15 at 21:19, Beauford.2002 wrote:
> > Has anyone seen or used this script? It looks fairly straight forward,
but I
> > can't get it to work. It is however, exactly what I need. Any help is
> > appreciated.
> >
> > http://codewalkers.com/tutorials.php?show=28&page=1
> >
> >
> >
> > --
> > 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
>
>



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




[PHP] colorizing output in bash

2003-02-16 Thread Ali Chahvand
Hi ,

i'm using php in the command line and code snippet looks like:



I use ANSI sequences to colorize the output in the bash. Well executing 
echo -e "\e[31;1mTesting\e[m";

in the bash works fine but doesn't in php. The bold stuff work fine
using php and bash , so i was wondering why this behavior shows up.

any clues, or redirections to other mailing lists?

regards Ali

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




Re: [PHP] date calculation

2003-02-16 Thread qt
Dear Stephen,

Good clue!!

Is it working allways without problem such as 29 feb?

And one more hel how can I write "1 2 2003" instead of  "1 february 2003"

I wrote but directly but doesn' t work

thanks

"Stephen Willcock" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Try:
>
> $today = strtotime ("1 february 2003");
> $enddate = strtotime ("2 february 2003");
> $diff = $enddate - $today;
>
> Should give you a clue!
>
> SW
>
>
> "Qt" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Dear Kevin,
> >
> > I used timestamp allready as following;
> >
> > $today = strtotime ("1 february 2003");
> > $enddate = strtotime ("1 march 2003");
> >
> > $diff = $enddate - $today;
> >
> > But result comes as
> >
> > 2419200
> >
> > How can I convert that numbers to days
> >
> > Best Regards
> >
> >
> >
> > "Kevin Waterson" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > This one time, at band camp,
> > > "qt" <[EMAIL PROTECTED]> wrote:
> > >
> > > > Dear Sirs,
> > > >
> > > > How can I add or subtract two date easily. Is therea any lib or
> function
> > > > about this. I can not find any easy way in the manual
> > >
> > > if the dates are timestamps, simply
> > >
> > > $new = $timestamp2 - $timestamp1;
> > >
> > > cheers
> > > Kevin
> > >
> > > --
> > >  __
> > > (_ \
> > >  _) )           
> > > |  /  / _  ) / _  | / ___) / _  )
> > > | |  ( (/ / ( ( | |( (___ ( (/ /
> > > |_|   \) \_||_| \) \)
> > > Kevin Waterson
> > > Port Macquarie, Australia
> >
> >
>
>



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




[PHP] ereg usage

2003-02-16 Thread Peter Gumbrell
Could someone please tell me why this code is not working:

ereg ('^[A-H]*([0-9]+)-$', $rank, $matches);
$workshop_ID = $matches[1][2};

where $rank is something like C12-1 and I just need the C12 part.

Many thanks

Peter Gumbrell
[EMAIL PROTECTED]


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




[PHP] copy *.* troubles

2003-02-16 Thread Malcolm
Hello List,

 I'm having trouble with copy.  I have this script that I got from php.net 
but I can't figure out how to set the path.  Right now it doesn't complain 
but no files are copied.  I'm trying to use a dynamically set directory to 
do this, I have included ml_config to make the vars available.  That's why 
the $listname in the to_path. I want all the files from /maillist to got to 
/$listname, I've tried all kinds of slashes, dots and anything else but I 
can't seem to copy any files.  It echos files copied at the end but it 
lies.  Here's the script ;


include "ml_config.php";
$from_path ="/aamaillist/maillist05";
$to_path = "/aamaillist/$listname";

function rec_copy ($from_path, $to_path) {
if(!is_dir($to_path))
{
mkdir($to_path, 0777);
}
if ($handle = opendir($from_path))
{
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") { if (is_file($from_path."/".$file))
{
copy($from_path."/".$file,$to_path."/".$file);
}
elseif ( is_dir($from_path."/".$file) )
{
rec_copy($from_path."/".$file,$to_path."/".$file);
}
}
}
}
}
echo "files copied from $from_path";
echo " files copied to $to_path";
echo "$PHP_SELF";
?>
Anyone see obvious errors or offer another way ?

malcolm
--



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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



[PHP] What happened to phpEdit???

2003-02-16 Thread Al
Their site no longer responds.

Surely, we haven't lost one of the best php editors.


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




Re: [PHP] Re: date calculation

2003-02-16 Thread olinux
If you're using a database, it may be able to take
care of this for you. If you're using mysql:

6.3.4 Date and Time Functions
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Date_and_time_functions

olinux 


--- Fred Merritt <[EMAIL PROTECTED]> wrote:
> Qt,
>   The easiest way is to convert your dates into a
> serial day number(i.e. 
> the number of days that have elapsed between your
> date, and some 
> arbitrary date in the dim and distant past - I think
> PHP uses 25th 
> November, -4714).  There are some calendar functions
> in php that will do 
> this for you.  Once you have your dates as a numeric
> offset, you can 
> subtract them to get a the number of days between
> the dates, or you can 
> add or subtract a number of days to get a new
> offset.  Once you have the 
> new offset, there are reverse calendar functions in
> php, to convert your 
> new offset back to a calendar date.
> 
> Check out the functions GregorianToJD(), and
> JDToGregorian(), in the 
> Calendar functions of the PHP manual.  If you do not
> have access to the 
> calendar functions in your version of php, there are
> also a couple of 
> examples how to do one of the conversions written in
> PHP, in the user 
> contributed notes of the manual.  There are also
> many published articles 
> describing algorithms on how to do this.  I can
> remember implementing 
> these functions in 1977(Not in PHP of course), from
> an article published 
> in the journal of the ACM, in 1963.
> 
> Hope this helps. . . Fred
> 
> Qt wrote:
> > Dear Sirs,
> > 
> > How can I add or subtract two date easily. Is
> therea any lib or function
> > about this. I can not find any easy way in the
> manual
> > 
> > Best Regards
> > 

__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




[PHP] Inserting records in a particular way in MySQL

2003-02-16 Thread Phillip S. Baker
Greetings all,

I have some PHP code that is inserting records into a DB.
Most of this is auto increment.

However I know there is allot of breaks in the sequencing.

I am wondering if there is some way to write the SQL code to search through 
the existing records in the DB and to find where the next available ID is 
instead of just inserting the next sequence.

So for example if the ID's are.

20453
20454
20458
20459

It would let me know that 20455 is available for use and use the ID number 
instead of using 20460
Thanks all.


Phillip

+++
IMPORTANT: This email message (including attachments, if any) is intended
for the use of the individual addressee(s) named above and may contain
information that is confidential, privileged or unsuitable for overly sensitive
persons with low self-esteem, no sense of humor or irrational religious
beliefs. If you are not the intended recipient, any dissemination, 
distribution
or copying of this email is not authorized (either explicitly or 
implicitly) and
constitutes an irritating social faux pas. Unless the word absquatulation
has been used in its correct context somewhere other than in this warning,
it does not have any legal or no grammatical use and may be ignored. No
animals were harmed in the transmission of this email, although the barking
dachshund next door is living on borrowed time, let me tell you. Those of
you with an overwhelming fear of the unknown will be gratified to learn that
there is no hidden message revealed by reading this warning backwards,
so just ignore that Alert Notice from Microsoft. However, by pouring a
complete circle of salt around yourself and your computer you can ensure
that no harm befalls you, your family or your pets. If you have received this
email in error, please add some nutmeg and egg whites, whisk and place
in a warm oven for 40 minutes.
+++


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



[PHP] List problem

2003-02-16 Thread Beauford.2002
Does anyone else get bounced messages saying they can't send email to
[EMAIL PROTECTED] when sending email to the list? Every email I send to
the list I get this.  I don't get this when sending email to anyone else or
any other list.

TIA



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




Re: [PHP] copy *.* troubles

2003-02-16 Thread Jason Wong
On Sunday 16 February 2003 23:48, Malcolm wrote:

>   I'm having trouble with copy.  I have this script that I got from php.net
> but I can't figure out how to set the path.  Right now it doesn't complain
> but no files are copied.  I'm trying to use a dynamically set directory to
> do this, I have included ml_config to make the vars available.  That's why
> the $listname in the to_path. I want all the files from /maillist to got to
> /$listname, I've tried all kinds of slashes, dots and anything else but I
> can't seem to copy any files.  

Are you using full paths? Does the directory 'maillist' reside in the root 
directory? If not, try using full paths.

> It echos files copied at the end but it
> lies.

I doubt whether PHP is clever enough to lie. It's only doing what you told it 
to do.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
We're on Token Ring, and it looks like the token got loose.
*/


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




Re: [PHP] List problem

2003-02-16 Thread Jason Wong
On Monday 17 February 2003 01:54, Beauford.2002 wrote:
> Does anyone else get bounced messages saying they can't send email to
> [EMAIL PROTECTED] when sending email to the list? Every email I send
> to the list I get this.  I don't get this when sending email to anyone else
> or any other list.

Yes, just ignore it. It'll sort itself out over time.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
"Time is an illusion.  Lunchtime doubly so."
-- Ford Prefect, _Hitchhiker's Guide to the Galaxy_
*/


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




Re: [PHP] ereg usage

2003-02-16 Thread Ernest E Vogelsinger
At 16:18 16.02.2003, Peter Gumbrell said:
[snip]
>Could someone please tell me why this code is not working:
>
>ereg ('^[A-H]*([0-9]+)-$', $rank, $matches);
>$workshop_ID = $matches[1][2};
>
>where $rank is something like C12-1 and I just need the C12 part.
[snip] 

You're missing the "-1" part in your expression:

^   Your string begins
[A-H]*  with no or more letters from A to H
([0-9]+)followed by one or more digits (grouped)
-followed by a dash
$ and the end or the string

Your pattern would match "C12-", but not "C12-1". If you only need the
"C12", your pattern should look something like
'^([A-H]*[0-9]+)-'
to return the complete letter/digit sequence at the beginning of the
string, up to (but not including) the dash. Omitting the '$' (string end)
character allows for anything after the dash.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Inserting records in a particular way in MySQL

2003-02-16 Thread Miles Thompson

Phillip,

It doesn't matter, obviously you're not using the autoincrement ID for a 
foreign key. All this does is identify a record.

If you did a SELECT and found a missing sequence number, what's to say that 
value would not be inserted by another user before your INSERT? If you have 
not set up the table with a MyISAM, MySQL will eventually use the missing 
numbers.

These are only identifying tags, with no intrinsic meaning.

Miles


At 09:37 AM 2/16/2003 -0800, Phillip S. Baker wrote:
Greetings all,

I have some PHP code that is inserting records into a DB.
Most of this is auto increment.

However I know there is allot of breaks in the sequencing.

I am wondering if there is some way to write the SQL code to search 
through the existing records in the DB and to find where the next 
available ID is instead of just inserting the next sequence.

So for example if the ID's are.

20453
20454
20458
20459

It would let me know that 20455 is available for use and use the ID number 
instead of using 20460
Thanks all.


Phillip



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




Re: [PHP] copy *.* troubles

2003-02-16 Thread Malcolm
On Mon, 17 Feb 2003 01:59:43 +0800, Jason Wong <[EMAIL PROTECTED]> 
wrote:

On Sunday 16 February 2003 23:48, Malcolm wrote:


I'm having trouble with copy.  I have this script that I got from 
php.net
but I can't figure out how to set the path.  Right now it doesn't 
complain
but no files are copied.  I'm trying to use a dynamically set directory 
to
do this, I have included ml_config to make the vars available.  That's 
why
the $listname in the to_path. I want all the files from /maillist to got 
to
/$listname, I've tried all kinds of slashes, dots and anything else but 
I
can't seem to copy any files.

Are you using full paths? Does the directory 'maillist' reside in the 
root directory? If not, try using full paths.


 Thanks Jason, but I think I've done that.  I'm on windows.
I've tried c:\foxy\www\maillist\
		c:\\foxy\\www\\maillist\\
 .//mailist
   		  /maillist
 		../maillist

anything I could think of

and tried to go to 		c:\foxy\www\maillist\$listname (or newlist -  the 
current valuse of $listname)
		c:\\foxy\\www\\maillist\\$listname (or newlist -  the current valuse of 
$listname)
 .//mailist/$listname (or newlist -  the current valuse of 
$listname)
   		  /maillist/$listname (or newlist -  the current valuse of $listname)
 		../maillist/$listname (or newlist -  the current valuse of $listname)

none of these and probaly many others, I lost track, work.


It echos files copied at the end but it
lies.


I doubt whether PHP is clever enough to lie. It's only doing what you 
told it to do.

 I'm thinking it's smarter than I am.


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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




[PHP] Re: .htpasswd and PayPal generated passwords

2003-02-16 Thread David Duong
Try http://www.php.net/md5.

Use md5 to encrypt the password, then when you need to check from login just
encrypt what is given, and see if this matches the md5 found in the
database.

- David

"Rob Packer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I use PayPal to generate a username and password and then write them
to
> the .htpasswd file. If I were to switch to using a database (because
> .htaccess seems to always prompt twice!) how would I perform the
comparison
> for the passwords? It would seem that everytime you generate an encrypted
> password it's different. So how would you compare them? Also, does anyone
> know what the encryption method used by PayPal is?
>
> Thanks for any help...
>
> Robert Packer
>
>



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




[PHP] Re: .htpasswd and PayPal generated passwords

2003-02-16 Thread David Duong
btw - What do you mean by paypal generated passwords?  I am interested in
using PayPal as an alternative to my current credit card handler.

Just a link is appreciated.

- David


"Rob Packer" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I use PayPal to generate a username and password and then write them
to
> the .htpasswd file. If I were to switch to using a database (because
> .htaccess seems to always prompt twice!) how would I perform the
comparison
> for the passwords? It would seem that everytime you generate an encrypted
> password it's different. So how would you compare them? Also, does anyone
> know what the encryption method used by PayPal is?
>
> Thanks for any help...
>
> Robert Packer
>
>



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




[PHP] How do I set UID and GID to files.

2003-02-16 Thread David Duong
See topic.



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




[PHP] Checkbox related...

2003-02-16 Thread Dhaval Desai
Hi everybody,

I have a form with 5 checkboxes. I want to make sure that a user checks 
atleast 2 boxes before he can proceed. How can that be made possible.

Thank you

-Dhaval





_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



Re: [PHP] List problem

2003-02-16 Thread Ernest E Vogelsinger
At 18:54 16.02.2003, Beauford.2002 said:
[snip]
>Does anyone else get bounced messages saying they can't send email to
>[EMAIL PROTECTED] when sending email to the list? Every email I send to
>the list I get this.  I don't get this when sending email to anyone else or
>any other list.
[snip] 

Yes, always as any other poster... I've added this to my auto-trash filter.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Checkbox related...

2003-02-16 Thread Ernest E Vogelsinger
At 19:57 16.02.2003, Dhaval Desai said:
[snip]
>I have a form with 5 checkboxes. I want to make sure that a user checks 
>atleast 2 boxes before he can proceed. How can that be made possible.
[snip] 

You have 2 options:

1) Client-side JavaScript: in the forms OnSubmit handler, loop your
checkboxes and make sure at least 2 are checked. If the precondition is not
met, return false from the onSubmit handler.

2) Server-Side via PHP: make an array of all available checkboxes, and walk
this array to see if you have at least 2 of these checkboxes set in your
$_REQUEST array. If the precondition is not met, retransmit the original
form without proceeding.

I'd prefer a combination of both - the JS method saves the user an
unnecessary form transmission, speeding up his entry. The server-side
script method makes sure there's no malicious user trying to trick the
system *g*


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] How do I set UID and GID to files.

2003-02-16 Thread Jason Sheets
Use the chown function, chown is documented at
http://www.php.net/manual/en/function.chown.php


Jason
On Sat, 2003-02-15 at 21:00, David Duong wrote:
> See topic.
> 
> 
> 
> -- 
> 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




RE: [PHP] Checkbox related...

2003-02-16 Thread Dhaval Desai
How do we do it using the first option i.e javascript to count how many 
boxes are checked...could you give some example...

Thanx

-Dhaval






From: "David McInnis" <[EMAIL PROTECTED]>
To: "'Dhaval Desai'" <[EMAIL PROTECTED]>
Subject: RE: [PHP] Checkbox related...
Date: Sun, 16 Feb 2003 10:59:17 -0800

You can use javascript to count the number of items checked or you can
check the size of your array once the form has been submitted to the
server.

David

-Original Message-
From: Dhaval Desai [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 16, 2003 10:58 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Checkbox related...

Hi everybody,

I have a form with 5 checkboxes. I want to make sure that a user checks
atleast 2 boxes before he can proceed. How can that be made possible.

Thank you

-Dhaval





_
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


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



_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


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



Re: [PHP] ereg usage

2003-02-16 Thread Rick Emery
The problem is that it's looking for hyphen, - , immediately preceeding the end.  
Remove the $.
- Original Message - 
From: "Peter Gumbrell" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Sunday, February 16, 2003 9:18 AM
Subject: [PHP] ereg usage


Could someone please tell me why this code is not working:

ereg ('^[A-H]*([0-9]+)-$', $rank, $matches);
$workshop_ID = $matches[1][2};

where $rank is something like C12-1 and I just need the C12 part.

Many thanks

Peter Gumbrell
[EMAIL PROTECTED]


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




[PHP] multiple select problem

2003-02-16 Thread Thomas Moore
I had code working that was passing multiple select values to another screen from a 
form...

In the URL on the next page I see a bunch of characters, so it doesn't work...
%5C%22year_model_id%5B%5D%5C%22=60776 

Anyone know what this is and how to fix it??? It was working fine for months and just 
stopped working one day.

Much appreciated...
thanks,
-tom



EOL

 }
 print "";


















RE: [PHP] Checkbox related...

2003-02-16 Thread Ernest E Vogelsinger
At 20:34 16.02.2003, Dhaval Desai said:
[snip]
>How do we do it using the first option i.e javascript to count how many 
>boxes are checked...could you give some example...
[snip] 

Warning - untested:


function validateChecks()
{
aboxes = Array('box1','box2','box3','box4','box5');
hF = document.forms['myform'];
if (hF) {
for (i = 0, count=0; i < aboxes.length; i++) {
   hBox = hF.elements[aboxes[i]];
   if (hBox.checked) {
   ++count;
   if (count >= 2)
   return true;
   }
}
}
return false;
}















I believe you get the idea...


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




[PHP] loading same page

2003-02-16 Thread Edward Peloke
hello,

I have a very simply page, the users can signup for a certain time to volunteer, when 
they hit submit, the page reloads but I want their time to be inserted in the db and 
then displayed.  After I hit submit, it brings me back to the page but their info 
isn't there until I refresh.  Sometimes their data never shows up yet I can print off 
the sql statements, run them against the db and see all the data...is the script just 
loading to fast?  I have only tested this running locally.

Thanks,
Eddie




Please sign up for the hours that you can work.  We need a minimum of 3 men there 
for each shift. They will be doing the tire pressure checks and any other minor 
maintenance that might be required. Ladies are also urged to come as we are hoping 
there will be women bikers that we can minister to in whatever way is needed.  Anyone 
can come anytime but we need to have enough commitments that we know the break will be 
staffed adequately every shift.
We cannot give away anything that would compete with the drinks and snacks that 
are sold at the rest stop but we can give away ice water and possibly coffee. Thanks 
for your help!
 
 
 



 Name 
Time 
Friday, February 28, 8 a.m.-12 
p.m.
Friday, February 28, 12 p.m.-4 p.m.
Friday, February 28, 4 p.m.-8 p.m.
Saturday, March 1, 8 a.m.-12 p.m.
Saturday, March 1, 12 p.m.-4 p.m.
Saturday, March 1, 4 p.m.-8 p.m.
Sunday, March 2, 8 a.m.-12 p.m.
Sunday, March 2, 12 p.m.-4 p.m.
Sunday, March 2, 4 p.m.-8 p.m.






 
  
  Friday February 28th 8 AM to Noon
  
  ";
 print $myrow["name"];
 print "";
 }
  ?>

 


 
  
  Friday February 28th 12 p.m  to 4 
p.m.
  
  ";
 print $myrow1["name"];
 print "";
 }
  ?>

 

 

 
  
  Friday February 28th 4 p.m. to 8 
p.m.
  
  ";
 print $myrow2["name"];
 print "";
 }
  ?>

 



 
  
  Saturday March 1st 8 AM to Noon
  
  ";
 print $myrow3["name"];
 print "";
 }
  ?>

 


 
  
  Saturday March 1st 12 p.m  to 4 
p.m.
  
  ";
 print $myrow4["name"];
 print "";
 }
  ?>

 

 

 
  
  Saturday March 1st 4 p.m. to 8 
p.m.
  
  ";
 print $myrow5["name"];
 print "";
 }
  ?>

 


 
  
  Sunday March 2nd 8 AM to Noon
  
  ";
 print $myrow6["name"];
 print "";
 }
  ?>

 


 
  
  Sunday March 2nd 12 p.m  to 4 p.m.
  
  ";
 print $myrow["name"];
 print "";
 }
  ?>

 

 

 
  
  Sunday March 2nd 4 p.m. to 8 p.m.
  
  ";
 print $myrow["name"];
 print "";
 }
  ?>

 







RE: [PHP] Inserting records in a particular way in MySQL

2003-02-16 Thread Willie G
Phillip,

You will have to change your code, so the primary key is not an auto
incremented value.  If you don't, the auto increment will over-ride the 'get
next' function.  Here is what I use in my code.  You just need to change it
for your table.

//- GetNextKey -//
function getnextkey(){

$db = new db();

$query = "select max(MemberKey) lastkey from Members";

$result=exequery($query);

if(@mysql_num_rows($result) >0){
$numrows=mysql_num_rows($result);
$flds=mysql_num_fields($result);
//Should only be one row, but just in case
for($r=0; $r < $numrows; $r++){
$row=mysql_fetch_array($result);
$lastkey = StripSlashes($row["lastkey"]);
}
} else {
return 1;
}

if (is_numeric($lastkey)) {
return $lastkey+1;
} else {
return 1;
}

$db->closedb();
}


-Original Message-
From: Phillip S. Baker [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 16, 2003 12:37 PM
To: PHP Email List
Subject: [PHP] Inserting records in a particular way in MySQL


Greetings all,

I have some PHP code that is inserting records into a DB.
Most of this is auto increment.

However I know there is allot of breaks in the sequencing.

I am wondering if there is some way to write the SQL code to search through
the existing records in the DB and to find where the next available ID is
instead of just inserting the next sequence.

So for example if the ID's are.

20453
20454
20458
20459

It would let me know that 20455 is available for use and use the ID number
instead of using 20460
Thanks all.


Phillip

+++
IMPORTANT: This email message (including attachments, if any) is intended
for the use of the individual addressee(s) named above and may contain
information that is confidential, privileged or unsuitable for overly
sensitive
persons with low self-esteem, no sense of humor or irrational religious
beliefs. If you are not the intended recipient, any dissemination,
distribution
or copying of this email is not authorized (either explicitly or
implicitly) and
constitutes an irritating social faux pas. Unless the word absquatulation
has been used in its correct context somewhere other than in this warning,
it does not have any legal or no grammatical use and may be ignored. No
animals were harmed in the transmission of this email, although the barking
dachshund next door is living on borrowed time, let me tell you. Those of
you with an overwhelming fear of the unknown will be gratified to learn that
there is no hidden message revealed by reading this warning backwards,
so just ignore that Alert Notice from Microsoft. However, by pouring a
complete circle of salt around yourself and your computer you can ensure
that no harm befalls you, your family or your pets. If you have received
this
email in error, please add some nutmeg and egg whites, whisk and place
in a warm oven for 40 minutes.
+++


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




RE: [PHP] Inserting records in a particular way in MySQL

2003-02-16 Thread Willie G
Miles,

I never use auto increment.  Not because of gaps, but in case I need to
reload the table.  They do have meaning if they are foreign keys to another
table.

- Larry


-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 16, 2003 1:14 PM
To: Phillip S. Baker; PHP Email List
Subject: Re: [PHP] Inserting records in a particular way in MySQL



Phillip,

It doesn't matter, obviously you're not using the autoincrement ID for a
foreign key. All this does is identify a record.

If you did a SELECT and found a missing sequence number, what's to say that
value would not be inserted by another user before your INSERT? If you have
not set up the table with a MyISAM, MySQL will eventually use the missing
numbers.

These are only identifying tags, with no intrinsic meaning.

Miles


At 09:37 AM 2/16/2003 -0800, Phillip S. Baker wrote:
>Greetings all,
>
>I have some PHP code that is inserting records into a DB.
>Most of this is auto increment.
>
>However I know there is allot of breaks in the sequencing.
>
>I am wondering if there is some way to write the SQL code to search
>through the existing records in the DB and to find where the next
>available ID is instead of just inserting the next sequence.
>
>So for example if the ID's are.
>
>20453
>20454
>20458
>20459
>
>It would let me know that 20455 is available for use and use the ID number
>instead of using 20460
>Thanks all.
>
>
>Phillip
>
>
>
>--
>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




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




[PHP] Sax-like : accessing form fields elements

2003-02-16 Thread Robert Mena
Hi,

I am developing an application which will have to
parse a html page and extract information about the
forms found.

I tried the HTMLSAX class
(http://www.phpclasses.org/browse.html/package/678.html)
which is ok except by the fact that I can not retrieve
the default/checked status from the elements.

Ie. 

Any ideias ?

Since the html will usually be ill-formed a standard
DOM-tree (with builtin functions at least) wont be possible.

__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




RE: [PHP] Result in the same page

2003-02-16 Thread Cal Evans
John,

header(location:) is the way I'm doing it. I check for the Submit button, if
it was pressed and the processing succeeded, I redirect.  If processing
fails (validation, error in connecting to the database, etc.) I redisplay
the same page with all the same variables that the user just input.  I give
them a message telling them what went wrong and allow them to fix it.

If you find a better way, please share. It would be nice to have something
like 
=C=


-Original Message-
From: John Hicks [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 15, 2003 11:56 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Result in the same page


Cal--

I just posted this reply to your reply on php.general.

--John


From: [EMAIL PROTECTED] (John Hicks)
Newsgroups: php.general
Subject: Re: [PHP] Result in the same page
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
NNTP-Posting-Host: 68.165.13.138
Message-ID: <[EMAIL PROTECTED]>

I, too, like the idea of keeping my processing code in the same file
as the form being processed. But I'm trying to figure out how to
transfer control to the next page based on the result of the forms
processing.

In JSP, i would use , which is basically a "Go to"
command. The only reference I can find to "transfer of control" in PHP
is the header(location: ) function. But that requires a complete
server/browser/server interchange.

There must be a more direct way to transfer control in PHP. Would
someone please tell me what it is?

Thanks in advance,

Frappy

[EMAIL PROTECTED] (Cal Evans) wrote in message
news:<[EMAIL PROTECTED]>...
> Yes, just user $_SERVER['PHP_SELF'] as the action of your form. This will
> cause the page to call itself. Then you can branch your processing on the
> existence of a SUBMIT button (or whatever) and handle the query.
>
> I do all my pages this way because it keeps all the code in a single page.
> It's easier for me to find it that way.
>
> =C=
>
> *
> * Cal Evans
> * Stay plugged into your audience.
> * http://www.christianperformer.com


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




Re: [PHP] date calculation

2003-02-16 Thread Stephen Willcock
Yes, will be OK with all dates (though the valid range of a timestamp is
typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07
GMT.)

The function you want for numeric dates is:
int mktime ( int hour, int minute, int second, int month, int day, int year)

so, in your example (1st Feb 2003):
$mydate = mktime(0,0,0,2,1,2003);

SW


"Qt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dear Stephen,
>
> Good clue!!
>
> Is it working allways without problem such as 29 feb?
>
> And one more hel how can I write "1 2 2003" instead of  "1 february 2003"
>
> I wrote but directly but doesn' t work
>
> thanks
>
> "Stephen Willcock" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Try:
> >
> > $today = strtotime ("1 february 2003");
> > $enddate = strtotime ("2 february 2003");
> > $diff = $enddate - $today;
> >
> > Should give you a clue!
> >
> > SW
> >
> >
> > "Qt" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Dear Kevin,
> > >
> > > I used timestamp allready as following;
> > >
> > > $today = strtotime ("1 february 2003");
> > > $enddate = strtotime ("1 march 2003");
> > >
> > > $diff = $enddate - $today;
> > >
> > > But result comes as
> > >
> > > 2419200
> > >
> > > How can I convert that numbers to days
> > >
> > > Best Regards
> > >
> > >
> > >
> > > "Kevin Waterson" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > This one time, at band camp,
> > > > "qt" <[EMAIL PROTECTED]> wrote:
> > > >
> > > > > Dear Sirs,
> > > > >
> > > > > How can I add or subtract two date easily. Is therea any lib or
> > function
> > > > > about this. I can not find any easy way in the manual
> > > >
> > > > if the dates are timestamps, simply
> > > >
> > > > $new = $timestamp2 - $timestamp1;
> > > >
> > > > cheers
> > > > Kevin
> > > >
> > > > --
> > > >  __
> > > > (_ \
> > > >  _) )           
> > > > |  /  / _  ) / _  | / ___) / _  )
> > > > | |  ( (/ / ( ( | |( (___ ( (/ /
> > > > |_|   \) \_||_| \) \)
> > > > Kevin Waterson
> > > > Port Macquarie, Australia
> > >
> > >
> >
> >
>
>



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




Re: [PHP] Re: date calculation

2003-02-16 Thread qt
No I am not using msql


"Olinux" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If you're using a database, it may be able to take
> care of this for you. If you're using mysql:
>
> 6.3.4 Date and Time Functions
>
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Dat
e_and_time_functions
>
> olinux
>
>
> --- Fred Merritt <[EMAIL PROTECTED]> wrote:
> > Qt,
> > The easiest way is to convert your dates into a
> > serial day number(i.e.
> > the number of days that have elapsed between your
> > date, and some
> > arbitrary date in the dim and distant past - I think
> > PHP uses 25th
> > November, -4714).  There are some calendar functions
> > in php that will do
> > this for you.  Once you have your dates as a numeric
> > offset, you can
> > subtract them to get a the number of days between
> > the dates, or you can
> > add or subtract a number of days to get a new
> > offset.  Once you have the
> > new offset, there are reverse calendar functions in
> > php, to convert your
> > new offset back to a calendar date.
> >
> > Check out the functions GregorianToJD(), and
> > JDToGregorian(), in the
> > Calendar functions of the PHP manual.  If you do not
> > have access to the
> > calendar functions in your version of php, there are
> > also a couple of
> > examples how to do one of the conversions written in
> > PHP, in the user
> > contributed notes of the manual.  There are also
> > many published articles
> > describing algorithms on how to do this.  I can
> > remember implementing
> > these functions in 1977(Not in PHP of course), from
> > an article published
> > in the journal of the ACM, in 1963.
> >
> > Hope this helps. . . Fred
> >
> > Qt wrote:
> > > Dear Sirs,
> > >
> > > How can I add or subtract two date easily. Is
> > therea any lib or function
> > > about this. I can not find any easy way in the
> > manual
> > >
> > > Best Regards
> > >
>
> __
> Do you Yahoo!?
> Yahoo! Shopping - Send Flowers for Valentine's Day
> http://shopping.yahoo.com



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




[PHP] long running PHP application

2003-02-16 Thread Ilja Polvanovas
Does anybody have minds about problems running long running PHP scripts as
standalone programs (ex. like servers, daemons). For example there is a
"simple TCP/IP server" in Sockets chapter of the Manual. Have anybody any
ideas how long can the script run ? is there any garbage collector in PHP,
if it is, is it enough solution? Can the script run for unlimited time ? is
there any restrictions ? Is it stable enough ?



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




[PHP] URL of calling page

2003-02-16 Thread acleave
I believe there's a way in PHP to get the URL of the page that called the 
current page but can't find it.  Is there such a function?  Or would I have to 
use another script (like Javascript)?

What I mean is if I click on a link on index.html to jeremiah.php I can call 
the function and find out I just came from index.html (and not henry.php or 
fred.php).

Thank you.

Allan Cleaveland
Webmaster and Computer Technician
Math Department
Univeristy of Arkansas


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




Re: [PHP] URL of calling page

2003-02-16 Thread Ernest E Vogelsinger
At 22:58 16.02.2003, acleave said:
[snip]
>I believe there's a way in PHP to get the URL of the page that called the 
>current page but can't find it.  Is there such a function?  Or would I
>have to 
>use another script (like Javascript)?
[snip] 

http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server

$_SERVER['HTTP_REFERER']

The address of the page (if any) which referred the user agent to the
current page. This is set by the user agent. Not all user agents will set
this, and some provide the ability to modify HTTP_REFERER as a feature. In
short, it cannot really be trusted. 



-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] URL of calling page

2003-02-16 Thread Kevin Waterson
This one time, at band camp,
acleave <[EMAIL PROTECTED]> wrote:

> I believe there's a way in PHP to get the URL of the page that called the 
> current page but can't find it.  Is there such a function?  Or would I have to 
> use another script (like Javascript)?

$_SERVER['HTTP_REFERER']

Kevin

-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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




Re: [PHP] URL of calling page

2003-02-16 Thread Justin French
on 17/02/03 9:25 AM, Kevin Waterson ([EMAIL PROTECTED]) wrote:

> This one time, at band camp,
> acleave <[EMAIL PROTECTED]> wrote:
> 
>> I believe there's a way in PHP to get the URL of the page that called the
>> current page but can't find it.  Is there such a function?  Or would I have
>> to 
>> use another script (like Javascript)?
> 
> $_SERVER['HTTP_REFERER']
> 
> Kevin

But it's not ALWAYS set by the browser, so don't rely on it for anything
mission critical on your site.

Justin


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




php-general Digest 16 Feb 2003 22:46:33 -0000 Issue 1887

2003-02-16 Thread php-general-digest-help

php-general Digest 16 Feb 2003 22:46:33 - Issue 1887

Topics (messages 135731 through 135785):

Re: call a website from a php script
135731 by: Ernest E Vogelsinger

htDig on PHP pages
135732 by: David McInnis

Re: [PHP-DEV] how to call a website from within a php script
135733 by: Sebastian Bergmann

Re: [PHP-DEV] database select
135734 by: Sebastian Bergmann

Re: permissions to work with fopen
135735 by: qt

date calculation
135736 by: qt
135741 by: Fred Merritt
135742 by: Kevin Waterson
135745 by: qt
135748 by: Stephen Willcock
135751 by: qt
135755 by: olinux
135779 by: Stephen Willcock
135780 by: qt

database selection
135737 by: H Prins
135739 by: H Prins
135740 by: Kevin Waterson
135743 by: Thomas Seifert
135746 by: H Prins

Re: Variables from the Form wouldn't transfer to my process page
135738 by: Geckodeep

Re: Help Needed for Beginners trying to configure Correctly
135744 by: D'habi Arabians

Re: Block direct image loads but allow them in PHP
135747 by: Michael Mulligan

Re: Forms Help (continued)
135749 by: Beauford.2002

colorizing output in bash
135750 by: Ali Chahvand

ereg usage
135752 by: Peter Gumbrell
135760 by: Ernest E Vogelsinger
135771 by: Rick Emery

copy *.* troubles
135753 by: Malcolm
135758 by: Jason Wong
135762 by: Malcolm

What happened to phpEdit???
135754 by: Al

Inserting records in a particular way in MySQL
135756 by: Phillip S. Baker
135761 by: Miles Thompson
135775 by: Willie G
135776 by: Willie G

List problem
135757 by: Beauford.2002
135759 by: Jason Wong
135767 by: Ernest E Vogelsinger

Re: .htpasswd and PayPal generated passwords
135763 by: David Duong
135764 by: David Duong

How do I set UID and GID to files.
135765 by: David Duong
135769 by: Jason Sheets

Checkbox related...
135766 by: Dhaval Desai
135768 by: Ernest E Vogelsinger
135770 by: Dhaval Desai
135773 by: Ernest E Vogelsinger

multiple select problem
135772 by: Thomas Moore

loading same page
135774 by: Edward Peloke

Sax-like : accessing form fields elements
135777 by: Robert Mena

Re: Result in the same page
135778 by: Cal Evans

long running PHP application
135781 by: Ilja Polvanovas

URL of calling page
135782 by: acleave
135783 by: Ernest E Vogelsinger
135784 by: Kevin Waterson
135785 by: Justin French

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 ---
At 11:40 16.02.2003, christian tischler said:
[snip]
>can anybody tell me please how to "call" a website from a php script.
>
>meaning
>if (something happens) {goto www.google.com} else {goto www.yahoo.com}
[snip] 

I believe you mean to redirect the browser to a website?

header('Location: http://www.google.com/');

Or to "incorporate" (speak steal) the website?

readfile('http://www.google.com');

Or to fetch the site to analyze it?

$hf = fopen('http://www.google.com/') or die('Cannot open google');
$buffer = null;
while ($chunk = fread($hf, 4096))
$buffer .= $chunk;
fclose($hf);
// analyze and process buffer

Enjoy :)


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



--- End Message ---
--- Begin Message ---
Most of the content on my site is generated dynamically by PHP out of a
MySQL database.  This is causing me problems when indexing the site.
Since pages are created dynamically htDig records the current date as
the date the document was created.  I need the create date to be the
create date from the date recorded in the database when the document /
record was added and NOT the date/time that PHP generates the document.

I am hoping that I can pass a date / timestamp in the header.

Any ideas?  Or did I confuse everyone.

David McInnis



--- End Message ---
--- Begin Message ---
christian tischler wrote:
> Can anybody tell me how to call a website from within a php script.

  Please ask user questions on the [EMAIL PROTECTED] list.

-- 
  Sebastian Bergmann
  http://sebastian-bergmann.de/ http://phpOpenTracker.de/

  Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

--- End Message ---
--- Begin Message ---
Hans Prins wrote:
> [...]

  Please ask user questions on the [EMAIL PROTECTED] list.

-- 
  Sebastian Bergmann
  http://sebastian-bergmann.de/ h

Re: [PHP] List problem

2003-02-16 Thread David T-G
Beauford --

...and then Beauford.2002 said...
% 
% Does anyone else get bounced messages saying they can't send email to
% [EMAIL PROTECTED] when sending email to the list? Every email I send to

Yep.  Looks like that person was subscribed to this list and died but the
list hasn't yet kicked out the address.

Just flush 'em when you get 'em.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg97143/pgp0.pgp
Description: PGP signature


Re: [PHP] Re: recursion?????

2003-02-16 Thread David T-G
Fred, et al --

...and then Fred Merritt said...
% 
...
% The benefit of checking in javascript(which I suspect is enabled in most 

Not me!  Not me!  Not me!

It is by no means ubiquitous.  Anyone who even moderately considers
security will have it turned off.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg97144/pgp0.pgp
Description: PGP signature


RE: [PHP] Inserting records in a particular way in MySQL

2003-02-16 Thread Miles Thompson

If you are not using them as foreign keys, how does it matter? They are 
simply identifiers for a particular record. If you need to know the number 
of records a select count(*) does that quickly enough, gaps are irrelevant.

Miles


At 03:38 PM 2/16/2003 -0500, Willie G wrote:
Miles,

I never use auto increment.  Not because of gaps, but in case I need to
reload the table.  They do have meaning if they are foreign keys to another
table.

- Larry


-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 16, 2003 1:14 PM
To: Phillip S. Baker; PHP Email List
Subject: Re: [PHP] Inserting records in a particular way in MySQL



Phillip,

It doesn't matter, obviously you're not using the autoincrement ID for a
foreign key. All this does is identify a record.

If you did a SELECT and found a missing sequence number, what's to say that
value would not be inserted by another user before your INSERT? If you have
not set up the table with a MyISAM, MySQL will eventually use the missing
numbers.

These are only identifying tags, with no intrinsic meaning.

Miles


At 09:37 AM 2/16/2003 -0800, Phillip S. Baker wrote:
>Greetings all,
>
>I have some PHP code that is inserting records into a DB.
>Most of this is auto increment.
>
>However I know there is allot of breaks in the sequencing.
>
>I am wondering if there is some way to write the SQL code to search
>through the existing records in the DB and to find where the next
>available ID is instead of just inserting the next sequence.
>
>So for example if the ID's are.
>
>20453
>20454
>20458
>20459
>
>It would let me know that 20455 is available for use and use the ID number
>instead of using 20460
>Thanks all.
>
>
>Phillip
>
>
>
>--
>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



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




[PHP] Converting a large number of passwords to MD5 at once.

2003-02-16 Thread Vernon
I made the mistake of opening a web site with encrypting the passwords
stored in the database and want to encrypt them all in one fell swoop. Any
ideas on how to do that?

Thanks



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




[PHP] Convert my old cookies to session variable(s)

2003-02-16 Thread Øystein Håland
I use extensively cookies in my web applications, but have reached the 4 kB
limit. So now I need to 'convert' all my cookies to session variables. Have
got an idea how I can create such for one variable, but here I have multi
element cookies. Reading the php manual gives me no idea on how to do this.
Here's the recipe for my cookies:
function formCookie() {
 var cookieValue = document.$formname.totalAns.value+'|'; // Using '|' to
split each part of the cookie
 cookieValue +=
document.form01.correct.value+'$test[1]'+document.form01.question1.value+doc
ument.form01.answer.value+'|';
 cookieValue +=
document.form02.correct.value+'$test[1]'+document.form02.question2.value+doc
ument.form02.answer.value+'|';



 document.cookie = '$answercookie='+escape(cookieValue)+';expires=';
}



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




[PHP] anyone know what ical and outlook are programmed in?

2003-02-16 Thread Kevin Myrick
Hey all,

I was wondering if anyone could tell me what iCal and
Outlook are programmed in offhand. I have an ambitious
but probably not so thought out plan on builing some
mods for phpwebsite based off of phprojekt,
squirrelmail, myphpcalendar, and was thinking I would
write my own address book, but will probably use the
one built into projekt.

This info will help me greatly, because I'll write
files that will pass the address book and schedule
info from Outlook, and just the schedule infor from
iCal, onto my system (if it is even possible...)

Thanks,
Kevin Myrick

PS- Where would I look to find the PEAR libs
documentation on what each function, in each file,
does. I plan on printing this out so I can take a clos
e look into designing my system... PEAR is used in the
new version of phpwebsite (currently 0.9.0RC4) and
wanted to use this common function system to do the
rest of the design for me.

=
Kevin Myrick
/etc/KevX45
http://www.ultimatealchemy.com
[EMAIL PROTECTED]
"Screw you guys, I'm going home."-Eric Cartman, South Park
Ultimatealchemy Dotcom!

__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




RE: [PHP] What happened to phpEdit???

2003-02-16 Thread Bryan Lipscy
Did you check google?
http://ozu.arecom-sa.com/~marms/phpedit.net/

-Original Message-
From: Al [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, February 16, 2003 8:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] What happened to phpEdit???


Their site no longer responds.

Surely, we haven't lost one of the best php editors.


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




RE: [PHP] anyone know what ical and outlook are programmed in?

2003-02-16 Thread Luke Woollard
Outlook would most likely be written in VC++ &/OR Visual Basic

It's just a hunch..

LW






-Original Message-
From: Kevin Myrick [mailto:[EMAIL PROTECTED]]
Sent: Monday, 17 February 2003 2:27 PM
To: 
Subject: [PHP] anyone know what ical and outlook are programmed in?


Hey all,

I was wondering if anyone could tell me what iCal and
Outlook are programmed in offhand. I have an ambitious
but probably not so thought out plan on builing some
mods for phpwebsite based off of phprojekt,
squirrelmail, myphpcalendar, and was thinking I would
write my own address book, but will probably use the
one built into projekt.

This info will help me greatly, because I'll write
files that will pass the address book and schedule
info from Outlook, and just the schedule infor from
iCal, onto my system (if it is even possible...)

Thanks,
Kevin Myrick

PS- Where would I look to find the PEAR libs
documentation on what each function, in each file,
does. I plan on printing this out so I can take a clos
e look into designing my system... PEAR is used in the
new version of phpwebsite (currently 0.9.0RC4) and
wanted to use this common function system to do the
rest of the design for me.

=
Kevin Myrick
/etc/KevX45
http://www.ultimatealchemy.com
[EMAIL PROTECTED]
"Screw you guys, I'm going home."-Eric Cartman, South Park
Ultimatealchemy Dotcom!

__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




RE: [PHP] anyone know what ical and outlook are programmed in?

2003-02-16 Thread Kevin Myrick
Thanks, I appreciate it.
--- Luke Woollard <[EMAIL PROTECTED]> wrote:
> Outlook would most likely be written in VC++ &/OR
> Visual Basic
> 
> It's just a hunch..
> 
> LW
> 
> 
> 
> 
> 
> 
> -Original Message-
> From: Kevin Myrick
> [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 17 February 2003 2:27 PM
> To: 
> Subject: [PHP] anyone know what ical and outlook are
> programmed in?
> 
> 
> Hey all,
> 
> I was wondering if anyone could tell me what iCal
> and
> Outlook are programmed in offhand. I have an
> ambitious
> but probably not so thought out plan on builing some
> mods for phpwebsite based off of phprojekt,
> squirrelmail, myphpcalendar, and was thinking I
> would
> write my own address book, but will probably use the
> one built into projekt.
> 
> This info will help me greatly, because I'll write
> files that will pass the address book and schedule
> info from Outlook, and just the schedule infor from
> iCal, onto my system (if it is even possible...)
> 
> Thanks,
> Kevin Myrick
> 
> PS- Where would I look to find the PEAR libs
> documentation on what each function, in each file,
> does. I plan on printing this out so I can take a
> clos
> e look into designing my system... PEAR is used in
> the
> new version of phpwebsite (currently 0.9.0RC4) and
> wanted to use this common function system to do the
> rest of the design for me.
> 
> =
> Kevin Myrick
> /etc/KevX45
> http://www.ultimatealchemy.com
> [EMAIL PROTECTED]
> "Screw you guys, I'm going home."-Eric Cartman,
> South Park
> Ultimatealchemy Dotcom!
> 
> __
> Do you Yahoo!?
> Yahoo! Shopping - Send Flowers for Valentine's Day
> http://shopping.yahoo.com
> 
> -- 
> 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
> 


=
Kevin Myrick
/etc/KevX45
http://www.ultimatealchemy.com
[EMAIL PROTECTED]
"Screw you guys, I'm going home."-Eric Cartman, South Park
Ultimatealchemy Dotcom!

__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




[PHP] Re: URL of calling page

2003-02-16 Thread Brendon
On Sun, 16 Feb 2003 15:58:30 -0600, Acleave <[EMAIL PROTECTED]> wrote:


I believe there's a way in PHP to get the URL of the page that called the 
current page but can't find it.  Is there such a function?  Or would I 
have to use another script (like Javascript)?

What I mean is if I click on a link on index.html to jeremiah.php I can 
call the function and find out I just came from index.html (and not 
henry.php or fred.php).

If you're trying to get back to a page, I would suggest passing the current 
page as a variable to the next page.

e.g.
Subscribe

--
_BB

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



Re: [PHP] long running PHP application

2003-02-16 Thread Robert Cummings
I run a fantasy MUD and I have a PHP based daemon which checks for in game
player mail and if found and the player has registered an email address, then
it sends the MUD mail out to the player's email address. The program wakes up
once a minute to check the database and then goes back to sleep. It's been
running for months without a problem.

Cheers,
Rob.

Ilja Polvanovas wrote:
> 
> Does anybody have minds about problems running long running PHP scripts as
> standalone programs (ex. like servers, daemons). For example there is a
> "simple TCP/IP server" in Sockets chapter of the Manual. Have anybody any
> ideas how long can the script run ? is there any garbage collector in PHP,
> if it is, is it enough solution? Can the script run for unlimited time ? is
> there any restrictions ? Is it stable enough ?
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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




[PHP] Future compatibility

2003-02-16 Thread Lord Loh.
Future compatibility
===

Php and zend have constantly been discarding old syntax...making it
deprecated and all...

How can I be sure that a code I write will run for ever (or at least 10
years) irrespective of future PHP versions...

Is there a list of syntax that php plans to discard...

for example(only example): The DBX library I have is giving warnings with
mysql...

Please help

Thank You!
Lord Loh



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




RE: [PHP] Re: URL of calling page

2003-02-16 Thread Luke Woollard
dude - try this:

echo $HTTP_REFERER;

It'l give you the refering page from when you came.

Luke Woollard






-Original Message-
From: Brendon [mailto:[EMAIL PROTECTED]]
Sent: Monday, 17 February 2003 3:17 PM
To:  Acleave
Subject: [PHP] Re: URL of calling page


On Sun, 16 Feb 2003 15:58:30 -0600, Acleave <[EMAIL PROTECTED]> wrote:

> I believe there's a way in PHP to get the URL of the page that called the
> current page but can't find it.  Is there such a function?  Or would I
> have to use another script (like Javascript)?
>
> What I mean is if I click on a link on index.html to jeremiah.php I can
> call the function and find out I just came from index.html (and not
> henry.php or fred.php).

If you're trying to get back to a page, I would suggest passing the current
page as a variable to the next page.

e.g.
Subscribe

--
 _BB

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




[PHP] Re: Converting a large number of passwords to MD5 at once.

2003-02-16 Thread Lord Loh.
Simple!
Write a script to automate the process!

Lord Loh



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




Re: [PHP] Converting a large number of passwords to MD5 at once.

2003-02-16 Thread Jason Wong
On Monday 17 February 2003 09:17, Vernon wrote:
> I made the mistake of opening a web site with encrypting the passwords
> stored in the database and want to encrypt them all in one fell swoop. Any
> ideas on how to do that?

while (some more password) {
  get password from wherever it is stored
  md5() password
  put password back to wherever it is stored
}

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Will this never-ending series of PLEASURABLE EVENTS never cease?
*/


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




[PHP] Re: PHP error messages

2003-02-16 Thread Lord Loh.
That is not an error! It is a Warning...I got it the other day when the file
was empty (or did not exist or something).

Use @ prefix to make it disappear

http://www.something.com/the_filename.txt";);
?>

Hope this helps...

Lord Loh.



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




[PHP] Re: loading same page

2003-02-16 Thread Lord Loh.
Thy these headers
=
$now = gmdate('D, d M Y H:i:s') . ' GMT';
header('Expires: ' . $now);
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Pragma: no-cache');
=

Hope it helps...

Lord Loh



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




[PHP] RE: call a website from a php script

2003-02-16 Thread Uttam
if (condition) {
header("Location: http://www.gogle.com/";);
} else {
header("Location: http://www.yahoo.com/";);
}

regds,
-Original Message-
From: christian tischler [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 16, 2003 16:11
To: [EMAIL PROTECTED]
Subject: call a website from a php script

can anybody tell me please how to "call" a website from a php script.

meaning
if (something happens) {goto www.google.com} else {goto www.yahoo.com}

tanks,

christian




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




[PHP] Free PHP?

2003-02-16 Thread Bjarke Walling Petersen
I'm planing to host websites. Is it free to use PHP4 as an option for my
users?
I'm hosting on a Windows-based system.

Thanks a lot.

Bjarke



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




Re: [PHP] Free PHP?

2003-02-16 Thread Alan Murrell
Hello Bjarke,

--- Bjarke Walling Petersen <[EMAIL PROTECTED]> wrote:
> Is it free to use PHP4 as an option for my users?

Yes.

HTH.

Alan

__ 
Post your free ad now! http://personals.yahoo.ca

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