php-general Digest 30 May 2003 12:24:32 -0000 Issue 2087
Topics (messages 149508 through 149549):
Re: Variables not being past
149508 by: The.Wiz
"Please wait"/server push sample code
149509 by: Karl O.Pinc
mysql field getting cut off
149510 by: Larry Brown
149512 by: John W. Holmes
149513 by: Larry Brown
php cookie problem ie 5.5
149511 by: steven melendez
Re: Random Blank Output wit 4.3.2
149514 by: Justin French
array question
149515 by: Randy Johnson
149516 by: Randy Johnson
PHP OOP x Procedural Performance - Conclusions
149517 by: William N. Zanatta
Re: Anyone have oci8 working on MacOSX?
149518 by: Weston Houghton
149530 by: Sapporo
imagettftext and Anti-Aliasing
149519 by: Jeff Maki
Mail - mime question
149520 by: Jim McNeely
149523 by: Manuel Lemos
random
149521 by: Marius
149525 by: Evan Nemerson
general question
149522 by: laurent hermann
149526 by: Evan Nemerson
output_handler in php.ini: how to use custom function
149524 by: Jean-Christian Imbeault
generate random
149527 by: Marius
149529 by: Leif K-Brooks
149532 by: David Grant
149535 by: David Grant
"Email This Story" and "Print" Functions
149528 by: Jeffrey L. Fitzgerald
149534 by: David Grant
mail function problem
149531 by: Bersani Francesco
149533 by: David Grant
Re: sessions and domains
149536 by: George Whiffen
How to question.
149537 by: Ryan A
149538 by: Wim Paulussen
149539 by: Sichta Daniel
PATH_INFO wrong URL
149540 by: Tobias Martelius
Zend Gone missing
149541 by: Chris Blake
149542 by: DvDmanDT
149547 by: David Grant
149548 by: Chris Blake
PHP- Converting to and from TIMESTAMPS
149543 by: Ian Gray
149544 by: David Grant
149545 by: Leif K-Brooks
149546 by: John W. Holmes
Suggestion of webpage about search engines
149549 by: l
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 ---
Could be because there is a solar eclipse somewhere????
If your going to ask a question, at least give details that matter. Asking a
question like: Why isn't the sun shining?? Leaves endless possibilities as
to why you can't see the sun. Is there a blanket over your head? Is it night
time???.. Just give relevant details....
"The Doctor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Questions, I have a
> cusotmer using a basic username and password
> verifier on a php Web Page.
>
> This was working and suddenly with I redefined the php environment,
> the php variables are not getting passed on.
>
> why?
>
> --
> Member - Liberal International On 11 Sept 2001 the WORLD was violated.
> This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED]
> Society MUST be saved! Extremists must dissolve.
> Arsenal Winners of the FA CUp 2003!
--- End Message ---
--- Begin Message ---
Does work with Mozilla....
Regards,
Karl
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
---------------------------<snip>-------------------
<?php
/* Example of how to do a "please wait" message while a web page loads.
*
* May 28, 2003
*
* Karl O. Pinc <kop AT meme DOT com>
*
* This code does not work with Microsoft's Internet Explorer.
* (I suspect they want you to use their DHTML instead of the
* W3/RFC standards. Unfortunately for them, javascript will do
* the same thing and is more popular.)
*
* This technique can be adapted to send files along with a web page,
* send many successive pages, send many alternative representations of
* the same content, and so forth. (RFC 1341 is your friend.)
*
* The idea is to send two complete web pages in response to a single
* client request. The first page has the "please wait" message, the
* second is the data we want to deliver. We send two pages by returning
* multipart/mixed mime document, each page being a separate part.
*
* For this page to work with apache/php the php short_open_tag configuration
* directive must be set to "off", so the xml declaration is passed to the
* client. Put "php_flag short_open_tag off" (in a <Directory> directive?)
* in /etc/httpd/conf/httpd.conf or a .htaccess file.
*
* Note that this page relies on the w3.org site for the
* xhtml dtd declaration. If you want to be stand-alone, copy
* the document to your own server and adjust the URLs in the doctype
* declaration. (The xmlns namespace in the "head" tag is a string
* identifying the namespace, not a document.)
*
* As coded this page needs a (possibly empty) CSS file named 'markup.css'
* in this file's parent directory. See:
* http://www.w3.org/TR/REC-html40/present/styles.html
* for more information.
*
* Technique from "The Linux Journal, Issue 82", "Web Servers and
* Dynamic Content", http://www.linuxjournal.com/article.php?sid=4386, the
* section titled "Pushing Continual Updates to the Browser".
* See also section 7.2 of RFC 1341, nicely formatted at:
* http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
*/
//
// Some constants
//
// The RFC is finicky, it wants carriage-return, line-feed as EOL
// in mime documents.
define(CRLF, "\r\n");
// The canonical name of the UTF-8 (us-ascii superset) encoding.
define(UTF8, 'UTF-8');
//
// Generate 70 characters to use for a boundary string. The boundary generated
// is the most random allowed under RFC1341. The odds are
// _long_ that the string won't occur elsewhere in the HTML.
//
// Note the space is last!
define(BCHARS
, "'()+,./01234567890:=?_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
");
define(BCHARS_LAST_POS, 74); // indexed zero relative
define(BCHARSNOSPACE_LAST_POS, 73); // 74 chars before the space
$BOUNDARY = '';
for ($i = 1; $i <= 69; $i++) {
// substr() is likely at least as fast as a php array reference.
$BOUNDARY .= substr(BCHARS, rand(0, BCHARS_LAST_POS), 1);
}
$BOUNDARY .= substr(BCHARS, rand(0, BCHARSNOSPACE_LAST_POS), 1);
//
// Other initialization -- make more 'constant's.
//
$DELIMITER = CRLF . '--' . $BOUNDARY . CRLF;
$CLOSE_DELIMITER = CRLF . '--' . $BOUNDARY . '--';
$CONTENT_HEADER = 'Content-type: text/html; charset=' . UTF8 . CRLF
. 'Content-Style-Type: text/css' . CRLF . CRLF;
// Note that we just assumed that all the parts are the same mime type and
// encoding. This does not have to be the case.
// Another possibility for a mime type is "text/plain", if that
// floats your boat. You can also use various mime headers to
// send files to the client and so forth.
//
// Have the server tell the client we'll be sending a multipart mime document.
//
// (Recall, header() _must_ be called before any output is sent. Check
// those require()-s and include()-s that might be above to be sure
// they don't generate output!)
// (Old-time netscape used multipart/x-mixed-replace, but mozilla
// works straight from the RFC recommendation.)
header("Content-Type: multipart/mixed; boundary=\"$BOUNDARY\"");
//
// Test the client's implementation of multipart/mixed.
// (If you're trying to get IE to work, remove this and the
// other test output in the epilogue.)
//
?>
All output before the first boundary delimiter is preamble and should
be ignored by the browser.
If you can see this, your browser is not RFC 1341 compliant.
<?php
//
// The first page to display.
//
// First, encapsulation as mime message, then the body, which includes
// the requisite meta information about html version, encoding, etc. to
// be standards compliant. (This meets XHTML 1.0, Strict.)
print($DELIMITER);
print($CONTENT_HEADER);
// Note, the \n trailing the ? > is part of the ? > tag and not sent to client.
?>
<?xml version="1.0" encoding="<?php print(UTF8); ?>"?>
<?xml-stylesheet type="text/css" href="markup.css"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<link type="text/css" rel="stylesheet" href="markup.css"></link>
<title>Test page -- waiting</title>
</head>
<body>
<p>
Please wait while our computer does something important sounding....
</p>
</body>
</html>
<?php
// Finish the encapsulation of the first page.
print($DELIMITER);
// Send the first page.
flush();
// Wait 7 seconds, so the user has time to read the first page.
sleep(7);
//
// Second page to display.
//
print($CONTENT_HEADER);
// Note, the \n trailing the ? > is part of the ? > tag and not sent to client.
?>
<?xml version="1.0" encoding="<?php print(UTF8); ?>"?>
<?xml-stylesheet type="text/css" href="markup.css"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<link type="text/css" rel="stylesheet" href="markup.css"></link>
<title>Test page</title>
</head>
<body>
<p>
All done. Ain't you glad you waited?
</p>
</body>
</html>
<?php
// Finish the second page.
print($CLOSE_DELIMITER);
//
// Just for grins, continue checking the client's rfc conformance.
//
flush(); // Send the second page.
// Note, the \n trailing the ? > is part of the ? > tag and not sent to client.
?>
All output after the closing boundary delimiter is epilogue and
should be ignored by the browser.
If you can see this, your browser is not RFC 1341 compliant.
--- End Message ---
--- Begin Message ---
If anyone can help I seem to be stuck on a problem getting a mysql field
inserted correctly. For instance the first page would have a field such
as...
<input type="text" name="field" size="12">
info that is placed into the field is "St. Petersburg, FL" (without the
quotes)
the php code for the statement...
$query = "insert into table values( $variable, '$field', $variable2 )";
This is where there are 3 fields in the "table" and the second is the one I
want populated with "St. Petersburg, FL". It ends up with "St." (I'm not
sure if the period makes it). I have verified that the entire statement
arrives at the php script in the variable $field and I have used the mysql
client to give the same command with "St. Petersburg, FL" as the value and
it accepts it without a problem.
Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388
--- End Message ---
--- Begin Message ---
> If anyone can help I seem to be stuck on a problem getting a mysql
field
> inserted correctly. For instance the first page would have a field
such
> as...
>
> <input type="text" name="field" size="12">
>
> info that is placed into the field is "St. Petersburg, FL" (without
the
> quotes)
>
> the php code for the statement...
>
> $query = "insert into table values( $variable, '$field', $variable2
)";
>
> This is where there are 3 fields in the "table" and the second is the
one
> I
> want populated with "St. Petersburg, FL". It ends up with "St." (I'm
not
> sure if the period makes it). I have verified that the entire
statement
> arrives at the php script in the variable $field and I have used the
mysql
> client to give the same command with "St. Petersburg, FL" as the value
and
> it accepts it without a problem.
When you run a SELECT from the command line, do you only see "St." in
the column? What kind of column is it?
Are you sure it's not fine in the database and you're just showing it
like:
<input type=text value=$value name=field>
which will end up like
<input type=text value=St. Petersburg, FL name=field>
and will only show "St." in the text box...
---John W. Holmes...
Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--- End Message ---
--- Begin Message ---
That, indirectly, is exactly what happened. I have a subsequent screen for
modifying the results. I must have gone back into that screen to change
something else and since it only pulled the St. when I applied it it changed
the field in the database. Thanks a lot. It seemed weird.
Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388
-----Original Message-----
From: John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 9:44 PM
To: 'Larry Brown'; 'PHP List'
Subject: RE: [PHP] mysql field getting cut off
> If anyone can help I seem to be stuck on a problem getting a mysql
field
> inserted correctly. For instance the first page would have a field
such
> as...
>
> <input type="text" name="field" size="12">
>
> info that is placed into the field is "St. Petersburg, FL" (without
the
> quotes)
>
> the php code for the statement...
>
> $query = "insert into table values( $variable, '$field', $variable2
)";
>
> This is where there are 3 fields in the "table" and the second is the
one
> I
> want populated with "St. Petersburg, FL". It ends up with "St." (I'm
not
> sure if the period makes it). I have verified that the entire
statement
> arrives at the php script in the variable $field and I have used the
mysql
> client to give the same command with "St. Petersburg, FL" as the value
and
> it accepts it without a problem.
When you run a SELECT from the command line, do you only see "St." in
the column? What kind of column is it?
Are you sure it's not fine in the database and you're just showing it
like:
<input type=text value=$value name=field>
which will end up like
<input type=text value=St. Petersburg, FL name=field>
and will only show "St." in the text box...
---John W. Holmes...
Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi, I'm using php 4.2 with NT/IIS and am having a
problem setting cookies on ie 5.5. I am setting a
series of cookies using the array syntax:
setcookie ("cookie[three]", "cookiethree");
setcookie ("cookie[two]", "cookietwo");
setcookie ("cookie[one]", "cookieone");
I've seen a variety of entries on the web where people
have had problems setting cookies for ie 5.5 and have
suggested solutions such as setting all parameters,
making sure the path has a trailing /, and putting all
values including expiration time in double quotes but
none of these have solved my problem.
The cookies are often set in a subdirectory, eg.
domain.com/sub/, and I have found that on ie 6.0, if I
put the path as "/" then the cookies aren't read. I
need to add in the domain as well, so I have "/",
".domain.com".
I have noticed that if I delete all existing cookies
from ie5.5 and then restart the browser that cookies
are then accepted, but I don't think this is an
acceptable solution for most users.
If anyone has any suggestions they would be greatly
appreciated.
Thanks in advance,
-steve
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
--- End Message ---
--- Begin Message ---
Do you use sessions? I had some weird results, blank output and loss of
session in 4.2.x with sessions using shared memory -- when sessions were
changed back to files, all was ok. This may be, but probably not, related
:)
Justin
on 30/05/03 2:00 AM, Andy BIERLAIR ([EMAIL PROTECTED]) wrote:
> Hi,
>
> I’ve tried php-4.3.2 with my old config (4.3.1), and I noticed that all our
> <VirtualHosts> are sometimes blank and then after a browser refresh, the
> content is showed. This happens approx. 1 in 10 times.
>
> You can try it with one of our vhosts: www.hot.lu and refreshing it a few
> times.
>
> The problem used to be a little different and I found a solution, but it
> only stopped the random output of an open_base_dir restricion (which isn't
> present!)
>
> At random times a PHP gave the error:
>
> Warning: open_basedir restriction in effect. File is in wrong directory
> in Unknown on line 0
>
> Warning: Failed opening '/php/page/I/happen/to/be/looking/at.php' for
> inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0
>
> I followed the instructions in this thread and changed the php.ini file:
> http://bugs.php.net/bug.php?id=15302
>
>
>
> I hope that someone can help me out since I think that I'm not the first one
> to have this problem.
>
> Btw: This problem did not occur in <= PHP-4.3.1
>
>
> Thanks,
>
>
> ************************************************************************
> * Andy BIERLAIR - root eSolutions sàrl - Management *
> * 133, route de Diekirch - L-7220 Walferdange - Luxembourg *
> * E-mail: [EMAIL PROTECTED] *
> * URL: http://www.root.lu - http://www.network.lu *
> ************************************************************************
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> ---
> [This E-mail scanned for viruses]
>
>
--- End Message ---
--- Begin Message ---
How do I access the data in $query_data after I go through the while loop,
here is an example
$result=mysql_query($query,$link);
while ($query_data=mysql_fetch_array($result) )
{
$var1=$query_data["var1"];
$var1=$query_data["var1"];
}
after the while is done, How do I access the data in query data again . I
perform calculations the first time and the second time I need to display
the rows on the screen.
Randy
--- End Message ---
--- Begin Message ---
I found this in the manual user comments and it worked great
mysql_data_seek($result,0);
Randy
----- Original Message -----
From: "Randy Johnson" <[EMAIL PROTECTED]>
To: "Brian Dunning" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 10:14 PM
Subject: [PHP] array question
> How do I access the data in $query_data after I go through the while loop,
> here is an example
>
> $result=mysql_query($query,$link);
> while ($query_data=mysql_fetch_array($result) )
> {
> $var1=$query_data["var1"];
> $var1=$query_data["var1"];
> }
>
> after the while is done, How do I access the data in query data again .
I
> perform calculations the first time and the second time I need to display
> the rows on the screen.
>
>
> Randy
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
First of all. Thanks everybody for the feedback. It was very precious to
hear from you.
So, there's no big differences unless we're working with heavy
processes. Even in this case, the performance seems to be very good in
both practices, thus I'll keep OOP.
My OOP concepts are not really sharp yet but I'm learning more and more
everyday and I feel very satisfied with that. I still get caught in some
aspects of classes abstraction, probably due to the lack of design.
I see OOP fitting in all contexts I've got until now, at least due to
code organization.
Also, I like that thoughts of using it primarily for Core libraries (I
have my own 'class Core' too) which drives much of my system. But I'm
wondering about that discussion on 'outputs'. I don't see any reasons
why don't do that, we can have an abstract class and other classes
implementing 'drivers' for the needed formats and that would fit really
good in some environments where data are output in many formats.
Thank you all guys!!!
Regards,
William N. Zanatta
--- End Message ---
--- Begin Message ---
What version of PHP are you using, and are you using both CLI and
Apache module at the same time?
I compiled it at work with no huge problems.
Wes
On Thursday, May 29, 2003, at 06:45 PM, Sapporo wrote:
Hi,
is anyone sucessfully using the oci8 Oracle extension on MacOSX?
Whenever I try to connect using OCILogon(), oci8 crashes:
May 30 00:33:19 localhost crashdump: Unable to write crash report to
/Library/Logs/CrashReporter/httpd.crash.log for uid: 70 Date/Time:
2003-05-30 00:33:19 +0200 OS Version: 10.2.6 (Build 6L60) Host:
myhostname.local. Command: httpd PID: 1400 Exception:
EXC_BAD_ACCESS (0x0001) Codes: KERN_PROTECTION_FAILURE (0x0002)
at 0x00000000 Thread 0 Crashed: #0 0x90000f20 in strlen #1
0x0193a0e8 in snauca_check_adapter #2 0x01913670 in nau_viat #3
0x0190ba18 in nau_gettab #4 0x0190a100 in nau_ini #5 0x018ba6f4
in nainit #6 0x018dad3c in nsnainit #7 0x0189c478 in nsopen #8
0x0189b160 in nscall1 #9 0x0189a948 in nscall #10 0x018fdc38 in
niotns #11 0x0188749c in osncon #12 0x01713c6c in upiini #13
0x0172428c in upiah0 #14 0x016e6ae4 in kpuatch #15 0x0171b7d0 in
OCIServerAttach #16 0x007834e4 in _oci_open_server (oci8.c:2437)
#17 0x00783b68 in oci_do_connect (oci8.c:2590) #18 0x00855758 in
execute (zend_execute.c:1596) #19 0x0084769c in zend_execute_script
TIA,
-sapporo.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I compiled 4.3.1 as Apache module and also installed the CLI (which I'm
not using). Compilation was not a problem here either - it's just that
oci8 crashes whenever I try to use it.
Here's my configure command:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
--mandir=/usr/share/man --with-apxs --with-zlib-dir=/usr
--enable-trans-sid --enable-exif --enable-wddx --enable-ftp
--enable-mbstring --enable-dbx --enable-dbase --enable-sockets
--with-oci8=/Users/oracle/9iR2/orahome
Did you modifiy your Apache startup file to set any environment
variables?
Thanks,
-sapporo.
What version of PHP are you using, and are you using both CLI and
Apache module at the same time?
I compiled it at work with no huge problems.
Wes
On Thursday, May 29, 2003, at 06:45 PM, Sapporo wrote:
Hi,
is anyone sucessfully using the oci8 Oracle extension on MacOSX?
Whenever I try to connect using OCILogon(), oci8 crashes:
May 30 00:33:19 localhost crashdump: Unable to write crash report to
/Library/Logs/CrashReporter/httpd.crash.log for uid: 70 Date/Time:
2003-05-30 00:33:19 +0200 OS Version: 10.2.6 (Build 6L60) Host:
myhostname.local. Command: httpd PID: 1400 Exception:
EXC_BAD_ACCESS (0x0001) Codes: KERN_PROTECTION_FAILURE (0x0002)
at 0x00000000 Thread 0 Crashed: #0 0x90000f20 in strlen #1
0x0193a0e8 in snauca_check_adapter #2 0x01913670 in nau_viat #3
0x0190ba18 in nau_gettab #4 0x0190a100 in nau_ini #5 0x018ba6f4
in nainit #6 0x018dad3c in nsnainit #7 0x0189c478 in nsopen #8
0x0189b160 in nscall1 #9 0x0189a948 in nscall #10 0x018fdc38
in niotns #11 0x0188749c in osncon #12 0x01713c6c in upiini #13
0x0172428c in upiah0 #14 0x016e6ae4 in kpuatch #15 0x0171b7d0 in
OCIServerAttach #16 0x007834e4 in _oci_open_server (oci8.c:2437)
#17 0x00783b68 in oci_do_connect (oci8.c:2590) #18 0x00855758 in
execute (zend_execute.c:1596) #19 0x0084769c in zend_execute_script
TIA,
-sapporo.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello Everyone:
I have a quick question about libgd, ttf fonts, imagettftext and
anti-aliasing -- I have two FreeBSD boxes, both running PHP 4.3. One
anti-aliases the text very nicely, and the other does not. I cannot
figure out why the images look so different on the two different boxes
-- does anybody know of anything that might cause this? I'm using libgd
2.0 "or higher" (according to phpinfo()) on both machines, and the same
version of php on both. Has anybody else discovered such behavior?
example good image:
example bad image:
Thanks!
-Jeff.
--- End Message ---
--- Begin Message ---
I've come a long way with many google searches an I almost have this
working, so have mercy!!!
So what am I missing here?
I'm doing a Mail_mime class smtp mail from php using PEAR. It needs to
have text and html versions which is why I'm using this. It is sending
out the email OK, but when I get the mail, I get this as the body of
the email:
--=_026291a5f21535a06900e25d87a7070a
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Text email simple dimple
--=_026291a5f21535a06900e25d87a7070a
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html><body><b>HTML<b> version of email</body></html>
--=_026291a5f21535a06900e25d87a7070a--
TIA...
--- End Message ---
--- Begin Message ---
Hello,
On 05/30/2003 02:28 AM, Jim McNeely wrote:
I've come a long way with many google searches an I almost have this
working, so have mercy!!!
So what am I missing here?
I'm doing a Mail_mime class smtp mail from php using PEAR. It needs to
have text and html versions which is why I'm using this. It is sending
out the email OK, but when I get the mail, I get this as the body of the
email:
Maybe your problem has to due with mail() function bugs. You may want to
try this other class that comes with work arounds to some of the mail()
function bugs and you can easily compose messages with text and HTML in
the same body as well embedded images and attached files if you need
that too.
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
I tried
<?
$random = gmp_intval(gmp_random(10));
echo $random;
?>
<?
$random = gmp_random(10);
$random = gmp_strval($random);
echo $random;
?>
but it echoes realy big numbers like 36324613454671
--
Marius
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
"limiter" is the maximum number of limbs, not the max random number. A limb,
according to the GMP documentation, is " the part of a multi-precision number
that fits in a single word. (We chose this word because a limb of the human
body is analogous to a digit, only larger, and containing several digits.)
Normally a limb contains 32 or 64 bits."
There's a comment on php.net/gmp_random about this
On Friday 30 May 2003 12:10 am, Marius wrote:
> I tried
> <?
> $random = gmp_intval(gmp_random(10));
> echo $random;
> ?>
> <?
> $random = gmp_random(10);
> $random = gmp_strval($random);
> echo $random;
> ?>
>
> but it echoes realy big numbers like 36324613454671
--
The people are the only sure reliance for preservation of our liberty.
-Thomas Jefferson
--- End Message ---
--- Begin Message ---
hello
i need to make a standalone application from a web php site.
how can i use php-gtk ?
how can i package this application ?
thanks
--- End Message ---
--- Begin Message ---
"The php-gtk-general list is meant for general discussion about using PHP-GTK.
To subscribe, send blank email to [EMAIL PROTECTED]
The address of the list itself is [EMAIL PROTECTED] The list is
archived at MARC. " - http://gtk.php.net/resources.php
Try there- you'll prolly get a better answer than you would here.
On Thursday 29 May 2003 11:22 pm, laurent hermann wrote:
> hello
>
> i need to make a standalone application from a web php site.
>
> how can i use php-gtk ?
>
> how can i package this application ?
>
>
>
> thanks
--
Cats are intended to teach us that not everything in nature has a function.
-Garrison Keillor
--- End Message ---
--- Begin Message ---
I'd like ot set the output_handler in php.ini to be a custom function I
will write. Is this possible. The documentation say how to redirect to a
function that is not part of the PHP core ...
Basically I want to have all the output be sent to my custom function,
which will do something to it, before being sent out to the browser.
Since I will be doing this on all my pages I don't want to hard-code a
call to ob_start() on each and every page. I am hoping I can do this
with a setting in the php.ini file.
Any suggestions?
thanks,
Jean-Christian Imbeault
--- End Message ---
--- Begin Message ---
how to generate random number ?
--
Marius
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I reccomend you RTFM!
www.php.net/rand
www.php.net/mt_rand
Marius wrote:
how to generate random number ?
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt
to decrypt it will be prosecuted to the full extent of the law.
--- End Message ---
--- Begin Message ---
Marius wrote:
how to generate random number ?
Look no further than rand(). Well, actually do look further because
srand() is better.
Regards,
David
--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625
Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
--- End Message ---
--- Begin Message ---
Leif K-Brooks wrote:
I reccomend you RTFM!
There's a MANUAL?! Wow! :)
--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625
Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
--- End Message ---
--- Begin Message ---
Thanks to Kevin, Monty and the others who helped with my earlier post...
Anyone have experience with PHP based "Email This Story" and "Print This
Story" functions?? I am looking to add these along with a digital postcard
mailer.
--- End Message ---
--- Begin Message ---
Jeffrey L. Fitzgerald wrote:
Thanks to Kevin, Monty and the others who helped with my earlier
post...
Anyone have experience with PHP based "Email This Story" and "Print
This Story" functions?? I am looking to add these along with a digital
postcard mailer.
Probably not the answer you're looking for, but a hell of a lot easier:
For print this story, you only need an alternate print stylesheet...
Look at the CSS spec.
Regards,
David
--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625
Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
--- End Message ---
--- Begin Message ---
Hi, I have a problem with the "mail" function; it always sends mails
assuming in the "from" field the user "[EMAIL PROTECTED]".
I tried to override it with this code:
----------------
<?
$email = "[EMAIL PROTECTED]";
$subject = "prova invio mail ";
$message = "parappaaaaaaaaaaa ";
$headers = "From:[EMAIL PROTECTED]:[EMAIL PROTECTED]";
mail($email, $subject, $message, $headers);
?>
------------------
It doesn't work...
Can anybody help me ?
--------------
Francesco Bersani
--- End Message ---
--- Begin Message ---
Bersani Francesco wrote:
Hi, I have a problem with the "mail" function; it always sends mails
assuming in the "from" field the user "[EMAIL PROTECTED]".
I tried to override it with this code:
----------------
<?
$email = "[EMAIL PROTECTED]";
$subject = "prova invio mail ";
$message = "parappaaaaaaaaaaa ";
$headers = "From:[EMAIL PROTECTED]:[EMAIL PROTECTED]";
mail($email, $subject, $message, $headers);
?>
------------------
It doesn't work...
Can anybody help me ?
Take a peek into php.ini to change the default value.
Note that you should seperate mail headers with \r\n.
Regards,
David
--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625
Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
--- End Message ---
--- Begin Message ---
Bk wrote:
Hi
I've to set up a shared shopping cart to buy items
from four different sites and pay them at once
passing trough a single checkout.
Provided that these sites are hosted on the same
server (actually in the same directory), but have
different names, is it possible to share php
sessions across multiple domains? How?
Bk,
I notice your question has basically been answered i.e. you have to pass
something e.g. session_id, between the sites via a GET/POST. So just a
couple of related points:
1. I seem to remember that you can set sessions to use IP addresses or
URL'ed session_ids as well as cookie'd session ids. Either of these
techniques would solve your problem as well, (although cookies strike me
as a better route if you must use sessions ;)).
2. If you are doing this kind of "multi-site" stuff and have Apache,
it's worth checking out the php virtual() and header() commands.
With these you can leave your "shops" to just handle their own stuff and
use a "master" domain to do all the basket/order processing.
The basic technique is to direct your order forms/buttons to a script on
the master domain which does the procesing, (and can set cookies if it
wants). Once it's finished, instead of generating its own page it uses
a Location header to redirect the user back to an appropriate page on
the "shop" domain. The user never knows you've done this.
Similarily, the checkout button can go to the master domain to do the
actual procesing, where it automatically picks up any cookies (e.g.
session_ids), that you set from a master domain page.
The virtual command might come into the picture if you want to show the
user the status of their shopping basket while in one of the shops.
Virtual allows you to run a http request behind the scenes and include
the output in your page. So your page can mix output from different php
scripts running on different domains. They don't even have to be
scripts in domains on the same server if you set up an Apache proxy to
point to the remote script.
You can use this to include a "basket status" section on your shop pages
without having to run the code to create it in your script. You can
have one set of "basket status" code across as many shops/domains as you
like i.e. code once, use often.
Unfortunately, what you can't do with a virtual() is to get the
"foreign" script to pick up any cookies set for its domain. (That's
because the user's browser never sees the http request, so it doesn't
know that it should send the cookies for the domain). That means you
would still have to swap the session_id, (or basket key), around between
sites.
You can see these techniques in action at any "Ishop" e.g.
www.levitron.co.uk. All the main procesing is done by www.ishop.co.uk,
but the shop has entirely its own identity. Order buttons, searches and
checkouts go to the master "ishop" domain and product pages include a
checkout status line generated on the master domain.
You'll notice that there is no use of php sessions. Basket information
is stored in the database and then the database key is cookied, posted
and urled. Partly that's because there's still a mix of php, C and perl
coded pages. Sessions are not really appropriate for heterogeneous
environments. C or Perl or any other language can easily pick up a
cookied database key and query a database but how do they get hold of
data in a php session?
Even if it was all php, I still wouldn't use sessions. My view is that
if data is to be stored on a server it should be stored properly in a
structured format in a database, not in a unstructured and pretty much
inaccessible session object. For example, it's hard to prove to a third
party what data you have stored about users, if some of it might be in
stored sessions.
Ummm, I wonder if I should explicitly raise my concerns about sessions
in a separate thread? I don't use sessions so it doesn't bother me, but
I wonder if some people are just storing up trouble for themselves by
basing their code on the use of sessions...
Anyway, hope this helps,
George
--- End Message ---
--- Begin Message ---
Hi,
I am a little confused with something that I am trying to implement (if you
want to see the code tell me, but its pretty simple so i dont think you will
need to) heres the idea, I want the client to be able to save up his choice
into his account
eg:
his choice is 5 records (which transalates to me just saving the sql for
those 5 records into his account)
heres my problem, I am trying to make it so that if he tries to save his 5
records and he has not already logged in, he should be presented with the
login page (have done this via sessions) *BUT* after he logs in he does not
have to pick the 5 records all over again, it should remember his 5 records
and automatically put it in.
eg:
1.guy come to site and picks 5 records (he is not logged in)
2. gets redirected to the login page (but his 5 records or the sql for the
five records are saved....how i dont know)
3.he logs in and the sql is entered into his accounts database for use later
on.
Sorry if that sounded confusing but if you get what i am trying to say you
will see that its not really.
Thanks for your help,
-Ryan
--- End Message ---
--- Begin Message ---
Dear Ryan,
2 possible scenarios I use :
a. store the values in variables that you transfer back and forth using
'hidden' input
b. store the values in variables that you register in the session you opened
(fyi all my php files start with session_start regardless whether I use it
or not).
Wim
-----Oorspronkelijk bericht-----
Van: Ryan A [mailto:[EMAIL PROTECTED]
Verzonden: Friday, May 30, 2003 11:37 AM
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] How to question.
Hi,
I am a little confused with something that I am trying to implement (if you
want to see the code tell me, but its pretty simple so i dont think you will
need to) heres the idea, I want the client to be able to save up his choice
into his account
eg:
his choice is 5 records (which transalates to me just saving the sql for
those 5 records into his account)
heres my problem, I am trying to make it so that if he tries to save his 5
records and he has not already logged in, he should be presented with the
login page (have done this via sessions) *BUT* after he logs in he does not
have to pick the 5 records all over again, it should remember his 5 records
and automatically put it in.
eg:
1.guy come to site and picks 5 records (he is not logged in)
2. gets redirected to the login page (but his 5 records or the sql for the
five records are saved....how i dont know)
3.he logs in and the sql is entered into his accounts database for use later
on.
Sorry if that sounded confusing but if you get what i am trying to say you
will see that its not really.
Thanks for your help,
-Ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
You can build some class which will hold some data and then you just need to
sets all class variables and register instance of this class to the session
variable.
DS
-----Original Message-----
From: Ryan A [mailto:[EMAIL PROTECTED]
Sent: Friday, May 30, 2003 11:37 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to question.
Hi,
I am a little confused with something that I am trying to implement (if you
want to see the code tell me, but its pretty simple so i dont think you will
need to) heres the idea, I want the client to be able to save up his choice
into his account
eg:
his choice is 5 records (which transalates to me just saving the sql for
those 5 records into his account)
heres my problem, I am trying to make it so that if he tries to save his 5
records and he has not already logged in, he should be presented with the
login page (have done this via sessions) *BUT* after he logs in he does not
have to pick the 5 records all over again, it should remember his 5 records
and automatically put it in.
eg:
1.guy come to site and picks 5 records (he is not logged in)
2. gets redirected to the login page (but his 5 records or the sql for the
five records are saved....how i dont know)
3.he logs in and the sql is entered into his accounts database for use later
on.
Sorry if that sounded confusing but if you get what i am trying to say you
will see that its not really.
Thanks for your help,
-Ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi
My path_info variable adds on to the current URL so the paht_info lose track
every time a click on the link , like this...
(myscript = myscript.php)
myscript/public/main.html
myscript/public/main.html/myscript/public/main.html
myscript/public/main.html/myscript/public/main.html/myscript/public/main.htm
l .... etc
the URL gets bigger and bigger!!!???
tanks in advance
/Tobias Martelius
--- End Message ---
--- Begin Message ---
Greetings learned PHP(eople),
I just downloaded and installed the Zend Studio trial package as I`m
tired of usign vim for all my PHP stuff, and during the install process
it asked if I wanted a shortcut/link placed on the desktop (Manrake 9.1
running here).
I said yep, and install finished.
Now I closed the app down but can`t find a way to start it up again. My
desktop contains no link.
Any ideas ?
Regards
Chris
--- End Message ---
--- Begin Message ---
Like just go to the folder where you installed it and run?
"Chris Blake" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Greetings learned PHP(eople),
>
> I just downloaded and installed the Zend Studio trial package as I`m
> tired of usign vim for all my PHP stuff, and during the install process
> it asked if I wanted a shortcut/link placed on the desktop (Manrake 9.1
> running here).
>
> I said yep, and install finished.
>
> Now I closed the app down but can`t find a way to start it up again. My
> desktop contains no link.
>
> Any ideas ?
>
> Regards
>
> Chris
>
--- End Message ---
--- Begin Message ---
Chris Blake wrote:
Any ideas ?
From: http://www.zend.com/install_instruct.php:
To start the ZDE (Zend Development Environment), run the zde in the
directory where you installed it (typically, /usr/local/Zend/bin)
Looks like you'll have to create your own shortcut (advice on how to is
beyond the scope of this list). Perhaps you should write them an e-mail
detailing your problems?
Regards,
David
--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625
Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
--- End Message ---
--- Begin Message ---
Howdy David,
I also got this info from Zends`site, but can`t find the file to run.
I also checked around on their FAQ`s but found nothing related to my
problem.
I`ll send them mail to get it sorted, just thought someone knew
off-the-bat what to do.
Many thanks for replying, much appreciated.
Regards
Chris
On Fri, 2003-05-30 at 13:24, David Grant wrote:
> Chris Blake wrote:
> > Any ideas ?
>
> From: http://www.zend.com/install_instruct.php:
>
> To start the ZDE (Zend Development Environment), run the zde in the
> directory where you installed it (typically, /usr/local/Zend/bin)
>
> Looks like you'll have to create your own shortcut (advice on how to is
> beyond the scope of this list). Perhaps you should write them an e-mail
> detailing your problems?
>
> Regards,
>
> David
>
> --
> David Grant
> Web Developer
>
> [EMAIL PROTECTED]
> http://www.wiredmedia.co.uk
>
> Tel: 0117 930 4365, Fax: 0870 169 7625
>
> Wired Media Ltd
> Registered Office: 43 Royal Park, Bristol, BS8 3AN
> Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
>
> Company registration number: 4016744
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> **********************************************************************
>
--- End Message ---
--- Begin Message ---
I am wanting one field on a table in one of my MYSQL databases to contain different
dates and times as a epoch timestamps.
Firstly how do I convert a particular time and date which the user will enter on the
website into the epoch timestamp.
And secondly, how do I convert it back once taken of the table. I'd like to use the
date function to print out this particular date and time- for example $a = date('g:IA
l, jS F, Y') so that $a could say '7:30PM Saturday, 23rd August, 2003' Does date only
work by outputting the current date or time? Can you get it to output the format of
any date and time you would like?
I'd be grateful for any help!
Ian Gray
--- End Message ---
--- Begin Message ---
Ian Gray wrote:
I am wanting one field on a table in one of my MYSQL databases to contain different dates and times as a epoch timestamps.
You're better off storing as a DATETIME field -- it has limits from
1000-01-01 to 9999-12-31, instead of 1970 to 2037..
Firstly how do I convert a particular time and date which the user will enter on the website into the epoch timestamp.
You need to use mktime() if you are getting the individual time segments
(e.g. hour, minute, date, month).
And secondly, how do I convert it back once taken of the table. I'd like to use the date function to print out this particular date and time- for example $a = date('g:IA l, jS F, Y') so that $a could say '7:30PM Saturday, 23rd August, 2003' Does date only work by outputting the current date or time? Can you get it to output the format of any date and time you would like?
The date() function accepts a second parameter, which is a UNIX
timestamp of your choice.
Regards,
David
--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625
Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
--- End Message ---
--- Begin Message ---
If you'd bothered to RTFM, you'd know both answers already. strtotime()
for number one, and date() accepts an optional second argument (the
timestamp).
Ian Gray wrote:
I am wanting one field on a table in one of my MYSQL databases to contain different dates and times as a epoch timestamps.
Firstly how do I convert a particular time and date which the user will enter on the website into the epoch timestamp.
And secondly, how do I convert it back once taken of the table. I'd like to use the date function to print out this particular date and time- for example $a = date('g:IA l, jS F, Y') so that $a could say '7:30PM Saturday, 23rd August, 2003' Does date only work by outputting the current date or time? Can you get it to output the format of any date and time you would like?
I'd be grateful for any help!
Ian Gray
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt
to decrypt it will be prosecuted to the full extent of the law.
--- End Message ---
--- Begin Message ---
> I am wanting one field on a table in one of my MYSQL databases to
contain
> different dates and times as a epoch timestamps.
>
> Firstly how do I convert a particular time and date which the user
will
> enter on the website into the epoch timestamp.
$db_timestamp = strtotime($user_input);
> And secondly, how do I convert it back once taken of the table. I'd
like
> to use the date function to print out this particular date and time-
for
> example $a = date('g:IA l, jS F, Y') so that $a could say '7:30PM
> Saturday, 23rd August, 2003' Does date only work by outputting the
> current date or time? Can you get it to output the format of any date
and
> time you would like?
$a = date('g:IA l, jS F, Y',$db_timestamp)
---John Holmes...
--- End Message ---
--- Begin Message ---
I found one small site (designed in php of course:)) what care about
registration on search engines and search engine optimalization here:
http://submit.prolidi.net/en/
I found some of the information very helpful, so I send it to you.
L.
--- End Message ---