Re: [PHP] Wrong time being displayed by PHP!
On Thu, Oct 18, 2012 at 2:12 AM, Ford, Mike m.f...@leedsmet.ac.uk wrote: From: underp...@gmail.com [mailto:underp...@gmail.com] On Behalf Of Richard S. Crawford Sent: 17 October 2012 19:29 To: PHP-General You can see the current output of the above code here: http://projectbench.extensiondlc.net Can I ask what the fix for this was? Because that URL is currently showing the following for me: 02:09:27 am America/Los_Angeles America/Los_Angeles Thu, 18 Oct 2012 02:09:27 -0700 Thu, 18 Oct 2012 09:09:27 + 1350551367 (-25200) Thu Oct 18 02:09:27 PDT 2012 Cheers! Mike Hi Mike, Sorry I took so long to answer. I've been out sick, and didn't have access to the resolution information until this morning. The server administrators wound up reinstalling the tzdata package and enabled time synchronization. -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
Re: [PHP] Wrong time being displayed by PHP!
On Tue, Oct 16, 2012 at 3:16 PM, Daniel Brown danbr...@php.net wrote: With regard to debugging your issue, it's extremely unlikely that it's PHP's fault, since no one else has the same issue. However, it does indeed sound as though there's a configuration mismatch or a bad setting of the system clock (as suggested earlier by myself and others). What's the output when you run the code below? ?php if (php_sapi_name() == 'cli') { define('NL',PHP_EOL); } else { define('NL','br/'.PHP_EOL); } echo date_default_timezone_get().NL; echo date('r').NL; echo gmdate('r').NL; echo time().' ('.date('Z').')'.NL; echo trim(`date`).NL; ? This is the output: America/Los_Angeles Tue, 16 Oct 2012 17:22:09 -0400 Tue, 16 Oct 2012 21:22:09 + 1350422529 (-14400) Tue Oct 16 17:22:09 EDT 2012 Is this a shared server, Rich? As shown, the admin configured the timezone of the machine to be EDT and set the clock right, but php.ini must be set to PDT. You can easily override this with a local php.ini file, an .htaccess directive, or by placing date_default_timezone_set() near the top of the code. You can see the current output of the above code here: http://projectbench.extensiondlc.net I've confirmed that the server is set to PDT. The value of date.timezone in php.ini is America/Los_Angeles, which should be (currently) -8 hours from UTC, but it looks like the PDT offset is only set to -4. Does that even make sense? -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
[PHP] Wrong time being displayed by PHP!
The value of date.timezone in php.ini is set to America/Los_Angeles. The local time is 11:02 a.m. Yet the output of date(h:i a e) is: 02:02 pm America/Los_Angeles which is three hours ahead of the real time. Why is this? What's going on? -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Twitter: http://twitter.com/underpope Facebook: http://www.facebook.com/underpope Google+: http://gplus.to/underpope
Re: [PHP] Wrong time being displayed by PHP!
I double checked the server time. It is set to America/Los_Angeles as well. On Tue, Oct 16, 2012 at 11:07 AM, Adam Richardson simples...@gmail.comwrote: On Tue, Oct 16, 2012 at 2:02 PM, Richard S. Crawford rich...@underpope.com wrote: The value of date.timezone in php.ini is set to America/Los_Angeles. The local time is 11:02 a.m. Yet the output of date(h:i a e) is: 02:02 pm America/Los_Angeles which is three hours ahead of the real time. Why is this? What's going on? The server's time could be wrong. Or, code somewhere could be (re)setting the timezone. Adam -- Nephtali: A simple, flexible, fast, and security-focused PHP framework http://nephtaliproject.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
Re: [PHP] Wrong time being displayed by PHP!
On Tue, Oct 16, 2012 at 12:42 PM, Enrico Lamperti z...@irken.com.ar wrote: You could try using date_default_timezone_set http://php.net/manual/en/function.date-default-timezone-set.php() in your script, instead. And if you don't need to care about DST, you can define a specific GMT offset http://www.php.net/manual/en/timezones.others.php. Hope it helps :) Hi Enrico, Thanks for the suggestion. Unfortunately the problem seems to be that PHP thinks the America/Los_Angeles timezone is the same as EDT. I'm not sure how to approach this issue. Richard On Tue, Oct 16, 2012 at 3:56 PM, Richard S. Crawford rscrawf...@mossroot.com wrote: I double checked the server time. It is set to America/Los_Angeles as well. On Tue, Oct 16, 2012 at 11:07 AM, Adam Richardson simples...@gmail.com wrote: On Tue, Oct 16, 2012 at 2:02 PM, Richard S. Crawford rich...@underpope.com wrote: The value of date.timezone in php.ini is set to America/Los_Angeles.. The local time is 11:02 a.m. Yet the output of date(h:i a e) is: 02:02 pm America/Los_Angeles which is three hours ahead of the real time. Why is this? What's going on? The server's time could be wrong. Or, code somewhere could be (re)setting the timezone. Adam -- Nephtali: A simple, flexible, fast, and security-focused PHP framework http://nephtaliproject.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com ) -- Enrico -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
Re: [PHP] Wrong time being displayed by PHP!
On Tue, Oct 16, 2012 at 2:05 PM, Daniel Brown danbr...@php.net wrote: On Tue, Oct 16, 2012 at 4:19 PM, Richard S. Crawford rscrawf...@mossroot.com wrote: Thanks for the suggestion. Unfortunately the problem seems to be that PHP thinks the America/Los_Angeles timezone is the same as EDT. I'm not sure how to approach this issue. Per list rules, just a gentle reminder: please don't top-post. Sorry about that. I was getting very frustrated with the issue, and I forgot. I'll be sure to keep it in mind. With regard to debugging your issue, it's extremely unlikely that it's PHP's fault, since no one else has the same issue. However, it does indeed sound as though there's a configuration mismatch or a bad setting of the system clock (as suggested earlier by myself and others). What's the output when you run the code below? ?php if (php_sapi_name() == 'cli') { define('NL',PHP_EOL); } else { define('NL','br/'.PHP_EOL); } echo date_default_timezone_get().NL; echo date('r').NL; echo gmdate('r').NL; echo time().' ('.date('Z').')'.NL; echo trim(`date`).NL; ? http://www.php.net/unsub.php This is the output: America/Los_Angeles Tue, 16 Oct 2012 17:22:09 -0400 Tue, 16 Oct 2012 21:22:09 + 1350422529 (-14400) Tue Oct 16 17:22:09 EDT 2012 -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
Re: [PHP] Friday - Return of Brain Teasers
Christopher Walken? Is that you? On Fri, Oct 5, 2012 at 10:43 AM, Daniel Brown danbr...@php.net wrote: About five-and-a-half years ago, we had a brainteasers thread going on[1]. Last year it was briefly resurrected[2], and both times got some good content and dialogue going. So I'd like to reprise the thread in 2012, as well. Those of you connected to me on Facebook (parasane) or Twitter (@oidk) might already have seen it, but a simple one to get things rolling: ?php require ++$cowbell; ? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
Re: [PHP] Re: MySQL and PHP weirdness - RESOLVED
This has been resolved. A previous programmer had snuck in a function that would convert the value of the description field to a date value if it contained the word Date. This has been fixed. On Tue, Feb 14, 2012 at 5:44 PM, David Robley robl...@aapt.net.au wrote: Richard S. Crawford wrote: Bear with me here. I have a problem with PHP and MySQL that's been stumping me for a couple of days now. I'm not even sure how to describe it, so I'll just do my best. There's a row in our bugs database that looks like every other row in the table, but when it's pulled from the database and displayed in PHP, the description field -- which is defined as a mediumtext field -- is displayed as a date field with a value of 12/31/1969. Moreoever, when I use PHPMyAdmin to look at the row directly, the description field has the data that I expect it to. Just for fun, here's the text in question: Quarterly Course Set Up - Spring 2012 (114) Section Course titleCourse Start Date 114MHI214 The Internet and the Future of Patient Care 04/02/2012 114MHI212 Health Information Systems Analysis and Design 04/02/2012 Program administrator 2 users; Laurel Aroner - Susan Catron - Jennifer Kremer Instructors; MHI214; Peter Yellowlees MHI212; Robert Balch Per instructions from Rita Smith-Simms - I'm creating this task for myself and based on instructions given which are that all listed courses are now to be backed-up and restored sooner (original course set up time-frame was a month before course starts). Adding instructions - Follow the 52-step quarterly course set up process and information from the course matrix; if matrix incomplete, input information during this set up As you track your time each day, please include in the notes which courses (use project code) you worked on and indicate either working on or completed. Create and notify by 2/15/2012 I've made sure there are no odd characters that would mess up how PHP is displaying the text. I've tried changing the field type from mediumtext to text but this didn't work. If anyone has any ideas as to why this might be happening -- or if I just wasn't clear -- please let me know. If phpmyadmin gives expected results and _your_ code doesn't, I'd be suspicious of your code :-) It might be helpful for you to post relevant part(s) ofthe actual code you are using. Cheers -- David Robley Man who run behind car get exhausted. Today is Sweetmorn, the 46th day of Chaos in the YOLD 3178. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
[PHP] MySQL and PHP weirdness
Bear with me here. I have a problem with PHP and MySQL that's been stumping me for a couple of days now. I'm not even sure how to describe it, so I'll just do my best. There's a row in our bugs database that looks like every other row in the table, but when it's pulled from the database and displayed in PHP, the description field -- which is defined as a mediumtext field -- is displayed as a date field with a value of 12/31/1969. Moreoever, when I use PHPMyAdmin to look at the row directly, the description field has the data that I expect it to. Just for fun, here's the text in question: Quarterly Course Set Up - Spring 2012 (114) Section Course titleCourse Start Date 114MHI214 The Internet and the Future of Patient Care 04/02/2012 114MHI212 Health Information Systems Analysis and Design 04/02/2012 Program administrator 2 users; Laurel Aroner - Susan Catron - Jennifer Kremer Instructors; MHI214; Peter Yellowlees MHI212; Robert Balch Per instructions from Rita Smith-Simms - I'm creating this task for myself and based on instructions given which are that all listed courses are now to be backed-up and restored sooner (original course set up time-frame was a month before course starts). Adding instructions - Follow the 52-step quarterly course set up process and information from the course matrix; if matrix incomplete, input information during this set up As you track your time each day, please include in the notes which courses (use project code) you worked on and indicate either working on or completed. Create and notify by 2/15/2012 I've made sure there are no odd characters that would mess up how PHP is displaying the text. I've tried changing the field type from mediumtext to text but this didn't work. If anyone has any ideas as to why this might be happening -- or if I just wasn't clear -- please let me know. -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Twitter: http://twitter.com/underpope Facebook: http://www.facebook.com/underpope Google+: http://gplus.to/underpope
Re: [PHP] Upgrade or Die?
That is indeed frustrating. I upgraded to FF 4 a month ago or so, and it's been nothing but a hassle. Out of frustration, I switched to Chrome, and I haven't looked back. On Fri, Jun 24, 2011 at 10:16 AM, ad...@buskirkgraphics.com wrote: In shifting gears to a faster pace of development and release, Mozilla has opted to abandon security support for Firefox 4 immediately upon the release of version 5, which came out this week. This could be a risky move, since many users neglect to update their browsers immediately for various reasons, despite the pop-up reminders Firefox periodically displays. I will never understand this mindset. Full story : http://www.technewsworld.com/edpick/72739.html Richard L. Buskirk -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
Re: [PHP] WHERE field = a range of values (value
On Tue, May 24, 2011 at 6:51 AM, Paul S pau...@roadrunner.com wrote: I'd like to check a table to retrieve rows for which one field equals one of a set of values #get products(fields) in category list while ($row = $db_connect-fetch_array($productsincategory_list)) { $product = $row ['selection']; $fields = $fields . $product,; } $fields = substr($fields,'',-1); ## echo $fieldsbrbr; ## $fields = Prod1, ProD2, Prod3 This ... $db_connect-fetch_array($sql_result); $store_result = $db_connect-query(select * from $sql_usertable WHERE (($sql_usertable.product1 = '($fields)')||( $sql_usertable.product2 = '($fields)')||($sql_usertable.product3 = '($fields)')) order by id desc limit $entry, $entries_per_page); doesn't work. It selects nothing (obviously because no single field equals ' (Prod1, Prod2, Prod3) '). But it's the idea. Can I change the: = '($fields)' syntax I'm trying? The actual select checks more fields for this or that and gets more complicated so I'd like to keep this as simple as possible. I would like to do this without UNIONS (in one pass) if possible (my dbsql.php doesn't seem to go beyond regular query). Try in: where productx in (Prod1, Prod2, Prod3) -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
[PHP] Odd array_push issue
I'm encountering what appears to be a bug in array_push when I try using that function to add objects to an array. For example... A = Object 1 B = Object 2 If I execute the following code: array_push(objectarray, A); array_push(objectarray, B); ...I expect the contents of $objectarray to be: [0] = A [1] = B Instead, the last object pushed onto the array is repeated throughout the array. In other words, instead of the above, I get this: [0] = B [1] = B Can anyone enlighten me as to why this is happening? I've looked through bug reports but haven't found anything, which leads me to think that perhaps my own code is at fault. -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com
Re: [PHP] Odd array_push issue
On Wed, May 11, 2011 at 1:30 PM, Peter Lind peter.e.l...@gmail.com wrote: On 11 May 2011 22:23, Richard S. Crawford rich...@underpope.com wrote: I'm encountering what appears to be a bug in array_push when I try using that function to add objects to an array. For example... A = Object 1 B = Object 2 If I execute the following code: array_push(objectarray, A); array_push(objectarray, B); ...I expect the contents of $objectarray to be: [0] = A [1] = B Instead, the last object pushed onto the array is repeated throughout the array. In other words, instead of the above, I get this: [0] = B [1] = B Can anyone enlighten me as to why this is happening? I've looked through bug reports but haven't found anything, which leads me to think that perhaps my own code is at fault. If you could post some more of your code, it would be easier to check if your code is at fault or not. Regards Peter Here's some more sample code, then: function retrieve_records ($where) { (Returns an array of objects which represent rows from a database query) } $records = retrieve_records($condition); $recordlist = array(); foreach ($records as $record) { array_push ($recordlist, $record) } I know this code isn't very useful, but these are the conditions which cause the issue I've mentioned. -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com
Re: [PHP] Custom function
On Mon, May 2, 2011 at 3:16 PM, Ron Piggott ron.pigg...@actsministries.orgwrote: Is it possible to write a function with an optional flag? What would the syntax look like? So far I have: function load_advertisement( $web_page_reference , $web_advertising_sizes_reference ) { Hi Ron: I'm not sure what you mean by optional flag? Do you mean an optional parameter? Richard -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
Re: [PHP] newbie - function is undefined
On Fri, Apr 1, 2011 at 2:32 PM, Jim Giner jim.gi...@albanyhandball.comwrote: function. Try something like: ... echo 'heaading contains: scriptgetText(h2)/script'; ... I tried it - no better. Did you still get the function undefined error? -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
[PHP] Script mysteriously restarting
I've got a massive PHP script which takes nearly an hour to run. Sometimes, when it comes close to the end, it mysterious restarts itself and I have to wait for another hour for it to complete. Is there any reason why a PHP script would restart itself like this? FWIW, I'm running PHP5 with Apache 2 on a Linux server. -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com
Re: [PHP] Script mysteriously restarting
Ah, sorry. It's a browser-based script. On Fri, Jan 21, 2011 at 1:28 PM, Jim Lucas li...@cmsws.com wrote: On 1/21/2011 12:37 PM, Richard S. Crawford wrote: I've got a massive PHP script which takes nearly an hour to run. Sometimes, when it comes close to the end, it mysterious restarts itself and I have to wait for another hour for it to complete. Is there any reason why a PHP script would restart itself like this? FWIW, I'm running PHP5 with Apache 2 on a Linux server. Clarification please. Is this cli or browser based? Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com
[PHP] Stripping carriage returns
I'm retrieving CLOB data from an Oracle database, and cleaning up the HTML in it. I'm using the following commands: $content = strip_tags($description-fields['CONTENT'],'polulli'); $content = preg_replace(/p.*/,p,$content); The second line is necessary because the p tag frequently comes with class or style descriptions that must be eliminated. This works on the whole except where the p tag with the style definition is broken up over two or more lines. In other words, something like: p class = bullettext style = line-height: normal border: 3; In this case, the second line of my code does not strip the class or style definitions from the paragraph tag. I've tried: $content = nl2br($content) and $content = str_replace(chr(13),$content) and $content = preg_replace(/[.chr(10).|.chr(13).]/,,$content) (I've read that Oracle uses chr(10) or chr(13) to represent line breaks internally, so I decided to give those a try as well.) and $content = str_replace(array('\n','\r','\r\n'),$content) all to no avail; these all leave the line break intact, which means my preg_replace('/p.*/','p',$content) line still breaks. Anyone have any ideas? -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com
Re: [PHP] Stripping carriage returns
Strangely, when I use \n, or nl2br(), or PHP_EOL, or anything like that, it strips out not just line breaks, but most of the rest of the text as well. I suspect an encoding issue at this point. Daniel, you were right when you said that neither of my str_replace lines had repl.acement values; that was indeed a typo when I was copying the code over into my email. Ashley, I've already been using strip_tags to eliminate all but p, ol, ul, and li tags. On Tue, Jan 11, 2011 at 11:24 AM, David Harkness davi...@highgearmedia.comwrote: On Tue, Jan 11, 2011 at 11:13 AM, Richard S. Crawford rich...@underpope.com wrote: $content = preg_replace(/[.chr(10).|.chr(13).]/,,$content) This should be $content = preg_replace('/[\r\n]/','',$content) First, you can embed \r and \n directly in the regular expression as-is (not converted to chr(10) by PHP) by using single quotes. Second, you don't want the vertical bar inside []. That's only for (). David -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com
Re: [PHP] Looking for open source Learning Management System suggestions
I'm late to this thread, so I don't know what's been mentioned here already. However, I'd be remiss if I did not recommend Moodle (http://www.moodle.org) as an open-source learning management system. The learning curve is a bit steep, especially if you're going to mess around in the code, but it's powerful and flexible. On Tue, Aug 31, 2010 at 8:57 PM, Michael Shadle mike...@gmail.com wrote: On Aug 31, 2010, at 7:53 PM, Bastien Koert phps...@gmail.com wrote: Our company built one on top of wordpress. You can easily build most of it with stock plugins and it has UIs for idevices...worth considering Yeah - obviously anything can be built and a lot of things can be extended... But were on a tight deadline for the first pass and would like something a little more out of the box (ideally) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Sláinte, Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
[PHP] Database vs. Array
I have a script that connects to an external database to process about 4,000 records. Each record needs to be operated on pretty heavily, and the script overall takes about half an hour to execute. We've hit a wall where the script's memory usage exceeds the amount allocated to PHP. I've increased the allotted memory to 32MB, but that's not ideal for our purposes. So my thought is, would it be more efficient, memory-wise, to read the database entries into an array and process the array records, rather than maintain the database connection for the entire run of the script. This is not an issue I've come across before, so any thoughts would be much appreciated. Thanks in advance. -- Richard S. Crawford (rich...@underpope.com) http://www.underpope.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
Re: [PHP] Making several variables into 1 variable
On Tue, Jul 28, 2009 at 6:32 AM, Miller, Teriontmil...@springfi.gannett.com wrote: I need to take this: $pastDays = strtotime(-30 days); $past_day = date(d, $pastDays); $past_month = date(m, $pastDays); $past_year =date(y, $pastDays); And make it into one var to compare to a db field that is formatted like 00/00/00 Try: $past_date = date(m/d/y, $pastDays) Or even: $past_date = date (m/d/y, time() - 2592000) (where 2592000 is 30 * 86400, and 86400 is the number of seconds in one day.) -- Richard S. Crawford (rscrawf...@mossroot.com) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Font problem
2009/7/28 Dušan Novaković ndu...@gmail.com: Hi, Is there a possibility that if there is no font installed on client side somehow browser finds it and redirect that font form server to client machine. For example: I have site that use Microsoft font and that font is not available on Linux distributions. So when u open page in FF on some Linux u get some default font (because browser doesn't recognize that font). I hope that I've managed to explane a problem :-) Does anyone has any solution for this problem??? Please it's very urgent Not really, no. The choice of font is up to the user's browser. However, you can, with CSS, set some basic parameters. If, say, you want to ensure that the users sees a sans-serif font on their browser, you can use: font-family: arial, helvetica, verdana, sans-serif This basically says, ensure that the browser uses arial; if arial isn't available, use helvetica; if helvetica isn't available, use verdana; and if verdana isn't available, use whatever sans-serif font the user has installed on their computer. Look up the font-family attribute for CSS on the web. There's too much detail to go into and this is a PHP list, not a CSS list. -- Richard S. Crawford (rscrawf...@mossroot.com) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_to_date equivalent in PHP
2009/7/28 Thodoris t...@kinetix.gr: Hi gang, I've been looking for a str_to_date (mysql) equivalent in PHP. I've noticed that these are matching the description: http://www.php.net/manual/en/datetime.createfromformat.php http://www.php.net/manual/en/function.date-create-from-format.php but I don't have PHP 5.3.0 installed in any of my systems to test it and the function/method is not well documented yet. So I will have to write a workaround this. Has anybody tried this? Does strtotime() not work for you? -- Richard S. Crawford (rscrawf...@mossroot.com) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_to_date equivalent in PHP
On Tue, Jul 28, 2009 at 10:09 AM, Jim Lucasli...@cmsws.com wrote: Richard S. Crawford wrote: 2009/7/28 Thodoris t...@kinetix.gr: Hi gang, I've been looking for a str_to_date (mysql) equivalent in PHP. I've noticed that these are matching the description: http://www.php.net/manual/en/datetime.createfromformat.php http://www.php.net/manual/en/function.date-create-from-format.php but I don't have PHP 5.3.0 installed in any of my systems to test it and the function/method is not well documented yet. So I will have to write a workaround this. Has anybody tried this? Does strtotime() not work for you? he is talking about to /MySQL/ date string format -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hm, probably $date = date('Y-m-d',strtotime($string)) then. -- Richard S. Crawford (rscrawf...@mossroot.com) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fwd: [PHP] newbie: problem with $_Post[]
form action=pass.php method=POST username : input type=text name=user br / password : input type=password name=pass br / input type=submit value=gop /form ?php $user=$_POST['user']; $pass=$_POST['pass']; if(($user==myname)($pass=mypass)) echo access granted; else echo access denied; ? getting Notice: Undefined index: user and Notice: Undefined index: pass. changing form action to another page will solve the problem but i want to be able to use $_POST array on the same page, how can i do it? thanks in advance /Arash Arash, It's hard to respond when it's unclear exactly what you want to do. I'm guessing that you want to simply have the same page show both the form, and also process the form, so that you can cut down on the number of pages you have to create. The way I do this is by first checking to see if the $_POST array has been set; if it has not been set, then I know that the form wasn't filled out, and so the script needs to print out the form. If the array has been set, on the other hand, then the script can process the form data. Here's a real quick example of what I mean: ?php if (!isset($_POST)) { ? // The $_POST array is not set, so display the form form action=pass.php method=POST username : input type=text name=user br / password : input type=password name=pass br / input type=submit value=gop /form ?php } else { // The $_POST array *is* set, so process the data $user=$_POST['user']; $pass=$_POST['pass']; if(($user==myname)($pass=mypass)) { echo access granted; } else { echo access denied; } ? Hope that helps. -- Richard S. Crawford (rscrawf...@mossroot.com) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to deal with identical fields in db
On Tue, May 5, 2009 at 1:34 PM, PJ af.gour...@videotron.ca wrote: I'm coming up with a bit of a quandry: how to enter and retrieve an identical book title with different authors. It is rather unbelievable what contortions one finds as authors :-( like editors, associations and then the unknowns and anon y mouses. I suppose one has to get really creative... Anyone for tea? What I've done for this sort of project in the past was create separate tables for authors, books, and author relationships (e.g., author, translator, editor), then linking tables for each of those. You seriously want to do some normalization on this task; otherwise, you end up with a giant table of books, with multiple rows duplicating the title of the book, leading to a huge books table, and nobody wants that. -- Richard S. Crawford (rscrawf...@mossroot.com) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Query string vanishes on header(Location: ...) redirect
I'm trying to redirect my users to a URL which includes a query string: $the_url = $CFG-wwwroot./DLC/includes/L1_accept_required.php?cid=.$course-id; //die (URL = $the_url); header('Location: '. $the_url); When I uncomment the die() command, the URL shows properly, e.g.: http://mysite.com/DLC/includes/L1_accept_required.php?cid=152 The script at the URL calls the variable cid with $_GET: $cid = $_GET['cid']; When I browse directly to the URL as echoed by the die() command, the value of cid is available to the script. However, when I do the redirect, the URL that shows up in the browser's location bar does not contain the query string. Thus, the script at L1_accept_required does not function properly. The annoying thing is that the redirect works properly everywhere else in the site. Can anyone give me insight into what might be going on? I've checked for rogue .htaccess files which might be doing some fancy URL rewriting, but found nothing. -- Richard S. Crawford (rscrawf...@mossroot.com) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] require_once dying silently
Hi, everyone. This one's been driving me bonkers for an hour now. Anyone have any idea why require_once would be dying silently in the script below? $CFG-dirroot = /home/rcrawford/public_html/tanktrunk/tanktrunk; $CFG-dataroot = $CFG-dirroot.'/moodledata'; require_once($CFG-dirroot/lib/setup.php); I've confirmed that the file setup.php exists and is readable. I've got error_reporting in php.ini set to E_ALL. I'm running Apache 2 and PHP5 on Kubuntu 7.10. Nothing shows up in my apache error log, and PHP itself produces absolutely no output, even though it will produce output galore when I put in a deliberate syntax error. I've also tried: require_once($CFG-dirroot./lib/setup.php); but this didn't help. Any assistance at all would be greatly appreciated. -- Richard S. Crawford ([EMAIL PROTECTED]) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
Re: [PHP] Making sure an include file works
Thanks to everyone for the suggestions. Unfortunately, I'm up against a couple of major hurdles: 1. My host does not allow command line access and has disabled shell execution of PHP; 2. Error reporting has been turned off and I can't seem to turn that on with ini_set or error_reporting (which is fun when I have minor syntax errors to fix); and 3. My host is also stuck in PHP 4.3, so the check_syntax function isn't available to me either (although I understand that this function has been deprecated in the most recent builds of PHP). At this point, I'll just use file_exists and is_readable for some basic checking, and hope that the included files have no syntax errors. On Fri, Feb 29, 2008 at 11:25 AM, Daniel Brown [EMAIL PROTECTED] wrote: On Thu, Feb 28, 2008 at 9:58 PM, Richard S. Crawford [EMAIL PROTECTED] wrote: I'm trying to figure out a way to make sure an included PHP file has no syntax errors before actually including it as a part of project. Is this even possible? I'm running into brick walls. As far as I know, the only way to do that is via the CLI (or accessing the include file directly in the browser). Make sure that error_reporting is enabled and that it's set to report E_ALL if you want to really be sure your code is clean (i.e. - reporting unused, undefined, and uninstantiated variables, et cetera). Then, if done from a *nix command line, just type: php -l /path/to/include/file.php -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Richard S. Crawford ([EMAIL PROTECTED]) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com) Support me in Write-a-thon 2007: http://www.firstgiving.com/richardscrawford
Re: [PHP] Making sure an include file works
On Friday 29 February 2008 11:58:16 Daniel Brown wrote: Get a new host that knows how to administer a web server. PHP 4.3 was released 27 December, 2002, with the latest from the 4.3 branch (4.3.11) being released 31 March, 2005. The CHANGELOG should give you an idea of how *horrible* this is: http://www.php.net/ChangeLog-4.php Ah, if only I could. The choice of host was made by my boss, and he loves them. -- Slainte, Richard S. Crawford Editor-in-chief, Daikaijuzine (http://www.daikaijuzine.com) Personal website: http://www.mossroot.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Making sure an include file works
I'm trying to figure out a way to make sure an included PHP file has no syntax errors before actually including it as a part of project. Is this even possible? I'm running into brick walls. -- Slainte, Richard S. Crawford Editor-in-chief, Daikaijuzine (http://www.daikaijuzine.com) Personal website: http://www.mossroot.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting the name of a function
For my own amusement, I'm writing a function that will print out detailed error messages for an API that I'm creating for a minor project. One of the pieces of information I'd like to return would be the name of the function that called the error function. For example: ?php function error ($message) { print The error message is $message; print The function that called the error was: [INSERT COOL CODE HERE]; } function bad_function($param) { error (This is dumb); return false; } bad_function(blah); ? Ideally this script would print this out: The error message is This is dumb The function that called the error was bad_function I know that I could pass the name of the function as a parameter to the error() function (e.g. error(bad_function,This is dumb)) but I'd rather keep it simpler than that. Is there a way to do this? -- Richard S. Crawford ([EMAIL PROTECTED]) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com) Support me in Write-a-thon 2007: http://www.firstgiving.com/richardscrawford
[PHP] Dealing with MSXML2.ServerXMLHTTP objects
For a project at work, I'm writing a PHP script that will process XML generated and sent by an MSXML2.ServerXMLHTTP object that lives on another server. The XML will be sent via POST, but I'm not sure how to deal with it. It doesn't look, to me, as though XMLRPC is called for in this case, but I'm not entirely sure how to deal with the incoming data. Any suggestions would be more than welcome. -- Richard S. Crawford ([EMAIL PROTECTED]) http://www.mossroot.com Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
Re: [PHP] mysql_fetch_array
On Friday 02 November 2007 18:23:03 Eduardo Vizcarra wrote: while($row=mysql_fetch_array($fotos)) { $fotos_mostrar[] = $row; } $fotos contains all records found in a db table, the SELECT statement is retrieving 2 columns from a table, how do I store all records in a 2 dimention table so I can use it later ? this WHILE sentence seems to only store the last record only That is peculiar; assuming that your query is properly executed and the code you're using to display the contents of $fotos_mostrar is written properly. Can you show us that code? -- Richard S. Crawford Editor-in-chief, Daikaijuzine (http://www.daikaijuzine.com) Personal website: http://www.mossroot.com Support me in the 2007 Write-a-thon: http://www.firstgiving.com/richardscrawford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please recommend blog script
On Sunday 07 October 2007 03:41:40 Paul Scott wrote: On Sun, 2007-10-07 at 09:35 +0200, Niels wrote: Basically I want to integrate articles into existing pages, something like ?php blog::getArticlesHTML($rule); ? ?php blog::getUserCommentEditHTML($article); ? What you want is a blog that exposes it's functionality as an API (MetaWebLog or ATOM). Most do that, including the Chisimba one (see http://fsiu.uwc.ac.za as an example. Download at http://avoir.uwc.ac.za) --Paul I've used Wordpress like that on my own site. I have my blog set up in one directory, but I use WordPress's API throughout my site to keep things consistent. -- Richard S. Crawford Editor-in-chief, Daikaijuzine (http://www.daikaijuzine.com) Personal website: http://www.mossroot.com http://www.myspace.com/underpope / underpope.livejournal.com We are here to help each other get through this thing, whatever it is. (Kurt Vonnegut, 1922 - 2007) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moodle: Add field to user listing
On Sunday 07 October 2007 08:10:16 RalfGesellensetter wrote: Dear list, is there any approach to patch any PHP files within moodle in order to gain further columns for the user list? Reference: http://docs.moodle.org/en/Browse_list_of_users Objective: I wish to add a (sortable) user field in order to find users by additional aspects. Thanks Ralf Ralf, As Tom suggested, your best bet is to go to Moodle.org and ask on the forums there. Having said that, I'd be remiss if I didn't mention that starting with 1.7, Moodle allows for custom fields in user records. I haven't yet worked with this functionality myself so I don't know much about it, but it's definitely there. Again, query the forums on http://www.moodle.org. -- Richard S. Crawford Editor-in-chief, Daikaijuzine (http://www.daikaijuzine.com) Personal website: http://www.mossroot.com http://www.myspace.com/underpope / underpope.livejournal.com We are here to help each other get through this thing, whatever it is. (Kurt Vonnegut, 1922 - 2007) signature.asc Description: This is a digitally signed message part.
Re: [PHP] Open New URL window
On Wednesday 19 September 2007 15:50:08 Andrew Prostko wrote: My problem is, I do not know how to make the Else statement... How do I get it to open a new url? I want it IF yes open this page, else open this page Andrew, try the header() function: ?php if ($_POST['pw'] != $password) { ? ...show your form... ?php } else { header (otherpage.php); } One problem you might be having is that the body tag at the very top might be sending headers to your browser before your else statement has a chance to kick in, generating an error which reads something like, Headers already sent... Try moving it to after the conditional, like this: ?php if ($_POST['pw'] != $password) { ? BODY onLoad=top.window.focus() ...rest of your form... ?php } else { ...and so on. -- Richard S. Crawford Editor-in-chief, Daikaijuzine (http://www.daikaijuzine.com) Personal website: http://www.mossroot.com http://www.myspace.com/underpope / underpope.livejournal.com We are here to help each other get through this thing, whatever it is. (Kurt Vonnegut, 1922 - 2007) signature.asc Description: This is a digitally signed message part.
[PHP] Problem downloading files in IE
My users are having problems downloading .doc or .xls files linked to from PHP pages; when they click on the link, IE returns an error stating that the file cannot be found. Firefox, however, seems to be able to find the file and open it just fine. From what I can tell, this is related to a known IE issue which prevents users from being able to download files from a secure site if the headers on the page are set to prevent caching. However, our site is not a secure site, nor do we have headers which prevent caching. This has been bugging me for weeks. I advise our users to use Firefox, but not all of them are able to do so; and since they pay our bills, we don't have much of an option. If anyone has any ideas, I'd appreciate hearing them. -- Richard S. Crawford Editor-in-chief, Daikaijuzine (http://www.daikaijuzine.com) Personal website: http://www.mossroot.com http://www.myspace.com/underpope / underpope.livejournal.com We are here to help each other get through this thing, whatever it is. (Kurt Vonnegut, 1922 - 2007) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings
On Tuesday 05 June 2007 10:50:15 Steve Marquez wrote: It seems that if I add a string, rather than just the variable, then does not work. I am getting an unexpected T_IS_EQUAL error. Your string delimiters are very strange; I'm not sure if your code has those in it or not, so I can't really diagnose your problem. At any rate, make sure your code looks like this: ?php $image = ; if ($image == NULL) { print False; } else { print img src=\$var\; } ? If that still gives you problems, you could try replacing the second print statement with this: print img src=\.$var.\; just to see if the problem is with the string or is some strange interpolation issue. -- Richard S. Crawford (http://www.mossroot.com) Editor In Chief, Daikaijuzine (http://www.daikaijuzine.com) AIM: Buffalo2K / GTalk: [EMAIL PROTECTED] We are here to help each other get through this thing, whatever it is. (Kurt Vonnegut, 1922 - 2007) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] People's misbehavior on the list
On Friday 18 May 2007 15:25:35 Tijnema wrote: ? function sighRelief() { return Thank fucking God!; } ? Saves you some time, and resources Yeah, but where's the fun in that? -- Richard S. Crawford (http://www.mossroot.com) Editor In Chief, Daikaijuzine (http://www.daikaijuzine.com) AIM: Buffalo2K / GTalk: [EMAIL PROTECTED] We are here to help each other get through this thing, whatever it is. (Kurt Vonnegut, 1922 - 2007) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Netscape Vs. IE
This can be done without CSS, actually. Try: td background=imagefile Not all browsers will support this, of course. But, then, even fewer browsers will support the use of CSS for the same application. You can also use: td bgcolor=#ff to make the background color white, again avoiding the use of CSS. Both, I believe, will pass as valid HTML 4.01 and XHTML transitional 1.01. On Mon, 2002-03-11 at 07:19, Vlad Kulchitski wrote: Hi, Someone replied to my post about browsers incompatibilities but I lost the message, can someone remind me how to set up the background image: td style='background: white' I mean I need another command that will tell to load image as a bg. I am trying to use background-image:file.gif, but it doesn't seem to work. Thanks, Vlad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Sliante, Richard S. Crawford mailto:[EMAIL PROTECTED] http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Yahoo!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupery Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Netscape vs. IE/Mozilla
A URL would be helpful On Fri, 2002-03-08 at 07:44, Vlad Kulchitski wrote: Hi guys, I know it's a wrong place to ask about this, but I am sure someone here faced the same problem. I am trying to get the site to look consistent in Netscape Navigator and it's giving me hard times. Either tables or/and cell background doesn't show up or spacing between two tables is not what it is supposed to be. If anyone can give me suggestion about where to look for some hints online that would be appreciated. Thanks, Vlad -- Sliante, Richard S. Crawford mailto:[EMAIL PROTECTED] http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Yahoo!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupery Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript Parser?
I'm not entirely sure I understand your question. Are you asking if there's an easy way to convert programs from JavaScript to PHP? saif wrote: hi, is there any site from where i can get the php scripts which can parse the javascript or at lest document.write(ln) part into php echo variable so that i dont need to implement javascript in my web documents(i have some documents writen in javascript so that i can insert them in any doc but now im moving from javascript to php.) thanks in advance. saif -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: IMPORTANT about asking QUESTIONS
Many people use mail clients that don't do any sort of threading to follow what's going on on this list; I use Eudora, personally, when in Windows, and the Mozilla mail client when I'm in Linux. It was, quite literally, years before someone finally pointed out to me that in a mail reader or a news reader that supports threading, if I start a new thread I shouldn't reply to an old thread with a new subject line. I'm now very careful to follow that procedure. In my mail client, it makes no difference, but I know it affects other readers. That's just why it happens; because not everyone uses a newsreader to read this newsgroup, so many people don't even realize what's happening. At 11:22 AM 1/11/2002, l0t3k wrote: one of my biggest problems, which happens here a lot, is that some people will ask a completely different question (with a different topic header) under an existing thread rather than starting a new thread. all it takes is a few minutes to familiarize oneself with the newsreader, but apparently a few minutes is too much.. Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Using a HTML button
PHP is entirely server-based. So when you load this page into your browser, all of the PHP is being parsed BEFORE it ever loads into the browser. So the function will be executed even before the page loads. Do it in JavaScript if you want it to be done in the browser. What you have written down will show up in the source code of your browser as: INPUT TYPE=BUTTON NAME=HH value=Mul onClick=1 (or something like that). PHP runs entirely on the server. Server! Server! Server! Server! Honest, I promise that it doesn't get interpreted by the browser. If you have any doubts, try writing a PHP script, reading it in your browser, and then viewing the source code to see what gets rendered. For browser-side scripting, I suggest you pick up a book on JavaScript programming. Nothing you do in PHP will ever be interpreted by a browser. At 01:59 PM 1/11/2002, Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 11-01-02 at 22:48 * Morten Nielsen said Hi, I am rather new to PHP so I hope somebody can help me. I have a normal button (HTML code). Then I have made a function function multiply($X) { return 2*$X; } The button has an OnClick, which calls my function. INPUT TYPE=BUTTON name=HH value=Mul onClick=? $XX=multiply(5);? I then writes $X to the screen. ?php echo $X ? The problem is I dont even have to press the button. When the page loads it already has calculated 2*$X. Why is that. I would like to only call my function when I press my button. What value is it returning 5, or 10? Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8P2ArHpvrrTa6L5oRAhPjAJ9Mv4k54bNNtu8DLGBegiD7SaQA1QCggJNl PolIOd8coSStooSyW/mmtk0= =MNoe -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] POSTing HTML into a database
I've used a combination of addslashes() and stripslashes() along with htmlspecialchars() to perform just that sort of thing, though I used MySQL instead of PostreSQL. Does anyone know, by the way, if there's a port of PostreSQL to Windows 2000? Or can I run it in Cygwin? At 03:45 PM 1/6/2002, James Arthur wrote: Hi I need a user to be able to enter submit HTML code (also perhaps containing PHP code) via a web form, which will then be entered into a database. The data is typed in to a textarea, which is then posted to my script. I notice that some special characters come out of this process escaped, but the escaping sequence does not appear to be entirely compatible with the SQL query I'm using to insert it into a table. Can anyone tell me the correct way to convert the output from the form into a format that PostgreSQL will accept, and then how to convert it back so that it's identical to what the user entered before being escaped by post (so that I can just use print to print it out)? Thanks. --jaa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to strip off all html-comments
Martin, strip_tags() would be useful for removing *all* HTML from a string, though you can specify that certain tags should be retained. For example, if you want to remove all *but* anchor tags from your string, your function would look like this: $str = strip_tags($str,'a'); However, if you want to remove *just* comment tags, though, you're better off using the ereg_replace() or eregi_replace() function to remove the comment tags, something like this: $str = eregi_replace(!--[^]*--,,$str); ...which would be a lot easier than including every other possible tag in the second field of the strip_tags() function. This regexp is very similar to one that I used to remove img tags from a string in a project I was working on. Good luck! At 07:58 AM 12/31/2001, Brian Clark wrote: * James Cox ([EMAIL PROTECTED]) [Dec 31. 2001 06:38]: http://www.php.net/stripcodes I think you mean strip_tags() http://www.php.net/strip_tags [...] Hello! How can I easily strip off all html-comments (! Comment ) from a string? Martin -- Brian Clark | Avoiding the general public since 1805! Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 Forget Napster. Why not really break the law? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML Email
The very first thing you need to do when thinking about a way to send HTML e-mail is to take plenty of aspirin and lie down until the urge passes and you feel sane again. HTML e-mail bad. Plain text good. At 06:51 AM 12/18/2001, Gerard Onorato wrote: Okay I know I must be overlooking somethign super obvious but I am trying to send a simple HTML email. It works in Netscape mail, Pegasus etc however in Outlook and Outlook express it actually places the Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Opening a new window.
Do you mean having it open a window as the page is loading? Just include the javascript to open the new window in the body tag, using the onLoad attribute. Of course, once the page has been loaded, you have to rely on JavaScript to do everything, because PHP only works on the server and not the browser. But, of course, you already knew that. At 02:59 PM 12/14/2001, Brandon Orther wrote: I wanted to know how I could have php open a window. Like can I have it print out some javascript to open a new window? Instead of someone having to click a link. Thanks Brandon Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Opening a new window.
You can't really specify target window properties in straight HTML without getting rid of JavaScript. For what it's worth, here is a bit of JavaScript that I use on my home page to spawn a small window: function my_win() { window.open('mailsend.html','mywindow','width=333,height=410,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes'); } The window that is spawned is 333 pixels wide, by 410 pixels high, has no toolbar, no location bar, no directory bar, no menu bar, no scrollbars, and no status bar, though it can be resized. Why do you want to get rid of JavaScript? At 03:06 PM 12/14/2001, Mehmet Kamil ERISEN wrote: that's a great point. Can you specify the target browser properties using html? Lise the Location bar, or the toolbar? I was actually using little popups with jscript. If I can get rid of JS that would be great. Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Opening a new window.
Generally, I agree with you. Sometimes a small, no-controls window can be useful, though, if all it is is a spinoff form that closes as soon as it passes data to a CGI-script. At 03:00 PM 12/14/2001, Mark Charette wrote: Nope - just opens a new window. Of course, personally, I'd like to take those people who turn off the toolbars and back buttons and whatevers on _my_ windows and put them in a speeding car down some highway with no brakes, no steering, a locked down accelerator, and no door handles ... hey, buddy, what's the problem? No controls? But the radio works just fine, and that's all I'm gonna give 'ya to play with ... we know best. Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] forms PHP
I've done something similar like this: a href=javascript:window.back() Click here to go back /a In the situations in which I've used it, the form data from the previous page is still in the form fields. Potential downsides of this approach: the data has not yet been processed. Or, if it has been, you run the risk of processing it twice. Also, it may be unreliable depending on how the user's cache is set up (though I've never had any problems reported to me). So, it may or may not suit your needs. At 09:44 AM 12/6/2001, [EMAIL PROTECTED] wrote: I think I'm making this harder or more confusing than it really needs to be. I have a form that is spread out over four pages. I want to be able to give the user the opportunity to return to page 1 from page 3, for example, by providing a regular link on page 3 to return to page1. When they click on this link, I want the info. originally entered in page 1 to still be there. Do I need to use sessions to do this or is there another way? Thank you, Shawna -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] header(Location:blah...) - passing variables
My approach has been to pass an error code back to the original form. form.php: ?php print(form aciton=\formVerify.php\); print(a buncha form crap); if ($errcode==1) print (Your user id is wrong. You suck); if ($errcode==2) print (Your password is wrong. You really suck); print(/form); ? Then in formVerify.php: ?php ...error checking code... if (userID invalid) header(Location: form.php?errcode=1); if (password invalid) header(Location: form.php?errcode=2); else header(Location: goodpage.php); ? You could probably also use cookies to pass the error code back and forth, but that's probably overkill and unreliable. (Sorry if the pseudo-code I used above offends anyone with the use of the word suck; the futile job search has got me really annoyed right now.) At 10:25 AM 12/4/2001, Mark Charette wrote: I cheat and just include the original form on error ... Almost all my input values are set to PHP variables in the form. The 1st time through none are set, so the values are blank. After submitting the form, I check for validity. If there are errors I mark the errors, generate an error string, and include the form. That way all previously typed in data remains in the form without me having to tell the user to hit the back button, and there's no horribly long URL string resetting all those values. There's a bit more work than that (using htmlspecialchars et al.) but if you start creating forms with error checking indication in mind it's really easy to do validation and redisplay if necessary. Mark C. Hi, I wonder if someone could tell me whether or not the following is possible? I have an HTML form which passes a username and password to a PHP script for validation. If either is not valid, I would like it to return to the previous page - carrying with it a variable plus the submitted form information... =-=-=-=-=-=-=-=-= if (strlen ($password1) 4 ) { $err = Password must be more than 4 characters long; header(Location:http://somelocation.php;); // ^-- at the location, the $err and form variables will be available exit; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP newbie alert
HomeSite is up to version 5. I use it primarily for the built-in FTP client, which makes website maintenance very, very easy. At 05:06 PM 12/4/2001, you wrote: EditPlus2, there might be a newer version, trial never runs out. HomeSite 4.5, there is a Macromedia version, 60 day trial, very very worthwhile for a purchase. Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Logic
You need parentheses around the entire antecedent: if (($type !=add) || ($type !=edit) || ($type !=delete)) { //etc ^--- Note these parentheses---^ Hope that helps. At 05:28 PM 12/4/2001, Dan McCullough wrote: Question. I am trying to check to see if a certain piece of code should be run. Here is an example. if ($type != add) || ($type != edit) || ($type != delete) {//if this or this or this then then run this code } else { then run this } Is this correct, for some reason this isn't working. Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mysql update query
What error are you getting, exactly? MySQL is not case-sensitive with regards to commands, but it is case-sensitive for table names, column names, etc. Make sure that the table names are exactly exact ;-) including cases, etc. You might double-check the values in the variables: do they contain special characters (like ' or ) that need to be escaped out with addslashes()? Check the datatypes for the columns as well. If the datatype is a number, the single quote is not needed (and will, in fact, cause an error). I've had trouble in the past using variables with single quotes in the string and variable interpolation. In this sort of case I usually use: $query = stuff='.$stuff.'; instead of $query = stuff = '$stuff'; It's clunkier, but it might work. Give it a try as well. Ultimately, though, I suspect that it's your data that's causing the problems. At 07:36 PM 12/4/2001, Tyler Longren wrote: Everything looks good to me...try this: $result = mysql_query(UPDATE table SET value1='$value1',value2='$value2' WHERE id='$id'); Although I doubt MySQL cares if certain words are capitalized. Good luck though, Tyler Longren - Original Message - From: Greg Sidelinger [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 04, 2001 9:27 PM Subject: [PHP] mysql update query I'm having trouble getting an update query to work Here is what I'm doing $result = mysql_query(update table set value1='$value1', value2='$value2' where id='$id'); It is not updating the database. All the $vars have values and I'm using the correct columns names. Could someone please point me in the correct direction because I have been trying different things for a while but can't seem to get it to work. Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Good host needed
I've had good luck with www.pair.com At 01:10 PM 11/29/2001, Rudi Ahlers wrote: I know this is OT, but I don't know where else to ask. I'm in South Africa, and I'm looking for a GOOD webserver host in the States. Bandwidth is a big thing, as well as using UNIX, else Linux. I would like to be able to manage the server from home,and not phone in every I need to do something. And I'm looking for good bandwidth. Any recommendation will do, as I'll be looking at all the companies, and see who offers the best. Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] call php with javascript
I don't get what you are trying to do. Does test.php contain JavaScript that you are trying to execute? If so, then test.php should be called test.js, and should look something like this: function (blah) { var foo = blah; document.write(foo); } If test.php is a PHP document that you're trying to execute, then your main document should look like this: ? include(test.php); ? ...and it should be called something like myDocument.php. The problem is that PHP is a server-side language and you're trying to force it to execute like a browser-side language. It won't work. ?rant IE is far too forgiving of the inclusion of bad code, which is why I never recommend that it be used for testing purposes -- in my experience, developers who develop for IE or who test on IE universally create bad code, because IE just lets it happen. Use Netscape for testing your pages; if it works in Netscape, it will work in IE and Opera and Mozilla, etc. If it works in IE, it may or may not work in other browsers. ? At 03:36 AM 11/27/2001, Bas Jobsen wrote: Hi, i have test.php: ? echo test; ? to call this in the html, i use SCRIPT LANGUAGE=Javascript SRC=test.php/script this works fine for IE, but is there an alternative for Netscape to do this? Tnx, Bas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Deleting from MySQL with more than one 'where' variable?
What kind of error are you getting? Your SQL looks fine to me. I can think of a couple of reasons why this might not be working; there may be a difference in how the field names are spelled, or there may not be any rows in usr_stats where the spec column contains a value of $field. Hm, you might also try: delete from usr_stats where sel like '$sel' and spec like '$field' At 12:35 PM 11/21/2001, cosmin laslau wrote: Ok, there's a table with 4 fields, I want to delete from it when two of the variables passed (through the function below) match up with the table's contents. However, I have only been able to get it to work with one 'where' clause, not two. Here's my code for one: function delete_one_sub($sel, $field, $update) { $query = delete from usr_stats where sel='$sel'; $result = mysql_db_query(f6, $query); } This was code for two variables: function delete_one_sub($sel, $field, $update) { $query = delete from usr_stats where sel='$sel' and spec='$field'; $result = mysql_db_query(f6, $query); } However, that doesn't work. Help? Thanks. Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Installing PHP with windows
You can download the win32 PHP binaries from www.php.net. I know it works because I've got it running on my win2k box. But I'm also running Apache so I don't know if it will work with PWS. I'd be interested in knowing. If it doesn't work with PWS, why not just install Apache? It's free and much, much more secure than PWS. At 12:55 PM 11/21/2001, Rob Bennion wrote: Hi I want to try out PHP and wanted to know if it is possible to install it on a windows machine and use it with personal web server. Any help would be appreciated. thanks Rob Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Testing for the presence of HTML
My database contains a field which may or may not contain HTML code, depending on what a particular user enters when they enter the data. Here's the challenge: If there is HTML code in this field, then print the text with interpreted HTML. No problem at all. If there is no HTML code in the field, then I still want the data printed nice and neat; the users will probably use line returns to make their text look somewhat decent. So, assuming that $text contains the contents of this field, then what I want to do is this: if (!HTMLin$text) then $text = nl2br($text); What's the best way to check and see if HTML is present in the field? Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Cookies and Variables
Consider this code, in page1.php: ?php setcookie(someWord,I am a cookie); ? ...and this code, in page2.php: ?php setcookie(someWord,$someWord); print (someWord says: $someWord); $someWord = I am a variable; print ( a href=\page2.php?someWord=$someWord\ Click here /a ); ? (In the actual code, the value of $someWord is passed via POST through a form, but the principle is the same.) The first time I load page2.php, the output should be: someWord says: I am a cookie Which, of course, works perfectly. But each subsequent time I load page2.php, I want the output to be: someWord says: I am a variable and then set the value of the cookie someWord to I am a variable. But that's not what happens. Everytime I load page2.php, someWord tells me that it is a cookie. How do I get the value of the variable to override the value of the cookie? Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: auto form submit
The second script would still need some way of knowing what data to pull from the database. Some sort of unique key could be generated by the first script when the data is inserted into the database, and that key used to pull the data in the second page. Of course, the key would probably have to be passed in the URL, which may or may not defeat the purpose, depending on why it is you are trying to keep the URL clean. Perhaps a cookie? I've been fighting with those little buggers all day and I think I've just about got them whipped into shape. At 06:20 PM 11/20/2001, Chris Kay wrote: How about storing it in a db or a file and retrieve it from the 2nd php script.. Chris Kay - Tech Support - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 -Original Message- From: Fred [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 1:08 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: auto form submit I know of no way to do this automatically with PHP. I think you can pull it off with some javascript. Wm [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hi all, if i pass data through a form (post) to a php script(script must be separate from form) is there a way that this php script can then forward that data to another script without attaching it to the end of the url? thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Transfer variable to next web-page
Use $phpVariableName = $htmlVariableName; Remember to use the $ in front of the variable that you toss from the HTML form. At 10:00 AM 11/17/2001, Olav Drageset wrote: I just started.. How do you transfer a variable from one web-page to another I try to use a form like this: ? echo(P FORM method='POST' action='join2.php' text for button INPUT type='submit' value='Next step' INPUT type='hidden' name='htmlVariableName' value='$phpVariableName' /FORM ); ? and catch it injoin2.phpby: $phpVariableName=htmlVariableName; echo$phpVariableName; This do not work. Can anyone tel me what should be done Neither books, php-manual nor HTML-specification does tel me. Olav -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: I suck at regular expressions!
Not quite. I have the same problem. At 11:36 PM 11/14/2001, Johan Holst Nielsen wrote: Richard S. Crawford wrote: I am trying to get the title of an html file... you know, the string between the title and /title tags... Here is the function I've got so far: function fileTitle($fileName) { $myFile = fopen($fileName, r); $myText=; while (!feof($myFile)) { $myText .= fgets($myFile,255); } fclose($myFile); if (eregi(TITLE(.+)/TITLE,$myText,$theTitle)) return $theTitle[0]; else return (No Title); } Try: function getTitle($filename) { $fp = fopen($filename, r); $filecontent = fread($fp, filesize($filename)); if(eregi(title(.+)/title, $content, $title_arr)) { return addslashes(htmlspecialchars(trim(strip_tags($title_arr[1]; } else { return (No Title); } } Regards, Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: I suck at regular expressions!
Actually, that does work when I'm using a string with that content. The only thing I can figure is that there is a problem with the way the the file is being read. Hmm. Ah, well. I'll make it work. Where's my hammer? At 12:18 AM 11/15/2001, Johan Holst Nielsen wrote: Richard S. Crawford wrote: Not quite. I have the same problem. I tried at test on my localhost. Following works for me: $string = htmlheadtitleSometime i dont wanna know/title/headbody/body/html; if(eregi(title(.+)/title, $string, $arr)) { echo Title: .$arr[1]; } else { echo unknown title; } This works for me? Regards, Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] I suck at regular expressions! -- not as bad, now
Thanks to everyone who helped me figure this out. I foolishly didn't realize that I was using the htmlspecialchars() function on the string that I was pulling from the file, but not accounting for that in the regexp. So, what I was getting was: lt;titlegt;BLAH BLAH BLAHlt;/titlegt; but what I was trying to find was: title BLAH BLAH BLAH /title It's all good now. Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Anyone ever done this - sort a multi-dimensional array
Of the type... $array[0][0] = !row of c's; $array[0][1] = ; $array[1][0] = row of a's; $array[1][1] = ; $array[2][0] = a row of b's; $array[2][1] = ; such that you sort on the value of the y-column? In this case, it would end up as: +--+--+ | row of a's | | | a row of b's | | | !row of c's | | +--+--+ Strange that I've been working with PHP this long and have never come across this problem. Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] I suck at regular expressions!
I am trying to get the title of an html file... you know, the string between the title and /title tags... Here is the function I've got so far: function fileTitle($fileName) { $myFile = fopen($fileName, r); $myText=; while (!feof($myFile)) { $myText .= fgets($myFile,255); } fclose($myFile); if (eregi(TITLE(.+)/TITLE,$myText,$theTitle)) return $theTitle[0]; else return (No Title); } The trouble is, it always returns (No Title), regardless of whether the file has a title defined in the header or not. I suspect I'm doing something fundamentally wrong. Can anyone set me straight? Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] javascript to php ???????
Why, sure! In your FORM tag, use ACTION=test.php. You can send your JavaScript variable as part of the form, in a hidden form field such as INPUT TYPE=hidden VALUE=myValue. The value of the variable will be available the next time test.php shows up as $myValue. You can then manipulate it to your heart's delight. At 03:17 PM 11/13/2001, fitiux wrote: Hi =) is it possible to pass a javascript array to php ??? by the time javascript comes into play, php has already done it's job and left the building. If you mean can javascript pass variables to a new request for php to handle, then sure. Thanks for your reply. =) I have a little problem.. well.. with php I build an html page with javascript to validate a form, the action of this form is call again to the php page. I mean... test.php - (make an html page)--- question.html ---(submit form) test.php I populated an array but now I need to pass this array to the same starting php page again. can I do this? --Patricio (I apology because my english is not good enough.. I hope that you can understand me.. ) Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] executing another php.script
I'm not clear on what it is that you are trying to accomplish. Could you restate your question, please? At 08:43 PM 11/11/2001, David Tod Sigafoos wrote: I am sure that I am just .. missing this .. From one script I wish to 'execute' another script. How is this done? Setting a link and clicking is not the answer .. one script loops through all the 'selected' rows and I want to 'execute' another script for each row .. can this be done? thanks DSig David Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTTP Headers
Boy, that's one of those Imagine the trouble we would get into if we could! questions, isn't it? Just like How do I disable the back button?, or How do I use PHP to feed me the contents of a web browser's hard drive? That said, some hosting services support what is called domain parking, where you can hop on to a URL, and then have that URL displayed in the browser's location bar throughout the browsing experience. The problem is that it's unreliable (you don't know when you're going to burst out of park mode and see the real URL), and the URL that is displayed is relatively static. That is, you will only see the URL, and not any subdirectories. It's obnoxious, and I don't recommend it, but check with your hosting service if that's really the route you want to go. Can't be done with PHP, though. At 03:55 PM 11/9/2001, Mike Harvey wrote: Is it possible to redirect to an IP address but have the browser address bar show an URL? Mike H. http://ibiz-tools.com http://vestudiohost.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] close windows
window.close() It's JavaScript. PHP is a server-side language and cannot affect anything on the browser itself. PHP cannot: 1. Close a browser window 2. Spawn new windows 3. Produce pop-up boxes 4. Do form verification before the form is submitted 5. Do anything to a page after it is loaded 6. Disable the back button 7. Change the right-click menu 8. Do image roll-overs 9. Dyanimically refresh a page which is already loaded 10. Make text blink All of the above need to be accomplished with JavaScript or regular HTML. I believe that this is the fourth e-mail to this list that I've seen over the past three days that asked how to perform a traditional JavaScript function with PHP. PHP is a great language for back end functionality and for creating web pages on the fly, but once a page has been loaded into the client browser, PHP loses all control over the page. Any more functionality that you wish to install on your page must be done with JavaScript. At 05:07 AM 10/30/2001, André Castanheira wrote: Hi, Is there a php command to close a window or return to the previous one ? Obrigado, André Castanheira Carioca Engenharia S.A. +55 21 3891-2200 r; 2325 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] downloading images
With some of the newer broswers, you may be able to re-define the functionality of the context menu via JavaScript. Visit http://www.dynamicdrive.com; I think that there are some examples there, and you might be able to redirect the save image as... functionality there (I wouldn't count on it, though). Another option might be to zip up the larger image as a zip file and create a link to that zip file through the thumbnail image. That way, when the user clicks on the thumbnail, they are prompted with a save as... dialogue box and they can then save the document on their own computer. They still have to unzip it though. Other than that, I think you're out of luck. The problem is that saving an image onto a computer is a client-side function, which you can have no control over with server-side programs such as PHP or Perl. If you can come up with a way for a web page to mess around with the source code of Netscape or IE, then you might be able to do things like control the save image as... functionality, or disable the back button, but that seems pretty unlikely to me. At 10:47 AM 10/29/2001, you wrote: Hey, I'd like users to be able to download images from on my site. The images are pretty big, so i've made thumbnails for each. I can display each thumbnail, but how can i get it so that once the user clicks on the thumbnail, they get to download the whole image. I'd like it to work without having the user to right click and choose 'save image as'. Any ideas?! Thanks, Heidi Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] spaces vs nbsp; in form fields
The problem is that you have special characters that are interfering with the output. I had exactly the same problem a few weeks ago. Try this: $fixedOutputValue = htmlspecialchars($outputValue); print (input type=\text\ value=\$fixedOutputValue\ /); This is how I solved it. Note that putting htmlspecialchars($outputValue) in the value attribute will give you undesirable results. At 01:32 PM 10/29/2001, Greg wrote: However, when I display the value in an input text box on a form, only John appears. The odd thing is that when I view source, the full name appears in the HTML; it just doesn't render that way in IE/Opera. Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Best [non-PHP] way to redirect a browser
You might try META tags. Put this in the head section of your index.html file: meta http-equiv=refresh content=0; url=index.php If the user has JavaScript disabled, you're probably best off using a link and letting the user click through. You may also be able to adjust your Apache or IIS or whatever configuration to load index.php by default, and even eliminated index.html altogether. That's what I wound up doing, and I have experienced no problems. At 10:25 AM 10/26/2001, René Fournier wrote: This is really I guess a non-PHP question, so please excuse... What is the most reliable, browser-safe way to redirect the browser from a default index.html to, say, index.php? The I'm doing it now is with the following javascript: script type=text/javascript language=Javascript document.location=index.php /script And it works, but I wanted to know if any of you are using a better [more compatible] way of redirecting the browser (say, if it doesn't have JavaScript (!?)). ...Rene --- Rene Fournier [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how can I do this !!
What do you mean, colorized code? At 02:26 PM 10/25/2001, Alawi wrote: i have txt file have this words -- bla bla bla [phpcode] ? echo 'hello word'; ? [/phpcode] bla bla bla --- now I want to convert the code that are between [phpcode] and [/phpcode] to colorized code .. How I can do that Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Opening a new page when done
Assuming you don't output anything else to a web page: header (Location: index.html); should do the trick if you put it at the end of the program. Be warned, though, that if you output anything to the browser at all, the header function will not work. Good luck! At 06:39 AM 10/24/2001, Roy W wrote: I have several scripts that when you complete a form it executes a PHP script. At the end of each script I have a simple statement saying it's done and then a place to hyperlink back to a given page: PRINT Process complete. a href=\index.html\Click here/a to continue; But what I really wanna do is just have the script code execute and when its all done - just take the user automatically to index.html or some other page. I know there's a command but cant seem to find it. Thought it might be include() but couldn't figure out my syntax Ideas? THANKS!!! :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I NEED HELP WITH PWS AND W98
Getting PHP to work with Apache is pretty simple. The documentation is easy to read. I would agree with trying Apache on your Win98 box; but be warned that the current Apache release is only supposed to be stable on NT platforms. Since I have win2k it's not an issue for me, but it might now work on Windows 98. At 08:54 AM 10/24/2001, Chris Hayes wrote: hi Nicolas, pws is not so great. if you are still in the beginning phase you may consider to use the free Apache server. It has a version for windows, very stable. You just need to make some changes to the configuration file to make php work. btw you do not need to compile php if you download the right version! (don't download 'source' but maybe they call it 'binary' or whatever). There are even packets on the internet which include working combinations of apache + php4 + mysql (mysql= free very popular web database). Just do a search on a search engine. There are also instruction pages on how to make php work on apache (you need to change two or three lines in a configuration file). good luck. Chris Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how do i give optional arguments to functions??
function top ($image) { if ($image) echo blah blah blah; else echo blah blah $image blah; } There's probably a more efficient way to do it. At 09:57 AM 10/24/2001, sunny AT wde wrote: hi all!! i'm writing functions like - --- function top () { echo blah blah blah;} --- what i want to do is make it so that i can do - --- function top($image) { echo blah blah $image blah; } --- but also make the $image parameter in the top() as optional. so if its not there, then tell php not to worry about it. any ideas?? thanks! sunny __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how do i give optional arguments to functions??
Hm, is the default attribute necessary? I've used this sort of approach without the default attribute just fine in the past. Though I admit that the default attribute would make me feel more secure. At 10:30 AM 10/24/2001, Arpad Tamas wrote: On Wednesday 24 October 2001 19:14, Richard S. Crawford wrote: The default value for $image parameter was missing: function top ($image=defaultvalue) { if ($image==defaultvalue) echo blah blah blah; else echo blah blah $image blah; } Arpi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how do i give optional arguments to functions??
Ahh, good point. Thanks for the tip. :) At 10:45 AM 10/24/2001, Tamas Arpad wrote: Not really necessary, but I like to make code without any warning message (it also makes the code more cleaner as you said), and you'll get a warning message if there's no parameter given at the function call (without the default value). Arpi Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Can PHP do what this javascript does...
Unfortunately, since PHP lives on the server and JavaScript lives on the browser, there really is no way to get PHP to do what you want. Stick with JavaScript. There's really no reason not to when you're doing client-side programming. At 11:14 AM 10/24/2001, [EMAIL PROTECTED] wrote: iTo print/i: a href=javascript:if (window.print != null) { window.print(); } else { alert('Unfortunately, your browser does not support this shortcut. Please select Print from the File menu.'); } bClick here/b/a ior/i Select bFile/b and then bPrint/b from your browser's menu. Is there an equivelant bit of code to do this printer shortcut with php? -- Chip Wiegand Computer Services www.simradusa.com [EMAIL PROTECTED] Simrad, Inc Lynnwood, WA 425-712-1138 There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977 (-- Then why do I have nine? Somebody help me!) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] INPUT tag with default value
It is possible to utilize a VALUE attribute with a FILE type input field. Even the specs at Blooberry list value as an attribute of the input type=file field. I double-checked at w3c.org to make sure, though, and found the information repeated there. I even checked my O'Reilly book on XHTML. :) O'Reilly suggests, though, that because of the vagaries of individual file systems on individual computers, the VALUE attribute just isn't recommended. I suggested the use of the htmlspecialchars() function to strip possible quotes from the value of $photo in the original author's example, as in: input type=file value=? echo htmlspecialchars($photo); ? I struggled with exactly this problem a couple of weeks ago. In the end I decided that using the VALUE attribute was just a bad idea, since one could never know how the user had set up their own file system. At 09:47 AM 10/23/2001, Philip Olson wrote: This is not possible. Default values cannot be set with type=file as if it were it would be quite a security risk.A little more information on the capability of this html form element: http://www.blooberry.com/indexdot/html/tagpages/i/inputfile.htm And a related RFC : http://www.faqs.org/rfcs/rfc1867.html regards, Philip Ollson Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] aaaaaaaaaaaaaaa
This is probably the most challenging question I've ever seen come across this list. Can we get back to you on this one, Franco? At 07:52 PM 10/23/2001, Franco Breciano wrote: a -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Disable Back Button
Can you imagine the trouble you'd get into if you could? At 09:47 PM 10/19/2001, Chip Landwehr wrote: Is there any way to do this in PHP4? Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] This is driving me to drink...
...But my boss won't let me keep the Bushmill's at my desk. *sigh* So, assuming that $p_code is MNE and $neuroKey is 2, then $hub should be 2, right? Instead, it's coming up with 1, which is the value of $coreKey. What have I missed? $hub=$coreKey; if (($p_code==MNE)||($p_code=='SN')||($p_code=='PM')) { $hub=$neuroKey; } else if ($p_code==MAI) { $hub=$allergyKey; } else if (($p_code==SPS)||($p_code==MCC)) { $hub=$dermKey; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] This is driving me to drink...
Problem solved. Boy, that was easy. The database was adding trailing spaces to the codes (so that MNE was actually MNE and so on). $p_code=trim($p_code) did the trick. I could still use that Bushmill's, though. At 03:57 PM 5/1/2001 -0700, Richard S. Crawford wrote: ...But my boss won't let me keep the Bushmill's at my desk. *sigh* So, assuming that $p_code is MNE and $neuroKey is 2, then $hub should be 2, right? Instead, it's coming up with 1, which is the value of $coreKey. What have I missed? $hub=$coreKey; if (($p_code==MNE)||($p_code=='SN')||($p_code=='PM')) { $hub=$neuroKey; } else if ($p_code==MAI) { $hub=$allergyKey; } else if (($p_code==SPS)||($p_code==MCC)) { $hub=$dermKey; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP]OT, but dual-boot operating system question
Beware if you're using WinNT or Windows 2000. Neither one plays nice with LILO. At 01:41 PM 4/30/2001 -0400, Toby Miller wrote: Your safest bet would probably be to look into RedHat Linux. It's a fairly straight forward Linux distribution. It also includes the LILO boot loader which is one way to boot into more than one operating system on the same machine. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Arrays in Classes
I'm quite new at object-oriented programming in PHP. Here's what I want to do. I want to create a class of objects called "lists". The properties I want to have for list objects include: owner of the list number of items in the list the list itself Each item in the list, of course, has several properties of their own: the date the item was added, the name of the item, and a link to the item. I figured that the list would be contained in an array of associative arrays... such as, item[0]["item"]="Palm Pilot" item[0]["dateAdded"]="2001-03-18" item[0]["link"]="http://www.palm.com" The lists will be built from a database which contains information about users and the lists that they maintain. The database part I have down pat. Properties of the list objects can be retrieved like this, of course... $myList=new List($userID); $num=$myList-numItems; $name=$myList-listOwner; What I'm wondering is, can I do something like this: for($i=0;$i$num;$i++) $itemList[$i]["item"]=$myList-item[$i]["item"]; If so, how??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP and the MIME type - an Apache question
Ah, sorry. Here's the deal. Our company runs Unix on Sun Solaris (sorry, don't know the numbers of the top of my head) servers. We have Apache set up to go through every HTML file which is served, and look for instances of a particular command. For example, in our HTML files, we might have commands such as "BOB-include" or something. When an HTML file is served, Apache calls a Perl module called parser.cgi which goes through the file and executes the BOB commands; in this case, the BOB-include command might mean to include a certain file, sort of like the PHP include command. While this system is good for specific database needs, it doesn't allow a large degree of flexibility, which is why we're beginning to explore using PHP to create complex scripts. What I would like to do is be able to include the BOB commands in the output of a PHP script -- say, in a print() command -- and have those BOB commands executed. I hope this makes sense. I'm trying to be as clear as possible without giving away any sensitive company information. Richard At 07:51 PM 3/9/01 -0700, Kelly Corkill wrote: I think it might help if you elaborated a little more on what you mean by "parse out all of my PHP scripts to run a particular CGI script". Apache has to be set up so know how to handle php (mime types), but it almost sounds like you're trying to execute a CGI in place of a php file? Also, if this IS a question related to apache what operating system? Makes a big diff. -- http://www.mossroot.com/index.php AIM Handle: Buffalo2K e-mail: [EMAIL PROTECTED] "When you lose the power to laugh at yourself, you lose the power to think straight." --Clarence Darrow -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP and the MIME type - an Apache question
I don't even know if this counts as a basic or an advanced question. Shows how much of a newbie I am. :) I'm trying to configure my Apache server to parse out all of my PHP scripts to run a particular CGI script when a PHP page is served. I know that in order to parse out HTML pages, I add this to my Apache configuration file: Action text/html [cgi script named here] What do I add to make it work for PHP pages? I tried Action text/html/php [cgi script named here] Help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP and the MIME type - an Apache question
Yes... Unfortunately, my question was not answered. I also added AddType text/php php to my httpd.conf file, but still no go. At 11:18 AM 3/10/01 +0900, Yasuo Ohgaki wrote: There is a great manual and FAQ. Did you read manual? FAQ? PHP Manual http://www.php.net/manual/en/ Install Section http://www.php.net/manual/en/installation.php FAQ http://www.php.net/FAQ.php Regards, Yasuo Ohgaki ""Richard S. Crawford"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I don't even know if this counts as a basic or an advanced question. Shows how much of a newbie I am. :) I'm trying to configure my Apache server to parse out all of my PHP scripts to run a particular CGI script when a PHP page is served. I know that in order to parse out HTML pages, I add this to my Apache configuration file: Action text/html [cgi script named here] What do I add to make it work for PHP pages? I tried Action text/html/php [cgi script named here] Help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- http://www.mossroot.com/index.php AIM Handle: Buffalo2K e-mail: [EMAIL PROTECTED] "When you lose the power to laugh at yourself, you lose the power to think straight." --Clarence Darrow -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Dynamic Links..
Yes, I should have mentioned... we actually do develop contracts outlining co-branding agreements with our partners before we establish a frameset. I should also mention that we don't use PHP for session tracking; we use a home-grown Perl/Oracle hybrid for session tracking. But I imagine that establishing a frameset like this would work for PHP session tracking as well. At 02:46 PM 3/8/01 -0400, Jon Haworth wrote: As a quick caveat you need to be *very* careful you're not obfuscating the target site copyright infringement, anyone? -- http://www.mossroot.com/index.php AIM Handle: Buffalo2K e-mail: [EMAIL PROTECTED] "When you lose the power to laugh at yourself, you lose the power to think straight." --Clarence Darrow -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Oracle Function Calls
Ah! My bad! I sent this question out with the wrong subject line. My apologies to everyone that I confused. At 01:07 PM 3/7/01 -0800, Richard S. Crawford wrote: I desperately need to know whether it is possible to call an Oracle function in PHP. For example... $functionResult=hubins($name,$commit_yn) where hubins is a stored procedure in our Oracle database. Can this be done? My first thought was to do something like this: $functionCall="hubins($name,$commit_yen)"; then then do ociexecute($functionCall); ...but that, of course didn't work. Any thoughts? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- http://www.mossroot.com/index.php AIM Handle: Buffalo2K e-mail: [EMAIL PROTECTED] "When you lose the power to laugh at yourself, you lose the power to think straight." --Clarence Darrow -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Dynamic Links..
At our company we solve this problem by including the second page in a frameset. That's what I would recommend for you. At 07:39 PM 3/7/01 -0400, Ashwin Kutty wrote: No, not the URL and therefore not HTTP_REFERER.. This is how it is.. My_Script.php redirects to Someone_Elses_Dynamically_Generated_Page.html Someone_Elses_Dynamically_Generated_Page.html has 'link' to another Page. I want My_Script.php to grab the a href="contents" of the 'link' and redirect to it, right after. The reason I want to do the above is, the first page dynamically creates a session id and attaches it to the 'link'.. I need that session id to continue on, and since this page is not on my server I cant control it.. Thanks.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- http://www.mossroot.com/index.php AIM Handle: Buffalo2K e-mail: [EMAIL PROTECTED] "When you lose the power to laugh at yourself, you lose the power to think straight." --Clarence Darrow -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Post without submit?
Without knowing exactly what you want to do, I would try something like the following in JavaScript: function doSubmit() { document.form.submit() } Then associate the function with any sort of desired event. In a project of mine, I have it attached to a keypress function so that the form is submitted when the user presses the enter key from the last form field. I suppose you could also put it in the BODY tag if you're feeling especially adventurous. At 12:23 AM 1/26/01 -0500, Chris wrote: is there anyway to post without clicking a submit button? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] FW: Cookies, Dammit!
Is there a way to: 1. Set cookies to a particular value (e.g., foo=hi and bar=ho), AND 2. Redirect the user to a new page in a different directory? AND 3. have the new page be able to retrieve the values of both foo and bar? I'm redirecting users from an index.htm page to an index.php page (because our server is not set up to have index.php as a default page), and trying to set cookies on the index.php page prior to redirecting the user to an index.htm page in an entirely different directory (why? because for some reason I thought it would streamline one of our processes). However, the cookies simply don't get set; a document.write command on the second index.html page shows that the value of the cookies is null. The value of the cookies are determined by the results of a query run against a MySQL directory, so they cannot be set on the first index.html page. I have been struggling with this conundrum for three days at this point, with no success. Let me know if this doesn't make sense. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] FW: Cookies, Dammit!
In this case, the value of the cookie is pulled from a database; the specific value depends on the URL at the user is redirecting from. If the user comes from www.domain.com/minisite1/index.htm then when they're directed to www.domain.com/index.htm, they should see "Welcome from minisite1"; but if they come from www.domain.com/minisite2/index.htm they should see "Welcome from minisite2" when they're redirected to www.domain.com/index.htm. it's a bit more complicated than that, but that's the general idea. Hope that helps. -- Richard S. Crawford Senior Web Developer NeuroHub, Inc. (916)789-4167 / (530)307-0069(cell) AIM Handle: Buffalo2K http://www.neurohub.net -Original Message- From: Jason Brooke [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 16, 2001 2:48 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] FW: Cookies, Dammit! The thing that usually intrigues me is why people design their application so that it needs to redirect to another page just so that they can attempt to read the cookie back. Do they not already have the value of the cookie in order to be able to set it? Why attempt to read it back straight away? jason Some browsers just can't handle a redirect and a set-cookie header in the same request. How you get PHP to generate these headers is irrelevant. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]