|
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 14 Jun 2004 19:41:16 -0000 Issue 2821
php-general-digest-help
lists.php.net
Date: Mon Jun 14 2004 - 14:41:16 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 14 Jun 2004 19:41:16 -0000 Issue 2821
Topics (messages 188197 through 188265):
Re: connecting remote host ..
188197 by: Manoj Nahar
188200 by: Angel Freire
small and big letter in WHERE statement
188198 by: QT
188199 by: Angel Freire
188220 by: John Nichel
188247 by: franciccio
Re: small and big letter in WHERE statement[Scanned]
188201 by: Michael Egan
Array problem
188202 by: Brent Clark
Re: PHP
188203 by: Brent Clark
188204 by: Umesh Deshmukh
[Newbie Guide] For the benefit of new members
188205 by: Ma Siva Kumar
Scheduling a PHP script
188206 by: Phil Ewington - 43 Plc
188208 by: Dennis Freise
188217 by: Phil Ewington - 43 Plc
Re: Combo problems.. Multi Array??
188207 by: Ford, Mike [LSS]
PHP 4.3.7 update - how to
188209 by: Alan McDonald
188212 by: Lester Caine
188213 by: Marek Kilimajer
188214 by: Alan McDonald
188215 by: Marek Kilimajer
188219 by: John Nichel
188222 by: raditha dissanayake
Help with an objective
188210 by: Ryan Schefke
188211 by: Jay Blanchard
188223 by: Dennis Seavers
Regular Expression - it works but uses way too much memory ?
188216 by: Ulrik S. Kofod
Re: Header target?
188218 by: Bob Lockie
188221 by: Marek Kilimajer
converting a char variable to an int?
188224 by: Adam Williams
188225 by: Adam Williams
188226 by: Torsten Roehr
188227 by: Dennis Seavers
188228 by: Marek Kilimajer
188230 by: salah.e-touch.ws
Re: gethostbyaddr
188229 by: Alicia Riggs
Re: Multidimensional Array advice from a newbie
188231 by: Justin Patrin
Re: Cookie Security?
188232 by: Justin Patrin
188234 by: Michal Migurski
188240 by: Justin Patrin
188243 by: Robert Cummings
188244 by: Justin Patrin
188248 by: Marek Kilimajer
188249 by: Paul Fierro
188251 by: Chris
188252 by: Chris
188254 by: Michal Migurski
Function Date
188233 by: Juan Pablo Herrera
188235 by: Sam Masiello
188236 by: Dennis Freise
188237 by: Daniel Clark
188238 by: Richard Davey
PHP CRM
188239 by: Anton Krall
188241 by: John Nichel
Re: creating a nested multidimensional array from a query
188242 by: Justin Patrin
Re: [PHP5] Super constructor?
188245 by: franciccio
188262 by: Justin Patrin
188263 by: Justin Patrin
MapServer and PHP/MapScript
188246 by: René Fournier
Load a frame and work on another?
188250 by: Robert Sossomon
188257 by: Steve Douville
Erroring out?!
188253 by: Robert Sossomon
188255 by: Steve Douville
188256 by: Chris
188258 by: Daniel Clark
188259 by: Robert Sossomon
188260 by: Steve Douville
Re: Problems compiling PHP 5 RC3
188261 by: Luca Spiller
php and CSS
188264 by: Bruno Santos
protecting your source code?
188265 by: Edward Peloke
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:
Hi Gowthaman,
For mysql to allow remove connecivity u have to make entry in mysql
database in tables db, user and host giving the IP of remote PC from
which u want to connect and username and password then reload the
database and It will all work
Manoj
On 14 Jun 2004 10:25:48 +0530, gowthaman ramasamy <gowtham
icgeb.res.in> wrote:
>
> hello list,
> My php script works fine with local mysql database.
> however when try to use some remote database it fails and gives follwing
> error ..
>
> Warning: mysql_connect(): Unknown MySQL Server Host 'http' (2) in
> /usr/local/apache2/htdocs/gowtham/forphp/db_qry_4repeat.php on line 86
>
> the mysql_connect() syntax is as follows ..
> $db=mysql_connect("192.168.1.109", "root", "password");
> 192.168.1.109 is the ip (internal IP on LAN) of the machine hosting the
> database.
>
> thanx a lot in advance ..
>
> --
> Ra. Gowthaman,
> Graduate Student,
> Bioinformatics Lab,
> Malaria Research Group,
> ICGEB , New Delhi.
> INDIA
>
> Phone: 91-9811261804
> 91-11-26173184; 91-11-26189360 #extn 314
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Reloadind database isn't necesary, a flush privileges should be ok.
El lun, 14-06-2004 a las 04:32, Manoj Nahar escribió:
> Hi Gowthaman,
>
> For mysql to allow remove connecivity u have to make entry in mysql
> database in tables db, user and host giving the IP of remote PC from
> which u want to connect and username and password then reload the
> database and It will all work
>
> Manoj
>
>
> On 14 Jun 2004 10:25:48 +0530, gowthaman ramasamy <gowtham
icgeb.res.in> wrote:
> >
> > hello list,
> > My php script works fine with local mysql database.
> > however when try to use some remote database it fails and gives follwing
> > error ..
> >
> > Warning: mysql_connect(): Unknown MySQL Server Host 'http' (2) in
> > /usr/local/apache2/htdocs/gowtham/forphp/db_qry_4repeat.php on line 86
> >
> > the mysql_connect() syntax is as follows ..
> > $db=mysql_connect("192.168.1.109", "root", "password");
> > 192.168.1.109 is the ip (internal IP on LAN) of the machine hosting the
> > database.
> >
> > thanx a lot in advance ..
> >
> > --
> > Ra. Gowthaman,
> > Graduate Student,
> > Bioinformatics Lab,
> > Malaria Research Group,
> > ICGEB , New Delhi.
> > INDIA
> >
> > Phone: 91-9811261804
> > 91-11-26173184; 91-11-26189360 #extn 314
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
attached mail follows:
Dear Sirs,
When I use where statement, I see that there is no meaning small and big
letter. Without looking small caps or big, result comes back. But I want to
match only small letters. How can I do that?
Best REgards
attached mail follows:
I'm guessing that you mean in a SQL sentence.
Well, depending on what SQL engine're you using it's case sensitive or
not.
MySQL don't take diferent case as diferent string, thats why is the
'binary' date type.
In that case you have two alternatives, or change the field type to
binary, or cast it in the where statement.
El lun, 14-06-2004 a las 14:36, QT escribió:
> Dear Sirs,
>
> When I use where statement, I see that there is no meaning small and big
> letter. Without looking small caps or big, result comes back. But I want to
> match only small letters. How can I do that?
>
> Best REgards
attached mail follows:
QT wrote:
> Dear Sirs,
>
> When I use where statement, I see that there is no meaning small and big
> letter. Without looking small caps or big, result comes back. But I want to
> match only small letters. How can I do that?
>
> Best REgards
>
Where statement for what? MySQL? If so, I don't think you can do it on
the SQL end as WHERE is normally case-insensitive. You could use a
regular expression while looping thru your result set.
--
John C. Nichel
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
In case u run under win32
...WHERE REGXEP BINARY fileldname=whatever..
If you run under unix, linux you don't need to do that.
Franciccio
"Qt" <web_tur
yahoo.com> ha scritto nel messaggio
news:20040614073750.22581.qmail
pb1.pair.com...
> Dear Sirs,
>
> When I use where statement, I see that there is no meaning small and big
> letter. Without looking small caps or big, result comes back. But I want
to
> match only small letters. How can I do that?
>
> Best REgards
attached mail follows:
The following may help:
http://dev.mysql.com/doc/mysql/en/Case_sensitivity.html
Cheers,
Michael Egan
-----Original Message-----
From: QT [mailto:web_tur
yahoo.com]
Sent: 14 June 2004 18:36
To: php-general
lists.php.net
Subject: [PHP] small and big letter in WHERE statement[Scanned]
Dear Sirs,
When I use where statement, I see that there is no meaning small and big
letter. Without looking small caps or big, result comes back. But I want to
match only small letters. How can I do that?
Best REgards
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
The information contained in this email (and in any attachments sent with it) is confidential. It is intended for the addressee only. Access to this email by anyone else is unintended and unauthorized.
If you are not the original addressee, 3tc asks you to please maintain confidentiality. If you have received this email in error please notify 3tc immediately by replying to it, then destroy any copies and delete it from your computer system.
Any use, dissemination, forwarding, printing or copying of this email by anyone except the addressee in the normal course of his/her business, is strictly prohibited. 3tc owns the copyright in this email and any document created by us and assert the right to be identified as the author of it. Copyright has not been transferred to the addressee.
We protect our systems with Sophos Anti-virus -
www.sophos.com
attached mail follows:
Hi all
I have this problem whereby im try to create some kind of an array of a
split off a file.
//Here I pull the file in the array $contents.
$contents = file($hotelpathprod.$hotel);
foreach($contents as $arr=>$conts){
$ff[] = split("\|",$conts); //Here im trying to do a split on the file
}
Now this the array $ff is fine, the catch is now, it that, the first element
has a have like "p101".
What I trying to do is do a substr($abc,1) and the take that value and make
that the number of the element I want.
This is what I was going with.
foreach($ff as $qaz=>$wsx){
$ffile[substr($qaz[0],1)]=$qaz[0];
}
If anyone could assist, it would really be appreciated.
Kind Regards
Brent Clark
attached mail follows:
hi
is this a joke
-----Original Message-----
From: Cheung Pui Pan [mailto:cheungpuipan
netvigator.com]
Sent: Wednesday, June 09, 2004 11:03 AM
To: php-general
lists.php.net
Subject: [PHP] PHP
Dear Sir/Madam,
I would like to make a page on which people may add records to a table and
view them (As my web server does not support MYSQL, I may have to do it on
text files). I would also like to sort them by descending order of time. Can
you please tell me which functions are available for the following items I
want to do? If possible, can you write a sample code for me? Thank you for
your time and attention.
* Date / Time
* Name
* E-mail (Check them too please)
* Company
* Vehicle
* Route (Original)
* Route (Now on)
* Notes
Yours faithfully,
Cheung Pui Pan
attached mail follows:
Hi,
You can visit www.phpclasses.org
There are n number of classes given for validation.
Regards,
Umesh.
-----Original Message-----
From: Brent Clark [mailto:bclark
eccotours.biz]
Sent: Wednesday, June 09, 2004 5:28 PM
To: Cheung Pui Pan; php-general
lists.php.net
Subject: RE: [PHP] PHP
hi
is this a joke
-----Original Message-----
From: Cheung Pui Pan [mailto:cheungpuipan
netvigator.com]
Sent: Wednesday, June 09, 2004 11:03 AM
To: php-general
lists.php.net
Subject: [PHP] PHP
Dear Sir/Madam,
I would like to make a page on which people may add records to a table and
view them (As my web server does not support MYSQL, I may have to do it on
text files). I would also like to sort them by descending order of time. Can
you please tell me which functions are available for the following items I
want to do? If possible, can you write a sample code for me? Thank you for
your time and attention.
* Date / Time
* Name
* E-mail (Check them too please)
* Company
* Vehicle
* Route (Original)
* Route (Now on)
* Notes
Yours faithfully,
Cheung Pui Pan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
=======================================
Please feel free to add more points and send
to the list.
=======================================
1. If you have any queries/problems about PHP
try http://www.php.net/manual/en first. You
can download a copy and use it offline also.
Please also try
http://www.php.net/manual/faq.php
for answers to frequently answered questions
about PHP (added by Christophe Chisogne).
2. Try http://www.google.com next. Searching
for "php YOUR QUERY" may fetch you relevant
information within the first 10 results.
3. There is a searchable archive of the
mailing list discussion at
http://phparch.com/mailinglists. Many of the
common topics are discussed repeatedly, and
you may get answer to your query from the
earlier discussions.
For example: One of the repeatedly discussed
question in the list is "Best PHP editor".
Everyone has his/her favourite editor.
You can get all the opinions by going through
the list archives. If you want a chosen list
try this link :
http://www.thelinuxconsultancy.co.uk/phpeditors/
(contributed by Christophe Chisogne).
4. Not sure if PHP is working or you want
find out what extensions are available to
you?
Just put the following code into a file with
a .php extension and access it through your
webserver:
<?php
phpinfo();
?>
If PHP is installed you will see a page with
a lot of information on it. If PHP is not
installed (or not working correctly) your
browser will try to download the file.
(contributed by Teren and reworded by Chris W
Parker)
5. If you are stuck with a script and do not
understand what is wrong, instead of posting
the whole script, try doing some research
yourself. One useful trick is to print
the variable/sql query using print or echo
command and check whether you get what you
expected.
After diagnosing the problem, send the
details of your efforts (following steps 1,
2 & 3) and ask for help.
6. PHP is a server side scripting language.
Whatever processing PHP does takes place
BEFORE the output reaches the client.
Therefore, it is not possible to access
users' computer related information (OS,
screen size etc) using PHP. Nor can you
modify any the user side settings. You need
to go for JavaScript and ask the question in
a JavaScript list.
On the other hand, you can access the
information that is SENT by the user's
browser when a client requests a page from
your server. You can find details about
browser, OS etc as reported by
this request. - contributed by Wouter van
Vliet and reworded by Chris W Parker.
7. Provide a clear descriptive subject line.
Avoid general subjects like "Help!!", "A
Question" etc. Especially avoid blank
subjects.
8. When you want to start a new topic, open a
new mail composer and enter the mailing list
address php-general
lists.php.net instead of
replying to an existing thread and replacing
the subject and body with your message.
9. It's always a good idea to post back to
the list once you've solved your problem.
People usually add [SOLVED] to the subject
line of their email when posting solutions.
By posting your solution you're helping the
next person with the same question.
[contribued by Chris W Parker]
10. Ask smart questions
http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)
11. Do not send your email to the list with
attachments. If you don't have a place to
upload your code, try the many pastebin
websites (such as www.pastebin.com).
[contributed by Burhan Khalid]
--
Integrated Management Tools for leather
industry
----------------------------------
http://www.leatherlink.net
Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106
attached mail follows:
Hi All,
I have a PHP script that I need to call from both web browsers & from a
crontab but whichever route I choose I hit a problem. Here are the options I
have tried along with problems encountered...
PHP
---------
/usr/bin/php /home/sites/home/web/schedules/index.php arg1 arg2 arg3
After resolving include path issues using ini_set() I get... Call to
undefined function: mysql_connect().
I assume that all mysql functions are unavailable??
curl
---------
/usr/bin/curl -u username:password
http://www.domain.com/script.php?arg1=a&arg2=b&arg3=c
This gives me a PHP error... Undefined index: arg2
Only the first argument is available
wget
---------
/usr/bin/wget --http-user=username --http-passwd=password
http://www.domain.com/script.php?arg1=a&arg2=b&arg3=c
This does not give an error but gives a message...
`index.php?fuseaction=NewMembers.1' saved [557]
Again it looks like query string is ignored. The database changes and email
report that are supposed to occur on successful execution are unavailable!
lynx
---------
/usr/bin/lynx -dump -auth=username:password
http://www.domain.com/script.php?arg1=a&arg2=b&arg3=c
This gives me a PHP error... Undefined index: arg2
Only the first argument is available again!
Any ideas anyone?
TIA
- Phil.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.705 / Virus Database: 461 - Release Date: 12/06/2004
attached mail follows:
On Mon, 14 Jun 2004 12:10:30 +0100
"Phil Ewington - 43 Plc" <phil.ewington
43plc.com> wrote:
> PHP
> ---------
> /usr/bin/php /home/sites/home/web/schedules/index.php arg1 arg2 arg3
>
> After resolving include path issues using ini_set() I get... Call to
> undefined function: mysql_connect().
> I assume that all mysql functions are unavailable??
Is your commandline php executable compiled --with-mysql ?
> curl
> ---------
> /usr/bin/curl -u username:password
> http://www.domain.com/script.php?arg1=a&arg2=b&arg3=c
When issuing commands through bash (or alike) you need to surround the string
with double-quotes ("), because & is a bash-operator, meaning "put into
background". With the command above you will execute "/usr/bin/curl -u
username:password http://www.domain.com/script.php?arg1=a" in the background,
"arg2=b" in the background, and "arg3=c" in the foreground ;)
The correct command is:
/usr/bin/curl -u username:password
"http://www.domain.com/script.php?arg1=a&arg2=b&arg3=c"
This also applies to wget, lynx and all other commandline tools you can imagine
;-)
--
Dennis Freise <cat
final-frontier.ath.cx>
GnuPG key: 2DE8 CCEF 6E20 11D4 3B27 21EC B0BA 1749 D2C8 38ED
Available at: http://www.final-frontier.ath.cx/?key-plain
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
iD8DBQFAzZgKsLoXSdLIOO0RAsXaAKCBeMygxXz1QaDZrzS9/MPHzJAHOwCfUkrI
mvQOp0X6czmJIxm78x7xiO4=
=iDKf
-----END PGP SIGNATURE-----
attached mail follows:
> On Mon, 14 Jun 2004 12:10:30 +0100
> "Phil Ewington - 43 Plc" <phil.ewington
43plc.com> wrote:
>
> > PHP
> > ---------
> > /usr/bin/php /home/sites/home/web/schedules/index.php arg1 arg2 arg3
> >
> > After resolving include path issues using ini_set() I get... Call to
> > undefined function: mysql_connect().
> > I assume that all mysql functions are unavailable??
>
> Is your commandline php executable compiled --with-mysql ?
My PHP installation (4.3.6) was configured with: with-mysql=shared
>
> > curl
> > ---------
> > /usr/bin/curl -u username:password
> > http://www.domain.com/script.php?arg1=a&arg2=b&arg3=c
>
> When issuing commands through bash (or alike) you need to
> surround the string
> with double-quotes ("), because & is a bash-operator, meaning "put into
> background". With the command above you will execute "/usr/bin/curl -u
> username:password http://www.domain.com/script.php?arg1=a" in the
> background,
> "arg2=b" in the background, and "arg3=c" in the foreground ;)
That worked a treat! Thanks.
>
> The correct command is:
> /usr/bin/curl -u username:password
> "http://www.domain.com/script.php?arg1=a&arg2=b&arg3=c"
>
> This also applies to wget, lynx and all other commandline tools
> you can imagine
> ;-)
>
> --
> Dennis Freise <cat
final-frontier.ath.cx>
> GnuPG key: 2DE8 CCEF 6E20 11D4 3B27 21EC B0BA 1749 D2C8 38ED
> Available at: http://www.final-frontier.ath.cx/?key-plain
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.705 / Virus Database: 461 - Release Date: 12/06/2004
attached mail follows:
> -----Original Message-----
> From: Michael Benbow [mailto:Michael.Benbow
CeLTS.monash.edu.au]
> Sent: 14 June 2004 08:31
> To: php-general
lists.php.net
> Subject: [PHP] Combo problems.. Multi Array??
>
>
> Hi,
>
> I've got a problem which has left me scratching my head for
> the better
> part of a week.
[...]
> The outcome, if working properly, should be...
>
> A [1][2] B C
> A B [1][2] C
> A B C [1][2]
> A [1] B [2] C
> A B [1] C [2]
> A [1] B C [2]
> A [2] B [1] C
> A [2] C C [1]
> A B [2] C [1]
>
> Does anyone have any ideas on how I could do this? As I said I'm
> completely stumped.
This is called a permutation. Googling for "permutation formula" brings up
any number of good links; the most succinct is probably
http://www.mathwords.com/p/permutation_formula.htm, but most of the other
top 10 links will give you the same answer with a bit (or a lot!) more
explanation.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services, JG125, James
Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS,
LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
I've downloaded the 4.3.7 tar ball and extractted it. I've run configure
(after deleting the cache), no errors. I've run make - no errors, I've then
run make install.. no errors, it says it's updating and installing.
Now I've restarted my httpd service - I've even rebooted but I'm left with
phpinfo telling me that version 4.2.2 is running.
I'm in RH9 and I have no idea why it doesn't install properly..
Can someone shed some light on this?
thanks
Alan
attached mail follows:
Alan McDonald wrote:
> I've downloaded the 4.3.7 tar ball and extractted it. I've run configure
> (after deleting the cache), no errors. I've run make - no errors, I've then
> run make install.. no errors, it says it's updating and installing.
> Now I've restarted my httpd service - I've even rebooted but I'm left with
> phpinfo telling me that version 4.2.2 is running.
> I'm in RH9 and I have no idea why it doesn't install properly..
> Can someone shed some light on this?
Not sure if it's relevant, but does httpd.conf point to the new version?
It's all I have to tweak in Windows.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
attached mail follows:
Alan McDonald wrote --- napísal::
> I've downloaded the 4.3.7 tar ball and extractted it. I've run configure
> (after deleting the cache), no errors. I've run make - no errors, I've then
> run make install.. no errors, it says it's updating and installing.
> Now I've restarted my httpd service - I've even rebooted but I'm left with
> phpinfo telling me that version 4.2.2 is running.
> I'm in RH9 and I have no idea why it doesn't install properly..
> Can someone shed some light on this?
> thanks
> Alan
>
Did you edit /etc/httpd/conf/httpd.conf and change the path to the php
module there?
attached mail follows:
> > I've downloaded the 4.3.7 tar ball and extractted it. I've run configure
> > (after deleting the cache), no errors. I've run make - no errors, I've
then
> > run make install.. no errors, it says it's updating and installing.
> > Now I've restarted my httpd service - I've even rebooted but I'm left
with
> > phpinfo telling me that version 4.2.2 is running.
> > I'm in RH9 and I have no idea why it doesn't install properly..
> > Can someone shed some light on this?
>
> Not sure if it's relevant, but does httpd.conf point to the new version?
> It's all I have to tweak in Windows.
>
> --
> Lester Caine
I must be missing something critical here... I was thinking that the make
install would overwrite the PHP executables but it obviously doesn't ..
Now where in the conf file does the PHP module get mentioned? I;ve searched
it with no mention of PHP!
Alan
attached mail follows:
Alan McDonald wrote --- napísal::
>>>I've downloaded the 4.3.7 tar ball and extractted it. I've run configure
>>>(after deleting the cache), no errors. I've run make - no errors, I've
>
> then
>
>>>run make install.. no errors, it says it's updating and installing.
>>>Now I've restarted my httpd service - I've even rebooted but I'm left
>
> with
>
>>>phpinfo telling me that version 4.2.2 is running.
>>>I'm in RH9 and I have no idea why it doesn't install properly..
>>>Can someone shed some light on this?
>>
>>Not sure if it's relevant, but does httpd.conf point to the new version?
>>It's all I have to tweak in Windows.
>>
>>--
>>Lester Caine
>
>
> I must be missing something critical here... I was thinking that the make
> install would overwrite the PHP executables but it obviously doesn't ..
> Now where in the conf file does the PHP module get mentioned? I;ve searched
> it with no mention of PHP!
> Alan
>
It might be in /etc/httpd/conf.d/[*]_mod_php.conf file
attached mail follows:
Alan McDonald wrote:
> I must be missing something critical here... I was thinking that the make
> install would overwrite the PHP executables but it obviously doesn't ..
> Now where in the conf file does the PHP module get mentioned? I;ve searched
> it with no mention of PHP!
> Alan
Make will overwrite the old PHP binaries if A) you have permission to
overwrite them, and b) they are in the path that you ran with configure...
./configure --prefix=/path/to/install
--
John C. Nichel
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
Alan McDonald wrote:
>I've downloaded the 4.3.7 tar ball and extractted it. I've run configure
>(after deleting the cache), no errors. I've run make - no errors, I've then
>run make install.. no errors, it says it's updating and installing.
>Now I've restarted my httpd service - I've even rebooted but I'm left with
>phpinfo telling me that version 4.2.2 is running.
>I'm in RH9 and I have no idea why it doesn't install properly..
>
>
personal opinion: Possibly because the default RPM installation of
apache on RH is a huge mess :-( me thinks apache should only be
installed on RH by compiling it from source
--
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
attached mail follows:
All,
I would like to use php to email a picture (as an attachment) that is on my
server (linux), without manually attaching/uploading one. Is this possible?
If so, how can it be done?
Thanks,
Ryan
attached mail follows:
[snip]
I would like to use php to email a picture (as an attachment) that is on
my
server (linux), without manually attaching/uploading one. Is this
possible?
If so, how can it be done?
[/snip]
Google can be your friend, if you use it....
http://www.zend.com/zend/spotlight/sendmimeemailpart1.php
attached mail follows:
Also check the archives of this e-mail list. I believe this topic has been
discussed before.
> [Original Message]
> From: Ryan Schefke <ryan
triomfgroup.com>
> To: Php-General-Help <php-general
lists.php.net>
> Date: 06/14/2004 5:48:16 AM
> Subject: [PHP] Help with an objective
>
> All,
>
>
>
> I would like to use php to email a picture (as an attachment) that is on
my
> server (linux), without manually attaching/uploading one. Is this
possible?
> If so, how can it be done?
>
>
>
> Thanks,
>
> Ryan
>
attached mail follows:
$replace = "/^(([a-z]+?[^a-z]+?){".($count)."})(".$typedmask.")(.*)/iS";
$with = "$1<error-start sourcetext=".$corr['sourcetext']." id=".$corr['id']."
group=\"".$corr['grupper']."\" class=\"".$corr['ordklasse']."\"
corrected-from=\"".$corr['typed']."\"
corrected-to=\"".$corr['corrected']."\">$3<error-end
sourcetext=".$corr['sourcetext']." id=".$corr['id'].">$4";
$text = preg_replace ($replace,$with,$text,1);
Above preg_replace works as expected, I have it inside a loop that processes 1000
texts and replaces a total of 30000 words.
The problem is that it accumulates memory up to 200MB, that isn't freed again until
the script completes?
It runs for about 1 - 2 minutes and allocates more and more memory.
If I comment out the preg_replace the memory usage looks normal, so I'm pretty sure
that is where the problem is?
My question is basically, is it something in my reg. exp. that it totally nuts or is
it normal behaviour for preg_replace to allocate memory and not free it again until
the script ends?
attached mail follows:
On 06/12/04 19:05 Kim Steinhaug spoke:
> Steve Douville had a long answer, the short answer : no
Ok, thanks.
I want to avoid relying on Javascript anyways.
attached mail follows:
Bob Lockie wrote --- napísal::
> On 06/12/04 19:05 Kim Steinhaug spoke:
>
>> Steve Douville had a long answer, the short answer : no
>
>
> Ok, thanks.
> I want to avoid relying on Javascript anyways.
>
Make _top the target of the form, then rebuild the frameset based on
your logic.
attached mail follows:
Hi, I have a variable that is created using the date command:
$date = date("Ymd");
but its not working in my database this way (when I explicity enter
20040614 in my database, it works though). so I think PHP is making $date
a character variable, so how can I force or change the caste of $date to
force it to be an integer variable? thanks
attached mail follows:
eh nevermind, I found settype();
:) thanks
On Mon, 14 Jun 2004, Adam Williams wrote:
> Hi, I have a variable that is created using the date command:
>
> $date = date("Ymd");
>
> but its not working in my database this way (when I explicity enter
> 20040614 in my database, it works though). so I think PHP is making $date
> a character variable, so how can I force or change the caste of $date to
> force it to be an integer variable? thanks
>
>
attached mail follows:
"Adam Williams" <awilliam
mdah.state.ms.us> wrote in message
news:Pine.LNX.4.44.0406141029240.26039-100000
roark.mdah.state.ms.us...
> Hi, I have a variable that is created using the date command:
>
> $date = date("Ymd");
>
> but its not working in my database this way (when I explicity enter
> 20040614 in my database, it works though). so I think PHP is making $date
> a character variable, so how can I force or change the caste of $date to
> force it to be an integer variable? thanks
Try this:
$date = (int) $date;
See here:
http://de2.php.net/language.types.type-juggling
But it should also work as a PHP string with your DB. Could you post your
INSERT/UPDATE statement?
Regards, Torsten Roehr
attached mail follows:
You could cast the type when you create the variable:
$variable = (integer) $variable;
Or you could set the type:
settype ($variable, "integer");
However, the problem may be with the database, depending on what you mean
by "it's not working in my database this way."
> [Original Message]
> From: Adam Williams <awilliam
mdah.state.ms.us>
> To: <php-general
lists.php.net>
> Date: 06/14/2004 8:32:18 AM
> Subject: [PHP] converting a char variable to an int?
>
> Hi, I have a variable that is created using the date command:
>
> $date = date("Ymd");
>
> but its not working in my database this way (when I explicity enter
> 20040614 in my database, it works though). so I think PHP is making
$date
> a character variable, so how can I force or change the caste of $date to
> force it to be an integer variable? thanks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Does it work now?
It should not matter, because if you use $date in your sql statement:
$sql = "update table set `date` = '$date'";
$date is converted (back) to string.
Adam Williams wrote --- napísal::
> eh nevermind, I found settype();
>
> :) thanks
>
> On Mon, 14 Jun 2004, Adam Williams wrote:
>
>
>>Hi, I have a variable that is created using the date command:
>>
>>$date = date("Ymd");
>>
>>but its not working in my database this way (when I explicity enter
>>20040614 in my database, it works though). so I think PHP is making $date
>>a character variable, so how can I force or change the caste of $date to
>>force it to be an integer variable? thanks
>>
attached mail follows:
Regardless of how you use your database, here you can read about type
juggling/casting:
http://www.php.net/language.types.type-juggling
Quoting Marek Kilimajer <lists
kilimajer.net>:
> Does it work now?
>
> It should not matter, because if you use $date in your sql statement:
>
> $sql = "update table set `date` = '$date'";
>
> $date is converted (back) to string.
>
> Adam Williams wrote --- napísal::
> > eh nevermind, I found settype();
> >
> > :) thanks
> >
> > On Mon, 14 Jun 2004, Adam Williams wrote:
> >
> >
> >>Hi, I have a variable that is created using the date command:
> >>
> >>$date = date("Ymd");
> >>
> >>but its not working in my database this way (when I explicity enter
> >>20040614 in my database, it works though). so I think PHP is making $date
> >>a character variable, so how can I force or change the caste of $date to
> >>force it to be an integer variable? thanks
> >>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi John,
Thank you for the ideas :) I am beginning to believe I need a new way
to work around this issue.
>gethostbyaddr is a simple reverse-DNS lookup (of the
>REMOTE_ADDR ip address) requested by your server to
>its nameserver. This never goes near the user's IE or
>Netscape browser.
>The IP address used is the one your webserver is using
>in its HTTP (TCP) connection with the browser (or its
>agent -- a firewall or proxy, for example).
>If there is no DNS entry for the ip address, there
>should be no hostname returned because by definition
>there is no host name to be returned.
This is exactly the problem, the error is DNS related and has nothing to
do with the languages, which is why I get the similar results no matter
what I write it in. And yes, they are using proxies as well as rotating
ip addresses. The client's team is behind a firewall with a specific
domain name but I am not consistently getting that IP address. To make
it more complicated, inside their firewall they have rotating ip
addresses, and only some of those have DNS entries.
I wrote it in JavaScript first, which works in IE if they are indeed
using a specific domain name, but not in Netscape, which returns IP
addresses with an occasional domain name, not sure why the browsers are
so different. So I switched to PHP... Thinking, like you, it would not
matter which browser they are using, which helped some, but I am still
unable to get domain names from all of their team. No DNS entries
listed for some of the IP addresses returned. I am not seeing a way to
do it without a consistent DNS entry for each person or at minimum fixed
ip addresses.
Thank you for helping me walk through it.
Alicia
-----Original Message-----
From: John Hicks [mailto:johnlist
gulfbridge.net]
Sent: Friday, June 11, 2004 11:35 PM
To: PHP
Subject: Re: [PHP] gethostbyaddr
Hi Alicia.
Welcome to the list.
On Friday 11 June 2004 12:58 pm, Alicia Riggs wrote:
> Hi guys, I am new to this list, and signed up
> specifically for this problem. If any one has any
> ideas it would be greatly appreciated.
>
> I am writing a function to allow users from a
> specific intranet permission to view a directory. I
> am getting very different results from IE and
> Netscape. I have written this in JavaScript as well
> as PHP, and I am getting the same error in both
> languages.
Are you talking about regular old (browser-based)
Javascript? Javascript and (server-based) PHP are like
apples and oranges. You can't really get the same
error from each because they are doing completely
different things in completely different places.
> When I use the gethostbyaddr call, in IE I get a
> domain name the majority of the time, with a few
> exceptions. When I use the gethostbyaddr call in
> Netscape I only receive a domain name if there is a
> DNS entry. If there is no DNS entry, Netscape
> returns an IP address.
PHP functions are executed by the server. The browser
(Netscape and IE) have nothing to do with them.
gethostbyaddr is a simple reverse-DNS lookup (of the
REMOTE_ADDR ip address) requested by your server to
its nameserver. This never goes near the user's IE or
Netscape browser.
The IP address used is the one your webserver is using
in its HTTP (TCP) connection with the browser (or its
agent -- a firewall or proxy, for example).
If there is no DNS entry for the ip address, there
should be no hostname returned because by definition
there is no host name to be returned.
> I am not sure what IE is using to get the domain
> names when there is no DNS entry.
>
> How do I get the correct info to be returned from
> Netscape?
>
>
> Here is the code I am using
> ***********************************
>
> <?php
> //echo "<pre>";
> //print_r($_SERVER);
> //echo "</pre>";
> $hn = gethostbyaddr($_SERVER['REMOTE_ADDR']);
> echo "host by addr = " . $hn . "\n<br>";
> $darr = explode(".", $hn);
> $cnt = count($darr);
> $host = $darr[$cnt - 2] . "." . $darr[$cnt - 1];
> echo "host = " . $host . "\n<br>";
> /*
> if($host == "xyz.com")
> header("Location: xyz.html");
> else
> if($host == "abc.com")
> header("Location: abc.html");
> else
> header("Location: error.html");
> */
> ?>
For debugging purposes, I would add more verbose echos:
particularly for IP address and full host name
returned ($hn).
How are you deducing that you are getting different
results based on the user's browser?
Are there firewalls or web proxies involved? This could
account for getting conflicting IP addresses for the
same user reported by the browser (via Javascript) and
server.
> Thanks in advance for any ideas!
>
> Alicia Riggs
> PSG - Web Development Engineer
> 214-550-7452
Hope this helps.
Regards,
John
---------------------------------------
John Hicks
Gulfbridge, Inc.
"Putting the Web to work for your business." http://gulfbridge.com
561-586-8116
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Is this what you need? (See below for inline suggestions).
grahama
siren.cc wrote:
> Hi :)
>
>
> I am creating an XML file out of a mysql query with nested arrays.
> Currently I can get 1 element and 1 child with a properly formatted XML
> file with the below script .
>
>
> My question is: How do I add 3 to 4 more child elements to the below
> 'playlist' array ?
> Currently ,I have one parent 'Artist' and one child 'english' ...
> I need to add more child elements to the 'Artist' array like urlPath,
> spanish, biography, etc
>
> My addled thoughts...
> So, would the multidimensional array be like:
> $playlist[ [$artist [ ] ] [$media[ ] ]
> [$mediaElement] ] ?
>
> for the 'trackName' child:
> $playlist [ "Artist 1" ] [ "Track 1" ] [ "trackName" ]
> or for 'urlPath' child :
> $playlist [ "Artist 1" ] [ "Track 1" ] [ "urlPath" ]
>
>
> Do I have to add another dimension to the 'playlist' array? Do I need
> another foreach loop ?
> Is there an easier more efficient way to do this?
> Be nice to spell out the schema in some way in the script...in case you
> need to add more levels...like a 'subCategory'
>
> I am a bit new to this so any help would be greatly appretiated ....
> head is spinning a bit
>
> <?php
>
$db = mysql_connect('127.0.0.1','name','pass');
>
> if (!$db)
> {
> echo 'Error:Could Not Connect';
> exit;
> }
>
> mysql_select_db('univision');
>
>
> $sql = 'SELECT artist.artist_name, media.english, media.path ';
> $sql .= 'FROM media, artist ';
> $sql .= 'WHERE artist.artist_id = media.artist_id LIMIT 0, 30 ';
>
> $result = mysql_query($sql);
> while ($row = mysql_fetch_array($result))
> {
> $playlist[$row['artist_name']] [] = $row['english'];
Instead, try
$playlist[$row['artist_name']][] = array('english' => $row['english'],
'path' => $row['path'],
//add more here);
You could even add a sub-loop here:
$entry = array('english' => $row['english'],
'path' => $row['path'],
//add more here);
//guessing here
$sql = 'SELECT * FROM tracks WHERE artist = "'.$row['artist_name'].'"';
$sth = mysql_query($sql);
while($track = mysql_fetch_assoc($sth)) {
$entry['tracks'][$track['name']] = $track;
}
$playlist[$row['artist_name']][] = $entry;
> //would like to add more children here...
> }
>
> $xml = "<sirenreels>\n";
>
> foreach ($playlist as $artist => $media)
> {
> $num_media = count($media);
> $xml .= "<artist>\n";
>
> $xml .= "\t<meta>\n";
> $xml .= "\t\t<title>".$artist."</title>\n";
> $xml .= "\t</meta>\n";
>
> $xml .= "\t<content>\n";
>
> foreach ($media as $mediaVal)
> {
> $xml .= "\t\t<media>\n";
> $xml .= "\t\t\t<english_name>".$mediaVal."</english_name>\n";
> ///add more children
> ///add more children
> $xml .= "\t\t</media>\n";
>
> }
>
> $xml .= "\t</content>\n";
> $xml .= "</artist>\n";
> }
> $xml .= "</sirenreels>\n";
> print $xml
--
paperCrane <Justin Patrin>
attached mail follows:
Phpmail wrote:
> My login script sets unique, secure, cookies that identify the user. Some of my pages only display content if a secure cookie is present. Is this a bad idea for secure pages with sensitive details as I have heard that cookies can be faked? I am always interested in creating a secure environment for my website visitors and I want to make sure I am protecting their privacy. Any help on this matter is greatly appreciated.
>
> Thanks,
>
> ~Sean V.
>
I would suggest tying your cookies to an IP. This makes it MUCH harder
for a cracker to use the cookie. You may just want to search for "PHP
secure cookies" on google.
--
paperCrane <Justin Patrin>
attached mail follows:
> > My login script sets unique, secure, cookies that identify the user.
> > Some of my pages only display content if a secure cookie is present.
> > Is this a bad idea for secure pages with sensitive details as I have
> > heard that cookies can be faked? I am always interested in creating a
> > secure environment for my website visitors and I want to make sure I
> > am protecting their privacy. Any help on this matter is greatly
> > appreciated.
>
> I would suggest tying your cookies to an IP. This makes it MUCH harder
> for a cracker to use the cookie. You may just want to search for "PHP
> secure cookies" on google.
As well as much harder for AOL subscribers (whose IP's change per-request)
to use the site. Cookies are easy to fake. In most cases, though, the cost
(to an intruder) of interfering with a user session far outweighs the
benefit. This is why most e-commerce sites are pretty lax about security
while you browse, and why they immediately switch to SSL when you decide
to pay.
Consider the potential damage done to your users or the sensitivity of the
information you're transmitting, and you may decide to go with SSL.
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html
attached mail follows:
[snip}
> As well as much harder for AOL subscribers (whose IP's change per-request)
> to use the site.
[snip]
WHAT?? Are you sure of this? AOL really breaks internet browsing this
much? Sorry, I can't believe this. If this was true, many things would
break. I know that dial-up users get different IPs every time they
connect, but for somehting like this to happen, they'd have to be using
some kind of round-robin DNS for a proxy server or some kind of wacky
load balancing. Can you point us to a resource that verifies this?
--
paperCrane <Justin Patrin>
attached mail follows:
On Mon, 2004-06-14 at 14:02, Justin Patrin wrote:
> [snip}
> > As well as much harder for AOL subscribers (whose IP's change per-request)
> > to use the site.
> [snip]
>
I don't think it changes per request, but rather has the potential to
change between requests.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Robert Cummings wrote:
> On Mon, 2004-06-14 at 14:02, Justin Patrin wrote:
>
>>[snip]
>>
>>>As well as much harder for AOL subscribers (whose IP's change per-request)
>>>to use the site.
>>
>>[snip]
>>
>
>
> I don't think it changes per request, but rather has the potential to
> change between requests.
>
I still don't believe that. The only reason an IP would change is if the
user dials up again.
Using IP-restricted cookies will not break anything while the person is
on the site. It will, however, not work if the user disconnects, then
dials up again as they *will* have a different IP.
This is true of Cable users as well as their IP *may* change at any time
(although it doesn't often if you leave your computer on most of the time).
--
paperCrane <Justin Patrin>
attached mail follows:
Justin Patrin wrote --- napísal::
> [snip}
>
>> As well as much harder for AOL subscribers (whose IP's change
>> per-request)
>> to use the site.
>
> [snip]
>
> WHAT?? Are you sure of this? AOL really breaks internet browsing this
> much? Sorry, I can't believe this. If this was true, many things would
> break. I know that dial-up users get different IPs every time they
> connect, but for somehting like this to happen, they'd have to be using
> some kind of round-robin DNS for a proxy server or some kind of wacky
> load balancing. Can you point us to a resource that verifies this?
>
a proxy server farm with some kind of wacky load balancing ;-)
attached mail follows:
On 06/14/2004 1:02 PM, Justin Patrin <papercrane
reversefold.com> wrote:
>> As well as much harder for AOL subscribers (whose IP's change per-request)
>> to use the site.
>
> WHAT?? Are you sure of this? AOL really breaks internet browsing this
> much? Sorry, I can't believe this. If this was true, many things would
> break. I know that dial-up users get different IPs every time they
> connect, but for somehting like this to happen, they'd have to be using
> some kind of round-robin DNS for a proxy server or some kind of wacky
> load balancing. Can you point us to a resource that verifies this?
"[W]ebmasters should not make assumptions about the relationship between
members and proxy servers when designing their web site."
http://webmaster.info.aol.com/proxyinfo.html
Paul
attached mail follows:
Marek Kilimajer wrote:
> Justin Patrin wrote --- napísal::
>
>> [snip}
>>
>>> As well as much harder for AOL subscribers (whose IP's change
>>> per-request)
>>> to use the site.
>>
>>
>> [snip]
>>
>> WHAT?? Are you sure of this? AOL really breaks internet browsing this
>> much? Sorry, I can't believe this. If this was true, many things
>> would break. I know that dial-up users get different IPs every time
>> they connect, but for somehting like this to happen, they'd have to
>> be using some kind of round-robin DNS for a proxy server or some kind
>> of wacky load balancing. Can you point us to a resource that verifies
>> this?
>>
>
> a proxy server farm with some kind of wacky load balancing ;-)
>
http://webmaster.info.aol.com/proxyinfo.html
attached mail follows:
Paul Fierro wrote:
>On 06/14/2004 1:02 PM, Justin Patrin <papercrane
reversefold.com> wrote:
>
>
>
>>>As well as much harder for AOL subscribers (whose IP's change per-request)
>>>to use the site.
>>>
>>>
>>WHAT?? Are you sure of this? AOL really breaks internet browsing this
>>much? Sorry, I can't believe this. If this was true, many things would
>>break. I know that dial-up users get different IPs every time they
>>connect, but for somehting like this to happen, they'd have to be using
>>some kind of round-robin DNS for a proxy server or some kind of wacky
>>load balancing. Can you point us to a resource that verifies this?
>>
>>
>
>"[W]ebmasters should not make assumptions about the relationship between
>members and proxy servers when designing their web site."
>
>http://webmaster.info.aol.com/proxyinfo.html
>
>Paul
>
>
>
Heh... bad timing :)
attached mail follows:
> [snip}
> > As well as much harder for AOL subscribers (whose IP's change per-request)
> > to use the site.
> [snip]
>
> WHAT?? Are you sure of this? AOL really breaks internet browsing this
> much? Sorry, I can't believe this. If this was true, many things would
> break.
Not really -- HTTP is stateless, so there's really no reason for each
request to come from the same IP. As other posters in this thread have
pointed out, AOL uses an army of proxy servers. In the past, they've even
cached and re-compressed images for the benefit of those on slow dialup.
As you say, wacky stuff.
You're on the right track, though - the way to make cookies tougher to
crack is to associate the cookie with some other piece of user
information. I've toyed with using an encrypted string based on the user
agent as part of the cookie, but have never encountered a project where
this level of care was called-for while SSL was not.
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html
attached mail follows:
Hi!
I am using date("j M Y"), the format date is 14 Jun 2004, but i need this
format 14 JUN 2004. The unique difference is Jun -> JUN. How can i change
this?.
Thank You,
Juan
attached mail follows:
Use the strtoupper function:
http://www.php.net/strtoupper
HTH!
--Sam
-----Original Message-----
From: Juan Pablo Herrera [mailto:juampi
linuxeducativo.com.ar]
Sent: Monday, June 14, 2004 11:05 AM
To: php-general
lists.php.net
Subject: [PHP] Function Date
Hi!
I am using date("j M Y"), the format date is 14 Jun 2004, but i need
this format 14 JUN 2004. The unique difference is Jun -> JUN. How can i
change this?.
Thank You,
Juan
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
attached mail follows:
On Mon, 14 Jun 2004 14:04:56 -0300 (ART)
"Juan Pablo Herrera" <juampi
linuxeducativo.com.ar> wrote:
> I am using date("j M Y"), the format date is 14 Jun 2004, but i need this
> format 14 JUN 2004. The unique difference is Jun -> JUN. How can i change
> this?.
How about strtoupper( date("j M Y") ); ?
--
Dennis Freise <cat
final-frontier.ath.cx>
GnuPG key: 2DE8 CCEF 6E20 11D4 3B27 21EC B0BA 1749 D2C8 38ED
Available at: http://www.final-frontier.ath.cx/?key-plain
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
iD8DBQFAzd33sLoXSdLIOO0RAlL9AKCM/BGXNZKd6Ok3GjZIqWnOEDjoZwCeI8HE
UEBb2ekds/uaCpFz0RRcpY0=
=r98z
-----END PGP SIGNATURE-----
attached mail follows:
How about.
strtoupper( date("j M Y"))
> I am using date("j M Y"), the format date is 14 Jun 2004, but i need this
> format 14 JUN 2004. The unique difference is Jun -> JUN. How can i change
> this?.
> Thank You,
> Juan
attached mail follows:
Hello Juan,
Monday, June 14, 2004, 6:04:56 PM, you wrote:
JPH> I am using date("j M Y"), the format date is 14 Jun 2004, but i need this
JPH> format 14 JUN 2004. The unique difference is Jun -> JUN. How can i change
JPH> this?.
$date = strtoupper(date('j M Y'));
:)
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I am not young enough to know everything." - Oscar Wilde
attached mail follows:
Guys.
Anybody knows any open source CRM thats based on PHP or something similar?
Im looking for CRM alternatives...
Thx for any comments.
Anton Krall
attached mail follows:
Anton Krall wrote:
> Guys.
>
> Anybody knows any open source CRM thats based on PHP or something similar?
>
> Im looking for CRM alternatives...
>
> Thx for any comments.
>
> Anton Krall
>
Please don't ask for read receipts when sending to a mailing list.
--
John C. Nichel
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
PLEASE stop posting the same qustion over and over. If you're not
subscribed to the list (or reading it via news.php.net) you need to be
to see responses. I sent a response to this question earlier today.
grahama
siren.cc wrote:
> Hi :)
>
> I am on my second week of php so be gentle
>
> I am creating an XML file out of a mysql query with nested arrays.
> Currently I can get 1 element and 1 child with a properly formatted XML
> file with the below script .
>
>
> My question is: How do I add 3 to 4 more child elements to the below
> 'playlist' array ?
> Currently ,I have one parent 'Artist' and one child 'english' ...
> I need to add more child elements to the 'Artist' array like urlPath,
> spanish, biography, etc
>
>
> Do I have to add another dimension to the 'playlist' array? Do I need
> another foreach loop ?
> Is there an easier more efficient way to do this?
> Be nice to spell out the schema in some way in the script...in case you
> need to add more levels...like a 'subCategory'
>
> I am a bit new to this so any help would be greatly appretiated ....
> head is spinning a bit
>
>
> $sql = 'SELECT artist.artist_name, media.english, media.path ';
> $sql .= 'FROM media, artist ';
> $sql .= 'WHERE artist.artist_id = media.artist_id LIMIT 0, 30 ';
>
> $result = mysql_query($sql);
> while ($row = mysql_fetch_array($result))
> {
> $playlist[$row['artist_name']] [] = $row['english'];
> //would like to add more children here...
> }
>
> $xml = "<sirenreels>\n";
>
> foreach ($playlist as $artist => $media)
> {
> $num_media = count($media);
> $xml .= "<artist>\n";
>
> $xml .= "\t<meta>\n";
> $xml .= "\t\t<title>".$artist."</title>\n";
> $xml .= "\t</meta>\n";
>
> $xml .= "\t<content>\n";
>
> foreach ($media as $mediaVal)
> {
> $xml .= "\t\t<media>\n";
> $xml .= "\t\t\t<english_name>".$mediaVal."</english_name>\n";
> ///add more children
> ///add more children
> $xml .= "\t\t</media>\n";
>
> }
>
> $xml .= "\t</content>\n";
> $xml .= "</artist>\n";
> }
> $xml .= "</sirenreels>\n";
> print $xml
--
paperCrane <Justin Patrin>
attached mail follows:
If i'm not wrong php has only 1 level of depth for child class. That means
you can only extends from 1 level up the class.
In your example you have the class OneMore that extends down from the
"grandfather" Base. It is not a problem in C++ but should not work in php or
either javascript.
Am i wrong?
Franciccio
"Frzzman" <FrzzMan
vnOCzone.com> ha scritto nel messaggio
news:20040613063640.21005.qmail
pb1.pair.com...
> Hi guys, hey don't laugh at the subject, in fact I don't what to call
> it, so let's call it super constructor :D
>
> Let's see following code...
>
> class Base
> {
> __construct()
> {
> // Do something
> }
> }
>
> class One extends Base
> {
> __construct()
> {
> // Do nothing
> }
> }
>
> class OneMore extends One
> {
> __construct()
> {
> // Do things :D
> }
> }
>
> So when I create an instance of OneMore class by:
>
> $OneMoreInstance = new OneMore()
>
> The __construct() method of class OneMore will be called, not the one of
> One and Base, right?
>
> So is there any way around to make the Base class have a contructor that
> will be called everytime one of its child initialize?
>
> My problem, I want all of the classes in my object are extend from one
> base class, so they are all have some common properties and function,
> but PHP won't implicit call the contructor (that's the right way)...
> btw, in my case, this is bad, as bad as every constructor would be
called...
>
> Well, hope you understand what I'm trying to say...
attached mail follows:
Franciccio wrote:
> If i'm not wrong php has only 1 level of depth for child class. That means
> you can only extends from 1 level up the class.
> In your example you have the class OneMore that extends down from the
> "grandfather" Base. It is not a problem in C++ but should not work in php or
> either javascript.
>
> Am i wrong?
Yes, you are. You can extend as much as you want. If you couldn't, it
wouldn't be very useful.
>
> Franciccio
>
>
> "Frzzman" <FrzzMan
vnOCzone.com> ha scritto nel messaggio
> news:20040613063640.21005.qmail
pb1.pair.com...
>
>>Hi guys, hey don't laugh at the subject, in fact I don't what to call
>>it, so let's call it super constructor :D
>>
>>Let's see following code...
>>
>>class Base
>>{
>>__construct()
>>{
>>// Do something
>>}
>>}
>>
>>class One extends Base
>>{
>>__construct()
>>{
>>// Do nothing
>>}
>>}
>>
>>class OneMore extends One
>>{
>>__construct()
>>{
>>// Do things :D
>>}
>>}
>>
>>So when I create an instance of OneMore class by:
>>
>>$OneMoreInstance = new OneMore()
>>
>>The __construct() method of class OneMore will be called, not the one of
>>One and Base, right?
>>
>>So is there any way around to make the Base class have a contructor that
>>will be called everytime one of its child initialize?
>>
>>My problem, I want all of the classes in my object are extend from one
>>base class, so they are all have some common properties and function,
>>but PHP won't implicit call the contructor (that's the right way)...
>>btw, in my case, this is bad, as bad as every constructor would be
>
> called...
>
>>Well, hope you understand what I'm trying to say...
--
paperCrane <Justin Patrin>
attached mail follows:
Hmm, looks like my reply got lost. Here's my ideas:
Instead of parent::__construct() use Class1::__construc(). This way, you
go straight to the top-level constructor without going through the
middle constructors. This means that you *must* overload __construct in
all child classes or else the constructor of the immediate parent will
be called.
If you want to leave the option of no child constructor open, you could
use something like:
parent::__construct();
if(strtolower(get_class($this)) == 'class2') {
//do constructor things for class2
}
in the constructor for Class2. Then if Class3 has no constructor, the
Class2 constructor code won't be run.
Frzzman wrote:
> Yeah you understood me, thanks god :D but not fully :(
>
> But the problem is right in your code (sorry :D)
>
> What if I create an instance of ChildClass, its constructor won't be
> called (since it commented out), but if I un-comment its constructor, it
> will be called even if I create an instance of GrandChildClass?
>
> Let me make some simple diagram ;)
>
> Class1 <-- Class2 <-- Class3 <-- Class4
>
> If I create an instance of Class4, then Class4's constructor and
> Class1's constructor must be called, neither Class3 nor Class2.
>
> You can see that Class1's constructor will always be called, and the
> constructor of the lowest class in the class tree will be called.
>
> I think this is a bit complex, I can define a final function in Class1,
> and call it in every deriver class constructor, it will solve the
> problem (I think) but it's not convenience, I want it done automatically...
>
> Any idea are welcome :D
>
> Chris wrote:
>
>> FrzzMan wrote:
>>
>>> Hi guys, hey don't laugh at the subject, in fact I don't what to call
>>> it, so let's call it super constructor :D
>>>
>>> Let's see following code...
>>>
>>> class Base
>>> {
>>> __construct()
>>> {
>>> // Do something
>>> }
>>> }
>>>
>>> class One extends Base
>>> {
>>> __construct()
>>> {
>>> // Do nothing
>>> }
>>> }
>>>
>>> class OneMore extends One
>>> {
>>> __construct()
>>> {
>>> // Do things :D
>>> }
>>> }
>>>
>>> So when I create an instance of OneMore class by:
>>>
>>> $OneMoreInstance = new OneMore()
>>>
>>> The __construct() method of class OneMore will be called, not the one
>>> of One and Base, right?
>>>
>>> So is there any way around to make the Base class have a contructor
>>> that will be called everytime one of its child initialize?
>>>
>>> My problem, I want all of the classes in my object are extend from
>>> one base class, so they are all have some common properties and
>>> function, but PHP won't implicit call the contructor (that's the
>>> right way)... btw, in my case, this is bad, as bad as every
>>> constructor would be called...
>>>
>>> Well, hope you understand what I'm trying to say...
>>>
>> I'm not positive I understand you correctly, but I think this will
>> answer your question.
>>
>> Example Classes:
>> class ParentClass
>> {
>> function __construct()
>> {
>> echo 'ParentClass::__construct()',"\r\n";
>> }
>> }
>> class ChildClass extends ParentClass
>> {
>> /*
>> function __construct()
>> {
>> parent::__construct();
>> echo 'ChildClass::__construct()',"\r\n";
>> }
>> //*/
>> }
>> class GrandChildClass extends ChildClass
>> {
>> function __construct()
>> {
>> parent::__construct();
>> echo 'GrandChildClass::__construct()',"\r\n";
>> }
>> }
>>
>> __construct is just like any other method, if you overload it
>> (redefine it in a child class), the parent method will not be called
>> automatically, so, if you want the functionality of both, you can call
>> the parent constructor from the childs constructor. If the direct
>> parent doesn't have a constructor, the next parent's constructor is
>> checked and so on.
>>
>> In the above example when defining a GrandChildClass, its constructor
>> and the ParentClass::__construct() are will both run. If you uncomment
>> ChildClass::__construct(), it will run as well.
--
paperCrane <Justin Patrin>
attached mail follows:
Anybody have any experience (good or bad) with MapServer?
(http://mapserver.gis.umn.edu/)
And if so, can you comment on how good or bad PHP/MapScript is?
(http://mapserver.gis.umn.edu/doc42/phpmapscript-class-guide.html)
Thanks.
...Rene
attached mail follows:
Here is a piece of my code in my PHP, I am trying to reload frame C with
updated information and reload the current page into the current frame.
Can someone tell me where I am going wrong?
if (mysql_num_rows($get_query_res) < 1){
//invalid id, send away
header("<script language=\"javascript\">parent.C.location.href =
\"show.html\";</script>");
header("<script language=\"javascript\">parent.B.location.href =
\"prefs.html\";</script>");
exit;
Thanks,
Robert
attached mail follows:
Did you try to just echo the javascript statements instead of trying to use
the header? Should have the same effect.
----- Original Message -----
From: "Robert Sossomon" <robert
gcnorris.com>
To: "PHP List" <php-general
lists.php.net>
Sent: Monday, June 14, 2004 2:32 PM
Subject: [PHP] Load a frame and work on another?
> Here is a piece of my code in my PHP, I am trying to reload frame C with
> updated information and reload the current page into the current frame.
> Can someone tell me where I am going wrong?
>
> if (mysql_num_rows($get_query_res) < 1){
> //invalid id, send away
> header("<script language=\"javascript\">parent.C.location.href =
> \"show.html\";</script>");
> header("<script language=\"javascript\">parent.B.location.href =
> \"prefs.html\";</script>");
> exit;
>
> Thanks,
> Robert
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
attached mail follows:
I am trying to figure out why if there is an error in my query it throws
an error message to the screen instead of parsing the rest of my script
to get the rest of the information. I have error checking in my script
and if there is no information I want it to process and do things.
I run this:
<?
session_start();
//connect to database
include 'db.php';
include 'salesinfo.php';
$query = "select * from quoteprefs where salesman = $user";
$get_query_res = mysql_query($query) or die(mysql_error());
if (mysql_num_rows($get_query_res) < 1){
//invalid id, send away
header("<script language=\"javascript\">parent.C.location.href =
\"show.html\";</script>");
header("<script language=\"javascript\">parent.B.location.href =
\"custn.html\";</script>");
exit;
} else {
//get info
$title = mysql_result($get_query_res,0,'item_num');
$desc = mysql_result($get_query_res,0,'description');
$q = mysql_result($get_query_res,0,'qty');
$p = mysql_result($get_query_res,0,'price');
$c = mysql_result($get_query_res,0,'comments');
$tp = mysql_result($get_query_res,0,'Tprice');
$display_block = "<html>";
}
?>
<html>
<head>
<body>
<center><BR>
Choose from the following options to set your preferences:
<? echo $display_block; ?>
<BR></center>
</body>
</html>
And I get:
Unknown column 'robert' in 'where clause'
ThANKS!!
Robert
attached mail follows:
You need to quote the $user:
$query = "select * from quoteprefs where salesman = '$user'";
----- Original Message -----
From: "Robert Sossomon" <robert
gcnorris.com>
To: "PHP List" <php-general
lists.php.net>
Sent: Monday, June 14, 2004 2:44 PM
Subject: [PHP] Erroring out?!
> I am trying to figure out why if there is an error in my query it throws
> an error message to the screen instead of parsing the rest of my script
> to get the rest of the information. I have error checking in my script
> and if there is no information I want it to process and do things.
>
> I run this:
> <?
> session_start();
>
> //connect to database
> include 'db.php';
> include 'salesinfo.php';
>
> $query = "select * from quoteprefs where salesman = $user";
> $get_query_res = mysql_query($query) or die(mysql_error());
>
>
> if (mysql_num_rows($get_query_res) < 1){
> //invalid id, send away
> header("<script language=\"javascript\">parent.C.location.href =
> \"show.html\";</script>");
> header("<script language=\"javascript\">parent.B.location.href =
> \"custn.html\";</script>");
> exit;
> } else {
> //get info
> $title = mysql_result($get_query_res,0,'item_num');
> $desc = mysql_result($get_query_res,0,'description');
> $q = mysql_result($get_query_res,0,'qty');
> $p = mysql_result($get_query_res,0,'price');
> $c = mysql_result($get_query_res,0,'comments');
> $tp = mysql_result($get_query_res,0,'Tprice');
>
>
> $display_block = "<html>";
>
> }
> ?>
> <html>
> <head>
> <body>
> <center><BR>
> Choose from the following options to set your preferences:
> <? echo $display_block; ?>
> <BR></center>
> </body>
> </html>
>
> And I get:
> Unknown column 'robert' in 'where clause'
>
> ThANKS!!
>
> Robert
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
attached mail follows:
Robert Sossomon wrote:
>I am trying to figure out why if there is an error in my query it throws
>an error message to the screen instead of parsing the rest of my script
>to get the rest of the information. I have error checking in my script
>and if there is no information I want it to process and do things.
>
>I run this:
><?
>session_start();
>
>//connect to database
>include 'db.php';
>include 'salesinfo.php';
>
>$query = "select * from quoteprefs where salesman = $user";
>$get_query_res = mysql_query($query) or die(mysql_error());
>
>
>if (mysql_num_rows($get_query_res) < 1){
>//invalid id, send away
>header("<script language=\"javascript\">parent.C.location.href =
>\"show.html\";</script>");
>header("<script language=\"javascript\">parent.B.location.href =
>\"custn.html\";</script>");
>exit;
>} else {
>//get info
>$title = mysql_result($get_query_res,0,'item_num');
>$desc = mysql_result($get_query_res,0,'description');
>$q = mysql_result($get_query_res,0,'qty');
>$p = mysql_result($get_query_res,0,'price');
>$c = mysql_result($get_query_res,0,'comments');
>$tp = mysql_result($get_query_res,0,'Tprice');
>
>
>$display_block = "<html>";
>
>}
>?>
><html>
><head>
><body>
><center><BR>
>Choose from the following options to set your preferences:
><? echo $display_block; ?>
><BR></center>
></body>
></html>
>
>And I get: