php-general Digest 7 Feb 2002 08:56:27 -0000 Issue 1157
Topics (messages 83754 through 83819): Re: !isset ?? 83754 by: Michael Sims 83758 by: Erik Price Re: Version checking 83755 by: Bogdan Stancescu GetImageSize and iptcparse problems 83756 by: Steven Jarvis 83808 by: Jason Wong checking for off site image 83757 by: sean.interconnect.is.it if variable is equal to 2 through 4 83759 by: Jay Fitzgerald 83765 by: Erik Price 83767 by: Erik Price 83769 by: hugh danaher Re: Sending MIME emails with base64 encoded attachments 83760 by: Svarc, Petr 83772 by: Analysis and Solutions Manual input, to form, to array, to session register... 83761 by: Floyd Baker 83763 by: Erik Price 83775 by: Floyd Baker Re: [PHP-DB] if variable is equal to 2 through 4 83762 by: Chris Boget 83764 by: Mihail Bota Re: mktime() Algorithm 83766 by: Lars Torben Wilson Re: Caching in php? 83768 by: Jeff Bearer odbc_fetch_into(), is there a way to display each data while using this function? 83770 by: Scott Fletcher Re: why !^ in email? 83771 by: Martin Towell Re: in_array algorithm 83773 by: Lars Torben Wilson XML closing elements called for <tag /> 83774 by: Hammy 83786 by: Christian Stocker 83788 by: Martin Towell Re: Newbie: Question about filesize() 83776 by: Ben Crawford 83777 by: Martin Towell 83779 by: Jeff Sheltren 83780 by: Lars Torben Wilson 83787 by: Lars Torben Wilson File Uploads 83778 by: Ben Crawford 83781 by: Jeff Sheltren Array !!! 83782 by: Pavel Zvertsov 83793 by: hugh danaher Writing PHP files from inside a PHP file 83783 by: Georgie Casey 83785 by: Brandon Orther 83789 by: J Smith Re: Create Mysql Records From a Comma separated Values String 83784 by: Ben Crawford Verisign / Payflow Pro 83790 by: Lazor, Ed cURL and XML? 83791 by: Petras Virzintas 83792 by: Martin Towell form > summary !! 83794 by: Pablo Petek Differences between PHP, ASP, JSP 83795 by: Ben Clumeck 83796 by: Tyler Longren secure form handling 83797 by: wm 83798 by: Lars Torben Wilson 83800 by: wm 83801 by: CC Zona 83803 by: wm 83804 by: Lars Torben Wilson 83807 by: Lars Torben Wilson 83811 by: CC Zona function to post data 83799 by: wm 83806 by: Lars Torben Wilson 83818 by: val petruchek create dynamic pulldown menu? 83802 by: John P. Donaldson 83805 by: Jason Wong File upload 83809 by: Balaji Ankem 83810 by: Jason Murray Get file download time. 83812 by: J.F.Kishor 83813 by: Jason Wong Need XML info for PHP -- XML Newbie 83814 by: Navid Yar Server Loading Question... 83815 by: Jason G. MySQL Install Problem 83816 by: Ben Clumeck 83817 by: Dave Barry 83819 by: Ben Clumeck Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
--- Begin Message ---At 03:06 PM 2/6/2002 -0500, Erik Price wrote: >Pretty confusing. Can anyone shed some light on whether or not there is a >final definite way to do this? I've used (!($_POST['var'])) with no >problems in the past, but does good coding style suggest that I use >(!isset($_POST['var'])) now? The problem with using (!$_POST['var']) as an expression is that you are asking the parser to evaluate the expression as a boolean. If $_POST['var'] isn't a boolean (and it won't be, because unless I'm mistaken all POST or GET variables are treated as strings unless you cast them) then the parser does an implicit cast to boolean while evaluating your expression. This is fine for most cases, but let's say that $_POST['var'] *is* set to either an empty string ("") or a string containing zero ("0"). Your test will fail, because both of these are evaluated as FALSE when cast as a boolean. That's the reason that isset() is a little more general purpose. If you aren't worried about missing an empty string or a string containing "0" then you can continue to use the method you have been using. For more info, see this: <http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting>--- End Message ---
--- Begin Message ---On Wednesday, February 6, 2002, at 03:42 PM, Michael Sims wrote: > This is fine for most cases, but let's say that $_POST['var'] *is* set > to either an empty string ("") or a string containing zero ("0"). Your > test will fail, because both of these are evaluated as FALSE when cast > as a boolean. That's the meat of it, then. I wasn't aware of the different types of evaluation that could be done on a variable (boolean, etc). Okay, I'm reading that link as I write this. Thanks again. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED]--- End Message ---
--- Begin Message ---Check this one out (I use it to define functions for versions of PHP that don't have wordwrap defined for example): // Function to determine if the current version of PHP is // at least the one specified as a string in the parameter. // This is needed because string comparison isn't always accurate: // "4.0.2">"4.0.12" as strings, although that's not true when // speaking of comparing versions. // Usage example: // if (!isphpver("4.0.2")) // { // [do something] // } // Bogdan Stancescu <[EMAIL PROTECTED]>, November 2001 // You may freely use this function as long as you keep the header function isphpver($minver) { $itis=2; // That is, undecided $minimum=explode(".",$minver); $current=explode(".",phpversion()); for ($i=0;(($i<sizeof($current)) && ($i<sizeof($minimum)));$i++) { if ($current[$i]>$minimum[$i]) { $itis=true; // In this case, we have a winner break; } if ($current[$i]<$minimum[$i]) // > { $itis=false; // In this case, we have a loser break; } } if ($itis==2) // This would only happen if all the common version // components are identical. But there are may be // differences: // Example 1: comparing "4.0.1" with "4.0" would be // identical for now, but the condition // is satisfied; // Example 2: comparing "4.0" with "4.0.1" - identical // for now, but the condition is NOT // satisfied { if (sizeof($current)>=sizeof($minimum)) { $itis=true; } else { // Ok, only one more chance: if for example the user // specified "4.0.0" and phpversion returned "4.0". for ($i=sizeof($current)-1;$i<sizeof($minimum);$i++) // > { if ($minimum[$i]) { $itis=false; } } if ($itis==2) { $itis=true; } } } return($itis); } Alan McFarlane wrote: > What's the best method for checking the PHP version number. > > I'm assuming that include() was available in all versions, so, from my main > index.php script, I include a local script (common.php) : > > <?php > // assume minimum version of PHP required is 4.0.5 > if (phpversion() < 4) { die("wrong version"); } > $ver = explode(".", phpversion()); > if ($ver[2] < 5) { die("wrong version"); } > ?> > > The problem I can see is that some of the earlier 4+ versions had a funny > number scheme - i.e. 4.0.1pl2. > > Does anyone have a complete list of version numbers (or a better method of > version checking)? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php--- End Message ---
--- Begin Message ---I've read the manual, and I'm still stuck, partially due to the manual itself. This is the first time I've dealt with this particular issue (parsing IPTC info from JPEGs). The example provided in the manual entry on GetImageSize: <?php $size = GetImageSize ("testimg.jpg",&$info); if (isset ($info["APP13"])) { $iptc = iptcparse ($info["APP13"]); var_dump ($iptc); } ?> Gives me the following error on php 4.0.6: Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of getimagesize(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. I don't understand what I need to pass to getImageSize in order to extract the IPTC info. Can someone point me in the right direction with this? Thanks, Steven--- End Message ---
--- Begin Message ---On Thursday 07 February 2002 05:02, Steven Jarvis wrote: > I've read the manual, and I'm still stuck, partially due to the manual > itself. This is the first time I've dealt with this particular issue > (parsing IPTC info from JPEGs). > > The example provided in the manual entry on GetImageSize: > > <?php > $size = GetImageSize ("testimg.jpg",&$info); > if (isset ($info["APP13"])) { > $iptc = iptcparse ($info["APP13"]); > var_dump ($iptc); > } > ?> > > Gives me the following error on php 4.0.6: > > Warning: Call-time pass-by-reference has been deprecated - argument > passed by value; If you would like to pass it by reference, modify the > declaration of getimagesize(). If you would like to enable call-time > pass-by-reference, you can set allow_call_time_pass_reference to true in > your INI file. However, future versions may not support this any longer. What this error is saying is that you cannot use &$info ie: GetImageSize ("testimg.jpg",&$info); > I don't understand what I need to pass to getImageSize in order to > extract the IPTC info. You can try: GetImageSize ("testimg.jpg", $info); > Can someone point me in the right direction with this? If the above doesn't work, then you probably have to change your php.ini as per error message. For more info on pass-by-reference see the chapter "References Explained" > "Passing by Reference". -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* We gave you an atomic bomb, what do you want, mermaids? -- I. I. Rabi to the Atomic Energy Commission */--- End Message ---
--- Begin Message ---I'd like a test to see if an image not saved locally exists or not, but I'm beginning to wonder if there's a way. I've tried: getimagesize ('http://offsite.image.gif', $info); if ($info[3] != "") $title= 'print out image html'; else $title= 'give some text'; My URL fopen wrapper is enabled... getimagesize doesent work for off site? My error? or do one of you have a crafty solution? Thanks for your help! Sean ------------------------------- I N T E R C O N N E C T Internet Image Development Tel: 505 989 3749 http://www.InterConnect.is.it ---------------------------------- End Message ---
--- Begin Message ---i am currently using this code: if ($variable == 2) || ($variable == 3) || ($variable == 4) { echo "hello"; } how would I write it if I wanted to say this: if $variable == 2 through 4 ??? Should you have any questions, comments or concerns, feel free to call me at 318-338-2034. Thank you for your time, Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A ========================================================== Bayou Internet..............(888) 30-BAYOU........................http://www.bayou.com Mississippi Internet.......(800) MISSISSIPPI...............http://www.mississippi.net Vicksburg Online..........(800) MISSISSIPPI................http://www.vicksburg.com ========================================================== Tel: (318) 338-2034 ICQ: 38823829 Fax: (318) 323-5053--- End Message ---
--- Begin Message ---On Wednesday, February 6, 2002, at 04:10 PM, Jay Fitzgerald wrote: > i am currently using this code: > > if ($variable == 2) || ($variable == 3) || ($variable == 4) > { > echo "hello"; > } > > how would I write it if I wanted to say this: > > if $variable == 2 through 4 ??? if ($variable >= 2) && ($variable <= 4) ---- Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED]--- End Message ---
--- Begin Message ---Also, it was excessive to cross-post to different lists, especially with this kind of question. It has nothing to do with MySQL. Cross-posting is really only relevant for certain kinds of important announcements, and even then probably aren't cool. Erik On Wednesday, February 6, 2002, at 04:25 PM, Erik Price wrote: > > On Wednesday, February 6, 2002, at 04:10 PM, Jay Fitzgerald wrote: > >> i am currently using this code: >> >> if ($variable == 2) || ($variable == 3) || ($variable == 4) >> { >> echo "hello"; >> } >> >> how would I write it if I wanted to say this: >> >> if $variable == 2 through 4 ??? ---- Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED]--- End Message ---
--- Begin Message ---try: if ($variable>=2 and $variable<=4) echo "hello"; ----- Original Message ----- From: "Erik Price" <[EMAIL PROTECTED]> To: "Jay Fitzgerald" <[EMAIL PROTECTED]> Cc: "PHP (E-mail)" <[EMAIL PROTECTED]> Sent: Wednesday, February 06, 2002 1:33 PM Subject: Re: [PHP] if variable is equal to 2 through 4 > Also, it was excessive to cross-post to different lists, especially with > this kind of question. It has nothing to do with MySQL. Cross-posting > is really only relevant for certain kinds of important announcements, > and even then probably aren't cool. > > Erik > > > On Wednesday, February 6, 2002, at 04:25 PM, Erik Price wrote: > > > > > On Wednesday, February 6, 2002, at 04:10 PM, Jay Fitzgerald wrote: > > > >> i am currently using this code: > >> > >> if ($variable == 2) || ($variable == 3) || ($variable == 4) > >> { > >> echo "hello"; > >> } > >> > >> how would I write it if I wanted to say this: > >> > >> if $variable == 2 through 4 ??? > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >--- End Message ---
--- Begin Message --- Title: RE: RE: Sending MIME emails with base64 encoded attachmentsFINAL SOLUTION!
Hello
Ok. It's me, the last time :-)
> Let say I have a small 4byte file with content "AB#0C"
> (ascii: #65,#66,#0,#67)
> I load it (using binary save fread into $txt)
> When I try to get third character (#0), quess what I get:
> $x = ord(substr($txt,2,1))
>
> $x IS NOT 0!
> $x IS 92, which mean backslash. Fourth char is 48, which
> means "0" and the fifth #67.
>
> So, PHP replaces any #0 with "\0" in every string internally.OK. THIS is true just for string obtained by fread()
Strings created internally are OK.So the solution is:
1) get the string from the file using $str=fread($file,filesize($filename));
2) I realize that in string obtained by fread() the following characters are changed:
#0 () -> #92#48 (\0)
#34 (") -> #92#34 (\")
#39 (') -> #92#39 (\')
#92 (\) -> #92#92 (\\)
3) So solution is before put text into base64_encode procedure, do the following:
$str=str_replace(chr(92).chr(48),chr(0),$str);
$str=str_replace(chr(92).chr(34),chr(34),$str);
$str=str_replace(chr(92).chr(39),chr(39),$str);
$str=str_replace(chr(92).chr(92),chr(92),$str);
4) Now you can encode it.It works.
Futhermore, I was trying to store some string to file using fwrite() method.
fwrite() works fine for all characters except backslash, where you have to
send there double backslash.
So fwrite($file,chr(0)) writes really #0,
but for writing #92 you have to call fwrite($file,chr(92).chr(92));
For writing #0 you can also call fwrite($file,chr(92).chr(48));
( and similary for all four cases stated above in point 3) )
So, a thing, that's all for now
Have a nice day...
Petr Svarc
This electronic message transmission contains information from TMP Worldwide and is confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution, or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify us by telephone immediately at +44 (0)20 7406 3333--- End Message ---
--- Begin Message ---Hey Petr: > 2) I realize that in string obtained by fread() the following characters are > changed: > #0 () -> #92#48 (\0) > #34 (") -> #92#34 (\") > #39 (') -> #92#39 (\') > #92 (\) -> #92#92 (\\) WAIT A SECOND! You've got the magic_quotes_runtime configuration variable turned on! To solve your problem you can: a) turn off that feature via the the php.ini or .htaccess file http://www.php.net/manual/en/configuration.php#ini.magic-quotes-runtime OR b) use stripslashes() on the string you get back from the file http://www.php.net/manual/en/function.stripslashes.php Enjoy, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409--- End Message ---
--- Begin Message ---Before 4.1 we used an input form with default field values and manual override input to an array and then posted to an action page. All was good until global_register were turned off. Now I need to make this work using the session register. I have the all this working and passing defined variables ok. How is this done with a manual input? I have tried to use the same input line as before.... print "<INPUT TYPE='text' NAME='rate[]' VALUE='$rate' SIZE='5'>"; but cannot integrate it into the session register. I have also tried track_var configurations with no luck. I can get $vars into the register but I need to input values to an array manually. I know it's here somewhere but can I get a pointer. Thanks. Floyd ----- End Message ---
--- Begin Message ---On Wednesday, February 6, 2002, at 04:08 PM, Floyd Baker wrote: > Now I need to make this work using the session register. I have the > all this working and passing defined variables ok. > > How is this done with a manual input? I have tried to use the same > input line as before.... > > print "<INPUT TYPE='text' NAME='rate[]' VALUE='$rate' SIZE='5'>"; > > but cannot integrate it into the session register. I have also > tried track_var configurations with no luck. I can get $vars into the > register but I need to input values to an array manually. I thought that with 4.1, you didn't need to use session_register(). Rather, you just define the variable you want in the $_SESSION array: $_SESSION['rate'] = $rate; But maybe that's not what you want... ? Erik PS: you could get this value into the default by doing print "<input type='text' name='rate[]' value='" . $_SESSION['rate'] . "' size='5' />"; IOW, concatenation. ---- Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED]--- End Message ---
--- Begin Message ---On Wed, 6 Feb 2002 16:23:25 -0500, you wrote: > >On Wednesday, February 6, 2002, at 04:08 PM, Floyd Baker wrote: > >> Now I need to make this work using the session register. I have the >> all this working and passing defined variables ok. >> >> How is this done with a manual input? I have tried to use the same >> input line as before.... >> >> print "<INPUT TYPE='text' NAME='rate[]' VALUE='$rate' SIZE='5'>"; >> >> but cannot integrate it into the session register. I have also >> tried track_var configurations with no luck. I can get $vars into the >> register but I need to input values to an array manually. > >I thought that with 4.1, you didn't need to use session_register(). >Rather, you just define the variable you want in the $_SESSION array: > >$_SESSION['rate'] = $rate; > >But maybe that's not what you want... ? > >Erik > >PS: you could get this value into the default by doing > >print "<input type='text' name='rate[]' value='" . >$_SESSION['rate'] . "' size='5' />"; >IOW, concatenation. > >---- > >Erik Price >Web Developer Temp >Media Lab, H.H. Brown >[EMAIL PROTECTED] What I'm trying to do would be more like the reverse... I don't have $rate predefined but need to input it manually via a form. It needs to go into the session register, not be read from it. How does one make a manual *form* entry go directly into the session register. That's about the basic idea I think. I can make name='rate[]' work the old way but can't get name='rate[]' into the session register. Floyd ----- End Message ---
--- Begin Message ---> how would I write it if I wanted to say this: > if $variable == 2 through 4 ??? if(( $variable >= 2 ) && ( $variable <= 4 )) { echo "Equals 2 through 4<br>\n"; } Chris--- End Message ---
--- Begin Message ---try this: if ($v>=2 && $v<=4) { echo "..."; } mihai On Wed, 6 Feb 2002, Jay Fitzgerald wrote: > i am currently using this code: > > if ($variable == 2) || ($variable == 3) || ($variable == 4) > { > echo "hello"; > } > > how would I write it if I wanted to say this: > > if $variable == 2 through 4 ??? > > > > Should you have any questions, comments or concerns, feel free to call me > at 318-338-2034. > > Thank you for your time, > > Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A > ========================================================== > Bayou Internet..............(888) > 30-BAYOU........................http://www.bayou.com > Mississippi Internet.......(800) > MISSISSIPPI...............http://www.mississippi.net > Vicksburg Online..........(800) > MISSISSIPPI................http://www.vicksburg.com > ========================================================== > Tel: (318) 338-2034 ICQ: 38823829 Fax: > (318) 323-5053 > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >--- End Message ---
--- Begin Message ---On Wed, 2002-02-06 at 11:28, David A Dickson wrote: > I need to create a function in another programming language that takes the > same input as the php mktime() function and produces the exact same output > as the php mktime() function. Does anybody out there know what the > algorithm is? > > -- > David A Dickson > [EMAIL PROTECTED] Sure: it starts around line 80 on ext/standard/datetime.c in the source tree: http://cvs.php.net/co.php/php4/ext/standard/datetime.c?r=1.82 Hope this helps, Torben -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506--- End Message ---
--- Begin Message ---There is Zend Cache, it expensive and you have to pay per processor. That drove folks to develop APC (Alternitive PHP Cache) which is open source. http://apc.communityconnect.com/ They take the PHP source and compile it into machine code and stores that code, which saves porcessor overhead when the page is loaded again. APC worked well for me, but that's not where my bottleneck is, mine is with database access so I wanted to cache database queries. I couldn't find any application that did what I wanted so I wrote a class that handles caching queries. In programming it I wanted it to be a transparent as possible and make using it just like using the PEAR mysql module so I could add it to my site with minor modifications. Here is a little on how it works. It checks to see if the query is cached, if not it queries the database. It takes the data returned from the query and stores it in a xml file, which I have on a RAM disk for speed. It returns a result object similiar to the result object from the PEAR mysql stuff. And that object has a FetchRow function just like the mysql result object so it drops right into existing code. It's new and I haven't truely tested it's proformance yet but if you are interested in it. Let me know, I'm positive that people will be able to improve the code in the class which would be cool. On Wed, 2002-02-06 at 09:23, Erick Papadakis wrote: > hello, > > i used asp and it seems there is an application object > which can help in caching of data. (e.g., > http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=142). > > > is this possible using php? what can i do to use > caching on my website which is totally database > driven? > > thanks/erick > > __________________________________________________ > Do You Yahoo!? > Send FREE Valentine eCards with Yahoo! Greetings! > http://greetings.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com--- End Message ---
--- Begin Message ---Hi! I want to know is is there a way to see the data per loop when using hte odbc_fetch_into() function? I want to see all of hte data. Thanks, Scott--- End Message ---
--- Begin Message ---I think it has something to do with the lines being too long, try throwing in a few carriage returns and see if that solve your problem Martin -----Original Message----- From: nina [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 5:21 PM To: [EMAIL PROTECTED] Subject: [PHP] Fw: why !^ in email? ----- Original Message ----- From: "YY" <[EMAIL PROTECTED]> Newsgroups: php.general Sent: Wednesday, February 06, 2002 1:29 PM Subject: why !^ in email? > why appear !^ in email when I send HTML email with mail() function? It works > w/ those HTML codes, but I've no idea why there are some "!" signs appear in > the email. Can anyone help? > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- End Message ---
--- Begin Message ---On Wed, 2002-02-06 at 08:26, John Fulton wrote: > > Does anyone know which algorithm in_array() uses? > > For example, if I say > > in_array("foo", $arr) > > Does in_array() do an unordered sequential serach of $arr for > "foo" which takes up to n comparisons [where n = count($arr)], > or does it do a binary search which takes about lg(n) comparisons? > Is it up to me to maintain a sorted array in the later case? > > Thanks, > John Well, the source for the currect version of that function (as of 4.2.0-dev) is here: http://cvs.php.net/co.php/php4/ext/standard/array.c?r=1.156 Search down the page for 'php_search_array'--that's the function which actually does the searching. Looks like a simple sequential search to me. Torben -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506--- End Message ---
--- Begin Message ---Is there any way to suppress or detect when the closing element event fires from tags in the form <tag /> rather than <tag></tag>?--- End Message ---
--- Begin Message ---In <000a01c1af5a$dbf70140$73fd883e@laptop>, Hammy wrote: > Is there any way to suppress or detect when the closing element event > fires from tags in the form <tag /> rather than <tag></tag>? > no, i don't think so. It means exactly the same in the XML-sense, so why should there be a difference in reporting it... chregu--- End Message ---
--- Begin Message ---if you set up the xml_set_character_data_handler(), maybe this isn't called for <tag />, but it will be called for <tag></tag> (??) you might want to check that 'cause I haven't :) Martin -----Original Message----- From: Christian Stocker [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 10:50 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: XML closing elements called for <tag /> In <000a01c1af5a$dbf70140$73fd883e@laptop>, Hammy wrote: > Is there any way to suppress or detect when the closing element event > fires from tags in the form <tag /> rather than <tag></tag>? > no, i don't think so. It means exactly the same in the XML-sense, so why should there be a difference in reporting it... chregu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- End Message ---
--- Begin Message ---You also seem to have an extra equals. Your loop should read: while (false != ($file=readdir($handle))){ It should come up as an error, but I'm not sure. Ben Manuel Ritsch wrote: > Hello There > > I'm new to PHP and trying to code a function that reads all teh files out of > a directory and printing out a link and the filesize, > but it seems that the filesize() function doesn't work, here's the code so > far: > > $handle = opendir ('images'); > echo "Files:<br><br>"; > while (false !== ($file = readdir ($handle))) { > if($file != "." && $file != "..") > { > $file_s = filesize($file); > echo "<a href=images/$file>$file</a> Filesize: > $file_s<br>"; > } > } > closedir($handle); > > and the output is somethingl ike this: > > Files: > button_test_04.gif Filesize: > button_test_03-down.gif Filesize: > lilextras_01.gif Filesize: > (and so on)... > > You see, there's no Filesize and I don't know why, please help me > > -- manu--- End Message ---
--- Begin Message ---that should be okay - it's to make sure that it is exactly equal to (as opposed to equates to be equal to) eg (0 === false) => false (0 == false) => true -----Original Message----- From: Ben Crawford [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 2:28 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Newbie: Question about filesize() You also seem to have an extra equals. Your loop should read: while (false != ($file=readdir($handle))){ It should come up as an error, but I'm not sure. Ben Manuel Ritsch wrote: > Hello There > > I'm new to PHP and trying to code a function that reads all teh files out of > a directory and printing out a link and the filesize, > but it seems that the filesize() function doesn't work, here's the code so > far: > > $handle = opendir ('images'); > echo "Files:<br><br>"; > while (false !== ($file = readdir ($handle))) { > if($file != "." && $file != "..") > { > $file_s = filesize($file); > echo "<a href=images/$file>$file</a> Filesize: > $file_s<br>"; > } > } > closedir($handle); > > and the output is somethingl ike this: > > Files: > button_test_04.gif Filesize: > button_test_03-down.gif Filesize: > lilextras_01.gif Filesize: > (and so on)... > > You see, there's no Filesize and I don't know why, please help me > > -- manu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- End Message ---
--- Begin Message ---At 10:27 AM 2/6/2002 -0500, Ben Crawford wrote: >You also seem to have an extra equals. Your loop should read: > >while (false != ($file=readdir($handle))){ I think you could eliminate the "false !=" in the while condition... It should be just the same if you write while (($file = readdir($handle))) right? -Jeff--- End Message ---
--- Begin Message ---On Wed, 2002-02-06 at 07:27, Ben Crawford wrote: > You also seem to have an extra equals. Your loop should read: > > while (false != ($file=readdir($handle))){ > > It should come up as an error, but I'm not sure. > > Ben No, that's the 'identical' operator, which returns true when its operands are both equalivalent and of the same type: http://www.php.net/manual/en/language.operators.comparison.php Cheers, Torben -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506--- End Message ---
--- Begin Message ---On Wed, 2002-02-06 at 15:33, Jeff Sheltren wrote: > At 10:27 AM 2/6/2002 -0500, Ben Crawford wrote: > >You also seem to have an extra equals. Your loop should read: > > > >while (false != ($file=readdir($handle))){ > > I think you could eliminate the "false !=" in the while condition... > > It should be just the same if you write > while (($file = readdir($handle))) > > right? > > -Jeff Wrong, actually. If you have any files in that directory which have names which would evaluate as false in PHP, then your way will fail on them and you'll get a truncated directory listing. Do 'touch 0' in a directory and give it a shot; you'll see what I mean. However, the original example does the same thing, since it only checks whether the result of the readdir() evaluates to FALSE, not whether it actually is a boolean FALSE value. The correct way to do this is: while (FALSE !== ($file = readdir($handle))) { . . . } Note the !== instead of !=. Hope this helps, Torben -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506--- End Message ---
--- Begin Message ---I apoligize if this question has already been asked but.... I am looking to upload files to my server. I use a form and can get the files to upload as user nobody with a random file name on my Linux box. That is the problem, the user is 'nobody'. This is either an Apache thing or a PHP thing and I haven't been able to figure it out. Is there some sort of login that I should be doing. I have tried the basic login just to check if that will work but it doesn't. Ben--- End Message ---
--- Begin Message ---The username will be the same username that apache is running as, which you can specify in your httpd.conf file. -Jeff At 10:32 AM 2/6/2002 -0500, Ben Crawford wrote: >I apoligize if this question has already been asked but.... > >I am looking to upload files to my server. I use a form and can get the >files to upload as user nobody with a random file name on my Linux box. >That is the problem, the user is 'nobody'. This is either an Apache >thing or a PHP thing and I haven't been able to figure it out. Is there >some sort of login that I should be doing. I have tried the basic login >just to check if that will work but it doesn't. > >Ben--- End Message ---
--- Begin Message ---Help!! How to move an array's internal pointer to the required element not the first one or last one??? Thanks!!!--- End Message ---
--- Begin Message ---if you created a "number" array then just input number between the brackets: echo $array_name['some_number_goes_here']; if you want all array values to print: for ($i=0;$i<=count($array_name);$i++) { echo $array_name[$i]; } if it's an associate array then input the name of the array element: echo $array_name['some_word_goes_here']; ----- Original Message ----- From: "Pavel Zvertsov" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 06, 2002 12:23 PM Subject: [PHP] Array !!! > Help!! > > How to move an array's internal pointer to the required element not the > first one or last one??? > > Thanks!!! > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >--- End Message ---
--- Begin Message ---I want to extract information from a database table and create a half-static, half-dynamic PHP page from the info. I want to store the template for the new page in an external file with tags in the places where I want variables to be printed. What;s the best of achieving this?? I tried "fread" but that just printed "<? echo $variable; ?>" to the static page instead of replacing it with the value. Any suggestions? -- Regards, Georgie Casey [EMAIL PROTECTED] *************************** http://www.filmfind.tv Ireland's Online Film Production Directory ***************************--- End Message ---
--- Begin Message ---Use include(); or require(); -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -------------------------------------------- -----Original Message----- From: Georgie Casey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 3:32 PM To: [EMAIL PROTECTED] Subject: [PHP] Writing PHP files from inside a PHP file I want to extract information from a database table and create a half-static, half-dynamic PHP page from the info. I want to store the template for the new page in an external file with tags in the places where I want variables to be printed. What;s the best of achieving this?? I tried "fread" but that just printed "<? echo $variable; ?>" to the static page instead of replacing it with the value. Any suggestions? -- Regards, Georgie Casey [EMAIL PROTECTED] *************************** http://www.filmfind.tv Ireland's Online Film Production Directory *************************** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- End Message ---
--- Begin Message ---include() and require() were suggested, but you may also want to look into eval(), which parses a string as PHP code and returns the parsed PHP. Sounds like what you're looking for. (I.e. storing PHP code in a database, right?) J Georgie Casey wrote: > I want to extract information from a database table and create a > half-static, half-dynamic PHP page from the info. I want to store the > template for the new page in an external file with tags in the places > where I want variables to be printed. What;s the best of achieving this?? > > I tried "fread" but that just printed "<? echo $variable; ?>" to the > static page instead of replacing it with the value. > > Any suggestions? > -- > Regards, > Georgie Casey > [EMAIL PROTECTED] > > *************************** > http://www.filmfind.tv > Ireland's Online Film Production Directory > ***************************--- End Message ---
--- Begin Message ---The function you are looking for is 'explode'. It works like this, say you have a line of text stored in line of say pizza topping like this: $pizza_toppings = "topping1,topping2,topping3" and now you want the toppings in an array just do this: $toppings = explode(",", $pizza_toppings); then you will have an array $toppings with entries for each of the toppings. Hope this helps. Ben Simos Varelakis wrote: > Hi to everyone > > i have the following problem > > i have a string $foo which contains (n variable) comma separated values > (example "1,17,23,45") > and i want to insert these values in a mysql table . The destination field > is int type and i need to insert one record per value > > Do you know which php function(s) should i use in order to (loop -extract > the values from string) and do that ?? > > Thanks in advance for your help > > regars > > simos--- End Message ---
--- Begin Message ---Hi =) I saw PHP has built-in support for Cybercash, but that Verisign has purchased them. It looks like I'll have to go with Payflow Pro, but I'm wondering if PHP has built-in support, available modules, or what the best approach is. Any recommendations? Thanks, -Ed **************************************************************************** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much.--- End Message ---
--- Begin Message ---Hi, has anyone successfully posted an XML data file using the PHP cURL functions? If so, could you please send an example of the "curl_setopt" function names used. Thanks in advance Petras--- End Message ---
--- Begin Message ---this is what I'm using: $ch = curl_init($gat_url); // url to post to curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); // contains the XML curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $x = curl_exec($ch); curl_close($ch); -----Original Message----- From: Petras Virzintas [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 12:24 PM To: PHP General List Subject: [PHP] cURL and XML? Hi, has anyone successfully posted an XML data file using the PHP cURL functions? If so, could you please send an example of the "curl_setopt" function names used. Thanks in advance Petras--- End Message ---
--- Begin Message ---Hello, well, here i have my first project and my first problem i write 2 litlte pages. The error consists that if the first item is not selected, "receptor.php" dont print nothing page 1 <? $articulo[0]="Xinna"; $precio[0]=0; $articulo[1]="joelllis"; $precio[1]=1; $articulo[2]="marcantonia"; $precio[2]=2; $articulo[3]="Trivol"; $precio[3]=3; ?> <form method="post" action="receptor.php"> <?for ($contador=0; $articulo[$contador]!="";$contador++): print "<INPUT TYPE='checkbox' NAME='seleccion[$contador]' VALUE='$articulo [$contador]'>"; print $articulo[$contador]; print " $ "; print $precio[$contador]; print "<br>"; endfor;?> <input type=submit value="Ordenar"> </form> ---------------------------------------------------------- // page receptor.php <? $articulo[0]="Xinna"; $precio[0]=0; $articulo[1]="joelllis"; $precio[1]=1; $articulo[2]="marcantonia"; $precio[2]=2; $articulo[3]="Trivol"; $precio[3]=3; ?> <? for ($contador=0; isset ($seleccion[$contador]); ++$contador): print $seleccion[$contador]; print $contador; print $articulo[$contador]; print " $ "; print $precio[$contador]; print "<br>"; endfor; ?>--- End Message ---
--- Begin Message ---I know there must be a tone of articles on the subject. Can anyone give me brief advantages and disadvantages between the 3 languages. Is there something that one language specifically does that another doesn't? Could PHP be used for online banking? Usually banks use JSP or ASP, why don't banks use PHP? Is there security issues? Thanks, Ben--- End Message ---
--- Begin Message ---PHP could be used for online banking. Banks use ASP because there is software already written in ASP for what they need. Also, they use it because it's from Microsoft. Tyler ----- Original Message ----- From: "Ben Clumeck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 06, 2002 9:14 PM Subject: [PHP] Differences between PHP, ASP, JSP > I know there must be a tone of articles on the subject. Can anyone give me > brief advantages and disadvantages between the 3 languages. Is there > something that one language specifically does that another doesn't? > > Could PHP be used for online banking? Usually banks use JSP or ASP, why > don't banks use PHP? Is there security issues? > > Thanks, > > Ben > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php--- End Message ---
--- Begin Message ---hi, i'm fairly new to this. what i want to do is use a form so the user can specify a few different choices of things they want to buy. maybe a few radio buttons with dollar amounts and then possibly a couple of quantity fields for items. this can then be passed to a script and total added up etc. and the user can input their billing data. what i don't want is for the user to be able to see the amount of the transaction in the source code in a hidden field. how do i hide this data while still passing it to the credit card script along with all the other info? thanks.--- End Message ---
--- Begin Message ---On Wed, 2002-02-06 at 17:36, wm wrote: > hi, > > i'm fairly new to this. > > what i want to do is use a form so the user can specify a few different > choices > of things they want to buy. maybe a few radio buttons with dollar > amounts and > then possibly a couple of quantity fields for items. > > this can then be passed to a script and total added up etc. and the user > > can input > their billing data. what i don't want is for the user to be able to see > the amount of > the transaction in the source code in a hidden field. > > how do i hide this data while still passing it to the credit card script > > along with all > the other info? > > thanks. Sorry, perhaps I've misunderstood. You would like to charge a customer's card without the customer knowing how much you're charging them? -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506--- End Message ---
--- Begin Message ---sorry lars. i accidentally just emailed you back instead of posting this. i want the user to be able to see the amount being charged on the screen, but not to be able to view it in a hidden field in the source code. most shopping cart applications are like this. ?? Lars Torben Wilson wrote: > On Wed, 2002-02-06 at 17:36, wm wrote: > > hi, > > > > i'm fairly new to this. > > > > what i want to do is use a form so the user can specify a few different > > choices > > of things they want to buy. maybe a few radio buttons with dollar > > amounts and > > then possibly a couple of quantity fields for items. > > > > this can then be passed to a script and total added up etc. and the user > > > > can input > > their billing data. what i don't want is for the user to be able to see > > the amount of > > the transaction in the source code in a hidden field. > > > > how do i hide this data while still passing it to the credit card script > > > > along with all > > the other info? > > > > thanks. > > Sorry, perhaps I've misunderstood. You would like to charge a customer's > card without the customer knowing how much you're charging them? > > -- > Torben Wilson <[EMAIL PROTECTED]> > http://www.thebuttlesschaps.com > http://www.hybrid17.com > http://www.inflatableeye.com > +1.604.709.0506--- End Message ---
--- Begin Message ---In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Obo) wrote: > > Sorry, perhaps I've misunderstood. You would like to charge a customer's > > card without the customer knowing how much you're charging them? > i want the user to be able to see the amount being charged on the > screen, but not to be able to view it in a hidden field in the source > code. most shopping cart applications are like this. What would be the point of that? If they can see it onscreen anyway (as they should), why hide it in the source? Could you point out some URLs where there are shopping carts like this? -- CC--- End Message ---
--- Begin Message ---amazon.com vitaminworld Cc Zona wrote: > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Obo) > wrote: > > > > Sorry, perhaps I've misunderstood. You would like to charge a customer's > > > card without the customer knowing how much you're charging them? > > > i want the user to be able to see the amount being charged on the > > screen, but not to be able to view it in a hidden field in the source > > code. most shopping cart applications are like this. > > What would be the point of that? If they can see it onscreen anyway (as > they should), why hide it in the source? > > Could you point out some URLs where there are shopping carts like this? > > -- > CC--- End Message ---
--- Begin Message ---On Wed, 2002-02-06 at 19:35, obo wrote: > sorry lars. i accidentally just emailed you back instead of posting this. > > i want the user to be able to see the amount being charged on the screen, but > not to be able > to view it in a hidden field in the source code. most shopping cart > applications are like this. > > ?? I cannot think of why this would be useful--in fact, if you're having to chase the same value around in two or more places, you could have a problem keeping them synced--but hey. :) You could always just store it in a session variable, which I believe is the way it's normally done. Torben > Lars Torben Wilson wrote: > > > On Wed, 2002-02-06 at 17:36, wm wrote: > > > hi, > > > > > > i'm fairly new to this. > > > > > > what i want to do is use a form so the user can specify a few different > > > choices > > > of things they want to buy. maybe a few radio buttons with dollar > > > amounts and > > > then possibly a couple of quantity fields for items. > > > > > > this can then be passed to a script and total added up etc. and the user > > > > > > can input > > > their billing data. what i don't want is for the user to be able to see > > > the amount of > > > the transaction in the source code in a hidden field. > > > > > > how do i hide this data while still passing it to the credit card script > > > > > > along with all > > > the other info? > > > > > > thanks. > > > > Sorry, perhaps I've misunderstood. You would like to charge a customer's > > card without the customer knowing how much you're charging them? > > > > -- > > Torben Wilson <[EMAIL PROTECTED]> > > http://www.thebuttlesschaps.com > > http://www.hybrid17.com > > http://www.inflatableeye.com > > +1.604.709.0506 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506--- End Message ---
--- Begin Message ---On Wed, 2002-02-06 at 20:03, Lars Torben Wilson wrote: > On Wed, 2002-02-06 at 19:35, obo wrote: > > sorry lars. i accidentally just emailed you back instead of posting this. > > > > i want the user to be able to see the amount being charged on the screen, but > > not to be able > > to view it in a hidden field in the source code. most shopping cart > > applications are like this. > > > > ?? > > I cannot think of why this would be useful--in fact, if you're having to > chase the same value around in two or more places, you could have a > problem keeping them synced--but hey. :) You could always just store it > in a session variable, which I believe is the way it's normally done. > > > Torben Never mind, I just figured out what you meant. :) Well, in order to prevent it from going client-side (anything sent to the client can be read by the user, one way or another), you'll need to store it server-side. Keep it in a session variable, as I said before. Torben -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506--- End Message ---
--- Begin Message ---In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Wm) wrote: > Cc Zona wrote: > > > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Obo) > > wrote: > > > > > > Sorry, perhaps I've misunderstood. You would like to charge a customer's > > > > card without the customer knowing how much you're charging them? > > > > > i want the user to be able to see the amount being charged on the > > > screen, but not to be able to view it in a hidden field in the source > > > code. most shopping cart applications are like this. > > > > What would be the point of that? If they can see it onscreen anyway (as > > they should), why hide it in the source? > > > > Could you point out some URLs where there are shopping carts like this? > amazon.com > vitaminworld Many shopping carts track persistent data (including running totals) via cookies. If you just want to know *how* to do what they do, the short answer is "cookies" <http://php.net/sessions> <http://php.net/set-cookie>. But I doubt any of them are doing so with the *intent* to prevent onscreen data from being viewable in the source. -- CC--- End Message ---
--- Begin Message ---is there a command in php to post form data to a script? example: i have a form. once the submit is hit i use php to check the values. if the values are ok i then call a function to post the data. thanks.--- End Message ---
--- Begin Message ---On Wed, 2002-02-06 at 19:32, obo wrote: > is there a command in php to post form data to a script? > > example: > > i have a form. once the submit is hit i use php to check the values. if > the values are ok i then call a function > to post the data. > > thanks. This is a fairly common request. Your best bets are to search for 'posttohost' in the mailing list archives, or just use cURL: http://www.php.net/curl ...which will more than likely satisfy any posting cravings you may have. :) Torben -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506--- End Message ---
--- Begin Message ---Or use such method: 1. create form with $PHP_SELF as action 2. in the beginning of php script check if form was posted and if was check it for correctness 3. if form is ok, save post data and then redirect user with Header(to certain page) 4. if form is bad, stay at this script and display both: error messages and form fields hope that helps; at least it helped me greatly, especially in saving my time Valentin Petruchek (aki Zliy Pes) *** Cut the beginning *** http://zliypes.com.ua mailto:[EMAIL PROTECTED] ----- Original Message ----- From: "Lars Torben Wilson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, February 07, 2002 6:06 AM Subject: Re: [PHP] function to post data > On Wed, 2002-02-06 at 19:32, obo wrote: > > is there a command in php to post form data to a script? > > > > example: > > > > i have a form. once the submit is hit i use php to check the values. if > > the values are ok i then call a function > > to post the data. > > > > thanks. > > This is a fairly common request. Your best bets are to search for > 'posttohost' in the mailing list archives, or just use cURL: > > http://www.php.net/curl > > ...which will more than likely satisfy any posting cravings you > may have. :) > > > Torben > > -- > Torben Wilson <[EMAIL PROTECTED]> > http://www.thebuttlesschaps.com > http://www.hybrid17.com > http://www.inflatableeye.com > +1.604.709.0506 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >--- End Message ---
--- Begin Message ---I am trying to create a pulldown menu based on the contents of a directory. Is there any way for PHP to read a directory and create the menu based on the files in that directory. It should create this menu dynamically each time the page is viewed, so if a file is deleted from that directory, it doesn't show up in the pulldown menu, if one is added, it shows up. So if the directory has two files in it, 1-2-2002.txt and 3-5-2002.txt, it will add these entries to the <select> menu: <option value="1-2-2002.txt">1-2-2002</option> <option value="3-5-2002.txt">3-5-2002</option> TIA John __________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com--- End Message ---
--- Begin Message ---On Thursday 07 February 2002 11:58, John P. Donaldson wrote: > I am trying to create a pulldown menu based on the > contents of a directory. Is there any way for PHP to > read a directory and create the menu based on the > files in that directory. It should create this menu > dynamically each time the page is viewed, so if a file > is deleted from that directory, it doesn't show up in > the pulldown menu, if one is added, it shows up. So > if the directory has two files in it, 1-2-2002.txt and > 3-5-2002.txt, it will add these entries to the > <select> menu: > > <option value="1-2-2002.txt">1-2-2002</option> > <option value="3-5-2002.txt">3-5-2002</option> Have a look at the chapter on "Filesystem Functions". -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* As he had feared, his orders had been forgotten and everyone had brought the potato salad. */--- End Message ---
--- Begin Message ---Hi, I am trying to upload a file from remote machine. Could you please help out me. Thanks in advance -Balaji ------------ upload.html ------------- <!DOCTYPE html public "-//w3c//dtd html 4.0 transitional//en"> <HTML> <TITLE> FileUpload </TITLE> <BODY> <center> <form action='upload.php' method='post' enctype='multipart/form-data'> <br><br><br> File: <input type='file' name='path'> <input type='submit' value='UPLOAD'> </form> </center> </BODY> </HTML> ---------------- upload.php ---------------- <?php echo "Path: $path <BR>"; $file=basename($path); echo "File name : $file"; if(copy($file,$path)){ echo "$file <br>$path"; print "<font face='verdana' size='2' class='text_size_9'>Your file has been uploaded!!!</font><br><br>" ; } else { print "<font face='verdana' size='2' class='text_size_9'>A problem was encountered during your file upload.</font><br>"; } ?>**************************Disclaimer************************************ Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. ********************************************************************--- End Message ---
--- Begin Message ---Hi Balaji, > I am trying to upload a file from remote machine. > Could you please help out me. Two things: > upload.html > ------------- > <form action='upload.php' method='post' enctype='multipart/form-data'> This also needs to have a maximum file size specified: <INPUT TYPE=HIDDEN NAME='MAX_FILE_SIZE' VALUE='200000'> > upload.php > ---------------- In this script, you'll want to copy $file to "/path/to/copy/to/filename". This doesn't seem to be what you're doing in the script you sent us, you overwrote $file with a new variable, $path - thus, losing the name of the temp file PHP copied the uploaded data into. Take care that you use the appropriate security measures to protect yourself against exploits here. Jason -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT "Work now, freak later!"--- End Message ---
--- Begin Message ---Hi all, Is there any way to get file download time, using php functions?, if not, could any one help to get it done. Thanks for sparing your precious time. Cheers, - JFK kishor Nilgiri Networks--- End Message ---
--- Begin Message ---On Thursday 07 February 2002 13:19, J.F.Kishor wrote: > Hi all, > > Is there any way to get file download time, using php functions?, > if not, could any one help to get it done. If you mean "how long it had taken for someone to download a file from your site" then yes. You need to handle file download links yourself. Thus all your download links would have to be of the form: http://www.domain.com/download.php?file=somefile Then your download.php would be in psuedo-code: <? retrieve filename from URL; look up file details (size) in filesystem; start a timer; output the appropriate HTTP headers; read and output the contents of file; stop timer; calculate elapsed time; ?> -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* "I'd love to go out with you, but I've been scheduled for a karma transplant." */--- End Message ---
--- Begin Message ---Hello everyone, I'm a "newbie" when it comes to XML. I need to know if there's an easy-to-understand documentation/tutorial online that will help me understand how PHP and XML work together, what software technologies PHP uses to parse XML/XSLT documents, and how to actually build PHP to have support of these parsers available on the Win32 platform. Can anyone help me find some resources? I went to www.php.net and they assume too much about their audience, and therefore it's hard to understand their documentations sometimes. Thanks in advance. :)--- End Message ---
--- Begin Message ---Hello List, Does anyone know of a Really Good way to determine what kind of loads your Webserver/network can handle before degrading performance or flaking out? I would like to find this out about our server before it fails us under heavy load. Thanks, Jason Garber Univo.biz--- End Message ---
--- Begin Message ---I am trying to install MySQL on WinXP, I get the following error message: Microsoft(R) Windows DOS (C)Copyright Microsoft Corp 1990-2001. C:\DOCUME~1\BEN>cd c:\mysql\bin C:\MYSQL\BIN>mysqld--standalone 'MYSQLD--STANDALONE' is not recognized as an internal or external command, operable program or batch file. C:\MYSQL\BIN>mysqladmin create testDB MYSQLADMIN: connect to server at 'localhost' failed error: 'Can't connect to MySQL server on 'localhost' (10061)' Check that mysqld is running on localhost and that the port is 3306. You can check this by doing 'telnet localhost 3306' Can anyone help? Please. Thanks, Ben--- End Message ---
--- Begin Message ---On 20 0, Ben Clumeck <[EMAIL PROTECTED]> wrote: > I am trying to install MySQL on WinXP, I get the following error message: > > Microsoft(R) Windows DOS > (C)Copyright Microsoft Corp 1990-2001. > > C:\DOCUME~1\BEN>cd c:\mysql\bin > > C:\MYSQL\BIN>mysqld--standalone > 'MYSQLD--STANDALONE' is not recognized as an internal or external command, > operable program or batch file. try 'mysqld --standalone' (note the space) it appears that you are not actually starting mysqld -- *-*-*-*-*-*-*-*-*-* So It Goes *-*-*-*-*-*-*-*-*-*--- End Message ---
--- Begin Message ---Dave, I tried it and got the following message: Microsoft(R) Windows DOS (C)Copyright Microsoft Corp 1990-2001. C:\DOCUME~1\BEN>cd c:\mysql\bin C:\MYSQL\BIN>mysqld --standalone 'MYSQLD' is not recognized as an internal or external command, operable program or batch file. Any suggestions? Ben -----Original Message----- From: Dave Barry [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 12:05 AM To: Ben Clumeck Cc: [EMAIL PROTECTED] Subject: Re: [PHP] MySQL Install Problem On 20 0, Ben Clumeck <[EMAIL PROTECTED]> wrote: > I am trying to install MySQL on WinXP, I get the following error message: > > Microsoft(R) Windows DOS > (C)Copyright Microsoft Corp 1990-2001. > > C:\DOCUME~1\BEN>cd c:\mysql\bin > > C:\MYSQL\BIN>mysqld--standalone > 'MYSQLD--STANDALONE' is not recognized as an internal or external command, > operable program or batch file. try 'mysqld --standalone' (note the space) it appears that you are not actually starting mysqld -- *-*-*-*-*-*-*-*-*-* So It Goes *-*-*-*-*-*-*-*-*-*--- End Message ---