[PHP] Re: About the code display on php.net
Could someone please fix the function pages on http://www.php.net, so that when people submit code all nice and formatted, it retains that formatting in the contributed notes section? There are some really intricate examples, and it just makes it that much easier to read. Not to mention, the left aligned code detracts from the professional look of an otherwise excellent resource/site. I should think this fix is as simple as using PRE /PRE tags (rather than, or in addition to the code tags you have now). Nope. code is used to let the text wrap and do not make horizontal scrollbars appear. I have added a conversion ofto nbsp; now, so it will show up in the correct form in a few minutes. While you're at it, please expand the textarea on this page: http://www.php.net/manual/add-note.php To facilitate someone entering in their code without being squished into these itty bitty 40 column by 6 row spot. Well, the manual notes system is not intended to be a code archive. Many notes include code which may have been much smaller. Anyway, I have extended the size of the textarea. Goba -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cpdf_set_font
Hello, I´m using ClibPDF function cpdf_set_font like: cpdf_set_font($cpdf, Times-Roman, 30,WinAnsiEncoding); But I need to have Windows-1250 Encoding or ISO-8859-2 (I need czech chars). Does anybody know how can I do that? Thank you very much Tomas Kubis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: File Upload Problem
In article 002e01c27f99$20e35b50$030a0a0a@skink, [EMAIL PROTECTED] says... Hi All I'll start by saying that I've checked the online manual (and comments) as well as having done a Google search on this with no success. My problem is that files uploaded through a form are increasing in size. For example, I upload an image that is 7658 bytes and the uploaded version is 7685 bytes, or upload 11106 bytes and it's 11133 bytes when uploaded. Images uploaded through my form are broken in the process and no longer display. This is only happening on my production server (RH Linux-based). My development environment is Win XP with Apache and PHP and the exact same code works perfectly. I've checked through /etc/php.ini for anything related without success. I use move_uploaded_file() to handle the uploaded file once it's on the server. Can anyone suggest where else I should be looking to resolve this? Thanks, Dave Doesn't that look like the EOL characters are being translated after the fashion of ftp ascii transfers? Maybe have a look at the two versions in a hex viewer and see if that is the case? Not a solution, but maybe a further step in the debugging process? Cheers -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] write on the begin of a file
Hi I have this *** line 1 line 2 ... *** and i want have this after my script ... *** MY NEW TEXT line 1 line 2 ... *** i had test this but it seems not work : $fp = fopen(test, a+); fseek ($fp,0); fputs($fp,set IP=192.11.11.11\n); fclose($fp); i had test the same script with w+ and rewind($fp) but it didnt work ... thx . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Segmentation Fault
Hi All, I'm scanning email address for our mailing list to see if they are valid and the PHP app I have built for this bombs out at random complaining of a Segmentation Fault. I believe this is to do with memory and possibly down to the number of open file handles but the code is spot on in that it opens a connection, runs some code, then closes it. I've checked it, double checked it then checked it some more and fclose definitely gets executed every time. The variable I'm using for the file handle is $Connect and the reference to this gets incremented by 1 every time I run fsockopen on it. Should it do this? My question: Is there any limit to the number of times I can run fsockopen in any one instance of PHP even though the connection is being closed? Or is there something else I should know? Thanks in advance Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array Question
-Original Message- From: PHP List [mailto:php_list;ibcnetwork.net] Sent: 29 October 2002 17:20 To: php Subject: Re: [PHP] Array Question No, array_keys does not do what I want, in order to user array_keys, it assumes I know the value of the key, but I don't, Er -- no. Go read its definition again -- you *may* pass it a value for which you want the corresponding keys, but by omitting the value argument you may also ask for *all* of the keys of your array. I want to get the value of the key but all I know is the index. First of all, I presume this means that, for example, if $index==4, you want to know what the key of the 4th array element is? In that case, the following, whilst not ideal, may be your best solution: $keys = array_keys($array); $required_key = $keys[$index]; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Need help...
Like noone seems to find something usefull to help me.. I've done the work myself :) I've tried this : $eregstr=/style[^]*([^]|[^\/]|\/[^style]|\/style[^])*\/style[^]* /msi; $data=preg_match_all($eregstr,$str,$matches); $str=preg_replace($eregstr,,$str); $styles=implode(\n,$matches[0]); $eregstr=/head[^]*(.*)\/head[^]*/si; $str=preg_replace($eregstr,head\\1.$styles./head,$str); And, actually, it works fine.. Any other solution ? ( faster...??) Baroiller Pierre-Emmanuel [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hi everyone... I've got a little problem : I've got an html template, with javasript functions and stylesheets in many places... This html template is made via a big big template handler i've done... All seems to work... But, now, I would like to clean this html page to procude a 'readable' page If got a page like this : html head /head body xyxyxyxyxyx script function nb1() {} /script y yy style .outter {} /style /body /html And.. I would like to produce a page like this : html head style .outter {} /style script function nb1() {} /script /head body xyxyxyxyxyx y yy /body html Anyone have and idea ? I've tried with some preg_match_all() but... The only that work for me is '/head[^]*(.*)\/head[^]*/si' witch returns the head content... (where I'll add style script contents).. I've tried to change 'head' with 'script' or 'style' but.. It doesn't work... Like I'm not a regex guru ...I'm looking for help.. Regards, P.E. Baroiller -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cutting off first 4 characters using array input names??
-Original Message- From: John W. Holmes [mailto:holmes072000;charter.net] Sent: 30 October 2002 01:15 To: 'Jarrad Kabral'; [EMAIL PROTECTED] Pretty sure this is a known bug; it's been discussed on here a few times. Do a search for it. Oh yeah, at least half a dozen -- I found them the other day whilst searching for something else! It's reported as fixed in the development CVS version, so you might want to try 4.3.0pre2 or a later snapshot from http://snaps.php.net/ Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] POST-ing or GET-ing an array
-Original Message- From: Paul Nicholson [mailto:paul;dtnicholson.com] Sent: 29 October 2002 19:10 To: Sascha Cunz; Petre Agenbag; [EMAIL PROTECTED] Hey, I think you should be able to serialize and urlencode the array and then pass that via get/post.post would be a lot better as get is limited to so many chars. Something like: $sql = select stuff from my_table; $result = mysql_query($sql); while ($myrow = mysql_fetch_assoc($result)) { $id = $myrow[id]; $my_array[] = $id; } echo 'a href=next_page.php?array='. urlencode(serialize($my_array)) .'Next/a'; You'll need to unserialize+urldecode the array at the other end. You shouldn't need to urldecode(), as this happens automatically. In fact, this is exactly *why* you need to urlencode() it in the first place! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] back and forward through a result query
basicly you need to do select .. limit $ptr, 1 and links prev = $ptr-1 (if $ptr!=0) and next = $ptr +1 (if $ptr select count(*)) Petre Agenbag wrote: Rick, thanks, I will check the lists, but I'm not sure that will resolve my problem, I don't want to limit the display in the initial result set, I want to have a page that lists ALL the hits above each other, and it's only once you click through to the next page that I want to start walking through the list. Anyway, I might be missing the point you are trying to make her, so I will first go and do some research before I ask a bunch of questions you have already answered for me... Ta On Tue, 2002-10-29 at 15:33, Rick Emery wrote: This is a common requirement; check the archives and/or php.net, phpbuilder, etc. What you will do is use mysql's LIMIT parameter on your select; go to mysql.com to read about it. Lets assume you wish to display 20 lines per page; assume you use a pointer, $ptr, to determine where you are in a search: $query = SELECT * FROM mytable WHERE some criteria LIMIT $ptr,20; mysql_query($query) or die(mysql_error()); To go to the next page, create a hyperlink: $ptrN = $ptr + 20; A href=this_script.php?ptr=$ptrNNext/A $ptrP = $ptr - 20; A href=this_script.php?ptr=$ptrPPrevious/A I leave the details to you. - Original Message - From: Petre Agenbag [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 29, 2002 6:06 AM Subject: [PHP] back and forward through a result query Hi I need to do the following, and have a slight idea of how to do it, but I'm not sure... I want to do a select id from table where something = whatever , then I will display all the hits from that query as links to a display page, sending along the id's of the row. On that next page, I will use that id to retrieve the relevant data to display for that specific record, but, I want to have a previous|next function, that will display the relevant data of the previous or next record as was displayed on the original page that showed the list of hits. So I *think* I should create an array containing all the id's of that query, and send it along with the clickthrough to the display page and then from there use the array functions next and prev to get the id's directly adjacent to the one I currently have, but I'm not sure if this is the best way to do it, for one, I don't know how to put those id's into an array from the original query, and two, don't know how to tell it to get prev of current id from array or get next of current id from array. And I think it might be a bit of an unnecessary overhead to send that entire array via GET to the display page if you are only ever going to use 2 values from it, so It would make much more sense to me to pass the current id, the next id and the previous id for each hit along to the display page. Any ideas on how I could do that? 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Flash and PHP?
[snip] I'm new to php coding but after some research am I right in saying that the latest release that I installed is PHP4.2.3 then there is a configuration setting called register_globals. Up until 4.2 it has always been ON. But not.. as of 4.2 it is OFF. is this right? if so have the scripts I have been writing have been a waist of time? [/snip] No, it has not been a waste of time. Register_globals has been turned off for security reasons. (If you had mentioned any of this during the previously vague e-mails the list may have been able to help more quickly.) Depending upon the form method (either GET or POST) your variables will be contained in an array called $_GET or $_POST, like $_GET[ToEmail] or $_POST[ToName]. If I could have seen the code for the form and the processing script I could have nailed this down for you. When you send a question to the list please be as specific as posible and include the code that is giving you trouble. Vague inquiries such as, Anyone use this? will largely go unanswered or will get flamed as yours did yesterday. Also, make sure that you reply to all so that your response goes to the list. That way if the individual who sent you information is no longer available it will allow someone else to pick up the thread. HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex Help
Instead of splitting the string on chars that don't equal \w and ', split it on chars that equal \s (or any other you need) Gerard Samuel wrote: Im trying to explode a string into an array of words using - $title = preg_split('/[^\w\']/', $title, -1, PREG_SPLIT_NO_EMPTY ); It seems to work well with words like this and don't but it doens't work with words with accents to it like Guantánamo Could my regex be expanded to handle non-english type characters, or any workarounds to get a string into an array of words, where the string contains non english characters?? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Standalone JDtoGregorian function, please??
Hi, 1. The server I am using does not have the Calendar functions compiled into PHP. 2. The online manual comments for GregoriantoJD supplies a standalone function to convert one way. 3. A counterpart function, translating back JDtoGregorian, is missing. Does anyone have a matching pair of these functions please? - I would be most grateful. :-) John (Montgomery, Web Design Unit, 01224 273218, [EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php form mail - checkbox problem
Tine wrote: Greetings, Forgive my newbism here, but I am having a hard time recieving check(box)ed items from a form sent to e-mail using PHP. The code is as follows: //Routine for checkboxes $MailBody .=Type medlemskap : ; $items = 2; //initiate possible # of items for ($i = 1; $i = $items; $i++) { //loop on # of items $MailBody .= $medlemskap[$i], ; //put results in variable MailBody where is $medlemskap set? is it comming from the form? you might then need to use $_REQUEST[medlemskap][$i] instead. It might be also simpler to use foreach($_REQUEST['medlemskap'] as $v) { $MailBody .= $v, ; } } ..and the html code put in the form is: input type=checkbox name=item_1[] value=hovedmedlemskap hovedmedlemskap [200 kr.] input type=checkbox name=item_2[] value=2 i husholdning 2 eller flere i samme husholdning [100 kr.] why are you using two different names for variables (item_1 and item_2)? should not it be name=medlemskap[] The problem is, when I recieve the form as email, it just shows the checked item(s) as: ,, (without the quotemarks) What am I doing wrong? I am using the script found here: http://www.grenadine.net/php/NadForm/NadForm_en.html Website where my form is located is here: http://komposlo.inmono.net/m_skap.html Help is very much appreciated! Thanks in advance, Tine -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] write on the begin of a file
There is no insert in fputs, you need to make a new file and then rename it to your old one, or build it in the memory and then overwrite it. Sbastien Eckert -- Netika wrote: Hi I have this *** line 1 line 2 ... *** and i want have this after my script ... *** MY NEW TEXT line 1 line 2 ... *** i had test this but it seems not work : $fp = fopen(test, a+); fseek ($fp,0); fputs($fp,set IP=192.11.11.11\n); fclose($fp); i had test the same script with w+ and rewind($fp) but it didnt work ... thx . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Yahoo moves to PHP
Forgive me if you guys have seen this. Just read it on www.webmasterworld.com Yahoo moves to PHP http://public.yahoo.com/~radwin/talks/yahoo-phpcon2002.htm -- Nick Wilson // www.tioka.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Yahoo moves to PHP
We're taking over. Steve Bradwell MIS Department. If you give someone a program, you will frustrate them for a day. If you teach them how to program, you will frustrate them for a lifetime. -Original Message- From: Nick Wilson [mailto:nick;tioka.com] Sent: Wednesday, October 30, 2002 8:13 AM To: php-general Subject: [PHP] Yahoo moves to PHP Forgive me if you guys have seen this. Just read it on www.webmasterworld.com Yahoo moves to PHP http://public.yahoo.com/~radwin/talks/yahoo-phpcon2002.htm -- Nick Wilson // www.tioka.com -- 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] PHP and .htaccess authentication
I just got done reading the online docs concerning http authentication and tried out a script that appears on the page. Apparently it is easy enough to protect any page with http authentication after you have already forced someone to enter a username and password on a regular .htaccess prompting under Apache. What I need to try to accomplish is checking a username and password against a MySQL database and redirect to a different directory upon success. The directory would be protected via a .htaccess file. Is there a way to pass through a .htaccess file if they have already passed a previous authentication scheme as above? Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File Random Access
I never noticed before...there is no easy way to perform random-access read and WRITE on a file. I vote/recommend/suggest that this most basic functionality be added to the next release of PHP. This would not be an enhancement; rather, it is correcting a serious flaw. Or am I missing something - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 6:28 AM Subject: Re: [PHP] write on the begin of a file There is no insert in fputs, you need to make a new file and then rename it to your old one, or build it in the memory and then overwrite it. Sbastien Eckert -- Netika wrote: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] File Random Access
-Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: 30 October 2002 13:46 I never noticed before...there is no easy way to perform random-access read and WRITE on a file. I vote/recommend/suggest that this most basic functionality be added to the next release of PHP. This would not be an enhancement; rather, it is correcting a serious flaw. Or am I missing something I haven't tested this, so I may be missing something, but doesn't fopen('filename', 'rb+') or fopen('filename', 'ab+') allow for this? Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] File Random Access
Rick, If you have a file that is to large to simply read into memory, do your inserts and then write back out then you need to move it to a database. Cluttering up the main code base with random flat-file reads and writes is not necessary. If you seriously need it then you can do as suggested, create a new file, read from the old file, insert at the proper place, close, delete, rename, rinse, repeat. If you think about it, that's what the php developers will have to do to accommodate your request. (assuming again that your file is too large to simply fit in memory.) It may be a need for you but in my 2 years of using PHP, you are the first person I've seen ask for it. Therefore I don't think it qualifies as a serious flaw. IMHO, etc. =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 30, 2002 7:46 AM To: PHP Subject: [PHP] File Random Access I never noticed before...there is no easy way to perform random-access read and WRITE on a file. I vote/recommend/suggest that this most basic functionality be added to the next release of PHP. This would not be an enhancement; rather, it is correcting a serious flaw. Or am I missing something - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 6:28 AM Subject: Re: [PHP] write on the begin of a file There is no insert in fputs, you need to make a new file and then rename it to your old one, or build it in the memory and then overwrite it. Sbastien Eckert -- Netika wrote: -- 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] database stuff and conditions
hi, i am a competant perl programmer of nearly a year and a half and I have just this week started looking at php. I am trying to write a couple of webpages that will allow me to update a mysql database which is powering a dns server, for a dynamic dns service. every time i have tried to grab some stuff from the database and check the login or domain permissions, I get stuck in a mess of ifs and whiles. can anyone give me an idead on the best method/starting place. my database looks like this: users -- pairs of usernames/user_ids domains -- matches domainnames/domain_ids/passkeys to user_ids records -- all the dns records. not got to this point yet. the keys also have to be digetst::md5 encrypted to compare with those in the database. I think i may need cookies for this so any help would be greatly appreciated. -- Mat Harris OpenGPG Public Key ID: C37D57D9 [EMAIL PROTECTED]matthewh.genestate.com msg83347/pgp0.pgp Description: PGP signature
[PHP] php / ldap
Hi, using php_ldapadd, I get this error in ldap.log: Oct 30 09:23:43 Lunar slapd[10714]: conn=202 op=1 RESULT tag=105 err=65 text=object class 'posixAccount' requires attribute 'uidNumber' How do I get the next available uid number from my ldap database and then use that number for uidnumber? Thanks!! -Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unsetting Session Variables
Hi all, I am having problems unsetting Session Variables - where I know it should work. I have a form. It contains both links with GET variables, and also a POST form. They all go to the same next page. Page 2 simply clears all session variables, and then sets them based upon the contents of the GET or POST array. It then calls page 3 which displays information based on the SESSION variable contents. My problem is that a session variable does not seem to unset. I am using: unset ($_SESSION['variablename']); But this does not seem to destroy the session variable. (it is still available later in other scripts) What can I do? David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com smime.p7s Description: application/pkcs7-signature
Re: [PHP] write on the begin of a file
Mike Ford had the answer: $fp = fopen(test, r+); - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 6:28 AM Subject: Re: [PHP] write on the begin of a file There is no insert in fputs, you need to make a new file and then rename it to your old one, or build it in the memory and then overwrite it. Sbastien Eckert -- Netika wrote: Hi I have this *** line 1 line 2 ... *** and i want have this after my script ... *** MY NEW TEXT line 1 line 2 ... *** i had test this but it seems not work : $fp = fopen(test, a+); fseek ($fp,0); fputs($fp,set IP=192.11.11.11\n); fclose($fp); i had test the same script with w+ and rewind($fp) but it didnt work ... thx . -- 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] File Random Access
You are correct. In fact, simply r+ works; I just tried it. Thanks - Original Message - From: Ford, Mike [LSS] [EMAIL PROTECTED] To: 'Rick Emery' [EMAIL PROTECTED]; PHP [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 8:05 AM Subject: RE: [PHP] File Random Access -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: 30 October 2002 13:46 I never noticed before...there is no easy way to perform random-access read and WRITE on a file. I vote/recommend/suggest that this most basic functionality be added to the next release of PHP. This would not be an enhancement; rather, it is correcting a serious flaw. Or am I missing something I haven't tested this, so I may be missing something, but doesn't fopen('filename', 'rb+') or fopen('filename', 'ab+') allow for this? Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Text patterns
Hello, Can you give me any url, where from I can get any Text patterns, I'm making a list of text patterns for code writing optimization. I'm in need of any type of patterns - e-mail, utl, ftp, etc. Any custom patterns are welcome ;) Thank you in advance ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unsetting Session Variables
Are you doing a session_start() on the page you are unsetting on? Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] If you need PHP hosting with an experienced support team 24/7 then email me today. On Wed, 30 Oct 2002, David Russell wrote: Hi all, I am having problems unsetting Session Variables - where I know it should work. I have a form. It contains both links with GET variables, and also a POST form. They all go to the same next page. Page 2 simply clears all session variables, and then sets them based upon the contents of the GET or POST array. It then calls page 3 which displays information based on the SESSION variable contents. My problem is that a session variable does not seem to unset. I am using: unset ($_SESSION['variablename']); But this does not seem to destroy the session variable. (it is still available later in other scripts) What can I do? David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] write on the begin of a file
This is not an answer for him, this would overwrite the old stuff, but he wants to prepend it. Rick Emery wrote: Mike Ford had the answer: $fp = fopen(test, r+); - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 6:28 AM Subject: Re: [PHP] write on the begin of a file There is no insert in fputs, you need to make a new file and then rename it to your old one, or build it in the memory and then overwrite it. Sbastien Eckert -- Netika wrote: Hi I have this *** line 1 line 2 ... *** and i want have this after my script ... *** MY NEW TEXT line 1 line 2 ... *** i had test this but it seems not work : $fp = fopen(test, a+); fseek ($fp,0); fputs($fp,set IP=192.11.11.11\n); fclose($fp); i had test the same script with w+ and rewind($fp) but it didnt work ... thx . -- 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] database stuff and conditions
attached is a dump of the mysql database. The passkeys are not on a per user basis, but rather per domain. this can change if that is not good. On Wed, Oct 30, 2002 at 03:36:58 +0100, Martin Hudec wrote: Hello Mat, MH hi, i am a competant perl programmer of nearly a year and a half and I have MH just this week started looking at php. I am the same but reversed ;)...just started perl :) MH I am trying to write a couple of webpages that will allow me to update a MH mysql database which is powering a dns server, for a dynamic dns service. sounds pretty easy for me MH every time i have tried to grab some stuff from the database and check the MH login or domain permissions, I get stuck in a mess of ifs and whiles. what kind of ifs and whiles? well when i am looking below to see tables in db i think user will log in...then he will see only his domains (identified by user_id) and he need to be able to modify them, delete them etc...am I right? Hmmm what kind of keys?...i cant see any password or something like that in users table, only user_ids (probably auto_incrementing PK) and usernames...hmmm MH can anyone give me an idead on the best method/starting place. MH my database looks like this: MH users -- pairs of usernames/user_ids MH domains -- matches domainnames/domain_ids/passkeys to user_ids MH records -- all the dns records. not got to this point yet. -- Best regards, Martinmailto:corwin;corwin.sk -- Mat Harris OpenGPG Public Key ID: C37D57D9 [EMAIL PROTECTED]matthewh.genestate.com pdnstest.gz Description: application/gunzip msg83355/pgp0.pgp Description: PGP signature
RE: [PHP] Unsetting Session Variables
-Original Message- From: David Russell [mailto:DavidR;BarloworldOptimus.com] Sent: 30 October 2002 14:32 I am having problems unsetting Session Variables - where I know it should work. I have a form. It contains both links with GET variables, and also a POST form. They all go to the same next page. Page 2 simply clears all session variables, and then sets them based upon the contents of the GET or POST array. It then calls page 3 which displays information based on the SESSION variable contents. My problem is that a session variable does not seem to unset. I am using: unset ($_SESSION['variablename']); But this does not seem to destroy the session variable. (it is still available later in other scripts) What can I do? PHP version? register_globals on or off? Using only $_SESSION, or are there any session_register() calls? All of these can affect what you have to do to destroy session values, but... Have you tried doing session_unregister('variablename') *in* *addition*? Does session_write_close() help? Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] File Random Access
-Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: 30 October 2002 14:35 You are correct. In fact, simply r+ works; I just tried it. Thanks Yes, but that's not guaranteed to be binary-safe on Windows -- if your data happens to include null bytes, you might get unexpected file truncations (I think...)! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] database stuff and conditions
there is no real hurry on the app but obviously I can't afford the lay down on the job. i would appreciate the help and especciallu the comments, but only if you are sure you have the time. this is the sort of options the user would have: sign up user login create domain delete domain administer domain update one A, one CNAME and one MX record they shouldn't have control to add unlimited records, but maybe a way to allow certain users to have certain limits. I hope I am not askin too much, just say the word and we'll drop it. thanks for all your help mat On Wed, Oct 30, 2002 at 04:08:05 +0100, Martin Hudec wrote: Hello Mat, I would recommend to not use passkeys in domains...rather in per user basis...it is better...one user can administer various domains i think..he will have to remember many passwordsor even if they are the same...you make passs key for each record in domain tableso more data storedhmmm...okay i am going home now,...will wait for while for your new mail...how fast you need this app to be done? I can make you whole app if you want...also ill include comments for you to see on things...just how fast you need it...and ..when user logs in he only needs to create, update and delete records right? anyway thanks for sql dump, itll help a lot :) -- Best regards, Martinmailto:corwin;corwin.sk Wednesday, October 30, 2002, 3:55:28 PM, you wrote: MH attached is a dump of the mysql database. The passkeys are not on a per user MH basis, but rather per domain. this can change if that is not good. -- Mat Harris OpenGPG Public Key ID: C37D57D9 [EMAIL PROTECTED]matthewh.genestate.com msg83358/pgp0.pgp Description: PGP signature
Re: [PHP] database stuff and conditions
Why domains.domain_id and users.user_id are not auto_increment? Mat Harris wrote: attached is a dump of the mysql database. The passkeys are not on a per user basis, but rather per domain. this can change if that is not good. On Wed, Oct 30, 2002 at 03:36:58 +0100, Martin Hudec wrote: Hello Mat, MH hi, i am a competant perl programmer of nearly a year and a half and I have MH just this week started looking at php. I am the same but reversed ;)...just started perl :) MH I am trying to write a couple of webpages that will allow me to update a MH mysql database which is powering a dns server, for a dynamic dns service. sounds pretty easy for me MH every time i have tried to grab some stuff from the database and check the MH login or domain permissions, I get stuck in a mess of ifs and whiles. what kind of ifs and whiles? well when i am looking below to see tables in db i think user will log in...then he will see only his domains (identified by user_id) and he need to be able to modify them, delete them etc...am I right? Hmmm what kind of keys?...i cant see any password or something like that in users table, only user_ids (probably auto_incrementing PK) and usernames...hmmm MH can anyone give me an idead on the best method/starting place. MH my database looks like this: MH users -- pairs of usernames/user_ids MH domains -- matches domainnames/domain_ids/passkeys to user_ids MH records -- all the dns records. not got to this point yet. -- Best regards, Martinmailto:corwin;corwin.sk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] regular expressions question
I have a little question. I'm having some difficulty with regular expressions: here it is: (this)example should be output in an array [0]= this [1]= thisexample I'm supposing this should be done with preg_grep, but I'm not really familiar with some of it's syntax for the regular expression. I could use some ideas, cheers, Simon
Re: [PHP] regular expressions question
$str = (this)example; preg_match(/\((.*?)\)(.*)/,$str,$regs); $a[0] = $regs[1]; $a[1] = $regs[1].$regs[2]; On Wed, 30 Oct 2002, Simon Dedeyne wrote: I have a little question. I'm having some difficulty with regular expressions: here it is: (this)example should be output in an array [0]= this [1]= thisexample I'm supposing this should be done with preg_grep, but I'm not really familiar with some of it's syntax for the regular expression. I could use some ideas, cheers, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regular expressions question
If I understand you correctly, I think you want this? $matches = array(); $test = (this)example; preg_match(/\((.*)\)(.*)/, $test, $matches); array_shift($matches); On Wed, 30 Oct 2002, Simon Dedeyne wrote: I have a little question. I'm having some difficulty with regular expressions: here it is: (this)example should be output in an array [0]= this [1]= thisexample I'm supposing this should be done with preg_grep, but I'm not really familiar with some of it's syntax for the regular expression. I could use some ideas, cheers, Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regular expressions question
Whoops.. I missed one bit. Rasmus did it right. ;) On Wed, 30 Oct 2002 [EMAIL PROTECTED] wrote: If I understand you correctly, I think you want this? $matches = array(); $test = (this)example; preg_match(/\((.*)\)(.*)/, $test, $matches); array_shift($matches); On Wed, 30 Oct 2002, Simon Dedeyne wrote: I have a little question. I'm having some difficulty with regular expressions: here it is: (this)example should be output in an array [0]= this [1]= thisexample I'm supposing this should be done with preg_grep, but I'm not really familiar with some of it's syntax for the regular expression. I could use some ideas, cheers, Simon -- 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] Unsetting Session Variables
PHP 4.2.2 Register Globals Off Using only $_SESSION No session_register() calls at all Interestingly enough, doing session_unregister('variablename') *in* *addition* does work (although I am sure it shouldn't) session_write_close() does not help Any suggestions? -Original Message- From: David Russell [mailto:DavidR;BarloworldOptimus.com] Sent: 30 October 2002 14:32 I am having problems unsetting Session Variables - where I know it should work. I have a form. It contains both links with GET variables, and also a POST form. They all go to the same next page. Page 2 simply clears all session variables, and then sets them based upon the contents of the GET or POST array. It then calls page 3 which displays information based on the SESSION variable contents. My problem is that a session variable does not seem to unset. I am using: unset ($_SESSION['variablename']); But this does not seem to destroy the session variable. (it is still available later in other scripts) What can I do? PHP version? register_globals on or off? Using only $_SESSION, or are there any session_register() calls? All of these can affect what you have to do to destroy session values, but... Have you tried doing session_unregister('variablename') *in* *addition*? Does session_write_close() help? Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 smime.p7s Description: application/pkcs7-signature
[PHP] session vs. header
Can someone tell me why I can't have $_SESSION['foo'] = 'content of foo'; following by header('Location: http://www.mysite.com'); Someone from www.php.net told me that it can confuse browser (http://bugs.php.net/19991). But, still I can't the idea why it can happen. Does register session means sending a 'header: location' too? Thanks. = Regards, mahara __ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unsetting Session Variables
-Original Message- From: David Russell [mailto:DavidR;BarloworldOptimus.com] Sent: 30 October 2002 15:30 To: 'Ford, Mike [LSS]' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Unsetting Session Variables PHP 4.2.2 Register Globals Off Using only $_SESSION No session_register() calls at all Interestingly enough, doing session_unregister('variablename') *in* *addition* does work (although I am sure it shouldn't) Yes, that's my interpretation, too -- but if doing the wrong thing gets the right answer, go for it! (Just be aware it might be different in 4.3!) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newbie question, open file error
hi, i hope im sending this to the correct place. im getting this error (below) when i run a script on my server. Im assuming I need to communicate with my admin about permissions, but im not 100% sure what the permission is. I'm basically trying to create an html file. if anyone can give me some advice as to where the error lies, i would greatly appreciate it. thanks, jennifer Warning: fopen(1037202617.html,w+) - Permission denied in /home/villany2k1/www.villany2k1.com/htdocs/ecards/index.php3 on line 157 · · · jv : www.whitenoisemachine.net : 201-776-8511 : visual energy specialist - Do you Yahoo!? HotJobs - Search new jobs daily now
[PHP] Mutiple header statements?
Why doesn't this work? ? if ($_POST['var'] == this) { header(Location: scipt1.php); } if ($_POST['var'] == that) { header(Location: script2.php); } ? If I select that from the form submitting the value to var I get a header already sent error. There is nothing else above these statments in my script. Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mutiple header statements?
Not sure if this is what you're looking for, but a possible solution could be: ? if ($_POST['var'] == this) $page = script1; if ($_POST['var'] == that) $page = script2; header(Location: $page.php); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mutiple header statements?
? if ($_POST['var'] == this) { header(Location: scipt1.php); exit;} if ($_POST['var'] == that) { header(Location: script2.php); exit; } ? - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 6:25 AM Subject: [PHP] Mutiple header statements? Why doesn't this work? If I select that from the form submitting the value to var I get a header already sent error. There is nothing else above these statments in my script. Thanks, Ed -- 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] array question
When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST[interests[]]; or $arrInterests = $_POST[interests]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unsetting Session Variables
I have noticed this behavior before, and I find it very inconsistent. Does anybody know if this is going to be fixed? Ford, Mike [LSS] wrote: -Original Message- From: David Russell [mailto:DavidR;BarloworldOptimus.com] Sent: 30 October 2002 15:30 To: 'Ford, Mike [LSS]' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Unsetting Session Variables PHP 4.2.2 Register Globals Off Using only $_SESSION No session_register() calls at all Interestingly enough, doing session_unregister('variablename') *in* *addition* does work (although I am sure it shouldn't) Yes, that's my interpretation, too -- but if doing the wrong thing gets the right answer, go for it! (Just be aware it might be different in 4.3!) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array question
What happened when you tried both methods? - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:29 AM Subject: [PHP] array question When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST[interests[]]; or $arrInterests = $_POST[interests]; -- 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] newbie question, open file error
You might be able to solve this yourself, connect using ftp and try chmod o+w directory, where directory is the directory that you want to write to. [EMAIL PROTECTED] wrote: hi, i hope im sending this to the correct place. im getting this error (below) when i run a script on my server. Im assuming I need to communicate with my admin about permissions, but im not 100% sure what the permission is. I'm basically trying to create an html file. if anyone can give me some advice as to where the error lies, i would greatly appreciate it. thanks, jennifer Warning: fopen(1037202617.html,w+) - Permission denied in /home/villany2k1/www.villany2k1.com/htdocs/ecards/index.php3 on line 157 · · · jv : www.whitenoisemachine.net : 201-776-8511 : visual energy specialist - Do you Yahoo!? HotJobs - Search new jobs daily now -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] array question
Either way, I'm not getting the interests. -Original Message- From: Rick Emery [mailto:remery;emeryloftus.com] Sent: Wednesday, October 30, 2002 9:34 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] array question What happened when you tried both methods? - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:29 AM Subject: [PHP] array question When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST[interests[]]; or $arrInterests = $_POST[interests]; -- 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
Re: [PHP] array question
What does you HTML look like? - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:36 AM Subject: RE: [PHP] array question Either way, I'm not getting the interests. -Original Message- From: Rick Emery [mailto:remery;emeryloftus.com] Sent: Wednesday, October 30, 2002 9:34 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] array question What happened when you tried both methods? - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:29 AM Subject: [PHP] array question When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST[interests[]]; or $arrInterests = $_POST[interests]; -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SAP documentation
I'm interested in the possibility of interfacing with SAP for a project using PHP or Perl. I've not found any documentation that might help yet: Can anyone point me in the direction of any help? I've only used PHP with MySQL to date. Thanks, Mick e-ssociate EPSON (UK) Ltd. Tel 01442 227374 www.epson.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML and XLS Sablotron
Dear all, I am just approaching to XML and I would need some explanation, which most of you will probably consider very trivial. I have read about the XLS Sablotron functions, which are able to apply XLS stylesheets to an XML document. My question is: if my aim is to apply to an XML document an XLS stylesheet server-side (being able in this way to avoid browsers incompatibilies) with PHP, which could it be my need to use SAX or DOM parsers? Could XLS Sablotron be seen as an alternative to SAX or DOM, or does in some ways rely on these technologies? Really thanks to whom will be able to clarify me on this. Daniele -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array question
Hello, John Meyer [EMAIL PROTECTED] wrote: Either way, I'm not getting the interests. ...[snip]... When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST[interests[]]; or $arrInterests = $_POST[interests]; Try this instead: $arrInterests = $_POST['interests']; - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mutiple header statements?
On Wed, 30 Oct 2002, Rick Emery wrote: ? if ($_POST['var'] == this) { header(Location: scipt1.php); exit;} if ($_POST['var'] == that) { header(Location: script2.php); exit; } Nope, I still get a header already sent error if I choose that. Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Yahoo Moving to PHP (seen on slashdot)
Sounds interesting. Is there any other official info about it somewhere? -- Maxim Maletsky [EMAIL PROTECTED] www.PHPBeginner.com // PHP for Beginners www.maxim.cx // my Home // my Wish List: ( Get me something! ) http://www.amazon.com/exec/obidos/registry/2IXE7SMI5EDI3 Philip Hallstrom [EMAIL PROTECTED] wrote... : Figured this was important enough to share... Yahoo Moving to PHP http://developers.slashdot.org/article.pl?sid=02/10/29/2052239mode=threadtid=169 Erek Dyskant writes Yahoo has decided to switch from a proprietary system written in C/C++ to PHP for their backend scripting. Here's the notes from a presentation by a Yahoo engineer at PHP Con 2002. http://public.yahoo.com/~radwin/talks/yahoo-phpcon2002.htm -- 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] Mutiple header statements?
I suppose this is just an excerpt, could you paste some more code here? [EMAIL PROTECTED] wrote: On Wed, 30 Oct 2002, Rick Emery wrote: ? if ($_POST['var'] == this) { header(Location: scipt1.php); exit;} if ($_POST['var'] == that) { header(Location: script2.php); exit; } Nope, I still get a header already sent error if I choose that. Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mutiple header statements?
On Wed, 30 Oct 2002 [EMAIL PROTECTED] wrote: Not sure if this is what you're looking for, but a possible solution could be: ? if ($_POST['var'] == this) $page = script1; if ($_POST['var'] == that) $page = script2; header(Location: $page.php); } ? This could be an option if neither of the if's matched it could continue with additional scripting below these conditions without getting sent a header. Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mutiple header statements?
On Wed, 30 Oct 2002, Rick Emery wrote: ? if ($_POST['var'] == this) { header(Location: scipt1.php); exit;} if ($_POST['var'] == that) { header(Location: script2.php); exit; } Nope, I still get a header already sent error if I choose that. WHAT IS THE ERROR?? It tells you _exactly_ in the header error message where the output was started. Look on or near that line because it caused some output to the browser and now headers cannot be sent. ---John Holmes.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unsetting Session Variables
I can't say that I've noticed this in 4.2.3. I just wrote an application where all I used was $_SESSION and unset() and it worked perfectly. ---John Holmes... - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 11:34 AM Subject: Re: [PHP] Unsetting Session Variables I have noticed this behavior before, and I find it very inconsistent. Does anybody know if this is going to be fixed? Ford, Mike [LSS] wrote: -Original Message- From: David Russell [mailto:DavidR;BarloworldOptimus.com] Sent: 30 October 2002 15:30 To: 'Ford, Mike [LSS]' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Unsetting Session Variables PHP 4.2.2 Register Globals Off Using only $_SESSION No session_register() calls at all Interestingly enough, doing session_unregister('variablename') *in* *addition* does work (although I am sure it shouldn't) Yes, that's my interpretation, too -- but if doing the wrong thing gets the right answer, go for it! (Just be aware it might be different in 4.3!) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- 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] session vs. header
Can someone tell me why I can't have $_SESSION['foo'] = 'content of foo'; following by header('Location: http://www.mysite.com'); Someone from www.php.net told me that it can confuse browser (http://bugs.php.net/19991). But, still I can't the idea why it can happen. Does register session means sending a 'header: location' too? What is your exact code? I do this all the time and don't have any trouble with it. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mutiple header statements?
On Wed, 30 Oct 2002, Marek Kilimajer wrote: I suppose this is just an excerpt, could you paste some more code here? [EMAIL PROTECTED] wrote: On Wed, 30 Oct 2002, Rick Emery wrote: ? if ($_POST['var'] == this) { header(Location: scipt1.php); exit;} if ($_POST['var'] == that) { header(Location: script2.php); exit; } My original code is: ? if ($_POST['var'] == this) { header(Location: script1.php); } if ($_POST['var'] == that) { header(Location: script2.php): } ? Stuff to do here if neither of these conditions match. What I'm trying to accomplish here is to check the value of a variable against these two conditions at the very top of my script. If any one condition matches is sends the user to it's respective script as defined above. If neither of these conditions match it continues on with the script. I'm getting header already sent errors if I choose the variable that makes the second condition true. It works just fine If I choose to make the first condition true or choose to make both conditions false. Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array question
A very important question indeed :) form method='POST'... input type=text name=interests[] input type=text name=interests[] print $_POST['interests'][0]; print $_POST['interests'][1]; input type=text name=interests[foo] input type=text name=interests[bar] print $_POST['interests']['foo']; print $_POST['interests']['bar']; Read the manual section on arrays for more information on using them. http://www.php.net/manual/en/language.types.array.php Regards, Philip On Wed, 30 Oct 2002, Rick Emery wrote: What does you HTML look like? - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:36 AM Subject: RE: [PHP] array question Either way, I'm not getting the interests. -Original Message- From: Rick Emery [mailto:remery;emeryloftus.com] Sent: Wednesday, October 30, 2002 9:34 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] array question What happened when you tried both methods? - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:29 AM Subject: [PHP] array question When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST[interests[]]; or $arrInterests = $_POST[interests]; -- 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 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] Tricky sorting problem
(Well, at least it's tricky for me... :-) I need to sort an array based on three numbers that are situated in the middle of each array element. For example: $list[] is an array, and contains the following [unsorted] elements: Super-S862-030.jpg Super-S1162-040.jpg Super-S874-010.jpg Super-S1174-020.jpg I want to sort $list based on those last three numbers, just before the extension, so that the new sort order is: Super-S874-010.jpg Super-S1174-020.jpg Super-S862-030.jpg Super-S1162-040.jpg I tried writing my own sort function--but can't seem to get anywhere with it: function cmp ($a,$b) { if (substr($a,-5,2) == substr($b,-5,2)) return 0; return (substr($a,-5,2) substr($b,-5,2)) ? -1 : 1 ; } usort($list,cmp); Any ideas? (Thanks.) ...Rene --- René Fournier, [EMAIL PROTECTED] Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mutiple header statements?
WHAT IS THE ERROR?? It tells you _exactly_ in the header error message where the output was started. Look on or near that line because it caused some output to the browser and now headers cannot be sent. ---John Holmes.. Here's the code: ? if ($_POST['county'] == Lots) { header(Location: lotland1.php); exit; } ? ? if ($_POST['county'] == Land and Acreage) { header(Location: lotland2.php); exit; } ? font face=Arial,Helvetica size=+1 color=red and on from here Here's the error: Warning: Cannot add header information - headers already sent by (output started at script.php:4) in script.php on line 5 Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mutiple header statements?
You have an empty line there, get rid of the ? ? pair [EMAIL PROTECTED] wrote: WHAT IS THE ERROR?? It tells you _exactly_ in the header error message where the output was started. Look on or near that line because it caused some output to the browser and now headers cannot be sent. ---John Holmes.. Here's the code: ? if ($_POST['county'] == Lots) { header(Location: lotland1.php); exit; } ? ? if ($_POST['county'] == Land and Acreage) { header(Location: lotland2.php); exit; } ? font face=Arial,Helvetica size=+1 color=red and on from here Here's the error: Warning: Cannot add header information - headers already sent by (output started at script.php:4) in script.php on line 5 Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question, open file error
Give it a try, that's the way I do it. jennifer villany wrote: hi, thanks for your feedback. chmod is greyed out in my ftp client. im using smart ftp. can i make these changes at the command line? thanks again, jennifer Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... You might be able to solve this yourself, connect using ftp and try chmod o+w directory, where directory is the directory that you want to write to. [EMAIL PROTECTED] wrote: hi, i hope im sending this to the correct place. im getting this error (below) when i run a script on my server. Im assuming I need to communicate with my admin about permissions, but im not 100% sure what the permission is. I'm basically trying to create an html file. if anyone can give me some advice as to where the error lies, i would greatly appreciate it. thanks, jennifer Warning: fopen(1037202617.html,w+) - Permission denied in /home/villany2k1/www.villany2k1.com/htdocs/ecards/index.php3 on line 157 · · · jv : www.whitenoisemachine.net : 201-776-8511 : visual energy specialist - Do you Yahoo!? HotJobs - Search new jobs daily now -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Tricky sorting problem
the -5 should be -7 René Fournier wrote: (Well, at least it's tricky for me... :-) I need to sort an array based on three numbers that are situated in the middle of each array element. For example: $list[] is an array, and contains the following [unsorted] elements: Super-S862-030.jpg Super-S1162-040.jpg Super-S874-010.jpg Super-S1174-020.jpg I want to sort $list based on those last three numbers, just before the extension, so that the new sort order is: Super-S874-010.jpg Super-S1174-020.jpg Super-S862-030.jpg Super-S1162-040.jpg I tried writing my own sort function--but can't seem to get anywhere with it: function cmp ($a,$b) { if (substr($a,-5,2) == substr($b,-5,2)) return 0; return (substr($a,-5,2) substr($b,-5,2)) ? -1 : 1 ; } usort($list,cmp); Any ideas? (Thanks.) ...Rene --- René Fournier, [EMAIL PROTECTED] Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mutiple header statements?
On Wed, 30 Oct 2002, Marek Kilimajer wrote: You have an empty line there, get rid of the ? ? pair That did it!! I didn't know a blank line inside php tags would be interpeted as output. Thanks! Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mutiple header statements?
See? If you had just started with your actual code and the actual error, we'd of solved this by now. ---John Holmes... -Original Message- From: Marek Kilimajer [mailto:kilimajer;webglobe.sk] Sent: Wednesday, October 30, 2002 12:37 PM To: PHP Subject: Re: [PHP] Mutiple header statements? You have an empty line there, get rid of the ? ? pair [EMAIL PROTECTED] wrote: WHAT IS THE ERROR?? It tells you _exactly_ in the header error message where the output was started. Look on or near that line because it caused some output to the browser and now headers cannot be sent. ---John Holmes.. Here's the code: ? if ($_POST['county'] == Lots) { header(Location: lotland1.php); exit; } ? ? if ($_POST['county'] == Land and Acreage) { header(Location: lotland2.php); exit; } ? font face=Arial,Helvetica size=+1 color=red and on from here Here's the error: Warning: Cannot add header information - headers already sent by (output started at script.php:4) in script.php on line 5 Ed -- 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] Mutiple header statements?
It's not inside PHP tags, look at your code again. You have two PHP blocks with a blank line between them. ---John Holmes... -Original Message- From: [EMAIL PROTECTED] [mailto:ed;home.homes2see.com] Sent: Wednesday, October 30, 2002 8:49 AM To: Marek Kilimajer Cc: PHP Subject: Re: [PHP] Mutiple header statements? On Wed, 30 Oct 2002, Marek Kilimajer wrote: You have an empty line there, get rid of the ? ? pair That did it!! I didn't know a blank line inside php tags would be interpeted as output. Thanks! Ed -- 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] Tricky sorting problem
...and the 2 should be 3 :) - E Marek Kilimajer [EMAIL PROTECTED] wrote: the -5 should be -7 René Fournier wrote: (Well, at least it's tricky for me... :-) I need to sort an array based on three numbers that are situated in the middle of each array element. For example: $list[] is an array, and contains the following [unsorted] elements: Super-S862-030.jpg Super-S1162-040.jpg Super-S874-010.jpg Super-S1174-020.jpg I want to sort $list based on those last three numbers, just before the extension, so that the new sort order is: Super-S874-010.jpg Super-S1174-020.jpg Super-S862-030.jpg Super-S1162-040.jpg I tried writing my own sort function--but can't seem to get anywhere with it: function cmp ($a,$b) { if (substr($a,-5,2) == substr($b,-5,2)) return 0; return (substr($a,-5,2) substr($b,-5,2)) ? -1 : 1 ; } usort($list,cmp); Any ideas? (Thanks.) ...Rene --- René Fournier, [EMAIL PROTECTED] Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada -- 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] Mutiple header statements?
Hello, [EMAIL PROTECTED] wrote: On Wed, 30 Oct 2002, Marek Kilimajer wrote: You have an empty line there, get rid of the ? ? pair That did it!! I didn't know a blank line inside php tags would be interpeted as output. ...because it was *outside*... :) - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mutiple header statements?
You're right again as usual Oh List God. Sorry about that. I love this list!! On Wed, 30 Oct 2002, John W. Holmes wrote: It's not inside PHP tags, look at your code again. You have two PHP blocks with a blank line between them. ---John Holmes... -Original Message- From: [EMAIL PROTECTED] [mailto:ed;home.homes2see.com] Sent: Wednesday, October 30, 2002 8:49 AM To: Marek Kilimajer Cc: PHP Subject: Re: [PHP] Mutiple header statements? On Wed, 30 Oct 2002, Marek Kilimajer wrote: You have an empty line there, get rid of the ? ? pair That did it!! I didn't know a blank line inside php tags would be interpeted as output. Thanks! Ed -- 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] Tricky sorting problem
Yes, and 2 should be 3 Marek Kilimajer wrote: the -5 should be -7 René Fournier wrote: (Well, at least it's tricky for me... :-) I need to sort an array based on three numbers that are situated in the middle of each array element. For example: $list[] is an array, and contains the following [unsorted] elements: Super-S862-030.jpg Super-S1162-040.jpg Super-S874-010.jpg Super-S1174-020.jpg I want to sort $list based on those last three numbers, just before the extension, so that the new sort order is: Super-S874-010.jpg Super-S1174-020.jpg Super-S862-030.jpg Super-S1162-040.jpg I tried writing my own sort function--but can't seem to get anywhere with it: function cmp ($a,$b) { if (substr($a,-5,2) == substr($b,-5,2)) return 0; return (substr($a,-5,2) substr($b,-5,2)) ? -1 : 1 ; } usort($list,cmp); Any ideas? (Thanks.) ...Rene --- René Fournier, [EMAIL PROTECTED] Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Tricky sorting problem
I need to sort an array based on three numbers that are situated in the middle of each array element. For example: $list[] is an array, and contains the following [unsorted] elements: Super-S862-030.jpg Super-S1162-040.jpg Super-S874-010.jpg Super-S1174-020.jpg I want to sort $list based on those last three numbers, just before the extension, so that the new sort order is: Super-S874-010.jpg Super-S1174-020.jpg Super-S862-030.jpg Super-S1162-040.jpg Maybe something like this? foreach($list as $k = $v) { $p = explode('-',$v); $new_list[$p[2]] = $v; } ksort($new_list); reset($new_list); $new_list will have the XXX number as the key of the array element and the name of the file corresponding to the number as it's value. If that won't work, let us know. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mutiple header statements?
That why I say COPYPASTE your code, if you write it from memory you may even fix the problem yourself and don't know about it. The code you wrote first had nothing wrong in it. [EMAIL PROTECTED] wrote: On Wed, 30 Oct 2002, Marek Kilimajer wrote: You have an empty line there, get rid of the ? ? pair That did it!! I didn't know a blank line inside php tags would be interpeted as output. Thanks! Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Tricky sorting problem
It works! Thanks. On Wednesday, October 30, 2002, at 10:50 AM, @ Edwin wrote: ...and the 2 should be 3 :) - E Marek Kilimajer [EMAIL PROTECTED] wrote: the -5 should be -7 René Fournier wrote: (Well, at least it's tricky for me... :-) I need to sort an array based on three numbers that are situated in the middle of each array element. For example: $list[] is an array, and contains the following [unsorted] elements: Super-S862-030.jpg Super-S1162-040.jpg Super-S874-010.jpg Super-S1174-020.jpg I want to sort $list based on those last three numbers, just before the extension, so that the new sort order is: Super-S874-010.jpg Super-S1174-020.jpg Super-S862-030.jpg Super-S1162-040.jpg I tried writing my own sort function--but can't seem to get anywhere with it: function cmp ($a,$b) { if (substr($a,-5,2) == substr($b,-5,2)) return 0; return (substr($a,-5,2) substr($b,-5,2)) ? -1 : 1 ; } usort($list,cmp); Any ideas? (Thanks.) ...Rene --- René Fournier, [EMAIL PROTECTED] Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada -- 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 --- René Fournier, [EMAIL PROTECTED] Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dazed and Confused
For some reason my brain is not operating within normal parameters this week. $myarray[test] = sd; echo $myarray[0]; Why will nothing echo? Do I somehow have to initialize indexing on the array $myarray? php says that $myarray is an array, but I can't access it with numeric indexes. I know if I do this: $myarray = array(test=sd); that I can now echo $myarray[0] and get the value of sd returned.
Re: [PHP] XML and XLS Sablotron
Basically SAX and DOM are for parsing xml and xslt is for transforming xml into html, svg, wml, pdf and the like. So it sounds like you want to use xslt. Daniele Baroncelli wrote: Dear all, I am just approaching to XML and I would need some explanation, which most of you will probably consider very trivial. I have read about the XLS Sablotron functions, which are able to apply XLS stylesheets to an XML document. My question is: if my aim is to apply to an XML document an XLS stylesheet server-side (being able in this way to avoid browsers incompatibilies) with PHP, which could it be my need to use SAX or DOM parsers? Could XLS Sablotron be seen as an alternative to SAX or DOM, or does in some ways rely on these technologies? Really thanks to whom will be able to clarify me on this. Daniele -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dazed and Confused
Because you haven't put anything in array index 0. The only array index that has anything is test. There is no difference between numeric and string indices. You seem to be assuming that somehow the first element in an array can always be accessed as index 0 which is not the case and never has been. -Rasmus On Wed, 30 Oct 2002, PHP List wrote: For some reason my brain is not operating within normal parameters this week. $myarray[test] = sd; echo $myarray[0]; Why will nothing echo? Do I somehow have to initialize indexing on the array $myarray? php says that $myarray is an array, but I can't access it with numeric indexes. I know if I do this: $myarray = array(test=sd); that I can now echo $myarray[0] and get the value of sd returned. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dazed and Confused
Hello, PHP List [EMAIL PROTECTED] wrote: For some reason my brain is not operating within normal parameters this week. $myarray[test] = sd; echo $myarray[0]; Why will nothing echo? Do I somehow have to initialize indexing on the array $myarray? php says that $myarray is an array, but I can't access it with numeric indexes. That's because your $myarray was set using strings... I know if I do this: $myarray = array(test=sd); that I can now echo $myarray[0] and get the value of sd returned. Are you sure? Try it :) - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML Post
I used a similar script and had the same problem I'm having with yours. The first few lines returned in the '$response' variable are the headers from the POST operation. When I get to the 'print' command at the end I get the headers generated by my server, then the headers retrieved from the POST operation are displayed on the page. Is this because of how I have my server configured? Or is there some run-tim way to tell the server to *not* generate headers, but simply send the specified text (including the headers) to the browser? Drew Kime -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: XML and XLS Sablotron
You'll need the SAX or DOM functions if you will be /generating/ your XML. I suppose, you mean, generating XML from another XML document, am I right? The Sablotron extension (and other XSLT processors) take XML and XSLT and output whatever your XSLT tells it to. The XSLT processor depends on getting well-formed XML and XSLT and that's where the DOM functions come in. Technically, you could use the DOM functions to build an XML document, use them to build an XSLT stylesheet and then send those two generated items through the XSLT processor to build HTML. So, if I well understood, in case you simply want to manually write XML documents and XSLT stylesheets, and then have the PHP (Sablotron in the specific) to make the produce your HTML from it, you don't need SAX or DOM. Is this correct, or am I missing something? Does this mean that you only need SAX or DOM if you want to convert an XML format to another XML format? Really thanks Daniele -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php web hosting
Anyone like to recommend a good host with good uptime for a high traffic site? The host would need excellent technical support as well as be feature rich (Multiple MySQL database support/listserver/SSL support etc.) I have been trying out phpwebhosting.com and they seem very good but I am not happy with their technical support which is very slow response time. We are based in Europe and they are in the US which might lead to problems as they haven't answered any of our queries. Saying that they have a good automated process in place which is easy to use. Anyone out there have high volume sites with a feature rich hosting solution? Any examples of Phpwebhosting welcomed as well. regards steve.
RE: [PHP] Php web hosting
Anyone out there have high volume sites with a feature rich hosting solution? I'd be interested, too, but especially in the free ones. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dazed and Confused
On Wed, 30 Oct 2002, PHP List wrote: So are you saying there really is no array pointer? Lets say I have an array with several different values like: $myarray[a] = s; $myarray[3] = d; $myarray[sdf] = y; There is no way of saying give me the value in the array at position 2? Since the size of the array is returned as 3, should there not be a way of doing this? There is an array pointer. It is manipulated using the various iteration functions. reset($myarray); echo next($myarray); would give you the value at the second position. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session vs. header
huge junk mail wrote: Can someone tell me why I can't have $_SESSION['foo'] = 'content of foo'; following by header('Location: http://www.mysite.com'); Someone from www.php.net told me that it can confuse browser (http://bugs.php.net/19991). But, still I can't the idea why it can happen. Does register session means sending a 'header: location' too? no, sessions never send location headers, they may send cookies but not location. -js Thanks. = Regards, mahara __ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Dazed and Confused
Yes... for the most part... think about it this way... (and please correct me if I'm wrong :) An associative array isn't ordered. It's key based. Think of it like a dictionary, but one whose first and last several pages have been removed. You wouldn't have any way of telling me the definition for the 100th word since you don't know. But you can tell me the definition of foo is by looking it up directly. And you're not guaranteed anything about their order since, well, they don't have any order :) I know that in PHP you can do: $ary[y] = two; $ary[x] = one; print_r($ary); and you'll get back: Array ( [y] = two [x] = one ) but you're not *guaranteed* to get it back in the same order you supplied it. It just happens that you do in PHP. Back when I used Perl you wouldn't necessarily get the same order repeatedly. hope this helps. On Wed, 30 Oct 2002, PHP List wrote: So are you saying there really is no array pointer? Lets say I have an array with several different values like: $myarray[a] = s; $myarray[3] = d; $myarray[sdf] = y; There is no way of saying give me the value in the array at position 2? Since the size of the array is returned as 3, should there not be a way of doing this? Like I said, I seem to be blanking on arrays. Because you haven't put anything in array index 0. The only array index that has anything is test. There is no difference between numeric and string indices. You seem to be assuming that somehow the first element in an array can always be accessed as index 0 which is not the case and never has been. -Rasmus On Wed, 30 Oct 2002, PHP List wrote: For some reason my brain is not operating within normal parameters this week. $myarray[test] = sd; echo $myarray[0]; Why will nothing echo? Do I somehow have to initialize indexing on the array $myarray? php says that $myarray is an array, but I can't access it with numeric indexes. I know if I do this: $myarray = array(test=sd); that I can now echo $myarray[0] and get the value of sd returned. -- 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: Dazed and Confused
While that is a good way to approach arrays, you are actually guaranteed to get the array back in the order you added the elements in PHP. -Rasmus On Wed, 30 Oct 2002, Philip Hallstrom wrote: Yes... for the most part... think about it this way... (and please correct me if I'm wrong :) An associative array isn't ordered. It's key based. Think of it like a dictionary, but one whose first and last several pages have been removed. You wouldn't have any way of telling me the definition for the 100th word since you don't know. But you can tell me the definition of foo is by looking it up directly. And you're not guaranteed anything about their order since, well, they don't have any order :) I know that in PHP you can do: $ary[y] = two; $ary[x] = one; print_r($ary); and you'll get back: Array ( [y] = two [x] = one ) but you're not *guaranteed* to get it back in the same order you supplied it. It just happens that you do in PHP. Back when I used Perl you wouldn't necessarily get the same order repeatedly. hope this helps. On Wed, 30 Oct 2002, PHP List wrote: So are you saying there really is no array pointer? Lets say I have an array with several different values like: $myarray[a] = s; $myarray[3] = d; $myarray[sdf] = y; There is no way of saying give me the value in the array at position 2? Since the size of the array is returned as 3, should there not be a way of doing this? Like I said, I seem to be blanking on arrays. Because you haven't put anything in array index 0. The only array index that has anything is test. There is no difference between numeric and string indices. You seem to be assuming that somehow the first element in an array can always be accessed as index 0 which is not the case and never has been. -Rasmus On Wed, 30 Oct 2002, PHP List wrote: For some reason my brain is not operating within normal parameters this week. $myarray[test] = sd; echo $myarray[0]; Why will nothing echo? Do I somehow have to initialize indexing on the array $myarray? php says that $myarray is an array, but I can't access it with numeric indexes. I know if I do this: $myarray = array(test=sd); that I can now echo $myarray[0] and get the value of sd returned. -- 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] [Fwd: Problem about pear]
---BeginMessage--- Hello, My System is Redhat Linux 7.2... I can't to find where is the path of pear under the system... So, can you help me ? Thank a lots. Edward. ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Looking for good ZIP Code / Latitude / Longitude table
I've written a nice php/mysql site that let's you search for hospitals and community colleges by zip code. The search is built upon some math that figures out distances by a zip's lat and lon cords. My problem is that my current ZIP table (bout 42,000 rows) seems to be flawed. There are a ton of zip codes round california that have all the same lat and lons. There are other dups as well. So I'm looking for some new data. Does anyone know a good source for this type of info? Thanks, ~ Mike -- http://www.mikezornek.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Dazed and Confused
I think the fog is starting to clear, thanks for the help. I do have one more question: If I want to use array_walk in a class, how do I refer to a function in that class? Class MyClass { . . . function DoArrayStuff($item1, $key, $nMode) { echo $item1; } function SomeOtherFunction { . . $myarray already filled with, say, 5 items; array_walk($myarray,'DoArrayStuff',1); --- PHP error: DoArrayStuff() - function does not exist in . . . I have tried 'MyClass::DoArrayStuff', 'this-DoArrayStuff', '$this-DoArrayStuff' but none work. The only way I can seem to use DoArraySuff is to define the funcion seperate(outside) from the class, which seems kind of odd since the only time the function is needed is internally by this class. } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Fwd: Problem about pear]
try: 'locate PEAR' if it doesn't show up do 'updatedb' then 'locate PEAR' mine is /usr/lib/php/PEAR (Gentoo) -js [EMAIL PROTECTED] wrote: Subject: Problem about pear From: [EMAIL PROTECTED] Date: Thu, 31 Oct 2002 02:02:45 +0800 To: [EMAIL PROTECTED] Hello, My System is Redhat Linux 7.2... I can't to find where is the path of pear under the system... So, can you help me ? Thank a lots. Edward. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] parse error
Hello everybody, maybe I am dumb , I dunnow, I have a parse error here and I don't understand why : $fp=fopen(temp/$userfile_name[$i-1],w+); the error I get is : Parse error: parse error, expecting `']'' in D:\Data\WebSSL\tm\RFP\upload2.php on line 61 THANX !!! :((( == Cyrille ANDRES IT-Tools Technician Siemens Shared Services, LLC Travel Management 1650 Technology Drive,m/s 243 San Jose, CA 95110 phone: (408) 764-9250 fax: (408) 764-9258 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse error
try: $fp = fopen('temp/'.$userfile_name[($i-1)], w+); -js Andres, Cyrille wrote: Hello everybody, maybe I am dumb , I dunnow, I have a parse error here and I don't understand why : $fp=fopen(temp/$userfile_name[$i-1],w+); the error I get is : Parse error: parse error, expecting `']'' in D:\Data\WebSSL\tm\RFP\upload2.php on line 61 THANX !!! :((( == Cyrille ANDRES IT-Tools Technician Siemens Shared Services, LLC Travel Management 1650 Technology Drive,m/s 243 San Jose, CA 95110 phone: (408) 764-9250 fax: (408) 764-9258 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] parse error
thx, but I still have the same error I think I have a poltergheist in my computer !!! -Original Message- From: Jonathan Sharp [mailto:js-lists;sharpmedia.net] Sent: Wednesday, October 30, 2002 11:13 AM To: Andres, Cyrille Cc: PHP List; php Subject: Re: [PHP] parse error try: $fp = fopen('temp/'.$userfile_name[($i-1)], w+); -js Andres, Cyrille wrote: Hello everybody, maybe I am dumb , I dunnow, I have a parse error here and I don't understand why : $fp=fopen(temp/$userfile_name[$i-1],w+); the error I get is : Parse error: parse error, expecting `']'' in D:\Data\WebSSL\tm\RFP\upload2.php on line 61 THANX !!! :((( == Cyrille ANDRES IT-Tools Technician Siemens Shared Services, LLC Travel Management 1650 Technology Drive,m/s 243 San Jose, CA 95110 phone: (408) 764-9250 fax: (408) 764-9258 -- 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] parse error
You forgot ] somewhere before line 61, and maybe even something else. Andres, Cyrille wrote: thx, but I still have the same error I think I have a poltergheist in my computer !!! -Original Message- From: Jonathan Sharp [mailto:js-lists;sharpmedia.net] Sent: Wednesday, October 30, 2002 11:13 AM To: Andres, Cyrille Cc: PHP List; php Subject: Re: [PHP] parse error try: $fp = fopen('temp/'.$userfile_name[($i-1)], w+); -js Andres, Cyrille wrote: Hello everybody, maybe I am dumb , I dunnow, I have a parse error here and I don't understand why : $fp=fopen(temp/$userfile_name[$i-1],w+); the error I get is : Parse error: parse error, expecting `']'' in D:\Data\WebSSL\tm\RFP\upload2.php on line 61 THANX !!! :((( == Cyrille ANDRES IT-Tools Technician Siemens Shared Services, LLC Travel Management 1650 Technology Drive,m/s 243 San Jose, CA 95110 phone: (408) 764-9250 fax: (408) 764-9258 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse error
Show us a few lines of code before the line that the error message reports. Remember, the line in the error message is just where PHP figured out something was wrong. The cause could be anywhere before that line. ---John Holmes... - Original Message - From: Andres, Cyrille [EMAIL PROTECTED] To: Jonathan Sharp [EMAIL PROTECTED] Cc: PHP List [EMAIL PROTECTED]; php [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 2:21 PM Subject: RE: [PHP] parse error thx, but I still have the same error I think I have a poltergheist in my computer !!! -Original Message- From: Jonathan Sharp [mailto:js-lists;sharpmedia.net] Sent: Wednesday, October 30, 2002 11:13 AM To: Andres, Cyrille Cc: PHP List; php Subject: Re: [PHP] parse error try: $fp = fopen('temp/'.$userfile_name[($i-1)], w+); -js Andres, Cyrille wrote: Hello everybody, maybe I am dumb , I dunnow, I have a parse error here and I don't understand why : $fp=fopen(temp/$userfile_name[$i-1],w+); the error I get is : Parse error: parse error, expecting `']'' in D:\Data\WebSSL\tm\RFP\upload2.php on line 61 THANX !!! :((( == Cyrille ANDRES IT-Tools Technician Siemens Shared Services, LLC Travel Management 1650 Technology Drive,m/s 243 San Jose, CA 95110 phone: (408) 764-9250 fax: (408) 764-9258 -- 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] Re: Looking for good ZIP Code / Latitude / Longitude table
Hello, On 10/30/2002 04:03 PM, Michael Zornek wrote: I've written a nice php/mysql site that let's you search for hospitals and community colleges by zip code. The search is built upon some math that figures out distances by a zip's lat and lon cords. My problem is that my current ZIP table (bout 42,000 rows) seems to be flawed. There are a ton of zip codes round california that have all the same lat and lons. There are other dups as well. So I'm looking for some new data. Does anyone know a good source for this type of info? This class may be used to figure the coordinates of a location given the IP address of a computer (the user computer): http://www.phpclasses.org/netgeoclass -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php