php-general Digest 14 Apr 2001 03:17:42 -0000 Issue 626 Topics (messages 48447 through 48507): Re: Calling Functions without all the arguments 48447 by: Hardy Merrill 48449 by: Chris Aitken 48450 by: Rasmus Lerdorf 48454 by: Chris Aitken Compile Problems 48448 by: Rohan Amin 48451 by: Rasmus Lerdorf Re: "show tables" in oracle 8-i 48452 by: Adi Wibowo Re: install question: idiot guide to apache and phph and mysql on win NT 4 48453 by: Peter Van Dijck I know POST Uploads, what about "downloads?" 48455 by: Chris Anderson 48460 by: Pierre-Yves Lemaire how to get num of sessions vars? 48456 by: phpman 48459 by: Keyur Kalaria 48464 by: phpman 48491 by: phpman Re: install question: idiot guide to apache and phph and mysql on win NT 4 - solved! 48457 by: Peter Van Dijck [EMAIL PROTECTED] PLEASE UNSUBSCRIBE!!! 48458 by: Chris Anderson 48463 by: Richard Re: getting all variables from session into array 48461 by: Christian Reiniger Re: Do any of you provide hosting? 48462 by: Jeff Pearson Re: What variable are being sent to my script? 48465 by: Jerry Lake file upload 48466 by: luis 48472 by: maatt Re: Developing new PHP modules 48467 by: Philip Olson How to I convert the PHP variable back into Javascript? 48468 by: Scott Fletcher 48469 by: Gianluca Baldo install question:php and mysql on win NT 4 48470 by: Peter Van Dijck 48471 by: Fabian Raygosa 48473 by: Phil Driscoll 48475 by: Peter Van Dijck 48477 by: Fabian Raygosa URGENT: Session problem not carrying UserName over 48474 by: Mike Yuen 48476 by: CC Zona how to put javascript array into php array? 48478 by: Scott Fletcher help with php java support 48479 by: Spencer Gibb casting arrays as objects 48480 by: Dean Hall 48489 by: Morgan Curley 48495 by: Dean Hall stdout/stderr 48481 by: Jake Fan Updating Sessions 48482 by: Jordan Elver 48484 by: CC Zona era2 48483 by: Jerry Lake PHP4 parsing canceled 48485 by: Norbert Pfeiffer Re: ROUND inconsistency 48486 by: Philip Hallstrom undefined symbol error 48487 by: Curtis Maurand Sessions? 48488 by: Ashley M. Kirchner XML via socket connection 48490 by: phpman 48504 by: Dean Hall PHP.NET small error in the date 48492 by: Matthew M. Boulter Turkey's "Biz" Portal 48493 by: http://www.thebizseeker-turkey.com php, mysql, and wysiwyg. 48494 by: FredrikAT 48503 by: Dean Hall foreach function 48496 by: kenny.hibs 48502 by: Dean Hall Any Australian Conferences coming up???? 48497 by: Matthew M. Boulter HTML and PHP? 48498 by: Jason Caldwell 48500 by: DanO 48501 by: Les Neste 48506 by: Patrick Dunford Re: return parse error 48499 by: Yasuo Ohgaki Re: header( ) 48505 by: Patrick Dunford sorting multi-dimensional arrays 48507 by: Shane43.aol.com 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] ----------------------------------------------------------------------
Chris Aitken [[EMAIL PROTECTED]] wrote: > On Fri, 13 Apr 2001, Chris Aitken wrote: > > >--------------------------------------- > > > >Warning: Missing argument 2 for stripe() in /location/to/included/file.php on line >257 > >Warning: Missing argument 3 for stripe() in /location/to/included/file.php on line >257 > > > >--------------------------------------- > > > > Okay, ive managed to do some more playing, and come up with some more > info. > > The above error only shows up when I have a function being called without > all the arguments filled in. For example, if I have a function as > "function blah($foo,$bar)" and call the function with both $foo and $bar > set, it will run just fine. But if I call it with only $foo it comes up > with these errors. > > The thing is, the previous version of PHP must have alowed me to call > functions without all the arguments and it never batted an eyelid or gave > an error. > > My question is, is there something I didnt compile into the new PHP, or is > there a line in php.ini file I need to modify so that it doesnt show these > errors up (or should I adjust my code so that I dont call functions > without all the arguments) ? I found the same problem - when we upgraded to PHP4, function calls that used to work and NOT provide all the parameters, started failing. The way I fixed it was to give each parameter a default value *IN* the function definition, like: function abc($a='', $b='') // assigns null as parameter defaults that way, every parameter gets a value, even if all the parameters were not supplied in the call. HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com
On Fri, 13 Apr 2001, Hardy Merrill wrote: >I found the same problem - when we upgraded to PHP4, function calls >that used to work and NOT provide all the parameters, started failing. > >The way I fixed it was to give each parameter a default value *IN* >the function definition, like: > >function abc($a='', $b='') // assigns null as parameter defaults > >that way, every parameter gets a value, even if all the parameters >were not supplied in the call. > This works great (thanks for that :). However my question now is, what is the general opinion about how to handle this. Is it better to call functions giving all arguments values (even if its an empty "" value) or is it fine to assign values from within the function as described above ? Chris
If a function has not been defined to take optional arguments, then you *must* provide these arguments when you call the function. The fact that previous versions of PHP incorrectly let you do this was at best an undocumented misfeature, but more likely a bug. And yes, having optional arguments with the default value defined in the function definition is perfectly acceptable. -Rasmus On Sat, 14 Apr 2001, Chris Aitken wrote: > On Fri, 13 Apr 2001, Hardy Merrill wrote: > > >I found the same problem - when we upgraded to PHP4, function calls > >that used to work and NOT provide all the parameters, started failing. > > > >The way I fixed it was to give each parameter a default value *IN* > >the function definition, like: > > > >function abc($a='', $b='') // assigns null as parameter defaults > > > >that way, every parameter gets a value, even if all the parameters > >were not supplied in the call. > > > > This works great (thanks for that :). However my question now is, what is > the general opinion about how to handle this. > > Is it better to call functions giving all arguments values (even if its an > empty "" value) or is it fine to assign values from within the function as > described above ?
On Fri, 13 Apr 2001, Rasmus Lerdorf wrote: >If a function has not been defined to take optional arguments, then you >*must* provide these arguments when you call the function. The fact that >previous versions of PHP incorrectly let you do this was at best an >undocumented misfeature, but more likely a bug. > Yeah, I kinda figured it would have been some sort of oversite with the beta version we were running. I pretty much started learning PHP using this install of PHP4 so I guess I picked up some bad habits learning along the way becase the install of PHP never stopped me, so I never knew there was a problem and never investigated my code. Chris
Configuration: Red Hat Linux 7.0 PHP 4.0 PL1 iODBC 3.0.4 Sablotron 0.5.1 Apache 1.3.19 We are attempting to compile PHP with iodbc, Java, and XML/Sablotron support as a static module for Apache 1.3.19. Depending upon the combination of options, the module fails to build or builds and dies with the segmentation violation. Before debugging, I thought I would check around to see if this is a known problem. Thanks in advance. Rohan
I assume you mean PHP 4.0.4pl1 I would go grab a recent snapshot from http://snaps.php.net and see if that solves the problem. If it doesn't, let us know and we can try to track it down. If it does then it is obviously an issue that has been fixed and you can either just stick with the snapshot release or look at the Changelog and figure out which change fixed the issue and apply just that change to the 4.0.4pl1 release you are using. -Rasmus On Fri, 13 Apr 2001, Rohan Amin wrote: > Configuration: > > Red Hat Linux 7.0 > PHP 4.0 PL1 > iODBC 3.0.4 > Sablotron 0.5.1 > Apache 1.3.19 > > We are attempting to compile PHP with iodbc, Java, and XML/Sablotron support > as a static module for Apache 1.3.19. Depending upon the combination of > options, the module fails to build or builds and dies with the segmentation > violation. Before debugging, I thought I would check around to see if this > is a known problem. > > Thanks in advance. > > > Rohan > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
On Thu, 12 Apr 2001, Dennis Gearon wrote: > I've been looking through the book, and so far, I can't find the command > for 'show tables' in Oracle 8i. Anyone know it? It should be > programmatically available, I would think, as an SQL command. select * from tab; Adi Wibowo ------------------------------- * Work matter : [EMAIL PROTECTED] * Private matter : [EMAIL PROTECTED] ------------------------------------------
Hi, thanks for the tips. > first check to see if you actually have those DLLs in your > computer. use Start | Find Files > or whatever you want to use. php_pdf.dll (the first error - the other errors seem to have stopped all by themselves) is actually in the /extensions/ subdir of php. (Php is installed in the cgi bin of Apache, I'm working on win NT 4) > if they're there already, they're just not in your path. do whatever > needs to be done on > your computer to put them in the path (there are different ways to > handle this if you're on > Win95/98, WinNT, Win2000 and probably WinME. i'm only familiar with > the Win95/98 > (edit autoexec.bat), WinNT (i forget exactly, but i can find it if > i've got it in front of me). no idea > where you do that in Win2000 and ME though. > >what web server are you using? are you trying to do this in apache? if >yes, you need to edit >httpd.conf to tell it about php. that's easy, just search for the string >"php" in httpd.conf and >uncomment the relevant lines. it's pretty obvious (one line is >Load-Module, the other is >Add-Type). ok, did that, uncommented these 2 lines in the apache config file: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps I already had added these before: ScriptAlias /php4/ "F:/Program Files/Apache group/Apache/cgi-bin/PHP/" Action application/x-httpd-php4 "/php4/php.exe" AddType application/x-httpd-php4 .php AddType application/x-httpd-php4 .php3 I restarted apache after doing this but I still get the "X-Powered-By: PHP/4.0.4 Content-type: text/html" on every php page. Any ideas? Peter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://liga1.com: building multiple language/culture websites
I have a large script set that allows people I host to manage their files on my server until they have a FTP account setup. Unfortunately the only way they can save an uploaded file is to r-click on the link in the managers listing and choose "Save link target". This obviously doesn't work for PHP or ASP(ugh) because the browser parses them THEN sends it to the client. Is there anyway to allow the client to download the actual unparsed file? Any help would be appreciated ^_^
Hello, Someone posted this a couple of days ago, might help you. $headertxt = "Content-Disposition: attachment; filename=\"".$filename."\""; header("Content-Type: application/force-download");header($headertxt); py At 09:51 AM 4/13/01 -0400, you wrote: >I have a large script set that allows people I host to manage their files >on my server until they have a FTP account setup. Unfortunately the only >way they can save an uploaded file is to r-click on the link in the >managers listing and choose "Save link target". This obviously doesn't >work for PHP or ASP(ugh) because the browser parses them THEN sends it to >the client. Is there anyway to allow the client to download the actual >unparsed file? Any help would be appreciated ^_^ + ====================== + Pierre-Yves Lem@ire + E-MedHosting.com + (514) 729-8100 + [EMAIL PROTECTED] + ======================
I thought this would work.. $num = count($HTTP_SESSION_VARS); ..but it doesn't. I can access the session vars themselves, so I know they're there. Help. -Dave
Hey Dave, you can try the following: num = sizeof($HTTP_SESSION_VARS); regards keyur ----- Original Message ----- From: "phpman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 13, 2001 8:40 PM Subject: [PHP] how to get num of sessions vars? > I thought this would work.. > > $num = count($HTTP_SESSION_VARS); > > ..but it doesn't. I can access the session vars themselves, so I know > they're there. Help. > > -Dave > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Thanks, another quick question. That works and I can access the variables still but this for ($x=0;$x<$s;$x++) { $tmp = $HTTP_SESSION_VARS[$x]; echo("<p>tmp=$tmp</p>\n"); } outputs tmp= ???? Why? How do I cycle through each session var and get its name and value? ""Keyur Kalaria"" <[EMAIL PROTECTED]> wrote in message 006501c0c42e$ba839860$2d64a8c0@office">news:006501c0c42e$ba839860$2d64a8c0@office... > Hey Dave, > > you can try the following: > > num = sizeof($HTTP_SESSION_VARS); > > > regards > keyur > > > ----- Original Message ----- > From: "phpman" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, April 13, 2001 8:40 PM > Subject: [PHP] how to get num of sessions vars? > > > > I thought this would work.. > > > > $num = count($HTTP_SESSION_VARS); > > > > ..but it doesn't. I can access the session vars themselves, so I know > > they're there. Help. > > > > -Dave > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
nevermind ""phpman"" <[EMAIL PROTECTED]> wrote in message 9b78hr$uvb$[EMAIL PROTECTED]">news:9b78hr$uvb$[EMAIL PROTECTED]... > Thanks, > > another quick question. That works and I can access the variables still but > this > for ($x=0;$x<$s;$x++) { > $tmp = $HTTP_SESSION_VARS[$x]; > echo("<p>tmp=$tmp</p>\n"); > } > > outputs > > tmp= > > > > ???? Why? How do I cycle through each session var and get its name and > value? > > > ""Keyur Kalaria"" <[EMAIL PROTECTED]> wrote in message > 006501c0c42e$ba839860$2d64a8c0@office">news:006501c0c42e$ba839860$2d64a8c0@office... > > Hey Dave, > > > > you can try the following: > > > > num = sizeof($HTTP_SESSION_VARS); > > > > > > regards > > keyur > > > > > > ----- Original Message ----- > > From: "phpman" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Friday, April 13, 2001 8:40 PM > > Subject: [PHP] how to get num of sessions vars? > > > > > > > I thought this would work.. > > > > > > $num = count($HTTP_SESSION_VARS); > > > > > > ..but it doesn't. I can access the session vars themselves, so I know > > > they're there. Help. > > > > > > -Dave > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I copied the php_pdf.dll file from the apache/cgi-bin/php/.. directory to the windows/winnt/system32 directory (it was just a hunch) and behold, it worked brilliantly!! Thanks!!!!! Now I just have to figure out how to: 1- get mysql to work 2- get virtual domains to worl Peter >hello, i'm not an expert on apache/php for windows, so i won't go on the >list so as not to pollute it with possibly wrogn answers. the following are >generic troubleshooting things, not specific to your question. > >caveat emptor :). > >On Fri, 13 Apr 2001, you wrote: > > "Unable to load dynamic library 'php_pdf.dll' - The specified module could > > "The dynamic link library isqlt09a.dll could not be found in the > specified path > > > >f:\PROGRA~1\APACHE~1\apache\cgi-bin\php;.;C:\WINNT\System32;C:\WINNT\system;C:\WINNT;F:\jdk1.3.0_01\bin\;C:\WINNT\system32;C:\WINNT;." > > "Unable to load dynamic library > > 'F:\PROGRA~1\APACHE~1\Apache\cgi-bin\PHP\EXTENSIONS/php_ifx.dll' - The > > specified module could not be found." > > first check to see if you actually have those DLLs in your > computer. use Start | Find Files > or whatever you want to use. > > if they're not there, you'll need to find them somewhere on the > web. or, if you don't need them, > find an apache/php installer that doesn't require them. sorry, can't > help you there. i work in > Unix, i always build my own apache and php with all modules they > need. the only time i > installed on Windows, it worked like a charm since the module i was > installing from already > had everything it needed. > > if they're there already, they're just not in your path. do whatever > needs to be done on > your computer to put them in the path (there are different ways to > handle this if you're on > Win95/98, WinNT, Win2000 and probably WinME. i'm only familiar with > the Win95/98 > (edit autoexec.bat), WinNT (i forget exactly, but i can find it if > i've got it in front of me). no idea > where you do that in Win2000 and ME though. > > >Another weird thing is that at the top of any PHP page I > > put there and run, it prijnts to the screen this: "X-Powered-By: PHP/4.0.4 > > Content-type: text/html " > >what web server are you using? are you trying to do this in apache? if >yes, you need to edit >httpd.conf to tell it about php. that's easy, just search for the string >"php" in httpd.conf and >uncomment the relevant lines. it's pretty obvious (one line is >Load-Module, the other is >Add-Type). > >if no, then you'll need to find a way to tell the web server about >PHP. either that, or you can >(somehow) configure PHP to execute with -q, i.e., in "quiet" mode. that >stops it from printing >those two lines. but then you'll have to make sure on your own that the >Content-type is set >correctly in your web browser. > >feel free to quote any of this on the list if you think it might help >someone else help you. > >good luck. > >tiger > > >-- >Gerald Timothy Quimpo [EMAIL PROTECTED] http://members.xoom.com/TigerQuimpo > > entia non sunt multiplicanda veritas liberabit vos > praetere necessitatem mene sakhet ur-seveh ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://liga1.com: building multiple language/culture websites
I am so tired of receivng multiple error emails when I post
I agree. Why do the newsgroup forward some of the messages to this guy? Attack? - Richard ""Chris Anderson"" <[EMAIL PROTECTED]> wrote in message 005701c0c42d$2b6e5f80$c61012d1@null">news:005701c0c42d$2b6e5f80$c61012d1@null... I am so tired of receivng multiple error emails when I post
On Friday 13 April 2001 16:03, you wrote: > Does it act as a "normal" array like: > $array = array(one => "Number One", two => "Number Two"); > > How would I go about to make this loop work (if I use the above array > it works): > > while(list($key, $val) = each($HTTP_SESSION_VARS)) > > echo "$key - $val"; > } Exactly like that -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) I saw God --------- and she was black.
Check out www.eaccounts.net. Im using them for my sites. They support basically everything and anything they dont have they are willing to add. The best part is they charge based on an actual usage instead of charging you for things you dont use because its part of a 'package'. Jeff Pearson > -----Original Message----- > From: Chris Anderson [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 12, 2001 7:34 AM > To: PHP > Subject: [PHP] Do any of you provide hosting? > > > I currently am using Thehostpros.com for my hosting, but I can't > say its been a pleasant experience. I had to have them install > PHP because they are more ASP oriented. So that cost me more. > Then I wanted MySQL and they have spent 3 months saying they'll > install that. Basicly here's what I need: > Someone who can host my domain (I own the domain already) > Can provide MySQL and PHP. Both up-to-date. > Can give around 60 meg of space (ballpark, less should be fine) > Also a way to set up subdomains without needing to go through the > admin (some hosts can do his). But this isn't necessary. > Can anyone help with that? > >
Loop through $HTTP_POST_VARS Jerry Lake - [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -----Original Message----- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 4:28 PM To: PHP User Group Subject: [PHP] What variable are being sent to my script? Hello, I there a way for me to find out what variables are being sent to script? Example: http://www.myscript.com/myscript.php?var1=asdf&var2=asdf that above would be $var1 and $var2 Thanks Brandon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
hi! I've php4.0.4pl1 and apache1.3.14 installed and I got a problem after the file is uploaded, using the copy function. The uploaded file was automatically added 2 lines in the beggining of the file, tellling the content-type of the file. Is there any way not to write those line into the uploaded file? thanks
> Is there any way not to write those line into the uploaded file? It's a bug in 4.0.4pl1 on (AFAIK) RH7 and Apache. Will be fixed in 4.0.5. You can't avoid them, but use something like the following to strip them out: /* void fix_broken_header(reference file) * Incorporates fix for problem with Apache & PHP 4.0.4p1 * on Red Hat 7, where the content-type header is appended to the image data, * corrupting it. See www.php.net/bugs.php?id=9298 - it took me a *long* time to * figure out what the fsck was going on! * * 02/04/2001 - oddly enough it doesn't happen w/NS4.74 on Win or Linux only IE5 & NS6 */ function fix_broken_header(&$image) { $new_image = "$image.new"; // Open the file for the copy $infile=fopen($image,"rb"); $outfile=fopen($new_image,"w"); // test for broken header $header=fgets($infile,255); if (eregi("content-type:", $header)) { $header=fgets($infile,255); // ditch next line } else { return; // do nothing } // Loop through the remaining file while(!feof($infile)) { $temp = fread($infile,128); fwrite($outfile,$temp,strlen($temp)); } fclose($outfile); fclose($infile); unlink($image); $image = $new_image; }
Some potentially useful links : Zend API Documentation : ------------------------------------------------------------- http://www.zend.com/zend/api.php Extending PHP : ------------------------------------------------------------- http://www.webtechniques.com/archives/2001/01/junk/ Writing a simple PHP extension : ------------------------------------------------------------- http://www.uk.research.att.com/~qsf/phpmodule/ A related post on extending PHP : ------------------------------------------------------------- http://marc.theaimsgroup.com/?l=php-general&m=98033228530307 Another response : ------------------------------------------------------------- http://marc.theaimsgroup.com/?l=php-general&m=97865440227175 Also have a look around the archives for a few discussions on the matter, there have been a few. Regards, philip On Fri, 13 Apr 2001, Bo Kleve wrote: > There was an article in the January 2001 issue of Webtechniques > (http://www.webtechniques.com) titled "Extending PHP" where Sterling Hughes > builds a module for converting between Roman and Arabic numerals. > > /BoK > > >"Carlos Serrão" <[EMAIL PROTECTED]> wrote in message > >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >> Hi all, > >> > >> I don't know if I'm in the correct mailling list or not, but > >> could someone provide me with some information about the developement > >> of new PHP modules (documentation, source-code, ...) ? > >> > >> Thanks in advance. > >> > >> Best regards, > >> > >> _____________________________________________________________ > >> Carlos Serrão [EMAIL PROTECTED] > >> http://www.carlos-serrao.com > >> DCTI - IS/IT Department IS/IT Research and Development > >> ADETTI/ISCTE - Av.Forcas Armadas 1600-082 LISBOA Portugal > >> Tel.: +351217903064/+351217903901 Fax: +351217935300 > > -------------------------------------------------- > Bo Kleve Mail: [EMAIL PROTECTED] > Linkoping University Phone: +46 13 281761 > Sweden Fax: +46 13 284400 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
When I use the form post or get method and when submitted, goes to the next page. I can get the data in PHP by adding the "$" to the javascript / html variable. I have not been able to put the php variable back into javascript variable for javascript scripting. I doubt if it would work if I assign the php variable to the html variable then have the javascript pick it up. Thanks, Scott
SF> I have not been able to put the php variable back into javascript variable SF> for javascript scripting. I doubt if it would work if I assign the php SF> variable to the html variable then have the javascript pick it up. You don't have "HTML variables"... you have form's fields with a VALUE. Do something like: <INPUT TYPE=text NAME=firstname VALUE="<? print $firstname; ?>"> for all your fields. Cheers, Gianluca -- ALBASOFTWARE C/ Mallorca 186 - 3º 1ª 08036 Barcelona (Spain) Tel. +34 93454009 - +34 934549324 Fax. +34 934541979 @@ ICQ 47323154 @@ [EMAIL PROTECTED] http://www.albasoftware.com http://www.phpauction.org http://www.gianlucabaldo.com
Hi, I installed php4 and apache on Win NT, it all works. Except that I get this error: open(/tmp\sess_fdf19ffc4a1192dd55183d067fc765fd, O_RDWR) failed: m (2) in So it can't save those session variables. Do I need to change permissions? Or set up a folder? If so where / how? Also: I can't seem to get mysql working. I can install it, but I'm used to using it on *nix. How can I open a command line and start building databases? Thanks for any answers / hints / ideas / links! Peter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://liga1.com: building multiple language/culture websites
As far as mysql on windows goes i think you can just use the DOS command line to type mysql as wellas use their MySqlManager.exe. But if you are used to unix stick with the DOS command line and make sure you are in the mysql/bin directory and it should be the same interface ----- Original Message ----- From: "Peter Van Dijck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 13, 2001 10:23 AM Subject: [PHP] install question:php and mysql on win NT 4 > Hi, > I installed php4 and apache on Win NT, it all works. > > Except that I get this error: > open(/tmp\sess_fdf19ffc4a1192dd55183d067fc765fd, O_RDWR) failed: m (2) in > > So it can't save those session variables. Do I need to change permissions? > Or set up a folder? If so where / how? > > Also: I can't seem to get mysql working. I can install it, but I'm used to > using it on *nix. How can I open a command line and start building databases? > > Thanks for any answers / hints / ideas / links! > Peter > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > http://liga1.com: building multiple language/culture websites > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>Except that I get this error: >open(/tmp\sess_fdf19ffc4a1192dd55183d067fc765fd, O_RDWR) failed: m (2) in Looks like your session.save_path is set incorrectly - set it to a sensible windows path (eg C:\php\session or similar) Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org
more probs: I shut down my machine and restarted, now apache won't run properly. Typing localhost gives server error: The server encountered an internal error or misconfiguration and was unable to complete your request. There is nothing in the server error logs. ... I don't know where to start ... help? Peter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://liga1.com: building multiple language/culture websites
Apache on NT is a service, check on control panel/services to see if it is running, beyond that i would need more details ... ----- Original Message ----- From: "Peter Van Dijck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 13, 2001 11:46 AM Subject: Re: [PHP] install question:php and mysql on win NT 4 > more probs: > > I shut down my machine and restarted, now apache won't run properly. > Typing localhost gives server error: The server encountered an internal > error or misconfiguration and was unable to complete your request. > > There is nothing in the server error logs. > ... > I don't know where to start ... help? > Peter > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > http://liga1.com: building multiple language/culture websites > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
I have this calendar and it's supposed to print out the word "Activity" if there is an event booked on that day. Everything works great except the query isn't finding the username. I did a print "$CUserName is CUserName" and it works great - so I know I started my session and it's accessible but when I put inside the query, it doesn't show up. I tried passing it through the browser and passing the entire session through the browser and still no dice. I also checked my php.ini file and ALL of my globals are on. Here's my coding, I really hope someone can help me figure this thing out. Thanks, Mike <?PHP session_start(); include ("dblib.inc"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>LDSAlberta.com: Personal Calendar</title> <Link href="arial.css" rel="stylesheet" title="arial" type="text/css"> </head> <body> <img src="pics/logo.gif"> <BR> <div align="center"><font size="4">Calendar of Events</font> <BR> <hr> <BR> <?PHP mk_drawCalendar($m,$y); ?></div> <div align="center"> <?PHP // Draw the Calendar global $CUserName; function mk_drawCalendar($m,$y) { if ((!$m) || (!$y)) { $m = date("m",mktime()); $y = date("Y",mktime()); if ($m==1) $themonth="jan"; else if ($m==2) $themonth="feb"; else if ($m==3) $themonth="mar"; else if ($m==4) $themonth="apr"; else if ($m==5) $themonth="may"; else if ($m==6) $themonth="jun"; else if ($m==7) $themonth="jul"; else if ($m==8) $themonth="aug"; else if ($m==9) $themonth="sept"; else if ($m==10) $themonth="oct"; else if ($m==11) $themonth="nov"; else if ($m==12) $themonth="dec"; } // get what weekday the first is on / $tmpd = getdate(mktime(0,0,0,$m,1,$y)); $month = $tmpd["month"]; $firstwday= $tmpd["wday"]; $lastday = mk_getLastDayofMonth($m,$y); ?> <font size=1>Click on date to see details</font> <table cellpadding=2 cellspacing=0 border=1> <tr> <td colspan=7 bgcolor="#cccc99"> <table cellpadding=0 cellspacing=0 border=0 width="100%"> <tr> <th width="100"> <a href="<?=$SCRIPT_NAME?>?m=<?=(($m-1)<1) ? 12 : $m-1 ?>&y=<?=(($m-1)<1) ? $y-1 : $y ?>"><<</a> </th> <th><font size=2><?="$month $y"?></font></th> <th width="100"> <a href="<?=$SCRIPT_NAME?>?m=<?=(($m+1)>12) ? 1 : $m+1 ?>&y=<?=(($m+1)>12) ? $y+1 : $y ?>">>></a> </th> </tr> </table> </td> </tr> <tr> <th width=100 class="tcell">Sunday</th> <th width=100 class="tcell">Monday</th> <th width=100 class="tcell">Tuesday </th> <th width=100 class="tcell">Wednesday</th> <th width=100 class="tcell">Thursday</th> <th width=100 class="tcell">Friday</th> <th width=100 class="tcell">Saturday</th> </tr> <?PHP $d = 1; $wday = $firstwday; $firstweek = true; //Loop Through to last day while ( $d <= $lastday) { //blanks for first week if ($firstweek) { print "<tr>"; for ($i=1; $i<=$firstwday; $i++) { print "<th height=100 bgcolor=#CCCCCC><font size=2> </font> </th>"; } $firstweek = false; } //checks for event if($numrows>=1) { //Event exists print "<td class='tcell' bgcolor=#CCCCCC valign=\"top\" height=\"100\"> <a href=calendardetails.php?ADay=$d&AMonth=$themonth&AYear=$y target=\"new_window\"><B>$d</b></a> </td>"; } else { //Event doesn't exist print "<td class='tcell' bgcolor=#CCCCCC valign=\"top\" height=\"100\"> <a href=calendardetails.php?ADay=$d&AMonth=$themonth&AYear=$y target=\"new_window\"><B>$d</b></a>"; /////////////////////////////////////////////////////// // PROBLEM IS HERE!!!! CUserName doesn't show up $eventrows = 0; $query = "SELECT * FROM activities WHERE CUserName='$CUserName' AND ADay='$d' AND AMonth='$themonth' AND AYear='$y'"; print "<font size=-1>$query</font>"; // /////////////////////////////////////////////////////// $result = mysql_query($query); $eventrows = mysql_num_rows($result); if($eventrows>=1) print "Activity"; print "</td>"; } $wday++; $wday = $wday % 7; $d++; // Sunday start week with <tr> if ($wday==0) { print "<th height=100 bgcolor=#ffffff><tr></th>"; } //blanks for last week if ($lastweek) { print "<tr>"; for ($lastday=28; $tlastday<=31; $lastday++) { print "<th height=100 bgcolor=#AAAAAA> </th><font size=2> </font>"; } $lastweek = false; } } ?> </tr></table> <font size=1>Click on date to see details</font> <br> <?PHP //end calendar Draw Function } //Show the last day of the month function mk_getLastDayofMonth($mon,$year) { for ($tday=28; $tday <= 31; $tday++) { $tdate = getdate(mktime(0,0,0,$mon,$tday,$year)); if ($tdate["mon"] != $mon) { break; } } $tday--; return $tday; } ?> </div> </body> </html> _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Mike Yuen") wrote: > /////////////////////////////////////////////////////// > // PROBLEM IS HERE!!!! CUserName doesn't show up > $eventrows = 0; > $query = "SELECT * FROM activities WHERE >CUserName='$CUserName' AND > ADay='$d' AND AMonth='$themonth' AND AYear='$y'"; > print "<font size=-1>$query</font>"; > // > /////////////////////////////////////////////////////// Your only other reference to $CUserName prior to this is: <?PHP // Draw the Calendar global $CUserName; Right now that line is outside the function in which $CUserName is called. 'global' should be used *inside any function in which you want to make use of a variable from the global namespace instead of the function's local namespace. -- CC
Hi! How do I convert the javascript array into the PHP array? Thanks, Scott
help! I'm trying to install java support for php here is the java section from php.ini [java] java.class.path=/usr/lib/php/extensions/php_java.jar java.home=/apps/java java.library.path=/usr/lib/php/extensions java.library=/usr/lib/php/extensions/libphp_java.so extension=libphp_java.so here are the contents of my php: <? $s = new Java ("java.lang.String", "This is a test String"); echo "s = $s\n"; ?> when I first try and load my page I get: Fatal error: Unable to locate CreateJavaVM function in /var/www/html/java.php on line 2 after a few reloads I get, the following and the phpinfo java section is reset, any ideas? Fatal error: Unable to load Java Library /lib.so, error: /lib.so: cannot open shared object file: No such file or directory in /var/www/html/java.php on line 2 -- Spencer Gibb [EMAIL PROTECTED]
Can you cast an array to an object of your choosing? If so, will the keys of the array match up with the attributes of your object? Say I have a class like this: class Foo { var $foo; var $bar; function Foo($foo = '', $bar = '') { ... } ... } Then I have an array like: $array['foo'] = "Hello"; $array['bar'] = "world"; If I do this: $foo = new Foo(); $foo = (object)$array; I've seen something similar done, but how do you keep $foo from forgetting which class it belongs to? The second assignment is independent of the first one, so $foo should become a plain object and forget that it's a "Foo" object. Any ideas? By the way, I was thinking this would be a really nifty way to fetch rows from the database into a pre-written class instead of doing it all manually. You'd have all the object properties automatically set by: $my_object = (object)$db->fetchRow(DB_FETCHMODE_ASSOC); I'm just worried about the object losing its membership in its original class. Dean.
why mot just <?php $foo = new Foo( $db->fetchRow(DB_FETCHMODE_ASSOC) ); ?> If you have to leave this part of the project for any length of time, coming back to the above would be much less confusing. ( i think so anyway :) morgan At 03:12 PM 4/13/2001 -0500, you wrote: >Can you cast an array to an object of your choosing? If so, will the keys of >the array match up with the attributes of your object? > >Say I have a class like this: > >class Foo { > var $foo; > var $bar; > > function Foo($foo = '', $bar = '') { > ... > } > ... >} > >Then I have an array like: > > $array['foo'] = "Hello"; > $array['bar'] = "world"; > >If I do this: > >$foo = new Foo(); >$foo = (object)$array; > >I've seen something similar done, but how do you keep $foo from forgetting >which class it belongs to? The second assignment is independent of the first >one, so $foo should become a plain object and forget that it's a "Foo" >object. > >Any ideas? > >By the way, I was thinking this would be a really nifty way to fetch rows >from the database into a pre-written class instead of doing it all manually. >You'd have all the object properties automatically set by: > >$my_object = (object)$db->fetchRow(DB_FETCHMODE_ASSOC); > >I'm just worried about the object losing its membership in its original >class. > >Dean. > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] === Morgan Curley Partner, e4media 212 674 7698 [EMAIL PROTECTED] http://www.e4media.com __________________________________________________
"Morgan Curley" <[EMAIL PROTECTED]> wrote: > why mot [sic] just > <?php > $foo = new Foo( $db->fetchRow(DB_FETCHMODE_ASSOC) ); > ?> > > If you have to leave this part of the project for any length of time, > coming back to the above would be much less confusing. ( i think so anyway :) Good idea. That's what I'm using right now, and it works fine -- besides having to manually assign variables -- probably good in the long-run for security and other concerns. All the same, I'm still interested in whether the original problem (casting an array as an object and the object of the assignment keeping its object membership) can work. Dean.
Is there a way to execute a system command and get both stdout and stderr into separate variables (without storing either one of them into a temp file)?
Hi, I've got a multi page form and I'm using sessions to keep track of all the variables between the pages. SO I fill in page one of the form and add the variables to a session. Then I can go on completeing the rest etc. My problem is that I want my users to be able to go back to the pages they have already visited and edit the data (in the form) and then undate the variables in the session. But I can't update the session, so I thought if I called session_unregister and then session_register again then that would work, but it doesn't? How can I get around this? Thanks for any help, Jord
In article <01041321314700.01991@localhost>, [EMAIL PROTECTED] (Jordan Elver) wrote: > Hi, > I've got a multi page form and I'm using sessions to keep track of all the > variables between the pages. SO I fill in page one of the form and add the > variables to a session. Then I can go on completeing the rest etc. > > My problem is that I want my users to be able to go back to the pages they > have already visited and edit the data (in the form) and then undate the > variables in the session. But I can't update the session, so I thought if I > called session_unregister and then session_register again then that would > work, but it doesn't? Just change the variable's value. For instance: //$sess_var="old_val" if($update==TRUE) { $sess_var="new_val"; echo $sess_var //"new_val" } else { echo $sess_var //"old_val" } -- CC
Does anyone have any knowledge of pulling info from Reynolds and Reynolds "era" systems using php ? I'm working on a rebuild of a carlot website and I'm just confused....if anyone has any info at all, I will be grateful. Jerry Lake - [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -----Original Message----- From: Jake Fan [mailto:[EMAIL PROTECTED]] Sent: Friday, April 13, 2001 1:24 PM To: '[EMAIL PROTECTED]' Subject: [PHP] stdout/stderr Is there a way to execute a system command and get both stdout and stderr into separate variables (without storing either one of them into a temp file)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hello generals, I work since version 3.0.3 with PHP and had until today no problems with it. In this week, three Interpreter have adjusted her service to three same computers, with Win98 and OmniHTTPd, one after the other. I have tested all versions of PHP4, no one works more, also the newest not. Then I have replaced PHP4 with PHP3 and all problems were missing. This participates no lasting solution however since many Scriptes use the advantages of PHP4 which now works no longer. To the better understanding, I have a protocol-departure and the php.ini attached. It will be very happy me, if can be helped me. Therefore thank you in advance. With very hopeful greetings and all a glad Easter Norbert Pfeiffer _________________________ tel +49-(0)2292-681769 mobil +49-(0)177-2363368 ------------------------- e.o.m.
In article <9b6c4v$m41$[EMAIL PROTECTED]> you write: >Correction, MySQL is not returning floor, since it returns 2 for round(1.5). - I >didn't see it. >MySQL should not return 2 for round(2.5), but it should return 3. I think it's >MySQL bug. > >How about ask in MySQL mailing list? I don't think it's just a MySQL thing... it occurs in PostgreSQL as well... test=> select version(); version ------------------------------------------------------------------------ PostgreSQL 7.0.3 on i386-unknown-freebsdelf4.1, compiled by gcc 2.95.2 (1 row) test=> select round(1.5); round ------- 2 (1 row) test=> select round(2.5); round ------- 2 (1 row) However, you could always do floor(number + .5) to consistent behaviour... -philip
hello, I'm trying to compile on RedHat 6.1 (latest changes applied). I can compile with mysql support and using the apxs and it compiles fine and it runs. This works for both 3.0.16 and 4.0.4pl1. As soon as I try to compile in --with-imap. it comiles fine, but when I run it I get an undefined symbol and its looking for gss_mech_krb5. anyone have any ideas of what I need to install. I have installed all the latest kerberos packages from redhat, including the development packages. I running with kernel 2.2.17-14 and its apache 1.3.14 Curtis
I'm used to building pages that contain links that have variables passed on the URL (somepage.php?var1=1&var2=2...) and I'm now looking into building a site that will have quite a bit of these that will have to 'live' from page to page, occasionally getting reset, or changed by new page. I'm told sessions are the way to go (specially since this will have several users using the site). And consequently, now I'm lost. Sessions..okay..how does the variable 'live' from one to the other? What do I have to do different when setting variables that will be used globally across the site (and reset/changed from time to time)? I don't need to STORE any of these (say for a future log-in), however if it's easy (easier?) to do it that way, that's fine as well. I may eventually start making the site customizable on a per user basis. But for right now, I need a startup primer first. AMK4 -- W | | I haven't lost my mind; it's backed up on tape somewhere. |____________________________________________________________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 SysAdmin / Websmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . eFax 248.671.0909 http://www.pcraft.com . 3550 Arapahoe Ave #6 .................. . . . . Boulder, CO 80303, USA
All the docs i've looked at for parsing XML takes a file as input. What's the proceedure for opening a socket connection and doing XML transmissions via TCP/IP. Do I need to do socket calls through PHP to open an XML connection (manually send all the HTTP headers and such?). Is there a built in function ; any place with these modules already written ; or should I just write them myself? -Dave
""phpman"" <[EMAIL PROTECTED]> wrote: > All the docs i've looked at for parsing XML takes a file as input. What's > the proceedure for > opening a socket connection and doing XML transmissions via TCP/IP. Do I > need to do > socket calls through PHP to open an XML connection (manually send all the > HTTP headers > and such?). Is there a built in function ; any place with these modules > already > written ; or should I just write them myself? > > -Dave If you want to use sockets to get your XML file, see <http://www.php.net/manual/en/ref.sockets.php>. But more than likely you just want to get it over HTTP (without handling the sockets yourself). In this case, you can just use fopen to get a file at a URL. See <http://www.php.net/manual/en/function.fopen.php>. Dean.
I've been away from the Threads for a while so excuse me if this has been mentioned. But when I logged onto WWW.PHP.NET I noticed that the date in the Upper-Right hand corner is way incorrect. It reckons that today is "Tuesday April 3rd!". I checked out my local mirror AU.PHP.NET and it was also wrong, saying that it is "Thursday 12th April"? I checked out CA.PHP.NET and it says Friday April 13th, which taking timezones into considerationg is correct. Just a helpful note. Cheers, --------------------------------------- Matthew M. Boulter MB Productions, Pty Ltd. m: 0414-912-501 e: [EMAIL PROTECTED] icq: 14626936 ---------------------------------------
Hi! I'm starting a news site, and I have one problem. (not with php or mysql, workin' fine!): 1. I want my authors to be able to make the text bold, italic ++, but I can't find anything that works. 2. The best sollution must be something similar to hotmails... I've looked around for ages, but I can't find something... It doesn't have to be something complicated, all I really need is a few buttons over my text-area (form!) - select text, press bold and the phrase changes... Like this: [BOLD] [ Text bla bla2 bla] <-- text area.. [SEND] I select/mark bla2 and the text area changes to [Text bla <b>bla2</b> bla] Note: I know that this isn't the right place to ask, I guess this is more Java related... Any help would be appreaciated! Thanks! Best regards Fredrik A. Takle Bergen, Norway --------------------------------- Fredrik A. Takle [EMAIL PROTECTED]
""FredrikAT"" <[EMAIL PROTECTED]> wrote: > Hi! > > I'm starting a news site, and I have one problem. > (not with php or mysql, workin' fine!): > > 1. I want my authors to be able to make the text bold, italic ++, > but I can't find anything that works. > 2. The best sollution must be something similar to hotmails... MS has a client-side component you can use for a WYSIWYG editor on IE -- you'll have to search the Microsoft Developer site. If you don't want to use MS (you can't use MS's WYSIWYG editor on Netscape, for instance), then there are some available to license -- but I've not seen any free ones. Yahoo! mail has one, and I guess so does Hotmail -- check the source and see if it's a JavaScript widget. If it is, and it's a lenient license, you can just use the JavaScript source. Dean.
My isp uses php3 and some of my scripts have the function 'foreach' which is php4. Is there are way to fix this kenny
""kenny.hibs"" <[EMAIL PROTECTED]> wrote: > My isp uses php3 and some of my scripts have the function 'foreach' > which is php4. > Is there are way to fix this Sure. If your code says: foreach($array as $element) { // this is a numerically-indexed array ... } do: while(list(,$element) = each($array)) { // the "," is important in "list(,$element)". ... } If your code says: foreach($array as $key => $value) { // real associative array ... } do: while($list($key, $value) = each($array)) { ... } This way, all you have to change is the loop itself -- nothing inside the loop needs to be changed if you do it this way. Dean.
Heya Guys, This question is primarily directed at the PHP Core development team. Is there any plans for the CORE PHP CREW (Zeev, Andrei, Sasha, etc...) coming Down Under to a conference or some such so us Aussie's can have a chance to say 'hi'? Thanx --------------------------------------- Matthew M. Boulter MB Productions, Pty Ltd. m: 0414-912-501 e: [EMAIL PROTECTED] icq: 14626936 ---------------------------------------
Is there a utility that I can use that will take a bunch of HTML and encapsulate it in the PRINT command? i.e. PRINT("{html stuff}\n"); ?? I have a ton of HTML pages that I want to make dynamic, but dread having to type the PRINT command in front of every line of html, and let alone having at manually add the slashes... urg. Thanks. Jason [EMAIL PROTECTED]
try this: <? print <<<EOP <html> jldsfajlf;dsajfl;dkfl;dsa </html> EOP; ?> AFAIK it is the easiest way to do multi-line printing! DanO ""Jason Caldwell"" <[EMAIL PROTECTED]> wrote in message 9b868e$2ca$[EMAIL PROTECTED]">news:9b868e$2ca$[EMAIL PROTECTED]... > Is there a utility that I can use that will take a bunch of HTML and > encapsulate it in the PRINT command? > > i.e. > > PRINT("{html stuff}\n"); > > ?? > > I have a ton of HTML pages that I want to make dynamic, but dread having to > type the PRINT command in front of every line of html, and let alone having > at manually add the slashes... urg. > > Thanks. > Jason > [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Cool. Does that work with echo too, do you know? At 06:19 PM 4/13/2001 -0700, DanO wrote: >try this: > ><? >print <<<EOP > ><html> >jldsfajlf;dsajfl;dkfl;dsa ></html> > >EOP; >?> > >AFAIK it is the easiest way to do multi-line printing! > >DanO > > >""Jason Caldwell"" <[EMAIL PROTECTED]> wrote in message >9b868e$2ca$[EMAIL PROTECTED]">news:9b868e$2ca$[EMAIL PROTECTED]... >> Is there a utility that I can use that will take a bunch of HTML and >> encapsulate it in the PRINT command? >> >> i.e. >> >> PRINT("{html stuff}\n"); >> >> ?? >> >> I have a ton of HTML pages that I want to make dynamic, but dread having >to >> type the PRINT command in front of every line of html, and let alone >having >> at manually add the slashes... urg. >> >> Thanks. >> Jason >> [EMAIL PROTECTED] >> >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: [EMAIL PROTECTED] >> > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > ............................................................................ Les Neste 678-778-0382 http://www.lesneste.com
On 13 Apr 2001 17:39:49 -0700 AD in php.general, Jason Caldwell said: >Is there a utility that I can use that will take a bunch of HTML and >encapsulate it in the PRINT command? > >i.e. > >PRINT("{html stuff}\n"); > >?? > >I have a ton of HTML pages that I want to make dynamic, but dread having to >type the PRINT command in front of every line of html, and let alone having >at manually add the slashes... urg. You don't need to make major changes to your HTML pages. Just embed the PHP into your HTML page wherever it's needed. Your web server will still treat a PHP page as an HTML except that the PHP code embedded in it is executed on the web server. However SSI commands will have to be replaced with their PHP equivalents. -- ======================================================================= Patrick Dunford, Christchurch, NZ - http://pdunford.godzone.net.nz/ And my God will meet all your needs according to his glorious riches in Christ Jesus. -- Philippians 4:19 http://www.heartlight.org/cgi-shl/todaysverse.cgi?day=20010413 ======================================================================= Created by Mail2Sig - http://pdunford.godzone.net.nz/software/mail2sig/
Small additional info about "expression" and "language construct". Expression is anything that have value. Therefore, if language construct returns value => valid expression. Following code works: ($val) ? include('abc.php') : include('def.php'); Following code does NOT work: ($val) ? echo('abc') : echo('def'); both "include" and "echo" is language construct, but "include" returns value. Thus "include" is valid expression while "echo" is not. "return" does not return value. (It returns value to caller, but not return value for expression context) User defined functions always return value, even if there is no "return" statement => functions are always valid expression. Hope this helps. -- Yasuo Ohgaki "Jeffrey Paul" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > At 03:56 AM 4/13/2001, Peter Harkins wrote: > > This generates a parse error: > > mysql_connect("localhost", "root", "rootpw") or > > return("bar"); > > > > But all the following work fine: > > mysql_connect("localhost", "root", "rootpw") or die("bar"); > > > > mysql_connect("localhost", "root", "rootpw") or > > print("bar"); > > > > if (!mysql_connect("localhost", "root", "rootpw")) { > > return("bar"); > > } > > > > Why? mysql_connect returns false on failure either way... I > > notice die > > > return isn't a function but a language construct. This is why the third > working line with the curlybraces works, and without them it doesn't. > > include() is a language construct too. the particulars of using language > constructs (like return() and include()) with control structure syntax are > explained on the page for include(). > > http://us2.php.net/manual/en/function.include.php > > -j (aka sneak) > > > > ---------------------------------------------- > [EMAIL PROTECTED] - 0x514DB5CB > he who lives these words shall not taste death > becoming nothing yeah yeah > forever liquid cool > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
On 11 Apr 2001 08:12:20 -0700 AD in php.general, Chris Lee said: >I'll post you a simple HTTP auth script. but you should realize = >something about header() > >client -> server >server -> client > >the client sends some HTTP request to the server, then the server sends = >some HTTP response to the client. php is strictly server side, you have = >full control over the HTTP headers sent to the user, but not from the = >user to the server. ie. method=3D'post' that is sending client data to = >the server, you will have no control over this at all... There are in fact two different servers: the web server and the PHP server. IMO it should be possible for the PHP server, executing PHP code, to send a request to the web server. It is certainly possible to send a header telling the web server to redirect to another web page. -- ======================================================================= Patrick Dunford, Christchurch, NZ - http://pdunford.godzone.net.nz/ And my God will meet all your needs according to his glorious riches in Christ Jesus. -- Philippians 4:19 http://www.heartlight.org/cgi-shl/todaysverse.cgi?day=20010413 ======================================================================= Created by Mail2Sig - http://pdunford.godzone.net.nz/software/mail2sig/
I have a question about sorting multidimensional arrays. Here is my problem: I have an 2-d array: $joke[1][rating]=10; $joke[2][rating]=20; $joke[3][rating]=15; .... I would like to sort the jokes into an array based on the rating from highest to lowest. The end result would be something like this: Joke 2 : 20 points Joke 3: 15 points Joke 1: 10 points How do I accomplish this? I have tried fooling around with sort(), arsort(), and array_multisort(), but I just can't get it. Thank you very much for your time. Shane