Re: [PHP] How to escape in hidden field?
Try this with single quotes: INPUT TYPE=HIDDEN VALUE='Hello world' NAME=Message Year, but then I couldn't use single-quotes in the text ;-) The problem is that the content of the field is inserted by the user, so I cannot say if he uses single- and/or double-quotes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql string comparison not working
if I set test = Y; then if ($test == Y) {echo (it matches);} seems to work while if ($row[24] == Y) {echo (it matches);} does not. The row[24] mysql variable is char type and 1 char long. any idea why it is not doing the comparison? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session problem
Hi, I am using session_start() and session_register(variablename) . The when I click on the back button from the browser it shows me the following error: Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button. How can I remove this. I have used RedHat Linux 7.2 and PHP 4.2.2 with MySQL-Max-3.23.51 = Best Regards, Monil Chheda(INDIA) http://domains.eliteral.com === === __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] How to escape in hidden field?
Hi, Tuesday, September 3, 2002, 4:35:45 PM, you wrote: Try this with single quotes: INPUT TYPE=HIDDEN VALUE='Hello world' NAME=Message MT Year, but then I couldn't use single-quotes in the text ;-) The problem is that MT the content of the field is inserted by the user, so I cannot say if he uses MT single- and/or double-quotes. How about this then... ? $test = Hello \O'Brian\; ? INPUT TYPE=HIDDEN VALUE=?echo htmlentities($test)? NAME=Message No need to decode the returned value -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE won't post on Windows, but will on Mac
Hi, Tuesday, September 3, 2002, 3:19:01 PM, you wrote: JV Hello, All, JV I've given myself two black eyes and a bloody nose on this one, and I'm sure JV it's a simple solution. I have a form on the php page entry.php: JV form name=zForm action=entry.php method=POST JV input type=text name=txt value=whatever JV /form JV At the top of that page, I have the PHP code: JV ? JV echo $REQUEST_METHOD; JV //other stuff... ? JV With IE 5.2 on Mac, I submit this form and I see POST echoed at the top of JV the page. JV With IE 5.5 on Windows, I submit this form and I see GET. JV How? Why? What the? I've tried playing with different encoding types and JV content-types, and nothing changes the results. I also tried setting my IE JV 5.5 security settings to lowest and enabled everything possible. No matter JV what I do, I can't POST the form. Can anyone tell me just what in tarnation JV is going on here? JV Many many thanks... JV Jed what does echo $_SERVER['REQUEST_METHOD'] print out? -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mysql string comparison not working
Have you tried single quotes ' '? David Banning [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if I set test = Y; then if ($test == Y) {echo (it matches);} seems to work while if ($row[24] == Y) {echo (it matches);} does not. The row[24] mysql variable is char type and 1 char long. any idea why it is not doing the comparison? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Function expects string but receiving array Warming??
I get the following warning which makes no sense to me. Warning: header() expects parameter 1 to be string, array given in /www/htdocs/jc/administration/edit_products/show_products.php on line 96 It's true that I am passing at an array to the function, but what I don't understand is why the function expects a string? How does any function know the type of an incoming var in PHP anyway? How can I fix my code to get rid of this error (while keeping the var as an array)?My code looks like this: header(array(ID,Name,Maker's Code,Maker Name,Label Name,Product Type)); function header_row($aH) { echo TR; foreach ($aH as $h) { ? TH ?php echo $h; ? /TH ?php } echo /TR; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function expects string but receiving array Warming??
You are trying to set a header() using methods not supported. But the really interesting bit is that you appear to be using it NOT for sending HTTP headers, but for setting header information on a TABLE read http://php.net/header ...this isn't what it does. ? function header_row($values) { $output = TR; foreach($values as $key = $value) { $output .= TH; $output .= $value; $output .= /TH; } $output .= /TR; return $output; } $myheaders = array(ID,Name,Maker's Code,Maker Name,Label Name,Product Type); echo header_row($myheaders); ? The above should (untested) echo the following HTML: TRTHID/THTHName/THTHMaker's Code/THTHMaker Name/THTHLabel Name/THTHProduct Type/TH/TR ... which is what I think you're after... althoug it seems a little weird :) Justin on 03/09/02 6:20 PM, Jean-Christian Imbeault ([EMAIL PROTECTED]) wrote: I get the following warning which makes no sense to me. Warning: header() expects parameter 1 to be string, array given in /www/htdocs/jc/administration/edit_products/show_products.php on line 96 It's true that I am passing at an array to the function, but what I don't understand is why the function expects a string? How does any function know the type of an incoming var in PHP anyway? How can I fix my code to get rid of this error (while keeping the var as an array)?My code looks like this: header(array(ID,Name,Maker's Code,Maker Name,Label Name,Product Type)); function header_row($aH) { echo TR; foreach ($aH as $h) { ? TH ?php echo $h; ? /TH ?php } echo /TR; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] limit in a loop function to prevent server load
hi there i was wondering if there was a way to limit the ammount of items in a loop to execute sleep then execute the rest of the items to prevent server load ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function expects string but receiving array Warming??
On Tue, 3 Sep 2002, Jean-Christian Imbeault wrote: Warning: header() expects parameter 1 to be string, array given in /www/htdocs/jc/administration/edit_products/show_products.php on line 96 How can I fix my code to get rid of this error (while keeping the var as an array)?My code looks like this: header(array(ID,Name,Maker's Code,Maker Name,Label Name,Product Type)); header() is a PHP function. You're calling it with an invalid arguement. (I think you're just calling the function you want by the wrong name, tho.) function header_row($aH) { Try calling header_row(), instead of header(), with your array argument, since it seems that you already have the proper function defined. g.luck, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] limit in a loop function to prevent server load
Op dinsdag 03 september 2002 10:46, schreef u: hi there i was wondering if there was a way to limit the ammount of items in a loop to execute sleep then execute the rest of the items to prevent server load ? for($i=0;...) { if($i0$i%100==0)sleep(10); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail() again...
the mail server is hosted on the mail server. i think thats whats casuing the problem. how can i get around this? i use unix. i remember a command to find out the smtp server.. anyone know? cheers Manuel Lemos [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, On 09/02/2002 07:59 AM, :B Nerdy wrote: what is recommended to use instead of mail() then? It depends on what is your problem. In most cases mail will do taking some care that may be platform dependent like the header line break issues that have to be \r\n under Windows but under Unix with sendmail or wrappers you'd better use \n . Anyway, if you use the class I mentioned you will be able to choose exactly the transport method that suits better your needs and platform constraints. In your case, maybe using the sendmail sub-class will give you enough control because it lets you call sendmail program wherever it is in your disk passing any command line switches to better control its operation without depending on any php.ini (except for safe mode that has to be off). Manuel Lemos cheers Manuel Lemos [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, On 09/01/2002 02:30 AM, Liam Mackenzie wrote: It seems nearly everyone has a problem with this function, probably because it relies on third party software. Yes, mail() is probably the most problematic of the frequently used functions of PHP. That can be for many reasons like the need for manual configuration of PHP, useless/meaningless or non-existing error messages produced by mail(), inconsistent documentation of mail() in PHP manual, installation problems of the MTA, configuration problems of the user networks, anti-spam measures, etc... The main difficulty is that it takes a lot of expertise to figure out which of these problems are affecting you. It doesn't work. That's my problem! I'm using Sendmail as my MTA, not running as a Daemon as I have POP3/SMTP server running on the same machine (eXtremail) I'm starting Sendmail like this: /usr/lib/sendmail -q1h When I do this: $this = mail([EMAIL PROTECTED], Subject, Message goes here); echo $this; The scripts hangs, and eventually my browser times out. Is there any way I can get some error messages? Or at least get it to tell me what on earth it's doing? Adding -v to the configuration of sendmail in php.ini may provide you a clue. Anyway, my guess is that your machine may not have a reverse DNS address. What is its IP? There's nothing in any of my Apache logs, nothing in eXtremail's logs, but I get this in my syslog... Sep 1 15:28:01 nudenurd sendmail[19146]: g815S1fW019146: from=nobody, size=63, class=0, nrcpts=1, msgid=[EMAIL PROTECTED], relay=nobody@localhost It seems you are missing seting th return-path. Use mail() 5th argument. Anyone got any ideas? Anyone know if there's any docs on this kind of thing? I looked, I failed... Or where I can get some information on where to get an alternate MTA that WORKS out of the box (or tar.gz) If all else fails, you may want to try this PHP class, with several variants that let you send messages by several methods besides mail(), like: using sendmail directly, using qmail-inject or even relay on specific SMTP server or even the most drastic measure that is to send messages directly to the receipient SMTP server. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function expects string but receiving array Warming??
Justin French wrote: But the really interesting bit is that you appear to be using it NOT for sending HTTP headers, but for setting header information on a TABLE Oops!! I had defined my own function called header() without even stopping to think there was already a PHP header() function. Silly me ... Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] html to php with echo
I try to transform a html file in -php file, but i have errors in it(Error in page.) Where is mistake? index.php WRONG ? echo END HEAD script language=JavaScript src=date-picker.js/script /HEAD BODY center form name=calform input type=text name=datebox size=15a href=javascript:show_calendar('calform.datebox'); onmouseover=window.status='Date Picker';return true; onmouseout=window.status='';return true;img src=show-calendar.gif width=24 height=22 border=0/a /form /center /BODY END; ? index.html GOOD: HEAD script language=JavaScript src=date-picker.js/script /HEAD BODY center form name=calform input type=text name=datebox size=15a href=javascript:show_calendar('calform.datebox'); onmouseover=window.status='Date Picker';return true; onmouseout=window.status='';return true;img src=show-calendar.gif width=24 height=22 border=0/a /form /center /BODY tx in adv for any help Ady
[PHP] wordwrap function (that skips html tags)
hello! i found a nice function that i would like to use but unfortunately there is a problem i can not solve. for my notepool device it would be great to use php's wordwrap function but because the string that needs to be wordwrapped contains also html tags i can not use this function like this. on php.net (manual: wordwrap) i found a user contribution with a wordwrap function that skips html tags (and forces words to split at a desired width). the bad thing about it is that in the output some characters are missing. example: as i enter this url into my form: http://www2.snm-hgkz.ch/~rieger/notepool/addnote.php that's the output: h tp://www2.snm-hgkz ch/~rieger/notepool/ ddnote.php (obviously some caracters are missing, the first 't' of http or the 'a' of addnote.php for instance.) can you tell me what needs to be modified to get rid of this side effect (or do you have another idea how to use wordwrap in a way it skips html tags and forces words to split)? this is the function: function sheep_wordwrap($str,$cols,$non_prop,$cut,$exclude1,$exclude2){ $count=0; $tagcount=0; $str_len=strlen($str); //$cut= $cut ; $calcwidth=0; for ($i=1; $i=$str_len;$i++){ $str_len=strlen($str); if ($str[$i]==$exclude1) $tagcount++; elseif ($str[$i]==$exclude2){ if ($tagcount0) $tagcount--; } else{ if (($tagcount==0)){ if (($str[$i]==' ') || ($str[$i]==\n)) $calcwidth=0; else{ if ($non_prop){ if (ereg(([QWOSDGCM#@m%w]+),$str[$i],$matches)) $calcwidth=$calcwidth+7; elseif (ereg(([I?\|()\]+),$str[$i],$matches)) $calcwidth=$calcwidth+4; elseif (ereg(([i']+),$str[$i],$matches)) $calcwidth=$calcwidth+2; elseif (ereg(([!]+),$str[$i],$matches)) $calcwidth=$calcwidth+3; else{ $calcwidth=$calcwidth+5; } } else{ $calcwidth++; } if ($calcwidth$cols){ $str=substr($str,0,$i-1).$cut.substr($str,$i,$str_len-1); $calcwidth=0; } } } } } return $str; //moby rules at 5am! :) } and here i call it: $str = $message; $cols = 100; $cut = \n; $non_prop = true; $exclude1 = ; $exclude2 = ; $str = sheep_wordwrap($str,$cols,$non_prop,$cut,$exclude1,$exclude2); echo $str; thanks a lot for your help! philipp * http://www2.snm-hgkz.ch/~rieger/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] threads in Apache 1.3
I would like to know how many PHP page apache generates in one thread at the same time. For example, two clients share the same thread of the apache web server. they request at the same time a php page. Does apache process them one by one? I use persistant database connections and I wonder, if one connection is always in use by one page or by more? Heiko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 3 Sep 2002 10:02:43 -0000 Issue 1563
php-general Digest 3 Sep 2002 10:02:43 - Issue 1563 Topics (messages 114963 through 115000): Re: help, array values echoed as Array on loop! 114963 by: Victor Re: How to escape in hidden field? 114964 by: Tom Rogers 114965 by: Martin Towell 114984 by: Martin Thoma 114987 by: Tom Rogers ftp question 114966 by: Victor 114970 by: nicos.php.net 114971 by: victor 114972 by: victor Re: Why doesn't the second instance work? 114967 by: Tom Rogers 114980 by: David Robley Re: crontab programmed with mysql ?? 114968 by: nicos.php.net 114969 by: Tom Rogers Re: coockie expiration problems 114973 by: Tom Rogers Re: Forum structure 114974 by: Justin French Re: mail() function problem 114975 by: Akhmad D. Sembiring 114976 by: Manuel Lemos 114977 by: Akhmad D. Sembiring 114978 by: Manuel Lemos Re: unexpected T_SL 114979 by: Voisine IE won't post on Windows, but will on Mac 114981 by: Jed Verity 114982 by: Martin Towell 114983 by: Jed Verity 114988 by: Tom Rogers mysql string comparison not working 114985 by: David Banning 114989 by: Henry 114999 by: lallous Session problem 114986 by: Monil Chheda Function expects string but receiving array Warming?? 114990 by: Jean-Christian Imbeault 114991 by: Justin French 114993 by: Chris Wesley 114996 by: Jean-Christian Imbeault limit in a loop function to prevent server load 114992 by: electroteque 114994 by: Bas Jobsen Re: mail() again... 114995 by: :B nerdy html to php with echo 114997 by: adi wordwrap function (that skips html tags) 114998 by: 457945.gmx.net threads in Apache 1.3 115000 by: Heiko Mundle 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] -- ---BeginMessage--- Thank you, I figured it out 30 seconds after I posted the question, you were right about the problem. - Victor www.argilent.com -Original Message- From: Chris Wesley [mailto:[EMAIL PROTECTED]] Sent: Monday, September 02, 2002 4:11 PM To: 'PHP' Cc: Victor Subject: Re: [PHP] help, array values echoed as Array on loop! On Mon, 2 Sep 2002, Victor wrote: $ID_arr[] = explode(',', $pictures); # make db data into array This is the string: 15,16,17,18,19 why does it echo as Array? ... because you've created an array ($ID_arr) with an array as the first value (the result of the call to explode()). Take the brackets off $ID_arr, and you'll get what you want. You don't want your array in an array ... you just want an array. $ID_arr = explode(',', $pictures); If you really wanted your array in the array, then loop over $ID_arr[0]. (I doubt that's what you were going for, though.) hth, ~Chris __ Post your free ad now! http://personals.yahoo.ca ---End Message--- ---BeginMessage--- Hi, Monday, September 2, 2002, 7:59:43 PM, you wrote: MT Hello! MT I have a simple hidden input-field like MT INPUT TYPE=HIDDEN VALUE=Hello world NAME=Message MT Now sometimes I need to insert like: MT INPUT TYPE=HIDDEN VALUE=Hello \world\ NAME=Message MT But this makes PHP (or the browser?) cutting of the string after Hello MT . How can I escape the ? MT Martin Try this with single quotes: INPUT TYPE=HIDDEN VALUE='Hello world' NAME=Message -- regards, Tom ---End Message--- ---BeginMessage--- Hi Martin You can also do this INPUT TYPE=HIDDEN VALUE=Hello quot;world NAME=Message HTH Martin :) -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 11:24 AM To: Martin Thoma Cc: [EMAIL PROTECTED] Subject: Re: [PHP] How to escape in hidden field? Hi, Monday, September 2, 2002, 7:59:43 PM, you wrote: MT Hello! MT I have a simple hidden input-field like MT INPUT TYPE=HIDDEN VALUE=Hello world NAME=Message MT Now sometimes I need to insert like: MT INPUT TYPE=HIDDEN VALUE=Hello \world\ NAME=Message MT But this makes PHP (or the browser?) cutting of the string after Hello MT . How can I escape the ? MT Martin Try this with single quotes: INPUT TYPE=HIDDEN VALUE='Hello world' NAME=Message -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Try this with single quotes: INPUT TYPE=HIDDEN VALUE='Hello world' NAME=Message Year, but then I couldn't use single-quotes in the text ;-) The problem is that the content of the field is inserted by the user, so I cannot say if he uses single- and/or
[PHP] Re: html to php with echo
Adi wrote: I try to transform a html file in -php file, but i have errors in it(Error in page.) Where is mistake? On my machine their both good. But a question raises? Why do you use echo in this case? Why don't you just give the filename the extension .php? Just rename the file from index.html to index.php. HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session problem
I am using session_start() and session_register(variablename) . The when I click on the back button from the browser it shows me the following error: Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button. That has nothing to do with your sessions. It has to do something with forms in HTML. If you use the POST method for forms, then the page will expire if you don't resubmit the values. You can also read that in the text. You cannot change this behaviour, because your browser does this for you. To force the browser to resubmit the values, you have to push the Refresh button. You won't get this behaviour if the form is submitted with the GET method, because the variables are then part of the URL (and thus automatically submitted if you push the back button) HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] wordwrap function (that skips html tags)
Hello, What's your php version? Take at look at: http://www.php.net/manual/en/function.wordwrap.php and http://www.php.net/manual/en/function.strip-tags.php b.e. $str='http://www2.snm-hgkz.ch/~rieger/notepool/addnote.php'; echo wordwrap(strip_tags($str),8,'br',1); i you can't use wordwrap(), try: ? /* written by [EMAIL PROTECTED] */ function wordwraphtml($string,$length,$endline='br',$striphtml=true) { if($striphtml)$string=strip_tags($string); $temp=''; $sublength=strlen($string); if($sublength$length)return $string; while($sublength$length) { $temp.=substr($string,0,$length).$endline; $string=substr($string,$length+1); $sublength=strlen($string); } return $temp; } $string='a href=http://www.startpunt.cc/a'; echo wordwraphtml($string,8); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: posting form values doesn't work
ØYstein HåLand wrote: Yes, you were right. Now a natural question. WHY? I don't understand your explanation, since I thought it was equal, getting a field value using document.answerform.name.value in javascript AND the variable $name in php. If you submit a form, you will POST the variables to the same page (FORM NAME=answerform METHOD=POST). The parser will only define variables at the start of a page. So, if you POST a page, PHP will define all the variables for you. What you are trying to do, is using the PHP variables before the form is submitted. That means that the parser did NOT define the variables for you. That makes sense, because the parser is running on the SERVER, and this Javascript code is running on the CLIENT. The client doesn't have the parser, so it can't define the variables for you. So getting variables using Javascript and PHP is NOT equal. Getting them in Javascript can be done by the client, like you do in your validation function. Getting them in PHP can only be done by the server. You cannot use these variables in Javascript code as $some_var. HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sorting array question
i have the following code which reads a list of files from a directory - $listcmd = ls .$dirPath; $temp = exec($listcmd, $listoffiles, $status); if($status == 0) { for ($i =0; $i sizeof($listoffiles); $i++) { $this-fileName[$i] = $listoffiles[$i]; $this-sizeofFile[$i] = sprintf(%01.2f, (filesize($dirPath./.$listoffiles[$i])/1024)/1024); $this-fileDate[$i] = date(d-M-y H:i, filemtime($dirPath./.$listoffiles[$i])); } $this-displayFiles(); What I want to do is display the files sorted by date. Okay, so I've just realised that the really easy way to do this is by adding -St (sort by time) to the ls command... $listcmd = ls -St .$dirPath; But how could this be achieved by sorting the three arrays? What if I alternately wanted to sort the files by name, size or date without re-reading the directory each time? Would an associative array structure be better suited to this type of operation? Thanks for your insight, Javier _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Carriage Returns in Text Fields
I have a script which takes a memo field and stuffs it into a mediumtext column of a MySQL table. When I spit out the contents of the field, the carriage returns are no longer there... how do I maintain the integrity of the paragraphs in text fields? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: header()-question
Fatal error: Cannot redeclare createlinks() (previously declared in c:\apache\htdocs\ha\recycle\lankar.php:6) in c:\apache\htdocs\ha\recycle\lankar.php on line 5 The problem is: the call for the function createlinks() is done from the previous page (index.php), the file where I user header(), and I can't see that the function has bin called for yet. It doens't look like a call problem, but, as the message says, a redeclaration in file lankar.php. It looks like you have something like below in lankar.php at line 5 and 6. function createlinks() function createlinks() { ... } The function createlinks() has been defined more then once. You should check your include files. HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Carriage Returns in Text Fields
How and where are you spitting out the text? If to HTML output, the use the nl2br(). or spit between pre tags. Elias Royw [EMAIL PROTECTED] wrote in message 00a301c25336$9815cc60$[EMAIL PROTECTED]">news:00a301c25336$9815cc60$[EMAIL PROTECTED]... I have a script which takes a memo field and stuffs it into a mediumtext column of a MySQL table. When I spit out the contents of the field, the carriage returns are no longer there... how do I maintain the integrity of the paragraphs in text fields? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] greeting based on time
really simple one - does someone have a bit of code that will variously display 'good morning', 'good afternoon', 'good evening' based on the current time? good morning from london, Javier _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] progress bar for a server side process
hi there i have created a script to regenerate thumbnails for a photo gallery , i have changed my code to use gd true color although it takes forever now , i have it generating 20 at a time then doing the rest but still takes forever , i know its impossible to generate a true progress bar for image uploads via a browser but how about server side processes ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP freelancer offer
Hi! I would like to work as a freelancer on some PHP projects. see my web page for skills/experiences: http://dorwin.wz.cz best regards Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] webmail without imap functions???
Hi NG Is it possible to make a webmail without enabled imap functions on the running version of .php? As far as I can see on http://www.php.net/manual/en/ref.imap.php it is the various imap functions I should use. I'd like to make a webinterface to my various POP3 email accounts, but my isp does not support the imap functions :( So... What do I do? thnx Ask -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Carriage Returns in Text Fields
Hey, I myself am a newbie to PHP, but I believe what you are looking for is the nl2br() functionI presume you are outputting html. Hope that helped. Cheers, -Ryan. - Original Message - From: RoyW [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 03, 2002 12:42 PM Subject: [PHP] Carriage Returns in Text Fields I have a script which takes a memo field and stuffs it into a mediumtext column of a MySQL table. When I spit out the contents of the field, the carriage returns are no longer there... how do I maintain the integrity of the paragraphs in text fields? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] greeting based on time
? $hour=date('H'); switch(true) { case ($hour 12): echo 'Good Morning';break; case ($hour 18): echo 'Good Afternoon'; break; default:echo 'Good Night'; break; } ? Op dinsdag 03 september 2002 13:01, schreef Javier Montserat: really simple one - does someone have a bit of code that will variously display 'good morning', 'good afternoon', 'good evening' based on the current time? good morning from london, Javier _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to escape in hidden field?
Try HTMLSpecialChars function. http://www.php.net/htmlspecialchars Regards, Jan - Original Message - From: Martin Thoma [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 02, 2002 11:59 AM Subject: [PHP] How to escape in hidden field? Hello! I have a simple hidden input-field like INPUT TYPE=HIDDEN VALUE=Hello world NAME=Message Now sometimes I need to insert like: INPUT TYPE=HIDDEN VALUE=Hello \world\ NAME=Message But this makes PHP (or the browser?) cutting of the string after Hello . How can I escape the ? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Class operator :: Problem
I have problems to make a dynamic call, please help me ? class a { function test() { echo Hallo; } } $testfunct = a::test; $testfunct(); ? returns: Fatal error: Call to undefined function: a::test() in /usr/local/share/version2.mypsi.de/index.html on line 10 --- Christian Unger IT-Consultant PSI Infrastruktur Services GmbH Dircksenstr. 42-44 10178 Berlin Tel: 030 / 2801 - 2536 Fax: 030 / 2801 - 297 2536 e-Mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Class operator :: Problem
Hi There Try doing it this way: ? class a { function test() { echo Hallo; } } $testfunct = a::test();; eval($testfunct); ? Regards -|Scott -Original Message- From: Unger, Christian [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 2:51 PM To: '[EMAIL PROTECTED]' Subject: [PHP] Class operator :: Problem I have problems to make a dynamic call, please help me ? class a { function test() { echo Hallo; } } $testfunct = a::test; $testfunct(); ? returns: Fatal error: Call to undefined function: a::test() in /usr/local/share/version2.mypsi.de/index.html on line 10 --- Christian Unger IT-Consultant PSI Infrastruktur Services GmbH Dircksenstr. 42-44 10178 Berlin Tel: 030 / 2801 - 2536 Fax: 030 / 2801 - 297 2536 e-Mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP freelancer offer
This has nothing to do with this newsgroup. This is not jobless.general. -- Merci de nous avoir choisi. - Thanks you for your choice. Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] [EMAIL PROTECTED] www.GroupAKT.com - Hébergement Group. www.WorldAKT.com - Hébergement de sites Internet Peter Turcan [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hi! I would like to work as a freelancer on some PHP projects. see my web page for skills/experiences: http://dorwin.wz.cz best regards Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Class operator :: Problem
? class a { function test() { echo Hallo; } } $testfunct = a::test(); $testfunct; ? i think because you assign a method to the variable rather than a data member you need to include parenthsis... a::test() I have problems to make a dynamic call, please help me ? class a { function test() { echo Hallo; } } $testfunct = a::test; $testfunct(); ? returns: Fatal error: Call to undefined function: a::test() in /usr/local/share/version2.mypsi.de/index.html on line 10 --- Christian Unger IT-Consultant PSI Infrastruktur Services GmbH Dircksenstr. 42-44 10178 Berlin Tel: 030 / 2801 - 2536 Fax: 030 / 2801 - 297 2536 e-Mail: [EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] progress bar for a server side process
I've got a nice progress bar with this code: for($i=0;$i10;$i++) { flush(); sleep(1); echo 'img src=img.gif width=20 height=20 border=0 alt=X'; } But read manual for the flush() function. electroteque wrote: hi there i have created a script to regenerate thumbnails for a photo gallery , i have changed my code to use gd true color although it takes forever now , i have it generating 20 at a time then doing the rest but still takes forever , i know its impossible to generate a true progress bar for image uploads via a browser but how about server side processes ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Downloading php4.2.2.zip??
I'm wonder whether I doing something wrong. I've tried, without any success, to d/l php 4.2.2.zip from all the US mirrors, the Canadian ones, Ireland, Australia, and even the main php.net site. I get as far as get_download . . . and nothing happens. Is there ftp access to get this file, or would some kind soul have a copy of it? I'm trying to get php installed on a laptop: PHPTriad barfs on a missing dll, and another combo tells me my 3 day limit has expired on the installer. All I need is PHP to test my site. Any assistance or advice appreciated. Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Class operator :: Problem
Try a helper function function helper() { return a::test(); } $testfunct = helper; ... Unger, Christian wrote: I have problems to make a dynamic call, please help me ? class a { function test() { echo Hallo; } } $testfunct = a::test; $testfunct(); ? returns: Fatal error: Call to undefined function: a::test() in /usr/local/share/version2.mypsi.de/index.html on line 10 --- Christian Unger IT-Consultant PSI Infrastruktur Services GmbH Dircksenstr. 42-44 10178 Berlin Tel: 030 / 2801 - 2536 Fax: 030 / 2801 - 297 2536 e-Mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: sorting array question
There is readdir() to read a complete directory. It will put it into an array, then use asort to class it. -- Merci de nous avoir choisi. - Thanks you for your choice. Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] [EMAIL PROTECTED] www.GroupAKT.com - Hébergement Group. www.WorldAKT.com - Hébergement de sites Internet Javier Montserat [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] i have the following code which reads a list of files from a directory - $listcmd = ls .$dirPath; $temp = exec($listcmd, $listoffiles, $status); if($status == 0) { for ($i =0; $i sizeof($listoffiles); $i++) { $this-fileName[$i] = $listoffiles[$i]; $this-sizeofFile[$i] = sprintf(%01.2f, (filesize($dirPath./.$listoffiles[$i])/1024)/1024); $this-fileDate[$i] = date(d-M-y H:i, filemtime($dirPath./.$listoffiles[$i])); } $this-displayFiles(); What I want to do is display the files sorted by date. Okay, so I've just realised that the really easy way to do this is by adding -St (sort by time) to the ls command... $listcmd = ls -St .$dirPath; But how could this be achieved by sorting the three arrays? What if I alternately wanted to sort the files by name, size or date without re-reading the directory each time? Would an associative array structure be better suited to this type of operation? Thanks for your insight, Javier _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] greeting based on time
Ummm, current time where? :) Assuming you mean your server's time, it shouldn't be too hard, but i thought I'd point out that your readers/users are bound to be in different time zones. Whilst some may think oh, different time zone, others will probably think idiots :) Then another option would be to do it based on the user's time, but if they have their clock wrong, same problem. Anyhoo, I just whipped this up... there is probably 100's of ways of doing it, but this was the first off the top of my head. Untested code. Returns good evening from 5:00pm 11:59pm, good morning from 12 midnight until 11:59am, and good afternoon from 12 midday thru to 4.59pm. I haven't taken into account daylight savings, timezones or anything else... just real basic, based on the hours. ? function serverTimeGreeting() { $h = date('G'); // current hour (0-23) $greeting = good evening; if($h 17) { $greeting = good afternoon; } if($h 12) { $greeting = good morning; } return $greeting; } echo serverTimeGreeting(); ? Justin on 03/09/02 9:01 PM, Javier Montserat ([EMAIL PROTECTED]) wrote: really simple one - does someone have a bit of code that will variously display 'good morning', 'good afternoon', 'good evening' based on the current time? good morning from london, Javier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Info into Class
Are there any rules as to how information from outside a class can be moved into it. What Ive been doing so far is 1. Through the constructor 2. defining a constant 3. Create a method whose sole purpose is to move data from the outside into the class. i.e. ?php class foo () { .. function outside_data($bar) { $this-bar = $bar; } .. } // class constructor here ... $class-outside_data($php); ? -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Downloading php4.2.2.zip??
Hi, Yes, we're experimenting some problems with our downloads servers. Please wait a little and try again. -- Merci de nous avoir choisi. - Thanks you for your choice. Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] [EMAIL PROTECTED] www.GroupAKT.com - Hébergement Group. www.WorldAKT.com - Hébergement de sites Internet Andre Dubuc [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] I'm wonder whether I doing something wrong. I've tried, without any success, to d/l php 4.2.2.zip from all the US mirrors, the Canadian ones, Ireland, Australia, and even the main php.net site. I get as far as get_download . . . and nothing happens. Is there ftp access to get this file, or would some kind soul have a copy of it? I'm trying to get php installed on a laptop: PHPTriad barfs on a missing dll, and another combo tells me my 3 day limit has expired on the installer. All I need is PHP to test my site. Any assistance or advice appreciated. Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Freelancer offer
We've got it. -- Merci de nous avoir choisi. - Thanks you for your choice. Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] [EMAIL PROTECTED] www.GroupAKT.com - Hébergement Group. www.WorldAKT.com - Hébergement de sites Internet Peter [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hi to all I would like to take contract in PHP/MySQL as a freelancer. my web page: http://dorwin.wz.cz best regards Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: webmail without imap functions???
Hi, There are many webmails that don't use imap but just POP3. You should check at them. -- Merci de nous avoir choisi. - Thanks you for your choice. Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] [EMAIL PROTECTED] www.GroupAKT.com - Hébergement Group. www.WorldAKT.com - Hébergement de sites Internet [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hi NG Is it possible to make a webmail without enabled imap functions on the running version of .php? As far as I can see on http://www.php.net/manual/en/ref.imap.php it is the various imap functions I should use. I'd like to make a webinterface to my various POP3 email accounts, but my isp does not support the imap functions :( So... What do I do? thnx Ask -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: webmail without imap functions???
Thnx - could you please guide me to an example, all I can find use the imap_open() like: $mbox = imap_open ({localhost/pop3:110}INBOX, user_id, password); But my ISP does not support these imap functions. [EMAIL PROTECTED] said: Hi, There are many webmails that don't use imap but just POP3. You should check at them. -- Merci de nous avoir choisi. - Thanks you for your choice. Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] [EMAIL PROTECTED] www.GroupAKT.com - Hébergement Group. www.WorldAKT.com - Hébergement de sites Internet [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hi NG Is it possible to make a webmail without enabled imap functions on the running version of .php? As far as I can see on http://www.php.net/manual/en/ref.imap.php it is the various imap functions I should use. I'd like to make a webinterface to my various POP3 email accounts, but my isp does not support the imap functions :( So... What do I do? thnx Ask -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FW: Texas PHP Developers Conference
-Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 9:03 AM To: Jay Blanchard Subject: Texas PHP Developers Conference Howdy! Thanks for taking interest in the (hopefully annual!) Texas PHP Developers Conference. I am in the process of setting up a web site for the conference. The URL will be sent out as soon as it is available. DATES - Dates for the conference have been narrowed down to some time between mid February and mid-March 2003. The T Bar M Conference Center in New Braunfels is putting the finishing touches on the package, so costs and registration information can be provided within the next week or so. For those living close to the location there will be a daily fee available so that staying at the conference location is not mandatory. PAPERS WORKSHOPS - If you are interested in presenting a paper, workshop, or both please let me know as soon as possible. The only suggestions are as follows; PAPERS - You should be able to present the paper in one or two 60 minute sessions, allowing sufficient time for a QA period. WORKSHOPS - A workshop should last approximately 90 minutes (with a 10 minute break occuring at the midway point of the workshop). The workshop should be as hands on as possible, focusing on a particular technique or set of techniques. Audience participation is encouraged! At the present time, unfortunately, there is no compensation available for presenters. As the conference grows in size and scope (therefore attracting sponsors) stipends will become available for those accepted to perform presentations. SPREAD THE WORD - There are thousands of PHP developers in and around Texas and you know them, but not all of them know about the conference. Let them know so that they can send their e-mail address in to be included on the list to receive updates. More updates soon ... Jay Blanchard Texas PHP Developers Conference -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] rand()
Hi all, I'm having a problem with the rand function. I use the function below: function gen_short_primary_key_value( $maxlength = 5 ) { $mt = split( ' ', microtime(), 2 ); $foo = (double) ($mt[0] + $mt[1]) * 1; $md5 = strtoupper( md5( $foo ) ); for ( $j = 0; $j $maxlength; $j++ ) { $key .= $md5[ rand( 0, strlen( $md5 ) ) ]; } return $key; } This function works nice on a Windows machine with PHP 4.2.2 (commandline) and also on a Solaris 7 machine with PHP 4.2.2 (also commandline). But when I implement this function into a website and call it, the rand() function will always returns 0 as the answer, making my primary key values always like 0, 1, A and so on. The nice thing about this function is, is that's it's really random ;-)) I've looped it (on commandline) trough 100.000 iterations, and not one value was the same! I need it's purpose because I need a random value which is not to long. Hope you guys can help me out here! Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: rand()
By the way, rand() will only return 0 if I call it with it's arguments. Without arguments it will return a random value. Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] exit() function question
Why exit() funtion always exit with 255 value instead of the passed value, in php 4.2.2, even when I compile with --enable-cli. Check the code bellow, to see # cat t3.php #!/usr/src/php-4.2.2/php ?php echo Version: ,phpversion(),\n; exit(1); ? # ./t3.php ; echo last run exit value:$? Version: 4.2.2 last run exit value:255 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php back?
What is the PHP equivalent to javascript: back? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php back?
There is none, really. Remember, PHP is being PARSED ON THE SERVER SIDE, and THEN spits out HTML to the browser. So your PHP script doesn't have a back or anything similar... it just parses PHP, and outputs HTML. What do you want to achieve exactly? Do you want to conditionally go back in your PHP code (on the server), or provide your user with a go back link on the page? If the former, things like header(Location: referringpage.php) might work, otherwise if it's the latter, just use the javascript Justin French on 04/09/02 1:44 AM, Erich Kolb ([EMAIL PROTECTED]) wrote: What is the PHP equivalent to javascript: back? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Any netscape users out there?
I develop mostly in a Linux environment anymore, but I have a problem with Netscape and PHP. Well, not so much with PHP but developing it with Netscape. Post data makes Netscape REFUSE to show the underlying source code! It's virtually impossible to design form handling stuff when I can't see the code that's generated when i send post data. Is this a bug and how do you fix it?? regards, dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any netscape users out there?
Dan Ostrowski wrote: Post data makes Netscape REFUSE to show the underlying source code! It's virtually impossible to design form handling stuff when I can't see the code that's generated when i send post data. Is this a bug and how do you fix it?? i've never seen this problem in ns, at least not with the stuff i've designed in the past. do you have a page/form somewhere we could look at? -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IBM UniVerse + PHP
I first asked on the PHP-DB list but got no response, so I thought I might try here. Is _anyone_ using PHP with IBM's UniVerse database? I am about to start a project that will connect to a UniVerse database, and would like to use PHP, but can't find any information on it (and I am not familiar with UniVerse). Any help will be greatly appreciated. Replies can be off-list since there doesn't seem to be much interest in PHP/UniVerse. Thanks, -Jackson -Forwarded Message- From: Jackson Miller [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] IBM UniVerse + PHP Date: 29 Aug 2002 10:21:11 -0400 I am about to start working with a client that uses the UniVerse RDMS from IBM and php is my scripting language of choice. I know nothing about UniVerse and will only be interfacing to an existing database to create web-based reports. I have searched the PHP documentation and this list's archives, but I can't find any information about PHP and UniVerse. Is there anyone out there using PHP with UniVerse, or should I look at other scripting languages? Thanks in advance, -Jackson -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re: Refering to an object from within an array variable in another class
Hi, Syntax B doesnt seem to work exactly because as you say it doesn't directly access the 'bars' variable...; here... $reference_to_bar = $this-GetBar($id) ; it seems that a copy of the bar object is being created, which is a new object. This new bar object is not related to the bar object which is a part of the $bars array property of the foo object. When you set the marklar property to the new value ... $reference_to_bar-SetMarklar($value) ; the value is changed for the new copy of the bar object you have just created. Because this value is assigned to the new object it doesn't appear when you print the contents of foo. This is illustrated by the lines i've added below. Maybe after setting the new property value you could reassigned this object to the $bars array of object foo. I'm no expert but it's always fun to play with code... Hope this helps in some way, Javier /* But this syntax doesn't: and this would be prefered, as it doesn't directly access the 'bars' variable... */ $reference_to_bar = $this-GetBar($id) ; echo $reference_to_bar-marklar; $reference_to_bar-SetMarklar($value) ; echo $reference_to_bar-marklar; print_r($reference_to_bar); _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any netscape users out there?
It happens ANYWHERE there is post info for me. Not just on my own PHP development pages. I was just wondering if there was a setting on Netscape to fix this kind of thing. regards, dan On Tue, 03 Sep 2002 10:07:11 -0600 Ashley M. Kirchner [EMAIL PROTECTED] wrote: Dan Ostrowski wrote: Post data makes Netscape REFUSE to show the underlying source code! It's virtually impossible to design form handling stuff when I can't see the code that's generated when i send post data. Is this a bug and how do you fix it?? i've never seen this problem in ns, at least not with the stuff i've designed in the past. do you have a page/form somewhere we could look at? -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any netscape users out there?
Netscape 4.xx series is notorious for caching issues. When you post data and then try to view the source code netscape thinks it has expired and thus gone. Another issue is when you resize the view source window, netscape reloads the page *ack*. On my site at http://www.wocmud.org I think my no cache headers even cause netscape to choke since I can't get page source on any of my pages in the 4.xx series. My solution is to use Mozilla/Netscape 7 to view the source when I need to and just use the 4.xx brokwser when I want to make sure it looks ok visually. HTH, Rob. --- Ashley M. Kirchner wrote: Dan Ostrowski wrote: Post data makes Netscape REFUSE to show the underlying source code! It's virtually impossible to design form handling stuff when I can't see the code that's generated when i send post data. Is this a bug and how do you fix it?? i've never seen this problem in ns, at least not with the stuff i've designed in the past. do you have a page/form somewhere we could look at? -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re: Refering to an object from within an array variable in another class
I believe the following discussion from Web Application Development with PHP 4.0 (available online at http://safari.oreilly.com) may shed some light on your question... Whenever PHP encounters a statement for which write access to a variable is needed, it evaluates and calculates the data that will be written into the variable, copies it, and assigns the result to the target space in memory. (This description is a little bit simplified, but you get the idea.) $some_var = 2; $my_var = $some_var * 3; $new_var = $some_var + $my_var; Looking at this script, PHP will Create space for $some_var and write 2 into it. Create space for $my_var, retrieve the value of $some_var, multiply it by 3, and assign it to the newly allocated memory. Create space for $new_var, retrieve the values of $some_var and $my_var, total them, and write them back to the new place in memory. Well, this sounds nice and logicalbut these are simple types and you've worked with them many times already. Things are very different (and illogical) when PHP is handling classes: class my_class { var $var1, $var2, $var3; } $my_object = new my_class; $my_object-var1 = 1; $my_object-var2 = 2; $my_object-var3 = 3; $new_object = $my_object; $new_object-var1 = 3; $new_object-var2 = 2; $new_object-var3 = 1; print(My object goes $my_object-var1, $my_object-var2, $my_object-var3 !br); print(New object goes $new_object-var1, $new_object-var2, $new_object-var3 !br); What do you think this will produce as output? The script first declares a class, creates one instance of it, and assigns values to its three properties. After having done this, it creates a new reference to this object, reassigns its properties, and then just prints out each property by using both references. Remember, one instance. Figure 2.7 shows the result. Figure 2.7. PHP creating a copy instead of a reference. If you're not surprised now, you either know PHP very well already or haven't thought enough about objects yet. PHP has created a copy, a new instance of my_class instead of just a new reference! This is not the desired behavior, since the new operator is supposed to create an instance of my_class in memory, returning a reference to it. Thus, when assigning this reference to another variable, only the reference should be copied, leaving the original data untouchedsimilar to a file system link, which allows access to the same data through different locations on the file system. This behavior of PHPcreating copies of referenced data rather than just the reference itselfmay not sound important enough to focus on; however, you'll see in a moment that it actually does make a difference. Note: At the time of this writing, both PHP 3.0 and PHP 4.0 are using copy syntax. A chat with someone closely involved in the core development revealed that the plan is to change the default behavior to use a reference syntax, but this change would cause a loss of backward compatibility. A possible change is planned with version 4.1if this happens, information contained here will be invalid for all future versions. Web Application Development with PHP 4.0 Tobias Ratschiller Till Gerken Zeev Suraski Andi Gutmans Publisher: New Riders Publishing First Edition July 12, 2000 ISBN: 0-7357-0997-1, 416 pages _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any netscape users out there?
Robert Cummings wrote: My solution is to use Mozilla/Netscape 7 to view the source when I need to and just use the 4.xx brokwser when I want to make sure it looks ok visually. d'oph. this might be way i never bothered - i use mozilla as well to check code. :) -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any netscape users out there?
Which is strange because I use Netscape 6. Hmm... Perhaps I should upgrade to 7. Also, would the fact that I have Netscape 4.x installed on the same machine as my Netscape 6 cause anything funny to bleed over, you think? Perhaps its a shared library thing.. hmmm... Well thanks for the advice... regards, dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any netscape users out there?
Dan Ostrowski wrote: I develop mostly in a Linux environment anymore, but I have a problem with Netscape and PHP. Well, not so much with PHP but developing it with Netscape. Post data makes Netscape REFUSE to show the underlying source code! It's virtually impossible to design form handling stuff when I can't see the code that's generated when i send post data. Is this a bug and how do you fix it?? regards, dan Netscape 4xx is in many respects a difficult browser because it is not standards compliant and is bug-ridden. Many developers wish people would stop using it. Use Mozilla instead during development and check and just use Netscape 4xx as one of the browsers you test your site with -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any netscape users out there?
Shouldn't be any bleeding from shared libraries. but then I'm on Linux and your probably under windows, and so I don't know for sure anymore :) Cheers, Rob. Dan Ostrowski wrote: Which is strange because I use Netscape 6. Hmm... Perhaps I should upgrade to 7. Also, would the fact that I have Netscape 4.x installed on the same machine as my Netscape 6 cause anything funny to bleed over, you think? Perhaps its a shared library thing.. hmmm... Well thanks for the advice... regards, dan -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any netscape users out there?
hmmm... must be a bug. Same thing happens on Mozilla as Netscape. Anything with post data greys out the view source button, and I can't get it open. Weird. Time to hit some Linux IRC rooms. dan On Tue, 03 Sep 2002 12:56:02 -0400 Robert Cummings [EMAIL PROTECTED] wrote: Dan Ostrowski wrote: Windows? No, Xwindows... :) I hate M$ stuff. I am on linux. I hear ya brother :) Hmmm.. maybe I will just use Mozilla for the time being then. regards, dan On Tue, 03 Sep 2002 12:50:42 -0400 Robert Cummings [EMAIL PROTECTED] wrote: Shouldn't be any bleeding from shared libraries. but then I'm on Linux and your probably under windows, and so I don't know for sure anymore :) Cheers, Rob. Dan Ostrowski wrote: Which is strange because I use Netscape 6. Hmm... Perhaps I should upgrade to 7. Also, would the fact that I have Netscape 4.x installed on the same machine as my Netscape 6 cause anything funny to bleed over, you think? Perhaps its a shared library thing.. hmmm... Well thanks for the advice... regards, dan -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parse errors: path?
I'm getting a parse error with this PHP statement: ?php $path = '/usr/local/plesk/apache/vhosts/.../httpdocs/thumbnails/'; $dir = opendir($path) or die(Could not open $dir); while ($file = readdir($dir)){ if (stristr($file, 'jpg') || stristr($file, 'jpeg')){ echo A HREF=/enlargements/$file$file/ABR\n; } } ? The browser is showing me the following error though, with a changed path: Parse error: parse error in /usr/local/psa/home/vhosts/.../httpdocs/fashion.php on line 144 That's the only PHP in the entire page, so the error has to be in there somewhere. My webhost mapped/aliased my old path to a new directory when they upgraded my server. Does anyone see any errors in the PHP, or should I be troubleshooting the path info??? Wm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any netscape users out there?
Simply hold down the control key and then push the r key while looking at the source code window. That will cause the page source to repost, and you will see the resulting source code. HTH, Peter Janett New Media One Web Services New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 PostgreSQL coming soon! http://www.newmediaone.net [EMAIL PROTECTED] (303)828-9882 - Original Message - From: Robert Cummings [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Dan Ostrowski [EMAIL PROTECTED]; [PHP GENERAL] [EMAIL PROTECTED] Sent: Tuesday, September 03, 2002 10:40 AM Subject: Re: [PHP] Any netscape users out there? Netscape 4.xx series is notorious for caching issues. When you post data and then try to view the source code netscape thinks it has expired and thus gone. Another issue is when you resize the view source window, netscape reloads the page *ack*. On my site at http://www.wocmud.org I think my no cache headers even cause netscape to choke since I can't get page source on any of my pages in the 4.xx series. My solution is to use Mozilla/Netscape 7 to view the source when I need to and just use the 4.xx brokwser when I want to make sure it looks ok visually. HTH, Rob. -- - Ashley M. Kirchner wrote: Dan Ostrowski wrote: Post data makes Netscape REFUSE to show the underlying source code! It's virtually impossible to design form handling stuff when I can't see the code that's generated when i send post data. Is this a bug and how do you fix it?? i've never seen this problem in ns, at least not with the stuff i've designed in the past. do you have a page/form somewhere we could look at? -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any netscape users out there?
Dan Ostrowski wrote: hmmm... must be a bug. Same thing happens on Mozilla as Netscape. Anything with post data greys out the view source button, and I can't get it open. Weird. Time to hit some Linux IRC rooms. Hmmm, I don't have that probem under Mozilla *grin*. Of course it didn't reload either like the other post suggest with the CTRL-r Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Parse errors: path?
Hi, I get no error with that syntax, thats pretty strange, btw why are you putting ... into your directory? You shouldn't. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Wm [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] I'm getting a parse error with this PHP statement: ?php $path = '/usr/local/plesk/apache/vhosts/.../httpdocs/thumbnails/'; $dir = opendir($path) or die(Could not open $dir); while ($file = readdir($dir)){ if (stristr($file, 'jpg') || stristr($file, 'jpeg')){ echo A HREF=/enlargements/$file$file/ABR\n; } } ? The browser is showing me the following error though, with a changed path: Parse error: parse error in /usr/local/psa/home/vhosts/.../httpdocs/fashion.php on line 144 That's the only PHP in the entire page, so the error has to be in there somewhere. My webhost mapped/aliased my old path to a new directory when they upgraded my server. Does anyone see any errors in the PHP, or should I be troubleshooting the path info??? Wm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Parse errors: path?
Sorry, I was just snipping part of the path to make it shorter. The ... is an abbreviation and isn't really in there, in either the code or the parse error. Sounds like the problem must be with the path then. Wm [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I get no error with that syntax, thats pretty strange, btw why are you putting ... into your directory? You shouldn't. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IBM UniVerse + PHP
Jackson Miller wrote: I am about to start a project that will connect to a UniVerse database, and would like to use PHP, but can't find any information on it (and I am not familiar with UniVerse). Jackson, Is there an ODBC driver for it? If so, you might be able to use ODBC. Ask IBM? HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with inserting Flash into MySQL database
I'm using this script to insert picture into database: $data = addslashes( fread( fopen( $arrayUploadedSomething['tmp_name'], r), filesize($arrayUploadedSomething['tmp_name'] ) ) ); And then i use ordinary mysql_query to insert it into database (BLOB field). When i print image on screen, I use this code: header(Content-type: . $arraySomething['something_type']); header(Content-Disposition: inline; filename= . $arraySomething['something_name'] ); print $arraySomething['something_data']; And it works very well...:D BUT, if i insert Flash animation (or something else made in Flash) it goes into database well, but when I print it out :D It wants to download (ignoring the contex-dispositon header) , and if i click open or save, it show error I know that I must use HTML like this: -- object classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca b#version=6,0,29,0 align=middle param name=movie value=something/show.php?bid=?php echo $arraySomething['bid'];? / param name=quality value=high / embed src=something/show.php?bid=?php echo $arraySomething['bid'];? quality=high pluginspage=http://www.macromedia.com/go/getflashplayer; align=middle type=application/x-shockwave-flash/embed /object -- It prints out Flash but the size is not correct, and it si blank (white)... Anyone knows where the problem could be ? Thanks -- Regards, Mitja -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: hide system output from header
i execute a system function which works great only prob is it breaks the header so what i need to know is how i can prevent the output from this and append it to a variable, i allready tried appending to variable but still outputted http://php.net/exec -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 'save as'
Running GNU/Debian Sid. Im Running into problems, Apache cant see the .php file (it brings up the save-as dialog everytime) I have this line enabled (see below) still no success AddType application/x-httpd-php .php installed php4 4.2.2-2, php4-mysql 4.2.2-2, phpnuke 5.6-3, apache 1.3.26-1.1. http://mdew.dyndns.org/httpd.conf http://mdew.dyndns.org/ yeah yeah im a n00b to php stuff, some pointers just to get this thing loadingrunning would be great. You're missing the LoadModule part in httpd.conf for PHP. When you did make install of PHP, it *should* have altered httpd.conf to include this... Make sure you are 'root' when you do 'make install' of PHP maybe... Try it again and see if it says anything about httpd.conf Also search for a *different* httpd.conf somewhere on the box, as PHP may have altered the wrong one. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Writing Files
How do you write files so that theyre chmoded 777 by default. the folders theyre written to are 0777 but the files aren't. so i cant delete or modify the files through PHP, i have to first chmod them with FTP, which takes ages. Do http://php.net/umask before you create them. Include the optional 0777 value for the parameter to any functions that accept it. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: a and validator problem
I have a tag: a href=index2.php?pg=2 CV/a when I want to validate page (W3C online validator) , validator prints: Line 37, column 50: a href=index2.php?pg=2PHPSESSID=195c0283f8 ... ^Error: unknown entity PHPSESSID Stupid, stupid, stupid. There is *NO* reason for the W3C to mistake that for an HTML entity. How can I solve this? (amp doesn't functioning, because after that is PHPSESSID added automatically by php) PHPSESSID is being added by PHP in order to pass the session data through the URL as a GET parameter. You *could* turn that off in php.ini by changing the trans-sid setting... But then your site won't work for users who don't do cookies, which very well may include the W3C validator. When I open the source file from MSIE there is no PHPSESSID parameter. So in properties of link. Maybe validator uses different way to connect to that site. Yes -- they are using HTTP. Is there possibility to solve this? Ignore it. Actually, I think the W3C (stupid) recommendation is to use a different character for the separator in your URLs. They probably recommend amp; or / or something. If you want to waste hours making that happen, have at it. There's a php.ini setting that will let you change the separator that PHP will use when it parses the URL, and then you can go change all your source code to use X instead of if you've got nothing better to do. So far as I know, the *ONLY* thing this will affect is the W3C validator. There isn't *ONE* browser on the planet that will actually choke on the in your URL. If you like jumping through hoops created by W3C for no apparent reason, go for it. :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Useragent and file
// get a web page into an array $fcontents= file ($targeturl); However I dont know how to mimic a different useragent. Using LWP::UA (in perl) i can pretend to be iexplore6 running on win2k or anything i want.. Is there a way i can do this in PHP? Yes, but you'll need to roll your own function with fsockopen($host, 80). Some sample code (using POST instead of GET) would be Rasmus SendToHost function from oh so long ago. Google Rasmus Lerdorf and SendToHost and it'll turn up. By changing the useragent will this also resolve problems with javascript?, I'd like the target server to think that I can view/run it. You'll have to figure out what data to send to fool them well enough, but it should be simple enough to convince the server that you can run JavaScript. But then if their site requires that you actually *DO* run the JavaScript to navigate or do something useful, you're on your own for figuring out how to get from A to B and send them back the JavaScript-modified data. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problem with include
// one.php ? include(two.php); ? --- html code --- // end file one.php // two.php ? include(three.php); ? --- html code --- //end two.php Where is three.php?... well, when I see in my browser www.myweb.com/two.php this shows two.php plus the include file in it three.php, so this works ok, but when i see in my browser (IE 6.0) www.myweb.com/one.php this shows one.php plus two.php, but not three.php that is include into two.php What am I doing wrong? Are they all in the same directory? What is your include_path setting in php.ini? PHP only looks in directories listed in include_path Are you getting an error message, or is the content simply not appearing, or?... Could be this because of cookies? No. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help with writing multiple records to a table
$_POST['category_id']; What do you think this does? Cuz it don't really do anything... $numcat = count($category); if ($numcat1){ $category_id=implode(,,$category); } elseif ($numcat==1){ $category_id=$category; } You have an array of '$category' that you need to insert into cat_survey. Whether you have 1 or 40 or 0 items in it, it's an array. Actually, if they didn't pick anything, the variable won't even exist, so it won't be an array. And your count($category) will probably issue a Warning message... You need to do an INSERT for *every* category they chose: while (isset($category) $category_id = each($category)){ $cat=mysql_query(insert into cat_survey (pfsurvey_id, category_id) values ('$pfsurvey_id','$category_id'),$dbi); if (!$cat) { print pCouldn't insert your record: .mysql_error()./p\n; } } print pLoaded your data correctly./p\n; This is still going to prit out, even if something went wrong. Bad Human Interface. You'll be giving contradictory statements one after the other. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Email formatting
Is it safe to assume that email addresses are accepted by all servers case insensitive? NO! The domain part (after the @) is case-insensitive. The username part (before the @) is case-sensitive. It is *POSSIBLE* for [EMAIL PROTECTED] and [EMAIL PROTECTED] to be very different people. It's not very common any more, but you really don't want to screw this up for the few people who care. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Ridding myself of HTML tags
My site accepts HTML files by upload. A lot of these files are written in MS Word and then saved as HTML files from that. MS Word likes to put a bunch of garbage at the beginning of the file. Now, when users upload their HTML files, my script goes and striptags all of the unnecessary junk in there except it can't rid all this junk (HTML, XML, CSS, JavaScript) at the beginning of the HTML file. But those are all enclosed in HTML tags, even with something as sucky as MS Word involved. Some of these tags span multiple lines, and my script goes through line-by-line, so it won't identify these as tags. Is there a simpler fashion? There's your true problem. An HTML tag can span multiple lines, regardless of where it comes from. Even my hand-coded HTML will occasionally end up with a multi-line HTML tag... Well, okay, maybe not, but I could if I wanted to :-) You need to http://php.net/implode all your HTML into one big long string *before* you strip_tags: $html = implode('', $html); $html = strip_tags($html); If you really need the multi-line HTML turned into an array after that, you can do: $html = explode(\n, $html); But you probably are storing this stuff in a file or database, and it's just as easy to fwrite the large string as to mess with it as an array. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mail/Confirmation Script delivery problems
if(@mail($to, $subject, $message)) . Is there an else clause here to tell you what went wrong if the email didn't go out?... Also add some headers like this: $headers = From: [EMAIL PROTECTED]\r\n; $headers .= Reply-to: [EMAIL PROTECTED]\r\n; and change your mail() to: mail($to, $subject, $message, $headers) Now when your email fails to deliver, the bounce will come back to you instead of, like, [EMAIL PROTECTED] or localhost or whatever, which is probably not getting read by a human. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: newbie question
How do I get PHP to automatically open another PHP page in a browser if a condition is met? I have a pull down HTML table that submits a form to a PHP script. That script then uses a little logic to figure out which web page to go to. I have 5 different pages, and each has different content. Right now, I can make it bring up links, but I can't figure a way out to make it automatically go to the proper web page. I know this has to be easy, but I can't find any info one it. First some Good News: Here's a couple quickie options: 1. Use http://php.net/include to just suck in the other file to the shell that you've built. 2. Use http://php.net/header as header(Location: $otherpage); to re-direct the browser. Now, some meta-comments about these techniques. 1. Seems really nice, until you have to come back to the page and maintain it a couple years down the line. It gets really messy to figure out what variables are coming from where when you have this shell game going on sucking in different files based on a variable. You can work with it, but expect to end up investing more in maintenance than you should 2. is really an abusive use of a mechanism for pages that *MOVED* -- header(Location: ) is really not the right weapon for programming site/layout. It was designed for pages that have literally been picked up and moved to another URL/server/whatever. It *can* be used to force the user to jump around inside your site, but that was not its intent, and will be problematic. One specific instance is that you'll end up not being able to use Cookies/Sessions reliably because the re-location happens before the Cookie makes it out the door. Now, for the Bad News: You really need to re-think the big picture of the design of your web-site so that you don't have to do this. You can use JavaScript in your HTML to re-direct the user to a different page, and leave PHP out of the page-choosing logic. But then you are relying on JavaScript which is unreliable, and some users don't even have it. It may work for the sites you visit (for *you*) and you may find it attractive, but there *will* be users who leave your site because it doesn't work. Your best bet is to not use an HTML pop-up menu for navigation at all. There is no reliable way using maintainable code that will make it really work. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: request what a user clicked
what is php's request object? like in ASP - Request(variable) $_REQUEST['variable'] Or, if you want to distinguish between GET and POST: $_GET['variable'] $_POST['variable'] In the future, if you're not sure where/how PHP is going to give you data, this function will *TELL* you: ?php phpinfo();? Throw that into any script at any point, and it will spew out everything you could possibly need to know about your variables. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Resource ID??
When trying to do this query: $rsum =mysql_query(SELECT SUM(rating) FROM ratings where threadid = $ratevar)or die (mysql_error()); This is the output: Resource id #15 or some other seemingly arbitrary Resource ID number? First of all what is a resource ID and second how do I get it to actually show what I am trying to get it to show! When you send a query to MySQL, you don't get your actual answer. You get a Resource ID It's more like a Receipt for your answer than your answer. You then need to use http://php.net/mysql_fetch_row or other functions to get your actual answer. It does seem a bit like jumping through extra hoops to a newbie, but there are some behind-the-scenes technical reasons why you don't just get your answer Something like this would work for the above example, after you GET RID of the die() part: if ($rsum){ $ratingsum = mysql_result($rsum, 0, 0); echo Rating Sum is $ratingsumBR\n; } else{ echo Web-site down for maintenance. Please try again later.BR\n; error_log(mysql_error()); # NOTE: You have 'broken' SQL. Check you Apache error_log to find the error message } If you were getting several rows, it would be more like: if ($rsum){ while (list($column1, $column2, $column3) = mysql_fetch_row($rsum)){ echo $column1, $column2, $column3BR\n; } else{ ... same stuff as above } -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: --with-imap strangeness in 4.3 dev
./configure --with-imap-ssl=/usr (other options not shown) Everything configures fine. I can also make and make install with no errors. You don't have IMAP in PHP. ./configure has a nasty habit of issuing warning messages for stuff you asked for --with-xxx and then blindly marching forward and allowing you to compile/install a perfectly valid PHP... It just doesn't have everything you asked for. There *are* almost for sure some messages that flew by from ./configure that would give you some hint what went wrong. Go back and do ./configure like this: ./configure --with-imap-ssl=/usr ... 21 configure.output You can then: tail -f configure.output to watch it go by (use control-C to break out) and have a permanent record of what happened to refer back to. Dig through that, and you'll find some IMAP problems somewhere, I'm betting. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: session encode and session decode question
I'm trying to get the one variable I stored insite a session, the variable's name is $username I am trying to do it like this, but I think it's wrong: $PHPSESSID = session_encode(); $username = session_decode(); It tells me I have wrong parameters for session decode. What am I supposed to encode to get the variable from the session? The encode/decode is all taken care of *UNLESS* you are replacing PHP's session back-end with your own. ?php session_start(); if (isset($_SESSION['count'])){ echo You have been here , $_SESSION['count'], times.BR\n; } else{ $_SESSION['_count'] = 1; } echo A HREF=, $_ENV['PHP_SELF'], ?microsoftsucks=, mt_rand(), Come back soon/ABR\n; ? You only need the encode/decode stuff if you want to, say, take PHP's file-based session storage and move it to MySQL so that you can have *TWO* web-servers talking to the same database server and using the same storage system so that users can be on either web-server and have the same session data. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refering to an object from within an array variable in another class
Any insight appreciated. In a best case if someone can add in the required ''s to the following code that would be great. ?php echo 'pre' ; error_reporting ( E_ALL ) ; class Foo { var $bars = array() ; function AddBar($id,$text) { $obj = new Bar ( $text ) ; $this-SetBar ( $id , $obj ) ; } function SetBar($id,$bar) { $this-bars[$id] = $bar ; } function GetBar($id) { return $this-bars[$id]; } function SetBarMarklarSyntaxA ($id,$value) { /* This syntax works... */ $this-bars[$id]-SetMarklar($value) ; } function SetBarMarklarSyntaxB ($id,$value) { $reference_to_bar = $this-GetBar($id) ; $reference_to_bar-SetMarklar($value) ; } } class Bar { var $marklar = '' ; function Bar($marklar) { $this-SetMarklar($marklar) ; } function SetMarklar($value) { $this-marklar = $value ; } } //--- $foo = new Foo ; $foo-AddBar('one','un') ; $foo-AddBar('two','duex') ; print_r($foo) ; //Works $foo-SetBarMarklarSyntaxB('one','eins') ; $foo-SetBarMarklarSyntaxB('two','zwei') ; print_r($foo) ; echo '/pre' ; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mail/Confirmation Script delivery problems
Hi Richard, Thank you for continuing to research this problem. Just before the weekend, I talked to my IP about the problem I was having. He thought it was strange: suggested I look at my browser settings to see what was being passed. To make a long story short, he mentioned that with 'mailto:' I shouldn't be having these problems. I told him that I was using 'mail()' -- [add a deep, low, groan from my IP] Seems like 'mail()' has been banned for security reasons by my IP (glad I found out now before I go 'live'!). He supplied a workaround IP-made function called 'smtpmail()' to be used in its place. Glad I checked. Thanks again for your help! Regards, Andre On Tuesday 03 September 2002 02:23 pm, Richard Lynch wrote: if(@mail($to, $subject, $message)) . Is there an else clause here to tell you what went wrong if the email didn't go out?... Also add some headers like this: $headers = From: [EMAIL PROTECTED]\r\n; $headers .= Reply-to: [EMAIL PROTECTED]\r\n; and change your mail() to: mail($to, $subject, $message, $headers) Now when your email fails to deliver, the bounce will come back to you instead of, like, [EMAIL PROTECTED] or localhost or whatever, which is probably not getting read by a human. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $PHPRC and CGI php ; multiple php.ini files
For a summary see http://bugs.php.net/bug.php?id=19202 :) Please be sure to follow the link to my phpinfo(); which will include the environment variables as seen by the CGI PHP parser. The link is also in the 'bug' report - http://aktualnosci.tras.pl/php.sphp Can someone please either confirm that the CGI version of PHP will look at its environment and look at PHPRC every time, or that it will ignore PHPRC in its environment? Or does $PHPRC only apply to the module version of php and not php used via CGI? Also, can php.ini 'include' another (global) php.ini file? I asked this on php-install but got no echo back, hence the repeat. Thank you, -- Tomasz Orzechowski [EMAIL PROTECTED] APK.net systems administration teamTO630 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about correct PHP/MySQL configuration
Hello. I'm in the process of setting up a RH Linux/Apache/MySQL/PHP configuration. Prior to attempting this setup, I've never installed Apache, MySQL, or PHP. So, please bear with me. Also, My RH Linux setup had PHP and Apache on it already (via the orginal RH install). So, here's my situation; as part of a MySQL book review I'm working on, I installed the MySQL binaries via RPM (fyi: the MySQL-Max RPM doesn't work..when it attempts to start, the daemon fails because of missing files. Regular MySQL works flawlessly). I also installed a sample PHP app from the book and, at the point it attempts to access the database, it generates a blank page (some source is present... just beginning and ending HTML doc tags). I suspect that the failure may be related to an improper PHP config. My PHPINFO script reveals the following --with statement: --with-mysql=shared,/usr. Meanwhile, mysql lives in /usr/bin. So, is this the problem? Is it because PHP is improperly configured t! o find mysql? If so, I'm also trying to figure out the fastest path to correcting the problem. I must confess that I've never run configure-make-install. If that's the easiest way to correct this, do I need to reinstall PHP so that I have the source code on my system? Not knowing much about PHP and seeing it show up in a bunch of directories on my Linux box, I'm not sure if I have the source, or what directory it's in (where I'd need to run configure-make-install). So, if the source isn't on this box, does it need to be and do I need to remove the current PHP installation first? If I need to remove the PHP installation and reinstall from the source, will that break the now functioning Apache-PHP connection and how would I correct that? Also, what's the shared part of the with statement? Why do I need or not need that? Thanks in advance for any help. David * * * * * * * Hackers. Thieves. Cyberterrorists. Are you prepared? Take the Digital Defense Test! A ZDNet Special Report. Coming Sept. 25. http://Defense.zdnet.com http://Defense.zdnet.com
Re: [PHP] Question about correct PHP/MySQL configuration
Step 1, please limit your lines in your emails to mailing lists to 78 chars or less in width. Your entire message shows up as 2 lines for me. Step 2, you need to install the php-mysql rpm. Then everything should work. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with inserting Flash into MySQL database
Hi Mitja, You need to specify the dimensions with the 'width' and 'height' attributes of the object tag and tell the movie to start playing with: PARAM NAME=PLAY VALUE=true For NS put WIDTH=xxx HEIGHT=xxx PLAY=true in the embed tag. HTH Paul At 7:54 pm +0200 3/9/02, Mitja Stepan wrote: I know that I must use HTML like this: -- object classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca b#version=6,0,29,0 align=middle param name=movie value=something/show.php?bid=?php echo $arraySomething['bid'];? / param name=quality value=high / embed src=something/show.php?bid=?php echo $arraySomething['bid'];? quality=high pluginspage=http://www.macromedia.com/go/getflashplayer; align=middle type=application/x-shockwave-flash/embed /object -- It prints out Flash but the size is not correct, and it si blank (white)... Anyone knows where the problem could be ? Thanks -- Regards, Mitja -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- === Paul Colcutt http://www.paulcolcutt.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help with inserting Flash into MySQL database
Your embed source and object movie value needs to be a file path to a swf. Your values are currently set to something.php, needs to be something.swf. hope that helps, -- Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] This is weird, this script does/doesn't work
on my own machine, W2k+Apache+php4.2 this works without problem, on the Internet-server though, (Linux), the following script produces a blank page: ?php require ../utils.php; $link=openDB(); $file = $target.form; // Queries for student if ($target == student) { // Add student Query to add // Change student info Query to change info // Delete student Query to delete } // Queries for result if ($target == result) { // Delete result Query to delete } if(!isset($administrate) $goal) { if ($logga_in == ok ) { $adm_user = admin; $adm_pass = password; if ($operation == logon) { if ($password == $adm_pass $admin == $adm_user) { setcookie(administrate, OK, 0); include(../recycle/head.php); include ($file.php); } else { include(../recycle/head.php); echo CENTERFONT SIZE=\5\ COLOR=\#C9\Please try again. Check your spelling./FONTCENTER; include (loginform.php); } } } else { include(../recycle/head.php); include (loginform.php); } } elseif ($target) {//When logged in this load the right form include(../recycle/head.php); include ($file.php); } if (!$target) {//This happens when first loaded. In the head.php there's a menu and the different targets are set include(../recycle/head.php); echo H2Administration of SUBIMG BORDER=0 SRC=\../pics/mypicmin.gif\ WIDTH=135 HEIGHT=30/SUB/H2 ; } include(../recycle/bottom.php); ? Explanation: utils.php with the two functions openDB() and queryDB() connect to the database and do the query. loginform.php contains the html to the loginform. $file = $target.form; so the right form will be loaded. So, what is wrong, why does it 'behave' so different? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with inserting Flash into MySQL database
No, it doesn't work... If I right-click on movie a contex menu opens, and there is an option Movie not loaded (which is disabled)... I think there is something wrong with printing .swf out of the database, but I cant figure out what... -- Regards, Mitja - Paul Colcutt [EMAIL PROTECTED] wrote in message news:a05111b03b99ac67c5fb7@[195.82.121.80]... Hi Mitja, You need to specify the dimensions with the 'width' and 'height' attributes of the object tag and tell the movie to start playing with: PARAM NAME=PLAY VALUE=true For NS put WIDTH=xxx HEIGHT=xxx PLAY=true in the embed tag. HTH Paul At 7:54 pm +0200 3/9/02, Mitja Stepan wrote: I know that I must use HTML like this: -- object classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.c a b#version=6,0,29,0 align=middle param name=movie value=something/show.php?bid=?php echo $arraySomething['bid'];? / param name=quality value=high / embed src=something/show.php?bid=?php echo $arraySomething['bid'];? quality=high pluginspage=http://www.macromedia.com/go/getflashplayer; align=middle type=application/x-shockwave-flash/embed /object -- It prints out Flash but the size is not correct, and it si blank (white)... Anyone knows where the problem could be ? Thanks -- Regards, Mitja -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- === Paul Colcutt http://www.paulcolcutt.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploading file
Hi, I am new to this group. I am trying to figure out how to let people to upload image files to my website. My ISP is using PHP 3 (I believe). If someone can give me simple example, that will be great. Thanks. --Clemson How can I tell what version of PHP is running on the system (linux)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with inserting Flash into MySQL database
Yes, but I'm reading .swf file from database That is why a used: header(Content-Disposition: inline; filename= . $arraySomething['something_name'] ); You see, I thought that filename = ... told object the name of the file... But I don't now if it does ... probably not ... but how can I solve this. I cant give .swf extension, becaose I'm reading the content of file from database... -- Regards, Mitja Mike Krisher [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Your embed source and object movie value needs to be a file path to a swf. Your values are currently set to something.php, needs to be something.swf. hope that helps, -- Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Any netscape users out there?
Ctrl r worked for me -Original Message- From: Peter Janett [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 10:00 AM To: Robert Cummings; [EMAIL PROTECTED] Cc: Dan Ostrowski; [PHP GENERAL] Subject: Re: [PHP] Any netscape users out there? Simply hold down the control key and then push the r key while looking at the source code window. That will cause the page source to repost, and you will see the resulting source code. HTH, Peter Janett New Media One Web Services New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 PostgreSQL coming soon! http://www.newmediaone.net [EMAIL PROTECTED] (303)828-9882 - Original Message - From: Robert Cummings [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Dan Ostrowski [EMAIL PROTECTED]; [PHP GENERAL] [EMAIL PROTECTED] Sent: Tuesday, September 03, 2002 10:40 AM Subject: Re: [PHP] Any netscape users out there? Netscape 4.xx series is notorious for caching issues. When you post data and then try to view the source code netscape thinks it has expired and thus gone. Another issue is when you resize the view source window, netscape reloads the page *ack*. On my site at http://www.wocmud.org I think my no cache headers even cause netscape to choke since I can't get page source on any of my pages in the 4.xx series. My solution is to use Mozilla/Netscape 7 to view the source when I need to and just use the 4.xx brokwser when I want to make sure it looks ok visually. HTH, Rob. -- - Ashley M. Kirchner wrote: Dan Ostrowski wrote: Post data makes Netscape REFUSE to show the underlying source code! It's virtually impossible to design form handling stuff when I can't see the code that's generated when i send post data. Is this a bug and how do you fix it?? i've never seen this problem in ns, at least not with the stuff i've designed in the past. do you have a page/form somewhere we could look at? -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FORUM CODE
Hi, im wondering how in popular forum software, those 'BB codes' are done in PHP, like, [B] and stuff. I just cant figure it out. - [EMAIL PROTECTED] http://www.cool-palace.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] continuation to the ftp story
The problem with my other php - well - problem was that the destination and file variables were reversed, I think, no I changed them, but I get this error when I try to ftp a file to a server: Warning: ftp_put(): error opening /home/victor/sites/kodak/user_pictures/vic Can user permissions cause this error? I also tried appending a '/' after the destination, but my error now read s as: Warning: ftp_put(): error opening /home/victor/sites/kodak/user_pictures/vic/ It also brakes at: echo 'FTP upload has failed.'; so that's where the problem is, I just don't know what the problem is. The ftp code is this: if someone could help it'd be nice. # set up basic connection $conn_id = ftp_connect($ftp_server) or die ('Could not establish FTP connection'); # login with username and password $login_result = ftp_login($conn_id, $ftp_user, $ftp_pass) or die ('Could not login'); # check connection if ((!$conn_id) || (!$login_result)) { echo 'FTP connection has failed.'; exit; } $destination = $picture_location.$f_username.'/'; # upload the file $upload = ftp_put($conn_id, $picture, $destination, FTP_BINARY); # check upload status if (!$upload) { echo 'FTP upload has failed.'; exit; } # close the FTP stream ftp_close($conn_id); - Victor www.argilent.com __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php