php-general Digest 10 Nov 2002 14:13:49 -0000 Issue 1696
Topics (messages 123642 through 123686):
Re: HTML forms & php 4.2.3 - how to get cvs fix applied
123642 by: Paul Nicholson
Re: Errors and Logging Configuration Options: docref-root
123643 by: Paul Nicholson
Re: Need MENTOR for Fantasy football project
123644 by: Justin French
123646 by: Bob Eldred
Php | Architect Magazine?
123645 by: Nick Oostveen
fopen() using non-standard port
123647 by: Tim Lan
123648 by: Khalid El-Kary
123653 by: Evan Nemerson
date problem
123649 by: Michael P. Carel
123652 by: Maxim Maletsky
converting decimal to fraction and vice versa
123650 by: Michael P. Carel
123665 by: Jason Wong
123674 by: Ernest E Vogelsinger
Re: Automatic Colspan from database data
123651 by: Dhaval Desai
123657 by: Marco Tabini
set_error_handler() Keeps Triggering Errors
123654 by: Monty
123673 by: Ernest E Vogelsinger
Suggestions Please
123655 by: Mike Miller
123661 by: Justin French
123664 by: John Nichel
Function Problem
123656 by: conbud
123658 by: Marco Tabini
123659 by: conbud
123660 by: conbud
123662 by: Maxim Maletsky
123663 by: conbud
123670 by: Ernest E Vogelsinger
how to insert data in mysql
123666 by: Karl James
123671 by: Justin French
123675 by: elybis
123682 by: . Edwin
Re: upload whole direcotry using ftp functions
123667 by: electroteque
123669 by: AKHIL KODALI
123672 by: Justin French
Create associative array from comments by preg
123668 by: Alawi albaity
Unique Identifier String
123676 by: Sebastian A.
123677 by: . Edwin
123680 by: . Edwin
MsWord html
123678 by: Steel
123681 by: . Edwin
Re: php5 features?
123679 by: electroteque
enable CLI
123683 by: Pierre Vaudrey
attachement
123684 by: Oliver Witt
123685 by: Rick Emery
123686 by: Ernest E Vogelsinger
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 ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hey,
Reconfigure php without "--enable-mbstr-enc-trans" and that will fix the
problem.
HTH!
~Paul
On Friday 08 November 2002 06:56 pm, andy wrote:
> I recently updated from 4.2.0 to 4.2.3 - since doing so values submitted
> to php from HTML forms using keys - value="foo[bar]" - get truncated in
> php - example: if I submit "[EMAIL PROTECTED]" it will come out as
> "eight13.com" with a print_r($_POST)
>
> I found these bug reports which say what appears to be the same bug has
> been "fixed in CVS":
>
> http://bugs.php.net/bug.php?id=20024
> http://bugs.php.net/bug.php?id=19829
>
> I'm wondering where to go from this point. I have a production server
> which I need this fixed on.
>
> Is my only choice to checkout the entire branch for the latest version
> 4.2.x? (I'm assuming its branched - I've not looked at any of this yet)
>
> Is there not a patch? Could I just checkout the applicable files?
>
> http://snaps.php.net/ wasn't avilable at the time of writing this -
> possibly it would have given me more information.
>
>
> Apache 1.3.20
> php from source as module
> Mandrake 8
- --
~Paul Nicholson
Design Specialist @ WebPower Design
"The web....the way you want it!"
[EMAIL PROTECTED]
www.webpowerdesign.net
"It said uses Windows 98 or better, so I loaded Linux!"
Registered Linux User #183202 using Register Linux System # 81891
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD4DBQE9zcldDyXNIUN3+UQRArDSAKCRyBACPvmlkvHv5335p5jzNijyQACXaRPA
JTBavZvIutTMj9eHFdu+zA==
=xhW8
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Did you restart apache?
HTH!
~Paul
On Saturday 09 November 2002 03:14 pm, Stefan Schiller wrote:
> I updated my development-server
>
> --> FreeBSD 4.7-REALEASE, Apache/1.3.27 (Port-Build), PHP 4.2.3
> (Port-Build) ...]
>
> After this I found
>
> http://www.php.net/manual/en/ref.errorfunc.php#ini.docref-root
>
> In the manual. I downloaded the manual and changed some config-item
>
> [httpd.conf]
> Alias /manual/ "/XXXXX/XXXX/manual/"
>
> [php.ini]
> docref_roof = /manual/php4_manual
> docref_ext = .html
>
>
> But I noticed no changes!
>
> - is this a future of php ?.?.? ??
>
> - are some configure options needed for the build?
>
> - is it useful, how does it look like?
>
>
> [some more options out php.ini]
> error_reporting = E_ALL
> display_errors = On
> log_errors = On
> html_errors = On
> error_log = "/XXXXXX/YYYYYYYYY/ZZZZZ/php.err"
> docref_roof = /manual/php4_manual
> docref_ext = .html
>
> Best regards
>
> Stefan Schiller
- --
~Paul Nicholson
Design Specialist @ WebPower Design
"The web....the way you want it!"
[EMAIL PROTECTED]
www.webpowerdesign.net
"It said uses Windows 98 or better, so I loaded Linux!"
Registered Linux User #183202 using Register Linux System # 81891
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9zcwODyXNIUN3+UQRAqXDAJ9V0D2msdGLtwL9IxNtEKm+7bzPsQCfdmzr
sE5SgBnX6WgcAT7rm2GrLQ0=
=kibB
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Hi,
This is a big, complex project for a newbie, and I doubt you're going to
find anyone with the time available to give you a hand.
Can I suggest you start by learning some PHP in relation to forms, form
validation, login, sessions, etc etc.
There's a good article by Kevin Yank on sitepoint.com / webmasterbase.com,
which formed the basis of my own user/login/member/session library which
I've used on many projects. http://www.WebmasterBase.com/article/319 You'll
need register globals ON in your php.ini from memory.
Then, get stuck into form validation and database design...
But please, please, PLEASE stop emailing the same massive emails asking very
non-specific questions, and looking for help... this list works best when
dealing with small, specific problems like "where can I find a good article
on member/session management" NOT "how do I build an entire website".
My suggestion would be to start with a smaller project (like a
search/edit/add/delete/categorise system to catalogue your CD collection),
or pay someone to work on it with you, and teach you as they go. As you
learn more about the principals, you'll learn the best way(s) to approach
larger projects, like the one you describe.
Justin
on 09/11/02 3:34 AM, Karl James ([EMAIL PROTECTED]) wrote:
> Ok here is what I need help with
>
> I need help with how to set up the layout of this project
>
> 1st I know I need a create account page for owners to create
> there username and password.
>
> Then once they successfully filled in the form they are logged in
> And taken to the Team choice page..
>
> Then once you click that you are taken two your team page.
> Their you can view all team stats, Roster, and Schedules
> For NFL and Fantasy Team Schedule
>
> Then you would have links on your team page
> That would be like
> Claim
> Drop
> Trade
> Submit starters
>
> Claim
> Would take you to a page that showed you all of the available players,
> with there stats and bye week.
> You would then choose your player by checking the box to the right of
> the total stats column.
> Once you hit claim is one of the hard parts for me.
>
> The player claim after selecting him and hitting saved. Will have a
> decision of being added to the roster or denied added to roster, there
> are three ways that are denied. 1.over roster size 2. over salary cap
> 3. after deadline.
>
> If over Roster size you are take to Roster to drop player to get under
> rosters size
> Then take back to the page to claim player then hit claim on player and
> save and the transaction is completed. This is the same thing for the
> salary cap if decision is
> Under $40.000.00.
>
> This is a major problem for me. Im not sure how to link all of this
> together.
> I Can create normal pages and tables and forms. But the paths and php
> code I need
> Help with..
>
> Drop
> You can always just drop a player and his name would appear on the free
> agent list in real time fashion.
> I want all this to be done I Real time fashion and also I want emails
> sent to me as they were done. And completed.
>
> Trades
> Trades can happen the same way has the rules 1 2 3 for claim players
> They have to meet all criteria.
> But the interface I want side by side teams and owners be able to choose
> the players and hit check and save..
>
> If met all criteria it happens and I get email. Then you see the players
> traded on there new Teams.
>
> Submit starters
> Can be a table with check boxes and hit save total players aloud to
> start we can determine when site is made
> Then once you hit save you are back at you team page. But it has to be
> in before you league deadline.
> Once starters are submitted I want owners to be able to go to a page to
> view all starters that all owners did for that week.
>
>
> And I need to have all these issues done in real time.
>
> And my database is setup in mysql
> Would any want to help me with this please get with me asap
> I need to be able to talk to you thru the end and make sure I do shit
> right.
> I want to do all the work, just need a teacher. Please any help would be
> greatly appreciated.
> Please email back
> Sincerely Karl James
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
--------------------
Creative Director
http://Indent.com.au
--------------------
--- End Message ---
--- Begin Message ---
So experiment. That's exactly how I made my fantasy league stuff work.
Along with a few questions here when I had *specific* issues with code.
Bob
----- Original Message -----
From: "Karl James" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 08, 2002 12:33 PM
Subject: RE: [PHP] Need MENTOR for Fantasy football project
I have the php bible 4 book but it
Doesn’t tell you how to do things all the way
And still leaves with lots of questions.
-----Original Message-----
From: Charles Wiltgen [mailto:lists@;wiltgen.net]
Sent: Friday, November 08, 2002 9:03 PM
To: List ˆ PHP General
Subject: Re: [PHP] Need MENTOR for Fantasy football project
Karl James wrote...
> Would any want to help me with this please get with me asap I need to
be able
> to talk to you thru the end and make sure I do shit right. I want to
do all
> the work, just need a teacher.
As they say, "Just Do It". Ask specific, PHP-related questions as you
have
them. If you don't know anything about using PHP and MySQL, buy one of
the
many fine books available on the subject. Or, you could just pay
someone
to do it for you.
-- Charles Wiltgen
--
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
--- End Message ---
--- Begin Message ---
Has anyone taken a look at this magazine yet (www.phparch.com)? I came
across mention of it on Slashdot earlier today and it looks interesting. I
am considering subscribing but wouldn't mind some feedback about the
overall quality of the publication beforehand.
Nick Oostveen
--- End Message ---
--- Begin Message ---
Is there anyway to use fopen() to open a webpage through a non-standard
port? For example, the webpage I need must be accessed through port 2734
instead of the standard HTTP port 80, and PHP seems to ignore port
information in the URL (e.g. fopen( "http://www.domain.com:2734/..." ); )
Thanks in advance.
Tim
--- End Message ---
--- Begin Message ---
hi,
i suggest that you use CURL, check the PHP manual
if CURL did't help you can use the lower-level PHP sockets extension
also check the PHP manual
khalid
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You can't use fopen, but you can use fsockopen ( php.net/fsockopen ).
$fp = fsockopen ( "www.domain.com", 2734);
fputs($fp, "GET / HTTP/1.0\r\n\r\n");
while ( !feof($fp) )
echo fgets($fp, 256);
CURL is kinda overkill, sockets are overkill and hard to use.
Of course, then you have to worry about headers, but that's easy enough to
overcome... just test each line. The first empty line is the end of the
headers. So wait for the first empty line, set a variable to TRUE...
On Saturday 09 November 2002 08:36 pm, Khalid El-Kary wrote:
> hi,
> i suggest that you use CURL, check the PHP manual
>
> if CURL did't help you can use the lower-level PHP sockets extension
> also check the PHP manual
>
> khalid
>
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
- --
I am convinced that the teaching of the church is in theory a crafty and evil
lie, and in practice a concoction of gross superstition and witchcraft
- -Leo Nikolaevich Tolstoy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9ze44/rncFku1MdIRAkBRAJ9C89eQx390eh1khrfq/CdaQjPHgQCfc8sf
oic6DqIPISSeqcWPivZcsJs=
=0D39
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
to all;
--- End Message ---
--- Begin Message ---
say it again?
--
Maxim Maletsky
[EMAIL PROTECTED]
On Sun, 10 Nov 2002 12:37:48 +0800 "Michael P. Carel" <[EMAIL PROTECTED]> wrote:
> to all;
>
--- End Message ---
--- Begin Message ---
hi to all;
is there any way to convert decimal numbers to fraction and fraction to decimal
format. i need to convert the inputed fractional value in the field before inserting
it to the mysql database, such us 1/2 = 0.5 .
thanx in advance.
regards,
mike
--- End Message ---
--- Begin Message ---
On Sunday 10 November 2002 12:45, Michael P. Carel wrote:
> hi to all;
>
> is there any way to convert decimal numbers to fraction and fraction to
> decimal format. i need to convert the inputed fractional value in the field
> before inserting it to the mysql database, such us 1/2 = 0.5 . thanx in
> advance.
Short answer: Yes.
Longer answer: No, not with the built-in functions.
Longest answer: You'll have to write your own functions/class, or find some
existing ones -> www.hotscripts.com, www.phpclasses.org, www.zend.com etc.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
"Card readers? We don't need no stinking card readers."
-- Peter da Silva (at the National Academy of Sciencies, 1965, in a
particularly vivid fantasy)
*/
--- End Message ---
--- Begin Message ---
At 05:45 10.11.2002, Michael P. Carel said:
--------------------[snip]--------------------
>is there any way to convert decimal numbers to fraction and fraction to
>decimal format. i need to convert the inputed fractional value in the field
>before inserting it to the mysql database, such us 1/2 = 0.5 .
--------------------[snip]--------------------
<?php
$in = '1/2';
eval("\$out = (double)$in;");
echo "$in = $out\n";
?>
Needs a lot of work before and after to check if things are right, but I
believe you get the idea...
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
Hi!
Well let's make it simple.. We can see that the following values:
2222211111111111111999999992222
are stored in just one row in 31 different columns.
Bsaed on this if we were to make a table with colspans how would it go..?
Thank you
Dhaval
From: Marco Tabini <[EMAIL PROTECTED]>
To: Dhaval Desai <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] Automatic Colspan from database data
Date: 09 Nov 2002 15:10:39 -0500
Ouch...
well, assuming you have two columns: day_id and value, here's a possible
solution:
$rs = mysql_query ('select day_id, value from my_table order by
day_id');
$a = mysql_fetch_assoc ($rs);
do
{
$i = 1;
$control = $a['value'];
while (($a = mysql_fetch_assoc ($rs)) && $a['value'] == $control)
$i++;
echo '<td colspan=' . $i . '>' . $control . '</td>';
} while ($a);
This is a bit rough and can probably be optimized quite a bit, plus I
can't test it, so I'm not sure that it will work the first time.
Hopefully, it gives you an idea of how it could be done.
If I could make a suggestion without knowing how your system works, I
think you should revisit your database design a little.
Hope this helps,
Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com
On Sat, 2002-11-09 at 14:32, Dhaval Desai wrote:
> Hi!
>
> Well I have 12 table for 2 years which makes it 24 tables named as:
> jan_2002, feb_2002 ...etc dec_2002
> jan_2003, feb_2003 ...etc dec_2003
>
> Each table has fields according to the number of days in the month plus
1
> field as a unique key.
>
> Each registration will create 1 entry in 24 tables each and it can only
be
> modified as 1 entry per registrant per table.
> the fields in each table will take values ranging rom 1-20.
>
> Well that's all about how my tables are in the database.
>
>
> Thank You for your time
>
> Dhaval Desai
>
>
>
>
>
>
>
>
>
> >From: Marco Tabini <[EMAIL PROTECTED]>
> >To: Dhaval Desai <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Automatic Colspan from database data
> >Date: 09 Nov 2002 13:34:20 -0500
> >
> >How is your database organized? you might be able to pull this
> >information from the query by using an appropriate group-by clause.
> >
> >
> >Marco
> >--
> >------------
> >php|architect - The magazine for PHP Professionals
> >The first monthly worldwide magazine dedicated to PHP programmers
> >Check us out on the web at http://www.phparch.com
> >
> >On Sat, 2002-11-09 at 11:57, Dhaval Desai wrote:
> > >
> > >
> > >
> > >
> > > Hi everybody!
> > >
> > >
> > > Well this is how it goes...
> > >
> > > For the month of January there are 31 days...
> > > so there are 2 rows in this table on the top row there are 31
columns
> > > showing 31 days...and in the row below this one we will have to
> > > generate....colspan based on the below information pulled from the
> > > database...
> > >
> > > 2222211111111111111999999992222
> > >
> > >
> > > in the above case we will have to get a colspan as follows:
> > > <tr>
> > > <td colspan="5"> 2 </td>
> > > <td colspan="15"> 1 </td>
> > > <td colspan="8"> 9 </td>
> > > <td>colspan="4"> 2 </td>
> > > </tr>
> > >
> > >
> > > This is all I want to do....I know it is difficult...but still
waiting
> >for
> > > some genius!
> > >
> > >
> > > Thank You!
> > > Dhaval
> > >
> > >
> > > _________________________________________________________________
> > > Add photos to your messages with MSN 8. Get 2 months FREE*.
> > > http://join.msn.com/?page=features/featuredemail
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
>
>
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> --
> 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
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
--- End Message ---
--- Begin Message ---
Dhaval,
did you try the code I sent you?
Marco
On Sat, 2002-11-09 at 23:59, Dhaval Desai wrote:
> Hi!
>
>
> Well let's make it simple.. We can see that the following values:
>
> 2222211111111111111999999992222
> are stored in just one row in 31 different columns.
>
> Bsaed on this if we were to make a table with colspans how would it go..?
>
>
> Thank you
>
> Dhaval
>
>
>
>
>
>
>
>
>
> >From: Marco Tabini <[EMAIL PROTECTED]>
> >To: Dhaval Desai <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Automatic Colspan from database data
> >Date: 09 Nov 2002 15:10:39 -0500
> >
> >Ouch...
> >
> >
> >well, assuming you have two columns: day_id and value, here's a possible
> >solution:
> >
> >$rs = mysql_query ('select day_id, value from my_table order by
> >day_id');
> >$a = mysql_fetch_assoc ($rs);
> >
> >do
> >{
> > $i = 1;
> > $control = $a['value'];
> >
> > while (($a = mysql_fetch_assoc ($rs)) && $a['value'] == $control)
> > $i++;
> >
> > echo '<td colspan=' . $i . '>' . $control . '</td>';
> >} while ($a);
> >
> >This is a bit rough and can probably be optimized quite a bit, plus I
> >can't test it, so I'm not sure that it will work the first time.
> >Hopefully, it gives you an idea of how it could be done.
> >
> >If I could make a suggestion without knowing how your system works, I
> >think you should revisit your database design a little.
> >
> >Hope this helps,
> >
> >
> >Marco
> >
> >--
> >------------
> >php|architect - The magazine for PHP Professionals
> >The first monthly worldwide magazine dedicated to PHP programmers
> >Check us out on the web at http://www.phparch.com
> >
> >On Sat, 2002-11-09 at 14:32, Dhaval Desai wrote:
> > > Hi!
> > >
> > > Well I have 12 table for 2 years which makes it 24 tables named as:
> > > jan_2002, feb_2002 ...etc dec_2002
> > > jan_2003, feb_2003 ...etc dec_2003
> > >
> > > Each table has fields according to the number of days in the month plus
> >1
> > > field as a unique key.
> > >
> > > Each registration will create 1 entry in 24 tables each and it can only
> >be
> > > modified as 1 entry per registrant per table.
> > > the fields in each table will take values ranging rom 1-20.
> > >
> > > Well that's all about how my tables are in the database.
> > >
> > >
> > > Thank You for your time
> > >
> > > Dhaval Desai
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > >From: Marco Tabini <[EMAIL PROTECTED]>
> > > >To: Dhaval Desai <[EMAIL PROTECTED]>
> > > >CC: [EMAIL PROTECTED]
> > > >Subject: Re: [PHP] Automatic Colspan from database data
> > > >Date: 09 Nov 2002 13:34:20 -0500
> > > >
> > > >How is your database organized? you might be able to pull this
> > > >information from the query by using an appropriate group-by clause.
> > > >
> > > >
> > > >Marco
> > > >--
> > > >------------
> > > >php|architect - The magazine for PHP Professionals
> > > >The first monthly worldwide magazine dedicated to PHP programmers
> > > >Check us out on the web at http://www.phparch.com
> > > >
> > > >On Sat, 2002-11-09 at 11:57, Dhaval Desai wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Hi everybody!
> > > > >
> > > > >
> > > > > Well this is how it goes...
> > > > >
> > > > > For the month of January there are 31 days...
> > > > > so there are 2 rows in this table on the top row there are 31
> >columns
> > > > > showing 31 days...and in the row below this one we will have to
> > > > > generate....colspan based on the below information pulled from the
> > > > > database...
> > > > >
> > > > > 2222211111111111111999999992222
> > > > >
> > > > >
> > > > > in the above case we will have to get a colspan as follows:
> > > > > <tr>
> > > > > <td colspan="5"> 2 </td>
> > > > > <td colspan="15"> 1 </td>
> > > > > <td colspan="8"> 9 </td>
> > > > > <td>colspan="4"> 2 </td>
> > > > > </tr>
> > > > >
> > > > >
> > > > > This is all I want to do....I know it is difficult...but still
> >waiting
> > > >for
> > > > > some genius!
> > > > >
> > > > >
> > > > > Thank You!
> > > > > Dhaval
> > > > >
> > > > >
> > > > > _________________________________________________________________
> > > > > Add photos to your messages with MSN 8. Get 2 months FREE*.
> > > > > http://join.msn.com/?page=features/featuredemail
> > > > >
> > > > >
> > > > > --
> > > > > PHP General Mailing List (http://www.php.net/)
> > > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > > >
> > >
> > >
> > > _________________________________________________________________
> > > STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> > > http://join.msn.com/?page=features/junkmail
> > >
> > >
> > > --
> > > 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
>
>
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
When I use set_error_handler('error_function') in my scripts, errors are
constantly being triggered that I've never seen before. If I comment the
handler function out, the errors go away. I have the error reporting set
very loosely: error_reporting (E_ERROR | E_USER_ERROR) - so not sure why it
keeps triggering an error, because the error I keep getting is:
Undefined variable: target
This is the same error message no matter what script I run. I don't even use
a variable named $target anywhere in any of my scripts, so, this is
baffling. And this seems like an E_NOTICE error message, but, I'm only
asking for E_ERROR and E_USER_ERROR notices.
My error handling function is fairly simple. It just loads the error info in
a session var then sends the user to the error page, which reads the error
info from the session vars and displays it.
function show_error($type, $msg, $file, $line, $context) {
// Setup error message in Session var...
$_SESSION['error']['type'] = $type;
$_SESSION['error']['msg'] = $msg;
$_SESSION['error']['file'] = $file;
$_SESSION['error']['line'] = $line;
header("Location:./error_page.php");
}
Anyone have any clues why when I set_error_handler to the above function
errors are being triggered for every page?
Monty
--- End Message ---
--- Begin Message ---
At 06:34 10.11.2002, Monty said:
--------------------[snip]--------------------
>When I use set_error_handler('error_function') in my scripts, errors are
>constantly being triggered that I've never seen before. If I comment the
>handler function out, the errors go away. I have the error reporting set
>very loosely: error_reporting (E_ERROR | E_USER_ERROR) - so not sure why it
It's somewhere in the docs - can't remember where just now, I believe
isomewhere in the user comments for error_handler:
your error_handler gets _all_ type of error,warning,notice, regardless of
the actual setting of error_reporting (which only decides if the
error/warning/notice gets sent to the client or not).
>keeps triggering an error, because the error I keep getting is:
>
> Undefined variable: target
>
>This is the same error message no matter what script I run. I don't even use
>a variable named $target anywhere in any of my scripts, so, this is
>baffling. And this seems like an E_NOTICE error message, but, I'm only
>asking for E_ERROR and E_USER_ERROR notices.
--------------------[snip]--------------------
Might point to a dynamic variable named target:
<?php
error_reporting(E_ALL);
$varname = 'target';
if ($$varname) {
;
}
?>
gets me
Notice: Undefined variable: target in /www/test/test.php on line 4
Do a grep for "target" on your source files.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
Ok I am building a site similar in purpose to elance for a client, and part
of their terms and conditions is no contact info till a bid has been
awarded. So they want all contact info that is posted to be removed on
submission of the bid, and any on site contact between buyer, and provider.
I have been beating my head against the wall trying to think of how to do
this but cannot think of a way, I know the regex() function will probably
be the best way, but how to make it verifiy the info before posting to the
database , is just beyond my creativity:) besides that there are a million
ways to say things, like email for instance, [EMAIL PROTECTED]
somoeone at somplace Dot com
and so on and on for email, phone, web address, instant messenger type
contact.
So I am truning to all of you that have been doing this a whole lot longer
than i have for suggestions.
Any help would be greatly appreciated,
Mike
--- End Message ---
--- Begin Message ---
Programatically, I doubt this can be done... or if it can, it would be one
mother of a regex :) As you've already pointed out, there's a million ways
to write an email address, and something such as an ICQ number can be
written without the word "icq" and some people will still spot it... but to
PHP, it would just look like a long number.
Generally, I've found that the easiest way to achieve a "no contact details"
policy is to have the contents reviewed by a real person before becoming
"valid content". This is the way dating sites and anything else where you
"pay for being connected to another person". I achieved this on one site
by:
1. user submits form
2. basic validation of data is done
3. added to the database, but the "publish" column is set to "false"
4. email is sent with the contents of the post in it to the moderator
5. moderator checks the contents via email, and clicks on one of two links:
a) confirm content ok (clicking on the link fires up the browser, and
sets the "publish" column of the row to "true")
b) not okay -- fires up the browser, showing content in a form, which the
moderator can edit down, and submit
6. content is now validated by the moderator, and "publishable".
To cut down the amount of work the moderator has to do, you can do some
basic validation of the content before it's emailed to the moderator... this
might include spitting back a "sorry, no contact details allowed" message
under some circumstances, eg if the words icq, yahoo, im, msn, email, po,
phone, ph, tel, etc etc are in the text... of course this might cause an
inconvenience to genuine posters... so you'll have assess the benefit.
Good luck,
Justin
on 10/11/02 4:24 PM, Mike Miller ([EMAIL PROTECTED]) wrote:
> Ok I am building a site similar in purpose to elance for a client, and part
> of their terms and conditions is no contact info till a bid has been
> awarded. So they want all contact info that is posted to be removed on
> submission of the bid, and any on site contact between buyer, and provider.
>
> I have been beating my head against the wall trying to think of how to do
> this but cannot think of a way, I know the regex() function will probably
> be the best way, but how to make it verifiy the info before posting to the
> database , is just beyond my creativity:) besides that there are a million
> ways to say things, like email for instance, [EMAIL PROTECTED]
> somoeone at somplace Dot com
> and so on and on for email, phone, web address, instant messenger type
> contact.
>
>
> So I am truning to all of you that have been doing this a whole lot longer
> than i have for suggestions.
>
> Any help would be greatly appreciated,
>
>
> Mike
>
>
--------------------
Creative Director
http://Indent.com.au
--------------------
--- End Message ---
--- Begin Message ---
I'm not big at taking options away from a customer / client / visitor to
my site, but in a case like this, I would. You don't have to worry
about all the different ways people can enter things, if you set the
standards. For example, with the email....
Check it with JavaScript before the form is even submitted, and make
sure it's in the format of '[EMAIL PROTECTED]'. If it isn't, don't
let the form submit, and pop an alert to the visitor reminding them of
the format that their email address must be in. You'll probably also
want to check it on the server side, just in case the person has JS
turned off. The phone number you can break up into 4 input boxes; area
code, prefix, number, extension. Make the first three required, and you
can check with JS that the AC and prefix contain exactally 3 digits, the
number contains exactally 4, and the extension (if present) is only
digits. Again, you'll probably want to check this on the server side
just to make sure.
Basically, make them enter the data the way you want it. Just my $0.02.
Mike Miller wrote:
Ok I am building a site similar in purpose to elance for a client, and part
of their terms and conditions is no contact info till a bid has been
awarded. So they want all contact info that is posted to be removed on
submission of the bid, and any on site contact between buyer, and provider.
I have been beating my head against the wall trying to think of how to do
this but cannot think of a way, I know the regex() function will probably
be the best way, but how to make it verifiy the info before posting to the
database , is just beyond my creativity:) besides that there are a million
ways to say things, like email for instance, [EMAIL PROTECTED]
somoeone at somplace Dot com
and so on and on for email, phone, web address, instant messenger type
contact.
So I am truning to all of you that have been doing this a whole lot longer
than i have for suggestions.
Any help would be greatly appreciated,
Mike
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
Hey
Im trying to create a fucntion in an include file
function db_conn($host,$user,$pass,$dab)
{
$db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db);
}
....
....
In the page ide use:
require('func.inc.php');
db_conn("$host","$user","$pass","$dab");
$result = mysql_query("select * FROM $page",$db);
$myrow = mysql_fetch_array($result);
echo $myrow['general_info'];
...
...
however when I use the db_conn on the webpage I just get a mysql error
saying not a valid resource, so how do I get the db_conn to actually return
the data, ive tried using
function db_conn($host,$user,$pass,$db)
{
$db = mysql_connect("$host", "$user","$pass")mysql_select_db("$db",$db);
return $db
}
and various other thing but still nothing, I have to actually put the echo
statements in the function too to get it to work properlly, any ideas?
--- End Message ---
--- Begin Message ---
Either add
global $db;
as the first line of the function or change your function call to:
$db = db_conn("$host","$user","$pass","$dab");
I assume that $host, $user, $pass and $dab actually contain some correct
values.
Marco
--
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com
On Sun, 2002-11-10 at 01:58, conbud wrote:
> Hey
> Im trying to create a fucntion in an include file
> function db_conn($host,$user,$pass,$dab)
> {
> $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db);
> }
> ....
> ....
> In the page ide use:
> require('func.inc.php');
> db_conn("$host","$user","$pass","$dab");
> $result = mysql_query("select * FROM $page",$db);
> $myrow = mysql_fetch_array($result);
>
> echo $myrow['general_info'];
>
> ...
> ...
> however when I use the db_conn on the webpage I just get a mysql error
> saying not a valid resource, so how do I get the db_conn to actually return
> the data, ive tried using
>
> function db_conn($host,$user,$pass,$db)
> {
> $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$db",$db);
>
> return $db
> }
>
> and various other thing but still nothing, I have to actually put the echo
> statements in the function too to get it to work properlly, any ideas?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hey,
Of course they do, they work if I put the echo in the function its self, but
I dont need the echo in the function.
- Lee
"Marco Tabini" <[EMAIL PROTECTED]> wrote in message
news:1036911387.23753.1054.camel@;localhost.localdomain...
> Either add
>
> global $db;
>
> as the first line of the function or change your function call to:
>
> $db = db_conn("$host","$user","$pass","$dab");
>
> I assume that $host, $user, $pass and $dab actually contain some correct
> values.
>
>
> Marco
> --
> ------------
> php|architect - The magazine for PHP Professionals
> The first monthly worldwide magazine dedicated to PHP programmers
> Check us out on the web at http://www.phparch.com
>
>
>
> On Sun, 2002-11-10 at 01:58, conbud wrote:
> > Hey
> > Im trying to create a fucntion in an include file
> > function db_conn($host,$user,$pass,$dab)
> > {
> > $db = mysql_connect("$host",
"$user","$pass")mysql_select_db("$dab",$db);
> > }
> > ....
> > ....
> > In the page ide use:
> > require('func.inc.php');
> > db_conn("$host","$user","$pass","$dab");
> > $result = mysql_query("select * FROM $page",$db);
> > $myrow = mysql_fetch_array($result);
> >
> > echo $myrow['general_info'];
> >
> > ...
> > ...
> > however when I use the db_conn on the webpage I just get a mysql error
> > saying not a valid resource, so how do I get the db_conn to actually
return
> > the data, ive tried using
> >
> > function db_conn($host,$user,$pass,$db)
> > {
> > $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$db",$db);
> >
> > return $db
> > }
> >
> > and various other thing but still nothing, I have to actually put the
echo
> > statements in the function too to get it to work properlly, any ideas?
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
--- End Message ---
--- Begin Message ---
also I have the function wrong in my original question I have it as
function db_conn($host,$user,$pass,$dab)
{
$db = mysql_connect("$host", "$user","$pass"
mysql_select_db("$dab",$db);
}
and not
function db_conn($host,$user,$pass,$dab)
{
$db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db);
}
"Conbud" <[EMAIL PROTECTED]> wrote in message
news:20021110065837.99825.qmail@;pb1.pair.com...
> Hey
> Im trying to create a fucntion in an include file
> function db_conn($host,$user,$pass,$dab)
> {
> $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db);
> }
> ....
> ....
> In the page ide use:
> require('func.inc.php');
> db_conn("$host","$user","$pass","$dab");
> $result = mysql_query("select * FROM $page",$db);
> $myrow = mysql_fetch_array($result);
>
> echo $myrow['general_info'];
>
> ...
> ...
> however when I use the db_conn on the webpage I just get a mysql error
> saying not a valid resource, so how do I get the db_conn to actually
return
> the data, ive tried using
>
> function db_conn($host,$user,$pass,$db)
> {
> $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$db",$db);
>
> return $db
> }
>
> and various other thing but still nothing, I have to actually put the echo
> statements in the function too to get it to work properlly, any ideas?
>
>
--- End Message ---
--- Begin Message ---
you need to return $db:
function db_conn($host,$user,$pass,$dab)
{
$db = mysql_connect("$host", "$user","$pass"
mysql_select_db("$dab",$db);
return $db;
}
and then use $db = db_conn(,,,);
or make it global:
function db_conn($host,$user,$pass,$dab)
{
blobal $db;
$db = mysql_connect("$host", "$user","$pass"
mysql_select_db("$dab",$db);
}
--
Maxim Maletsky
[EMAIL PROTECTED]
On Sun, 10 Nov 2002 02:16:14 -0500 "conbud" <[EMAIL PROTECTED]> wrote:
> also I have the function wrong in my original question I have it as
> function db_conn($host,$user,$pass,$dab)
> {
> $db = mysql_connect("$host", "$user","$pass"
> mysql_select_db("$dab",$db);
> }
>
> and not
> function db_conn($host,$user,$pass,$dab)
> {
> $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db);
> }
>
>
> "Conbud" <[EMAIL PROTECTED]> wrote in message
> news:20021110065837.99825.qmail@;pb1.pair.com...
> > Hey
> > Im trying to create a fucntion in an include file
> > function db_conn($host,$user,$pass,$dab)
> > {
> > $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db);
> > }
> > ....
> > ....
> > In the page ide use:
> > require('func.inc.php');
> > db_conn("$host","$user","$pass","$dab");
> > $result = mysql_query("select * FROM $page",$db);
> > $myrow = mysql_fetch_array($result);
> >
> > echo $myrow['general_info'];
> >
> > ...
> > ...
> > however when I use the db_conn on the webpage I just get a mysql error
> > saying not a valid resource, so how do I get the db_conn to actually
> return
> > the data, ive tried using
> >
> > function db_conn($host,$user,$pass,$db)
> > {
> > $db = mysql_connect("$host", "$user","$pass")mysql_select_db("$db",$db);
> >
> > return $db
> > }
> >
> > and various other thing but still nothing, I have to actually put the echo
> > statements in the function too to get it to work properlly, any ideas?
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
huh I thought I tried that befoer and it didnt work but this time it worked
good, thanks everyone.
Also whats the difference between $globals['$variable'] and just global
-Lee
"Maxim Maletsky" <[EMAIL PROTECTED]> wrote in message
news:20021110082455.7C29.MAXIM@;php.net...
>
> you need to return $db:
>
> function db_conn($host,$user,$pass,$dab)
> {
> $db = mysql_connect("$host", "$user","$pass"
> mysql_select_db("$dab",$db);
> return $db;
> }
>
> and then use $db = db_conn(,,,);
>
> or make it global:
>
>
> function db_conn($host,$user,$pass,$dab)
> {
> blobal $db;
> $db = mysql_connect("$host", "$user","$pass"
> mysql_select_db("$dab",$db);
> }
>
> --
> Maxim Maletsky
> [EMAIL PROTECTED]
>
>
> On Sun, 10 Nov 2002 02:16:14 -0500 "conbud" <[EMAIL PROTECTED]> wrote:
>
> > also I have the function wrong in my original question I have it as
> > function db_conn($host,$user,$pass,$dab)
> > {
> > $db = mysql_connect("$host", "$user","$pass"
> > mysql_select_db("$dab",$db);
> > }
> >
> > and not
> > function db_conn($host,$user,$pass,$dab)
> > {
> > $db = mysql_connect("$host",
"$user","$pass")mysql_select_db("$dab",$db);
> > }
> >
> >
> > "Conbud" <[EMAIL PROTECTED]> wrote in message
> > news:20021110065837.99825.qmail@;pb1.pair.com...
> > > Hey
> > > Im trying to create a fucntion in an include file
> > > function db_conn($host,$user,$pass,$dab)
> > > {
> > > $db = mysql_connect("$host",
"$user","$pass")mysql_select_db("$dab",$db);
> > > }
> > > ....
> > > ....
> > > In the page ide use:
> > > require('func.inc.php');
> > > db_conn("$host","$user","$pass","$dab");
> > > $result = mysql_query("select * FROM $page",$db);
> > > $myrow = mysql_fetch_array($result);
> > >
> > > echo $myrow['general_info'];
> > >
> > > ...
> > > ...
> > > however when I use the db_conn on the webpage I just get a mysql error
> > > saying not a valid resource, so how do I get the db_conn to actually
> > return
> > > the data, ive tried using
> > >
> > > function db_conn($host,$user,$pass,$db)
> > > {
> > > $db = mysql_connect("$host",
"$user","$pass")mysql_select_db("$db",$db);
> > >
> > > return $db
> > > }
> > >
> > > and various other thing but still nothing, I have to actually put the
echo
> > > statements in the function too to get it to work properlly, any ideas?
> > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
--- End Message ---
--- Begin Message ---
At 08:16 10.11.2002, conbud said:
--------------------[snip]--------------------
>also I have the function wrong in my original question I have it as
>function db_conn($host,$user,$pass,$dab)
>{
>$db = mysql_connect("$host", "$user","$pass"
>mysql_select_db("$dab",$db);
>}
>
>and not
>function db_conn($host,$user,$pass,$dab)
>{
>$db = mysql_connect("$host", "$user","$pass")mysql_select_db("$dab",$db);
>}
--------------------[snip]--------------------
mysql_select_db already opens a connection to the database; you don't need
the mysql_connect() call afterwards.
In your code you have mysql_select_db() as fourth parameter to
mysql_connect(). While the fourth parameter is boolean and won't generate
any error at runtime, it's use- and senseless. The 4th parameter on
mysql_connect specifies if PHP should use an existing link, or create a new
one.
You should decide whether you want to go with mysql_select_db() or
mysql_connect().
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---
--- Begin Message ---
Hello
I was wondering if anyone had a good tutorial on how
To insert data from a form I created to the managers
Table in my database.
Im using mysql and php for this?
--- End Message ---
--- Begin Message ---
Start by reading all the pages in this section:
http://www.php.net/manual/en/tutorial.php
Particularly the forms one.
Now you should know heaps about PHP, variables, forms, etc etc.
Now you need to insert that data into mysql through a PHP script. There are
hundreds of tutorials on this... Kevin Yank gives away the first 4 chapters
of his book on webmasterbase.com...
http://www.WebmasterBase.com/subcats/53
Read Build your own Database Driven Website using PHP & MySQL Part 1 thru to
part 4 -- somewhere along the way he introduces MySQL, the theory behind
relational databases, and how to insert and query a database.
I know, it's a lot reading, but I don't think there's an easy way into
this... I can give you an instant fix example of inserting data, but you
won't understand how or why... to do what you want to achieve in the other
posts, you really should get a firm grip at the start by doing a lot of
reading.
There's also some good starting points on phpbeginner.com, like:
http://www.phpbeginner.com/columns/joel/mysql
http://www.phpbeginner.com/columns/ray/db
http://www.phpbeginner.com/columns/shobhan/guestbook
http://www.phpbeginner.com/columns/scott/authentication
etc etc
Since you want to create users (managers), this will involve sessions and
user management. The link I directed you to in an earlier email
(http://www.WebmasterBase.com/article/319) will provide you with code you
can easily adapt to suit.
Justin
on 10/11/02 9:19 AM, Karl James ([EMAIL PROTECTED]) wrote:
> Hello
>
> I was wondering if anyone had a good tutorial on how
> To insert data from a form I created to the managers
> Table in my database.
>
> Im using mysql and php for this?
>
>
--------------------
Creative Director
http://Indent.com.au
--------------------
--- End Message ---
--- Begin Message ---
> Hello
hello
>
> I was wondering if anyone had a good tutorial on how
> To insert data from a form I created to the managers
> Table in my database.
>
> Im using mysql and php for this?
check out
http://www.hotscripts.com/PHP/Tips_and_Tutorials/Database-Related/
there are some good and simple tutorials
cheers
stefan
--- End Message ---
--- Begin Message ---
Hello,
"Karl James" <[EMAIL PROTECTED]> wrote:
> Hello
>
> I was wondering if anyone had a good tutorial on how
> To insert data from a form I created to the managers
> Table in my database.
>
> Im using mysql and php for this?
>
I googled for "how to insert data in mysql" and I found this tutorial:
http://www.ba814.sfsu.edu/tutorial/tutorial_insert.html
Looks good. You might want to check it out.
- E
--- End Message ---
--- Begin Message ---
was this an answer or a question ?
"Akhil Kodali" <[EMAIL PROTECTED]> wrote in message
news:Pine.LNX.4.44.0211091958120.10474-100000@;gdit.iiit.net...
> Hi,
>
> I there anyway to upload entire directory.
>
> --
> AKHIL K
> 200101009
> Room No. 15
> BH-2
> IIIT
> --------------------------------------------------------------------------
>
> Look at me. My life has no meaning or direction, and I'm happy
>
>
--- End Message ---
--- Begin Message ---
Its a question.
I want to know if there is any method to upload a directory,
If yes, then how.
On Sun, 10 Nov 2002, electroteque wrote:
> was this an answer or a question ?
>
> "Akhil Kodali" <[EMAIL PROTECTED]> wrote in message
> news:Pine.LNX.4.44.0211091958120.10474-100000@;gdit.iiit.net...
> > Hi,
> >
> > I there anyway to upload entire directory.
> >
> > --
> > AKHIL K
> > 200101009
> > Room No. 15
> > BH-2
> > IIIT
> > --------------------------------------------------------------------------
> >
> > Look at me. My life has no meaning or direction, and I'm happy
> >
> >
>
>
>
>
--- End Message ---
--- Begin Message ---
>From the browser window, I believe you can only upload individual files to
the server... you can do multiples at once, but you can't (IMHO) upload an
entire directory off your desktop THROUGH your browser, to the server.
You could .zip, .tar or .sit a folder of course, but then you'd have to
uncompress on the server, which is possible for SOME compression types.
Justin
on 10/11/02 7:30 PM, AKHIL KODALI ([EMAIL PROTECTED]) wrote:
>
>
> Its a question.
> I want to know if there is any method to upload a directory,
> If yes, then how.
>
>
>
>
> On Sun, 10 Nov 2002, electroteque wrote:
>
>> was this an answer or a question ?
>>
>> "Akhil Kodali" <[EMAIL PROTECTED]> wrote in message
>> news:Pine.LNX.4.44.0211091958120.10474-100000@;gdit.iiit.net...
>>> Hi,
>>>
>>> I there anyway to upload entire directory.
>>>
>>> --
>>> AKHIL K
>>> 200101009
>>> Room No. 15
>>> BH-2
>>> IIIT
>>> --------------------------------------------------------------------------
>>>
>>> Look at me. My life has no meaning or direction, and I'm happy
>>>
>>>
>>
>>
>>
>>
>
--------------------
Creative Director
http://Indent.com.au
--------------------
--- End Message ---
--- Begin Message ---
I have comments like that :
<!-- comname1 --!>
value1
<!-- end comname1 --!>
<!-- comname2 --!>
value2
<!-- end comname2 --!>
Now :
How can me get associative array like this
$var["comname1"] = "value1";
$var["comname2"] = "value2";
can any body help me to do that ?
--- End Message ---
--- Begin Message ---
I am currently working on a mySQL site administration system and I need help
on figuring out how I can create a 24 digit letter/number unique identifier
string. I know that I can easily get a random number using a PHP function (I
can remember it off the top of my head) but I also need to create random
letters and then insert them into the number. Here are the steps of the
process:
1. Create a 12 digit random number using a PHP function
2. Create 12 random letters
3. Insert the letters into the number, or the other way around
Result: 1h5l79G05OP65kN61LPs1o6Z
Out of the steps above, I am not sure how to do 2 and 3 and I would greatly
appreciate it if someone could point out for me how to do them.
Thanks in advance.
--- End Message ---
--- Begin Message ---
Hello,
"Sebastian A." <[EMAIL PROTECTED]> wrote:
> I am currently working on a mySQL site administration system and I need
help
> on figuring out how I can create a 24 digit letter/number unique
identifier
> string. I know that I can easily get a random number using a PHP function
(I
> can remember it off the top of my head) but I also need to create random
> letters and then insert them into the number. Here are the steps of the
> process:
>
> 1. Create a 12 digit random number using a PHP function
> 2. Create 12 random letters
> 3. Insert the letters into the number, or the other way around
> Result: 1h5l79G05OP65kN61LPs1o6Z
>
>
> Out of the steps above, I am not sure how to do 2 and 3 and I would
greatly
> appreciate it if someone could point out for me how to do them.
This may not be the best way but you can do it this way:
1. Make sure that the number 1 above is in an array. Then,
2. Make an array of uppercase and lowercase letters, shuffle() them.
3. Get 12 from each. (i.e. by looping thru each and assigning it to another
array, etc.)
4. array_merge() the two resulting arrays.
5. shuffle() again.
Should work...
- E
--- End Message ---
--- Begin Message ---
And btw, you might want to check "User Contributed Notes" dated 04-Nov-2002
@
http://www.php.net/manual/en/function.rand.php
Perhaps you can just add some if...else and you can have the
12-random-digit-12-random-letter-string that you're looking for.
HTH,
- E
--- End Message ---
--- Begin Message ---
Hi php-windows,
Does anybody knows, what regexp can help me remove almost all
M$ Word2000 HTML tags and styles?
Let the Force Be with Yo! ;)
--
The Same,
Steel mailto:asergey@;inbox.ru
http://www.none.ru
--- End Message ---
--- Begin Message ---
Hello,
"Steel" <[EMAIL PROTECTED]> wrote:
> Hi php-windows,
Wrong list :)
> Does anybody knows, what regexp can help me remove almost all
> M$ Word2000 HTML tags and styles?
Perhaps, you can try this class instead:
http://phpclasses.optip.com/browse.html/package/277.html
('Haven't use it though--I just know that it exists...)
- E
--- End Message ---
--- Begin Message ---
well i read somewhere that the zend 2 engine was coming out in 4.3 which had
proper OO capabilities including public and private and maybe even error
exeption handlers but doesnt look good might have to wait a little longer in
the mean time i'm starting to get my head around tomcat ..
"Maxim Maletsky" <[EMAIL PROTECTED]> wrote in message
news:20021109230110.6EC9.MAXIM@;php.net...
>
> Try searching the list archives, particularly of PHP-DEV lists (but
> hesitate asking these questions there)
>
>
> --
> Maxim Maletsky
> [EMAIL PROTECTED]
>
>
> On Sat, 9 Nov 2002 13:27:05 -0800 (PST) ed <[EMAIL PROTECTED]> wrote:
>
> > Hi all. I was wondering if there are resources on the
> > web that will help me get an
> > idea of the changes and new features that will be in
> > php5.
> > I'm particularly interested in what's gonna be added
> > or changed to php in regards to
> > its OOP capabilities.
> >
> > I already love this language. I'm just looking
> > forward to seeing in what areas it is going to be made
> > even better.
> >
> > tia,
> > --ed
> >
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > U2 on LAUNCH - Exclusive greatest hits videos
> > http://launch.yahoo.com/u2
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
--- End Message ---
--- Begin Message ---
I'm running PHP4 on Mac OS 10.2.1 using Marc Liyanage's binaries
compiled with --disable-cli option .Is there any possibility to install
an extension to enable CLI ?
Thanks for your help .
Pierre Vaudrey
email [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi,
I wrote a php script that's supposed to enable me to attach files to an
email. However, the attached files ends up being a mess of letters.
"Hallo" becomes "SGFsbG8=". That must have to do with encoding. Is that
a common problem or do you need the entire script?
Thanks,
Olli
--- End Message ---
--- Begin Message ---
Here is a PHP mail class that handles multiple attachments and several other functions:
<?php
/*
* Notes from [EMAIL PROTECTED] 25 Mar 2000:
* This library based idea of Dan Potter
* Improvements: Multi attachmends in one e-mail, ability to post html & plain trext,
up to
3x speed improved.
* USAGE - mimetype example for attacment
* $m = new CMIMEMail($to,$from,$subject);
* $m->mailbody("This is simply text","<html><body><h1>This is HTML text</h1>");
* $m->attach("example.html","text/html",$filebody);
* $m->attachFile("resume.gif","image/gif");
* $m->send();
* NOTE: if your system have chunk_split function use it.
*******
* To Do:
* 1. Make quoted-printable encoder and use them in makebody;
* 2. Generate right boundaries
* 3. Fix bugs in SMTP send direct futction SMTPsend()
*/
function my_chunk_split($str)
{
$stmp = base64_encode($str);
$len = strlen($stmp);
$out = "";
$done=0;
while( $done<$len ) {
$out.=( $len-$done>76)?substr($strp,$done, 76). "\r\n":substr($strp,$done,
$len-$done). "\r\n";
$done+=76;
}
return $out;
}
class CMIMEMail {
var $to;
var $from;
var $cc;
var $bcc;
var $subject;
var $priority;
var $boundary = "----=_NextPart_000_0009_01BF95E9.CDFD2060";
var $smtp_headers;
var $filename_real;
var $body_plain;
var $body_html;
var $atcmnt;
var $atcmnt_type;
function CMIMEMail($to,$from,$subject,$cc="",$bcc="",$priority=3) {
$this->to=$to; $this->from=$from; $this->subject=$subject;
$this->priority=$priority; $this->cc=$cc; $this->bcc=$bcc;
}
function mailbody( $plain, $html= "" ) {
$this->body_plain=$plain;
$this->body_html=$html;
}
function attach( $name, $content_type, $data ) {
$this->atcmnt[$name]=$data;
$this->atcmnt_type[$name]=$content_type;
}
function attachfile( $fname, $content_type ) {
$name=ereg_replace( "(.+/)", "",$fname);
$f=fopen($name, "r");
$fsz = filesize($name);
$ftext = fread($f,$fsz);
$this->attach($name,$content_type,$ftext);
fclose($f);
}
function clear() {
unset( $this->atcmnt );
unset( $this->atcmnt_type );
}
function makeheader() {
$out = "From: ".$this->from."\nReply-To: ".$this->from. "\n";
if( $this->cc !="") $out .="Cc: ".$this->cc."\n";
if( $this->bcc !="") $out .="Bcc: ".$this->bcc."\n";
$out.= "MIME-Version: 1.0\nContent-Type: multipart/mixed;\n
boundary=\"".$this->boundary. "\"\nX-Priority: ".$this->priority. "\n";
return $out;
}
function makebody() {
$boundary2= "----=_NextPart_001_0009_01BF95E9.CDFD2060";
$out= "";
$out= "\n\n".$this->body_plain. "\n\n";
if( $this->body_html!= "" ) {
$out.= "--".$this->boundary. "\nContent-Type: multipart/alternative;\n
boundary=$boundary2\n\n";
$out.= "$body_plain\n--$boundary2\nContent-Type:
text/plain\nContent-Transfer-Encoding: quoted-printable\n\n".$this->body_plain.
"\n\n--$boundary2\nContent-Type: text/html\n".
"Content-Transfer-Encoding:
quoted-printable\n\n$this->body_html\n\n--$boundary2--\n";
} else {
# $out.= "--".$this->boundary. "\nContent-Type:
text/plain\nContent-Transfer-Encoding:
quoted-printable\n\n".$this->body_plain. "\n\n--".$this->boundary. "\n";
$out.= "--".$this->boundary. "\nContent-Type:
text/plain\nContent-Transfer-Encoding:
quoted-printable\n\n".$this->body_plain. "\n\n";
}
if( ISSET($this->atcmnt_type) )
{
reset( $this->atcmnt_type);
while( list($name, $content_type) = each($this->atcmnt_type) ) {
$out.= "\n--".$this->boundary. "\nContent-Type:
$content_type\nContent-Transfer-Encoding: base64\nContent-Disposition: attachment;
filename=\"$name\"\n\n".
chunk_split(base64_encode($this->atcmnt[$name])). "\n";
} }
$out.= "--".$this->boundary. "--\n";
return $out;
}
function send(){
mail( $this->to, $this->subject, $this->makebody(),$this->makeheader() );
}
function sendto($email,$subj="#"){
if( $subj=="#") $subj= $this->subject;
mail( $email, $subj, $this->makebody(),$this->makeheader() );
}
function SMTPsend($host){
$errno=0;$errstr= "";
// $f=fsockopen("127.0.0.1",25,&$erno, &$errstr);
if(!$f) {
$this->send();
} else {
//SNMP commands Not finished yet
echo fgets($f,512);
fputs($f, "HELO host.com\n");
echo fgets($f,512);
fputs($f, "MAIL FROM: ".$this->from. "\n");
echo fgets($f,512);
fputs($f, "RCPT TO: ".$this->to). "\n";
echo fgets($f,512);
fputs($f, "data\n");
echo fgets($f,512);
fputs($f, "From: ".$this->from. "\nTo: ".$this->to.
"\n".$this->makeheader().$this->makebody(). "\n\n.\n");
fputs($f, "quit\nexit");
fclose($f);
}
}
}
?>
."
----- Original Message -----
From: "Oliver Witt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, November 10, 2002 7:31 AM
Subject: [PHP] attachement
Hi,
I wrote a php script that's supposed to enable me to attach files to an
email. However, the attached files ends up being a mess of letters.
"Hallo" becomes "SGFsbG8=". That must have to do with encoding. Is that
a common problem or do you need the entire script?
Thanks,
Olli
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
At 14:31 10.11.2002, Oliver Witt said:
--------------------[snip]--------------------
>I wrote a php script that's supposed to enable me to attach files to an
>email. However, the attached files ends up being a mess of letters.
>"Hallo" becomes "SGFsbG8=". That must have to do with encoding. Is that
>a common problem or do you need the entire script?
--------------------[snip]--------------------
It seems that you're encoding the file somehow - that's usual, even
required if your file is a binary file (like a picture, or a formatted
document).
In your mail headers, you should see some MIME like
Content-Type: multipart/alternative;
boundary=GU4wuTSk68F
("alternative" could also read "related" - depends on the content, the
"multipart" is the point here)
which would tell the client browser that the next mail consists of a couple
of separate parts, with a separator line as "--GU4wuTSk68F".
Next comes the message entity, which starts with such a separator line, and
a set of MIME headers for the respective entity:
--GU4wuTSk68F
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Content-Type: text/plain
You are receiving this message as a subscriber
to the Just For You Network. To cancel, see the
instructions at the end of this mail.
That's the first part of the mail - it's plain text. The next part would be
an image, and again starts with a boundary:
--GU4wuTSk68F
Content-Type: image/jpeg;
name="sample.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="sample.jpg"
JVBERi0xLjMNJeLjz9MNCjE5OSAwIG9iag08PCANL0xpbmVhcml6ZWQgMSANL08gMjAy
JVBERi0xLjMNJeLjz9MNCjE5OSAwIG9iag08PCANL0xpbmVhcml6ZWQgMSANL08gMjAyIA0vSCBb
IDE2NDUgMjc0IF0gDS9MIDEwOTMzMSANL0UgNzg3MDYgDS9OIDMgDS9UIDEwNTIzMiAN
IDE2NDUgMjc0IF0gDS9MIDEwOTMzMSANL0UgNzg3MDYgDS9OIDMgDS9UIDEwNTIzMiANPj4gDWVu
[...]
RHA0NjcxUFJGbzgtMTZsNDM=
--GU4wuTSk68F
The message should also end with a boundary, but most mail client's omit
this...
For more information consult RFC2045 ff about MIME
ftp://ftp.rfc-editor.org/in-notes/rfc2045.txt
Hope this helps,
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--- End Message ---