|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 24 Jun 2004 17:38:48 -0000 Issue 2840
php-general-digest-help
lists.php.net
Date: Thu Jun 24 2004 - 12:38:48 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 24 Jun 2004 17:38:48 -0000 Issue 2840
Topics (messages 188929 through 188979):
Re: Php survey+database
188929 by: Joel Kitching
Object Oriented Programming in PHP
188930 by: Eric Marden
188931 by: Chris Shiflett
188957 by: Eric Marden
Re: SQL Case sensitivity
188932 by: Evan Nemerson
Re: Sort a text string by last word before separator
188933 by: Evan Nemerson
Re: issue with inheriting private property from abstract class in php5rc3
188934 by: Marek Kilimajer
Holding links in a database
188935 by: Shaun
188945 by: Jay Blanchard
188946 by: webmaster.jnsolutions.co.uk
188948 by: Jay Blanchard
Re: TIFF display problem...
188936 by: Richard Harb
188937 by: Richard Harb
Site changes
188938 by: Thies
Optimize simple file XOR code
188939 by: Marcus Johansson
188942 by: Marcel Tschopp
188947 by: Marcus Johansson
188964 by: Curt Zirzow
188965 by: Curt Zirzow
Multipart Email Problem
188940 by: Matt MacLeod
188941 by: Alister Bulman
ibill.com
188943 by: Syed Ghouse
188959 by: Eric Marden
Re: PHP+GD on FreeBSD 5.1
188944 by: Jay Blanchard
max upload size
188949 by: me2resh
188952 by: raditha dissanayake
R: [PHP] Holding links in a database
188950 by: Alessandro Vitale
188953 by: Jason Wong
188955 by: Steve Douville
Posting Data to MySQL
188951 by: Tom Chubb
188956 by: Robert Sossomon
188958 by: Tom Chubb
188961 by: Eric Marden
188962 by: Eric Marden
Hidden message
188954 by: Hatchman
Re: Determine whether $_GET has a value
188960 by: Brent Baisley
188963 by: Anguz
188972 by: Chris Shiflett
CMS for a Intranet
188966 by: WebMaster. Radio ECCA
188968 by: Jason Wong
Re: here
188967 by: kris.koehntopp.de
sceen grab
188969 by: Matthew Holmen
188970 by: Jay Blanchard
188971 by: Matt Matijevich
Search and replace a String in a file.
188973 by: Eric L. Sammons
188975 by: Jay Blanchard
188978 by: Justin Patrin
Re: MHTML in email
188974 by: Juan Pablo Herrera
substr_count
188976 by: Gabe
188977 by: Matt Matijevich
a 4 days diary
188979 by: Pierre
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
I think he wants us to tell him how to set up PHP and a database, and
then write some PHP code to add survey results to the database. So,
get on it!
On Thu, 24 Jun 2004 13:07:28 +1000, Ligaya Turmelle <lig
mgpt.com> wrote:
>
> So what is your question.
>
> Respectfully,
> Ligaya Turmelle
>
> "Tommie Ramirez.Andujar" <tommie
ispcmw.rimed.cu> wrote in message
> news:200406231143.i5NBhM531059
servercom.rimed.cu...
>
>
> > Dear colleagues..
> >
> > I am new to php and I am trying to do the following, to create a php file
> > that may contain some kind of form or survey and the data entered may be
> > added to a database...
> > Here the code of the html form
> >
> > -----
> > <html>
> > <head>
> > <title>Survey</title>
> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> > </head>
> >
> > <body>
> > <p ><strong>Survey</strong></p>
> > <form action="" method="post" name="importance" id="importance">
> > <table width="605" border="0">
> > <tr>
> > <td ><strong>Is reading important? </strong></td>
> > </tr>
> > <tr>
> > <td > yes
> > <input name="radiobutton" type="radio" value="radiobutton"></td>
> > </tr>
> > <tr>
> > <td >no
> > <input name="radiobutton" type="radio" value="radiobutton"></td>
> > </tr>
> > <tr>
> > <td >maybe
> > <input name="radiobutton" type="radio" value="radiobutton"></td>
> > </tr>
> > <tr>
> > <td >i don't know
> > <input name="radiobutton" type="radio" value="radiobutton"></td>
> > </tr>
> > <tr>
> > <td >¿Why? </td>
> > </tr>
> > <tr>
> > <td ><textarea name="textarea" cols="85" rows="5" ></textarea></td>
> > </tr>
> > </table>
> > </form>
> > <br>
> > </body>
> > </html>
> > ----
> >
> >
> > ______________________________
> > msc. tomas alberto ramirez.andujar
> > webmaster - cejisoft - +53 32 26 24 51
> > universidad pedagogica jose marti. camaguey
> > circunvalacion norte km 51/2 cp 74670. cuba
> > email : tommie
ispcmw.rimed.cu
> > url: http://www.esicm.cu/cejisoft
> >
> >
> >
> > ............................................................
> > Este mensaje ha sido analizado por MDaemon Antivirus v2.21.
> > Instituto Superior Pedagógico de Camaguey, Cuba.
>
>
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
I'm interested in getting up to speed on OOP in PHP.... can anyone
recommend some good titles for me to pick up?
Thanks!
---
eric marden
http://xentek.net
---
attached mail follows:
--- Eric Marden <xenlab
gmail.com> wrote:
> I'm interested in getting up to speed on OOP in PHP.... can anyone
> recommend some good titles for me to pick up?
George Schlossnagle gave a good talk on this last night at NYPHP. His
slides aren't up yet, but they should appear here soon:
http://www.schlossnagle.org/~george/talks/
If you want to buy a book, his Advanced PHP Programming is a good title:
http://www.amazon.com/exec/obidos/ASIN/0672325616/ref%3Dnosim/chrisshiflett-20
Another good one is Upgrading to PHP 5 by Adam Trachtenberg, which should
be available in a few weeks and specifically explains OOP in terms of
what's different:
http://www.amazon.com/exec/obidos/ASIN/0596006365/ref%3Dnosim/chrisshiflett-20
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/
attached mail follows:
Awesome. I was looking at the Advanced PHP Programming book on amazon,
and so far it looked to be about the only title that covered that.
Thanks for the links to his site / talks, as i'm sure there's some
great info to be gleaned from them too.
I will take a look at picking up his book shortly.
---
eric marden
http://xentek.net
---
> George Schlossnagle gave a good talk on this last night at NYPHP. His
> slides aren't up yet, but they should appear here soon:
> http://www.schlossnagle.org/~george/talks/
> If you want to buy a book, his Advanced PHP Programming is a good title:
> http://www.amazon.com/exec/obidos/ASIN/0672325616/ref%3Dnosim/chrisshiflett-20
attached mail follows:
http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html should do the trick,
provided you're using MySQL.
On Wednesday 23 Jun 2004 20:14, Gabe wrote:
> I hope I don't get too chastised for a double post ( posted in .db first
> ), but I'm hoping someone can help me.
>
> I'm using PHP with ADOdb ( and an MS Access 2000 db ) to write a simple
> SQL statement but was running into some case sensitivity issues. Here's
> my SQL currently:
>
> SELECT autoQuesID,fldQuesTitle,fldBody
> FROM tblFAQ_Question
> WHERE fldBody LIKE '%$strSearchFor%';
>
> All I'm trying to do is have the users search string searched for in the
> "fldBody" field. However, I'm having problems trying to get it so that
> the search is case-insensitive. For instance:
>
> If I search on "Airline", I get 1 record.
> If I search on "airline", I get 0 records.
>
> I make the value of $strSearchFor lower case ( using strtolower() ), but
> I don't know how to get it so that the contents of the "fldBody" field
> is lower case also. I can't seem to find any functions or operators
> that remove the case-sensitivity. However, I have tried this where
> clause to no avail:
>
> WHERE LCase(fldBody) LIKE '%$strSearchFor%'
>
> Any help would be much appreciated!
--
Evan Nemerson
evan
coeus-group.com
http://coeusgroup.com/en
--
"The greatest mistake is to imagine that the human being is an autonomous
individual. The secret freedom which you can supposedly enjoy under a
despotic government is nonsense, because your thoughts are never entirely
your own. Philosophers, writers, artists, even scientists, not only need
encouragement and an audience, they need constant stimulation from other
people. It is almost impossible to think without talking. If Defoe had really
lived on a desert island, he could not have written Robinson Crusoe, nor
would he have wanted to. Take away freedom of speech, and the creative
faculties dry up."
-George Orwell
attached mail follows:
If I were you I'd use preg_match_all() so you get the first and last name as
separate elements, then use usort() to create a custom sorting function based
on strnatcasecmp()
Be careful about middle names and the such.
On Thursday 24 Jun 2004 04:38, Andre Dubuc wrote:
> Given a text string:
>
> $OK = "Joe Blow, William Howard Anser, Hannie Jansen, etc, etc,";
>
> $_SESSION['txt'] = "$OK";
> session_write_close();
> $txt = $_SESSION['txt'];
>
> $sorted = explode(", ", $txt);
> sort($sorted);
> print "$sorted";
>
> results in a sort based on the first name:
>
> "Hannie Jansen, Joe Blow, William Howard Anser, etc, etc"
>
>
> I tried a another function (before_last)
>
> ******
>
> function before ($this, $inthat)
> {
> return substr($inthat, 0, strpos($inthat, $this));
> }
>
> function strrevpos($instr, $needle)
> {
> $rev_pos = strpos (strrev($instr), strrev($needle));
> if ($rev_pos===false) return false;
> else return strlen($instr) - $rev_pos - strlen($needle);
> };
>
> function after_last ($this, $inthat)
> {
> if (!is_bool(strrevpos($inthat, $this)))
> return substr($inthat, strrevpos($inthat, $this)+strlen($this));
> };
>
> function before_last ($this, $inthat)
> {
> return substr($inthat, 0, strrevpos($inthat, $this));
> };
>
> ********
>
> to sort on last name, and it does work, but gives only the last item:
>
> $test2 = between_last(' ', ', ', $OK);
> print "$test2";
>
> "Jansen"
>
> How would I get this 'before_last' function to iterate through the initial
> string, so I could build a sorted list with both first and last names,
> sorted by last name? I can't seem to get a proper 'foreach' statement to
> work, nor a 'while' statement.
>
> I'm really confused. I've read almost every entry on arrays/strings and
> searched code snippets. Almost all focus on one element arrays such "apple,
> orange, peach" rather than 2 or more elements such as "fancy cars, big
> trucks, fast dangerous motorcycles,"
>
> Is it even possible to accomplish this type sort on a string?
>
>
>
> Any advice, pointers, or help will be greatly appreciated,
> Tia,
> Andre
--
Evan Nemerson
evan
coeus-group.com
http://coeusgroup.com/en
--
"If anyone can show me, and prove to me, that I am wrong in thought or deed, I
will gladly change. I seek the truth, which never yet hurt anybody. It is
only persistence in self-delusion and ignorance which does harm."
-Marcus Aurelius
attached mail follows:
Curt Zirzow wrote --- napísal::
> * Thus wrote Marek Kilimajer:
>
>>Chris wrote --- nap?sal::
>>
>>>if anyone can, would you please explain why the below code does what it
>>>does? I would expect $this->test in TestInstance to refer to the
>>>inherited $test from Test. Using php5RC3. Thanks.
>>>
>>><?php
>>>abstract class Test {
>>> private $test;
>>> abstract public function addToTest($i);
>>>}
>>>
>>>class TestInstance extends Test {
>>> public function __construct() {
>>> $this->test = 0;
>>> }
>>
>>...
>>
>>The variable is private for Test, so TestInstance does not have access
>>to it. By assigning 0 to $this->test in the constructor of TestInstance,
>>you create a new property of TestInstance that is public (the default).
>>
>>var_dump() shows it clearly:
>>object(TestInstance)#1 (2) {
>> ["test:private"]=> NULL <---- belongs to Test
>> ["test"]=> int(3) <---- belongs to TestInstance
>>}
>
>
> I think one could argue that that test:private shouldn't even be
> there. To me that test:private would imply that is TestIntance's
> private variable.
>
>
Right, ["Test::test:private"] would be better
attached mail follows:
Hi,
I have created a site that is begining to accumulate a large number of
pages. I have been considering holding links to all pages in a database so
that the sub menus alter dynamically rather than being hand coded. Has
anyone else done this...
Many thanks for your thoughts/comments
attached mail follows:
[snip]
I have created a site that is begining to accumulate a large number of
pages. I have been considering holding links to all pages in a database
so that the sub menus alter dynamically rather than being hand coded.
Has anyone else done this...
[/snip]
Yes.
attached mail follows:
Quoting Jay Blanchard <jay.blanchard
niicommunications.com>:
> [snip]
> I have created a site that is begining to accumulate a large number of
> pages. I have been considering holding links to all pages in a database
> so that the sub menus alter dynamically rather than being hand coded.
> Has anyone else done this...
> [/snip]
>
>
> Yes.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Me too....!!!!!
attached mail follows:
[snip]
Quoting Jay Blanchard <jay.blanchard
niicommunications.com>:
> [snip]
> I have created a site that is begining to accumulate a large number of
> pages. I have been considering holding links to all pages in a
database
> so that the sub menus alter dynamically rather than being hand coded.
> Has anyone else done this...
> [/snip]
>
>
> Yes.
>
Me too....!!!!!
[/snip]
We could start a club, others could join!
attached mail follows:
Are you certain there are no other characters being sent (introduced
by the addition) in the 'body' beside the image?
Will you get any output (characters and all) if you request the image
file directly - without embedding it into a page using <img src or
whatever?
While I have used only the "supported by default" images like jpg, png
and the like, that always turned out to be the problem for me ...
Richard
-----Original Message-----
Sent: Monday, June 21, 2004, 9:43:19 PM
> Hi All,
> I've run into a jam.. I have the follow PHP script:
> <?
> header("Content-type: image/tiff");
> $_GET['id'] = str_replace( ".", "", $_GET['id'] );
> $_GET['id'] = str_replace( "/", "", $_GET['id'] );
> $blah = "/usr/local/apache/chm-images/" . $_GET['id'] . ".A";
> readfile( $blah );
?>>
> This works just fine...
> When I add...
> session_start();
> if ( !$_SESSION['user_id'] )
> {
> exit();
> }
> ...to it, the image does not display.
> What I need to do is read in images from a secured directory and display it
> on the page. I was using JPGs before and now need to display TIFF files.
> We have the plugins for IE all setup. Could someone tell me how I could fix
> this? I'm at a complete loss...
> -Dan Joseph
attached mail follows:
Argh, I see your problem was already solved (answers haven't been
listed as one thread, so I missed em). Oh well.
-----Original Message-----
Sent: Thursday, June 24, 2004, 11:58:15 AM
> Are you certain there are no other characters being sent (introduced
> by the addition) in the 'body' beside the image?
> Will you get any output (characters and all) if you request the image
> file directly - without embedding it into a page using <img src or
> whatever?
> While I have used only the "supported by default" images like jpg, png
> and the like, that always turned out to be the problem for me ...
> Richard
> -----Original Message-----
> Sent: Monday, June 21, 2004, 9:43:19 PM
>> Hi All,
>> I've run into a jam.. I have the follow PHP script:
>> <?
>> header("Content-type: image/tiff");
>> $_GET['id'] = str_replace( ".", "", $_GET['id'] );
>> $_GET['id'] = str_replace( "/", "", $_GET['id'] );
>> $blah = "/usr/local/apache/chm-images/" . $_GET['id'] . ".A";
>> readfile( $blah );
?>>>
>> This works just fine...
>> When I add...
>> session_start();
>> if ( !$_SESSION['user_id'] )
>> {
>> exit();
>> }
>> ...to it, the image does not display.
>> What I need to do is read in images from a secured directory and display it
>> on the page. I was using JPGs before and now need to display TIFF files.
>> We have the plugins for IE all setup. Could someone tell me how I could fix
>> this? I'm at a complete loss...
>> -Dan Joseph
attached mail follows:
attached mail follows:
Hi!
I'm using a very simple algorithm to encrypt files sent from the server
"On Demand". The algorithm uses XOR for the encryption. My problem is
that the code is very slow, it can only process about 40 KB per second
on my system, so my question is, is there any more speed optimized way
to write this code?
Here is my function:
function CryptFile($hash, $filename)
{
// The current position in the key generated below
$key_pos = 0;
// The key used is generated using another function.
// Since this function is only called once it has
// nothing to do with the performance of this function
$key = GenerateKey($hash);
$handle=fopen($filename, "r");
while (!feof($handle))
{
// Set the time limit or the script will time out
// on large files
set_time_limit(30);
$data = fread($handle,8192);
for ($i=0; $i<strlen($data); $i++)
{
// Change the data read from the file by using
// XOR with the key
$data[$i] = $data[$i] ^ $key[$key_pos];
// Calculate the next position in the key
$key_pos=($key_pos+1) % count($key);
}
// Return the encrypted version to the browser
echo $data;
}
}
My guess is that if one should start optimizing the code anywhere, it
would be within the for-loop. Any ideas?
Thanks in advance!
Regards,
Marcus
attached mail follows:
Hi Marcus
Try this:
function CryptFile($hash, $filename)
{
// The key used is generated using another function.
// Since this function is only called once it has
// nothing to do with the performance of this function
$key = GenerateKey($hash);
$keylen = strlen($key = implode('', $key));
$handle = fopen($filename, 'r');
while (!feof($handle))
{
// Set the time limit or the script will time out
// on large files
set_time_limit(30);
$data = fread($handle, 8192);
for ($i = 0; $i < strlen($data); $i = $i + $keylen)
{
$data = substr_replace($data, substr($data, $i, $keylen) ^ $key, $i, $keylen);
}
// Return the encrypted version to the browser
echo $data;
}
}
It should return the same results, but at my machine it is about 30
percent faster.
Cheers
Marcel
> Hi!
>
> I'm using a very simple algorithm to encrypt files sent from the server
> "On Demand". The algorithm uses XOR for the encryption. My problem is
> that the code is very slow, it can only process about 40 KB per second
> on my system, so my question is, is there any more speed optimized way
> to write this code?
>
> Here is my function:
>
> function CryptFile($hash, $filename)
> {
> // The current position in the key generated below
> $key_pos = 0;
>
> // The key used is generated using another function.
> // Since this function is only called once it has
> // nothing to do with the performance of this function
> $key = GenerateKey($hash);
>
> $handle=fopen($filename, "r");
> while (!feof($handle))
> {
> // Set the time limit or the script will time out
> // on large files
> set_time_limit(30);
>
> $data = fread($handle,8192);
> for ($i=0; $i<strlen($data); $i++)
> {
> // Change the data read from the file by using
> // XOR with the key
> $data[$i] = $data[$i] ^ $key[$key_pos];
>
> // Calculate the next position in the key
> $key_pos=($key_pos+1) % count($key);
> }
>
> // Return the encrypted version to the browser
> echo $data;
> }
> }
>
> My guess is that if one should start optimizing the code anywhere, it
> would be within the for-loop. Any ideas?
>
> Thanks in advance!
>
> Regards,
> Marcus
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Wow! That REALLY did make a great difference!
Encoding a file of 2MB took 50 seconds before, now it is done in 1 (ONE)
second!
My Key is 8192 bytes long, is that the reason for why it so much faster
for me?
I don't really get how it works, but I guess I will figure it out.
Thank you very much!
-- Marcus
-----Original Message-----
From: Marcel Tschopp [mailto:marcel.tschopp
gmx.net]
Sent: den 24 juni 2004 13:37
To: php-general
lists.php.net
Subject: Re: [PHP] Optimize simple file XOR code
Hi Marcus
Try this:
function CryptFile($hash, $filename)
{
// The key used is generated using another function.
// Since this function is only called once it has
// nothing to do with the performance of this function
$key = GenerateKey($hash);
$keylen = strlen($key = implode('', $key));
$handle = fopen($filename, 'r');
while (!feof($handle))
{
// Set the time limit or the script will time out
// on large files
set_time_limit(30);
$data = fread($handle, 8192);
for ($i = 0; $i < strlen($data); $i = $i + $keylen)
{
$data = substr_replace($data, substr($data, $i, $keylen) ^ $key,
$i, $keylen);
}
// Return the encrypted version to the browser
echo $data;
}
}
It should return the same results, but at my machine it is about 30
percent faster.
Cheers
Marcel
> Hi!
>
> I'm using a very simple algorithm to encrypt files sent from the
> server "On Demand". The algorithm uses XOR for the encryption. My
> problem is that the code is very slow, it can only process about 40 KB
> per second on my system, so my question is, is there any more speed
> optimized way to write this code?
>
> Here is my function:
>
> function CryptFile($hash, $filename)
> {
> // The current position in the key generated below
> $key_pos = 0;
>
> // The key used is generated using another function.
> // Since this function is only called once it has
> // nothing to do with the performance of this function
> $key = GenerateKey($hash);
>
> $handle=fopen($filename, "r");
> while (!feof($handle))
> {
> // Set the time limit or the script will time out
> // on large files
> set_time_limit(30);
>
> $data = fread($handle,8192);
> for ($i=0; $i<strlen($data); $i++)
> {
> // Change the data read from the file by using
> // XOR with the key
> $data[$i] = $data[$i] ^ $key[$key_pos];
>
> // Calculate the next position in the key
> $key_pos=($key_pos+1) % count($key);
> }
>
> // Return the encrypted version to the browser
> echo $data;
> }
> }
>
> My guess is that if one should start optimizing the code anywhere, it
> would be within the for-loop. Any ideas?
>
> Thanks in advance!
>
> Regards,
> Marcus
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Just to speed things up a little more...
* Thus wrote Marcel Tschopp:
> ...
> $key = GenerateKey($hash);
> $keylen = strlen($key = implode('', $key));
>
> $handle = fopen($filename, 'r');
> while (!feof($handle))
> {
> // Set the time limit or the script will time out
> // on large files
> set_time_limit(30);
>
> $data = fread($handle, 8192);
// read in the $keylen amount
$data = fread($handle, $keylen);
> for ($i = 0; $i < strlen($data); $i = $i + $keylen)
> {
> $data = substr_replace($data, substr($data, $i, $keylen) ^ $key, $i, $keylen);
> }
>
> // Return the encrypted version to the browser
> echo $data;
// then all the above becomes usless..
echo $data ^ $key
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
* Thus wrote Marcus Johansson:
> Wow! That REALLY did make a great difference!
> Encoding a file of 2MB took 50 seconds before, now it is done in 1 (ONE)
> second!
>
> My Key is 8192 bytes long, is that the reason for why it so much faster
> for me?
Most likely because the number crunching is happening in C instead
of the php code.
> I don't really get how it works, but I guess I will figure it out.
It's taking advanatge to the xor'ing of strings:
echo 'hallo' ^ 'hello';
php will xor each corresponding byte in the string, so your output
will be (in binary)
04000
HTH,
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
I have a script that sends a multipart email from a php page.
The script appears to work fine on my mail client (Mail on Mac OSX) and
on an online email reader (mail2web.com).
However a colleague using Outlook on Windows 2003 views the whole email
(ie the raw code - both the text only and the HTML) and when I sent an
email to his hotmail account, hotmail simply displayed a blank page.
My client is getting quite frantic about this so if anyone has any
suggestions, I'd be very grateful.
This is the script I am using:
$to="Matt MacLeod <matt
bigbarn.co.uk>";
$from="Vinciane Rycroft <vinciane
london21.org>";
$subject="London 21 Newsletter";
$mime_boundary="==Multipart_Boundary_x".md5(mt_rand())."x";
$headers = "From: $from\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type:multipart/alternative;\n" .
" boundary=\"{$mime_boundary}\r\n\"";
$headers.= "From: $from\r\n";
$message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$nonhtml ."\n" .
"--{$mime_boundary}\n" .
"Content-Type: text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$htmlVersion;
if (mail($to, $subject, $message, $headers))
echo "Message Sent!";
else
echo "Failed to send message.";
attached mail follows:
On Thu, 24 Jun 2004 12:27:17 +0100, Matt MacLeod <matt
bigbarn.co.uk> wrote:
>
> I have a script that sends a multipart email from a php page.
>
> The script appears to work fine on my mail client (Mail on Mac OSX) and
> on an online email reader (mail2web.com).
>
> However a colleague using Outlook on Windows 2003 views the whole email
> (ie the raw code - both the text only and the HTML) and when I sent an
> email to his hotmail account, hotmail simply displayed a blank page.
Sorting out the MIME headers is not easy.
So user http://pear.php.net/package/Mail_Mime to do the hard work.
Alister
attached mail follows:
Hi All
Any body tell me how to use ibill.com payment site for my project
attached mail follows:
Message-ID: <7f9711bd04062407441f080f49
mail.gmail.com>
Date: Thu, 24 Jun 2004 10:44:03 -0400
From: Eric Marden <xenlab
gmail.com>
To: "php-general
lists.php.net" <php-general
lists.php.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Subject: Re: [PHP] ibill.com
> Any body tell me how to use ibill.com payment site for my project
iBill is similar to 2checkout, in the fact that the forms are hosted
on their secure server. Basically, the user launches their purchase
into the iBill site by clicking out of yours.... usually I use a form
button that says continue to payment site, because you have to send
the product ID from your site to match up with a product that you've
set up in iBill so that you get the right infomation being charged for
on the iBill site. Once iBill completes, it can send some confirmation
info back to your site for you to process.
That's kind of a quick overview (from memory) of the process I used on
one of my projects, but it's been a while since i've used iBill.
--
---
eric marden
http://xentek.net
---
attached mail follows:
[snip]
I have been having an extremely difficult getting PHP installed with GD
support on a FreeBSD 5.1 system. While I can get the default GD package
installed, I can't seem to get it installed with JPEG support. Does
anyone know of any good tutorials or instructions for people with basic
general knowledge of FreeBSD?
[/snip]
Here is the configure line for PHP from one of our FreeBSD servers...
'./configure' '--enable-versioning' '--enable-memory-limit'
'--with-layout=GNU' '--with-zlib-dir=/usr' '--disable-all'
'--with-regex=php' '--with-pear' '--with-bz2=/usr' '--enable-calendar'
'--enable-ctype' '--with-curl=/usr/local' '--enable-dba' '--enable-ftp'
'--with-gd' '--enable-gd-native-ttf' '--enable-gd-jis-conv'
'--with-freetype-dir=/usr/local' '--with-jpeg-dir=/usr/local'
'--with-png-dir=/usr/local' '--with-xpm-dir=/usr/local'
'--with-gdbm=/usr/local' '--with-gettext=/usr/local'
'--with-mysql=/usr/local' '--enable-overload' '--with-pcre-regex=yes'
'--enable-posix' '--enable-session' '--enable-tokenizer'
'--with-expat-dir=/usr/local' '--enable-xml' '--with-zip=/usr/local'
'--with-zlib=yes' '--with-apxs=/usr/local/sbin/apxs'
'--prefix=/usr/local' 'i386-portbld-freebsd5.1'
attached mail follows:
hi there
i am trying to make a script to upload files to a specific directory on my
server
i already made it but there is a problem with max file size, i want to
upload files with sizes up to 500 MB
i know that the only solution for this is to use FTP client embeded on the
page
can anyone tell me how to make ftp client in php to upload files with large sizes ?
attached mail follows:
Message-ID: <40DAD532.9090000
raditha.com>
Date: Thu, 24 Jun 2004 19:20:50 +0600
From: raditha dissanayake <jabber
raditha.com>
Reply-To: jabber
raditha.com
MIME-Version: 1.0
To: php-general
lists.php.net
Content-Type: text/plain; charset=us-ascii; formatowed
Content-Transfer-Encoding: 7bit
Subject: Re: [PHP] max upload size
Please do not send html email to any mailing list.
max upload is not the only setting, for a complete list of settings that
you have to edit please see http://www.radinks.com/upload/config.php
FTP with PHP is not a solution either because the file still has to be
uploaded. You might want to look at an FTP or SFTP applet.
--
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
attached mail follows:
I'd like to apply!
A.
-----Messaggio originale-----
Da: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
Inviato: giovedi 24 giugno 2004 14.00
A: webmaster
jnsolutions.co.uk; Shaun
Cc: php-general
lists.php.net
Oggetto: RE: [PHP] Holding links in a database
[snip]
Quoting Jay Blanchard <jay.blanchard
niicommunications.com>:
> [snip]
> I have created a site that is begining to accumulate a large number of
> pages. I have been considering holding links to all pages in a
database
> so that the sub menus alter dynamically rather than being hand coded.
> Has anyone else done this...
> [/snip]
>
>
> Yes.
>
Me too....!!!!!
[/snip]
We could start a club, others could join!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Thursday 24 June 2004 21:14, Alessandro Vitale wrote:
> I'd like to apply!
Jeez. Can we kill this thread now?
If you want to make what you think is a witty comment then at least trim your
post!
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
When pleasure remains, does it remain a pleasure?
*/
attached mail follows:
People with 10+ line sig's shouldn't talk about trimming posts... ;-)
(or did I misunderstand what you meant about trimming posts? lol)
----- Original Message -----
From: "Jason Wong" <php-general
gremlins.biz>
To: <php-general
lists.php.net>
Sent: Thursday, June 24, 2004 9:36 AM
Subject: Re: [PHP] R: [PHP] Holding links in a database
> On Thursday 24 June 2004 21:14, Alessandro Vitale wrote:
> > I'd like to apply!
>
> Jeez. Can we kill this thread now?
>
> If you want to make what you think is a witty comment then at least trim
your
> post!
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> When pleasure remains, does it remain a pleasure?
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
attached mail follows:
I am trying to design a form that posts the data to a DB, but being new to
PHP/MySQL, it takes me ages to hand write the code and I'm sure there must
be an easier way to do it?
My form has 100 fields using 20 rows and 5 columns and it's taking me ages
to write the code for it.
Can anyone advise how they code large forms like that and if you know of any
software to make it easier?
I've searched Google for hours and checked loads of Database scripts on
sites like Hotscripts, but can't find anything.
Thanks,
Tom
attached mail follows:
I actually found the perfect answer to this task in Google Answers.
First you will need to know how your database tables are set up,
secondly you need to figure out field names and such, thirdly you grab
the data from the form and dump it into an insert statement (or update
if the information was in the DB before).
If you pass me some specifics I might be able to give you a hand.
Robert
-----Original Message-----
From: Tom Chubb [mailto:tom
ps-hosting.co.uk]
Sent: Thursday, June 24, 2004 9:19 AM
To: php-general
lists.php.net
Subject: [PHP] Posting Data to MySQL
I am trying to design a form that posts the data to a DB, but being new
to PHP/MySQL, it takes me ages to hand write the code and I'm sure there
must be an easier way to do it? My form has 100 fields using 20 rows and
5 columns and it's taking me ages to write the code for it. Can anyone
advise how they code large forms like that and if you know of any
software to make it easier? I've searched Google for hours and checked
loads of Database scripts on sites like Hotscripts, but can't find
anything. Thanks, Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I have had quite a lot of response from this, so I felt I should elaborate.
Basically, I am a DJ and every week I submit a chart of the Top 20 records I
am playing.
I want a form with 5 columns (Position, Artist, Title, Label, Misc)
And then obviously I am entering that for all 20 tracks. The database table
also has a datepost so I can select from the week ending when I posted them.
Thanks to everyone who has responded.
Tom
-----Original Message-----
From: Robert Sossomon [mailto:robert
gcnorris.com]
Sent: 24 June 2004 15:30
To: 'Tom Chubb'; php-general
lists.php.net
Subject: RE: [PHP] Posting Data to MySQL
I actually found the perfect answer to this task in Google Answers.
First you will need to know how your database tables are set up,
secondly you need to figure out field names and such, thirdly you grab
the data from the form and dump it into an insert statement (or update
if the information was in the DB before).
If you pass me some specifics I might be able to give you a hand.
Robert
-----Original Message-----
From: Tom Chubb [mailto:tom
ps-hosting.co.uk]
Sent: Thursday, June 24, 2004 9:19 AM
To: php-general
lists.php.net
Subject: [PHP] Posting Data to MySQL
I am trying to design a form that posts the data to a DB, but being new
to PHP/MySQL, it takes me ages to hand write the code and I'm sure there
must be an easier way to do it? My form has 100 fields using 20 rows and
5 columns and it's taking me ages to write the code for it. Can anyone
advise how they code large forms like that and if you know of any
software to make it easier? I've searched Google for hours and checked
loads of Database scripts on sites like Hotscripts, but can't find
anything. Thanks, Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
From: Tom Chubb [mailto:tom
ps-hosting.co.uk]
> I am trying to design a form that posts the data to a DB, but being new
> to PHP/MySQL, it takes me ages to hand write the code and I'm sure there
> must be an easier way to do it?
A couple things you can try:
Dreamweaver MX 2004 is very capable of doing simple DB interactions
like the one you're describing. If your form fields are named the same
as your DB fields, a click of the button and DW will match them up for
you and generate the insert statement. There's a little more to it, in
the set up of your development environment, but this is the jist of
it.
Another thing you can try is, breaking your form up into smaller
pages, for more of a 'wizard' interface to the form. This might
actually take longer to code, but on the flip side is, greater
usability for your users, and dealing with the form in more managable
chunks, than it is working with a 1000 line file.
---
eric marden
http://xentek.net
---
attached mail follows:
I got it. So yeah, try dreamweaver, as that might speed up / automate
your production.
The other thing to try is condensing your code, depending on how your
DB is set up.
That is, you can use a simple loop to build the form (you code for one
row of the form, and loop it out 20 times)... name your forms like
this: position[], artist[], title[], etc. etc.
That way when the form is submitted, it will send the data as an array.
then you can loop out the insert code 20 times, and use counter
variable (such as $i ) to point to which one you want... quick
example:
for ($i = 0; $i < 20; $i++) {
$insert = "INSERT into TBL (artist, position, title) VALUES
(".$_POST['artist'][$i].",".$_POST['position'].",".$_POST['title'][$i].")";
}
like i said this is a very quick example, but i wanted to use it to
show you a couple things:
1) using the $i var to point to the branch of the array you are trying
to get at.
2) remember arrays start counting at 0, and the above code will stop
at 19 (0 thru 19 = 20). you can use the same loop to loop out your
form too.
also, you should put the execution of the sql query into the actual
loop, so that it fires off each time, inserting the record. Include
the date on each row of the data, so when you want to get a particular
week, select using the DATE field, and order it by your position
field. This is your easiest bet. Don't try to have a row in the
database that has all 20 of your picks on one line... as that would be
more difficult to code, and would probably kill you on DataBase
performance. not to mention setting up your db like this will make
searching
for individual artists / titles whatever, easier... as you will only
have to reference 1 or 2 columns, and not 20 or 40 per row looking for
a particular artist and / or title.....
Hope this helps.... I know I gave you more theory than code, but this
should get your going in the right direction.
--
---
eric marden
http://xentek.net
---
attached mail follows:
attached mail follows:
This is a thorny topic for some people to grasp. The way I finally
figured it out is that there are three answers to a yes and no
question: yes, no and no answer. Or, to put it in boolean terms
1,0,NULL. It's that third option in a two option multiple choice
question that throws things.
What you may be looking for is the triple equals for comparison, which
works by "typing" the value. For example:
$testVar = NULL;
$testVar == ''; is true
$testVar === ''; is false
$testVar = 0;
$testVar == '0'; is true
$testVar === '0'; is false
$testVar == NULL; is true
$testVar === NULL; is false
Hope that helps a little.
On Jun 23, 2004, at 11:13 PM, Terence wrote:
> Hi,
>
> Say you have a querystring - index.php?myname=joe
>
> To determine whether myname has a value I have come to the following
> conclusions / shortcomings when using one of the following:
>
> ISSET = as long as the variable myname exists it's set, but there's no
> guarantee of a value
>
> !EMPTY = if your name = 0 (zero) then it's considered empty, for all
> else it seems to work
>
> STRLEN = I have found this to be the only sure way to know.
>
> Is there any other way, or should we always use a combination of ISSET
> and STRLEN?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
attached mail follows:
Terence wrote:
> Hi,
>
> Say you have a querystring - index.php?myname=joe
>
> To determine whether myname has a value I have come to the following
> conclusions / shortcomings when using one of the following:
>
> ISSET = as long as the variable myname exists it's set, but there's no
> guarantee of a value
>
> !EMPTY = if your name = 0 (zero) then it's considered empty, for all
> else it seems to work
>
> STRLEN = I have found this to be the only sure way to know.
>
> Is there any other way, or should we always use a combination of ISSET
> and STRLEN?
Wouldn't this work?
if(isset($_GET['var']) && !empty($_GET['var'])){
// do something...
}
Cristian
attached mail follows:
--- Anguz <clavaque
prodigy.net.mx> wrote:
> Wouldn't this work?
>
> if(isset($_GET['var']) && !empty($_GET['var'])){
> // do something...
> }
No, he mentioned that he considers 0 to be acceptable, and this will fail
the empty() test.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/
attached mail follows:
Hi! I´m developing a new intranet for my company and I wonder if there is any CMS package that fulfil my needs.
I´ve used PHP Nuke but I think it isn´t very safe.
I would need a package where creating new modules wew easy.
Which one would you recommend it?
Which one do you use?
Thanks in advance.
attached mail follows:
From: Jason Wong <php-general
gremlins.biz>
To: php-general
lists.php.net
Date: Fri, 25 Jun 2004 00:31:58 +0800
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Message-Id: <200406250031.58877.php-general
gremlins.biz>
Subject: Re: [PHP] CMS for a Intranet
On Thursday 24 June 2004 23:44, WebMaster. Radio ECCA wrote:
> Hi! I´m developing a new intranet for my company and I wonder if there is
> any CMS package that fulfil my needs.
http://marc.theaimsgroup.com/?l=php-general&m8691840605127&w
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
There comes a time in the affairs of a man when he has to take the bull
by the tail and face the situation.
-- W.C. Fields
*/
attached mail follows:
See the file.
attached mail follows:
I am looking for a way to retrieve data from another website, parse
through it and then display it as I would like to. Basically a screen
grab from say espn.com, then I take the data that is there and form it
to fit on my site.
The catch here is that my target is an asp page that requires a login to
get to the page I would like to get to. They do allow for the check
here so i will be remembered next time, but will that work with a php
screen grab.
Any help at all would be appreciated.
Thanks
Matt
attached mail follows:
[snip]
I am looking for a way to retrieve data from another website, parse
through it and then display it as I would like to. Basically a screen
grab from say espn.com, then I take the data that is there and form it
to fit on my site.
The catch here is that my target is an asp page that requires a login to
get to the page I would like to get to. They do allow for the check
here so i will be remembered next time, but will that work with a php
screen grab.
[/snip]
http://www.php.net/curl
attached mail follows:
[snip]
The catch here is that my target is an asp page that requires a login
to
get to the page I would like to get to. They do allow for the check
here so i will be remembered next time, but will that work with a php
screen grab.
[/snip]
http://pear.php.net/package/HTTP_Client
attached mail follows:
Being new to PHP this task seems to be little out of my reach right now. I
wonder if anyone could tell me how, as I read a file, line by line, search for
and then replace a given string?
The lines in the file will appear as such:
Summary: Some Summary
Name: Some-Name
Version: x.x
.
.
.
Basically I will open the file, read its lines one by one and I want to
replace Some-Name with Some-other-Name.
Thank you!
attached mail follows:
[snip]
Being new to PHP this task seems to be little out of my reach right now.
I
wonder if anyone could tell me how, as I read a file, line by line,
search for
and then replace a given string?
Basically I will open the file, read its lines one by one and I want to
replace Some-Name with Some-other-Name.
[/snip]
http://www.php.net/str_replace
attached mail follows:
There's a PEAR package for just this. :-)
http://pear.php.net/package/File_SearchReplace
On Thu, 24 Jun 2004 12:58:08 -0400, Eric L. Sammons <esammons
vt.edu> wrote:
>
> Being new to PHP this task seems to be little out of my reach right now. I
> wonder if anyone could tell me how, as I read a file, line by line, search for
> and then replace a given string?
>
> The lines in the file will appear as such:
>
> Summary: Some Summary
> Name: Some-Name
> Version: x.x
> .
> .
> .
>
> Basically I will open the file, read its lines one by one and I want to
> replace Some-Name with Some-other-Name.
>
> Thank you!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
paperCrane --Justin Patrin--
attached mail follows:
Thank you,
really i need incluided in email body a image (jpg or gif), too see html.
The MHTML file is a idea, but i think that not function with dinamic
content.How can i do this?
Thank you!
Juan
> Hello,
>
> On 06/23/2004 06:15 PM, Juan Pablo Herrera wrote:
>> I need to attach a file extension .mhtml in function mail, but i too
>> need view the content from the body of e-mail.That is everything!
>
> MHTML messages are just HTML messages with alternative plain text
> version in the same body.
>
> You may want to take a look at this class that lets you compose MHTML
> messages easily:
>
> http://www.phpclasses.org/mimemessage
>
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Does anyone know of a way to have this function run case insensitive?
E.g.
$strHaystack = "this iS a tEsT.";
$strNeedle = "is";
$intCount = substr_count( $strHaystack, $strNeedle );
Anyway, to get this to return a count of two? The haystack that I'm
searching in could be just about anything, so I can't rely on upper case
and lower case only ( or even Ucfirst() or Ucwords() ).
Thanks
attached mail follows:
[snip]
Anyway, to get this to return a count of two?
[/snip]
just strtolower or strtoupper both $strHaystack and $strNeedle
attached mail follows:
Hi all,
I have to code a 4 days diary for a client, schedule every 30 mn and with a
system of rdv accepted by mail. I really don't know how to start to draw a
cool diary and to code it correctly to be the most reusable as possible. POO
or not? If you have there any examples of this style of coding this is could
great or just maybe an idea of how I can start my code to have a good one?
Just a good direction and way of coding to not have many surprises...
I hope I was clear
Thx all
Pierre
- image/bmp attachment: vbpireiyph.bmp
- image/bmp attachment: vkpowpuwei.bmp
- plain/text attachment: Norton_AntiVirus_eliminato1.txt
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]