php-general Digest 17 Feb 2004 11:39:20 -0000 Issue 2595
Topics (messages 177886 through 177923):
Ora_Parse failed
177886 by: Matt Hillebrand
177888 by: Matt Hillebrand
Re: How many days between two dates
177887 by: Marek Kilimajer
Steps to installin PHP on apache 2
177889 by: Philip J. Newman
177890 by: Stuart
177891 by: Richard Davey
pdflib alternatives
177892 by: Fernando M. Maresca
177894 by: James Kaufman
Re: Opening a popup window?
177893 by: memoimyself.yahoo.com.br
Headers Again
177895 by: PETCOL
177896 by: John Nichel
177903 by: Jason Wong
177907 by: PETCOL
177911 by: Jason Wong
177913 by: PETCOL
177918 by: Michael Egan
177921 by: Stuart
177923 by: Richard Davey
Problems with authentication (I think)
177897 by: Leif Gregory
177898 by: Leif Gregory
PowerPoint to html converter, server-side
177899 by: Andrew Warner
Re: Are variables persistent?
177900 by: André Cerqueira
Algorithm....
177901 by: Bob Eldred
177902 by: Martin Towell
177904 by: Manuel Vázquez Acosta
177905 by: Bob Eldred
Socket warning
177906 by: Tan Ai Leen
Messenger via PHP
177908 by: "Miguel J. Jiménez"
177910 by: Manuel Lemos
Re: zip problem
177909 by: Jason Wong
problem with resultset
177912 by: Angelo Zanetti
Global vars or Environment var on Class
177914 by: Turbo
177915 by: Vivian Steller
A date n the future
177916 by: Shaun
177922 by: Stuart
UK Postcodes Format
177917 by: Shaun
177919 by: Roddie Grant
177920 by: Michael Nolan
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 ---
I have an Oracle 8 problem. Unfortunately, I can't use the OCI functions and must use
the ORA functions. The code below looks fine to me. It will return *almost* all of the
rows, but then the script just dies with no warnings or errors, even though I have
called error_reporting(E_ALL). I do get the following error message in an Apache error
log:
Ora_Parse failed (ORA-00936: missing expression -- while processing OCI function
OPARSE).
Here's my code:
<?
$query = "select $columns from $table where $where_clauses";
ora_parse($cursor, $query) or die("<br>ora_parse() failed: ".ora_error());
ora_exec($cursor) or die("<br>ora_exec() failed: ".ora_error());
print '<br><br><a name=results><table border=1>';
$rowcount = 0;
while(ora_fetch($cursor)) {
print '<tr>';
for($i=0; $i<sizeof($columns); $i++) {
$cell_data = ora_getcolumn($cursor, $i);
if($cell_data === false)
die("ora_getcolumn() failed: ".ora_error());
print "<td>$cell_data</td>";
}
print "</tr>\n";
}
print '</table>';
?>
Thanks for any advice.
Matt
--- End Message ---
--- Begin Message ---
I modified that code to make it more readable. You may be wondering why the $columns
variable looks like a string and then later like an array. Don't worry....there's no
bug there. The $query variable actually equals "select ${columns_imploded} from
${state}_spell where ${where_clauses}";
Matt
Matt Hillebrand <[EMAIL PROTECTED]> wrote:
I have an Oracle 8 problem. Unfortunately, I can't use the OCI functions and must use
the ORA functions. The code below looks fine to me. It will return *almost* all of the
rows, but then the script just dies with no warnings or errors, even though I have
called error_reporting(E_ALL). I do get the following error message in an Apache error
log:
Ora_Parse failed (ORA-00936: missing expression -- while processing OCI function
OPARSE).
Here's my code:
<?
$query = "select $columns from $table where $where_clauses";
ora_parse($cursor, $query) or die("<br>ora_parse() failed: ".ora_error());
ora_exec($cursor) or die("<br>ora_exec() failed: ".ora_error());
print '<br><br><a name=results><table border=1>';
$rowcount = 0;
while(ora_fetch($cursor)) {
print '<tr>';
for($i=0; $i<sizeof($columns); $i++) {
$cell_data = ora_getcolumn($cursor, $i);
if($cell_data === false)
die("ora_getcolumn() failed: ".ora_error());
print "<td>$cell_data</td>";
}
print "</tr>\n";
}
print '</table>';
?>
Thanks for any advice.
Matt
--- End Message ---
--- Begin Message ---
Shaun wrote:
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Shaun wrote:
Hi,
how can I check how many days are between two given dates?
Thanks for your help
There are many ways, it would help if you tell us what form are the
dates in - timestamp, formated string, sql date column ...
Sorry,
The dates are retrieved from the database so are stored as YYYY-MM-DD
HH-MM-SS in MySQL
Thanks for your help
Let mysql do it:
SELECT TO_DAYS(date1) - TO_DAYS(date2) AS number_of_days ...
--- End Message ---
--- Begin Message ---
Can someone send me a link to where i can find easy to read docs on
getting php set up on Apache ...
--- End Message ---
--- Begin Message ---
Philip J. Newman wrote:
Can someone send me a link to where i can find easy to read docs on
getting php set up on Apache ...
You're kidding right?!?!?!?
http://php.net/install.apache2
Introducing the PHP Documentation - all you ever wanted to know about
PHP in one convenient location in several formats and many many
languages: http://php.net/docs
--
Stuart
--- End Message ---
--- Begin Message ---
Hello Stuart,
Tuesday, February 17, 2004, 12:10:49 AM, you wrote:
S> all you ever wanted to know about PHP in one convenient location in
S> several formats and many many languages...
... except "lazy arse-eese" :)
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html
--- End Message ---
--- Begin Message ---
Hello everybody:
Is there are any alternatives to the pdflib for on the fly generation of
printable documents? May be a postcript lib?
I need no fancy things, just speed and minimal formating facilities,
even no graphics support is ok.
Any sugestions?
Thanks in advance to all of you
--
Fernando M. Maresca
Cel: (54) 221 15 502 3938
Cel: 0221-15-502-3938
--- End Message ---
--- Begin Message ---
On Mon, Feb 16, 2004 at 09:35:10PM -0300, Fernando M. Maresca wrote:
> Hello everybody:
> Is there are any alternatives to the pdflib for on the fly generation of
> printable documents? May be a postcript lib?
> I need no fancy things, just speed and minimal formating facilities,
> even no graphics support is ok.
> Any sugestions?
> Thanks in advance to all of you
> --
>
> Fernando M. Maresca
>
http://www.fpdf.org/?lang=en
--
Jim Kaufman
Linux Evangelist
public key 0x6D802619
http://www.linuxforbusiness.net
--- End Message ---
--- Begin Message ---
Hello Shaun,
On 16 Feb 2004 at 22:23, Shaun wrote:
> I have a form on a page. If certain options are selected on that page
> I need a popup window with a select option on there to appear. How can
> I make this happen with PHP, or do I need to use some JavaScript?
PHP is a server side scripting language, which means it is parsed by software on the
server before anything is sent to the client. That's why you don't see any PHP code if
you look at the source of a web page on a client machine.
The opening and closing of windows, on the other hand, is something that happens on
the client side and depend on the client's browser, among other things. PHP has
*nothing* to do with the client's browser other than the fact that it receives some
identification information from the browser. In order to pop open windows or do
anything
else on the client's computer, you'll need a client-side scripting language, i.e. one
that is
processed on the client's computer. One such language is JavaScript, which will take
care of all your window-opening needs.
Hope this helps,
Erik
--- End Message ---
--- Begin Message ---
Hi,
I have authenticated a user, after that I want to take them to another page:
Header("Location: welcome.php");
But I get the following error?
------------error------------
Cannot modify header information - headers already sent
------------error------------
Suggestions?
Col
--- End Message ---
--- Begin Message ---
PETCOL wrote:
Hi,
I have authenticated a user, after that I want to take them to another page:
Header("Location: welcome.php");
But I get the following error?
------------error------------
Cannot modify header information - headers already sent
------------error------------
Suggestions?
Don't send output to the browser before you try to send headers().
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
On Tuesday 17 February 2004 09:57, PETCOL wrote:
> I have authenticated a user, after that I want to take them to another
> page:
>
> Header("Location: welcome.php");
>
> But I get the following error?
>
> ------------error------------
> Cannot modify header information - headers already sent
> ------------error------------
>
> Suggestions?
google?
--
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 want to achieve immortality through my work. I want to achieve
immortality through not dying.
-- Woody Allen
*/
--- End Message ---
--- Begin Message ---
Jason,
What I shock, 307,000 entries returned.
Maybe someone with ability greater or other than I, should give some serious
consideration to a solution or work around.
I've been using ColdFuion for 7 years and I can do a <cflocation
url="anotherlocation.htm"> anywhere in the page, no matter if I've run CFML,
Javascript it still works.
Sorry I'm just frustrated.
Regards
Col
"Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> On Tuesday 17 February 2004 09:57, PETCOL wrote:
>
> > I have authenticated a user, after that I want to take them to another
> > page:
> >
> > Header("Location: welcome.php");
> >
> > But I get the following error?
> >
> > ------------error------------
> > Cannot modify header information - headers already sent
> > ------------error------------
> >
> > Suggestions?
>
> google?
>
> --
> 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 want to achieve immortality through my work. I want to achieve
> immortality through not dying.
> -- Woody Allen
> */
--- End Message ---
--- Begin Message ---
On Tuesday 17 February 2004 16:37, PETCOL wrote:
What you're asking is a VERY FAQ. Something that's asked almost every other
day. The list archives will have plenty of answers.
> What I shock, 307,000 entries returned.
If you don't want to trawl through those search results then read the error
message again (carefully, all of it). If you still haven't figured it then
read the manual entry for header(), every single line, then correlate what is
said with the error message.
> Maybe someone with ability greater or other than I, should give some
> serious consideration to a solution or work around.
All the info you need is in the archives.
> I've been using ColdFuion for 7 years and I can do a <cflocation
> url="anotherlocation.htm"> anywhere in the page, no matter if I've run
> CFML, Javascript it still works.
You can do that as well, again, all the info you need is in the archives.
> Sorry I'm just frustrated.
I'm sure regulars on the list are just as frustrated at how often this
question crops up and at how little research people do before asking another
FAQ.
--
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
------------------------------------------
/*
Losing your drivers' license is just God's way of saying "BOOGA, BOOGA!"
*/
--- End Message ---
--- Begin Message ---
Jason,
I appreciate people get just as frustrate by reading repetative posts.
Alliare and Macromedias forums for ColdFusion and other software, allow a
search through the entire post, archive everything. Which always avoid this
problem of a newsgroup. Maybe I'm wrong, but I don't thing there's a search
like this for a newsgroup?
If you do happen to know, as it would appear you may, the url of the answer
to the original question, then could you simply supply it.
I'm new to this code, I appreciate any assistance, and I will troll through
archives etc to get it. However, if some kind sole can save me 3 hours
work, I'll also appreciate it, which is probably why this list get
repetative posts.
Cheers, relax, and have a nice day.
Col
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tuesday 17 February 2004 16:37, PETCOL wrote:
>
> What you're asking is a VERY FAQ. Something that's asked almost every
other
> day. The list archives will have plenty of answers.
>
> > What I shock, 307,000 entries returned.
>
> If you don't want to trawl through those search results then read the
error
> message again (carefully, all of it). If you still haven't figured it then
> read the manual entry for header(), every single line, then correlate what
is
> said with the error message.
>
> > Maybe someone with ability greater or other than I, should give some
> > serious consideration to a solution or work around.
>
> All the info you need is in the archives.
>
> > I've been using ColdFuion for 7 years and I can do a <cflocation
> > url="anotherlocation.htm"> anywhere in the page, no matter if I've run
> > CFML, Javascript it still works.
>
> You can do that as well, again, all the info you need is in the archives.
>
> > Sorry I'm just frustrated.
>
> I'm sure regulars on the list are just as frustrated at how often this
> question crops up and at how little research people do before asking
another
> FAQ.
>
> --
> 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
> ------------------------------------------
> /*
> Losing your drivers' license is just God's way of saying "BOOGA, BOOGA!"
> */
--- End Message ---
--- Begin Message ---
Got to agree with Jason's comments - as I'm sure all other regulars on the list will
do.
I've just had a quick look at the php.net site, done a search for "header" and halfway
down the first page returned found this:
"Remember that header() must be called before any actual output is sent, either by
normal HTML tags, blank lines in a file, or from PHP. It is a very common error to
read code with include(), or require(), functions, or another file access function,
and have spaces or empty lines that are output before header() is called. The same
problem exists when using a single PHP/HTML file."
Not hard is it?
Regards,
Michael Egan
> -----Original Message-----
> From: PETCOL [mailto:[EMAIL PROTECTED]
> Sent: 17 February 2004 09:22
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Headers Again
>
>
> Jason,
>
> I appreciate people get just as frustrate by reading repetative posts.
>
> Alliare and Macromedias forums for ColdFusion and other
> software, allow a
> search through the entire post, archive everything. Which
> always avoid this
> problem of a newsgroup. Maybe I'm wrong, but I don't thing
> there's a search
> like this for a newsgroup?
>
> If you do happen to know, as it would appear you may, the url
> of the answer
> to the original question, then could you simply supply it.
>
> I'm new to this code, I appreciate any assistance, and I will
> troll through
> archives etc to get it. However, if some kind sole can save
> me 3 hours
> work, I'll also appreciate it, which is probably why this list get
> repetative posts.
>
> Cheers, relax, and have a nice day.
>
> Col
>
> "Jason Wong" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > On Tuesday 17 February 2004 16:37, PETCOL wrote:
> >
> > What you're asking is a VERY FAQ. Something that's asked
> almost every
> other
> > day. The list archives will have plenty of answers.
> >
> > > What I shock, 307,000 entries returned.
> >
> > If you don't want to trawl through those search results
> then read the
> error
> > message again (carefully, all of it). If you still haven't
> figured it then
> > read the manual entry for header(), every single line, then
> correlate what
> is
> > said with the error message.
> >
> > > Maybe someone with ability greater or other than I,
> should give some
> > > serious consideration to a solution or work around.
> >
> > All the info you need is in the archives.
> >
> > > I've been using ColdFuion for 7 years and I can do a <cflocation
> > > url="anotherlocation.htm"> anywhere in the page, no
> matter if I've run
> > > CFML, Javascript it still works.
> >
> > You can do that as well, again, all the info you need is in
> the archives.
> >
> > > Sorry I'm just frustrated.
> >
> > I'm sure regulars on the list are just as frustrated at how
> often this
> > question crops up and at how little research people do before asking
> another
> > FAQ.
> >
> > --
> > 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
> > ------------------------------------------
> > /*
> > Losing your drivers' license is just God's way of saying
> "BOOGA, BOOGA!"
> > */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
PETCOL wrote:
Alliare and Macromedias forums for ColdFusion and other software, allow a
search through the entire post, archive everything. Which always avoid this
problem of a newsgroup. Maybe I'm wrong, but I don't thing there's a search
like this for a newsgroup?
http://marc.theaimsgroup.com/?l=php-general
--
Stuart
--- End Message ---
--- Begin Message ---
Hello PETCOL,
Tuesday, February 17, 2004, 8:37:15 AM, you wrote:
>> google?
P> What I shock, 307,000 entries returned.
Assuming you're running Windows, do what I do and download the Windows
CHM help file version of the PHP manual. It includes standard
search capabilities, so clicking on Search and entering "header" will
bring you back exactly what you need to know.
In this case it's the top 2 results.
Takes like 3 minutes at the most.
Then if the manual description doesn't help enough you can check out
the on-line annotated manual and post messages to this list without
receiving sarcastic replies back again.
P> I've been using ColdFuion for 7 years and I can do a
P> <cflocation url="anotherlocation.htm"> anywhere in the page, no
P> matter if I've run CFML, Javascript it still works.
Yes, ASP does similar with Response.Redirect - but you're in PHP land
now so why not get yourself a copy of the PHP bible? It'll save you SO
much hassle.
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html
--- End Message ---
--- Begin Message ---
Hello all,
What I have:
Windows webserver running PHP 4.34 and MySQL 4.0.17.
The knowns:
Doing the PHP test works and I get back all sorts of information,
and PHPBB2 works as advertised with no problems, so does PHPMyAdmin.
My Problem:
I've tried a number of PHP scripts to do various things (some just to
play around and learn, and some because I really want them on my web
server.) The three problems I usually encounter with the problematic
PHP scripts are:
1. When I hit the page, it just returns a blank page. This happens
with:
PHPTest http://www.resynthesize.com/code/phptest_info.php
Proxy http://sourceforge.net/projects/sbp/
2. When I hit the page, it needs some authentication for login, and
even though it appears to take the login, nothing really happens
(i.e. it didn't log me in, so I can't go anywhere. This happens
with:
Scubaman Dive Log http://www.ivains.com/scubaman
Directory Indexer http://autoindex.sourceforge.net (only when I
enable the authentication for user logon,
otherwise it works fine)
3. Parts of the PHP script work, but others don't. This happens with:
GoRedirector http://www.studentplatinum.com/scripts/ (It will
return the values from MySQL that are in there, but I can't delete,
add, or administer it in any way, nor does the actual PHP
redirector itself work.)
I don't know enough about PHP yet to really know where to start
looking. Any help would be greatly appreciated. I thought it had
something to do with Global Variables being disabled in the php.ini
file, but I re-enabled that to test it, but it didn't help.
Cheers,
Leif Gregory
--
TB Lists Moderator (and fellow registered end-user)
PCWize Editor / ICQ 216395 / PGP Key ID 0x7CD4926F
Web Site <http://www.PCWize.com>
--- End Message ---
--- Begin Message ---
Hello Leif,
Monday, February 16, 2004, 7:13:30 PM, you wrote:
LG> PHPTest http://www.resynthesize.com/code/phptest_info.php
Just a followup. I found out that the PHPTest showing just a blank
page was a mistype in my config.inc.php file. It now shows me the
login screen, but when I login it does not do it. If I create a new
user via the PHPTest interface, it does indeed create the new user,
but I can't login with that one either.
I know I'm asking about a specific app here, but the problem spans a
few apps, and the problem is the same with all of them (namely,
authentication won't work).
Thanks again.
Cheers,
Leif Gregory
--
TB Lists Moderator (and fellow registered end-user)
PCWize Editor / ICQ 216395 / PGP Key ID 0x7CD4926F
Web Site <http://www.PCWize.com>
--- End Message ---
--- Begin Message ---
I'm looking for a PowerPoint to html/slides converter that can work
server-side and on Linux. Does such a thing exist? Most of the
converters I've come across are desktop apps.
Andrew
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Paul Furman wrote:
When I refresh a script using a form, it goes through & resets all my
custom Constants but presumably all my variables should still hold their
values from the last run, right? THere are no functions involved.
wrong
What would cause a variable or even a $POST[] value to be erased?
the script exiting
thats what happens when it finishes running
if you want persistency, try session
http://www.php.net/session
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAMZADaxdA/5C8vH8RAjaUAJwP/auFvfSc4QPfcSQkRAJJpqPaRgCfVtEz
KFZglAix8zxhnOwu0H1xdnE=
=DoaG
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
I'm working on a calendaring script right now, and am stuck on a
programmatic way to figure something out.
Basically, the work day is broken down into 15-minute intervals, where the
value of a given interval can be figured as $hour=floor($i/4) and the
minutes can be figured as $minutes=($i%4)*15. So 32 = 8:00, 33=8:15, etc.
Currently, it's relatively easy to pull up a day, and block out those times
that are already taken up with appointments. I'm throwing them all into an
array ($available_times). So, that array would look like:
32=>yes
33=>yes
34=>yes
35=>yes
36=>no
37=>no
38=>yes
39=>yes
etc, for someone who has a meeting from 9:00 to 9:30.
Now, what I'm trying to do is check when they schedule a new meeting so that
they don't overlap their times with something that's already taken up. So,
in the array given above, if they select 8:30 as the start time, I'd like
them to be able to select 8:45 or 9:00 as the end time, but nothing later
than that, as the time from 9:00 to 9:30 is already taken up.
And I'm stuck trying to figure out an approach to this. Preferably one that
I can throw into javascript so they can fix their errors before it ever hits
the server.
Any help appreciated.
Bob
--- End Message ---
--- Begin Message ---
Hiya,
Work out the start array position, keep incrementing by 1 until you find a
"yes"
>From this you'll know the allowable end times.
HTH
Martin
> -----Original Message-----
> From: Bob Eldred [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 17 February 2004 4:04 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Algorithm....
>
>
> I'm working on a calendaring script right now, and am stuck on a
> programmatic way to figure something out.
>
> Basically, the work day is broken down into 15-minute
> intervals, where the
> value of a given interval can be figured as $hour=floor($i/4) and the
> minutes can be figured as $minutes=($i%4)*15. So 32 = 8:00,
> 33=8:15, etc.
>
> Currently, it's relatively easy to pull up a day, and block
> out those times
> that are already taken up with appointments. I'm throwing
> them all into an
> array ($available_times). So, that array would look like:
>
> 32=>yes
> 33=>yes
> 34=>yes
> 35=>yes
> 36=>no
> 37=>no
> 38=>yes
> 39=>yes
>
> etc, for someone who has a meeting from 9:00 to 9:30.
>
> Now, what I'm trying to do is check when they schedule a new
> meeting so that
> they don't overlap their times with something that's already
> taken up. So,
> in the array given above, if they select 8:30 as the start
> time, I'd like
> them to be able to select 8:45 or 9:00 as the end time, but
> nothing later
> than that, as the time from 9:00 to 9:30 is already taken up.
>
> And I'm stuck trying to figure out an approach to this.
> Preferably one that
> I can throw into javascript so they can fix their errors
> before it ever hits
> the server.
>
> Any help appreciated.
>
> Bob
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> __________ Information from NOD32 1.617 (20040206) __________
>
> This message was checked by NOD32 for Exchange e-mail monitor.
> http://www.nod32.com
>
>
>
>
--- End Message ---
--- Begin Message ---
I suggest a bit's mask technique; since max(i)=96, you can represent a day
by 96/8 = 12 bytes = 3 (32-bits integers).
TimeFrameA is an integer representing the first 32 15-minutes chunks(0-31),
TimeFrameB represents 32-63, and TimeFrameC 64-95.
If a bit is 1 the you that 15-minutes chunk is marked as "busy", 0
otherwise. It is easy to find which is the first 'busy'bit in each
TimeFrame:
// at least one bit is marked as busy
if (TimeFrame <> 0)
{
mask = 0x80000000;
while (mask & TimeFrame == 0)
mask = mask >> 1;
}
Hope this helps (I think it saves both memory and time)
Manu.
"Bob Eldred" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm working on a calendaring script right now, and am stuck on a
> programmatic way to figure something out.
>
> Basically, the work day is broken down into 15-minute intervals, where the
> value of a given interval can be figured as $hour=floor($i/4) and the
> minutes can be figured as $minutes=($i%4)*15. So 32 = 8:00, 33=8:15, etc.
>
> Currently, it's relatively easy to pull up a day, and block out those
times
> that are already taken up with appointments. I'm throwing them all into
an
> array ($available_times). So, that array would look like:
>
> 32=>yes
> 33=>yes
> 34=>yes
> 35=>yes
> 36=>no
> 37=>no
> 38=>yes
> 39=>yes
>
> etc, for someone who has a meeting from 9:00 to 9:30.
>
> Now, what I'm trying to do is check when they schedule a new meeting so
that
> they don't overlap their times with something that's already taken up.
So,
> in the array given above, if they select 8:30 as the start time, I'd like
> them to be able to select 8:45 or 9:00 as the end time, but nothing later
> than that, as the time from 9:00 to 9:30 is already taken up.
>
> And I'm stuck trying to figure out an approach to this. Preferably one
that
> I can throw into javascript so they can fix their errors before it ever
hits
> the server.
>
> Any help appreciated.
>
> Bob
--- End Message ---
--- Begin Message ---
Clearly, I'm going to have to get on the PHP short bus. I was never any
good at bitmasking.
In the meantime, I've got it working. Not elegant, mind you, but working
nonetheless. Thanks.
Bob
----- Original Message -----
From: "Manuel Vázquez Acosta" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 16, 2004 9:47 PM
Subject: [PHP] Re: Algorithm....
> I suggest a bit's mask technique; since max(i)=96, you can represent a day
> by 96/8 = 12 bytes = 3 (32-bits integers).
>
> TimeFrameA is an integer representing the first 32 15-minutes
chunks(0-31),
> TimeFrameB represents 32-63, and TimeFrameC 64-95.
>
> If a bit is 1 the you that 15-minutes chunk is marked as "busy", 0
> otherwise. It is easy to find which is the first 'busy'bit in each
> TimeFrame:
> // at least one bit is marked as busy
> if (TimeFrame <> 0)
> {
> mask = 0x80000000;
> while (mask & TimeFrame == 0)
> mask = mask >> 1;
> }
>
> Hope this helps (I think it saves both memory and time)
>
> Manu.
>
>
> "Bob Eldred" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I'm working on a calendaring script right now, and am stuck on a
> > programmatic way to figure something out.
> >
> > Basically, the work day is broken down into 15-minute intervals, where
the
> > value of a given interval can be figured as $hour=floor($i/4) and the
> > minutes can be figured as $minutes=($i%4)*15. So 32 = 8:00, 33=8:15,
etc.
> >
> > Currently, it's relatively easy to pull up a day, and block out those
> times
> > that are already taken up with appointments. I'm throwing them all into
> an
> > array ($available_times). So, that array would look like:
> >
> > 32=>yes
> > 33=>yes
> > 34=>yes
> > 35=>yes
> > 36=>no
> > 37=>no
> > 38=>yes
> > 39=>yes
> >
> > etc, for someone who has a meeting from 9:00 to 9:30.
> >
> > Now, what I'm trying to do is check when they schedule a new meeting so
> that
> > they don't overlap their times with something that's already taken up.
> So,
> > in the array given above, if they select 8:30 as the start time, I'd
like
> > them to be able to select 8:45 or 9:00 as the end time, but nothing
later
> > than that, as the time from 9:00 to 9:30 is already taken up.
> >
> > And I'm stuck trying to figure out an approach to this. Preferably one
> that
> > I can throw into javascript so they can fix their errors before it ever
> hits
> > the server.
> >
> > Any help appreciated.
> >
> > Bob
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hi all,
I programmed a server to bind to an external server(Let's call it
C-server). My server will have to listen on the connection to C-server
and send over data frequently. Each write of data to C-server from my
server will cause C-server to response a string.
So the codes will be something like this:
if($response)
{
socket_write($read_socket, "$response", strlen($response));
echo $response."\n";
}
...
some processing to construct string to be send over
...
foreach($message as $part)
{
socket_write($this->c_socket, $part);
echo $part."\n";
$out = socket_read($this->c_socket, 1024);
echo $out."\n";
error_log($part.":".$out."\n", 3, $this->logfile);
}
Everytime the execution reaches socket_write($this->c_socket, $part);
a php warning is issued
<br />
<b>Warning</b>: socket_read() unable to read from socket [11]: Resource
temporarily unavailable in
<b>/var/www/html/dreamscape_mg/connectors/celcom/mo.php</b> on line
<b>134</b><br />
Line 134 is the curl brace after the foreach. I am assuming that the
socket read would be $out = socket_read($this->c_socket, $part). Why do
I get the warning? c_socket is non blocking.
Thanks for your help
Ai Leen
--- End Message ---
--- Begin Message ---
Hi, I want to know if there's a way to send MSN messenger messages thru
PHP... If there is.... How can I do it? Thanks...
--- End Message ---
--- Begin Message ---
Hello,
On 02/17/2004 05:40 AM, "Miguel J. Jiménez" wrote:
Hi, I want to know if there's a way to send MSN messenger messages thru
PHP... If there is.... How can I do it? Thanks...
I am not sure about sending messages, but here you may find a couple of
classes that can communicate with MSN messenger servers.
http://www.phpclasses.org/browse/class/66.html
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--- End Message ---
--- Begin Message ---
On Tuesday 17 February 2004 03:28, marc serra wrote:
> I want to know if it's possible to extract a zip file in PHP.
>
> I've read php documentation on ZZIPlib but i don't find any solution to
> extract file.
>
> Can you please help me to solve it.
The example in the manual shows how to open a zip archive and read each file
into memory and display. It should be a straight forward matter to use the
functions in "Filesystem functions" to write the uncompressed files to disk.
--
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
------------------------------------------
/*
If it seems too good to be true, it probably is
-- Murphy's Love Laws n10
*/
--- End Message ---
--- Begin Message ---
HI all,
I am querying a db and getting the resultset, then to get out each
individual field of the resultset (which is a single unique line all the
time) as mysql_result($result2, 0, "p_company"). the problem is that if the
actual field has a space in it say "Sun microsystems", I only get "sun" and
it doesnt give me anything after the first space.
I have looked at the manual but as far as im concerned its really vague in
its description of alot of the mysql functions.
any idea what could be causing this??
thanx Angelo
--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--- End Message ---
--- Begin Message ---
Hi....
I cann't call Global vars or Environment var on Class.How to's i do to
call it?
I want to call variable same below.
var $location
="http://".$HTTP_SERVER_VARS['HTTP_HOST'].$_SERVER['REQUEST_URI']."?".$HTTP_SERVER_VARS['QUERY_STRING'];
Thank you.
Turbo.
--- End Message ---
--- Begin Message ---
Turbo wrote:
> Hi....
>
> I cann't call Global vars or Environment var on Class.How to's i do to
> call it?
> I want to call variable same below.
>
> var $location
> ="http://".$HTTP_SERVER_VARS['HTTP_HOST'].$_SERVER['REQUEST_URI']."?"
$HTTP_SERVER_VARS['QUERY_STRING'];
>
>
> Thank you.
> Turbo.
i would try the following:
- check if it works with $GLOBLAS['_SERVER']['REQUEST_URI']..., but I think
your implementation should work then, too.
- so: if you don't necessarily need this var to be a real class var (with
the only disadvantage not seeing it when asking for
get_class_vars("Class")) then let the var set by the constructor:
<?php
class Foo {
var $location = "";
function Foo() {
$this->location = $GLOBLAS['_SERVER']['REQUEST_URI'] . ...;
}
}
?>
hope i could help.
vivi
--- End Message ---
--- Begin Message ---
Hi,
How can i tell if one date occurs before another date in the format
yyyy-mm-dd?
--- End Message ---
--- Begin Message ---
Shaun wrote:
How can i tell if one date occurs before another date in the format
yyyy-mm-dd?
$date1 = '2004-01-01';
$date2 = '2004-02-01';
if (strtotime($date1) < strtotime($date2))
{
...
}
--
Stuart
--- End Message ---
--- Begin Message ---
Hi,
does anyone know the format of the postcodes in the UK so I can keep my
database accurate?
Thanks
--- End Message ---
--- Begin Message ---
on 17/2/04 10:25 am, Shaun at [EMAIL PROTECTED] wrote:
> Hi,
>
> does anyone know the format of the postcodes in the UK so I can keep my
> database accurate?
>
> Thanks
Try http://javascript.internet.com/forms/uk-postcode-validation.html
Roddie Grant
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Shaun wrote:
Hi,
does anyone know the format of the postcodes in the UK so I can keep my
database accurate?
Thanks
http://www.royalmail.com/portal/rm/content1?catId=400044&mediaId=9200078#3400055
--- End Message ---