|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Fri Aug 31 2001 - 16:44:04 CDT
php-general Digest 31 Aug 2001 21:44:04 -0000 Issue 849
Topics (messages 65432 through 65549):
Re: Problem with microtime()
65432 by: Rosen
Re: determining the pixel width of a string
65433 by: Don Read
Re: help !
65434 by: Jon Haworth
65436 by: CC Zona
base64_decode problem.
65435 by: Johan Vikerskog (ECS)
just 10 characters from a string
65437 by: Marcos Lloret
65439 by: James Holloway
65440 by: Johan Vikerskog (ECS)
65444 by: * R&zE:
65519 by: Alexander Skwar
2 General MySQL Questions
65438 by: Tom Churm
65443 by: Jon Haworth
65446 by: B. van Ouwerkerk
Chat / IRC
65441 by: ERISEN, Mehmet Kamil
assosiative array in php
65442 by: Kiat Kin
65445 by: Andrey Hristov
header,session stuff works on live fails on dev...?
65447 by: Nic Skitt
65450 by: Christopher William Wesley
65453 by: Nic Skitt
Re: Whacky WGET issue...
65448 by: Peter Clarke
number to word converter
65449 by: Carry Ian
65454 by: * R&zE:
65456 by: * R&zE:
65533 by: Hugh Bothwell
session.save_handler = user
65451 by: php-jp
65452 by: Andrey Hristov
Re: Can PHP and Java work together?
65455 by: Benjamin Lupu
65477 by: Alfredeen, Johan
HTTP authentication
65457 by: Boris
65471 by: Jon Haworth
Re: access to the apache environment from the c-client built into PHP 4.0.x
65458 by: Liam Hoekenga
Re: Refreshing php.ini without restart...
65459 by: Miles Thompson
form data used on the same page?
65460 by: webmaster
65461 by: * R&zE:
Re: Directing A Parked Domain To A Sub Directory
65462 by: Dave
Opt-In Request Re: Php-general
lists.php.net
65463 by: abundantliving.aolms.com
Re: The future of PHP
65464 by: Manuel Lemos
65474 by: Christopher CM Allen
65481 by: Thomas Deliduka
65504 by: Philip Olson
65522 by: pierre-yves
Re: PHP_SELF or REQUEST_URI within Function ?
65465 by: Arcadius A.
65484 by: Alexander Skwar
65486 by: Boget, Chris
65488 by: Alexander Skwar
65490 by: Boget, Chris
65491 by: Arcadius A.
65492 by: Alexander Skwar
65496 by: Boget, Chris
65498 by: Arcadius A.
65501 by: Boget, Chris
65502 by: Philip Olson
65505 by: Arcadius A.
65518 by: Alexander Skwar
move_uploaded_file and related question
65466 by: ---
65467 by: Andrey Hristov
Re: header() + link..
65468 by: Ashwin Kutty
65469 by: * R&zE:
Segmentation Fault on apache with imageCopy fonction
65470 by: Matthieu Brunet
PHP Syntax question.
65472 by: Erols
65473 by: Jon Haworth
Variable Syntax Question
65475 by: Ninety-Nine Ways To Die
65476 by: * R&zE:
65478 by: * R&zE:
Re: File read Parser error
65479 by: Bopolissimus Platypus
PHP Security
65480 by: Alfredeen, Johan
65508 by: Seb Frost
65512 by: Alfredeen, Johan
Re: [PHP-WIN] Can PHP and Java work together?
65482 by: Robin Bolton
65483 by: Robin Bolton
65485 by: Alfredeen, Johan
65487 by: mark Charette
Cookies
65489 by: Jason Radley
65494 by: Jon Farmer
65497 by: Jon Farmer
65528 by: Papp Gyozo
PHP to fax
65493 by: Ari Nepon
65495 by: Andrey Hristov
65503 by: Sean C. McCarthy
Plese help me
65499 by: soawarat weangkawe
My apologies for the OOAR's
65500 by: Phil Labonte
Re: Databases, arrays and woes
65506 by: Papp Gyozo
array search
65507 by: Joseph Bannon
65509 by: Andrey Hristov
65510 by: Papp Gyozo
65514 by: Philip Olson
65517 by: Alfredeen, Johan
Setcookie
65511 by: Galvin, Max
65513 by: Jason Radley
65520 by: Galvin, Max
Re: help with strings...
65515 by: Papp Gyozo
65521 by: Philip Olson
passing variables between scripts?
65516 by: Jon Thompson Coon
65541 by: Papp Gyozo
help again
65523 by: Nikola Veber
65524 by: Jason Bell
65525 by: Alex Marín Fica \(Desarrollo\)
65526 by: Philip Olson
65531 by: Nikola Veber
65532 by: Jason Bell
Re: The future of PHP or my 2 cents
65527 by: B. van Ouwerkerk
Re: multiple submit buttons
65529 by: Johnson, Kirk
Re: PHP with Access?
65530 by: EDUMEXICO
chmod failed: Operation not permitted
65534 by: Police Trainee
65536 by: Jason Bell
65538 by: Police Trainee
65539 by: Larry Rosenman
65540 by: Jason Bell
HELP! Frustrating Cookie Problem....
65535 by: Jack Sasportas
65537 by: Richard Baskett
sessions problems :/
65542 by: Rui Barreiros
FTP Connection Problems
65543 by: news.php.net
65544 by: news.php.net
UpLoading Large Files?
65545 by: Henrik Hudson
How to get a double to show the .00 in a hole number
65546 by: Robert J Collins
65547 by: Boget, Chris
65548 by: Andrey Hristov
Disbale function in certain virtual host
65549 by: Nicolas Ross
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,
The problem is, thath I want to generate random number between 1 and 10000
How can I do it ?
Thanks,
Rosen
"Lawrence Sheed" <Lawrence.Sheed
dfait-maeci.gc.ca> wrote in message
news:4B0FC61A2044D31180A60000F810DF207D37E5
shngir01.shngi.dfait-maeci.gc.ca
...
>
> You are casting microtimes results as an integer value. It isn't an
integer
> value, hence the 0.
>
>
> From the manual It returns the string the string "msec sec" where sec is
> the current time measured in the number of seconds since the Unix Epoch
> (0:00:00 January 1, 1970 GMT), and msec is the microseconds part. This
> function is only available on operating systems that support the
> gettimeofday() system call.
>
>
> Try:
>
> for ($i = 0; $i < 100; $i++) {
> $k = microtime();
> echo "<br>$k";
>
> for ($j = 0; $j < 10000; $j++)
> $m = $j *3;
> }
>
> Or look in the http://www.php.net/manual/en/function.microtime.php for
> examples.
>
> -----Original Message-----
> From: Rosen [mailto:rosen_dm
dir.bg]
> Sent: August 31, 2001 3:29 PM
> To: php-general
lists.php.net
> Subject: [PHP] Problem with microtime()
>
>
> Hi,
> I'm using the following code:
> for ($i = 0; $i < 100; $i++) {
> $k = (int) microtime();
> echo "<br>$k";
>
> for ($j = 0; $j < 10000; $j++)
> $m = $j *3;
> }
>
>
> but it prints me only "0......"
>
>
>
> Where can be problem ?
>
>
>
> Thanks,
>
> Rosen
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
On 31-Aug-2001 _lallous wrote:
> It also depends on the font!
> it might be a fixed font or not a fixed font!
>
True, but the five installed GD fonts are fixed cell fonts.
> "Don Read" <dread
texas.net> wrote in message
> news:XFMail.20010830160307.dread
texas.net...
>>
>> On 30-Aug-2001 John Meyer wrote:
>> > Is there anyway to determine the pixel width of a string?
>> >
>>
>> $font=2;
>> $strpx=imagefontwidth($font) * strlen($str);
>>
>> Regards,
>> --
>> Don Read dread
texas.net
>> -- It's always darkest before the dawn. So if you are going to
>> steal the neighbor's newspaper, that's the time to do it.
>
>
-- Don Read dreadtexas.net -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.
attached mail follows:
Hi Nikola,
You need to add your PHP code to your HTML. I'm sure Dreamweaver allows you to edit the HTML directly, but I don't know how I'm afraid. To check everything's up and running, open Notepad (should be under Start>Programs>Accessories) and paste this in:
---start---
<html> <head> <title>Test PHP page</title> </head> <body> <?php echo "<h1>Hello world!</h1>"; ?> </body> </html>
----end----
If this works, then congratulations - you've just used echo()
If not, give us a shout and someone will help you out :-)
Cheers Jon
-----Original Message-----
From: Nikola Veber [mailto:veber
ptt.yu]
Sent: 31 August 2001 08:59
To: php-general
lists.php.net
Subject: [PHP] help !
Importance: High
I'm sorry I have to ask these stuff, but I havent found anything like this in the manual. I am running win98 with properly insalled xitami web server with php support (I ran installshield). Any way, I cant figure out hov to make a smple program with echo command, because I don't know where to place the code. I am using opera 5.12 as my default browser, and Macromedia Dreamweaver as the html editor. Maybe there is an option in Dreamweaver , but I couldn't find it in it's documentation
Please help !
Nikola Veber
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
********************************************************************** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality'
**********************************************************************
attached mail follows:
In article <67DF9B67CEFAD4119E4200D0B720FA3F70FCBC
BOOTROS>,
jhaworth
witanjardine.co.uk (Jon Haworth) wrote:
> You need to add your PHP code to your HTML. I'm sure Dreamweaver allows you > to edit the HTML directly, but I don't know how I'm afraid.
Yep, just use DW's "HTML Source" view (or open in Homesite) to edit files directly.
-- CC
attached mail follows:
Hi all.
I have this variable cn$ which sometimes is in base64 format and sometimes it isnt. This is how the script looks like. It will get bigger but this is one of the problem i have to get threw first.
If you wonder why i dont use the built in ldap function in PHP i just can tell you that i want to. The compilation doesnt work and i have talked to several OpanLdap persons. So ignore that for now. The problem below is that ldaps $cn is sometimes in base64 format and if it is i need to decode it. I have no problem decoding it my problem is that i need to make it somehow "know" if it is in that format or not. Thankfull for any help.
//Johan
<?php $ldap="/export/scratch/apps3/ldap/bin/ldapsearch"; $string=`$ldap -L uid=$user uid cn department telephoneNumber| awk '{print $0}'`;
$line = explode("\n",$string); $var = array("cn:", "department:","uid:", "telephoneNumber:");
foreach ($var as $varx) { foreach ($line as $str) { if (ereg($varx,$str)) { $newvarx = str_replace (":","",$varx); $tomte[$newvarx] = str_replace($varx,"",$str); } //if } //foreach } //foreach
$cn=$tomte['cn']; $uid=$tomte['uid']; $dep=$tomte['department']; $phone=$tomte['telephoneNumber'];
?> </HTML>
attached mail follows:
hi to all, i have a long string (about 255 characters) and i would like to show only 10. how can i do it?
thanks in advance,
marcos
attached mail follows:
Hi Marcos,
use substr();
http://www.php.net/manual/en/function.substr.php
$string = substr($string, 0, 10);
James
"Marcos Lloret" <mlloret
mail.fujitsu.es> wrote in message
news:019701c131f1$f57bdfa0$371c94c1
mlloret...
hi to all,
i have a long string (about 255 characters) and i would like to show
only 10. how can i do it?
thanks in advance,
marcos
attached mail follows:
$string=abcdefghijklmnopqrstuvxyz $string = substr($string, 0, 10);
Thats all there is to it.
-----Original Message-----
From: Marcos Lloret [mailto:mlloret
mail.fujitsu.es]
Sent: den 31 augusti 2001 09:53
To: php-general
lists.php.net
Subject: [PHP] just 10 characters from a string
hi to all, i have a long string (about 255 characters) and i would like to show only 10. how can i do it?
thanks in advance,
marcos
attached mail follows:
<Original message>
From: Marcos Lloret <mlloret
mail.fujitsu.es>
Date: Fri, Aug 31, 2001 at 09:53:01AM +0200
Message-ID: <019701c131f1$f57bdfa0$371c94c1
mlloret>
Subject: [PHP] just 10 characters from a string
> hi to all, > i have a long string (about 255 characters) and i would like to show only 10. how can i do it? > > thanks in advance, > > marcos
</Original message>
<Reply>
When it's about _showing_ 10 characters, and not to change the string itself:
$yourString = "abcdefghijklmnopqrstuvwxyz"; printf ("%.10s", $yourString);
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
So sprach »Marcos Lloret« am 2001-08-31 um 09:53:01 +0200 : > i have a long string (about 255 characters) and i would like to show only 10. how can i do it?
substr
Alexander Skwar
-- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 1 hour 48 minutes
attached mail follows:
hi,
i'm awared that this is not exactly the correct forum for these questions. please humor me this one time:
1) can anyone refer me please to a public, postable MySQL newsgroup? i've found a few MySQL newsgroups, but none of them allows posting. it would be great if you could also tell me the name of the (public) newsgroup server hosting the group.
if you don't know of a newsgroup, how about a good (digest-capable) mailing list? i've tried the MySQL general mailing list, but they don't offer a 'digest' option and i can't handle getting hundreds of posts a day in my inbox.
2) who can refer me to a good intermediate tutorial to better learn MySQL syntax? again, i've been to mysql.com, but i find the structure & format of the site somehow daunting (not as user-friendly as the annotated manual at php.net).
thanks muchly,
tom
attached mail follows:
> 1) can anyone refer me please to a public, postable MySQL newsgroup? > i've found a few MySQL newsgroups, but none of them allows posting. it > would be great if you could also tell me the name of the (public) > newsgroup server hosting the group. >
Not sure, but a hunt around on groups.google.com might well reveal something.
> 2) who can refer me to a good intermediate tutorial to better learn > MySQL syntax? again, i've been to mysql.com, but i find the structure & > format of the site somehow daunting (not as user-friendly as the > annotated manual at php.net).
Agree about the format of the site :-)
IMHO the best tutorial for MySQL is Paul Dubois' book "MySQL", published by New Riders, which you can grab from amazon or b&n or wherever you usually buy these sorts of things. Takes you from beginner through to funky advanced stuff painlessly and clearly. Highly recommended.
HTH Jon
********************************************************************** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality'
**********************************************************************
attached mail follows:
>i'm awared that this is not exactly the correct forum for these >questions. please humor me this one time:
Hmmm.
>if you don't know of a newsgroup, how about a good (digest-capable) >mailing list? i've tried the MySQL general mailing list, but they don't >offer a 'digest' option and i can't handle getting hundreds of posts a >day in my inbox.
Try the list found at www.mysql.com it's archive: http://lists.mysql.com/ Don't forget to check the archive before you post.. Dunno if it's digest-capable.. you need to find that one out on your own.
>2) who can refer me to a good intermediate tutorial to better learn >MySQL syntax? again, i've been to mysql.com, but i find the structure & >format of the site somehow daunting (not as user-friendly as the >annotated manual at php.net).
www.devshed.com has some good tutorials. Otherwise you could use a searchengine and type some words like: mysql tutorial Should help..
The book MySQL written by Paul DuBois is great..
Bye,
B.
attached mail follows:
HEllo, Did anybody have a luck with a good Chat Program.? Thanks, Mehmet.
===== Mehmet Erisen http://www.erisen.com
__________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com
attached mail follows:
how to insert the new key/value pair into assiosiative array in php.
TIA, Kiat Kin
attached mail follows:
$ar_name[$new_key]=$value;
Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS
----- Original Message -----
From: "Kiat Kin" <return78
yahoo.com>
To: <php-general
lists.php.net>
Sent: Friday, August 31, 2001 12:35 PM
Subject: [PHP] assosiative array in php
> how to insert the new key/value pair into assiosiative array in php.
>
> TIA,
> Kiat Kin
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Hi all,
I am still failing to fix this problem with headers. I receive the following error:
Warning: Cannot add header information - headers already sent by (output started at c:\apache\apache\htdocs\client-secure.php:11) in c:\apache\apache\htdocs\client-secure.php on line 18
Which would indicate that the line 11 is sending output to the browser. Line 11 is:
$uid=$HTTP_SESSION_VARS["userid"];
How can this be sending an output? I also get this:
Warning: Undefined index: userid in c:\apache\apache\htdocs\client-secure.php on line 11
Which would indicate that it cant find the session info. If it cant find it does it write it?
This is not an isolated case. This problem is happening in a few areas of the system yet on the live server everything works a dream!!??
Anyone any ideas?
Cheers
Nic
attached mail follows:
On Fri, 31 Aug 2001, Nic Skitt wrote:
> Warning: Cannot add header information - headers already sent by (output > started at c:\apache\apache\htdocs\client-secure.php:11) in > c:\apache\apache\htdocs\client-secure.php on line 18 > > Which would indicate that the line 11 is sending output to the browser. Line > 11 is: > > $uid=$HTTP_SESSION_VARS["userid"]; > > How can this be sending an output? I also get this:
The error you get isn't saying that line 11 is sending output; the error is saying that output was sent prior to line 11. You'll get the error if you have any code that sends output to STDOUT, or if you have any HTML or even whitespace before your opening PHP tag, and then try to send header data. (Once the browser starts getting the data your PHP script sends to STDOUT and other HTML and spaces, the browser has all the header data its going to use, and sending more is erroneous.)
> Warning: Undefined index: userid in > c:\apache\apache\htdocs\client-secure.php on line 11 > Which would indicate that it cant find the session info. If it cant find it > does it write it?
Make sure you registered userid as a session variable i.e. - session_register("userid");
And/Or make sure you make a call to session_start() before trying to check the session variable(s) if you registered the variable in another script and/or don't have session.auto_start set to 1.
(http://www.php.net/manual/en/ref.session.php)
~Chris /"\ \ / Pine Ribbon Campaign Microsoft Security Specialist X Against Outlook The moron in Oxymoron. / \ http://www.thebackrow.net
attached mail follows:
Chris,
Thanks, Andrey pointed me in the right direction. It was the error output that was causing the headers to be sent ergo more errors :-P
Cheers
Nic
attached mail follows:
"Sondra Russell" <sondra
sondra.com> wrote in message
news:p05100303b7b4263f844e
[212.43.200.227]...
> Hello everyone!
>
> Crazy question:
>
> I've created a little script that reads in .txt files and, with the
> help of phplib templates, matches them up with a collection of
> templates and spits out the beautiful html page.
>
> In order to avoid sending variables through the URL I've stolen this
> bizarre workaround where, when you call
> http://www.mysite.com/somepage.html for example, the apache
> configuration realizes it's a 404 and redirects all 404s through my
> cms script. Then my script looks for
> http://www.mysite.com/somepage.txt and does the rest.
>
> This works beautifully, and my plan was to have a "dev" environment
> that runs against the little CMS system and then wget the whole site
> periodically for the live server (so, the live site actually *is* a
> collection of flat pages).
>
> Beautiful plan, but it turns out that WGET doesn't see the apache
> configuration change that runs all 404s through my CMS script. It
> sees a 404 and tells me its a 404 and then goes back to its coffee
> break, you know?
>
> Anyone else tried this workaround before with similar results?
> Anyone else have a better workaround? Bueller?
>
> Anyway, best,
> Sondra
Make sure to change the header. The page returned will have all the content but the header still says "404" this needs to be changed to "200" so that wget doesn't go off on a coffee break. Try using:
header ("status: 200 OK");
Peter
attached mail follows:
Hello, can anybody suggest me where could i get a script to convert a integer value to a phrase. for eg. "135" to "One Hundred And Thirty Five" thanks in advance. carry
-------------------------------------------------------------------------------------------------- Get real solutions to all your problems.
http://www.salahkarindia.com - India's first advisory Portal
Your friend, advisor, healer,companion!!!
Register now to get free advice on all your problems.
--------------------------------------------------------------------------------------------------
attached mail follows:
<Original message>
From: Carry Ian <carry
bharatnet.com>
Date: Fri, Aug 31, 2001 at 12:36:20PM +0200
Message-ID: <200108311036.f7VAaJS17568
datalink.telemediair.nl>
Subject: [PHP] number to word converter
> Hello, > > can anybody suggest me where could i get a script to convert a integer value to a phrase. > for eg. "135" to "One Hundred And Thirty Five" > > thanks in advance. > > carry
</Original message>
<Reply>
In some spare time I just created this function. It's prob. far from optimal, so maybe you'll have to give a look in order to optimize it. But at least it works.
--- PHP code --- <?
function inttoword ($x) { settype ($x, "string"); $returnString = "";
$digit = array ("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"); $tens = array ("Twenty", "Thirty", "Fourty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety");
$hundred = false; for ($pos = 0; $pos < strlen ($x); $pos++) { $togo = strlen($x)-$pos; $returnString .= " ";
if ($togo > 2) { if ($togo > 3) { $returnString .= inttoword (substr($x, 0, $togo-3)); $returnString .= " Thousand"; $pos += ($togo-4); } else { if ((integer)substr($x, $pos, 1) > 0) { $returnString .= $digit[((integer)substr($x, $pos, 1))-1]; $returnString .= " Hundred"; $hundred = true; } } } elseif ($togo == 2) { if ((integer)substr($x, $pos, 1) == 1) { if ($hundred) $returnString .= "and "; $returnString .= $digit[((integer)substr($x, $pos, 2))-1]; break; } else { if ((integer)substr($x, $pos, 1) > 0) { if ($hundred) $returnString .= "and "; $hundred = false; $returnString .= $tens[((integer)substr($x, $pos, 1))-2]; } $pos++; $returnString .= " "; if ((integer)substr($x, $pos, 1)) { if ($hundred) $returnString .= "and "; $returnString .= $digit[((integer)substr($x, $pos, 1))-1]; } break; } } else { if ($hundred) $returnString .= "and "; $returnString .= $digit[((integer)substr($x, $pos, 1))-1]; } }
return (preg_replace ("/\s+/", " ", preg_replace ("/^\s+/", "", $returnString))); }
?> <PRE> <? print inttoword(11)."\n"; print inttoword(21)."\n"; print inttoword(101)."\n"; print inttoword(152)."\n"; print inttoword(1000)."\n"; print inttoword(101032)."\n"; print inttoword(111111)."\n"; ?> </PRE>
--- End of PHP code ---
Let me know if this is what you're looking for and/or if you have optimized it.
Good luck!
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
<Original message>
From: * R&zE: <renze
datalink.nl>
Date: Fri, Aug 31, 2001 at 02:03:06PM +0200
Message-ID: <20010831140306.B20892
pro-pain.telemediair.nl>
Subject: Re: [PHP] number to word converter
Oh... btw... It works uptil 999999. So you can convert everything between 1 and 999999. Zero (0) cannot be converted (stupid but true, and easy to patch in) and everything >= a million will result in very weird results.
But like I said... it's just a quickly written function and the most used numbers you can convert.
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Here is a slightly more readable number-to-English converter. It will deal with negative numbers and recognizes zero; it's table-driven, so it shouldn't be too hard to convert to other languages.
It will convert anything in +/- 10^30. This should be pretty comprehensive; if not, extend the triplets table (and email me to explain what on Earth you're doing with it!! ;-)
<?php
// Hugh Bothwell hugh_bothwell
hotmail.com
// August 31 2001
// Number-to-word converter
$ones = array( "", " one", " two", " three", " four", " five", " six", " seven", " eight", " nine", " ten", " eleven", " twelve", " thirteen", " fourteen", " fifteen", " sixteen", " seventeen", " eighteen", " nineteen" );
$tens = array( "", "", " twenty", " thirty", " forty", " fifty", " sixty", " seventy", " eighty", " ninety" );
$triplets = array( "", " thousand", " million", " billion", " trillion", " quadrillion", " quintillion", " sextillion", " septillion", " octillion", " nonillion" );
// recursive fn, converts three digits per pass function convertTri($num, $tri) { global $ones, $tens, $triplets;
// chunk the number, ...rxyy $r = (int) ($num / 1000); $x = ($num / 100) % 10; $y = $num % 100;
// init the output string $str = "";
// do hundreds if ($x > 0) $str = $ones[$x] . " hundred";
// do ones and tens if ($y < 20) $str .= $ones[$y]; else $str .= $tens[(int) ($y / 10)] . $ones[$y % 10];
// add triplet modifier only if there // is some output to be modified... if ($str != "") $str .= $triplets[$tri];
// continue recursing? if ($r > 0) return convertTri($r, $tri+1).$str; else return $str; }
// returns the number as an anglicized string function convertNum($num) { $num = (int) $num; // make sure it's an integer
if ($num < 0) return "negative".convertTri(-$num, 0);
if ($num == 0) return "zero";
return convertTri($num, 0); }
?>
and a test fn I wrote,
<?php function randThousand() { return mt_rand(0,999); }
// Returns an integer in -10^9 .. 10^9 // with log distribution function makeLogRand() { $sign = mt_rand(0,1)*2 - 1; $val = randThousand() * 1000000 + randThousand() * 1000 + randThousand(); $scale = mt_rand(-9,0);
return $sign * (int) ($val * pow(10.0, $scale)); }
// example of usage for ($i = 0; $i < 20; $i++) { $num = makeLogRand(); echo "<br>$num: ".convertNum($num); } ?>
Usage is simple: convertNum(integer) returns a string, the value in English.
Hope this helps.
attached mail follows:
Hello!
I have a question regarding sessions when
register_globals = off
in php.ini
Using the example from www.php.net:
<? session_register("count"); $HTTP_SESSION_VARS["count"]++; ?>
This works well when
session.save_handler = files
However, when
session.save_handler = user
where the "user" functions are the ones found on phpbuilder.com. It turns out that the sess_write rountine is NEVER called, ie. session_registered variables aren't saved.
I thought there was something wrong with the customer-handler but for debugging purposes, I took out everything except things like:
function sess_write ($key, string value) { echo ( "sess_write was called.<br>"); }
and yet, it was ever called! Other functions like read, gc, destory works great.
However, if I change php.ini to
register_globals = ON
Then the above sess_write function would be called!
Is this a known problem, or am I missing something?
reg.
attached mail follows:
A colegue of mine said to me a month ago that in the routines on phpbuilder.com there are one or few bugs. Look at the code. The problem is in session handlers.
Hope this will help you.
Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS
----- Original Message -----
From: "php-jp" <php-jp
typhoon.jp>
To: <php-general
lists.php.net>
Sent: Friday, August 31, 2001 1:56 PM
Subject: [PHP] session.save_handler = user
> Hello!
>
> I have a question regarding sessions when
>
> register_globals = off
>
> in php.ini
>
> Using the example from www.php.net:
>
> <?
> session_register("count");
> $HTTP_SESSION_VARS["count"]++;
> ?>
>
> This works well when
>
> session.save_handler = files
>
> However, when
>
> session.save_handler = user
>
> where the "user" functions are the ones found on phpbuilder.com. It
> turns out that the sess_write rountine is NEVER called, ie.
> session_registered variables aren't saved.
>
> I thought there was something wrong with the customer-handler but for
> debugging purposes, I took out everything except things like:
>
> function sess_write ($key, string value) {
> echo ( "sess_write was called.<br>");
> }
>
> and yet, it was ever called! Other functions like read, gc, destory
> works great.
>
> However, if I change php.ini to
>
> register_globals = ON
>
> Then the above sess_write function would be called!
>
> Is this a known problem, or am I missing something?
>
> reg.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Jack,
You can either check your text field with JavaScript before submitting your form or after on server-side with PHP. I prefer to use JavaScript because it saves a back and forth.
here an example of that :
http://1ppl.free.fr/scripts/javascript16.htm
For the printing function, check that :
http://1ppl.free.fr/scripts/javascript04.htm
Enjoy :-)
"Jack" <jack
nedcor.com> wrote in message
news:20010831093314.29759.qmail
pb1.pair.com...
> Dear all
> I want to ask if i want to perform two task after the user had click a
> button,
> 1 is the task perform by PHP
> 2 is the task perform by JavaScript
> is it possible to do so?
>
> I'm actually fresh on JavaScript, before i would call the JavaScript, what
> should i do first or what should i set before though?
>
> Thx
> Jack
> jack
nedcor.com
>
>
attached mail follows:
Jack, Yes this is possible. I assume you want to use a javascript onClick event function. Then in your javasript code, just execute your PHP code. You can run PHP code within a javascript block. For example, on my site I assign a javascript variable to the value held in a PHP variable like this:
var jstitle = <? print("\"" . $article_array[1][0] . "\""); ?>;
Good luck,
Johan Which World? www.pongworld.com
-----Original Message-----
From: Jack [mailto:jack
nedcor.com]
Sent: Friday, August 31, 2001 2:13 AM
To: php-general
lists.php.net; php-windows
lists.php.net
Subject: [PHP] Can PHP and Java work together?
Dear all I want to ask if i want to perform two task after the user had click a button, 1 is the task perform by PHP 2 is the task perform by JavaScript is it possible to do so?
I'm actually fresh on JavaScript, before i would call the JavaScript, what should i do first or what should i set before though?
Thx
Jack
jack
nedcor.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Is there a way to force re-authentication without closing and re-opening the browser.
Thanks Boris
attached mail follows:
Won't sending a 401 header do the trick?
<?php header("WWW-Authenticate: Basic realm='my realm'"); header("HTTP/1.0 401 Unauthorized"); ?>
Not sure, but worth a try.
Cheers Jon
-----Original Message-----
From: Boris [mailto:boris
episteme.no]
Sent: 31 August 2001 13:08
To: php-general
lists.php.net
Subject: [PHP] HTTP authentication
Is there a way to force re-authentication without closing and re-opening the browser.
Thanks Boris
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
********************************************************************** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality'
**********************************************************************
attached mail follows:
On Thu, 30 Aug 2001, Rasmus Lerdorf wrote:
> Just do a putenv() from PHP?
We've tried doing that - that's how c-client normally wants to learn about the krb4 ticket file (with the KRBTKFILE variable).
But... something is caching the KRBTKFILE value in appropriately, and it's not getting reset each time php is accessed. We're pretty sure the problem lies with c-client (probably the krb4 kerberos patches - that it expect to be called in a single-user kinda situation, such as from pine, so it doesn't clean up after itself properly). Rather than rely on c-client seeing the KRBTKFILE variable, we're trying hard code the name of the ticketfile into c-client.. which, on our webservers, will *always* be /ticket/kerb.username (ie /ticket/kerb.liamr) My post for 8/29 describe the actualy problem in more detail.
We had gotten around this by running PHP as a CGI - to make it get a fresh copy of the environment everytime.. but at this point in the game we really need to run it as a server module.
So, we're trying to correct for this in the source code of the krb4 patches to c-client.. but we can't get the user name into it.
php_imap.c stores the value we want in imap->user, but we can't find it again once php_imap.c calls c-client itself. We'd expected it to be in mb->user, but that variable is empty.. and that little piece of printenv code we tried shows the c-client knows about the HTTP_ENV_VARS class of variables, but not the HTTP_SERVER_VARS variables.
Liam
> On Fri, 31 Aug 2001, Liam Hoekenga wrote: > > > we're trying to get a krb4 c-client working with php built as an apache > > server module (either dso or static). > > > > we've hit a wall in that, c-client itself seems to have access to the > > environment in which apache was started, but not the apache environment. > > > > ie... we threw this into c-client: > > > > { > > extern char **environ; > > > > int i; > > > > for ( i = 0; environ[ i ] != NULL; i++ ) { > > fprintf( stderr, "%s\n", environ[ i ] ); > > } > > } > > > > and the environment that c-client itself can see is: > > [Fri Aug 31 00:22:19 2001] [info] Server built: Aug 30 2001 12:11:45 > > APACHE=/usr/local/httpsd/bin/httpsd > > AWK=/usr/bin/awk > > GREP=/usr/bin/grep > > HOME=/ > > KRBTKFILE=/ticket/p1090525904 > > PIDFILE=/usr/local/httpsd/log/httpd.pid > > PS=/usr/bin/ps > > PWD=/ > > USER=nobody > > > > ie - the same stuff phpinfo() lists under HTTP_ENV_VARS. We really need > > access to the HTTP_SERVER_VARS (we're revising the krb4 imap patches for > > c-client, *really* need access to REMOTE_USER from within c-client > > itself). > > > > does anyone have suggestions? > > > > Liam > > > > > > >
attached mail follows:
Just restart the web server -- IIS or Apache
Miles
At 02:06 PM 8/31/01 +0800, Raphael Pirker wrote:
>Hi,
>
>i just moved my PHP project from my local PC to the online webserver and I
>will need to do a few adjustments to the server. since the server is used by
>all the employees in the company, there is no chance I can reboot it without
>prior notice... my question: is there any way I can refresh the changes I
>make in php.ini without doing a reboot?
>
>TIA,
>
>Raphael
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Greetungs.
Is it possible to use data collected in a form ON THE SAME PAGE without using the form's "submit" button? In other words, if a text field is filled in, can I capture (via PHP or other means) the info typed there and display it elsewhere on the same page?
I realize the answer may very well be "NO," but if it is possible, it would certainly make my life easier this morning.
Thanks in advance.
Kenn
attached mail follows:
<Original message>
From: webmaster <webmaster
bakergrfx.com>
Date: Fri, Aug 31, 2001 at 07:46:41AM -0500
Message-ID: <003001c1321a$fb84afc0$ad000001
august.net>
Subject: [PHP] form data used on the same page?
> Greetungs. > > Is it possible to use data collected in a form ON THE SAME PAGE without > using the form's "submit" button? In other words, if a text field is filled > in, can I capture (via PHP or other means) the info typed there and display > it elsewhere on the same page? > > I realize the answer may very well be "NO," but if it is possible, it would > certainly make my life easier this morning. > > Thanks in advance. > > Kenn
</Original message>
<Reply>
JavaScript is your solution!
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
>I've got a website, we'll call it MainDomain.com. > >I created a specialty site in a sub-directory. We'll call the >sub-directory Widgets. > >I want a different domain to point to that sub directory. We'll call the >new domain WidgetWorld.com > >My webhost will allow me to park WidgetWorld.com at MainDomain.com. >However, if someone goes to WidgetWorld.com, it would pull up the index >page for MainDomain.com. > >How can I use PHP to detect if the visitor wanted MainDomain.com (and >display MainDomain/index.php) or WidgetWorld.com (and then display >MainDomain/Widgets/index.php).
$HTTP_HOST - not sure if all browsers use this though(read older non 1.1 compliant)
Another question would be why do NamedVirtualHost and have an entry for that domain point to their directory in your Apache conf file (if using apache). Otherwise I get teh impression that you would have to wrap every conceivable page on the sub-directory site in the main directory with the redirect PHP script...
ie, yes, if I request just the domain name your index page can redirect to a sub-directory... however if I request WidgetWorld.com/thispage.php the requests will go to MainDomain.com/thispage.php and will return 404 error if it doesn't exist
follow my concern?
Dave
attached mail follows:
This is a one-time mailing only. You are receiving this message because you recently submitted to one of our websites -- this is simply an attempt to update our files by verifying your email address Php-general
lists.php.net at 206.43.192.76
***********************************************************
Dear Patron,
By popular request, we have designed a FREE newsletter titled . . .
"Abundant Living Online"
. . containing information on a wide variety of topics designed to enhance your experiences both online and offline, including:
=> useful and innovative websites => highest-rated homebased businesses => incredible travel deals => important health & nutrition tips => freebies => and much more!
We would like to invite you to subscribe to this FREE newsletter, and enjoy a free vacation weekend as our thank-you gift. Simply click on the following link and fill out the form on the website (there are absolutely NO strings attached):
http://aolms.vacation-4-free.com/abundantliving/
For business questions or comments, we can be reached at:
abundantliving
aolms.com
Sincerely,
Abundant Living
*********************************************************** NOTE: This email is sent in compliance with our strict anti-abuse regulations. We are attempting to verify your email address. This message is only a request to verify. It is not in any way to be construed as a commercial message. If you do not wish to receive any mail from our servers, do not reply to this email nor click on any of the above links. If you wish to have your email address permanently blocked from our servers from further verification requests please go to http://inetekk.com/abuse.html
Thank you, Abundant Living
attached mail follows:
Hello,
Zeev Suraski wrote: > > At 01:40 31-08-01, Manuel Lemos wrote: > >Whoever hears you may even believe that Microsoft products and > >supporting sites are successful because they don't have flaws. Sorry, > >but honestely this sounds like an excuse for not doing it. > > Microsoft chooses which sites it links from microsoft.com *very* carefully > - a very small select number of sites gets connected to it, and usually > only for specific purposes (e.g., a specific article). If you draw a > comparison to the PHP world, you actually proved my point.
That hasn't much to do what I was saying, but, anyway your are not linking to anybody in either php.net or zend.com , apart from the links section and the directory that do not give a big deal of visibility.
> >The problem is not PHP-GUI capabilities being able to compete with other > >languages. The problem is that you seem to be willing to omit them when > >you present PHP as if it is something you don't want PHP be known for. > > I actually mention PHP-GTK in my sessions. I mention it as an anecdote, > much like I mention some of the other interesting modules and projects in > PHP (e.g., PEAR). I'm really not sure why people think I'm trying to bury > PHP-GTK. Just because I don't see PHP-GTK as a main course of PHP, doesn't > mean I don't think it's an important and useful project.
Oh, man, do you really do that? That is worse than not mention it at all. You may be joking but not everybody may understand it that way. Doing that you ruining the credibility of those efforts that take PHP far out what originally it was meant for. If you are going to just make it a joke, you'd better not mention it at all. I think that is extremely unfair for people like Andrei and other that worked so much on it! :-(
> >In this company, they have choose Microsoft stuff because they think it > >is the right choice for what they do. For some things, PHP could be a > >better choice, but it would be hard to convince who is in charge above > >me because PHP does not benefit of a great credibility in the market > >that would help me to make a good case to switch to PHP. > > In the US (and perhaps in the rest of America), that's relatively > true. That's not the case in Europe or the far east. It has a lot to do > with mentality and corporate culture.
So, what? Even if it is like you say, because you have this perception that it is not that way in Europe and far east, you are not going to do anything to help people living in the Americas to make a better case for PHP in the corporate world?
Regards, Manuel Lemos
attached mail follows:
Php'ers:
These are great points that have been brought up (a kinda synopsis, since we are repeating here :)
<synopsis> 1) some want direct marketing 2) Some believe the status quo is enough 3) all agreee php is useful as a web development tool/language 4) some agree that it can/should be more (GTK/Command Line etc)
This originally started as a call to php'ers to step up and market the language so that it can compete more vitally in a larger market. Both Rasmus and Zeev have stated that they believe they are doing just that via conferences and Zend. Mr Lemos et al believe that more should be done. A more constructive targeted aim at the .NET and Java based crowd. Several solutions/ideas have been suggested one of which is a poll/display of quality/imaginative etc php sites. Another suggested that php go the way of BIND and APACHE and that the wait will pay off with the volume of users in 10-12 years.
</synopsis>
Good Day! --ccma
attached mail follows:
Actually this originally started (If you're referring to the thread itself) with my question as to what to tell my JSP-loving buddy that PHP isn't an antiquated and dying language/processing system.
I NEVER would have thought it was balloon into this conversation!
On 8/31/2001 10:29 AM this was written:
> This originally started as a call to php'ers to step up and market the > language so that it can compete more vitally in a larger market. > Both Rasmus and Zeev have stated that they believe they are doing just that > via conferences and Zend. Mr Lemos et al believe that more should be done. A > more constructive targeted aim at the .NET and Java based crowd. Several > solutions/ideas have been suggested one of which is a poll/display of > quality/imaginative etc php sites. Another suggested that php go the way of > BIND and APACHE and that the wait will pay off with the volume of users in > 10-12 years.
--Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
attached mail follows:
looks bright.
attached mail follows:
> <synopsis> > 1) some want direct marketing > 2) Some believe the status quo is enough > 3) all agreee php is useful as a web development tool/language ...
Did you open source your thread filter program? :)
Good job anyway. For me the most important point is that the developer/maintainer of the language are focusing on making the best web development language out there. (even if it is already the best)
py
----- Original Message -----
From: "Christopher CM Allen" <callen
driver8.org>
To: <mlemos
acm.org>; <php-general
lists.php.net>
Sent: Friday, August 31, 2001 10:29 AM
Subject: Re: [PHP] The future of PHP
> Php'ers:
>
> These are great points that have been brought up (a kinda synopsis, since
we
> are repeating here :)
>
> <synopsis>
> 1) some want direct marketing
> 2) Some believe the status quo is enough
> 3) all agreee php is useful as a web development tool/language
> 4) some agree that it can/should be more (GTK/Command Line etc)
>
> This originally started as a call to php'ers to step up and market the
> language so that it can compete more vitally in a larger market.
> Both Rasmus and Zeev have stated that they believe they are doing just
that
> via conferences and Zend. Mr Lemos et al believe that more should be done.
A
> more constructive targeted aim at the .NET and Java based crowd. Several
> solutions/ideas have been suggested one of which is a poll/display of
> quality/imaginative etc php sites. Another suggested that php go the way
of
> BIND and APACHE and that the wait will pay off with the volume of users
in
> 10-12 years.
>
> </synopsis>
>
> Good Day!
> --ccma
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Thanks Jack !!!!
arcad.
"Jack Dempsey" <dempsejn
georgetown.edu> wrote in message
news:3B8F0619.2A3CC915
georgetown.edu...
> you have to use $GLOBALS["SCRIPT_FILENAME"]
>
> jack
>
> "Arcadius A." wrote:
>
> > Hello !
> > Why this script prints an empty string(it prints nothing) as the
value of
> > the variable "u" ?
> > This happens even if $REQUEST_URI or PHP_SELF is used instead of
> > SCRIPT_FILENAME .
> > Thanks...
> >
> > <?
> > function menu( $theurl)
> > {
> > //global $u ;
> > $u = $SCRIPT_FILENAME;
> > echo $u;
> > echo $theurl;
> > }
> > ?>
> >
> > Hello there !!!
> >
> > <? menu(hoho.com) ?>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
So sprach »Arcadius A.« am 2001-08-31 um 05:27:04 -0700 : > $u = $SCRIPT_FILENAME;
Because you did not define $SCRIPT_FILENAME anywhere. If you want to access the global variable, you've got to say so:
global $SCRIPT_FILENAME;
Alexander Skwar
-- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 1 hour 46 minutes
attached mail follows:
> So sprach »Arcadius A.« am 2001-08-31 um 05:27:04 -0700 : > > $u = $SCRIPT_FILENAME; > Because you did not define $SCRIPT_FILENAME anywhere. If you want to > access the global variable, you've got to say so: > global $SCRIPT_FILENAME;
Or, so you don't have to specify all the variables you are using as globals (especially if you are using *alot* of them), you can use:
$GLOBALS[SCRIPT_FILENAME];
Chris
attached mail follows:
So sprach »Boget, Chris« am 2001-08-31 um 10:04:49 -0500 : > Or, so you don't have to specify all the variables you are using > as globals (especially if you are using *alot* of them), you can > use: > > $GLOBALS[SCRIPT_FILENAME];
What's the gain? 'global ' has 7 characters, whereas '$GLOBALS[]' has 10 characters. So, you don't type less. And with using global(), the code is more orderly, and thus easier to read.
Alexander Skwar
-- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 2 hours 0 minutes
attached mail follows:
> > Or, so you don't have to specify all the variables you are using > > as globals (especially if you are using *alot* of them), you can > > use: > > $GLOBALS[SCRIPT_FILENAME]; > What's the gain? 'global ' has 7 characters, whereas '$GLOBALS[]' has > 10 characters. So, you don't type less. And with using global(), the > code is more orderly, and thus easier to read.
True. But take the following function:
function processLotsOfFormVars() { global $fieldOne, $fieldTwo, $fieldThree, $fieldFour; global $fieldFive, $fieldSix, $fieldSeven; global $PHP_SELF, $REQUEST_URI; global $HTTP_REFERER;
echo "Field One is: $fieldOne<br>\n"; echo "Field Two is: $fieldTwo<br>\n"; // etc }
OR you can do it this way:
function processLotsOfFormVars() { echo "Field One is: $GLOBALS[fieldOne]<br>\n"; echo "Field Two is: $GLOBALS[fieldTwo]<br>\n"; // etc }
I've done it both ways. I'm not advocating using "$GLOBALS[var_name];" over "global $var_name", just that it is an alternative if you are using alot of global variables in a function. Plus, if the function gets large, it's easier to see where the value is coming from by using the $GLOBALS variable. That's all I was saying.
Chris
attached mail follows:
RE: [PHP] PHP_SELF or REQUEST_URI within Function ?Ok Men !!!..... Now I see .... thanks alot for the inputs ! :o))
Arcad
----- Original Message -----
From: Boget, Chris
To: 'Alexander Skwar'
Cc: Arcadius A. ; php-general
lists.php.net
Sent: Friday, August 31, 2001 8:22 AM
Subject: RE: [PHP] PHP_SELF or REQUEST_URI within Function ?
> > Or, so you don't have to specify all the variables you are using > > as globals (especially if you are using *alot* of them), you can > > use: > > $GLOBALS[SCRIPT_FILENAME]; > What's the gain? 'global ' has 7 characters, whereas '$GLOBALS[]' has > 10 characters. So, you don't type less. And with using global(), the > code is more orderly, and thus easier to read.
True. But take the following function:
function processLotsOfFormVars() { global $fieldOne, $fieldTwo, $fieldThree, $fieldFour; global $fieldFive, $fieldSix, $fieldSeven; global $PHP_SELF, $REQUEST_URI; global $HTTP_REFERER;
echo "Field One is: $fieldOne<br>\n"; echo "Field Two is: $fieldTwo<br>\n"; // etc }
OR you can do it this way:
function processLotsOfFormVars() { echo "Field One is: $GLOBALS[fieldOne]<br>\n"; echo "Field Two is: $GLOBALS[fieldTwo]<br>\n"; // etc }
I've done it both ways. I'm not advocating using "$GLOBALS[var_name];" over "global $var_name", just that it is an alternative if you are using alot of global variables in a function. Plus, if the function gets large, it's easier to see where the value is coming from by using the $GLOBALS variable. That's all I was saying.
Chris
attached mail follows:
So sprach »Boget, Chris« am 2001-08-31 um 10:22:28 -0500 : > True. But take the following function: > > function processLotsOfFormVars() { > global $fieldOne, $fieldTwo, $fieldThree, $fieldFour; > global $fieldFive, $fieldSix, $fieldSeven; > global $PHP_SELF, $REQUEST_URI; > global $HTTP_REFERER; > > echo "Field One is: $fieldOne<br>\n"; > echo "Field Two is: $fieldTwo<br>\n"; > // etc > } > > OR you can do it this way: > > function processLotsOfFormVars() { > echo "Field One is: $GLOBALS[fieldOne]<br>\n"; > echo "Field Two is: $GLOBALS[fieldTwo]<br>\n"; > // etc > }
Uh? I don't see it. The "matching" function 1 is:
function processLotsOfFormVars() { global $fieldOne; global $fieldTwo;
echo "Field One is: $fieldOne<br>\n"; echo "Field Two is: $fieldTwo<br>\n"; }
this quite doesn't look as intimidating as the piece you wrote. And even if there are 10 lines of 'global', I still like it a lot better, because it CLEARLY shows which form vars are going to be used.
One of the downside of PHP IMHO is, that you do not have to define variables. This leads to a lot of errors. At least there should be a "option", which forces you to define variables, like maybe so:
dim $some_var;
this leads to easier readable code IMHO.
> variables in a function. Plus, if the function gets large, > it's easier to see where the value is coming from by using > the $GLOBALS variable.
Now, that's the point I'm arguing here. I don't think so.
Alexander Skwar
-- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 2 hours 10 minutes
attached mail follows:
> One of the downside of PHP IMHO is, that you do not have to define > variables. This leads to a lot of errors. At least there should be a > "option", which forces you to define variables, like maybe so: > dim $some_var;
I definitely agree there. I've been bitten by this bug more times than I can count. Granted, it's always been my fault, but it would have been nice to have something there to say "hey, this variable hasn't been defined". I know you can make PHP do this if you set the error checking very, very high but in doing so, you are also opening up another bucket of worms that you don't always need to deal with.
> > variables in a function. Plus, if the function gets large, > > it's easier to see where the value is coming from by using > > the $GLOBALS variable. > Now, that's the point I'm arguing here. I don't think so.
This is definitely a matter of coding style. Neither of us are wrong, just a matter of preference. In replying, I was simply offering alternatives so that Arcadius would know all options open to him. I wasn't trying to say your way was erroneous and if I came off that way, my apologies.
Chris
attached mail follows:
Cool ... Now that we're talking about PHP .... I'd like to ask a question .... You know the "overloading" function in C++ .... Is that possible in PHP ?
Basically , I'd like to define more than one function having the same name but different number of variables/parameters ... so PHP would know which one I'm calling depending on the numbwer/type of the variables ... exemple :
<? function arcad_func( $var_a ) { echo $vara ; } ; function arcad_func( $var_a , $var_b ) { echo $vara . $var_b ; } ?>
<? arcad_func("Hello!"); arcad_func("Hello" , "World!") ?>
Would this work ?
Thanks...
----- Original Message -----
From: "Alexander Skwar" <ASkwar
digitalprojects.com>
To: "Boget, Chris" <Chris.Boget
wild.net>
Cc: "Arcadius A." <ahouans
sh.cvut.cz>; <php-general
lists.php.net>
Sent: Friday, August 31, 2001 8:21 AM
Subject: Re: [PHP] PHP_SELF or REQUEST_URI within Function ?
> So sprach »Boget, Chris« am 2001-08-31 um 10:22:28 -0500 : > > True. But take the following function: > > > > function processLotsOfFormVars() { > > global $fieldOne, $fieldTwo, $fieldThree, $fieldFour; > > global $fieldFive, $fieldSix, $fieldSeven; > > global $PHP_SELF, $REQUEST_URI; > > global $HTTP_REFERER; > > > > echo "Field One is: $fieldOne<br>\n"; > > echo "Field Two is: $fieldTwo<br>\n"; > > // etc > > } > > > > OR you can do it this way: > > > > function processLotsOfFormVars() { > > echo "Field One is: $GLOBALS[fieldOne]<br>\n"; > > echo "Field Two is: $GLOBALS[fieldTwo]<br>\n"; > > // etc > > } > > Uh? I don't see it. The "matching" function 1 is: > > function processLotsOfFormVars() { > global $fieldOne; > global $fieldTwo; > > echo "Field One is: $fieldOne<br>\n"; > echo "Field Two is: $fieldTwo<br>\n"; > } > > this quite doesn't look as intimidating as the piece you wrote. And > even if there are 10 lines of 'global', I still like it a lot better, > because it CLEARLY shows which form vars are going to be used. > > One of the downside of PHP IMHO is, that you do not have to define > variables. This leads to a lot of errors. At least there should be a > "option", which forces you to define variables, like maybe so: > > dim $some_var; > > this leads to easier readable code IMHO. > > > variables in a function. Plus, if the function gets large, > > it's easier to see where the value is coming from by using > > the $GLOBALS variable. > > Now, that's the point I'm arguing here. I don't think so. > > Alexander Skwar > -- > How to quote: http://learn.to/quote (german) http://quote.6x.to (english) > Homepage: http://www.digitalprojects.com | http://www.iso-top.de > iso-top.de - Die günstige Art an Linux Distributionen zu kommen > Uptime: 2 days 2 hours 10 minutes >
attached mail follows:
> Cool ... > Now that we're talking about PHP .... > I'd like to ask a question .... > You know the "overloading" function in C++ .... Is that > possible in PHP ?
No, I do not believe so. > Basically , I'd like to define more than one function having > the same name but different number of variables/parameters ... > so PHP would know which one I'm calling depending on the > numbwer/type of the variables ... exemple :
You can do this with variable parameters. Something along these lines:
function myFunc( $requiredVar, $optionalVar1 = "", $optionalVar2 = "" ) { echo "$requiredVar<br>\n";
if( $optionalVar1 ) { echo "$optionalVar1<br>\n";
} // etc. }
Alternately, if you need *alot* of optional vars, consider passing an array and check that.
Chris
attached mail follows:
> One of the downside of PHP IMHO is, that you do not have to define > variables. This leads to a lot of errors. At least there should be a > "option", which forces you to define variables, like maybe so:
I've not followed this thread but this is pretty much what E_NOTICE is for, turn it on in error_reporting and it'll tell you every undefined variable. Do this in php.ini or with error_reporting function. In fact, one _should_ develop with E_ALL on.
if ($var) // will produce a Warning if $var is not set
echo $notset; // ditto
$arr[somekey] // Warning if constant variable somekey is not defined (i.e. use 'quotes')
$arr['key'] // Warning if key 'key' not defined
See :
http://www.php.net/manual/en/phpdevel-errors.php http://marc.theaimsgroup.com/?l=php-general&m=99486381324867
Much more can be said, hope the above helps.
Regards, Philip Olson
attached mail follows:
Ok .....I see.... Thanks to you both ! Have a nice weekend !!!! Arcad
attached mail follows:
So sprach »Arcadius A.« am 2001-08-31 um 17:36:51 -0700 : > Would this work ?
Kinda, but not really.
If you want to do this, you've got to stuff it all in one function, like so:
function dunno($mandatory, $optional1 = NULL, $opt2 = NULL){ if (NULL === $optional1){ // behave, as if only $mandatory is set echo 'mandatory is: ' . $mandatory; return; } if (NULL === $optional2){ // behave, as if $man. and $opt1 have set echo 'mand is : ' . $mandatory; echo 'opt1 is : ' . $optional1; return; } // neither $opt1 nor $opt2 are null echo 'mand is : ' . $mandatory; echo 'opt1 is : ' . $optional1; echo 'opt2 is : ' . $opt2; return; }
Alexander Skwar
-- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 2 hours 31 minutes
attached mail follows:
but why i should use move_uploaded_file and similar functions instead of a simple copy command??
which is the security hole related to the use of copy??
At the php site is strongly encouraged the use of these functions, but i don't know why, where's the problem??
---------------------
Federico Marani
flagzenNO-SPAM
libero.it
---------------------
attached mail follows:
You have to move or delete your file so it have not te be in the /tmp after your script finishes or /tmp will get crowdy.
Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS
----- Original Message -----
From: "---" <flagzen
libero.it>
To: <php-general
lists.php.net>
Sent: Friday, August 31, 2001 4:35 PM
Subject: [PHP] move_uploaded_file and related question
> but why i should use move_uploaded_file and similar functions instead of a
> simple copy command??
>
> which is the security hole related to the use of copy??
>
> At the php site is strongly encouraged the use of these functions, but i
> don't know why, where's the problem??
>
>
> ---------------------
> Federico Marani
> flagzenNO-SPAM
libero.it
> ---------------------
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Hi,
I thought as much.. And no, dont want to use frames.. Id rather just have the URL shown in the Location Field..
I do realise, there is no real way to ever hide the URL, however, I just dint want to make it too obvious for the users to bookmark or pass around to people who are not authorized to view the page..
However, thanks for the reply..
* R&zE: wrote:
> <Reply>
>
> There's actually no good way to achieve it in a different way. You
> could include/require the new page, but that's actually what you
> don't want (<quote>Besides printing the page in the script
> itself</quote>).
> But there is a different way to do it. It concerns the frame-layout,
> though. 'Cause if you use frames, the URL of one of the frames will
> not be shown in the location bar. But then you'll have to use
> frames, which I don't know if you want.
> One thing I can tell you though... of a page that's being shown, you
> cannot hide the URL. Never.
>
> </Reply>
>
> --
>
> * R&zE:
>
> -- »»»»»»»»»»»»»»»»»»»»»»»»
> -- Renze Munnik
> -- DataLink BV
> --
> -- E: renze
datalink.nl
> -- W: +31 23 5326162
> -- F: +31 23 5322144
> -- M: +31 6 21811143
> --
> -- Stationsplein 82
> -- 2011 LM HAARLEM
> -- Netherlands
> --
> -- http://www.datalink.nl
> -- ««««««««««««««««««««««««
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
<Original message>
From: Ashwin Kutty <Ashwin.Kutty
Dal.Ca>
Date: Fri, Aug 31, 2001 at 10:44:04AM -0300
Message-ID: <3B8F94A4.BA594E86
Dal.Ca>
Subject: Re: [PHP] header() + link..
> Hi, > > I thought as much.. And no, dont want to use frames.. Id rather just have the > URL shown in the Location Field.. > > I do realise, there is no real way to ever hide the URL, however, I just dint > want to make it too obvious for the users to bookmark or pass around to people > who are not authorized to view the page.. > > However, thanks for the reply..
</Original message>
<Reply>
Ehmmm... You say that people who aren't authorized aren't allowed to see the page (which makes sense ;). I don't know ofcourse how you take care of things, but for me it's no problem if unauthorized people get URL's where they shouldn't look. I mean... the server just denies access. Problem solved!
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
This line in my code : imageCopy($im,$source,10,10,0,0,$this->width,$this->height); Give me a segmentation fault in apache : [Fri Aug 31 13:58:43 2001] [notice] child pid 4158 exit signal Segmentation fault (11)
If I replace this fonction by imageCopyMerge($im,$source,10,10,0,0,$this->width,$this->height,100); (which, according the documentation, sould give the same result as imageCopy) I have no segmentation fault, but some images got a very bad aspect, like in 16 colors or so...
My configuration : PHP 6.0.4 Configuration Commande : './configure' '--with-mysql' '--enable-ftp' '--enable-track-vars' '--with-gd' '--enable-native-tt' '--with-freetype-dir=/usr/local' '--with-jpeg-dir' '--with-png-dir' '--with-zlib-dir' '--with-apache=../apache_1.3.19' '--enable-track-vars' '--enable-sockets' '--enable-trans-sid'
Thanks a lot.
-- Matthieu Brunet - matthieu.brunetreseau-photo.com Réseau-Photo S.A. - http://www.reseau-photo.com 15, rue du Général Campredon - 34000 Montpellier Tél. : 04 67 58 07 08 - Fax : 04 67 58 03 04 Icq : 119683958
attached mail follows:
Sorry for my ignorance.
I just saw some PHP syntax that I am not aware of. Could someone please shed
some light on this.
What is the purpose of the
in the following call to the PHP mail method?
mail( /* some parameters */ );
If I remove the
, then php compiler complains.
Thank you in advance.
attached mail follows:
The
suppresses any warning/error messages that are produced - hence the
complaints when it's taken out :-)
Cheers Jon
-----Original Message-----
From: Erols [mailto:anas
erols.com]
Sent: 31 August 2001 01:06
To: php-general
lists.php.net
Subject: [PHP] PHP Syntax question.
Sorry for my ignorance.
I just saw some PHP syntax that I am not aware of. Could someone please shed
some light on this.
What is the purpose of the
in the following call to the PHP mail method?
mail( /* some parameters */ );
If I remove the
, then php compiler complains.
Thank you in advance.
********************************************************************** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality'
**********************************************************************
attached mail follows:
I have a form that reads in a couple variables via:
<input type=textbox name=bob1> <input type=textbox name=bob2> <input type=textbox name=bob3> <input type=textbox name=bob4>
Now... I want to read in those variables in something like the following:
for($i=1;$i<4;$i++) { echo "$bob$i"; }
BUT.... that obviously doesn't work, it simple prints 1, so how to I make it echo the value of the variable bob1?
-Hass
Get 250 color business cards for FREE! http://businesscards.lycos.com/vp/fastpath/
attached mail follows:
<Original message>
From: Ninety-Nine Ways To Die <ninetyninewaystodie
lycos.com>
Date: Fri, Aug 31, 2001 at 10:28:56AM -0400
Message-ID: <NLFHEPCPJCOLJAAA
mailcity.com>
Subject: [PHP] Variable Syntax Question
> I have a form that reads in a couple variables via: > > <input type=textbox name=bob1> > <input type=textbox name=bob2> > <input type=textbox name=bob3> > <input type=textbox name=bob4> > > Now... I want to read in those variables in something like the following: > > for($i=1;$i<4;$i++) { > echo "$bob$i"; > } > > BUT.... that obviously doesn't work, it simple prints 1, so how to I make it echo the value of the variable bob1? > > -Hass
</Original message>
<Reply>
for ($i = 1; $i < 4; $i++) { $myVar = "bob$i"; print ($$myVar); }
</Reply>
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
<Original message>
From: * R&zE: <renze
datalink.nl>
Date: Fri, Aug 31, 2001 at 04:36:36PM +0200
Message-ID: <20010831163636.A29057
pro-pain.telemediair.nl>
Subject: Re: [PHP] Variable Syntax Question
Btw... Why not just use an array?
<input type="text" name="bob[]"> <input type="text" name="bob[]"> <input type="text" name="bob[]"> <input type="text" name="bob[]">
and then:
foreach ($bob as $myValue) { print ($myValue); }
That's a much nicer solution...
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
On Thu, 30 Aug 2001 17:06:38 -0500, gbland
worldnet.att.net (Gary)
wrote:
>Can someone tell me why I am getting an error for the second line below. >It works locally but not live. > > <?php > $filename = "www/name/test/free.txt"
missing semicolon there.
tiger
attached mail follows:
I am looking for a good, practical tutorial on what I should be doing as a developer to create a secure web site (PHP related). I have looked in my PHP text and searched the web, but haven't found anything real useful. I am not interested in Apache or OS security, as this is -hopefully- taken care of by my webhost. So if you know of a good guide, online or off, please contribute.
Thanks,
Johan PongWorld.com
attached mail follows:
Great question - I'd love to know too.
I can give you one hint. Make sure that you validate any variables passed in the url. I had a script that should take an integer, and realised if someone put in a fraction or text then the script output errors to the html page showing file and directory names that I wanted hidden.
To solve this I used:
function SecureInt($var,$default) { if (($var!=0) && ($var*1!=0) && is_int($var*1)) { $var=$var*1; //echo "is int"; } else { $var=$default; //echo "is not int"; } return($var); }
$intvar = SecureInt($intvar,1);
- seb
-----Original Message-----
From: Alfredeen, Johan [mailto:johanalfredeen
vp.net]
Sent: 31 August 2001 15:54
To: php-general
lists.php.net
Subject: [PHP] PHP Security
I am looking for a good, practical tutorial on what I should be doing as a developer to create a secure web site (PHP related). I have looked in my PHP text and searched the web, but haven't found anything real useful. I am not interested in Apache or OS security, as this is -hopefully- taken care of by my webhost. So if you know of a good guide, online or off, please contribute.
Thanks,
Johan PongWorld.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.274 / Virus Database: 144 - Release Date: 23/08/2001
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.274 / Virus Database: 144 - Release Date: 23/08/2001
attached mail follows:
Thanks for the tip. This is what I am talking about. Even with an error like the one you mention below, preferably the page should die nicely and not output a bunch of secret info or other stuff to the client. I am generally careful to prevent that from happening in all my dealings with my mySQL db by checking all the db connections, results, and things, and killing the execution if there was some error. This works well. But I am sure I have not covered every possibility.
I am mainly looking for a list of links or textbooks that outlines some of these things.
Johan
-----Original Message-----
From: Seb Frost [mailto:seb
raceshoot.com]
Sent: Friday, August 31, 2001 9:57 AM
To: Alfredeen, Johan; php-general
lists.php.net
Subject: RE: [PHP] PHP Security
Great question - I'd love to know too.
I can give you one hint. Make sure that you validate any variables passed in the url. I had a script that should take an integer, and realised if someone put in a fraction or text then the script output errors to the html page showing file and directory names that I wanted hidden.
To solve this I used:
function SecureInt($var,$default) { if (($var!=0) && ($var*1!=0) && is_int($var*1)) { $var=$var*1; //echo "is int"; } else { $var=$default; //echo "is not int"; } return($var); }
$intvar = SecureInt($intvar,1);
- seb
-----Original Message-----
From: Alfredeen, Johan [mailto:johanalfredeen
vp.net]
Sent: 31 August 2001 15:54
To: php-general
lists.php.net
Subject: [PHP] PHP Security
I am looking for a good, practical tutorial on what I should be doing as a developer to create a secure web site (PHP related). I have looked in my PHP text and searched the web, but haven't found anything real useful. I am not interested in Apache or OS security, as this is -hopefully- taken care of by my webhost. So if you know of a good guide, online or off, please contribute.
Thanks,
Johan PongWorld.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.274 / Virus Database: 144 - Release Date: 23/08/2001
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.274 / Virus Database: 144 - Release Date: 23/08/2001
attached mail follows:
If you're talking about a form, then what you can do is set the properties for the button like so:
> -----Original Message-----
> From: Jack [mailto:jack
nedcor.com]
> Sent: August 31, 2001 2:13 AM
> To: php-general
lists.php.net; php-windows
lists.php.net
> Subject: [PHP-WIN] Can PHP and Java work together?
>
>
> Dear all
> I want to ask if i want to perform two task after the user had click a
> button,
> 1 is the task perform by PHP
> 2 is the task perform by JavaScript
> is it possible to do so?
>
> I'm actually fresh on JavaScript, before i would call the JavaScript, what
> should i do first or what should i set before though?
>
> Thx
> Jack
> jack
nedcor.com
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe
lists.php.net
> For additional commands, e-mail: php-windows-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
My apologies for the previous message not being complete (for some reason CTRL-V occasionally sends the message in Outlook!).
Let's try this again.
If you're talking about a form, then what you can do is set the properties for the button like so:
<form name="formname" method="post" action="script.php"> <input type="submit" name="Submit" value="Submit" onClick="js_function('arguments')"> </form>
This won't work if you're thinking of using JavaScript to validate the form before it gets sent to the server, but it's good if you want to submit the form and perform a JS action at the same time.
Also, if you are considering using JavaScript to validate your form, you may want to reconsider doing it in PHP as JavaScript is easy to circumvent.
-- Robin
> -----Original Message-----
> From: Robin Bolton [mailto:rbolton
lonepinepublishing.com]
> Sent: August 31, 2001 8:49 AM
> To: Jack; php-general
lists.php.net; php-windows
lists.php.net
> Subject: RE: [PHP-WIN] Can PHP and Java work together?
>
>
> If you're talking about a form, then what you can do is set the
> properties for the button like so:
>
>
> > -----Original Message-----
> > From: Jack [mailto:jack
nedcor.com]
> > Sent: August 31, 2001 2:13 AM
> > To: php-general
lists.php.net; php-windows
lists.php.net
> > Subject: [PHP-WIN] Can PHP and Java work together?
> >
> >
> > Dear all
> > I want to ask if i want to perform two task after the user had click a
> > button,
> > 1 is the task perform by PHP
> > 2 is the task perform by JavaScript
> > is it possible to do so?
> >
> > I'm actually fresh on JavaScript, before i would call the
> JavaScript, what
> > should i do first or what should i set before though?
> >
> > Thx
> > Jack
> > jack
nedcor.com
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-windows-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-windows-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
attached mail follows:
Jack, My apologies. Disregard my earlier example - it only works because the PHP variable is "passed" to the javascript variable during onLoad when everything is executed. But in your case, the page has already been sent to the client and PHP can only be called by calling the server again.
Johan
> > -----Original Message-----
> > From: Jack [mailto:jack
nedcor.com]
> > Sent: August 31, 2001 2:13 AM
> > To: php-general
lists.php.net; php-windows
lists.php.net
> > Subject: [PHP-WIN] Can PHP and Java work together?
> >
> >
> > Dear all
> > I want to ask if i want to perform two task after the user had click a
> > button,
> > 1 is the task perform by PHP
> > 2 is the task perform by JavaScript
> > is it possible to do so?
> >
> > I'm actually fresh on JavaScript, before i would call the
> JavaScript, what
> > should i do first or what should i set before though?
> >
> > Thx
> > Jack
> > jack
nedcor.com
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-windows-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-windows-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
From: "Robin Bolton" <rbolton
lonepinepublishing.com>
> Also, if you are considering using JavaScript to validate your form, you may > want to reconsider doing it in PHP as JavaScript is easy to circumvent.
I think most if not all of us doing industrial-strength Web programming for our living end up doing it at both ends - JavaScript for browsers that support it (reduces round-trips if we can verify early and customer gets immediate and nicely presented feedback) and server side (for those browsers that aren't "doing" JavaScript and for doing heavy-duty and/or session based validation).
You just can't win ...
Mark C.
attached mail follows:
Does anyone know how to share cookies between servers. What I want to do is set a cookies on non secure server for a secure server. Here is setcookie("SessionID","$sessid",time() + 7200,"https://domainname.com"); Thanks
attached mail follows:
You can't set a cookie for a different domain or subdomain. If you set a cookie for a domain and then goto to SSL then the cookie will still be presented.
Regards
Jon
-- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to pgpkeybctech.co.uk
----- Original Message ----- From: "Jason Radley" <php
streamlineinternet.com> To: <php-general
lists.php.net> Sent: Friday, August 31, 2001 4:11 PM Subject: [PHP] Cookies
> Does anyone know how to share cookies between servers. > What I want to do is set a cookies on non secure server for a > secure server. > Here is > setcookie("SessionID","$sessid",time() + 7200,"https://domainname.com"); > Thanks > >
---------------------------------------------------------------------------- ----
> -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Ignore my previous post it is incorrect
Sorry
Jon
-- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to pgpkeybctech.co.uk
----- Original Message ----- From: "Jon Farmer" <jonfarmer
enta.net> To: "Jason Radley" <php
streamlineinternet.com>; <php-general
lists.php.net> Sent: Friday, August 31, 2001 4:31 PM Subject: Re: [PHP] Cookies
> You can't set a cookie for a different domain or subdomain. If you set a > cookie for a domain and then goto to SSL then the cookie will still be > presented. > > Regards > > Jon > -- > Jon Farmer > Systems Programmer, Entanet www.enta.net > Tel 01952 428969 Mob 07968 524175 > PGP Key available, send blank email to pgpkey
bctech.co.uk > > ----- Original Message ----- > From: "Jason Radley" <php
streamlineinternet.com> > To: <php-general
lists.php.net> > Sent: Friday, August 31, 2001 4:11 PM > Subject: [PHP] Cookies > > > > Does anyone know how to share cookies between servers. > > What I want to do is set a cookies on non secure server for a > > secure server. > > Here is > > setcookie("SessionID","$sessid",time() + 7200,"https://domainname.com"); > > Thanks > > > > > > > -------------------------------------------------------------------------- -- > ---- > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > > For additional commands, e-mail: php-general-help
lists.php.net > > To contact the list administrators, e-mail: php-list-admin
lists.php.net > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
http://www.phpbuilder.com/columns/chriskings20001128.php3
----- Original Message -----
From: Jason Radley <php
streamlineinternet.com>
To: <php-general
lists.php.net>
Sent: Friday, August 31, 2001 5:11 PM
Subject: [PHP] Cookies
> Does anyone know how to share cookies between servers. > What I want to do is set a cookies on non secure server for a > secure server. > Here is > setcookie("SessionID","$sessid",time() + 7200,"https://domainname.com"); > Thanks > >
----------------------------------------------------------------------------
----> -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Does anyone know of a way to go directly from a PHP/MySQL application to having a fax sent out??? I am trying to set up my application so that when a transaction is completed. Both parties receive a fax. Anyone done anything like this?
Thanks,
Ari Nepon
attached mail follows:
use exec() to call fax program on Linux.
Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS
----- Original Message -----
From: "Ari Nepon" <ari
workedhard.com>
To: <php-general
lists.php.net>
Sent: Friday, August 31, 2001 6:25 PM
Subject: [PHP] PHP to fax
> Does anyone know of a way to go directly from a PHP/MySQL application to
> having a fax sent out??? I am trying to set up my application so that when a
> transaction is completed. Both parties receive a fax. Anyone done anything
> like this?
>
> Thanks,
>
> Ari Nepon
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Hi Ari,
If you are using Linux (if not you should! really) You can use lprfax which will let you use 'lpr -Pfax -J<number or name>', mgetty-fax, efax or something like that. If you use one of those programs dump the information to file and use exec() from PHP.
Sean C. McCarthy SCI, S.L. (www.sci-spain.com)
Ari Nepon wrote:
>
> Does anyone know of a way to go directly from a PHP/MySQL application to
> having a fax sent out??? I am trying to set up my application so that when a
> transaction is completed. Both parties receive a fax. Anyone done anything
> like this?
>
> Thanks,
>
> Ari Nepon
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
We have installed PHP4.06 manually to use it with IIS 5 on win2000server
We did everything the installation guide told us to do. We uncommented some options in php.ini including
extension=php_oci8.dll
Afer we stopped and started the Web server every dll was loaded except php_oci.dll
"unable to load dynamic library 'C:/PHP/extentions/php_oci.dll'-The specified procedure could not be found."
What should I do? Your help will be very appreciated
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
attached mail follows:
Apparently I caused some agitation with my reply to Eric. I want to be clear so that everyone knows.
I apologies for my reply and I will not be sending anymore OOAR to the list.
Once again, I apologize.
Phil Labonte
attached mail follows:
I think it's very simple to do it.
<?php //...
$result = mysql_query('SELECT * FROM my_table ORDER BY Type, "Place Name"');
for($i = 0, $prev_type = FALSE; $i < mysql_numrows($result); $i++) { $row = mysql_fetch_array($result); if ($prev_type !== $row['Type']) { // close the previous type list if any if ($prev_type !== FALSE) echo '</ul>';
// new Type list echo '<ul>' . $row['Type']; } // print out the rest of the row like : // Place Name and Place Abbr and ther link echo '<li>'.$row['place name']; echo ' <a>jump '.$row['place abbr'].'</a>'; //... } //... ?> or maybe I missed something?
----- Original Message -----
From: Kath <kath
kathweb.net>
To: <php-general
lists.php.net>
Sent: Thursday, August 30, 2001 3:17 PM
Subject: [PHP] Databases, arrays and woes
> I have a MySQL table which stores information like this:
>
> | Type | Place Name | Place Abbrv |
>
> and lets say I have data in the table like:
>
> Example #1:
> | Office | Bill's Office | bo |
> | Store | Millcreek Supply | mcs |
> | Office | Harry's Office | ho |
> | Store | Sam's Discount Taxidermy | sdt |
> | Shipping | East Coast Distribution Facility | ecdf |
>
> What I'd like to do is be able to have PHP grab the information out of the
> database and sort like this on a webpage:
>
> Type Name #1:
> - Place Name (with hyperlink using the abbrv)
> - Place Name (with hyperlink using the abbrv)
>
> Type Name #2:
> - Place Name (with hyperlink using the abbrv)
> - Place Name (with hyperlink using the abbrv)
>
> For a better illustration, using the information from Example #1:
>
> Example #2:
>
> Office
> - Bill's Office (link using bo)
> - Harry's Office (link using ho)
>
> Store
> - Millcreek Supply (link using mcs)
> - Sam's Discount Taxidermy (link using sdt)
>
> Shipping
> - East Coast Distribution Facility (link using ecdf)
>
> So basically it has to group the common "Type" fields together and list
them
> together and make a hyperlink.
>
> What is the best way to do this? I've tried arrays, different MySQL
calls,
> voodoo, ouija boards and drinking, but nothing has gotten me what I need.
>
> btw, the information in "Type" is not a set number. There could be 2 or
200
> different "Type". (Otherwise this would be much easier and I might not
have
> a hangover from aforementioned drinking ;p )
>
> - k
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
I have an array of names, like below...
$people = array("Jim","John","JP");
Is there a way in an IF statement to see if someone's name is in the array? Like...
if ($people =~ $person) { }
I don't want to have to create a foreach loop to go through the array to see if that person is there.
Joseph
attached mail follows:
from http://php.net/quickref.php
$os = array ("Mac", "NT", "Irix", "Linux");
if (in_array ("Irix", $os)){
print "Got Irix";
}
Andrey HristovIcyGEN Corporationhttp://www.icygen.comBALANCED SOLUTIONS
----- Original Message -----
From: "Joseph Bannon" <JBannon
advparadigm.com>
To: "PHP (E-mail)" <php-general
lists.php.net>
Sent: Friday, August 31, 2001 6:40 PM
Subject: [PHP] array search
> I have an array of names, like below...
>
> $people = array("Jim","John","JP");
>
> Is there a way in an IF statement to see if someone's name is in the array?
> Like...
>
> if ($people =~ $person) { }
>
> I don't want to have to create a foreach loop to go through the array to see
> if that person is there.
>
> Joseph
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
yes, in_array($person, $people)!
however, you may take a look into the manual.
----- Original Message -----
From: Joseph Bannon <JBannon
advparadigm.com>
To: PHP (E-mail) <php-general
lists.php.net>
Sent: Friday, August 31, 2001 5:40 PM
Subject: [PHP] array search
> I have an array of names, like below...
>
> $people = array("Jim","John","JP");
>
> Is there a way in an IF statement to see if someone's name is in the
array?
> Like...
>
> if ($people =~ $person) { }
>
> I don't want to have to create a foreach loop to go through the array to
see
> if that person is there.
>
> Joseph
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
just to add some info. rememember this is case sensitive and spaces do matter, sometimes (depending on your goals) the following will apply :
$good_names = array('jim','philip','sasheen');
$my_name = 'PHiliP';
if (in_array(trim(strtolower($my_name)),$good_names))
and, another good function is array_keys and array_search. see :
regards, Philip Olson
On Fri, 31 Aug 2001, Andrey Hristov wrote:
> from http://php.net/quickref.php
>
> $os = array ("Mac", "NT", "Irix", "Linux");
> if (in_array ("Irix", $os)){
> print "Got Irix";
> }
>
> Andrey HristovIcyGEN Corporationhttp://www.icygen.comBALANCED SOLUTIONS
> ----- Original Message -----
> From: "Joseph Bannon" <JBannon
advparadigm.com>
> To: "PHP (E-mail)" <php-general
lists.php.net>
> Sent: Friday, August 31, 2001 6:40 PM
> Subject: [PHP] array search
>
>
> > I have an array of names, like below...
> >
> > $people = array("Jim","John","JP");
> >
> > Is there a way in an IF statement to see if someone's name is in the array?
> > Like...
> >
> > if ($people =~ $person) { }
> >
> > I don't want to have to create a foreach loop to go through the array to see
> > if that person is there.
> >
> > Joseph
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Joseph, The below postings are what you're looking for. Hopefully the in_array PHP function uses a smart search algorithm and doesn't go through the entire array. If you store your values in a db you can make use of an index on the column, or you could write your own search algorithm that uses a btree or some other type of search methodology.
Johan
-----Original Message-----
From: Papp Gyozo [mailto:pgerzson
freestart.hu]
Sent: Friday, August 31, 2001 10:02 AM
To: Joseph Bannon; PHP (E-mail)
Subject: Re: [PHP] array search
yes, in_array($person, $people)!
however, you may take a look into the manual.
----- Original Message -----
From: Joseph Bannon <JBannon
advparadigm.com>
To: PHP (E-mail) <php-general
lists.php.net>
Sent: Friday, August 31, 2001 5:40 PM
Subject: [PHP] array search
> I have an array of names, like below...
>
> $people = array("Jim","John","JP");
>
> Is there a way in an IF statement to see if someone's name is in the
array?
> Like...
>
> if ($people =~ $person) { }
>
> I don't want to have to create a foreach loop to go through the array to
see
> if that person is there.
>
> Joseph
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Is there any way to see whether or not the cookie setting has actually worked without going to another page? I suspect there isn't but I'd like confirmation ;)
Cheers
Max
attached mail follows:
<?php $alertthem = "Testing your browser for cookies.";
if(empty($check)){ $page = "$PHP_SELF?check=1"; header("Location: $page"); setcookie("testcookie","1"); } else{ if(empty($testcookie)){ $alertthem = "<H3>Please enable cookies.<br>You need cookies to shop this site</h3>"; } else{ header("Location: somepage.php3"); } } ?>
-----Original Message-----
From: Galvin, Max [mailto:m.galvin
centralservices.co.uk]
Sent: Friday, August 31, 2001 9:45 AM
To: 'php-general
lists.php.net'
Subject: [PHP] Setcookie
Is there any way to see whether or not the cookie setting has actually worked without going to another page? I suspect there isn't but I'd like confirmation ;)
Cheers
Max
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Header redirect isn't vaiable in this situation.
> ----------
> From: Jason Radley[SMTP:php
streamlineinternet.com]
> Sent: 31 August 2001 17:00
> To: Galvin, Max
> Cc: php-general
lists.php.net
> Subject: RE: [PHP] Setcookie
>
> <?php
> $alertthem = "Testing your browser for cookies.";
>
> if(empty($check)){
> $page = "$PHP_SELF?check=1";
> header("Location: $page");
> setcookie("testcookie","1");
> }
> else{
> if(empty($testcookie)){
> $alertthem = "<H3>Please enable cookies.<br>You need cookies
> to shop this
> site</h3>";
> }
> else{
> header("Location: somepage.php3");
> }
> }
> ?>
>
> -----Original Message-----
> From: Galvin, Max [mailto:m.galvin
centralservices.co.uk]
> Sent: Friday, August 31, 2001 9:45 AM
> To: 'php-general
lists.php.net'
> Subject: [PHP] Setcookie
>
>
> Is there any way to see whether or not the cookie setting has actually
> worked without going to another page? I suspect there isn't but I'd like
> confirmation ;)
>
> Cheers
>
> Max
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
$GLOBALS[substr($string, 0, 1)] or :
$tmp = substr($string, 0, 1); ${$tmp} = 'add whatever value you want';
----- Original Message -----
From: Stig-Ørjan Smelror <sos
LinCom.no>
To: <php-general
lists.php.net>
Sent: Friday, August 31, 2001 9:35 AM
Subject: [PHP] help with strings...
> Hei all.
>
> I've got this string, $string = "test"; and I want to make a $t; out of
> $string.
> Is this possible?
>
> I tried ${substr($string, 0, 1)}, but that didn't work ;)
>
>
> Any help appreciated.
>
>
> TIA.
> --
> Stig-Ørjan Smelror
> Systemutvikler
>
> Linux Communications AS
> Sandakerveien 48b
> Box 1801 - Vika
> N-0123 Oslo, Norway
>
> tel. +47 22 09 28 80
> fax. +47 22 09 28 81
> http://www.lincom.no/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Not sure what your goal is here but the easiest (and most efficient) way to get the first character of a string is :
$string = 'abcdef';
print $string{0}; // prints a print $string{3}; // prints d
So in your case, maybe the following craziness is what you're wanting :
${$string{0}} = 'crazy';
print $a; // prints crazy
Regards, Philip Olson
On Fri, 31 Aug 2001, Papp Gyozo wrote:
>
> $GLOBALS[substr($string, 0, 1)]
> or :
>
> $tmp = substr($string, 0, 1);
> ${$tmp} = 'add whatever value you want';
>
> ----- Original Message -----
> From: Stig-Ørjan Smelror <sos
LinCom.no>
> To: <php-general
lists.php.net>
> Sent: Friday, August 31, 2001 9:35 AM
> Subject: [PHP] help with strings...
>
>
> > Hei all.
> >
> > I've got this string, $string = "test"; and I want to make a $t; out of
> > $string.
> > Is this possible?
> >
> > I tried ${substr($string, 0, 1)}, but that didn't work ;)
> >
> >
> > Any help appreciated.
> >
> >
> > TIA.
> > --
> > Stig-Ørjan Smelror
> > Systemutvikler
> >
> > Linux Communications AS
> > Sandakerveien 48b
> > Box 1801 - Vika
> > N-0123 Oslo, Norway
> >
> > tel. +47 22 09 28 80
> > fax. +47 22 09 28 81
> > http://www.lincom.no/
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
I can't cope the fact that I loose my variables every time I reload the page. If someone could point me to the right direction, I'd be grateful.
Present problem:
I have a script that has some globals (surprise). Within this script, pretty deep in a function call tree, a function saves a query into an array and saves it to a global. Then an user makes an selection and the script reloads itself. After this I'd like to my hands on the saved query, but the global variable where it's saved seems to get initialised on reload. How to get around this? Sessions? I'm pretty new (a forthnight and wery little documentation) to server side programming, so I'm probably misunderstanding some basics.
Most of my problems are related to this area, so anyone bold enough to anwer will probably pounded with several questions more.
Thank you in advance Jon Thompson Coon
attached mail follows:
I think, the built-in session management can solve your problem: http://www.php.net/manual/en/ref-session.php
Briefly, you should register your variable into the session and after reloading the page you can get it back.
peculiarly: http://www.php.net/manual/en/function-session-register.php
hth,
Papp Gyozo
- pgerzson
freestart.hu
----- Original Message -----
From: Jon Thompson Coon <jon.thompson
helsinki.fi>
To: <php-general
lists.php.net>
Sent: Saturday, September 01, 2001 4:14 AM
Subject: [PHP] passing variables between scripts?
> I can't cope the fact that I loose my variables every time I reload the
> page. If someone could point me to the right direction, I'd be grateful.
>
> Present problem:
>
> I have a script that has some globals (surprise). Within this script,
> pretty deep in a function call tree, a function saves a query into an
> array and saves it to a global. Then an user makes an selection and the
> script reloads itself. After this I'd like to my hands on the saved
> query, but the global variable where it's saved seems to get initialised
> on reload. How to get around this? Sessions? I'm pretty new (a
> forthnight and wery little documentation) to server side programming, so
> I'm probably misunderstanding some basics.
>
> Most of my problems are related to this area, so anyone bold enough to
> anwer will probably pounded with several questions more.
>
> Thank you in advance
> Jon Thompson Coon
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
I am having big troubles here. I wrote this code just as it said in the manual, and it prints "{$beer}'s taste is great";?>
<html> <head> <title>PHP Test</title> </head> <body> <?php $beer = 'Heineken'; echo <h1>"{$beer}'s taste is great"</h1>; ?> </body> </html>
and if I don't put string into <h1> it prints nothing !
I'm kind of confused right now ...
(win98, opera 5.12, php installed with installShield)
attached mail follows:
All you should need to do is echo "<H1>$beer's taste is great</H1>";
don't use the braces.
-Jbell
----- Original Message -----
From: "Nikola Veber" <veber
ptt.yu>
To: "php forum" <php-general
lists.php.net>
Sent: Friday, August 31, 2001 9:38 AM
Subject: [PHP] help again
> I am having big troubles here. I wrote this code just as it said in the
manual, and
> it prints
> "{$beer}'s taste is great";?>
>
> <html>
> <head>
> <title>PHP Test</title>
> </head>
> <body>
> <?php
> $beer = 'Heineken';
> echo <h1>"{$beer}'s taste is great"</h1>;
> ?>
> </body>
> </html>
>
> and if I don't put string into <h1> it prints nothing !
>
> I'm kind of confused right now ...
>
> (win98, opera 5.12, php installed with installShield)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
echo sends a literal string to the output and eventually evaluates variables that are found inside, so it seems that your instruction should be:
echo "<h1>{$beer}'s taste is great</h1>";
Why it worked with <h1> outside, I guess because it was closing some former tag in your code or something like that...
Hope this helps (this sentence should be a tag!) Regards, Alex.
----- Original Message -----
From: "Nikola Veber" <veber
ptt.yu>
To: "php forum" <php-general
lists.php.net>
Sent: Friday, August 31, 2001 12:38 PM
Subject: [PHP] help again
> I am having big troubles here. I wrote this code just as it said in the
manual, and
> it prints
> "{$beer}'s taste is great";?>
>
> <html>
> <head>
> <title>PHP Test</title>
> </head>
> <body>
> <?php
> $beer = 'Heineken';
> echo <h1>"{$beer}'s taste is great"</h1>;
> ?>
> </body>
> </html>
>
> and if I don't put string into <h1> it prints nothing !
>
> I'm kind of confused right now ...
>
> (win98, opera 5.12, php installed with installShield)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Sounds like you want to do :
$guiness = 'Thick and Creamy!';
$beer = 'guiness';
print ${$beer}; // Thick and Creamy!
Regards, Philip Olson
On Fri, 31 Aug 2001, Nikola Veber wrote:
> I am having big troubles here. I wrote this code just as it said in the manual, and
> it prints
> "{$beer}'s taste is great";?>
>
> <html>
> <head>
> <title>PHP Test</title>
> </head>
> <body>
> <?php
> $beer = 'Heineken';
> echo <h1>"{$beer}'s taste is great"</h1>;
> ?>
> </body>
> </html>
>
> and if I don't put string into <h1> it prints nothing !
>
> I'm kind of confused right now ...
>
> (win98, opera 5.12, php installed with installShield)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
The code of your's print's the following :
$beer's taste is great";?>
I'm not sure if there could be a problen in configuring PHP, since the only thing
I have done was making html page
containing this code.
8/31/01 6:42:02 PM, "Andrey Hristov" <ahristov
icygen.com> wrote:
><html>
><head>
><title>PHP Test</title>
></head>
><body>
><?php
>$beer = 'Heineken';
>echo "<h1>$beer's taste is great</h1>";
>?>
></body>
></html>
>
>Andrey Hristov
>IcyGEN Corporation
>http://www.icygen.com
>BALANCED SOLUTIONS
>
>
>----- Original Message -----
>From: "Nikola Veber" <veber
ptt.yu>
>To: "php forum" <php-general
lists.php.net>
>Sent: Friday, August 31, 2001 7:38 PM
>Subject: [PHP] help again
>
>
>> I am having big troubles here. I wrote this code just as it said in the manual,
and
>> it prints
>> "{$beer}'s taste is great";?>
>>
>> <html>
>> <head>
>> <title>PHP Test</title>
>> </head>
>> <body>
>> <?php
>> $beer = 'Heineken';
>> echo <h1>"{$beer}'s taste is great"</h1>;
>> ?>
>> </body>
>> </html>
>>
>> and if I don't put string into <h1> it prints nothing !
>>
>> I'm kind of confused right now ...
>>
>> (win98, opera 5.12, php installed with installShield)
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>> For additional commands, e-mail: php-general-help
lists.php.net
>> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>>
>>
>
>
attached mail follows:
do yourself a favor... create a file, call it something like test.php and add the following to it's contents: /* begin test.php */ <?php phpinfo(); ?> /* End test.php */
then, open this page with your browser. if PHP is working, you should see a lot of configuration and version information, and the PHP logo etc.... if you don't see that, then your installation is broken.
----- Original Message -----
From: "Nikola Veber" <veber
ptt.yu>
To: "Andrey Hristov" <ahristov
icygen.com>; "php forum"
<php-general
lists.php.net>
Sent: Friday, August 31, 2001 11:00 AM
Subject: Re: [PHP] help again
> The code of your's print's the following :
>
> $beer's taste is great";?>
>
> I'm not sure if there could be a problen in configuring PHP, since the
only thing
> I have done was making html page
> containing this code.
>
> 8/31/01 6:42:02 PM, "Andrey Hristov" <ahristov
icygen.com> wrote:
>
> ><html>
> ><head>
> ><title>PHP Test</title>
> ></head>
> ><body>
> ><?php
> >$beer = 'Heineken';
> >echo "<h1>$beer's taste is great</h1>";
> >?>
> ></body>
> ></html>
> >
> >Andrey Hristov
> >IcyGEN Corporation
> >http://www.icygen.com
> >BALANCED SOLUTIONS
> >
> >
> >----- Original Message -----
> >From: "Nikola Veber" <veber
ptt.yu>
> >To: "php forum" <php-general
lists.php.net>
> >Sent: Friday, August 31, 2001 7:38 PM
> >Subject: [PHP] help again
> >
> >
> >> I am having big troubles here. I wrote this code just as it said in the
manual,
> and
> >> it prints
> >> "{$beer}'s taste is great";?>
> >>
> >> <html>
> >> <head>
> >> <title>PHP Test</title>
> >> </head>
> >> <body>
> >> <?php
> >> $beer = 'Heineken';
> >> echo <h1>"{$beer}'s taste is great"</h1>;
> >> ?>
> >> </body>
> >> </html>
> >>
> >> and if I don't put string into <h1> it prints nothing !
> >>
> >> I'm kind of confused right now ...
> >>
> >> (win98, opera 5.12, php installed with installShield)
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> >> For additional commands, e-mail: php-general-help
lists.php.net
> >> To contact the list administrators, e-mail:
php-list-admin
lists.php.net
> >>
> >>
> >
> >
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
>I think with everyone replying to "The future of PHP" e-mails and putting in >their two cents, we're eventually going to raise that $100,000 in no time. ><g>
Yeah.. not to mention the time it takes to read or just download those messages.
I stopped counting and started hitting the delete button.
Just wondering how long this tread will keep alive.. thought it would be dead by now.
It started as "The future of PHP" but seems to become a discussion about what is a suitable job for a PHP script.. how to do some marketing for PHP.. ISP's not nowing everything about PHP.. and many many other things..
I've got some great ideas for cheap but very effective marketing.. but I'm running out of time now.
Bye,
B.
/"\ \ / ASCII Ribbon Campaign X Against HTML Mail and News / \
attached mail follows:
Tim Ward wrote: > Be careful using values of submit buttons ... if the user hits return instead of clicking one of the buttons you won't get anything. If you want a default value try a hidden field before the submits with same name. >
Tim, thanks for the tip. I had heard of this behavior before, but never witnessed it. Today I wrote a test form with 1 text field and 1 submit, and it did do this: when I submitted via return, the submit field was not posted. However, when I added a second text field to the form, the submit did get posted. I was careful that the focus was still in the text field, and not on the button, when I hit return.
Any ideas on why this inconsistency? Just curious. Since it is inconsistent, your point is important and well-taken.
My code is below if anyone wants to play.
Kirk
submit.php ---------- <HTML><HEAD></HEAD><BODY> <FORM ACTION="submitRun.php" METHOD="POST">
<INPUT TYPE="text" name="test"><br> <!--<input type="text" name="test2"><br>-->
<!--<INPUT TYPE="hidden" name="submit" value="Yes">--> <INPUT TYPE="SUBMIT" name="submit" value="Yes"> <INPUT TYPE="SUBMIT" name="submit" value="No">
</FORM></BODY></HTML>
submitRun.php ------------- <? while(list($key,$val)=each($HTTP_POST_VARS)) { echo "key $key = $val <br>"; } ?>
attached mail follows:
Try upsizer, simple but work fine.
On Thu, Aug 30, 2001 at 10:02:03AM -0400, Jeff Lewis wrote: > I am using mySQL with all of my stuff but a friend who started writing some files for our online baseball league was using Access as his database. We tried running it on my server but it returns an error that says undefined function odbc_connect. > > Now my questions, can I get this to work on a Linux box? If not, is there a nice way to convert the MDB to mySQL? :) > > Jeff
-- Mauricio Téllez Jiménez Seguimiento Técnico EDUMEXICO edumexicospeedy.coacade.uv.mx Zamora No. 25, Col. Centro C.P. 91000, Xalapa, Ver. Tel. 52(28)17-86-87, 17-73-80 Fax. 52(28)18-64-13
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org
iD8DBQE7j89Pt5EzMv51BrsRAghbAKCDbr2Ok+TgUCZRfJ0X9iNsQR6rSgCZAaQ/ I4g0O/DqVnePCreAulWmNjM= =Vank -----END PGP SIGNATURE-----
attached mail follows:
can anyone help? safe mode is set to "0", which i believe is "off".
i put a chmod command in one of my scripts and got the following error on running it:
Warning: chmod failed: Operation not permitted in /path-here/index.phtml on line 1
why won't chmod work?
the chmod command i used is: <?chmod("../index.phtml", 0646);write data to file that has been made world-writable here; chmod("../index.phtml", 0644);}?>
the full error printout is:
Warning: chmod failed: Operation not permitted in /path-here/index.phtml on line 1
Warning: fopen("../index.phtml","a") - Permission denied in /path here/index.phtml on line 1
Warning: Unable to find file identifier 0 in /path here/index.phtml on line 2
Warning: chmod failed: Operation not permitted in /path-here/index.phtml on line 2
I know the second error is because the file wasn't made world-writable so it wasn't able to write to it, i don't know what the third error is for
__________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com
attached mail follows:
who owns the file to begin with? your account? a web server typically runs as a low access account, such as "nobody" on Unix. So, what is probably happening is that you don't have permissions to chmod the file. Doesn't have anything to do with your PHP configuration.
Jason Bell
----- Original Message -----
From: "Police Trainee" <policetrainee
yahoo.com>
To: "PHP" <php-general
lists.php.net>
Sent: Friday, August 31, 2001 11:43 AM
Subject: [PHP] chmod failed: Operation not permitted
> can anyone help?
> safe mode is set to "0", which i believe is "off".
>
> i put a chmod command in one of my scripts and got the
> following error on running it:
>
> Warning: chmod failed: Operation not permitted in
> /path-here/index.phtml on line 1
>
> why won't chmod work?
>
> the chmod command i used is: <?chmod("../index.phtml",
> 0646);write data to file that has been made
> world-writable here; chmod("../index.phtml", 0644);}?>
>
> the full error printout is:
>
> Warning: chmod failed: Operation not permitted in
> /path-here/index.phtml on line 1
>
> Warning: fopen("../index.phtml","a") - Permission
> denied in
> /path here/index.phtml on line 1
>
> Warning: Unable to find file identifier 0 in
> /path here/index.phtml on line 2
>
> Warning: chmod failed: Operation not permitted in
> /path-here/index.phtml on line 2
>
> I know the second error is because the file wasn't
> made world-writable so it wasn't able to write to it,
> i don't know what the third error is for
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger
> http://im.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
the files are all owned by me, that is, my unix login.
--- Jason Bell <jbell
barkingrat.com> wrote:
> who owns the file to begin with? your account? a
> web server typically runs
> as a low access account, such as "nobody" on Unix.
> So, what is probably
> happening is that you don't have permissions to
> chmod the file. Doesn't have
> anything to do with your PHP configuration.
>
> Jason Bell
>
> ----- Original Message -----
> From: "Police Trainee" <policetrainee
yahoo.com>
> To: "PHP" <php-general
lists.php.net>
> Sent: Friday, August 31, 2001 11:43 AM
> Subject: [PHP] chmod failed: Operation not permitted
>
>
> > can anyone help?
> > safe mode is set to "0", which i believe is "off".
> >
> > i put a chmod command in one of my scripts and got
> the
> > following error on running it:
> >
> > Warning: chmod failed: Operation not permitted in
> > /path-here/index.phtml on line 1
> >
> > why won't chmod work?
> >
> > the chmod command i used is:
> <?chmod("../index.phtml",
> > 0646);write data to file that has been made
> > world-writable here; chmod("../index.phtml",
> 0644);}?>
> >
> > the full error printout is:
> >
> > Warning: chmod failed: Operation not permitted in
> > /path-here/index.phtml on line 1
> >
> > Warning: fopen("../index.phtml","a") - Permission
> > denied in
> > /path here/index.phtml on line 1
> >
> > Warning: Unable to find file identifier 0 in
> > /path here/index.phtml on line 2
> >
> > Warning: chmod failed: Operation not permitted in
> > /path-here/index.phtml on line 2
> >
> > I know the second error is because the file wasn't
> > made world-writable so it wasn't able to write to
> it,
> > i don't know what the third error is for
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get email alerts & NEW webcam video instant
> messaging with Yahoo!
> Messenger
> > http://im.yahoo.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail:
> php-general-help
lists.php.net
> > To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
> >
> >
>
__________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com
attached mail follows:
Therein lies the problem. The webserver, therefore your PHP script, is probably *NOT* running with your credentials.
Larry
* Police Trainee <policetrainee
yahoo.com> [010831 13:50]:
> the files are all owned by me, that is, my unix login.
> --- Jason Bell <jbell
barkingrat.com> wrote:
> > who owns the file to begin with? your account? a
> > web server typically runs
> > as a low access account, such as "nobody" on Unix.
> > So, what is probably
> > happening is that you don't have permissions to
> > chmod the file. Doesn't have
> > anything to do with your PHP configuration.
> >
> > Jason Bell
> >
> > ----- Original Message -----
> > From: "Police Trainee" <policetrainee
yahoo.com>
> > To: "PHP" <php-general
lists.php.net>
> > Sent: Friday, August 31, 2001 11:43 AM
> > Subject: [PHP] chmod failed: Operation not permitted
> >
> >
> > > can anyone help?
> > > safe mode is set to "0", which i believe is "off".
> > >
> > > i put a chmod command in one of my scripts and got
> > the
> > > following error on running it:
> > >
> > > Warning: chmod failed: Operation not permitted in
> > > /path-here/index.phtml on line 1
> > >
> > > why won't chmod work?
> > >
> > > the chmod command i used is:
> > <?chmod("../index.phtml",
> > > 0646);write data to file that has been made
> > > world-writable here; chmod("../index.phtml",
> > 0644);}?>
> > >
> > > the full error printout is:
> > >
> > > Warning: chmod failed: Operation not permitted in
> > > /path-here/index.phtml on line 1
> > >
> > > Warning: fopen("../index.phtml","a") - Permission
> > > denied in
> > > /path here/index.phtml on line 1
> > >
> > > Warning: Unable to find file identifier 0 in
> > > /path here/index.phtml on line 2
> > >
> > > Warning: chmod failed: Operation not permitted in
> > > /path-here/index.phtml on line 2
> > >
> > > I know the second error is because the file wasn't
> > > made world-writable so it wasn't able to write to
> > it,
> > > i don't know what the third error is for
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Get email alerts & NEW webcam video instant
> > messaging with Yahoo!
> > Messenger
> > > http://im.yahoo.com
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail:
> > php-general-unsubscribe
lists.php.net
> > > For additional commands, e-mail:
> > php-general-help
lists.php.net
> > > To contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> > >
> > >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
> http://im.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: lerlerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
attached mail follows:
at your unix prompt, (assuming you are running apache) enter the command "ps -ef |grep httpd"
you should see the httpd (apache) process, and who owns it. Typicly this is the user "nobody". Your file needs to be owned by the user that owns the httpd process.
- Jason Bell
----- Original Message -----
From: "Police Trainee" <policetrainee
yahoo.com>
To: "PHP" <php-general
lists.php.net>
Sent: Friday, August 31, 2001 11:50 AM
Subject: Re: [PHP] chmod failed: Operation not permitted
> the files are all owned by me, that is, my unix login.
> --- Jason Bell <jbell
barkingrat.com> wrote:
> > who owns the file to begin with? your account? a
> > web server typically runs
> > as a low access account, such as "nobody" on Unix.
> > So, what is probably
> > happening is that you don't have permissions to
> > chmod the file. Doesn't have
> > anything to do with your PHP configuration.
> >
> > Jason Bell
> >
> > ----- Original Message -----
> > From: "Police Trainee" <policetrainee
yahoo.com>
> > To: "PHP" <php-general
lists.php.net>
> > Sent: Friday, August 31, 2001 11:43 AM
> > Subject: [PHP] chmod failed: Operation not permitted
> >
> >
> > > can anyone help?
> > > safe mode is set to "0", which i believe is "off".
> > >
> > > i put a chmod command in one of my scripts and got
> > the
> > > following error on running it:
> > >
> > > Warning: chmod failed: Operation not permitted in
> > > /path-here/index.phtml on line 1
> > >
> > > why won't chmod work?
> > >
> > > the chmod command i used is:
> > <?chmod("../index.phtml",
> > > 0646);write data to file that has been made
> > > world-writable here; chmod("../index.phtml",
> > 0644);}?>
> > >
> > > the full error printout is:
> > >
> > > Warning: chmod failed: Operation not permitted in
> > > /path-here/index.phtml on line 1
> > >
> > > Warning: fopen("../index.phtml","a") - Permission
> > > denied in
> > > /path here/index.phtml on line 1
> > >
> > > Warning: Unable to find file identifier 0 in
> > > /path here/index.phtml on line 2
> > >
> > > Warning: chmod failed: Operation not permitted in
> > > /path-here/index.phtml on line 2
> > >
> > > I know the second error is because the file wasn't
> > > made world-writable so it wasn't able to write to
> > it,
> > > i don't know what the third error is for
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Get email alerts & NEW webcam video instant
> > messaging with Yahoo!
> > Messenger
> > > http://im.yahoo.com
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail:
> > php-general-unsubscribe
lists.php.net
> > > For additional commands, e-mail:
> > php-general-help
lists.php.net
> > > To contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> > >
> > >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger
> http://im.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
OK I have been using the *same* cookie function to place cookies on the surfers pc and it works for a few hundred people just fine. Now I have a few people that it just won't work for.
After extensive testing the only thing I can see is that it is not writing the cookies, we do see it writing the c_user_email cookie, but not others, we even added code to erase the cookie first, and still no luck.
Any ideas would be appreciated...
function f_put_cookie($user_name,$user_email,$account_type,$company_name) {
global $HTTP_COOKIE_VARS; global $s_c_url;
$l_url = ".".$s_c_url;
setcookie("c_user_email",$user_email,(time()+400*30*12),'/',$l_url,0);
setcookie("c_user_name",$user_name,(time()+400),'/',$l_url,0);
setcookie("c_account_type",$account_type,(time()+400),'/',$l_url,0);
setcookie("c_company_name",$company_name,(time()+400),'/',$l_url,0); setcookie("c_uas_time", "GREEN",(time()+400),'/',$l_url,0); }
___________________________________________________________ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net
attached mail follows:
I had the exact same problem, so what I have been doing is using the header function to set cookies directly as a header. For example:
header("Set-Cookie: CookieName=$NameVar; path=/; expires=$DateVar");
I have had no problems with this way of setting cookies... So far :)
Rick
> OK I have been using the *same* cookie function to place cookies on the
> surfers pc and it works for a few hundred people just fine. Now I have
> a few people that it just won't work for.
>
> After extensive testing the only thing I can see is that it is not
> writing the cookies, we do see it writing the c_user_email cookie, but
> not others, we even added code to erase the cookie first, and still no
> luck.
>
> Any ideas would be appreciated...
>
>
> function
> f_put_cookie($user_name,$user_email,$account_type,$company_name) {
>
> global $HTTP_COOKIE_VARS;
> global $s_c_url;
>
> $l_url = ".".$s_c_url;
>
>
> setcookie("c_user_email",$user_email,(time()+400*30*12),'/',$l_url,0);
>
> setcookie("c_user_name",$user_name,(time()+400),'/',$l_url,0);
>
> setcookie("c_account_type",$account_type,(time()+400),'/',$l_url,0);
>
> setcookie("c_company_name",$company_name,(time()+400),'/',$l_url,0);
> setcookie("c_uas_time",
> "GREEN",(time()+400),'/',$l_url,0);
> }
>
>
> ___________________________________________________________
> Jack Sasportas
> Innovative Internet Solutions
> Phone 305.665.2500
> Fax 305.665.2551
> www.innovativeinternet.com
> www.web56.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
i'm sorry if the solution to this problem was posted here before, but if it was i couldn't find it.
i have an app that it's basically like this:
index.php:
$app = new App; $app->start();
in class app:
function start() { (....) session_start();
if($need_auth) { global $auth; /* another class */ if(!isset($auth)) { $auth = new auth; session_register("auth"); } $auth->start(); } (....) }
my question is, the auth class get's registered, and the auth array inside the auth class ($auth->auth[]) get his values recorded on the first attempt, but, if the user tries again, it doesn't refresh the session data, oh i'm using my session functions to write them on a mysql db, i've been debugging, and i can see all the queries that the session stores in the db through syslog, and for instance in $auth->start() if i change any variable like $this->auth["username"]=$username; the data field passed to my session_write() still has the first value not $username instead.
another question is, at what time of the script does php call my session_write function to update the registered session?!
thanks all
--
Rui Barreiros
Software Developer
WEBSOLUT - Soluções Internet
Emailto: rui
websolut.net
Personal Info: http://websolut.net/people/rui.html
As informações contidas neste email são confidenciais
e destinam-se apenas à(s) pessoa(s) a quem foi enviado:
http://websolut.net/confidencialidade-responsabilidade.html
attached mail follows:
I'm getting the following error:
Warning: Unable to find ftpbuf 0 in C:\directory\page.php on line 22
Whenever I try to connect to our FTP server...it does this whenever I make a call to ftp_login(). The server, username, and password are correct, and I can successfully FTP into it through other clients.
It also gives this error for the first ftp_put() I call, but it drops the first file to be FTP'd into its local folder and then the script dies. Does anyone know whether this error is coming from my code, PHP, or the FTP server I'm trying to connect to?
Thanks- Michael Jacobs
attached mail follows:
I'm getting the following error:
Warning: Unable to find ftpbuf 0 in C:\directory\page.php on line 22
Whenever I try to connect to our FTP server...it does this whenever I make a call to ftp_login(). The server, username, and password are correct, and I can successfully FTP into it through other clients.
It also gives this error for the first ftp_put() I call, but it drops the first file to be FTP'd into its local folder and then the script dies. Does anyone know whether this error is coming from my code, PHP, or the FTP server I'm trying to connect to?
Thanks- Michael Jacobs
attached mail follows:
Afternoon List-
I have been burrowing through archives and newsgroups for awhile now and have been trying to find some info on a better way to upload files from a browser then doing HTTP based uploads? Are there any?
My system: PIII 750, 128MB RAM running FreeBSD 4.2 and Apache 1.3.20, PHP 4.0.6
The normal load average is very low (usually 95%+ resources free), but when I start the HTTP load the single http process slowly makes its merry way to 98% CPU util or so. Additional PHP based requests are slow, while html requests are fine. I was also reading that large http file requests are inherrintly slow and have troubles. Details on this?
I guess my question is, is uploading large file (15MB+) over the internet a viable thing to do using a HTTP upload method? and are there ways of keeping the process utilization down? That's probably BSD dependant, but thought I'd throw it in :)
Thanks!
Henrik
Please CC me on replies, I am only reading the Digest of this list.
attached mail follows:
I am trying to get a double data type to display the .00 in a "hole" dollar amount (i.e. 432.00 not 432 or $432.00 not $432).
Can anyone tell me how to do this?
Thanks,
Robert J Collins
attached mail follows:
> I am trying to get a double data type to display the .00 in a > "hole" dollar amount (i.e. 432.00 not 432 or $432.00 not $432). > Can anyone tell me how to do this?
printf(); or sprintf(); is your friend
Chris
attached mail follows:
Try number_format()
if you have int than ($int_var*100)/100 or (double)$int_var
number_format((double)$int_var,...)
Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS
----- Original Message -----
From: "Robert J Collins" <robertjcollins
zonehenge.com>
To: <php-general
lists.php.net>
Sent: Friday, August 31, 2001 10:50 PM
Subject: [PHP] How to get a double to show the .00 in a hole number
> I am trying to get a double data type to display the .00 in a "hole" dollar
> amount (i.e. 432.00 not 432 or $432.00 not $432).
>
> Can anyone tell me how to do this?
>
> Thanks,
>
> Robert J Collins
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
I am searching a way of disabling certain functions in a particular Virtual Host.
I search through the archive of this list and I found a begening of a solution. I can disable functions in php.ini, but I can't use them in vhost I want to. If I don't disable functions in php.ini, I cannot disable functions through httpd.conf with php_value or php_admin_value...
Does some one have an Idea ?
Nicolas Ross
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]