php-general Digest 8 Sep 2009 07:27:04 -0000 Issue 6328
Topics (messages 297763 through 297785):
Re: Displaying image paths with spaces
297763 by: Skip Evans
297764 by: Ashley Sheridan
297768 by: HallMarc Websites
297770 by: Skip Evans
Re: Taking body of an email and storing it in MySQL database
297765 by: Dave M G
297773 by: Paul M Foster
297777 by: Dave M G
297784 by: Manuel Lemos
Overwrite value of true or false in PHP
297766 by: Bobby Pejman
297767 by: Ashley Sheridan
297769 by: Martin Scotta
297771 by: Martin Scotta
297772 by: Eddie Drapkin
297774 by: Bobby Pejman
how to check function's execution?
297775 by: A.a.k
297776 by: Bobby Pejman
new php script and sqlite
297778 by: Eric Boo
Calendar tutorial
297779 by: Haig Davis
297781 by: viraj
need php_mssql so I retreated to 5.2.10
297780 by: Fred Silsbee
297785 by: Tommy Pham
How to take output from an include, and embed it into a variable?
297782 by: Rob Gould
297783 by: Eddie Drapkin
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 ---
Ashley Sheridan wrote:
How are you outputting those URLs? PHP won't just automatically converty
'%20' to a '\ '.
What is the raw URL format you're getting from FCKEditor?
Thanks,
Ash
http://www.ashleysheridan.co.uk
The raw code in the FCKeditor looks like this:
src="/clients/client_118/images//Event%20images/Show%20ads/catspaw1compressed.jpg"
(withing an <img...> tag of course)
But when the page displays and the images do not appear,
viewing the image's properties shows this: (Notice the %5C).
That %5C is what I think is being converted to a slash. Why it
shows up is baffling me.
http://penguinsites.com/clients/client_118/images//Event%5C%20images/Show%5C%20ads/catspaw1compressed.jpg
I simply output the code from the FCKeditor with a plain echo
to the browser.
But then if I right-click the image to view it, that's when I
see this
The requested URL /clients/client_118/images//Event\
images/Show\ ads/catspaw1compressed.jpg was not found on this
server.
So it seems it's not preserving the %20 as coded spaces, and
also converting that %5C to a slash!
Whaaaa????
Thanks,
Skip
--
====================================
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut
--- End Message ---
--- Begin Message ---
On Mon, 2009-09-07 at 12:14 -0500, Skip Evans wrote:
> Ashley Sheridan wrote:
> >
> > How are you outputting those URLs? PHP won't just automatically converty
> > '%20' to a '\ '.
> >
> > What is the raw URL format you're getting from FCKEditor?
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
>
> The raw code in the FCKeditor looks like this:
>
> src="/clients/client_118/images//Event%20images/Show%20ads/catspaw1compressed.jpg"
>
> (withing an <img...> tag of course)
>
> But when the page displays and the images do not appear,
> viewing the image's properties shows this: (Notice the %5C).
> That %5C is what I think is being converted to a slash. Why it
> shows up is baffling me.
>
> http://penguinsites.com/clients/client_118/images//Event%5C%20images/Show%5C%20ads/catspaw1compressed.jpg
>
> I simply output the code from the FCKeditor with a plain echo
> to the browser.
>
> But then if I right-click the image to view it, that's when I
> see this
>
> The requested URL /clients/client_118/images//Event\
> images/Show\ ads/catspaw1compressed.jpg was not found on this
> server.
>
> So it seems it's not preserving the %20 as coded spaces, and
> also converting that %5C to a slash!
>
> Whaaaa????
>
> Thanks,
> Skip
>
> --
> ====================================
> Skip Evans
> Big Sky Penguin, LLC
> 503 S Baldwin St, #1
> Madison WI 53703
> 608.250.2720
> http://bigskypenguin.com
> ------------------------------------
> Those of you who believe in
> telekinesis, raise my hand.
> -- Kurt Vonnegut
>
I believe %5C is the http code for %.
Are you saying then that FCKEditor is sending the %20 encoded URL when
you submit the form? I've not had any problems using FCKEditor myself.
Have you tried using str_replace('%20', ' ', $url) on the URL when you
receive it from the form?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Ashley Sheridan [mailto:[email protected]]
> Sent: Monday, September 07, 2009 1:24 PM
> To: Skip Evans
> Cc: [email protected]
> Subject: Re: [PHP] Displaying image paths with spaces
>
> On Mon, 2009-09-07 at 12:14 -0500, Skip Evans wrote:
> > Ashley Sheridan wrote:
> > >
> > > How are you outputting those URLs? PHP won't just automatically
> converty
> > > '%20' to a '\ '.
> > >
> > > What is the raw URL format you're getting from FCKEditor?
> > >
> > > Thanks,
> > > Ash
> > > http://www.ashleysheridan.co.uk
> > >
> >
> > The raw code in the FCKeditor looks like this:
> >
> >
> src="/clients/client_118/images//Event%20images/Show%20ads/catspaw1comp
> ressed.jpg"
> >
> > (withing an <img...> tag of course)
> >
> > But when the page displays and the images do not appear,
> > viewing the image's properties shows this: (Notice the %5C).
> > That %5C is what I think is being converted to a slash. Why it
> > shows up is baffling me.
> >
> >
> http://penguinsites.com/clients/client_118/images//Event%5C%20images/Sh
> ow%5C%20ads/catspaw1compressed.jpg
> >
> > I simply output the code from the FCKeditor with a plain echo
> > to the browser.
> >
> > But then if I right-click the image to view it, that's when I
> > see this
> >
> > The requested URL /clients/client_118/images//Event\
> > images/Show\ ads/catspaw1compressed.jpg was not found on this
> > server.
> >
> > So it seems it's not preserving the %20 as coded spaces, and
> > also converting that %5C to a slash!
> >
> > Whaaaa????
> >
> > Thanks,
> > Skip
> >
> > --
> > ====================================
> > Skip Evans
> > Big Sky Penguin, LLC
> > 503 S Baldwin St, #1
> > Madison WI 53703
> > 608.250.2720
> > http://bigskypenguin.com
> > ------------------------------------
> > Those of you who believe in
> > telekinesis, raise my hand.
> > -- Kurt Vonnegut
> >
> I believe %5C is the http code for %.
>
> Are you saying then that FCKEditor is sending the %20 encoded URL when
> you submit the form? I've not had any problems using FCKEditor myself.
> Have you tried using str_replace('%20', ' ', $url) on the URL when you
> receive it from the form?
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
Actually, %5C is a \ character, % is %25
Why it is adding a character that is used in local address strings is
baffling and I think a clue as to what is going on. Is it possible it is
mashing a local file address into a web address?
BTW, IMHO using spaces in folder and/or file names is bad practice and
should be avoided.
Marc Hall
HallMarc Websites
610.446.3346
__________ Information from ESET Smart Security, version of virus signature
database 4403 (20090907) __________
The message was checked by ESET Smart Security.
http://www.eset.com
--- End Message ---
--- Begin Message ---
HallMarc Websites wrote:
Actually, %5C is a \ character, % is %25
Why it is adding a character that is used in local address strings is
baffling and I think a clue as to what is going on. Is it possible it is
mashing a local file address into a web address?
Aha! I think that might be it. In the database it is stored as
src="/clients/client_118/images//Event%20images/Show%20ads/catspaw1compressed.jpg"
But somehow it is converting this to a local file address
before it is displayed.
BTW, IMHO using spaces in folder and/or file names is bad practice and
should be avoided.
I totally agree and the code I write I always replace user's
spaces with '_' characters, but this is FCKeditor's directory
creation code.
Maybe I should look into modifying it to do the same. I
actually have already modified FCK to store images in client
specific directories and found the code to be pretty well
written so maybe I need to do the same and solve the problem
that way.
I'll check that out.
Thanks Ash and Marc for the input. I think we're on the right
path ;)
Skip
--
====================================
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut
--- End Message ---
--- Begin Message ---
Paul,
Is there a decent tutorial anywhere on the net for the pop3.class.inc
available on phpclasses.org?
http://www.phpclasses.org/browse/package/1120.html
Maybe I'm blind, but I just can't find anywhere a decent description or
tutorial of what calls you can make to its functions. The documentation
file has two sections in German and a terse section in English.
I'm trying to figure out how to get each message and get their subject
line, from address, and then based on those two pieces of information,
I'll take the whole body and store them in the right place in a MySQL
database.
Just for reference, this is what I've built so far (I renamed
pop3.class.inc to POP3.php):
include('POP3.php');
$pop3 = new POP3();
// Connect to mail server
$do = $pop3->connect ('xxx.xxxxxxxxx.com');
if ($do == false)
{
$message = $pop3->error;
}
$do = $pop3->login ('uuuuuuuuuuu', 'ppppppppppp');
if ($do == false)
{
$message = $pop3->error;
}
$status = $pop3->get_office_status();
if ($status == false)
{
die($pop3->error);
}
$count = $status['count_mails'];
for ($i = 1; $i <= $count; $i++)
{
// Here's where I hit a wall.
// 1. Get the from address
// 2. Get the subject line
// 3. Get the header+body as one text file
// 4. Store it in the database.
}
$pop3->close();
--- End Message ---
--- Begin Message ---
On Tue, Sep 08, 2009 at 03:27:05AM +0900, Dave M G wrote:
> Paul,
>
> Is there a decent tutorial anywhere on the net for the pop3.class.inc
> available on phpclasses.org?
>
> http://www.phpclasses.org/browse/package/1120.html
>
> Maybe I'm blind, but I just can't find anywhere a decent description or
> tutorial of what calls you can make to its functions. The documentation
> file has two sections in German and a terse section in English.
>
> I'm trying to figure out how to get each message and get their subject
> line, from address, and then based on those two pieces of information,
> I'll take the whole body and store them in the right place in a MySQL
> database.
>
> Just for reference, this is what I've built so far (I renamed
> pop3.class.inc to POP3.php):
>
> include('POP3.php');
> $pop3 = new POP3();
>
> // Connect to mail server
> $do = $pop3->connect ('xxx.xxxxxxxxx.com');
> if ($do == false)
> {
> $message = $pop3->error;
> }
>
> $do = $pop3->login ('uuuuuuuuuuu', 'ppppppppppp');
>
> if ($do == false)
> {
> $message = $pop3->error;
> }
>
> $status = $pop3->get_office_status();
>
> if ($status == false)
> {
> die($pop3->error);
> }
>
> $count = $status['count_mails'];
>
>
> for ($i = 1; $i <= $count; $i++)
> {
> // Here's where I hit a wall.
> // 1. Get the from address
> // 2. Get the subject line
> // 3. Get the header+body as one text file
> // 4. Store it in the database.
I'm not sure why you're attempting to do the above. According to the
documentation, you should simply be able to do:
for ($i = 1; $i <= $count; $i++) {
$msg = $pop3->get_mail($i);
// parse the message as you like
$pop3->save2file($msg, 'myfilename.txt');
// or
$pop3->save2mysql(a bunch of parameters);
}
The $msg is returned as an array of strings. You could use the PHP
implode() function to reconstruct the array as a single string. But the
POP3::save2file() function will do this and save it to a text file if
you like.
It appears the class doesn't provide any support for parsing the message
internally. So that part is up to you. However, you could set up a loop
like this:
for ($j = 0; $j < count($msg); $j++) {
if (strpos($msg[$i], 'Subject: ') == 0)
// got the subject line
if (strpos($msg[$i], 'From: ') == 0)
// got the From: address line
}
Parsing the subject line and From: address is up to you. But there are
plenty of PHP functions to search and parse strings.
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
Paul,
Thank you very much for responding.
> I'm not sure why you're attempting to do the above. According to the
> documentation, you should simply be able to do
> ...
> $pop3->save2mysql(a bunch of parameters);
I'm not sure the parameters on the save2mysql() function give me the
flexibility I need. I have to save to particular tables and change other
fields in the database, determined by user data in the database and the
from and subject field in the email.
The save2mysql class seems to assume a certain database structure.
Although, again, I could be wrong about that because documentation is
lacking.
> However, you could set up a loop
> like this:
>
> for ($j = 0; $j < count($msg); $j++) {
> if (strpos($msg[$i], 'Subject: ') == 0)
> // got the subject line
> if (strpos($msg[$i], 'From: ') == 0)
> // got the From: address line
> }
>
> Parsing the subject line and From: address is up to you. But there are
> plenty of PHP functions to search and parse strings.
Thanks very much for the code you provided. I think that should be
enough of a boost forward to get me to a new stage, and hopefully even
take me to the end of this current problem.
I'll see what I can do with it and then hopefully report back success.
--
Dave M G
--- End Message ---
--- Begin Message ---
Hello,
on 09/07/2009 07:47 AM Dave M G said the following:
> I am working on a project now where I need to check a POP3 mail account,
> download any mails there, and store the body and headers of each
> individual mail as plain text in a MySQL database.
>
> I have downloaded the POP3 class which seems to be the standard class
> everyone uses for POP3 mail checking:
> http://www.phpclasses.org/browse/package/2.html
>
> I think I understand how to create an instance of the class and use it
> to check the email. The part where you log into the account isn't that
> complicated.
>
> But after that it becomes a little strange. It seems that emails are not
> mere text files, but have to be assembled line by line?
>
> I thought each email, and their headers, would be something I could just
> access, download, and pass along to MySQL. But it seems more complicated
> than that.
>
> Has anyone done something like this before?
>
> If someone could let me know how it is that I can create a body of text
> for each email (including the headers) so that I can then store it in
> the database, that would be awesome.
If you look at that same package there is a script named
browse_mailbox.php that demonstrates how to use the POP3 class to pull
messages from the POP3 server and automatically decode them so you can
process the messages very easily according to your needs.
It returns arrays that list all message parts, including any
attachments. From then on, you need to decide which parts of the
messages are relevant to you to perform the necessary database INSERT
queries to store the message text, HTML, images, attachments, etc..
For this you also need the MIME parser class that is available in the
same site:
http://www.phpclasses.org/mimeparser
You may also want to read this blog post to learn how to use these
classes to process the messages conveniently:
http://www.phpclasses.org/blog/package/2/post/1-Process-incoming-email-messages-using-PHP.html
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
Hi,
I noticed that the following returns a 1.
echo (1<2) ? True : False
I was under the impression that true/false are of type boolean and not int.
But in php anything other than 0 translates to true, meaning a 1. What I am
trying to achieve is for a 1 to be a 1 and a true or false to be a true and
false respectively and I do not want to put quotes around the word true/false
either because then it is no longer a boolean but string.
Is it possible to overwrite php's true/false and declare them as boolean? You
often see in C++, some use Define().
Thanks.
--- End Message ---
--- Begin Message ---
On Mon, 2009-09-07 at 19:14 +0000, Bobby Pejman wrote:
> Hi,
>
> I noticed that the following returns a 1.
>
> echo (1<2) ? True : False
>
> I was under the impression that true/false are of type boolean and not int.
> But in php anything other than 0 translates to true, meaning a 1. What I am
> trying to achieve is for a 1 to be a 1 and a true or false to be a true and
> false respectively and I do not want to put quotes around the word true/false
> either because then it is no longer a boolean but string.
>
> Is it possible to overwrite php's true/false and declare them as boolean?
> You often see in C++, some use Define().
>
> Thanks.
>
The statement you gave does return a boolean value, but what you are
doing is printing the resulting value out. PHP converts the boolean to
the nearest printable value, which will be a 1 or 0. If you want it to
output the value 'True' or 'False' then you need to output a string
value.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Mon, Sep 7, 2009 at 4:14 PM, Bobby Pejman <[email protected]> wrote:
> Hi,
>
> I noticed that the following returns a 1.
>
> echo (1<2) ? True : False
>
> I was under the impression that true/false are of type boolean and not int.
> But in php anything other than 0 translates to true, meaning a 1. What I
> am trying to achieve is for a 1 to be a 1 and a true or false to be a true
> and false respectively and I do not want to put quotes around the word
> true/false either because then it is no longer a boolean but string.
>
> Is it possible to overwrite php's true/false and declare them as boolean?
> You often see in C++, some use Define().
>
> Thanks.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Yes *true* and *false* are booleans.
PHP convert natively different types to boolean in order to help write
sentences like this
if( $object )
{
$object->something();
}
while( $data = mysql_fetch_assoc( $resource ) )
{
print_r( $data );
}
But we you try to print a boolean variable PHP convert it to string: true
becomes '1' and false becomes ''. That's why you can't just echo a boolean
variable to see the value, but you can rely on var_dump to show this.
$bool = true;
echo $bool;
var_dump( $bool );
$bool =! $bool;
echo $bool;
var_dump( $bool );
As other languages PHP as an special operator for checking types while
comparing values.
$a = 'false';
$b = true;
var_dump(
$a == $b, # <-- true
$a === $b # <-- false
);
This happens because values are converted before comparison so, 'false'
becomes true.
PHP converts everything different to an empty string as *true*
This also affect any type of variable.
--
Martin Scotta
--- End Message ---
--- Begin Message ---
On Mon, Sep 7, 2009 at 4:19 PM, Ashley Sheridan
<[email protected]>wrote:
> On Mon, 2009-09-07 at 19:14 +0000, Bobby Pejman wrote:
> > Hi,
> >
> > I noticed that the following returns a 1.
> >
> > echo (1<2) ? True : False
> >
> > I was under the impression that true/false are of type boolean and not
> int. But in php anything other than 0 translates to true, meaning a 1.
> What I am trying to achieve is for a 1 to be a 1 and a true or false to be
> a true and false respectively and I do not want to put quotes around the
> word true/false either because then it is no longer a boolean but string.
> >
> > Is it possible to overwrite php's true/false and declare them as boolean?
> You often see in C++, some use Define().
> >
> > Thanks.
> >
> The statement you gave does return a boolean value, but what you are
> doing is printing the resulting value out. PHP converts the boolean to
> the nearest printable value, which will be a 1 or 0. If you want it to
> output the value 'True' or 'False' then you need to output a string
> value.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I think php convert the boolean variable to string before print its content.
That's why...
echo true; # prints '1'
echo false; # does not prints anything, or prints ''
$bool = false;
var_dump(
(string) $bool,
(int) $bool
);
--
Martin Scotta
--- End Message ---
--- Begin Message ---
On Mon, Sep 7, 2009 at 3:14 PM, Bobby Pejman<[email protected]> wrote:
> Hi,
>
> I noticed that the following returns a 1.
>
> echo (1<2) ? True : False
>
> I was under the impression that true/false are of type boolean and not int.
> But in php anything other than 0 translates to true, meaning a 1. What I am
> trying to achieve is for a 1 to be a 1 and a true or false to be a true and
> false respectively and I do not want to put quotes around the word true/false
> either because then it is no longer a boolean but string.
>
> Is it possible to overwrite php's true/false and declare them as boolean?
> You often see in C++, some use Define().
>
> Thanks.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
It might be pertinent for you to read the section of the manual
dealing with type juggling:
http://us3.php.net/manual/en/language.types.type-juggling.php and the
various things linked therein.
--- End Message ---
--- Begin Message ---
I see what's going on now. Because of the type conversion, I am writing my
code such that my return codes are translated to a strict 1 or 0. The idea of
having anything other than '' or 0 translating to a true scares me a little but
thanks for pointing out the === operator. I had to rewrite a lot of code after
discovering it. Good times...
Thanks for clarifying everyone.
-----Original Message-----
From: Martin Scotta <[email protected]>
Date: Mon, 7 Sep 2009 16:43:59
To: <[email protected]>
Cc: <[email protected]>
Subject: Re: [PHP] Overwrite value of true or false in PHP
On Mon, Sep 7, 2009 at 4:14 PM, Bobby Pejman <[email protected]> wrote:
> Hi,
>
> I noticed that the following returns a 1.
>
> echo (1<2) ? True : False
>
> I was under the impression that true/false are of type boolean and not int.
> But in php anything other than 0 translates to true, meaning a 1. What I
> am trying to achieve is for a 1 to be a 1 and a true or false to be a true
> and false respectively and I do not want to put quotes around the word
> true/false either because then it is no longer a boolean but string.
>
> Is it possible to overwrite php's true/false and declare them as boolean?
> You often see in C++, some use Define().
>
> Thanks.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Yes *true* and *false* are booleans.
PHP convert natively different types to boolean in order to help write
sentences like this
if( $object )
{
$object->something();
}
while( $data = mysql_fetch_assoc( $resource ) )
{
print_r( $data );
}
But we you try to print a boolean variable PHP convert it to string: true
becomes '1' and false becomes ''. That's why you can't just echo a boolean
variable to see the value, but you can rely on var_dump to show this.
$bool = true;
echo $bool;
var_dump( $bool );
$bool =! $bool;
echo $bool;
var_dump( $bool );
As other languages PHP as an special operator for checking types while
comparing values.
$a = 'false';
$b = true;
var_dump(
$a == $b, # <-- true
$a === $b # <-- false
);
This happens because values are converted before comparison so, 'false'
becomes true.
PHP converts everything different to an empty string as *true*
This also affect any type of variable.
--
Martin Scotta
--- End Message ---
--- Begin Message ---
hello
I have a problem to check whether a function successfully inject to database
or not, here is the code :
if($object->dbupdate())
echo 'done';
else
echo 'damn!';
inside the 'if' statement $obj->dbupdate() doesn't execute , how can I
execute and check if it was a successful inject within this function? is it
even possible or should I check within class or something?
--- End Message ---
--- Begin Message ---
Your dbupdate is probably executing a mysql_query command. Is so, update
results from mysql_query will be either true on success or false on failure.
If your query also fails due to perms it will return false.
------Original Message------
From: A.a.k
To: [email protected]
ReplyTo: A.a.k
Subject: [PHP] how to check function's execution?
Sent: Sep 7, 2009 2:52 PM
hello
I have a problem to check whether a function successfully inject to database
or not, here is the code :
if($object->dbupdate())
echo 'done';
else
echo 'damn!';
inside the 'if' statement $obj->dbupdate() doesn't execute , how can I
execute and check if it was a successful inject within this function? is it
even possible or should I check within class or something?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
I'm currently using a text file to store data which the php script
will read and write back to. I've a few questions:
1) I'm thinking of using sqlite, but not sure whether this will be
widely available on most hosts, as I intend for the php script to be
deployed without needing to much with much configuration. Is sqlite
included with most php setups?
2) Should I be using sqlite 2 or 3?
Thanks for your time!
Regards.
Eric
--- End Message ---
--- Begin Message ---
Dear PHP List Members,
First off I am well aware that I can go online and download a PHP script to
make a Calendar, it's not that I'm too cheap to buy the script it is that I
want to work through and fully understand what I have so that I am
intimately aware of every aspect of my project. What I really would like is
a tutorial that will teach me to write the script for a calendar (or at
least get me started) that will allow me to schedule various multi day
events and write the requests to a mySQL database. I would prefer something
that is PHP/ mySQL, HTML and CSS no flash or Java. If any one knows of a
site on the web I could find such a tutorial please let me know.
Many Thanks
Haig Vancouver BC
--- End Message ---
--- Begin Message ---
On Tue, Sep 8, 2009 at 9:17 AM, Haig Davis<[email protected]> wrote:
> Dear PHP List Members,
> least get me started) that will allow me to schedule various multi day
> events and write the requests to a mySQL database. I would prefer something
> that is PHP/ mySQL, HTML and CSS no flash or Java. If any one knows of a
> site on the web I could find such a tutorial please let me know.
i have googled a lot to find out a good tutorial on this topic,
finally decided to start coding it.
it's just a bunch of while loops and mysql views. the schema and the
classes and methods are totally up to the developer and heavily
depends on the specific requirements.
date_parse and strtotime were very useful php functions.
~viraj
>
> Many Thanks
>
> Haig Vancouver BC
>
--- End Message ---
--- Begin Message ---
under IE8:
http:// 209.33.25.167:8080/phpinfo.php
with:
<?php
phpinfo();
?>
I get :
The website cannot display the page
HTTP 500
Most likely causes:
•The website is under maintenance.
•The website has a programming error.
under Firefox 3.5.2
___________________________________________
The specified procedure could not be found.
___________________________________________
I installed :
php-5.2.10-Win32-VC6-x86.zip and put php.ini in C:\PHP and C:\PHP\ext
AND C:\WINDOWS, C:\WINDOWS\system and C:\WINDOWS\system32
I installed FastCGI 1.5 !
In php.ini I put :
________________________________
cgi.force_redirect = 0 // for CGI
extension_dir = "C:\PHP\ext" (not trying to use any extension ...just
get phpinfo to work)
doc_root = "C:\inetpub\wwwroot" // for IIS/PWS
an earlier post recommended:
doc_root =
_________________________________________________
IIS 5.1 properties->configuration I added .php C:\PHP\php5.dll
GET,HEAD,POST,DEBUG
_________________________________________________
I added to the XP Prof environment path ;C:\PHP;C:\PHP\ext
I created an environment variable (and rebooted) PHPRC = C:\PHP;C:\PHP\ext
_________________________________________________
From the unzipped download,
I copied ntwdblib.dll to C:\PHP and C:\PHP\ext
AND C:\WINDOWS, C:\WINDOWS\system and C:\WINDOWS\system32
I never found any statement of the necessity of requiring CGI
The instructions ramble around
--- End Message ---
--- Begin Message ---
--- On Mon, 9/7/09, Fred Silsbee <[email protected]> wrote:
> From: Fred Silsbee <[email protected]>
> Subject: [PHP] need php_mssql so I retreated to 5.2.10
> To: [email protected]
> Date: Monday, September 7, 2009, 11:09 PM
>
> under IE8:
> http:// 209.33.25.167:8080/phpinfo.php
> with:
> <?php
> phpinfo();
> ?>
>
> I get :
> The website cannot display the page
> HTTP 500
> Most likely causes:
> •The website is under maintenance.
> •The website has a programming error.
>
> under Firefox 3.5.2
> ___________________________________________
> The specified procedure could not be found.
> ___________________________________________
>
> I installed :
> php-5.2.10-Win32-VC6-x86.zip and put php.ini in C:\PHP and
Let's start with what OS you're using... From above ...x86.zip, I presume
you're using 32bit Windows?
> C:\PHP\ext
> AND C:\WINDOWS, C:\WINDOWS\system and C:\WINDOWS\system32
>
> I installed FastCGI 1.5 !
>
> In php.ini I put :
> ________________________________
>
> cgi.force_redirect = 0
> // for CGI
>
> extension_dir = "C:\PHP\ext" (not
> trying to use any extension ...just
>
>
> get phpinfo to work)
>
>
> doc_root = "C:\inetpub\wwwroot" // for IIS/PWS
> an earlier post recommended:
> doc_root =
> _________________________________________________
> IIS 5.1 properties->configuration I added .php
> C:\PHP\php5.dll
> GET,HEAD,POST,DEBUG
>
You need to read the docs again... installing CGI does not use *.dll. You only
use php5-cgi.exe. Allow DEBUG operations is bad for hack attempts, if this
setup is for production.
> _________________________________________________
>
> I added to the XP Prof environment path ;C:\PHP;C:\PHP\ext
>
> I created an environment variable (and rebooted) PHPRC =
> C:\PHP;C:\PHP\ext
> _________________________________________________
> From the unzipped download,
> I copied ntwdblib.dll to C:\PHP and C:\PHP\ext
> AND C:\WINDOWS, C:\WINDOWS\system and C:\WINDOWS\system32
Doing this will you get you into all kinds of problems. You should only put
the right bitwise file into the proper folder.
>
> I never found any statement of the necessity of requiring
> CGI
>
> The instructions ramble around
>
Which instructions are you referring to? The online? or the text .txt file?
Any particular reason why you need to use the mssql extension? It only
supports connecting to MSSQL 2000 since it uses MS SQL 2000 library headers.
You might as well use a more current version of PHP and connect to MSSQL via
ODBC.
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I have an invoice table that is drawn on a number of pages, so I have
all the logic in an include-file like this:
include "invoicetable_bottom.php";
However, now I'm needing to take the output from that include file and
pass it as an email. To do that, I need to somehow take the output
from this include file and get it into a variable somehow. Is there a
simple way to do this?
Something like: $emailtcontent = include "invoicetable_bottom.php"?
--- End Message ---
--- Begin Message ---
On Tue, Sep 8, 2009 at 12:35 AM, Rob Gould<[email protected]> wrote:
> I have an invoice table that is drawn on a number of pages, so I have all
> the logic in an include-file like this:
>
> include "invoicetable_bottom.php";
>
>
> However, now I'm needing to take the output from that include file and pass
> it as an email. To do that, I need to somehow take the output from this
> include file and get it into a variable somehow. Is there a simple way to
> do this?
>
> Something like: $emailtcontent = include "invoicetable_bottom.php"?
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Use output buffering and capture:
http://us3.php.net/manual/en/book.outcontrol.php
ob_start();
include 'stuff_that_makes_html.php';
$contents = ob_get_clean();
--- End Message ---