Re: [PHP] PHP generated JavaScript
On Mon, Feb 20, 2006 at 06:29:12PM +1030, Tim Burgan wrote: Is is possible to make an external Javascript with PHP. Am I doing this correcT? ?php header(Content-Type: text/javascript); $text = Hello World; echo alert('.$text.');; ? This looks perfectly fine. There are a few things you have to be careful with: - php strings can handle line endings, consider if you have: $text = Hello\nWorld; echo alert('. $text .'); You will end up with a javscript error. - A typical javascript file that resides on on a webserver will only be requested once from the webserver (pending cache settings) so resources for a page load will be minimal. If you have a php script output javascript, the browser will request the file on each request. Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: menu Q
YOU are the MAN! Thanks!!! -W Rafael [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED] I use Fx 1.5.0.1 and Opera 9-prev2 and everything seems to be Ok. The select it's inside a form, and my guess is that you haven't set any padding/margin for that form, so try adding something like FORM { padding: 0; margin: 0; } By the way, this questions should not be here, what Kim posted was a really better place to post it: http://www.css-discuss.org --having said that, I must confess I thought I was reading a message from that list, so maybe you got confused as well? William Stokes wrote: I have a select menu on a header bar on my page. The header bar is 20px high. The menu, code and style below, works ok on Opera but not in Ie6 or Firefox. In these browsers the menu 'streches' the bar height so that the bg image starts repeating itself. (looks nasty) It's almost like the menu prints one 'invisble' or empty row beneath the menu so that the header bar becomes about 30 or 35px high. Any ideas? [···] $sql=SELECT * FROM x_table ORDER BY sorter ASC; $result=mysql_query($sql); $num = mysql_num_rows($result); $cur = 1; print form name=\form\; print select name=\val_team\ size=\1\ id=\menu\ onChange=\javascript:goToURL()\; print option selected value=\\Valitse joukkue:/option; while ($num = $cur) { $row = mysql_fetch_array($result); $jouk_nimi = $row[jouk_nimi]; $team_id = $row[jouk_id]; print option value=\index.php?team=$team_id\$jouk_nimi/option; $cur++; } print /select; print /form; StyleSheet: #menu{ height: 18px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; text-align: left; background-color: #CC; BORDER-RIGHT: #FF 1px solid; BORDER-TOP: #FF 1px solid; BORDER-LEFT: #FF 1px solid; BORDER-BOTTOM: #FF 1px solid; COLOR: #FF; } -- Atentamente, J. Rafael Salazar Magaña Innox - Innovación Inteligente Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE [EMAIL PROTECTED] http://www.innox.com.mx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HN CAPTCHA at http://www.phpclasses.org
A bot could find it if it parses (and executes) javascript. Andrew - Original Message - From: Gerry Danen [EMAIL PROTECTED] To: comex [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Monday, February 20, 2006 3:58 AM Subject: Re: [PHP] HN CAPTCHA at http://www.phpclasses.org How would a bot find it though? On 2/19/06, comex [EMAIL PROTECTED] wrote: You got me. Where are you hiding it? In test.js: http://www.xn--ovg.com/no_bot/rpc.php?action=one Unless you hide it in a different place each time, how useful is that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Looping from A to Z
Richard K Miller wrote: Good afternoon. I'm having trouble getting PHP to loop from A through Z. Here is what I tried, coming from a C background: for ($l = A; $l = Z; $l++) echo $l; I use this: for($i='a'; $i != 'aa'; $i++){ print $i; | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need a php multiple/mysql choice quiz
I am looking for a php/mysql multiple choice quiz. One that saves the answers to a database. A basic example I can expand on is all that is required. Ross -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5.1.2/Apache2/WindowsXP
I am trying to use the DB PEAR extension. Every time it tries to connect, I get a memory cannot be read error. I have just setup all this to try out PHP5 so help to a newbie would be appreciated. Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: need a php multiple/mysql choice quiz
Ross wrote: I am looking for a php/mysql multiple choice quiz. One that saves the answers to a database. A basic example I can expand on is all that is required. Ross O_o - You want us to give you code examples? - You want us to give you hints? - link to scripts? - mushrooms? What do you want? A basic example. what is that? Basic example: Use php and mysql for example. Be a bit more precise please. Or this will end up like multiple choice here. Thank you barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: need a php multiple/mysql choice quiz
Barry wrote: Ross wrote: I am looking for a php/mysql multiple choice quiz. One that saves the answers to a database. A basic example I can expand on is all that is required. Ross O_o - You want us to give you code examples? - You want us to give you hints? - link to scripts? - mushrooms? what kind of mushrooms? and to the OP: google for your supper: http://www.google.com/search?num=100q=php+questionnaire http://www.google.com/search?num=100q=php+questionnaire+tool -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: need a php multiple/mysql choice quiz
Jochem Maas wrote: Barry wrote: Ross wrote: I am looking for a php/mysql multiple choice quiz. One that saves the answers to a database. A basic example I can expand on is all that is required. Ross O_o - You want us to give you code examples? - You want us to give you hints? - link to scripts? - mushrooms? what kind of mushrooms? rainbow colored ones =) -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: need a php multiple/mysql choice quiz
what kind of mushrooms? rainbow colored ones =) Think they're illegal in the UK... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: need a php multiple/mysql choice quiz
On 2/20/06, Dan Parry [EMAIL PROTECTED] wrote: what kind of mushrooms? rainbow colored ones =) Think they're illegal in the UK... Then move out of there quicker than fast, they're too tasty to miss! -- Kim Christensen [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: need a php multiple/mysql choice quiz
On Mon, 20 Feb 2006 16:24:32 - Dan Parry [EMAIL PROTECTED] wrote: what kind of mushrooms? rainbow colored ones =) Think they're illegal in the UK... I think just about EVERYTHING is illegal in the UK. Well, except for vacation time - that's just illegal in the US. #;-D Regards, Ozz. pgpRpC2xcQUBw.pgp Description: PGP signature
Re: [PHP] need a php multiple/mysql choice quiz
Hello Ross, Monday, February 20, 2006, 8:49:55 AM, you wrote: I am looking for a php/mysql multiple choice quiz. One that saves the answers to a database. A basic example I can expand on is all that is required. http://www.hotscripts.com/PHP/Scripts_and_Programs/Tests_and_Quizzes/index.html -- TBUDL/BETA/DEV/TECH Lists Moderator / PGP 0x6C0AB16B __ Geocaching:http://gps.PCWize.com ( ) ( ___)(_ _)( ___) TBUDP Wiki Site: http://www.PCWize.com/thebat/tbudp )(__ )__) _)(_ )__) Roguemoticons Smileys:http://PCWize.com/thebat ()()()(__)PHP Tutorials and snippets:http://www.DevTek.org Moderating is like trying to herd cats. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ajax was HN CAPTCHA...
Hi gang: The http://xn--ovg.com/no_bot was my first dive into ajax. What I found interesting was that the presentation on the screen wasn't also found in the code. That I'm sure is known to others, but it was a surprise to me. Immediately, I thought of CAPTCHA and other situations where you would want bots to see one thing while you presented what you wanted to your visitor. For example, it's easy to hide stuff from visually unimpaired visitors by using a far-left css technique -- in other words, moving text far left and out of the screen. However, this causes problems for the visually impaired because they still read it AND if a search engine concern (i.e., Google) catches you trying to deceive, then your site may be banned. I only present this because you could do it. Another example is presenting your email address on your site to a visitor while keeping it away from bots. That certainly works -- or at least I think it works -- I'm awaiting proof otherwise. As for bots detecting, parsing and executing the javascript to arrive at answer -- I'm sure they could, but I wonder how likely that would be? In any event, this is another CAPTCHA solution that works pretty good. My first impression of ajax is that this is very cool for creating non-auto-refreshing web pages. Now I'm off to experiment with it further. Thanks for the review guys. tedd -- http://sperling.com php code: http://www.weberdev.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Invalid Credentials
Hi, I have a simple php script that binds to an openldap server but I keep getting this error message; Warning: ldap_bind(): Unable to bind to server: Invalid credentials in /srv/www/site.com/check-user2.php on line 15 LDAP bind failed... The password is correct so I'm not quite sure why getting this error. Is there something wrong with my code? Here's the PHP script: ## ?php $ldapdn=$_POST['users']; $basedn=$_POST['dn']; $ldappass=$_POST['pw']; ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3); $ldapconn = ldap_connect(192.168.15.130) or die(Could not connect to LDAP server.); if ($ldapconn) { // binding to ldap server $ldapbind = ldap_bind($ldapconn, $ldapdn . $basedn, $ldappass); // verify binding if ($ldapbind) { echo LDAP bind successful...; } else { echo LDAP bind failed...; } } ? Here's the HTML form: html head titleLDAP Authentication/title /head body form name=Login method=post action=check-user2.php table tr tdUser Name/td td select name=users option value=uid=bobbyBobby/option option value=uid=feliciaFelicia/option /select INPUT TYPE=hidden NAME=dn value=ou=people,dc=site,dc=com/td /tr tr tdPassword/td tdinput type=password name=pw /td /tr /table input type=image src=images/login.gif alt=Login name=image /form /body /html # - Delamatrix -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP documentation solutions? (PHPDoc, Doxygen, ???)
Ok, so we're starting to get a little more serious about this product we're working on and may in the near future try to standardize and flesh out our coding and product documentation (always a nice thing). I'm semi-familiar with PHPDoc (http://www.phpdoc.org) but my boss just pointed me toward Doxygen (http://www.stack.nl/~dimitri/doxygen/) as a possible solution. Just wondering if anyone has had any practical experience with either/both or have an alternative that they enjoy using? I like the idea of being able to specify internal (developers) documentation as well as end user product documentation but maybe there's other features people have found useful as well that we havn't thought of yet. Thanks. -TG ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newbie problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear php-users, When working with an HTML file with a form with form action=somename.php method=post the somename.php file is served (completely) to my browser as plain text after the 'submit' button is clicked on my machine (MacOS X). On the external webhost though everything is processed correctly... Is this related to some setting that I should change on my localhost? Thanks, Robert. -BEGIN PGP SIGNATURE- Version: PGP SDK 3.0.3 iQA/AwUBQ/oVBLSl/DgWyrAzEQL52wCdGqw+d3sTJo5pEVwLy28KTn+/eYAAn188 5DD5Y4UbSBXHjC1japDLp3yK =uUgZ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] newbie problem
[snip] When working with an HTML file with a form with form action=somename.php method=post the somename.php file is served (completely) to my browser as plain text after the 'submit' button is clicked on my machine (MacOS X). On the external webhost though everything is processed correctly... Is this related to some setting that I should change on my localhost? [/snip] Are you working on localhost or the remote server? Have you uploaded the form to the remote server? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP documentation solutions? (PHPDoc, Doxygen, ???)
[snip] Ok, so we're starting to get a little more serious about this product we're working on and may in the near future try to standardize and flesh out our coding and product documentation (always a nice thing). I'm semi-familiar with PHPDoc (http://www.phpdoc.org) but my boss just pointed me toward Doxygen (http://www.stack.nl/~dimitri/doxygen/) as a possible solution. Just wondering if anyone has had any practical experience with either/both or have an alternative that they enjoy using? I like the idea of being able to specify internal (developers) documentation as well as end user product documentation but maybe there's other features people have found useful as well that we havn't thought of yet. [/snip] I have tried PHPdoc, but I have not tried Doxygen. After reading the features of Doxygen I would be tempted to give it a try, because I found that PHPdoc doesn't do everything that I want in an auto-doc application. I know that this is not much help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie problem
Robert Voogdgeert wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear php-users, When working with an HTML file with a form with form action=somename.php method=post the somename.php file is served (completely) to my browser as plain text after the 'submit' button is clicked on my machine (MacOS X). On the external webhost though everything is processed correctly... Is this related to some setting that I should change on my localhost? snip Is your localhost parsing php documents? If you're using Apache, do you have a line like this in you httpd.conf AddType application/x-httpd-php .php -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP documentation solutions? (PHPDoc, Doxygen, ???)
On Mon, 2006-02-20 at 13:51, [EMAIL PROTECTED] wrote: Ok, so we're starting to get a little more serious about this product we're working on and may in the near future try to standardize and flesh out our coding and product documentation (always a nice thing). I'm semi-familiar with PHPDoc (http://www.phpdoc.org) but my boss just pointed me toward Doxygen (http://www.stack.nl/~dimitri/doxygen/) as a possible solution. Just wondering if anyone has had any practical experience with either/both or have an alternative that they enjoy using? I like the idea of being able to specify internal (developers) documentation as well as end user product documentation but maybe there's other features people have found useful as well that we havn't thought of yet. In the spirit of re-inventing the wheel... I rolled my own JinnDoc. I now use it to maintain my PHP and JavaScript source code documentation. Example output can be found from here: http://www.interjinn.com/jinnDoc/index.phtml Example markup can be found here (view the source): http://www.interjinn.com/javaScript/interJinn/Core/httpRequest.js Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Page validation: Un-wanted PHP session ID added to links????
Hi, I just finished a website for client - I just uploaded the site to their server space - when I went to go validate my pages using the W3C XHTML validator I get several errors due to an un-encoded ampersand in the link URL... For some reason, a session ID is getting added to the end of all my menu links: /start.php?page=homePHPSESSID=45142bb20b8b2e800be5359b667237 Ummm, can I turn this off? I tested/built the site on my server and never got this problem. I am sure it is an easy fix. Suggestions? Links? Many thanks in advance. Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Page validation: Un-wanted PHP session ID added to links????
Michael Hulse wrote: Hi, I just finished a website for client - I just uploaded the site to their server space - when I went to go validate my pages using the W3C XHTML validator I get several errors due to an un-encoded ampersand in the link URL... For some reason, a session ID is getting added to the end of all my menu links: /start.php?page=homePHPSESSID=45142bb20b8b2e800be5359b667237 Ummm, can I turn this off? I tested/built the site on my server and never got this problem. I am sure it is an easy fix. Suggestions? Links? It's all in the manual http://us3.php.net/session -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Page validation: Un-wanted PHP session ID added to links????
Michael Hulse wrote: I just finished a website for client - I just uploaded the site to their server space - when I went to go validate my pages using the W3C XHTML validator I get several errors due to an un-encoded ampersand in the link URL... For some reason, a session ID is getting added to the end of all my menu links: /start.php?page=homePHPSESSID=45142bb20b8b2e800be5359b667237 http://www.w3.org/QA/2005/04/php-session details how to fix the problem (without breaking the session tracking for users without cookies supported and enabled). -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Page validation: Un-wanted PHP session ID added to links????
On Feb 20, 2006, at 12:10 PM, John Nichel wrote: It's all in the manual Hi, thanks for pointing that out. I guess I should have RTFM first, then ask q's second... noob mistake, wont happen again. :D I guess I just do not understand why a session is even being created, I never started one... I guess I need to read the manual in more detail (doing now). Thanks for the quick response. :) Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Page validation: Un-wanted PHP session ID added to links????
On Feb 20, 2006, at 12:11 PM, David Dorward wrote: http://www.w3.org/QA/2005/04/php-session details how to fix the problem (without breaking the session tracking for users without cookies supported and enabled). Ah, great link. Thanks! :) I don't know why sessions are being stored in the first place, but at least I can fix the validation prob. Cheers! Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Page validation: Un-wanted PHP session ID added to links????
Michael Hulse wrote: On Feb 20, 2006, at 12:10 PM, John Nichel wrote: It's all in the manual Hi, thanks for pointing that out. I guess I should have RTFM first, then ask q's second... noob mistake, wont happen again. :D I guess I just do not understand why a session is even being created, I never started one... I guess I need to read the manual in more detail (doing now). Thanks for the quick response. :) Micky The server you're running the script on may have session.auto_start enabled -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP documentation solutions? (PHPDoc, Doxygen, ???)
[snip] In the spirit of re-inventing the wheel... I rolled my own JinnDoc. [/snip] My single largest arguement against these kinds of tools were the additional mark-up required. Code commentary, done properly, can yield the same results without additional mark-up. I'd rather be able to insert a code comment or html comment with a simple 'type' to tell me what the commentary is. It makes it much more universal where auto-doc harvesters are concerned and removes the requirement for page level elements to be stated first, etc. example(s) /* type=description * * describe whatever is being described here */ or !-- type=description whatever is being described -- or $myBigVar = 'large' //type=variable -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [SOLVED] [PHP] Page validation: Un-wanted PHP session ID added to links????
This did the trick: ?php ini_set('arg_separator.output','amp;'); ? On Feb 20, 2006, at 12:37 PM, John Nichel wrote: The server you're running the script on may have session.auto_start enabled Ah, got it. :) Thanks all! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP documentation solutions? (PHPDoc, Doxygen, ???)
On Mon, 2006-02-20 at 15:38, Jay Blanchard wrote: [snip] In the spirit of re-inventing the wheel... I rolled my own JinnDoc. [/snip] My single largest arguement against these kinds of tools were the additional mark-up required. Code commentary, done properly, can yield the same results without additional mark-up. I'd rather be able to insert a code comment or html comment with a simple 'type' to tell me what the commentary is. It makes it much more universal where auto-doc harvesters are concerned and removes the requirement for page level elements to be stated first, etc. example(s) /* type=description * * describe whatever is being described here */ or !-- type=description whatever is being described -- or $myBigVar = 'large' //type=variable I see your point and considered it before I rolled my own, but rolling my own using the existing TemplateJinn system allowed me the flexibility of custom tags and all the goodies that already come with the TemplateJinn system making it that much easier to incorporate JinnDocs into any existing page layout scheme or whatnot and to make use of the already existing site compilation system. Also with the system you describe precision formatting becomes necessary since the parser needs to pull out implied details based on blank lines, spacing, indentation, etc... but as you also show it can make for a cleaner inline document :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP documentation solutions? (PHPDoc, Doxygen, ???)
[snip] I see your point and considered it before I rolled my own, but rolling my own using the existing TemplateJinn system allowed me the flexibility of custom tags and all the goodies that already come with the TemplateJinn system making it that much easier to incorporate JinnDocs into any existing page layout scheme or whatnot and to make use of the already existing site compilation system. Also with the system you describe precision formatting becomes necessary since the parser needs to pull out implied details based on blank lines, spacing, indentation, etc... but as you also show it can make for a cleaner inline document :) [/snip] I can see where yours dovetails neatly with your InterJinn framework and agree with your take on it in this context. Where general documentability is concerned I would rather give a well defined list of comment types to my development team and roll the documentor from there. If the comment had no 'type' you could still harvest it and use it appropriately. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP documentation solutions? (PHPDoc, Doxygen, ???)
Jay Blanchard wrote: [snip] In the spirit of re-inventing the wheel... I rolled my own JinnDoc. [/snip] My single largest arguement against these kinds of tools were the additional mark-up required. Code commentary, done properly, can yield the same results without additional mark-up. I'd rather be able to insert a code comment or html comment with a simple 'type' to tell me what the commentary is. It makes it much more universal where auto-doc harvesters are concerned and removes the requirement for page level elements to be stated first, etc. example(s) /* type=description * * describe whatever is being described here */ or !-- type=description whatever is being described -- or $myBigVar = 'large' //type=variable Before each function I create, I have this: /* // Function: getCategoryEmail // Description : Retrieves a list of email addresses based on // past orders per category // Requires: $catids (Array) - Array of category ids // $id (Integer) - The DCHOB site id // Optional: None // Returns : Array with email addresses and stats; false on // failure // Author : John Nichel // Email : [EMAIL PROTECTED] // Created : 20 Mar 05 // Modified: // Modified By : // Mod Email : // Mod Date: */ Major block of code... /* // Description : Checks if customer has come in thru BorderFree; // sets appropriate flags if true // Expected: If a BorderFree id is set either in the POST or // GET request, assign id to users session so it // so that it will be available should customer // attempt to purchase. If id does not match known // BF syntax, email admin with name/value pair; set // flag for normal checkout with logging // Author : John Nichel // Email : [EMAIL PROTECTED] // Created : 20 Mar 05 // Modified: // Modified By : // Mod Email : // Mod Date: */ Variables... $foo = bar // This is what this variable is for So on, and so forth. I am the IT department here, so I'm not worried about documenting it yet. ;) -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php+ ajax
Hello, I am trying to do a pre-search to let the users know how many rows will be returned before they actually hit submit. I think this is more of a js question but : I have this js function: function preSearch() { //Put the form data into a variable var min_price= document.getElementById('min_price').value ; var max_price= document.getElementById('max_price').value ; document.getElementById('prop_num').innerHTML = Searching...; var url = 'ajax.php?min_price=' + min_price +'max_price=' + max_price; xmlhttp.open('GET', url, true); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 xmlhttp.status == 200) { document.getElementById('prop_num').innerHTML ='TotalRecords: ' + xmlhttp.responseText + ' '; } else { //If the PHP script fails to send a response, or sends back an error, display a simple user-friendly notification document.getElementById('prop_num').innerHTML = ''; } }; xmlhttp.send(null); // } } And have this for inputs: input name=min_price id=min_price etc. I would really like to have all of my inputs has part of an arry so: input name=search[min_price] id=search[min_price] etc The problem is js seems to get confused trying to look this up by id and I don't think I can use an array like this with a GET, how can I use arrays for all this?? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php+ ajax
On 2/20/06, blackwater dev [EMAIL PROTECTED] wrote: The problem is js seems to get confused trying to look this up by id and I don't think I can use an array like this with a GET, how can I use arrays for all this?? You have to escape the brackets with backslashes, so that the JS really interprets it as an element ID - not an array. Something like this might work: [snip] (HTML) input name=search[min_price] id=search[min_price] (JS) var min_price= document.getElementById('search\[min_price\]').value ; [/snip] -- Kim Christensen [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Request for views on ASP/PHP/ASP.NET - please!
Hi guys, A bit of an odd request. I'm in my third and final year at university, and part of an assignment requires obtaining developers' perspective on web languages. If anyone has done at least one of the languages in the subject title (ASP/ASP.NET/PHP), I would be eternally grateful if you could pop to (and also send any other web developers you know to) http://www.coralsystemsolutions.co.uk/uni Theres a maximum of 14 short questions (depending on answers to the other questions), all optional, just fill out as much as you can be bothered with, then click submit a few times until its saved. Thank you very much in advance! Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Working with a config file
I'm trying to parse a config file, example of the config is: [fred] id=8782 section=s1 years=4 download1=mirror1 [frank] id=8372 section=s3 years=4 download1=mirror12 download2=mirror2 . . . I want to parse this so I can only call frank or freds data and move id, section, years, etc to varaibles. Can someone give me some help Thanks Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php+ ajax
Kim Christensen wrote: On 2/20/06, blackwater dev [EMAIL PROTECTED] wrote: The problem is js seems to get confused trying to look this up by id and I don't think I can use an array like this with a GET, how can I use arrays for all this?? You have to escape the brackets with backslashes, so that the JS really interprets it as an element ID Element ids may not contain square brackets in HTML documents. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert Voogdgeert wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear php-users, When working with an HTML file with a form with form action=somename.php method=post the somename.php file is served (completely) to my browser as plain text after the 'submit' button is clicked on my machine (MacOS X). On the external webhost though everything is processed correctly... Is this related to some setting that I should change on my localhost? snip Is your localhost parsing php documents? If you're using Apache, do you have a line like this in you httpd.conf AddType application/x-httpd-php .php -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] John, My httpd.conf has the following: IfModule mod_php4.c # If php is turned on, we repsect .php and .phps files. AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps Robert -BEGIN PGP SIGNATURE- Version: PGP SDK 3.0.3 iQA/AwUBQ/pDjrSl/DgWyrAzEQJLyQCgvVwSVICv4tRgp6r5GQMdMXfR78cAoO9Y CROHvZImh4LFXGxWV0UoUgld =qSjr -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie problem
On Monday 20 February 2006 15:32, Robert Voogdgeert wrote: Robert Voogdgeert wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear php-users, When working with an HTML file with a form with form action=somename.php method=post the somename.php file is served (completely) to my browser as plain text after the 'submit' button is clicked on my machine (MacOS X). On the external webhost though everything is processed correctly... Is this related to some setting that I should change on my localhost? snip Is your localhost parsing php documents? If you're using Apache, do you have a line like this in you httpd.conf AddType application/x-httpd-php .php -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] John, My httpd.conf has the following: IfModule mod_php4.c # If php is turned on, we repsect .php and .phps files. AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps Robert Is the file in one of your home folders, or in a folder that Apache is configured to check? (I've seen that happen from time to time) eg. file in /home/myhome/projects/file.php or file in /var/www/htdocs/file.php Also, was apache restarted after allowing PHP (if applicable) -- Ray Hauge Programmer/Systems Administrator American Student Loan Services http://www.americanstudentloan.com 1.800.575.1099 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Working with a config file
On Feb 20, 2006, at 2:21 PM, Benjamin Adams wrote: I want to parse this so I can only call frank or freds data and move id, section, years, etc to varaibles. Can someone give me some help Here is a function I wrote, I bet it will help you (sorry, not the most readable because I pulled from bigger application I wrote, hopefully you can translate to suit your needs): $ini = File to parse. e.g.[ 'rand_01.ini' ] You might want to change extension of your config to .ini, not sure if that will matter. $images = get_ini_file($ini); // Call $get_ini_file() function, put in $images array. / function get_ini_file(): / Reads ini file for other functions: function get_ini_file($ini) { global $PATH_TO_INI, $DEFAULT_INI_FILE; # if no custom ini file has been specified, use the default: $ini_file = $ini ? $PATH_TO_INI.$ini : $PATH_TO_INI.$DEFAULT_INI_FILE; # read the config file into an array or die trying: $parsed_ini = @parse_ini_file($ini_file, true); if(!$parsed_ini) { die('[ Unable to read ini file! ]'); } else { return $parsed_ini; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Working with a config file
Benjamin Adams wrote: I'm trying to parse a config file, example of the config is: [fred] id=8782 section=s1 years=4 download1=mirror1 [frank] id=8372 section=s3 years=4 download1=mirror12 download2=mirror2 . . . I want to parse this so I can only call frank or freds data and move id, section, years, etc to varaibles. Can someone give me some help Thanks Ben --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you´ve a php 5 environment I would recommend the Configuration Package of the newly releases ezComponents. Components overview: http://ez.no/doc/components/overview Fast, feature-rich and easy to use, hava a look at the tutorial: http://ez.no/doc/components/view/(file)/1.0/introduction_Configuration.html -Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Proper OOP Syntax
Given the following code: $password = (strlen($this-user_pw) 32) ? md5($this-user_pw) : $this-user_pw; $sql = sprintf(SELECT COUNT(*) AS test, TeamID FROM %s WHERE BINARY login = '%s' AND pw = '%s' AND active = 'y', $this- table_name, $this-user, $password); } $result = mysql_query($sql) or die(mysql_error()); if (mysql_result($result, 0, test) == 1) { return true; } else { return false; } How would I set a session variable for the value of TeamID? Thanks. Albert Padley -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Proper OOP Syntax
Albert Padley wrote: Given the following code: $password = (strlen($this-user_pw) 32) ? md5($this-user_pw) : $this-user_pw; $sql = sprintf(SELECT COUNT(*) AS test, TeamID FROM %s WHERE BINARY login = '%s' AND pw = '%s' AND active = 'y', $this- table_name, $this-user, $password); } $result = mysql_query($sql) or die(mysql_error()); if (mysql_result($result, 0, test) == 1) { return true; } else { return false; } How would I set a session variable for the value of TeamID? You'll need to change it so you actually fetch the teamid: $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); if (empty($row)) { return false; } $_SESSION['TeamID'] = (int)$row['TeamID']; return true; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Proper OOP Syntax
Thank you Chris. Albert On Feb 20, 2006, at 5:00 PM, Chris wrote: Albert Padley wrote: Given the following code: $password = (strlen($this-user_pw) 32) ? md5($this-user_pw) : $this-user_pw; $sql = sprintf(SELECT COUNT(*) AS test, TeamID FROM % s WHERE BINARY login = '%s' AND pw = '%s' AND active = 'y', $this- table_name, $this-user, $password); } $result = mysql_query($sql) or die(mysql_error()); if (mysql_result($result, 0, test) == 1) { return true; } else { return false; } How would I set a session variable for the value of TeamID? You'll need to change it so you actually fetch the teamid: $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); if (empty($row)) { return false; } $_SESSION['TeamID'] = (int)$row['TeamID']; return true; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie problem
Hi all, I have a page that lets people upload images - they are then resized for use throughout my site. It all works fine, but I need to reduce the jpg size (without reducing image size) Is there a php function that lets you compress the jpg? Thanks Jules -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Different Values for intval(float)
Interestingly enough, I tried it on several of my machines, which are different platforms and different (sub)versions of PHP and I got different results: RH7.3 with PHP 4.1.2: 2113879380 IRIX 6.5.11 with PHP 4.2.3: 2147483647 FC1 with PHP 4.3.6: 2113879380 RH7.3 with PHP 4.3.9: 2113879380 FC3 with PHP 4.3.10: -2147483648 FC4 with PHP 4.4.0: -2147483648 FC4 with PHP 5.0.5: -2147483648 So my question now, is it version or platform related? I'd guess it depends on the compiler on the machine and (maybe) the libc version. Probably best to ask on the developer list about it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Distribution of records
Hi Alan, Formation OCall DCall OYards Key The key is an amalgam of the first 3 fields so a typical record might look like this:- Formation - I OCall - RT DCall - BZ OYards - 5 Key - IRTBZ What I want to do is to produce report that looks like this:- Form OCall DCall OYards - Median OYards - Mean OYards 0 OYards 0 - 4 OYards 5+ So in other words for every combination of Formation, OCall and DCall I want to report how many times it occured, what the Median and Mean values were and what the distribution of plays was. I reckon I'm going to have to create an array and then loop over the array pulling out the relevant information but are there any special techniques I should consider? You should be able to do this all in sql. Something like: select formation, count(formation) AS timesrun, ocall, dcall, AVG(oyards) FROM table GROUP BY formation, ocall, dcall; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fw: [PHP] regular pattern to match XXX
Satyam wrote: - Original Message - From: Patrick [EMAIL PROTECTED] im trying to get my regular pattern to allow åäöÅÄÖ but it refuses to, i have something like this: [^a-zA-ZåäöÅÄÖ0-9-_ ] But this dosent seem to work, anyone got any ideas? Just an idea, try putting a backslash before the non-ASCII characters, perhaps that will force the function to take them literally instead of making who knows what assumption about them. And let me know if it works because we use diacritical marks in Spanish, who know when I might need it. Satyam Are these characters multibyte? You might need to use the mb_ereg_match function rather than the regular ereg functions: http://www.php.net/manual/en/function.mb-ereg-match.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] question about foreach and associate array
jonathan wrote: I have the following construct: $arg['textarea']['body']=Hello; foreach($arg['textarea'] as $row) { echo $row['body'].br/; echo $arg['textarea']['body'].br/; } I would expect both of them to output Hello but only the second does. The first outputs H. I thought I have done this before. Can anybody tell me why this won't work? You have an associative array so you need to specify both parts: foreach($arg['textarea'] as $area = $entry) { echo $area . 'br/'; // body echo $entry . 'br/'; // hello } Your method works ok for indexed arrays like: $array[1] = XYZ; $array[2] = ABC; etc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Request for views on ASP/PHP/ASP.NET - please!
Well, I would like to know what conclusion you got, so if possible let me know when you have enough data/finished you work. Simon O'Beirne wrote: Hi guys, A bit of an odd request. I'm in my third and final year at university, and part of an assignment requires obtaining developers' perspective on web languages. If anyone has done at least one of the languages in the subject title (ASP/ASP.NET/PHP), I would be eternally grateful if you could pop to (and also send any other web developers you know to) http://www.coralsystemsolutions.co.uk/uni Theres a maximum of 14 short questions (depending on answers to the other questions), all optional, just fill out as much as you can be bothered with, then click submit a few times until its saved. Thank you very much in advance! Simon -- Atentamente, J. Rafael Salazar Magaña Innox - Innovación Inteligente Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE [EMAIL PROTECTED] http://www.innox.com.mx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Working with a config file
On Tue, 2006-02-21 at 00:14 +0100, Jens Kleikamp wrote: Benjamin Adams wrote: I'm trying to parse a config file, example of the config is: [fred] id=8782 section=s1 years=4 download1=mirror1 [frank] id=8372 section=s3 years=4 download1=mirror12 download2=mirror2 . Config files of this type in PHP anyway, are generally generated by the PEAR Config package. Luckily for you it works both ways (creating and reading the files) so its really easy to work with. The Config package also supports all sorts of nifty features that will make your life easier working with this file. HTH --Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] question about foreach and associate array
Just do: $arg['textarea']['body']=Hello; foreach($arg['textarea'] as $row) { echo $row.br/; echo $arg['textarea']['body'].br/; } The $row is an string, and what you are trying to do the $row['body']. And php will translate 'body' to 0 in this, I do not know why :) Try echo $row['body']. $row[1]. $row[1]. $row[2]. $row[3]. $row[4]; It will probably echo Hello for you :) /Peter -Original Message- From: jonathan [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 21, 2006 9:58 AM To: php-general@lists.php.net Subject: [PHP] question about foreach and associate array I have the following construct: $arg['textarea']['body']=Hello; foreach($arg['textarea'] as $row) { echo $row['body'].br/; echo $arg['textarea']['body'].br/; } I would expect both of them to output Hello but only the second does. The first outputs H. I thought I have done this before. Can anybody tell me why this won't work? thanks, jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HOSTNAME Environment variable
Hi, How to set Hostname environment variable? (It contains the servers name, not the servers domain) Its a Linux server. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php