php-general Digest 17 Jan 2003 14:10:35 -0000 Issue 1828

Topics (messages 131956 through 132006):

Re: Display Dates in English o_O
        131956 by: Rick Emery
        131984 by: Tom Rogers

Re: fit window to image
        131957 by: Justin French
        131958 by: Ezequiel Sapoznik
        132002 by: Marek Kilimajer

output sql
        131959 by: Paul Marinas
        131960 by: Timothy Hitchens \(HiTCHO\)

Create unike variables for each record
        131961 by: Lars Espelid
        131964 by: Lars Espelid
        131966 by: Justin French
        131969 by: Jason Sheets

Re: postfix instead of sendmail
        131962 by: Timothy Hitchens \(HiTCHO\)

Meta Refresh
        131963 by: Edson Waite
        131967 by: Jason Wong
        131968 by: Edson Waite
        131970 by: Jason Wong
        131975 by: roel
        131996 by: Ford, Mike               [LSS]
        132003 by: Marek Kilimajer

--with-mcal=/usr/local/mcal compilation issue
        131965 by: Roger Thomas

Re: Php's future with Asp .NET?
        131971 by: Tariq Murtaza

Changing page orientaion for printing
        131972 by: Stanislav Skrypnik
        132006 by: Marek Kilimajer

global variables
        131973 by: Dara Dowd
        131977 by: Jason k Larson

Making alternate rows of different colour
        131974 by: Denis L. Menezes
        131976 by: Rasmus Lerdorf
        131986 by: Chris Hayes
        132001 by: rush
        132004 by: Edward Peloke

Re: Passing Arrays Through Forms
        131978 by: Sancar Saran

Re: GD version 1.6.2 and resizing images...
        131979 by: Marco Alting
        131982 by: Jason Wong

Curl Linux Console String --> PHP Translation
        131980 by: Andrian Ivanov

Re: Security in included PHP files
        131981 by: Philippe Saladin

Re: Ever complained about lousy PHP programmers?
        131983 by: Tom Rogers

Re: What's the PHP-equivalent of Perl's AUTOLOAD feature?
        131985 by: Chris Hayes

Alternate row colours - what is wrong with this code?
        131987 by: Denis L. Menezes
        131988 by: Clarkson, Nick
        131989 by: Jason Wong
        131991 by: Chris Hayes
        131992 by: Clarkson, Nick

PDF
        131990 by: Brian McGarvie
        131993 by: Larry Brown

opening tex file
        131994 by: Artur Bereœniewicz
        131995 by: Jason Wong
        131999 by: Chris Hayes

Re: x12 837
        131997 by: Edward Peloke

Re: session_destroy have strange effect....
        131998 by: Marek Kilimajer

Re: getopt usage?
        132000 by: Jason Wong

little Prob...
        132005 by: Manohar Ramjibhai Solanki

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 ---
look at mysql's DATE_FORMAT()   Let mysql do it for you, instead of PHP
----- Original Message -----
From: Stephen
To: PHP List
Sent: Thursday, January 16, 2003 7:16 PM
Subject: [PHP] Display Dates in English o_O


I have a PHP driven site that as a time schedule. Since the site isn't exactly filled 
with very
intellagent people who just LOVE to translate times and dates from a weird format 
(Such as the
format used in MySQL), I'd like to take these from a MySQL table (the table's types 
are DATE and
TIME) and translate the date to something like "Thrusday, January 16th, 2003" when the 
date strate
from the table is "2003-01-16." Then with time, I'd like it to read something like 
"8:00 PM" when it
reads straight from the table "20:00:00." Another feature I'd like to have it 
timezones but that's
not the point of this message. If you don't mind, though, could you also tell me how 
to configure
the times according the the timezone a user has chosen?

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

"What's the point in appearance if your true love, doesn't care about it?" -- 
http://www.melchior.us



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

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

Friday, January 17, 2003, 11:16:53 AM, you wrote:
S> I have a PHP driven site that as a time schedule. Since the site isn't exactly 
filled with very intellagent people who just LOVE to translate times and dates from a 
weird format (Such as the
S> format used in MySQL), I'd like to take these from a MySQL table (the table's types 
are DATE and TIME) and translate the date to something like "Thrusday, January 16th, 
2003" when the date strate
S> from the table is "2003-01-16." Then with time, I'd like it to read something like 
"8:00 PM" when it reads straight from the table "20:00:00." Another feature I'd like 
to have it timezones but
S> that's not the point of this message. If you don't mind, though, could you also 
tell me how to configure the times according the the timezone a user has chosen?

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

S> "What's the point in appearance if your true love, doesn't care about it?" -- 
http://www.melchior.us

What you could do is use javascript to get the clients local time, compare it
with the server time and get a difference. Then get all dates from mysql as a
unix timestamp, apply the difference then use date() to format it as you want
and it will always match the clients time on their computer...even if they have
it wrong :)

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
php can help, but remember, PHP only outputs HTML code to the browser... it
can't actually resize the window, because that's a client-side thing like
javascript.

but you can find out the x and y of an image with
http://www.php.net/manual/en/function.getimagesize.php

Then use this information in a javascript which resizes the browser window.


Of course for the javascripts, you'd need to ask a JS list, and remember
that not everyone has javascript, and not everyone enjoys the web developer
resizing their windows and 'taking control' of their browsers :)


Justin


on 17/01/03 12:37 PM, Ezequiel Sapoznik ([EMAIL PROTECTED]) wrote:

> Hi!
> 
> Is there anyway in php to fit the window to the size of an image?
> 
> Thanks!
> 
> Ezequiel
> 
> 

--- End Message ---
--- Begin Message ---
ok, I try with

<?php
$size = getimagesize ("../images/1817.jpg");
echo "$size";
?>

to then use the x and y with a javascript code like:

window.open
('win_sizer.html','Photo','toolbar=yes,status=yes,scrollbars=yes,location=ye
s,menubar=yes,directories=yes,width=x,height=y')

But in the php part, I am receiving the following error:

Warning: getimagesize: Unable to open '../images/1817.jpg' for reading. in
/home/sites/site8/web/prueba.php on line 12

I'd like to add that I changed mode to 777 (UNIX)

Thank you for your help.

Ezequiel


"Justin French" <[EMAIL PROTECTED]> escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> php can help, but remember, PHP only outputs HTML code to the browser...
it
> can't actually resize the window, because that's a client-side thing like
> javascript.
>
> but you can find out the x and y of an image with
> http://www.php.net/manual/en/function.getimagesize.php
>
> Then use this information in a javascript which resizes the browser
window.
>
>
> Of course for the javascripts, you'd need to ask a JS list, and remember
> that not everyone has javascript, and not everyone enjoys the web
developer
> resizing their windows and 'taking control' of their browsers :)
>
>
> Justin
>
>
> on 17/01/03 12:37 PM, Ezequiel Sapoznik ([EMAIL PROTECTED]) wrote:
>
> > Hi!
> >
> > Is there anyway in php to fit the window to the size of an image?
> >
> > Thanks!
> >
> > Ezequiel
> >
> >
>


--- End Message ---
--- Begin Message ---
You need to change directory permissions too

Ezequiel Sapoznik wrote:

ok, I try with

<?php
$size = getimagesize ("../images/1817.jpg");
echo "$size";
?>

to then use the x and y with a javascript code like:

window.open
('win_sizer.html','Photo','toolbar=yes,status=yes,scrollbars=yes,location=ye
s,menubar=yes,directories=yes,width=x,height=y')

But in the php part, I am receiving the following error:

Warning: getimagesize: Unable to open '../images/1817.jpg' for reading. in
/home/sites/site8/web/prueba.php on line 12

I'd like to add that I changed mode to 777 (UNIX)

Thank you for your help.

Ezequiel


"Justin French" <[EMAIL PROTECTED]> escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

php can help, but remember, PHP only outputs HTML code to the browser...

it

can't actually resize the window, because that's a client-side thing like
javascript.

but you can find out the x and y of an image with
http://www.php.net/manual/en/function.getimagesize.php

Then use this information in a javascript which resizes the browser

window.

Of course for the javascripts, you'd need to ask a JS list, and remember
that not everyone has javascript, and not everyone enjoys the web

developer

resizing their windows and 'taking control' of their browsers :)


Justin


on 17/01/03 12:37 PM, Ezequiel Sapoznik ([EMAIL PROTECTED]) wrote:


Hi!

Is there anyway in php to fit the window to the size of an image?

Thanks!

Ezequiel







--- End Message ---
--- Begin Message ---
Dose anyone know how can i do that:
- select some data form a sql db and put it in a web page. the
problem is that i whant to change the value (name) of a column that is
selected form the database and then put in a web page with the diferent
name.

Thanks, Paul
--- End Message ---
--- Begin Message ---
SELECT first_name AS first FROM clients

As you can see the first_name field will now be accessable as first.



Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]

> -----Original Message-----
> From: Paul Marinas [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, 17 January 2003 12:58 PM
> To: Ezequiel Sapoznik
> Cc: [EMAIL PROTECTED]
> Subject: [PHP] output sql
> 
> 
> 
> Dose anyone know how can i do that:
> - select some data form a sql db and put it in a web page. 
> the problem is that i whant to change the value (name) of a 
> column that is selected form the database and then put in a 
> web page with the diferent name.
> 
> Thanks, Paul
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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

I have a table in a MySQL-db. The primary-key-coloumn is a number which is
not sorted. I don't know how many records there are.

I have a while-loop in a php-page which prints a link for each record. Each
link points to the same page (iow. page reloads).

When someone click on one of these links I would like to create a unike
session-variable which identifies the links record and set it's value like
1. The next time someone click on the link, the variable should be set like
0.

The meaning is to run another query if a record's variable is set to 1 and
display it. The page will then have functionality like windows explorer (you
can click on a folder and it will then display its contents).

The problem is how I can make a unike variable for each record and know how
to call it(know it's name).

Hope someone understands my problem. (difficult to explain)

Thanks.

Lars


--- End Message ---
--- Begin Message ---
Is it possible to register an array as a session variable? If so I think it
solves my problem.


Thanks.

Lars


"Lars Espelid" <[EMAIL PROTECTED]> skrev i melding
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I have a table in a MySQL-db. The primary-key-coloumn is a number which is
> not sorted. I don't know how many records there are.
>
> I have a while-loop in a php-page which prints a link for each record.
Each
> link points to the same page (iow. page reloads).
>
> When someone click on one of these links I would like to create a unike
> session-variable which identifies the links record and set it's value like
> 1. The next time someone click on the link, the variable should be set
like
> 0.
>
> The meaning is to run another query if a record's variable is set to 1 and
> display it. The page will then have functionality like windows explorer
(you
> can click on a folder and it will then display its contents).
>
> The problem is how I can make a unike variable for each record and know
how
> to call it(know it's name).
>
> Hope someone understands my problem. (difficult to explain)
>
> Thanks.
>
> Lars
>
>


--- End Message ---
--- Begin Message ---
wouldn't you use the primary key as the unique identifier?

<html>
<body>
<?
if(!isset($_GET['id']))
    {
    // show all records
    // print a clickable list of first and last names

    $sql = "select id,firstname,lastname from contacts";
    $result = mysql_query($sql);
    while($myrow = mysql_fetch_array($result))
        {
        echo "<a href=\"{$_SERVER['PHP_SELF']}?id={$myrow['id']}\">";
        echo "{$myrow['firstname']} {$myrow['lastname']}</a>";
        }
    }
else
    {
    // show the details of a specific contact
    $sql = "select * from contacts where id='{$_GET['id]}' LIMIT 1";
    $result = mysql_query($sql);
    $myrow = mysql_fetch_array($result);
    echo "{$myrow['firstname']} {$myrow['lastname']}<br />";
    echo "{$myrow['phone']}<br />";
    echo "{$myrow['fax']}<br />";
    echo "{$myrow['email']}<br />";
    }
?>
</body>
</html>


the key line here is
echo "<a href=\"{$_SERVER['PHP_SELF']}?id={$myrow['id']}\">";

which puts the ID into the URL, and is used to decide if you want to show
all records (no ID in URL) or just one (id in the URL).


Have fun,

Justin


    




on 17/01/03 2:17 PM, Lars Espelid ([EMAIL PROTECTED]) wrote:

> Hello,
> 
> I have a table in a MySQL-db. The primary-key-coloumn is a number which is
> not sorted. I don't know how many records there are.
> 
> I have a while-loop in a php-page which prints a link for each record. Each
> link points to the same page (iow. page reloads).
> 
> When someone click on one of these links I would like to create a unike
> session-variable which identifies the links record and set it's value like
> 1. The next time someone click on the link, the variable should be set like
> 0.
> 
> The meaning is to run another query if a record's variable is set to 1 and
> display it. The page will then have functionality like windows explorer (you
> can click on a folder and it will then display its contents).
> 
> The problem is how I can make a unike variable for each record and know how
> to call it(know it's name).
> 
> Hope someone understands my problem. (difficult to explain)
> 
> Thanks.
> 
> Lars
> 
> 

--- End Message ---
--- Begin Message ---
Yes, the php manual is available at http://www.php.net, session
information is available at http://www.php.net/session.

Jason

On Thu, 2003-01-16 at 20:58, Lars Espelid wrote:
> Is it possible to register an array as a session variable? If so I think it
> solves my problem.
> 
> 
> Thanks.
> 
> Lars
> 
> 
> "Lars Espelid" <[EMAIL PROTECTED]> skrev i melding
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hello,
> >
> > I have a table in a MySQL-db. The primary-key-coloumn is a number which is
> > not sorted. I don't know how many records there are.
> >
> > I have a while-loop in a php-page which prints a link for each record.
> Each
> > link points to the same page (iow. page reloads).
> >
> > When someone click on one of these links I would like to create a unike
> > session-variable which identifies the links record and set it's value like
> > 1. The next time someone click on the link, the variable should be set
> like
> > 0.
> >
> > The meaning is to run another query if a record's variable is set to 1 and
> > display it. The page will then have functionality like windows explorer
> (you
> > can click on a folder and it will then display its contents).
> >
> > The problem is how I can make a unike variable for each record and know
> how
> > to call it(know it's name).
> >
> > Hope someone understands my problem. (difficult to explain)
> >
> > Thanks.
> >
> > Lars
> >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I don't use postfix but as far as I know it is a drop in replacement and
you should just change the entry in php.ini

look for:

 ; For Unix only.  You may supply arguments as well (default: "sendmail
-t -i").
 ;sendmail_path =


Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]

> -----Original Message-----
> From: HPS [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, 17 January 2003 11:50 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] postfix instead of sendmail 
> 
> 
> what should i do if i want to use PostFix in the php, but not 
> SendMail?
> 
> thx very much
> HPS
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
Hi All,

I am trying to make an automated tour as a section of my site, using the
following.

<?php
$NewID = $colname_earlytour + 1;
?>
<META HTTP-EQUIV="refresh" CONTENT="15" URL=early-tour.php?ID= <?php echo
"$NewID";?>>

This works great going from early-tour?ID=1 to early-tour?ID=2 but I can't
get it to continue on to ID=3, ID=4 etc. It just keeps reloading the data
from ID=2

The data for each page is in a row identified by a unique ID# I just want
the page to reload with the data from the next ID# after a givin time 15
seconds.

Thanks in advance for any ideas,
Edson Waite III
http://www.sportsvideooutlet.com




--- End Message ---
--- Begin Message ---
On Friday 17 January 2003 11:25, Edson Waite wrote:
> Hi All,
>
> I am trying to make an automated tour as a section of my site, using the
> following.
>
> <?php
> $NewID = $colname_earlytour + 1;
> ?>
> <META HTTP-EQUIV="refresh" CONTENT="15" URL=early-tour.php?ID= <?php echo
> "$NewID";?>>
>
> This works great going from early-tour?ID=1 to early-tour?ID=2 but I can't
> get it to continue on to ID=3, ID=4 etc. It just keeps reloading the data
> from ID=2
>
> The data for each page is in a row identified by a unique ID# I just want
> the page to reload with the data from the next ID# after a givin time 15
> seconds.

Where does $colname_earlytour come from?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Credit ... is the only enduring testimonial to man's confidence in man.
                -- James Blish
*/

--- End Message ---
--- Begin Message ---
Hi Jason,

<?php
$colname_earlytour = "1";
if (isset($HTTP_GET_VARS['ID'])) {
  $colname_earlytour = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['ID'] :
addslashes($HTTP_GET_VARS['ID']);
}
mysql_select_db($database_airforcemuseum, $airforcemuseum);
$query_earlytour = sprintf("SELECT * FROM early WHERE ID = %s",
$colname_earlytour);
$earlytour = mysql_query($query_earlytour, $airforcemuseum) or
die(mysql_error());
$row_earlytour = mysql_fetch_assoc($earlytour);
$totalRows_earlytour = mysql_num_rows($earlytour);
?>

This code was inserted by DWMX  when I created the record set "earlytour" So
I don't know exactly.

[EMAIL PROTECTED]
> On Friday 17 January 2003 11:25, Edson Waite wrote:
> > Hi All,
> >
> > I am trying to make an automated tour as a section of my site, using the
> > following.
> >
> > <?php
> > $NewID = $colname_earlytour + 1;
> > ?>
> > <META HTTP-EQUIV="refresh" CONTENT="15" URL=early-tour.php?ID= <?php
echo
> > "$NewID";?>>
> >
> > This works great going from early-tour?ID=1 to early-tour?ID=2 but I
can't
> > get it to continue on to ID=3, ID=4 etc. It just keeps reloading the
data
> > from ID=2
> >
> > The data for each page is in a row identified by a unique ID# I just
want
> > the page to reload with the data from the next ID# after a givin time 15
> > seconds.
>
> Where does $colname_earlytour come from?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Credit ... is the only enduring testimonial to man's confidence in man.
> -- James Blish
> */
>


--- End Message ---
--- Begin Message ---
On Friday 17 January 2003 12:45, Edson Waite wrote:
> Hi Jason,
>
> <?php
> $colname_earlytour = "1";
> if (isset($HTTP_GET_VARS['ID'])) {
>   $colname_earlytour = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['ID'] :
> addslashes($HTTP_GET_VARS['ID']);
> }
> mysql_select_db($database_airforcemuseum, $airforcemuseum);
> $query_earlytour = sprintf("SELECT * FROM early WHERE ID = %s",
> $colname_earlytour);
> $earlytour = mysql_query($query_earlytour, $airforcemuseum) or
> die(mysql_error());
> $row_earlytour = mysql_fetch_assoc($earlytour);
> $totalRows_earlytour = mysql_num_rows($earlytour);
> ?>
>
> This code was inserted by DWMX  when I created the record set "earlytour"
> So I don't know exactly.

What does your complete code look like?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
One good turn asketh another.
                -- John Heywood
*/

--- End Message ---
--- Begin Message ---
Try this:

$NewID = $ID + 1; (instead of the $NewID assignment you've got now...)


"Edson Waite" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi All,
>
> I am trying to make an automated tour as a section of my site, using the
> following.
>
> <?php
> $NewID = $colname_earlytour + 1;
> ?>
> <META HTTP-EQUIV="refresh" CONTENT="15" URL=early-tour.php?ID= <?php echo
> "$NewID";?>>
>
> This works great going from early-tour?ID=1 to early-tour?ID=2 but I can't
> get it to continue on to ID=3, ID=4 etc. It just keeps reloading the data
> from ID=2
>
> The data for each page is in a row identified by a unique ID# I just want
> the page to reload with the data from the next ID# after a givin time 15
> seconds.
>
> Thanks in advance for any ideas,
> Edson Waite III
> http://www.sportsvideooutlet.com
>
>
>
>


--- End Message ---
--- Begin Message ---
> > On Friday 17 January 2003 11:25, Edson Waite wrote:
> > > Hi All,
> > >
> > > I am trying to make an automated tour as a section of my 
> site, using the
> > > following.
> > >
> > > <?php
> > > $NewID = $colname_earlytour + 1;
> > > ?>
> > > <META HTTP-EQUIV="refresh" CONTENT="15" 
> URL=early-tour.php?ID= <?php
> echo
> > > "$NewID";?>>

This looks supect if it's a direct cut-and-paste from your script -- you've got a 
superfluous space between ?ID= and <? php echo which shouldn't be there and may affect 
the value of ID that your script sees.

(Also, although it won't affect your results, you really don't need those quotes in 
the echo -- why force PHP to interpret a string, extract the $NewID part, and then go 
fetch its value, when you could write <?php echo $NewID ?> and let it just fetch the 
value straight off?  (In fact, come to that, why even bother with $NewID at all when 
you can write <?php echo $colname_earlytour + 1 ?> and have done with it?))

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 
--- End Message ---
--- Begin Message ---
<META HTTP-EQUIV="refresh" CONTENT="15; URL=early-tour.php?ID=<?php echo
"$NewID";?>">


misplaced quote, missing semicomma, and redundant space

Edson Waite wrote:

Hi All,

I am trying to make an automated tour as a section of my site, using the
following.

<?php
$NewID = $colname_earlytour + 1;
?>
<META HTTP-EQUIV="refresh" CONTENT="15" URL=early-tour.php?ID= <?php echo
"$NewID";?>>

This works great going from early-tour?ID=1 to early-tour?ID=2 but I can't
get it to continue on to ID=3, ID=4 etc. It just keeps reloading the data
from ID=2

The data for each page is in a row identified by a unique ID# I just want
the page to reload with the data from the next ID# after a givin time 15
seconds.

Thanks in advance for any ideas,
Edson Waite III
http://www.sportsvideooutlet.com







--- End Message ---
--- Begin Message ---
php-4.3
libmcal-0.5 (i intend to use Horde's Kronolith and the README said it cannot
work with libmcal-0.6)

configure gave this error:
checking for MCAL support... yes
configure: error: Unable to locate your libmcal header files - cal_misc.h
should be in the directory you specify or in the include/ subdirectory below it
- default search location is /usr/local

please advise.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
Sancar Saran wrote:
On Thursday 16 January 2003 09:07, Dhaval Desai wrote:

Hello ppl,

I was just wondering what is php's future with something like Asp .Net
coming up...I have read many articles by Php guys who think Asp.Net is the
future. If that's the true case...is it really worth sticking to Php at
all?

Thanx!
-Dhaval

Hi,
My opinon is Php future is very bright. .NET is marketing mumbo jumbo, and java is Sun's bug yard.

It was pretty clear. None of them able to compete against PHP. ASP.NET is expensive, JSP is hard to config and code. Both of them slower than PHP, learning PHP easier than others.

Sancar "Delifisek" Saran
And Moreover its FREE.... :)

Tariq






--- End Message ---
--- Begin Message ---
Hi everybody,
Is it possible using PHP change page orientation in browser so that when
user clicks
on "Print" button page automatically rotated to "landscape" orientation.
I've heard that it is possible to do with ActiveX but due to security reason
ActiveX might be disabled.
Thanks for any help in advance,
Stas.


--- End Message ---
--- Begin Message ---
No, but you can use pdf

Stanislav Skrypnik wrote:

Hi everybody,
Is it possible using PHP change page orientation in browser so that when
user clicks
on "Print" button page automatically rotated to "landscape" orientation.
I've heard that it is possible to do with ActiveX but due to security reason
ActiveX might be disabled.
Thanks for any help in advance,
Stas.





--- End Message ---
--- Begin Message ---
Is it "better" to pass variables through functions or to simply declare them as global 
within the function's scope?
The variables in this particular case are things like MySQL database connections and 
tablenames.
Thanks,Dara
-- 
For the largest free email in Ireland (25MB) & 
File Storage space (20MB), visit http://www.campus.ie

Powered by Outblaze
--- End Message ---
--- Begin Message --- In terms of security, or in my opinion, good and proper coding, it is best to have no global variables. There is always a way to wrap variables that will be needed in local scopes. However, this philosophy is harder to practice than it is to preach. Code can get ugly when passing if you are not strong in your coding designing abilities.

Sometime it just becomes easier to attempt to keep as much out of the global scope as possible and suffer the idea of some of them being globally available.

That being said, if someone was to exploit a script that had global or local access to a variable storing database connection info, then the consequences could be drastic. Similar situations are easly applicable as well, with any crucial data or passwords etc.

You should consider reading the section entitled,
"Security: New Input Mechanism" here: http://www.php.net/release_4_1_0.php

Regards,
Jason k Larson


Dara Dowd wrote:

Is it "better" to pass variables through functions or to simply declare them as global within the function's scope?
The variables in this particular case are things like MySQL database connections and tablenames.
Thanks,Dara


--- End Message ---
--- Begin Message ---
Hello friends.

I put the output of the database query in a table. It works fine. Now I have a need to 
make the alternate rows of a different color.

Can someone please help me with the code?

Thanks
Denis
--- End Message ---
--- Begin Message ---
> I put the output of the database query in a table. It works fine. Now I have a need 
>to make the alternate rows of a different color.
> 
> Can someone please help me with the code?

   $cols = array('#ff0000','#00ff00');
   $i = 0;
   while(your_loop_to_output_each_row) {
      echo '<tr bgcolor="'.$cols[$i%2].'"><td>$row_data</td></tr>';
   }

-Rasmus

--- End Message ---
--- Begin Message ---
At 09:05 17-1-2003, you wrote:
> I put the output of the database query in a table. It works fine. Now I have a need to make the alternate rows of a different color.
>
> Can someone please help me with the code?

$cols = array('#ff0000','#00ff00');
$i = 0;
while(your_loop_to_output_each_row) {
echo '<tr bgcolor="'.$cols[$i%2].'"><td>$row_data</td></tr>';
}
um, Rasmus, shouldn't this have a
$i++;
line in the while loop?


some other ways (there are many)

- shortest code, you need to use a 'for' loop or add a counter $i that is increased in every loop

for ($i=0; $i<=10; $i++)
{ echo '<tr bgcolor="'.(($i%2==0)?'red':'white')."\"><td>$i</td></tr>";
}


- using a color toggle

$color_toggle=false;
for ($i=0;$i<10;$i++)
{
echo('<TR bgcolor="'.(($color_toggle=!$color_toggle)?'#D8D1E7':'white')
}

Of ocurse you can put the color values in variabels like $color1 and $color2, and define them at the top of the file for easier configuring.





--- End Message ---
--- Begin Message ---
"Denis L. Menezes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I put the output of the database query in a table. It works fine. Now I
have a need to make the alternate rows of a different color.
>
> Can someone please help me with the code?

See one possible solution (with TemplateTamer) :

http://www.templatetamer.org/index.php?AlternatingListExample

rush
--
http://www.templatetamer.org/



--- End Message ---
--- Begin Message ---
I did this by defining two colors, and as I looped through the query, I
would just change it each time...

ex...

$trcolor="#F0F8FF";
while ($myrow = mysql_fetch_array($result)){
          $colorset=0;
            if ($trcolor=='#F0F8FF'){
                  $trcolor='#B0C4DE';
                  $colorset=1;
                                     }
            if ($colorset==0){
                  if ($trcolor=='#B0C4DE'){
                       $trcolor='#F0F8FF';}
                              }
          print "<tr bgcolor='$trcolor'>";

                                             }

Eddie

-----Original Message-----
From: rush [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 8:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Making alternate rows of different colour


"Denis L. Menezes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I put the output of the database query in a table. It works fine. Now I
have a need to make the alternate rows of a different color.
>
> Can someone please help me with the code?

See one possible solution (with TemplateTamer) :

http://www.templatetamer.org/index.php?AlternatingListExample

rush
--
http://www.templatetamer.org/




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

--- End Message ---
--- Begin Message ---
On Thursday 16 January 2003 20:58, [EMAIL PROTECTED] wrote:
> Hello Everyone,
>
> I've attempted this many times, but have failed to understand it each time.
> I want to make it easier for myself to deal with passing variables through
> a form. So I thought, why not use a single array variable to do that. If I
> do such a thing, what steps do I need to take to ensure that the values in
> the array are intact just as the user entered it? How do I serialize array
> data from an initial form? Here's a simple example of what I might have:
>
> <form method="post" action="some_page.php">
>    <input type="text" name="form_vars['firstname']"></input>
>    <input type="text" name="form_vars['lastname']"></input>
>    <input type="text" name="form_vars['address']"></input>
>    <input type="text" name="form_vars['city']"></input>
>    <input type="text" name="form_vars['state']"></input>
>    <input type="text" name="form_vars['zip']"></input>
> </form>
>

 <form method="post" action="some_page.php">
    <input type="text" name="form_vars[firstname]"></input>
    <input type="text" name="form_vars[lastname]"></input>
    <input type="text" name="form_vars[address]"></input>
    <input type="text" name="form_vars[city]"></input>
    <input type="text" name="form_vars[state]"></input>
    <input type="text" name="form_vars[zip]"></input>
 </form>

some_page.php
<?
$form_vars = $_POST["form_vars"];

?>




--- End Message ---
--- Begin Message ---
I've looked at netpbm and ImageMagick, but I can't make heads or tails from
it, I have to 'make' modules and stuff? My site is hosted on an Apache
server, Is there maybe a pre-baked version I can download and install?

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> On Thursday 16 January 2003 17:43, Marco Alting wrote:
> > My provider has GD version 1.6.2 running, and I'm trying to 
> > dynamically resize uploaded JPEG images. But ofcourse that doesn't 
> > work with that version. Does anyone have another solution to 
> > automatically resize JPEG images upon upload?
> 
> If you can install your own programs then you can use netpbm or 
> ImageMagick
> (or you can ask your host to do so).
> 
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> 
> /*
> He who knows, does not speak.  He who speaks, does not know.
>               -- Lao Tsu
> */
> 
--- End Message ---
--- Begin Message ---
On Friday 17 January 2003 16:38, Marco Alting wrote:
> I've looked at netpbm and ImageMagick, but I can't make heads or tails from
> it, I have to 'make' modules and stuff? 

Can't you persuade your host to upgrade to a more recent version of GD -- 
1.6.2 is pretty ancient.

If they won't/can't upgrade then the least they can do is install 
netpbm/imagemagick so everyone can use it.

> My site is hosted on an Apache
> server, 

This isn't important ...

> Is there maybe a pre-baked version I can download and install?

..., you need to know the OS and architecture that your server is running then 
see if someone has produced a binary version.

If you're still here (ie none of the above worked for you) then it's time to 
get you hands dirty and do some "configure; make; make install". This is 
beyond the scope of this list.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Law stands mute in the midst of arms.
                -- Marcus Tullius Cicero
*/

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

i have a curl string:

curl --casert CA.srt -E client.pem:huho8 -l "https://...";

now, i've added all of the needed curl properties for the php
application(e.g. curl_setopt($connection,CURLOPT_PORT,9000).... BUT i can't
find what's the name of the Curl CONSTANT matching the client's Public Key
file, if anybody can help me...

Regards, Andrian Ivanov




--- End Message ---
--- Begin Message ---
"Jacob Copsey" <[EMAIL PROTECTED]> a écrit dans le message news:
[EMAIL PROTECTED]
> This should work as long as you are only including your include files from
> scripts named index.php.

Yes, of course. I have only one *real* page beginning with <html> and ending
with </html>, called index.php, and depending on the user navigation with a
menu, the required files are included.

Thanks Jacob.

Ph.


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

Friday, January 17, 2003, 4:44:19 AM, you wrote:
PH> Leon Mergen said:

>> Now, first of all, why did you this:
>>
>> <?php echo("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); ?>
>>
>> and not just:
>>
>> <?xml version="1.0" encoding="UTF-8" ?>

PH> Because short tags are evil ;-)  My provider has short tags enabled, so
PH> there is no getting around this bit of ugliness.

>> only that I personally prefer to call a print() statement for
>> everything

PH> Do you mean as opposed to echo?

PH> If so, would you mind saying a few word as to why?

PH> I read that echo is a "language construct."  It seems like it would be
PH> preferable to print() for this reason.  On top of that, it will take
PH> multiple strings as input.  I think I will remove the parentheses, though.

PH> -Peter
put it into single quotes and it is a bit tidier :)  and you don't need the semi
colon if you are ending php parsing.

<?php echo '<?xml version="1.0" encoding="UTF-8" ?>'?>

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
At 02:06 17-1-2003, you wrote:
I just read an interesting article in The Perl Journal (TPJ) about using
AUTOLOAD as a layer of abstraction for accessing database columns and I
would like to write something similar in PHP.  Is this possible?
If you mean some sort of database abstraction so one script would work on MySQL as well as Oracle; there is not such a thing within PHP itself. The google search term would 'database abstraction layer' and a popular one is ADODB (not to be confused with the other adoDB), at http://php.weblogs.com/ADODB.

If that's not what you mean please try to explain it again....

Chris Hayes



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

I want alternating colours in the output table. Can someone tell me what is wrong with 
this code? I get the data but no alternating colours.

Quote :

 <?php
 $cols = array('#ff0000','#00ff00');
     $i = 0;
 while($row=mysql_fetch_array($result)){ 
      echo '<tr bgcolor="'.$cols[$i++%2].'">';
    Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font 
face=\"Tahoma\" color=\"#000000\">" ;
 Print   "<b> <font size=\"2\" color=\"ff0000\"> $row[OrgName] </b></font>";
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font 
size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print  $row[Country]; 
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font 
size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print  $row[Date]; 
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#FFFFbf\"><font 
size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print  $row[Number]; 
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\" bgcolor=\"#b7b700\"><font 
size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print "<form action=\"fullmarks.php\" method=\"post\">";
    Print"<INPUT TYPE=\"submit\" value=\"View details\" Name=\"Details\">";
    Print"<input type=\"hidden\" name=\"SelectedItemNumber\" value= $row[Id]";
     print "</td>";
     Print "</form>";
    Print "</tr>";}
   }
 ?>


Unquote.


Thanks
Denis
--- End Message ---
--- Begin Message ---
I think it's because you're setting the bgcolor="#FFFFbf" for the TD tag, so
it's overriding using the TR tag bgcolor. The maths is OK, so if you remove
the td bgcolor bit it *should* (standard disclaimer) work.

Nick

-----Original Message-----
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: 17 January 2003 12:12
To: PHP general list
Subject: [PHP] Alternate row colours - what is wrong with this code?


Hello Guys,

I want alternating colours in the output table. Can someone tell me what is
wrong with this code? I get the data but no alternating colours.

Quote :

 <?php
 $cols = array('#ff0000','#00ff00');
     $i = 0;
 while($row=mysql_fetch_array($result)){ 
      echo '<tr bgcolor="'.$cols[$i++%2].'">';
    Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font face=\"Tahoma\" color=\"#000000\">" ;
 Print   "<b> <font size=\"2\" color=\"ff0000\"> $row[OrgName] </b></font>";
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print  $row[Country]; 
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print  $row[Date]; 
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print  $row[Number]; 
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#b7b700\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print "<form action=\"fullmarks.php\" method=\"post\">";
    Print"<INPUT TYPE=\"submit\" value=\"View details\" Name=\"Details\">";
    Print"<input type=\"hidden\" name=\"SelectedItemNumber\" value=
$row[Id]";
     print "</td>";
     Print "</form>";
    Print "</tr>";}
   }
 ?>


Unquote.


Thanks
Denis


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.

--- End Message ---
--- Begin Message ---
On Friday 17 January 2003 20:11, Denis L. Menezes wrote:
> Hello Guys,
>
> I want alternating colours in the output table. Can someone tell me what is
> wrong with this code? I get the data but no alternating colours.
>
> Quote :
>
>  <?php
>  $cols = array('#ff0000','#00ff00');
>      $i = 0;
>  while($row=mysql_fetch_array($result)){
>       echo '<tr bgcolor="'.$cols[$i++%2].'">';

Look at the HTML source of the resulting page, if each <tr bgcolor...> is 
alternating then your code is working. Which means your HTML is dodgy ...

>     Print "<td width=\"12%\" align=\"center\" height=\"6\"
> bgcolor=\"#FFFFbf\"><font face=\"Tahoma\" color=\"#000000\">" ; Print  

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
There are no winners in life, only survivors.
*/

--- End Message ---
--- Begin Message --- At 13:11 17-1-2003, you wrote:
> I want alternating colours in the output table. Can someone tell me what is wrong with this code? I get the data but no alternating colours.

It has to do with the $cols[$i++%2] part.

When I try to print $i++%2 the outcome varies between 1 and none. Somehow the complete row is not show anymore.

The easiest way is to stop trying this approach and move to the tested versions i mailed to this list about an hour ago.


Further i would suggest to keep the form within the <td></td> bit and not overlap it.

--- End Message ---
--- Begin Message ---
I've just tested this stripped down (some colours changed) version of your
code and I get alternating rows no problem. On another point, without the
<TABLE> tags it won't work properly. I think your PHP works fine, it's your
HTML ;o)

Nick

<?php
$cols = array('#ff0000','#00ff00');
print "<TABLE>";
for ($i = 0; $i<10;) {
print '<tr bgcolor="'.$cols[$i++%2].'">';
print "<td width=\"12%\" align=\"center\" height=\"6\"><font face=\"Tahoma\"
size=\"2\" color=\"555555\">TEST</font>" ;
print "&nbsp;</td></tr>";
}
print "</TABLE>";
?>





-----Original Message-----
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: 17 January 2003 12:12
To: PHP general list
Subject: [PHP] Alternate row colours - what is wrong with this code?


Hello Guys,

I want alternating colours in the output table. Can someone tell me what is
wrong with this code? I get the data but no alternating colours.

Quote :

 <?php
 $cols = array('#ff0000','#00ff00');
     $i = 0;
 while($row=mysql_fetch_array($result)){ 
      echo '<tr bgcolor="'.$cols[$i++%2].'">';
    Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font face=\"Tahoma\" color=\"#000000\">" ;
 Print   "<b> <font size=\"2\" color=\"ff0000\"> $row[OrgName] </b></font>";
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print  $row[Country]; 
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print  $row[Date]; 
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#FFFFbf\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print  $row[Number]; 
 print "</font>  &nbsp;</td>";
 Print "<td width=\"12%\" align=\"center\" height=\"6\"
bgcolor=\"#b7b700\"><font size=\"2\" face=\"Tahoma\" color=\"#000000\">" ;
 Print "<form action=\"fullmarks.php\" method=\"post\">";
    Print"<INPUT TYPE=\"submit\" value=\"View details\" Name=\"Details\">";
    Print"<input type=\"hidden\" name=\"SelectedItemNumber\" value=
$row[Id]";
     print "</td>";
     Print "</form>";
    Print "</tr>";}
   }
 ?>


Unquote.


Thanks
Denis


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.

--- End Message ---
--- Begin Message ---
I'm looking to find out if PHP has the ability to do this...

OK I'm looking for a solution that could do the following.

We require to generate PDF files that can then be emailed or printed &
posted to clients.

I can create PDF Files from scratch using PDFLib.

What we will require to do though is, we presently have paper copies of
forms from various parties we deal with, our present Access-based system
simply prints on top of these, I am presently developing in PHP a system to
replace the Access database, we will want it to create these as PDF files
(we can get the printed forms in PDF format) based on supplied PDF files...
for example, generate a PDF for Customer X based on Supplier Z's PDF file.

Any solutions in PHP (open source, free, commercial etc etc.) would be very
much appreciated, or if we need to look at another Language to perform this
part of the solution (i.e. ASP).

The solution I'm developing is PHP, running on a Windows 2000 Server as we
require use of some windows-only software too. So if *cough* ASP is what's
needed to do the above then so be it :\ - really hope not though!!!

Thanks in advance!


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03


--- End Message ---
--- Begin Message ---
According to pdflib their commercial version gives you the ability to edit
pdf files using the PDI library.  Have you looked at this?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-----Original Message-----
From: Brian McGarvie [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 7:23 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] PDF

I'm looking to find out if PHP has the ability to do this...

OK I'm looking for a solution that could do the following.

We require to generate PDF files that can then be emailed or printed &
posted to clients.

I can create PDF Files from scratch using PDFLib.

What we will require to do though is, we presently have paper copies of
forms from various parties we deal with, our present Access-based system
simply prints on top of these, I am presently developing in PHP a system to
replace the Access database, we will want it to create these as PDF files
(we can get the printed forms in PDF format) based on supplied PDF files...
for example, generate a PDF for Customer X based on Supplier Z's PDF file.

Any solutions in PHP (open source, free, commercial etc etc.) would be very
much appreciated, or if we need to look at another Language to perform this
part of the solution (i.e. ASP).

The solution I'm developing is PHP, running on a Windows 2000 Server as we
require use of some windows-only software too. So if *cough* ASP is what's
needed to do the above then so be it :\ - really hope not though!!!

Thanks in advance!


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.438 / Virus Database: 246 - Release Date: 07/01/03



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


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

  how can I open text file and start reading in the middle of it?

-- 
regards,


--- End Message ---
--- Begin Message ---
On Friday 17 January 2003 20:59, Artur Bereśniewicz wrote:

>   how can I open text file and start reading in the middle of it?

AFAIK it's not possible to jump directly into the middle of a file and start 
reading.

You would have to read it line-by-line until you get to the part you're 
interested in.

If the file isn't large (say less than several MBs) then just read it all into 
an array using file() and process it from there.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
You definitely intend to start living sometime soon.
*/

--- End Message ---
--- Begin Message ---
At 14:05 17-1-2003, you wrote:
On Friday 17 January 2003 20:59, Artur Bereœniewicz wrote:

> how can I open text file and start reading in the middle of it?

AFAIK it's not possible to jump directly into the middle of a file and start
reading.

You would have to read it line-by-line until you get to the part you're
interested in.

If the file isn't large (say less than several MBs) then just read it all into
an array using file() and process it from there.
Well why not try something like this

<?PHP
$filename="halffile.txt";

$fp=fopen("$filename","r");
fseek($fp,$numpoint);

//jump to midfile
$middle_of_file=(filesize($filename))/2;
echo "\n".$middle_of_file;
$precontent=fread($fp,$middle_of_file);

$content=fread($fp,filesize("$filename"));
fclose($fp);
echo nl2br($content);

exit();
?>

--- End Message ---
--- Begin Message ---
Thanks Cal,

I may be asking some questions!  I just have a blank script now so I have a
lot to do!

Eddie

-----Original Message-----
From: Cal Evans [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 4:37 PM
To: Edward Peloke; Php-General@Lists. Php. Net
Subject: RE: [PHP] x12 837


yea, mine is all array based.  I pull the data from a FoxPro table via XML
(and jump through several hoops.)  Then I have a main loop that spins
through the data (which is ordered) and

* creates a new PO if the PO number has changes (PO Object)
* Create a PoLineItem for each line in the PO (POLineItemObject)
* repeat.

* PO's own POLineItems
* All PO's are owned by the X12_850 object.

Once everything is nicely sliced and diced into objects I call
X12_850->generateX12(). This spits out all the necessary headers and then
calls generateX12() on each PO. Each PO spits out all the necessary headers
and then calls generateX12() on each POLine Item.  Then it spits out the
necessary trailers and bumps control back up the line.

Once it's finished, I have a (honkin' big) string that represents the 850
document. Currently, I dump this out to a file for ftping but you could just
as easily use CURL to call a SOAP process somewhere if your X12 partner had
a brain. (mine does not, the company I was a consultant for in the medical
insurance industry did not either)

Anyhow, I'm happy to share what I know if you have questions.

HTH,
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
* http://www.calevans.com
*


-----Original Message-----
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 3:55 PM
To: Php-General@Lists. Php. Net
Subject: RE: [PHP] x12 837


Cal,

You used php for this?  I am pretty sure that an 850 is on our list of
things to do somewhere.

Eddie

-----Original Message-----
From: Cal Evans [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 4:22 PM
To: Edward Peloke; Php-General@Lists. Php. Net
Subject: RE: [PHP] x12 837


I've created an 850 and a base class x12. It's not terribly hard. I did not
find much in the way of useful classes already built though.

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-----Original Message-----
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 3:39 PM
To: Php-General@Lists. Php. Net
Subject: [PHP] x12 837


Ok, I know this is a longshot but does anyone on this list work in the
healthcare industry and have created an 837 with php?  I am thinking of
attempting to create one in php and didn't want to reinvent the wheel.

Thanks,
Eddie


--
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
This seems pretty dangerous to me. You should better explain your
problem, I didn't understand it.

Scott Fletcher wrote:

Oh never mind. I found a work around to it. I can use the passthru
command. Like this...

--clip--
passthru("rm -f /tmp/sess_*****")
--clip--

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

session_destroy() do work when I logged out of the website. But if I'm
logged in and open a 2nd browser and try to log in. This where the script

I

use to detect exisitng session and destroy it before generating a new one.
Problem is that session_destroy does not work on the 2nd browser...

So, my question is what is the workaround to using session_destroy() ????
How do I unset it???? Etc....

I tried this one but it had no effect if I'm the 2nd user...

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

$_SESSION = array();
session_destroy();

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







--- End Message ---
--- Begin Message ---
On Thursday 16 January 2003 06:51, Eli Criffield wrote:
> I can't seem to find any examples of code using getopt() around. I'm
> thinking not many people use php for command line shell scripts.
>
> Here is what i came up with for getopt();
>
> <?
> $options = getopt("a:bc");
>
> reset($options);
> while(list($key, $value) = each($options)) {
>     switch ($key) {
>         case 'b':
>             $B=1;
>             break;
>         case 'a':
>             $A=$value;
>             break;
>         case 'c':
>             $C=1;
>             break;
>         default:
>             echo "unknown option";
>           // print usage or something
>             break;
>     }
> }
> ?>
>
> The problem with this is it never hits default in the switch. If you give
> an argument that it doesn't know about it accepts it without doing anything
> and without an error, 

getopt() has already sanitised the arguments for you thus unknown 
options/switches do not make it into $options -- meaning you cannot test for 
them! Try print_r($options) and enter differing combinations of 
options/switches and see what you get.

> same thing if you don't give a value for an argument
> thats supposed to have one (like -a above).

That you have to test for yourself. In your example above if $A is empty then 
inform the user.

> Oh and --long arguments would
> be nice too.

Yes and I'll have fries with that as well please ;-)

> So why not use the Console/Getopt.php library you ask. Because i can't
> figure out how to parse the output array. I can figure out the first part
>
> <?
> require 'Console/Getopt.php';
>
> $optclass =  new Console_Getopt;
> $args = $optclass->readPHPArgv();
> array_shift($args);
>
> $shortoptions = "a:bc";
> $longoptions = array("long", "alsolong=", "doublelong==");
>
> $options = $optclass->getopt( $args, $shortoptions, $longoptions);
> print_r($options);
> ?>
>
> But that returns an array with more then one dimension and i have no idea
> how to loop though to set variables like i did with getopt().

Ok, here $options consists of 2 arrays, the first ($options[0]) is an array 
containing all the valid options. To read them you can use:

  foreach ($options[0] as $opt) {
    echo "Option::{$opt[0]}   Value::{$opt[1]}\n";
  }

> My questions are what is the preferred way to get command line options,
> is there a way to give errors 

Yes, you manually check for them!

> and take long arguments with getopt(),

Doesn't look it.

The second array ($options[1]) just contains the rest of your command line.

Using Console_Getopt if an unknown option/switch is given a PEAR_Error is 
raised thus you have to check/trap for that.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
San Francisco isn't what it used to be, and it never was.
                -- Herb Caen
*/

--- End Message ---
--- Begin Message --- Sir
I am using PHP4.2.2 with gd 1.6.2 But my web host has PHP4.2.3
with gd2.0.0....So I needed to ask U as "How to upgrade PHP4.2.2
to PHP4.2.3"...Also same for gd1.6.2. to gd 2.0.0.....
Is there any step by step procedure for doing this if so Please
mail me I'll be thankfull to U
Waiting for response.
Manohar




________________________________________________________________
NIIT supports World Computer Literacy Day on 2nd December.
Enroll for NIIT SWIFT Jyoti till 2nd December for only Rs. 749
and get free Indian Languages Office software worth Rs. 2500.
For details contact your nearest NIIT centre, SWIFT Point
or click here http://swift.rediff.com/

--- End Message ---

Reply via email to