[PHP-WIN] Please Help with incorrect Date Code

2001-09-17 Thread max

I'm posting a snippet of code which prints each date within a week.  For
example on the day of 10/21/01 it will print the dates 10/21/01, 22, 23, 24,
25, 26, and 27.

The problem I am having is on the week of 10/28/01 it will print 10/28
twice.  for example 28,28,29,30,31,1,2,3.  As far as I can tell every other
date seems to work fine except for the week of the 28th, where I get the
28th twice.  I'm hoping someone will take a quick look at the code below and
maybe have an idea as to why this is occuring or see something I dont see.

I greatly appreciate any help or advince.

Thanks.



";

$next_stamp = $next_stamp + 86400; // stamp plus # of seconds in a day
$next_day = date("Y-m-d",$next_stamp);;
}
?>


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




RE: [PHP-WIN] Please Help with incorrect Date Code

2001-09-17 Thread max

Dean,

Thanks for the response Dean, I didn't even think about daylight savings
time!  Changed the hour on the initial timestamp as you suggested and all is
well again ;)

Thanks again,

Max

-Original Message-
From: Dean Bennett [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 17, 2001 11:24 AM
To: max
Subject: Re: [PHP-WIN] Please Help with incorrect Date Code


Someone else discovers daylight savings.  Once a year, one day has 25 hours,
so
24 hours after 10/28/01 00:00 is 10/28/01 23:00.  Use an hour other than
00:00
in your initial timestamp,  Or you could just keep incrementing $dy - mktime
knows that 10/32 is 11/1.

max wrote:
>
> I'm posting a snippet of code which prints each date within a week.  For
> example on the day of 10/21/01 it will print the dates 10/21/01, 22, 23,
24,
> 25, 26, and 27.
>
> The problem I am having is on the week of 10/28/01 it will print 10/28
> twice.  for example 28,28,29,30,31,1,2,3.  As far as I can tell every
other
> date seems to work fine except for the week of the 28th, where I get the
> 28th twice.  I'm hoping someone will take a quick look at the code below
and
> maybe have an idea as to why this is occuring or see something I dont see.
>
> I greatly appreciate any help or advince.
>
> Thanks.
>
>  $yr = "2001";
> $mnth = "10";
> $dy = "28";
>
> $sunday_stamp =
> mktime(0,0,0,$mnth,$dy-date("w",mktime(0,0,0,$mnth,$dy,$yr)),$yr);
> $last_sunday = date("Y-m-d", $sunday_stamp);
> $next_saturday =
>
date("Y-m-d",mktime(0,0,0,$mnth,$dy+6-date("w",mktime(0,0,0,$mnth,$dy,$yr)),
> $yr));
>
> $next_day = $last_sunday;
> $next_stamp = $sunday_stamp;
> while($next_day <= $next_saturday)
> {
> $newsplit = explode("-", $next_day);
> $date = date("m/d/y",
> mktime(0,0,0,$newsplit[1],$newsplit[2],$newsplit[0]));
> $dayoweek = date("l",
> mktime(0,0,0,$newsplit[1],$newsplit[2],$newsplit[0]));
>
> echo "$dayoweek $date";
>
> $next_stamp = $next_stamp + 86400; // stamp plus # of seconds in a
day
> $next_day = date("Y-m-d",$next_stamp);;
> }
> ?>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP-WIN] RE: PHP 4.2.1. on PWS...

2002-06-04 Thread Max Sullivan

Hi,

You need to set cgi.force_redirect = 0 in your php.ini file.

-Original Message-
From: Mircea Goia [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, June 04, 2002 7:37 AM
To: [EMAIL PROTECTED]
Subject: PHP 4.2.1. on PWS...


Hi,

I've installed PHP 4.2.1 (Windows installer) on Windows 98 which uses
Personal Web Server 4.

And when I'm trying to access a .php page I get this:
~~~
Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means that a page will only be served up if the REDIRECT_STATUS CGI
variable is set, e.g. via an Apache Action directive.

For more information as to why this behaviour exists, see the manual
page for CGI security.

For more information about changing this behaviour or re-enabling this
webserver, consult the installation file that came with this
distribution, or visit the manual page. 

   What this means? I visited those two links but I didn't understand
too much (my background is ASP/SQL server)

When I used PHP 4.1.1. (also Windows installer) on the same
configuration all worked well.

What should I do for PHP 4.2.1.to work?

Thanks,
Mircea

--
Mircea Goia
Web Developer and web design team coordinator http://www.deep.ro (DEEP
Foundation) http://www.jiuvalley.com (Jiu Valley regional web portal)

Mircea Goia
Dezvoltator web si coordonator echipa web design http://www.deep.ro
(Fundatia DEEP) http://www.valeajiului.ro (portalul regional al Vaii
Jiului)





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




RE: [PHP-WIN] Is there a limit... PLEASE HELP I'm Desperate

2002-07-24 Thread Max Sullivan

Have you tried changing the value of memory_limit in your php.ini file?
If you have this set to 4mb, that may be your problem.

Heres what it looks like in the php.ini file.
memory_limit = 8M  ; Maximum amount of memory a script may consume
(8MB)



-Original Message-
From: R.S. Herhuth [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 23, 2002 1:40 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Is there a limit... PLEASE HELP I'm Desperate



After checking the bios it seems to be truncating right around the 4092
character mark (including spaces).  I checked the database and it does
in fact contain the entire bio (well over the 4092 character mark)...and
as a side note ASP returns the entire bio.  It seems to be some type of
truncation that is happening in PHP.

Is there any way I can break the Bio up over several queries to ensure I
get the entire thing back?

I'm dying here, I'm set to go live and I just noticed this problem.

Please help.

Ron




> 
> Is there a limit to the amount of text a variable can hold?
> 
> I have a situation where I'm querying a SQL database for a Salesmans 
> Biography and then echoing the variable using the syntax "$row['bio]" 
> and for some reason the bios appear to be truncated on the larger 
> bios. I am not processing the bios in any way shape or form so they 
> should be complete.
> 
> If in fact there is a limit, how could I formulate a work around for 
> this problem?
> 
> Thanks,
> Ron
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP-WIN] Configuration Trouble

2002-10-19 Thread Max Graham
I took a look at Apache, IIS, PWS, etc., and figured they were more than what I 
needed; I only want a platform to test pages on before sending them to my website's 
server. So I went with AnalogX's SimpleServer. I know it has CGI capability, and 
specifically PHP capability; it has a companion utility called PHPConfig, which is a 
GUI interface for editing the PHP.ini file. I was wondering, if anyone out there also 
has AnalogX's SimpleServer, is there something I'm missing? My website's structure is 
pretty basic: the index.html file is the main page loaded, giving a list of options, 
and the links go from there to the PHP files. When I click on any of them, it brings 
up the file download requestor dialog. Any suggestions?

Thanks in advance ...



[PHP-WIN] text file parsing

2002-10-25 Thread Max Graham
There are a couple of ways to do this, depending on what you're looking to
accomplish. One involves treating the contents of the text file as literal
text, not as HTML. This comes directly from the manual, under the
get_html_translation_table() function. Here's a quick copy & paste:

$trans = get_html_translation_table(HTML_ENTITIES);
$str = "Hallo &  & Krämer";
$encoded = strtr($str, $trans);

The $encoded variable will now contain: "Hallo &  &
Krämer".

Another possibility is this: If you have your text files set up in a
specified format, you can make your code parse the tables and put them out
in a specific format. I use that option, simply because I find it easier to
use. A file structured like this:

--text file start--
-identity
Litany Against Fear|http://www.bbc.co.uk/dna/h2g2/A594489|Bene Gesserit
Litany Against Fear (From Frank Herbert's "Dune")|-
You In Lego|http://www.reasonablyclever.com/|Picture yourself made in
Lego!|-
You In South Park|http://southpark.gamesweb.com/flash/sp-studio.html|Picture
yourself in South Park|-
You As A Virtual Model|http://www.myvirtualmodel.com/|You as a virtual
model|-
*
-software
Mailwasher Email Filter|http://www.mailwasher.net/|Preview, delete, bounce
emails from your server before downloading them to your computer|-
EO Video|http://www.eo-video.com|All-in-one video player, converter|hot
*

..
..
..
..
and so on (no blank lines at the end of the file; one line per link
description)
--text file end--
is parsed by this routine of code:
--code start--
// initialize variables; not necessary but generally good coding practice
$linkcat = "";
$catcount = 0;
$ltf = 0;
$linkref = file("links.txt"); // load text file
$linkcount = count($linkref); // count links/lines
echo "  \n"; // start the table
for ($lrcount = 0; $lrcount < $linkcount; $lrcount++) { // go through all li
nks
  $lcomptobj = $linkref[$lrcount]; // set a comparison object
  if (substr_count($lcomptobj, "*") < 1) { // if the line isn't a "*" for a
category divider
if (substr($linkref[$lrcount],0,1) == '-') { // if it's prefaced by a -,
for a category name
  $linkcat = trim(substr($linkref[$lrcount],1));
   $outstr = "  ".$linkcat."\n"; // display a
table header with category name
} else {
   list($_hname, $_url, $_title, $_linkstat) = explode("|",
$linkref[$lrcount]); // separate the line at the | characters
  $outstr = "  ".$_hname."";
   $outstr .= "".$_title.(($_linkstat == "hot") ? " (hot link)" :
"")."\n"; // format the table line with descriptions and URL
titles
}
 if (($linktype == $linkcat)||($linktype == "all")) { echo $outstr; }//
display the line if the category matches or if all categories selected
  }
}
echo "  \n\n";
--code end--

I made this code for my site because I wanted to display by categories and
let me choose only one category if I wanted to, by calling a URL like
"links.php?linktype=identity". It's not the best method, and not the most
efficient, but it's just the one I wanted to use. Sorry if the text in this
message seemed tough to read :P


> Message-ID: <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> From: "Bryan Luisana" <[EMAIL PROTECTED]>
> Date: Thu, 24 Oct 2002 19:38:44 -0400
> Subject: text file parsing
>
> Hello,
>
> I have only been working with php for about 2 hours now so bare with me if
I
> type something stupid.
>
> I am trying to open up a remote text file, parse the file, and output the
> parsed text as html.  As of now I can open the file read characters into a
> buffer and then output them as html.  My problem is with parsing the
buffer
> to get to the text I want to output.
>
> Should I read the entire file into an array?  Then output the parts of the
> array I want to show?  If so please post some type of example code.
>
> Does php have functions to move through a file and choose which characters
> you want to put into an array or a buffer?
>
> Any help would be greatly appreciated.
>
> Thanks for your time


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




[PHP-WIN] fopen, fputs, fwrite, fclose, fdammit

2002-10-31 Thread Max Graham
I'm trying to put a comment page on my weblog. I have the link displayed in
the format of date first, then a link to bookmark the entry, and then a link
to post a comment. I want to write the comments to a text file. My comment
page accepts a default value of "target", which is set to the date to be
commented on. Then it opens (or creates) a text file in the format of the
variable set by $pctarget.

$pctarget = "/blogbits/".substr($target,0,6)."/_".$target."_bc.txt";
if ($newpost == "yes") {
  $addrecord =
$newpostname."\n".$newpostemail."\n".$newposturl."\n".date("l, F jS,
Y")."\n".$newpostcomments."\n";
  $fullcomments .= "-splitcomment-\n";
  $getcomments = fopen($pctarget, "a");
  fputs($getcomments, $addrecord);
  fclose($getcomments);
}

I've tried assigning fputs() and fclose() to variables (which I infer is the
right way to do things but the manual isn't clear on it, i.e.
$gc=fputs($getcomments, $addrecord); but that doesn't work either. When the
page loads I get a blank page and this for the source:






It's not even the header source I told it to put out. As I understand it,
this is the source put out by an error page, when the code won't run. I
haven't been able to figure out what simple thing I'm missing, and I know
it's simple because it invariably is. (Law of Murphy, don't ya know.)

Any suggestions? Would lack of file permissions cause this? Server is a
Linux box.

Thanks in advance


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




Re: [PHP-WIN] Redirect browser to another URL?

2002-11-27 Thread Max Graham
You know, this is exactly what happened to me. I was trying to design a
comments page for a weblog to open in a popup. The page had a submission
form that would submit back to itself. 'course, I was banging my head on the
wall trying to come up with a way to get the page to detect whether it had
received a form submission and write the comments to a comment file, and
then include the comment file with the form afterwards. I kept coming up
with the results of fopen(), fputs(), fflush(), and fclose() coming back as
false, which equals failed. I eventually did go to a separate page to do the
file writing, and that page finishes up with a 1-second delay using the
javascript setTimeout() for this command in a standalone function:

echo "location.replace('blogcomments.php?target=".$target."');\n";

Inelegant, but it works. I haven't had too much experience with the header
function, and knowing how long it took me to bang this one out, I might set
something on fire trying it :)

Anyone else had any fun with this issue?

Message-ID: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Reply-To: "Jack Kelly Dobson" <[EMAIL PROTECTED]>
From: "Jack Kelly Dobson" <[EMAIL PROTECTED]>
Date: Wed, 27 Nov 2002 10:19:30 -0600
Subject: Re: [PHP-WIN] Redirect browser to another URL?

Thanks for all the help guys.

My problem, as most of you figured, is that my script has a form in it that
re-runs itself when the form is submitted so there is only one script
including the form and all the validation for the form. If the validation is
successful it sends you to a different page depending on the information
posted in the form. There was therefore no way I could get the header() to
be at the top of the returned data.

I ended up using:

if ($condition) {
   print("window.location='" . $url .
"'");
}

A rather elegant solution I've decided.

Oh, and FYI to all you IIS users out there... (At least I'm assuming it's
IIS and not the Windows platform itself. I'd be interested to know what
Windows users running Apache are experiencing).

I didn't have this problem with my script until I migrated it to a
Linux/Apache platform.

I assume that means that when I was doing it the original way that I had
multiple sets of header information and no telling what else being sent back
to the browser and IIS wasn't producing any error. Anyone using IIS and the
header(location: '') function might want to make sure they aren't exposing
data they didn't mean to.

j-



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




Re: [PHP-WIN] Redirect browser to another URL?

2002-11-28 Thread Max Graham
Ahhh yes  I have seen this mentioned somewhere, and yet I can't remember
where right now. This is the output buffering that lets you even put header
content after page content and still have it appear before, isn't it?

If I remember correctly, this is controlled by setup on the server, right? A
setting in the php.ini file that controls this? If so ... I may have to
plead with my web host, I don't actually own and run the server my site is
hosted on ... but definitely something I'll do some more reading on

I am pretty much a newbie, having taught myself what I need to know, and
I've done some major experimenting ... I haven't even gotten into some of
the more complex functions of PHP. I used to have my site primarily coded in
Javascript/DHTML, and I basically adopted what I was trying to do with DHTML
into Javascript if that tells you the complexity I'm currently working on.
I've only started playing with file functions, to say nothing of databases.
...

- Original Message -
From: "Ignatius Reilly" <[EMAIL PROTECTED]>
To: "Stephen Edmonds" <[EMAIL PROTECTED]>; "PHP Helplist
Windows" <[EMAIL PROTECTED]>
Cc: "Max Graham" <[EMAIL PROTECTED]>
Sent: Thursday, November 28, 2002 6:32 AM
Subject: Re: [PHP-WIN] Redirect browser to another URL?


> I concur with Stephen. However, there is an EXTREMELY simple and
convenient
> way to control output - that has not been mentioned in this thread:
> start all your PHP scripts with :
> ob_start() ;
>
> then you can pepper your script with one < header:Location... > statement
> EVERYWHERE you want (in my case I redirect to custom error pages)
>
> when you are done (at the end of the display form that follows the
> validation script), output the buffered content:
> ob_end_flush() ;
>
> HTH
> Ignatius
> ________
> - Original Message -
> From: "Stephen Edmonds" <[EMAIL PROTECTED]>
> To: "PHP Helplist Windows" <[EMAIL PROTECTED]>
> Cc: "Max Graham" <[EMAIL PROTECTED]>
> Sent: Thursday, November 28, 2002 2:21 PM
> Subject: Re: [PHP-WIN] Redirect browser to another URL?
>
>
> > if ( $FormIsSent == "My-String ) {
> > process form
> > header( "Location: url" );
> > }
> > else {
> > display form
> > 
> > }
> >
> > I use this technique on my sites all the time. The only restriction is
you
> > can't have any output before the header. If there is an error in the
form,
> > store it in an error variable:
> >
> > $error[NameForError] = "Problem with form";
> >
> > then use a foreach to get the values back out
> >
> > if ( count( $error ) ) {
> > foreach ( $error as $key=>$value ) {
> > print "Error with $key - $value";
> > }
> > }
> > else {
> > header( "location: http://youurl.com/formsuccess.php"; );
> > exit;
> > }
> >
> > - Original Message -
> > From: "Max Graham" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, November 28, 2002 5:50 AM
> > Subject: Re: [PHP-WIN] Redirect browser to another URL?
> >
> >
> > > You know, this is exactly what happened to me. I was trying to design
a
> > > comments page for a weblog to open in a popup. The page had a
submission
> > > form that would submit back to itself. 'course, I was banging my head
on
> > the
> > > wall trying to come up with a way to get the page to detect whether it
> had
> > > received a form submission and write the comments to a comment file,
and
> > > then include the comment file with the form afterwards. I kept coming
up
> > > with the results of fopen(), fputs(), fflush(), and fclose() coming
back
> > as
> > > false, which equals failed. I eventually did go to a separate page to
do
> > the
> > > file writing, and that page finishes up with a 1-second delay using
the
> > > javascript setTimeout() for this command in a standalone function:
> > >
> > > echo "location.replace('blogcomments.php?target=".$target."');\n";
> > >
> > > Inelegant, but it works. I haven't had too much experience with the
> header
> > > function, and knowing how long it took me to bang this one out, I
might
> > set
> > > something on fire trying it :)
> > >
> > > Anyone else had any fun with this issue?
> > >
> > > Message-ID: <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED]
> > > Reply-To: "Jack K

Re: [PHP-WIN] Redirect browser to another URL?

2002-11-28 Thread Max Graham
I like this approach. I may try that out sometime, because in this case I
didn't really want any output before the header. All the scripting work was
to be done before any output hit the browser window anyways.

- Original Message -
From: "Stephen Edmonds" <[EMAIL PROTECTED]>
To: "PHP Helplist Windows" <[EMAIL PROTECTED]>
Cc: "Max Graham" <[EMAIL PROTECTED]>
Sent: Thursday, November 28, 2002 6:21 AM
Subject: Re: [PHP-WIN] Redirect browser to another URL?


> if ( $FormIsSent == "My-String ) {
> process form
> header( "Location: url" );
> }
> else {
> display form
> 
> }
>
> I use this technique on my sites all the time. The only restriction is you
> can't have any output before the header. If there is an error in the form,
> store it in an error variable:
>
> $error[NameForError] = "Problem with form";
>
> then use a foreach to get the values back out
>
> if ( count( $error ) ) {
> foreach ( $error as $key=>$value ) {
> print "Error with $key - $value";
> }
> }
> else {
> header( "location: http://youurl.com/formsuccess.php"; );
> exit;
> }
>
> - Original Message -
> From: "Max Graham" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, November 28, 2002 5:50 AM
> Subject: Re: [PHP-WIN] Redirect browser to another URL?
>
>
> > You know, this is exactly what happened to me. I was trying to design a
> > comments page for a weblog to open in a popup. The page had a submission
> > form that would submit back to itself. 'course, I was banging my head on
> the
> > wall trying to come up with a way to get the page to detect whether it
had
> > received a form submission and write the comments to a comment file, and
> > then include the comment file with the form afterwards. I kept coming up
> > with the results of fopen(), fputs(), fflush(), and fclose() coming back
> as
> > false, which equals failed. I eventually did go to a separate page to do
> the
> > file writing, and that page finishes up with a 1-second delay using the
> > javascript setTimeout() for this command in a standalone function:
> >
> > echo "location.replace('blogcomments.php?target=".$target."');\n";
> >
> > Inelegant, but it works. I haven't had too much experience with the
header
> > function, and knowing how long it took me to bang this one out, I might
> set
> > something on fire trying it :)
> >
> > Anyone else had any fun with this issue?
> >
> > Message-ID: <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Reply-To: "Jack Kelly Dobson" <[EMAIL PROTECTED]>
> > From: "Jack Kelly Dobson" <[EMAIL PROTECTED]>
> > Date: Wed, 27 Nov 2002 10:19:30 -0600
> > Subject: Re: [PHP-WIN] Redirect browser to another URL?
> >
> > Thanks for all the help guys.
> >
> > My problem, as most of you figured, is that my script has a form in it
> that
> > re-runs itself when the form is submitted so there is only one script
> > including the form and all the validation for the form. If the
validation
> is
> > successful it sends you to a different page depending on the information
> > posted in the form. There was therefore no way I could get the header()
to
> > be at the top of the returned data.
> >
> > I ended up using:
> >
> > if ($condition) {
> >print("window.location='" . $url .
> > "'");
> > }
> >
> > A rather elegant solution I've decided.
> >
> > Oh, and FYI to all you IIS users out there... (At least I'm assuming
it's
> > IIS and not the Windows platform itself. I'd be interested to know what
> > Windows users running Apache are experiencing).
> >
> > I didn't have this problem with my script until I migrated it to a
> > Linux/Apache platform.
> >
> > I assume that means that when I was doing it the original way that I had
> > multiple sets of header information and no telling what else being sent
> back
> > to the browser and IIS wasn't producing any error. Anyone using IIS and
> the
> > header(location: '') function might want to make sure they aren't
exposing
> > data they didn't mean to.
> >
> > j-
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
>


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




Re: [PHP-WIN] Redirect browser to another URL?

2002-11-28 Thread Max Graham
The original issue was, I tried to have the single page to display any
previous comments, and then a form to add comments. Then, once it was
submitted, it would submit itself. The page was supposed to detect whether
any new data had been submitted, by way of a hidden input in the form, and
if so, would first write to the output file and then display the output
file. It wasn't a text file in this case, it was actually an HTML snippet I
would get the script to grab with the include() function. What I had to do,
because I suspected there wasn't enough of a delay between
writing/flushing/closing the file and including it (maybe it thought the
include file was still locked from being written to), was split the file
into two separate files. The first comments page shows the past comments and
the submission form. The form submits to a separate file that writes to the
include file and then displays the only displayed code in the page. In the
header I have a refresh function, and in the body tag I have the onload
handler set to trigger the refresh function.

I just realized, though, the setTimeout may be redundant ... :P I'm still
managing to learn slowly ... like most things I do, it's all self-taught,
and you're right -- I haven't even touched SQL databases. My only
familiarity with databases was with FoxPro before it became "Visual FoxPro"
(ominous music here). And I haven't even toyed with turning off Javascript
... there are services I'll turn off, but javascript ... for all its
resemblance to C++ with bipolarism, I have been tempted to turn it off, but
it just somehow reminds me of that scene from the Indiana Jones movie where
he's trying to weigh how much sand in the bag will equal the weight of the
statue to avoid triggering the booby traps ...

- Original Message -
From: "Rich Gray" <[EMAIL PROTECTED]>
To: "Max Graham" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, November 28, 2002 3:05 AM
Subject: RE: [PHP-WIN] Redirect browser to another URL?


> Hi Max
>
> Well it seems you are messing around with text files rather than a
> database - this sounds like hard work :) I'm not sure I fully understand
> your issue but are you saying you could not make the code 'refresh' the
> comments data on the form page without a javascript redirect?
>
> What happens if you switch off javascript in your browser - does it fail?
>
> Rich
> -Original Message-
> From: Max Graham [mailto:[EMAIL PROTECTED]]
> Sent: 28 November 2002 05:51
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Redirect browser to another URL?
>
>
> You know, this is exactly what happened to me. I was trying to design a
> comments page for a weblog to open in a popup. The page had a submission
> form that would submit back to itself. 'course, I was banging my head on
the
> wall trying to come up with a way to get the page to detect whether it had
> received a form submission and write the comments to a comment file, and
> then include the comment file with the form afterwards. I kept coming up
> with the results of fopen(), fputs(), fflush(), and fclose() coming back
as
> false, which equals failed. I eventually did go to a separate page to do
the
> file writing, and that page finishes up with a 1-second delay using the
> javascript setTimeout() for this command in a standalone function:
>
> echo "location.replace('blogcomments.php?target=".$target."');\n";
>
> Inelegant, but it works. I haven't had too much experience with the header
> function, and knowing how long it took me to bang this one out, I might
set
> something on fire trying it :)
>
> Anyone else had any fun with this issue?
>
>
>
>


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




Re: [PHP-WIN] Redirect browser to another URL?

2002-11-29 Thread Max Graham
Ahhh ... I see your point

I could also do that by making a link refresh, or the meta refresh tag ...
that one I have

- Original Message -
From: "Rich Gray" <[EMAIL PROTECTED]>
To: "Max Graham" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, November 28, 2002 9:09 AM
Subject: RE: [PHP-WIN] Redirect browser to another URL?


> Hi Max
>
> My comment on switching off javascript was just to warn you that there are
> users/browsers out there who have it switched off all the time so your
> script won't work for these users... Doing it all in PHP i.e. server side
> will avoid that problem.
>
> From what you have described I would start looking at using a database to
> store the comments - it'll make your life much easier.
>
> Rich
> -Original Message-
> From: Max Graham [mailto:[EMAIL PROTECTED]]
> Sent: 28 November 2002 15:19
> To: Rich Gray; [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Redirect browser to another URL?
>
>
> The original issue was, I tried to have the single page to display any
> previous comments, and then a form to add comments. Then, once it was
> submitted, it would submit itself. The page was supposed to detect whether
> any new data had been submitted, by way of a hidden input in the form, and
> if so, would first write to the output file and then display the output
> file. It wasn't a text file in this case, it was actually an HTML snippet
I
> would get the script to grab with the include() function. What I had to
do,
> because I suspected there wasn't enough of a delay between
> writing/flushing/closing the file and including it (maybe it thought the
> include file was still locked from being written to), was split the file
> into two separate files. The first comments page shows the past comments
and
> the submission form. The form submits to a separate file that writes to
the
> include file and then displays the only displayed code in the page. In the
> header I have a refresh function, and in the body tag I have the onload
> handler set to trigger the refresh function.
>
> I just realized, though, the setTimeout may be redundant ... :P I'm still
> managing to learn slowly ... like most things I do, it's all self-taught,
> and you're right -- I haven't even touched SQL databases. My only
> familiarity with databases was with FoxPro before it became "Visual
FoxPro"
> (ominous music here). And I haven't even toyed with turning off Javascript
> ... there are services I'll turn off, but javascript ... for all its
> resemblance to C++ with bipolarism, I have been tempted to turn it off,
but
> it just somehow reminds me of that scene from the Indiana Jones movie
where
> he's trying to weigh how much sand in the bag will equal the weight of the
> statue to avoid triggering the booby traps ...
>
>
>


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




RE: [PHP-WIN] help:How can I upload the whole directory to the web

2001-05-06 Thread Max Graham

> Subject: [PHP-WIN] help:How can I upload the whole directory to the web

Internet Neighborhood, it treats folders on a remote FTP server like folders on your 
computer. Very slick ...

try it ... http://in.deerfield.com/





[PHP-WIN] PHP Hosting

2001-07-05 Thread Max Graham

Not quite free, but damn close ... anyone heard anything about this hosting service?

http://www.ucvhost.com/index.htm





[PHP-WIN] Re: Send mail

2003-03-02 Thread Max Graham
Orlando:

I used this in a script, I set up a message body like this

mail($mrecipient, $subject, $messagebody, $headers);

You may need to set the $headers variable ... or you can use this script that allows 
you to send a multipart MIME email

http://www.hotscripts.com/Detailed/18698.html



"Orlando castañeda" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> I am trying to send an e-mail like this:
> 
>   $to = "[EMAIL PROTECTED]";
>  $subject = "xsubject";
>  $message = "x data";
>   mail ($to, $subject, $message);
> ?>
> 
> There are no errors, but the e-mail is never sent !
> I apreciate any help !
> 
> 
> Tito
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> ICQ # 32019090


[PHP-WIN] GD under w2k

2003-03-23 Thread Franz Max
Hi all,

I would like to install GD for PHP under W2000. I have got the GD source and
the PHP source downloaded. How can I compile them? I dont have any C
compiler. In all of the manuals the compiling procedure written for Linux
instead of Windows.

Thanx in advance
Franz




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



[PHP-WIN] Subject: + character in a command line argument

2003-04-01 Thread Max Graham
Have you tried replacing the + with %2B?

Having never tried this before myself, this is sort of a shot in the dark
... but I figured it might give you an idea as to where to go from


> Message-ID: <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> From: "mmy" <[EMAIL PROTECTED]>
> Date: Sun, 30 Mar 2003 11:30:22 +0200
> Subject: + character in a command line argument
>
> Hi!
>
> I'm using PHP 4.3.1, IE 5.5, Win ME
>
> I'm trying to use php through DOS command line.
>
> Running the very basic script
>
> $argv = $_SERVER['argv'];
> var_dump($argv);
>
> I noticed that the command line arguments are split at a + character, even
> if between double quotes.
>
> for instance
>
> php test.php a+b
>
> or
>
> php test.php "a+b"
>
> both return 3 arguments, "test.php", "a" and "b".
>
> I don't know if it is a DOS or php problem (though if you name a file
> a+b.txt, the DOS command type a+b.txt runs correctly, which seems to
> exonerate DOS...).
>
> My questions are more practical : does anybody knows how to pass a + in an
> argument?? Are there other characters that are special in addition to "
and
> + ??
>
> Thanks in advance


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



[PHP-WIN] PHP and beers...

2003-04-05 Thread Max Graham
Try finding an empty beer bottle, and blowing across the top of it

While this may not have any effect on your CD, it has been known to have a
profound effect on beer openers. It's sort of like their mating call :P


> Message-ID:
> <[EMAIL PROTECTED]>
> From: "Asendorf, John" <[EMAIL PROTECTED]>
> To: "Svensson, B.A.T. (HKG)" <[EMAIL PROTECTED]>, Php Win32 list
>   <[EMAIL PROTECTED]>
> Date: Fri, 4 Apr 2003 09:00:06 -0500
> MIME-Version: 1.0
> Content-Type: text/plain;
>  charset="iso-8859-1"
> Subject: RE: [PHP-WIN] PHP and beers...
>
> How rude to us Americans.  We're just starting our workday and you taunt
> us with your proximity to beer drinking time!
>
> I fart in your general direction!
>
> -
> John Asendorf - [EMAIL PROTECTED]
> Web Applications Developer
>
>
>
> > -Original Message-
> > From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 04, 2003 9:02 AM
> > To: Php Win32 list
> > Subject: [PHP-WIN] PHP and beers...
> >
> >
> > I have this problem with a php CD: I can't find it! I need to find it
> > because I put my beer opener on top of it, so now I wonder if anybody
> > know how I can find it? We are namely going to start to drink
> > our Friday
> > beers with in 1 hour now, so I am really desperate to locate it.
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >


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



[PHP-WIN] Re: Deleting users from htpasswd

2003-06-06 Thread Max Graham
If you want a script that's premade that'll do it for you, I suggest
PHPAccess ...

http://www.krizleebear.de/phpaccess/dynamisch/

If nothing else, it'll give you some code to look at to see how it's done in
case you don't want to use this and would rather customize your own

Message-ID: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
From: "Cristian MARIN" <[EMAIL PROTECTED]>
Date: Fri, 6 Jun 2003 12:54:06 +0300
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="=_NextPart_000_005D_01C32C2A.B6E6E660"
Subject: Re: Deleting users from htpasswd

--=_NextPart_000_005D_01C32C2A.B6E6E660
Content-Type: text/plain;
 charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

$user =3D "bubu";
$file_ht =3D fopen("path_to_the_htaccess","r+");
if ($file_ht){
$content_file =3D fread($file_ht, filesize("path_to_the_htaccess"));
fclose($file_ht);
$content_file =3D preg_replace("/".$user.".*\n/","",$content_file);
$file_ht=3Dfopen("path_to_the_htaccess","w+");
if ($file_ht){
   fwrite($file_ht,$content_file);
   fclose($file_ht);
}else{
echo "Failed open for writing";
}
}else{
 echo "failed open for reading";
}

You have to replace the user with the $user ( I don't know how do you =
take the user) and the path_to_the_htaccess

Hope it helps.

--=20
-
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610=20
[EMAIL PROTECTED]

  "Guru P Chaturvedi" <[EMAIL PROTECTED]> wrote in message =
news:[EMAIL PROTECTED]
  Hi Cristian,

  Well that's right... i wanna do it thru PHP Scrip... but dunno what =
exactly
  i should use... any clues...?


  "Cristian Marin" <[EMAIL PROTECTED]> wrote in message
  news:[EMAIL PROTECTED]
  Remove the line of the user from the .htpasswd. You can do it manually =
or a
  php script can do it for you.



  --
  -
  Cristian MARIN
  InterAKT Online (www.interakt.ro)
  +4021 411 2610
  [EMAIL PROTECTED]

"Guru P Chaturvedi" <[EMAIL PROTECTED]> wrote in message
  news:[EMAIL PROTECTED]
Hi,
i am storing all users for accessing apache resources in a file =
called
my.users i am able to add/modify users and passwords using the =
htpasswd
utility. But not able to remove a particular user... are there =
anyways of
doing it? can u please help...

with Warm Regards,
Guru.
---
Phone: (+91)9845290270
URL: www.gangarasa.com
Yahoo IM: guru4vedi
MSN: [EMAIL PROTECTED]
---






--=_NextPart_000_005D_01C32C2A.B6E6E660--



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



[PHP-WIN] Re: Mail sent an hour before I send it

2003-06-18 Thread Max Graham
What timezone is the server in relative to you?

Perhaps it's just the mail form itself that misinterprets the time ... I
encountered a similar issue when my host outsourced the hosting from his own
server in the same timezone I'm in to a server 2 hours ahead of here ... I
had to change the scripts on my site to offset the time zone


> When I send email through php, the mail is stamped witha time that is an
> hour after I send it.  I have checked the time zone and daylight
> settings one ALL servers. =20
> =20
> I forwarded it to another account and this is the original message.
> This was actually sent at 7:53 am.  When I log onto the mail server
> directly and send mail the time is correct, so it appears to have
> something to do with PHP.  Does anyone have any thoughts on this?
> =20


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



[PHP-WIN] Re: Parse error what's this, what to do?

2003-06-20 Thread Max Graham
This might require two separate files. In the first, you'd have to set up a
form in the first file, advanced3.php:

---


  new
  old


---

and then in the second, the processform.php file, you'd have this line:

---
require $select3;
---

or however you'd want it. I'm guessing that this is what you're trying to
do, to use a form to tell a script what components are required ... am I
correct in guessing that?


- Original Message -
From: "Ildiko Nyari" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Max Graham" <[EMAIL PROTECTED]>
Sent: Friday, June 20, 2003 8:12 AM
Subject: Re: Parse error what's this, what to do?


> Hello, Thank you
> line129:   class="SELECTSize">
>
> But the whole stuff look-a-like this:
>
>  search by
> 
> new
> used
> ); ?>
>
> What I want is the option selected should be an input for the search,
that's
> what I try to figure out in Dreamweaver MX
>
>
> THANKS,
> ildiko
>
>
> - Original Message -
> From: "Max Graham" <[EMAIL PROTECTED]>
> To: "Ildiko Nyari" <[EMAIL PROTECTED]>
> Sent: Thursday, June 19, 2003 11:34 PM
> Subject: Re: Parse error what's this, what to do?
>
>
> > What does your code look like? Can you show us what line 129 looks like
in
> > advanced3.php?
> >
> >
> > - Original Message -
> > From: "Ildiko Nyari" <[EMAIL PROTECTED]>
> > Newsgroups: php.windows
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, June 19, 2003 6:43 PM
> > Subject: Parse error what's this, what to do?
> >
> >
> > Hello
> > Parse error: parse error, unexpected '<' in C:\Program Files\Apache
> > Group\Apache2\htdocs\advanced3.php on line 129
> >
> > what's this?
> > I always get this error when I want to display the php files on the web,
> so
> > can't.
> > What do I do wrong?
> >
> > thanks,
> > ildiko
> >
> >
>
>
>


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



[PHP-WIN] Calling Illustrator from PHP

2007-02-04 Thread Max Beutel
Hello there,

On a windows server, I want to call Adobe Illustrator, make it open a 
javascript file and execute it. All controlled via PHP. I use com to call 
illustrator, which already works nice, but I cant make it yet to open the 
script file. Does anyone know where to find information about this? The 
documentation I found was not very helpful. Mainly there was no 
documentation at all.

This is all I got so far :

$WshShell = new COM("WScript.Shell");
$illustrator = $WshShell->Run("Illustrator.exe", 3, true);


Thanks in advance! 

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



[PHP-WIN] Calling Illustrator from PHP

2007-02-04 Thread Max Beutel
Hi there,

what I want to do on my Windows server: open Illustrator, make it open a 
JavaScript file and execute it (manually you would go to File -> Scripts), 
all controlled via PHP.

Unfortunately I got no idea on how to do this. I only got some codesnippet, 
that opens Illustrator. Not that much, I´d say:

$WshShell = new COM("WScript.Shell");
$illustrator = $WshShell->Run("Illustrator.exe", 3, true);

I googled quite a lot on this, but found actually nothing... I have no idea 
where to look at to find something on Illustrators Object hierarchy.

Has anyone done something before like this with Illustrator? Any 
documentation you could point me to?

Help would be greatly appreciated!

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