Re: [PHP] Most secure way to send a password
| | JavaScript doesn't implement any kind of one-way hashing. But that's for a | good reason: suppose JavaScript encoded your password and sent it encoded to | the server. The in-between hacker would retrieve the encoded password as it | is sent to the server and simply pass that as the password - he doesn't ever | need to know your undencoded password to break in, since the server expects | it to be encoded anyway! and what about those guys who visit your site, download your page with the javascript encoder in the source HTML, and finds out how a crypted password can be decrypted? I 'm not aware of how the javascript source can be hidden. | So you're only left with SSL for proper security... Yes. SSL must be developed for reasons of this kind. | | HTTP_AUTH is just another way of sending the unsername and password as plain | text -- it's just more comfortable to use than checking if you have proper | credeintials in every page. My personal recommendation is to forget about | HTTP_AUTH and use SSL plus phplib for proper security. Yes, agreed.
Re: [PHP] PostgreSQL query taking a long time
use EXPLAIN to get more information about how postgres executes this query. I'm not sure about this, but there are some issues with fields of type int8. It may help to cast explicitly the fields involved in join like: WHERE bible.book::int4 = books.id::int4 Ask it the postgres mailing list, too! btw, what version of pg do you have? - Original Message - From: K Old [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 21, 2001 5:51 PM Subject: [PHP] PostgreSQL query taking a long time | Hello all, | | I have a PostgreSQL database that is storing The Bible. It has 31,103 | records in it and I have a PHP page executing this query: | SELECT | books.book_name, bible.chapter, bible.verse, bible.versetext | FROM asv_bible bible, book_bible books WHERE bible.book = books.id ORDER BY | random() LIMIT 1 | | The database schema is: | | /* | Sequences | */ | CREATE SEQUENCE book_bible_seq start 1 increment 1 maxvalue 2147483647 | minvalue 1 cache 1; | | /* | Table structure for table asv_bible | */ | CREATE TABLE asv_bible ( |id int8 NOT NULL, |book int8, |chapter int8, |verse int8, |versetext text, |CONSTRAINT asv_bible_pkey PRIMARY KEY (id) | ); | | | | /* | Table structure for table book_bible | */ | CREATE TABLE book_bible ( |id int4 DEFAULT nextval('book_bible_seq'::text) NOT NULL, |book_name varchar(20), |CONSTRAINT book_bible_pkey PRIMARY KEY (id) | ); | | Right now it takes 9 seconds to return the results. I was wondering if | anyone could offer any help with lowering the time it takes to run? | | Or if this is the normal runtime for a database of this size, I'd just like | confirmation. | | Thanks, | Kevin | | | _ | Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. | | | -- | 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] array_walk() + class methods
array_walk($ar, array($object, 'methodname')); - Original Message - From: Jeff Levy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 13, 2001 1:17 PM Subject: [PHP] array_walk() + class methods | I'd like to call a class method with array_walk(). Is this possible? | | class widget { | function sicballs($arg){ | print $arg; | } | } | | $x = new widget(); | | $ar = array('my','values'); | | array_walk($ar, ???) | | ... | | the only way I've been able to get this (simplified) code to work the way | I want it is: | | function snafu($arg) { | global $x; | call_user_method(sicballs, $x, $arg); | } | | obviously, I want to call the method direcly, without writing this | function, snafu()... | | anyone know? | | -- | 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] Costum Error Page
there is an example in the apache docs or httpd.conf samples how to pass to error script the original request uri, ins't there any? - Original Message - From: Ashley M. Kirchner [EMAIL PROTECTED] To: Daniel Urstger [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, December 08, 2001 4:02 AM Subject: Re: [PHP] Costum Error Page | Daniel Urstger wrote: | | How could I check, which file apache tried to access, and didnt found ? | That would be a pretty nice function for my PHP skript .. | | Check your REQUEST_URI variable. | | -- | H | Life is the art of drawing without an eraser. - John Gardner | + | Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 | Director of Internet Operations / SysAdmin. 800.441.3873 x130 | Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6 | http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. | | | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | To contact the list administrators, e-mail: [EMAIL PROTECTED] |
Re: [PHP] WDDX
What do you get as result from a 'Show source...' in your browser? AFAIK, NS4.76 does not display unrecognized HTML element, and it treats your script's output as HTML source. try: ?php print (htmlspecialchars(wddx_serialize_value($one_var))); ? - Original Message - From: con pulpa [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, December 08, 2001 11:57 AM Subject: [PHP] WDDX | Hi EVERYONE! | | I'm running RH7.1 with PHP version 4.04pl1 and | Apache1.3.19-5. A simple php script ?php phpinfo(); ? | tells me that the library is configured with the | '--enable-wddx' and '--with-xml' options. | | I'm using netscape4.76 and konqueror(kde 2.1.1) browser. | | Now running a slightly more complicated script from one of | the online tutorials | | ?php | $one_var = I was serialized on 2001-12-08; | print wddx_serialize_value($one_var); | ? | | I find that it produces no output at all! | There are no errors reported in the log files... | | Then, if I put an echo statement before the print: | ?php | echo ==WDDX Test; | $one_var = I was serialized on 2001-12-08; | print wddx_serialize_value($one_var); | ? | | I get the following output. | ==WDDX Test I was serialized on 2001-12-08 | | I'm not too concerned about this wierd behaviour; | However, I was expecting this code to produce something | dressed in XML: | | wddxPacket version='0.9' | data | stringI was serialized on 2001-12-08/string | /data | /wddxPacket | | Can anyone help me? | | Thanks, Conpulpa | | | | | | | _ | Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp | | | -- | 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] |
Fw: [PHP] Need a script that will read Apache Log files and generate reports
maybe this is what you need. - Original Message - From: Chris Allen [EMAIL PROTECTED] To: Dan McCullough [EMAIL PROTECTED]; PHP General List [EMAIL PROTECTED] Sent: Monday, November 26, 2001 11:21 PM Subject: Re: [PHP] Need a script that will read Apache Log files and generate reports | http://www.analog.cx/ | Subject: [PHP] Need a script that will read Apache Log files and generate | reports | | | | | -- | 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_user_func problem
| That means that you should create a .htaccess file containing that: | | php_value allow_call_time_pass_reference 1 | | That should work :) But as the errormessage mentioned it may not supported in future version. I think if you declare your function arguments to be passed by variables then you don't need to explicitly set it in call-time. does it work? (i've not tried yet.) $result = call_user_func(foo, $bar); function foo( $bar ) { $bar .= 'foobar'; return 1; } | | C Prior to 4.0.6 it worked fine, however, now when I try: | | C $result = call_user_func(foo, $bar); | | C function foo( $bar ) { | C$bar .= 'foobar'; | Creturn 1; | C } | | C I get this: | | C Warning: Call-time pass-by-reference has been deprecated - argument passed | C by value; If you would like to pass it by reference, modify the declaration | C of call_user_func(). If you would like to enable call-time | C pass-by-reference, you can set allow_call_time_pass_reference to true in | C your INI file. However, future versions may not support this any longer. | | C Does that mean I can't pass by reference anymore? I kinda need to (the two | C functions above are not my actual functions btw) | | | | Ivan 'Faeton aka xetrix' Danishevsky | ICQ(240266) [EMAIL PROTECTED] www.xemichat.com | ::: p . y, . ::: | | | -- | 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] Session Help
PHP automatically calls the appropiate function instead if you. But consider that the save handler is not called on individual session_register functions, only when all output is gone, and the whole session - each registered variable - must be saved. manual Note: The write handler is not executed until after the output stream is closed. Thus, output from debugging statements in the write handler will never be seen in the browser. If debugging output is necessary, it is suggested that the debug output be written to a file instead. /manual - Original Message - From: phantom [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 30, 2001 10:10 AM Subject: [PHP] Session Help | I am trying to set my session data to be stored in MySQL so I am using | session_set_save_handler() which sets the six user-level session storage | functions (which I have already defined). | | Will session_set_save_handler automatically run the appropiate storage | function when required (like when i say session_register(Variable)) | --OR-- do I specifically have to run that function | (mysql_sessions_write(SID,$Value)) from my script when I want to save | info to the session table? | | I would appreciate any scripts anyone might have that would illustrate | how this works, the PHP manual and online examples I have found just are | not cutting it. | | Thank you. [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] WHat has happened to parse_str in the Docs????
Hello, The manual says that parse_str does it. (btw, I didn't try it) Look on the second sentence pasted here. manual void parse_str (string str, array [arr]) Parses str as if it were the query string passed via an URL and sets variables in the current scope. If the second parameter arr is present, variables are stored in this variable as an array elements instead. /manual - Original Message - From: Brian White [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 1:11 AM Subject: [PHP] WHat has happened to parse_str in the Docs | I have had a good hunt around the www.php.net site and I can find no reference | to the parse_str function in the docs, except as what looks like | cached results in old searches. | | Anyway - the reason I ask is I was wondering if there was a function that | did what parse_str did, except that it put the results of parsing the | query string into an associative array rather than creating variables. | I have a vague recollection of something like that | | Regs | | Brian White | | - | Brian White | Step Two Designs Pty Ltd - SGML, XML HTML Consultancy | Phone: +612-93197901 | Web: http://www.steptwo.com.au/ | Email: [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] error handling and __LINE__
try, assert() instead of echo()ing error messages. assert('is_object($obj)'); and write your error handler code or use mine :) or am i missing something? Papp Gyozo - [EMAIL PROTECTED] - Original Message - From: SafeV [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 4:15 PM Subject: [PHP] error handling and __LINE__ | Hi, | I wonder if there's a way to find the line number of the calling script | from a function, like the error messages PHP generates. An example: | | In an included file I have a function and want to do something similar to: | | function foo($obj) { | if (!is_object($obj)) { | echo Error: supplied argument is not an object in ; | echo __FILE__ . line . __LINE__; | } | ... | } | | But __FILE__ and __LINE__ refers to the current file, ie. the file with | the function in, and not the file where the function is called from. | The first one I can solve by using $SCRIPT_NAME, but what about the line | number??? | | | | -- | 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] Form's : making me sick!
I just want to know how to make a form inside a form get to respond or dont make any browser errors? This is prohibited by either SGML DTDs if HTML 4.01(http://www.w3.org/TR/html4/interact/forms.html#h-17.3): !ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -- and XML DTDs of XHTML 1.0 (http://www.w3.org/TR/xhtml1/#prohibitions) form cannot contain other form elements. So, it is a good reason why browsers don't like it. Respect to your original problem, value of element select can be changed by JavaScript without submitting the whole form. Here is a little example (this behaves like a combobox ,common input + select with history list): input type=text name=combo_input style=width:5em onKeypress=combo_select.value=''; return true;br select name=combo_select style=width:5em tabindex=-1 onChange=combo_input.value=combo_select.value; return true; onFocus=this.blur; return true; option value=oneone/option option value=twotwo/option option value=threethree/option /select - Original Message - From: Steve Maroney [EMAIL PROTECTED] To: George Pitcher [EMAIL PROTECTED] Cc: De Necker Henri [EMAIL PROTECTED]; PHP-General (E-mail) [EMAIL PROTECTED] Sent: Saturday, November 17, 2001 8:18 PM Subject: Re: [PHP] Form's : making me sick! Thats sounds right becasuse anything between form ... /form can only will be passeed only to one script. Steve On Tue, 13 Nov 2001, George Pitcher wrote: I don't think that you can nest forms. George - Original Message - From: De Necker Henri [EMAIL PROTECTED] To: PHP-General (E-mail) [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 1:09 PM Subject: [PHP] Form's : making me sick! I just want to know how to make a form inside a form get to respond or dont make any browser errors? It looks someting like this : form input type = text input type = text form select onchange = this.form.submit(); //This must change the next select values ! /select /form select //this values must be cahnge /select /form Everthing is working fine but i just cant get the two forms to work together.If i only can get some ideas on what action,or onchange values to change it will be greatfull! -- 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] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.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] Thank you, Steve Maroney -- 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] xslt function documentation
Hi, I'd like to know if someone out there knows a good tutorial or some simple examples about how to use xslt functions. The manual says the xslt ext is in experimental phase and so the documentation lacks of even good examples or description of the function arguments. I've already read Sablotron's documentation, but some help will be appriciated, especially for xslt_transform(). Papp Gyozo - [EMAIL PROTECTED]
Re: [PHP] xslt function documentation
OK, I found some hints in the annotated manual. BTW, I'm looking for hearing any comments on this ... - Original Message - From: Papp Gyozo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 17, 2001 11:19 AM Subject: [PHP] xslt function documentation Hi, I'd like to know if someone out there knows a good tutorial or some simple examples about how to use xslt functions. The manual says the xslt ext is in experimental phase and so the documentation lacks of even good examples or description of the function arguments. I've already read Sablotron's documentation, but some help will be appriciated, especially for xslt_transform(). Papp Gyozo - [EMAIL PROTECTED]
Re: [PHP] Question on variable variables
have you tried /e modifier? preg_replace(/yabb\s+$tags[1]/e,'${$1}', $curline); it's just a tip. - Original Message - From: Jeff Lewis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 17, 2001 2:25 PM Subject: Re: [PHP] Question on variable variables Thanks Jason and Christoper for replying, here is the solution I came up with. It takes into account that there could be multiple instances of what I'm looking for on the same line - got it working late last night: while (preg_match (/yabb\s+(\w+)/,$curline,$tags)) $curline = preg_replace(/yabb\s+$tags[1]/,${$tags[1]},$curline); Jeff - Original Message - From: Jason G. [EMAIL PROTECTED] To: Jeff Lewis [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, November 17, 2001 7:02 AM Subject: Re: [PHP] Question on variable variables It seems to me that the use of a temp variable may be the clearest solution, and I doubt any overhead would matter really. $a = dog; $tmp = MY.$a; //$tmp = MYdog; So the following two would be the same: $$tmp = Spot; $MYdog = Spot; Good Luck, Jason Garber IonZoft.com At 09:47 PM 11/16/2001 -0500, Jeff Lewis wrote: I've a question regarding variable variable I was hoping someone could help me with: All the examples in the manual have the entire variable name being variable e.g. $a = hello and $$a being the same as $hello What I need to do, however, is append a variable portion to a constant prefix. So I have a set of variables that are named $MYdog, $MYcat etc. and I need to do $a = dog ${MY$a} being the same as $MYdog Can this be done, and if so - how? I can't get it to work. Jeff -- 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] Question on variable variables
Oops... have you tried /e modifier? preg_replace(/yabb\s+$tags[1]/e,'${$1}', $curline); preg_replace(/yabb\s+(\w+)/e,'${$1}', $curline); it's just a tip. - Original Message - From: Jeff Lewis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 17, 2001 2:25 PM Subject: Re: [PHP] Question on variable variables Thanks Jason and Christoper for replying, here is the solution I came up with. It takes into account that there could be multiple instances of what I'm looking for on the same line - got it working late last night: while (preg_match (/yabb\s+(\w+)/,$curline,$tags)) $curline = preg_replace(/yabb\s+$tags[1]/,${$tags[1]},$curline); Jeff - Original Message - From: Jason G. [EMAIL PROTECTED] To: Jeff Lewis [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, November 17, 2001 7:02 AM Subject: Re: [PHP] Question on variable variables It seems to me that the use of a temp variable may be the clearest solution, and I doubt any overhead would matter really. $a = dog; $tmp = MY.$a; //$tmp = MYdog; So the following two would be the same: $$tmp = Spot; $MYdog = Spot; Good Luck, Jason Garber IonZoft.com At 09:47 PM 11/16/2001 -0500, Jeff Lewis wrote: I've a question regarding variable variable I was hoping someone could help me with: All the examples in the manual have the entire variable name being variable e.g. $a = hello and $$a being the same as $hello What I need to do, however, is append a variable portion to a constant prefix. So I have a set of variables that are named $MYdog, $MYcat etc. and I need to do $a = dog ${MY$a} being the same as $MYdog Can this be done, and if so - how? I can't get it to work. Jeff -- 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] working HEADER in PHP
Hi, I used header(content-type:text/html;charset='windows-1256'); and header(content-language:'fa'); I suggest to try Content-Type Content-Language with initial capitals rather than all lowercase and simply fa, without qoutes. header(Content-Type: text/html; charset=windows-1256); header(Content-Language: fa); for showing my Farsi messages, in PHP, on browser but these could not work. Please help me! Thanks. __ Do You Yahoo!? Find the one for you 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]
Re: [PHP] custom errors
I know how to make an error message when the connection is lost with the database, with the @ and the OR DIE in the connection with the database. Is there also a way to display a custom error message when this error is displaid? i wrote a more or less simple class to wrap PHP's errorhandling. http://phpclasses.upperdesign.com/browse.html/package/345 this version needs to be updated. Tidied up version can be found: http://users.freestart.hu/pgerzson/PHP/ErrorHandler/ Warning: Supplied argument is not a valid MySQL result resource in /opt/guide/www.domain.nl/HTML/inc/menu.php on line 34 Thanks, Sjoerd Sjoerd van Oosten Digitaal vormgever [EMAIL PROTECTED] Datamex E-sites B.V. http://www.esites.nl Minervum 7368 Telefoon: (076) 5 730 730 4817 ZH BREDA Telefax: (076) 5 877 757 ___ -- 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] Regular expressions?
?php $quoted = preg_quote($searchstring, '!'); preg_match_all('!(\w+)(?[^]*).*'.$quoted.'(?[^]*)/$1!Ui', $source, $matches); ? good point to start: http://www.php.net/manual/en/ref.pcre.php - Original Message - From: Martin Thoma [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 16, 2001 8:30 AM Subject: [PHP] Regular expressions? Hello! I need to search for strings between html-tags. For example, I need to know if the String Searchstring is between H2 and /H2 (case-insensitive). How is it done? I think I need regular expressions, but I have no idea about it. I'm not getting to clever out of the php-documentaion. Where can I start to learn reg-exp? Should I use the ereg- oder preg-functions? Help! Martin -- 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] multiple include
if (!defined('_SYS_TYPES.H')) { include('sys/types.h'); } - Original Message - From: Briet Vincent [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 15, 2001 10:31 AM Subject: [PHP] multiple include Hi all, I would like to do something like that : #ifndef _SYS_TYPES_H #include sys/types.h #endif Is it possible in php ? Thx poz
Re: [PHP] Re: Can If Else statements be split into code blocks??
Nonetheless sometimes it is more efficient to use a template engine. (IMHO) Papp Gyozo - [EMAIL PROTECTED] - Original Message - From: Jason G. [EMAIL PROTECTED] To: Brad Melendy [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, November 14, 2001 1:33 PM Subject: Re: [PHP] Re: Can If Else statements be split into code blocks?? try this.. ? if(true) { ? Raw html code here for as long as you want ? } else { ? More Raw Html Code Here ? } I believe that this feature is way underutilized by php developers. Tying all your html up in echo or print statements is a mess to say the least. -Jason Garber IonZoft.com At 05:13 PM 11/13/2001 -0800, Brad Melendy wrote: Ok, I figured out that just using echo seems to be the best way to do this under PHP. In ASP, you can end your code block and start in with HTML, but I couldn't get that to work with PHP. However, I was able to just use the echo statement to get the conditional HTML I wanted to show up when the proper condition was met in the If Else statement. Brad Brad Melendy [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I'm trying to execute some HTML in an IF ELSE statement. I'm trying something like: ?php if (strstr($DomResults,$Match)) print Congratulations! $domain.$suffix is available!; ? form method=POST action=step2.asp name=form2 pinput type=submit value=Register name=B1/p /form ?php else print Sorry, $domain.$suffix is already taken.; ? Basically, it works great without the form I'm trying to insert, but with the form after the IF statement, it fails. Is what I want to do against the rules? I'm converting an ASP script I have to PHP and I have it all working under ASP. That means it should be eaiser with PHP right? ;-) Thanks in advance. ...Brad -- 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] e modifier
PHP 4.0.5, as far as I know. - Original Message - From: "Brian Clark" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, November 11, 2001 6:15 AM Subject: [PHP] e modifier Does anyone know when the PCRE modifier 'e' was added into PHP? Is it version dependant, or has it been there since 3.0? In 3.0.18 with `PCRE library version: 2.05 21-Apr-1999' I get: Warning: Unknown option 'e' in [...] But in 4.2.0-dev it is, of course, fine. -Brian -- 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] Text Editor with Highlighting
EditPlus (http://www.editplus.com) on windows HTML-Kit (http://www.chami.com/html-kit/) - Original Message - From: Eugene Mah [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 01, 2001 3:32 PM Subject: Re: [PHP] Text Editor with Highlighting At 10:02 PM 11/01/2001 +0100, TD - Sales International Holland B.V. wrote: Hey there, I looked on the site for this but couldn't find anything about it. I'd like a list of your favorite text editors (preferable for Linux/XFree) with highlighting. emacs! :) Eugene -- To put my contact info into your Palm device, click here: http://signature.coola.com/?[EMAIL PROTECTED] Personal Signature Coolet - Eugene Mah, M.Sc., DABR [EMAIL PROTECTED] Medical Physicist/Misplaced Canuck[EMAIL PROTECTED] Department of Radiology For I am a Bear of Very Little Medical University of South Carolina Brain, and long words Bother Charleston, South Carolina me. Winnie the Pooh http://home.netcom.com/~eugenem/ PGP KeyID = 0x1F9779FD, 0x319393F4 PGP keys available on request ICQ 3113529 O- - -- 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] Re: Removing an Array Element
and what about array_slice(), array_splice(), array_pop() or array_unshift()? Please read the corresponding pages of the manual! - Original Message - From: Christian Reiniger [EMAIL PROTECTED] To: Jason Caldwell [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, October 25, 2001 11:03 AM Subject: Re: [PHP] Re: Removing an Array Element On Wednesday 24 October 2001 23:33, Jason Caldwell wrote: That won't work, as that will only unset the *value* not the *element*. Try again: $myArray = array('100'='jibberjabber','200'='morejibberjabber','0'=''); var_dump ($myArray); echo br; if(isset($myArray[0])) { unset ($myArray [0]); } var_dump ($myArray); Outputs: array(3) { [100]= string(12) jibberjabber [200]= string(16) morejibberjabber [0]= string(4) } array(2) { [100]= string(12) jibberjabber [200]= string(16) morejibberjabber } - index 0 is gone. -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) /* you are not expected to understand this */ - from the UNIX V6 kernel source -- 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] Help, please!
check: http://www.php.net/manual/en/function.ini-set.php - Original Message - From: Valentin V. Petruchek [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Sent: Thursday, October 18, 2001 4:00 PM Subject: [PHP] Help, please! Hello, Professionals! I've such problem: i need to change parameters from php.ini (such as sendmail_from) during execution script. Is it possible to perform and if is, how can i do it. Thanks Val.zp.ua -- 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] Using Array of classes as a class member variable?
First some basic questions: (1) Can you create an unitialised array ? do you mean: $array = array(); // creates an empty array; (2) Can an unitinialised array be a class member variable ? for( $i = 0 ; $i 5; $i++) $array[] = new User(); I think it should work. I have a class called user - which represents one row in a mySQL table (also called user) I want to create a class called userBag - this class will contain an array of user classes - the constructor for userBag gets an SQL statement and uses this do decide which users to place in the userBag Maybe I'm going about this all worng, but is there some other way I can store a variable number of classes (Such as a CObject class in MFC for Visual C++) - i.e. is there soem other collection class/type I don't know of ? Thanks, Martin. -- 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] Sessions, sessions, sessions...
session_register() registers the _global_ variable named by it with the current session. So if these globals are not set, you 're out of luck, I think. - Original Message - From: Bradley Goldsmith [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 02, 2001 3:13 AM Subject: [PHP] Sessions, sessions, sessions... Hi, I am using php4 (great) under win32 apache (not so great) ... I am trying to regsiter two session variables. When the page is first displayed, the variables are registered thus: session_register(Sheet); $HTTP_SESSION_VARS[Sheet]=serialize($Sheet); //store time offset session session_register(offset); $HTTP_SESSION_VARS[offset]=$offset; I had some checking code in there before and the registers returned true. The problem is that on the first time around the variables do not seem to register. However, if the page loads and then I do a refresh by clicking on the toolbar - it all seems to work ok. Any ideas on how I can get the vars to stick first time around? Cheers, Brad -- 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] Warning: Sybase message: Incorrect syntax near 't'.
Hi, I suggest to you: var_dump($sybase_query); It may help you to make wellformed query-string. - Original Message - From: Caleb Carvalho [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 01, 2001 11:04 AM Subject: [PHP] Warning: Sybase message: Incorrect syntax near 't'. Hi am trying to add data from html form, and it seems like the line 14 in my script, $sybase_query=INSERT into problem VALUES('$product','$pro_title','$description','$solution'); $sybase_result=sybase_query($sybase_query); Warning: Sybase message: Incorrect syntax near 't'. (severity 15) in /var/www/html/process.php on line 14 Warning: Sybase message: Unclosed quote before the character string ')'. (severity 15) in /var/www/html/process.php on line 14 when trying to insert the following data Product :Test Director Problem Title : Doesn\'t work Description: I dont knw why Solution : dondd Caleb Carvalho Application Engineer LoadRunner/APM -- --- Enterprise Testing and Performance Management Solutions -- --- Mercury Interactive 410 Frimley Business Park Frimley, Surrey. GU16 7ST United Kingdom Telephone : +44 (0)1276 808300 _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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] Locale Month Name
LC_* are predefined constants, so: setlocale(LC_ALL, LT); - Original Message - From: Veniamin Goldin [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 11:37 AM Subject: [PHP] Locale Month Name Hello ! Please help me, How to get Month name according to server's locale setings ? I tryed to use: setlocale(LC_ALL, LT); $month = strftime(%B, mktime(0,0,0,$m,1,$y)); But I get message: Warning: Passing locale category name as string is deprecated. Use the LC_* -constants instead. in (My PHP runes on Windows Server) Thank You. -- 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] php's future
I also can hardly believe the 84+ sec. In such case all PHP template engines may run for a thousand years. - Original Message - From: nick [EMAIL PROTECTED] To: 'nick' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, September 02, 2001 2:56 PM Subject: RE: [PHP] php's future Haha I tried its code and it only takes 1~2 secs to run it . Wellgod damn lies -Original Message- From: nick [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 02, 2001 8:38 PM To: 'Faisal Nasim'; [EMAIL PROTECTED] Subject: RE: [PHP] php's future It's Chinese . I translated it maybe u cannot understand bcoz my English is not good First: jsp test for loop see below jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type=dates.JspCalendar/ jsp:getProperty name=clock property=time / % int i=0; int j=0; int k=0; (i=0;i2;i++){ for(j=0;j2;j++){ } } % jsp:useBean id='clock1' scope='page' class='dates.JspCalendar' type=dates.JspCalendar/ jsp:getProperty name=clock1 property=time / 4 secs taken Next : php test for loop see below (he didn't mention if it is php3 or php4) ? $TTime=date(Y-n-d). . date(H:i:s); echo $TTime; echo ; for($i=0;$i1000;$i++){ for($j=0;$j1000;$j++){ } } $TTime=date(Y-n-d). . date(H:i:s); echo $TTime; ? 84 secs taken ++ Third : Asp for loop test % response.write now response.write for i=0 to 2000 for j=0 to 2000 next next response.write now % 64 secs taken Last one : Asp+ for loop test % Dim intStart,intStop As DateTime Dim timeUse As TimeSpan dim Sum,i,j as int32 intStart = DateTime.Now for i=1 to 2 for j=1 to 2 Sum=Sum + i next next intStop = DateTime.Now ti meUse = intStop.Subtract(intStart) Response.Write (TimeSpan.ToString(timeUse)) % 3.6 secs taken if u can read Chinese u can go http://www.webappcabaret.com/jsptw/doc/test-report.htm for more infomation. It's a website which teach jsp at all -Original Message- From: Faisal Nasim [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 02, 2001 7:54 PM To: nick Subject: Re: [PHP] php's future Where did you see that? Faisal At 04:28 PM 9/2/2001, you wrote: Hi all in the list : I read an news that said jsp/asp.net is better than php.. They made a test that asp/php/jsp/asp.net using for loops, Jsp from 1 to 2 takes only 4 secs Asp from 1 to 2000 (not 2) takes 72 secs Php from 1 to 2000 (not 2) takes 68 secs Asp.Net from 1 to 2 takes only 3.5~3.8 secs... So is it time to learn jsp/asp+ instead of learning php ..??? I am so confused ~ I have been learning php for a while and now it said jsp/asp+ is better than it.@@ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ereg question
Hello, check it in the manual: http://www.php.net/manual/en/function.ereg.php If you don't pass the third -- optional -- argument, then it's true. Otherwise not. I don't know this book, but you may keep in my mind that PHP is evolving, so the online manual can be its most up-to-date documentation. - Original Message - From: js [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, September 02, 2001 3:05 AM Subject: [PHP] ereg question In the Leon Atkinson Core PHP book, in his ereg example he states that ereg will only return the first match on a line. Can anyone confirm or deny this? Thanks, Josh -- 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] Databases, arrays and woes
I think it's very simple to do it. ?php //... $result = mysql_query('SELECT * FROM my_table ORDER BY Type, Place Name'); for($i = 0, $prev_type = FALSE; $i mysql_numrows($result); $i++) { $row = mysql_fetch_array($result); if ($prev_type !== $row['Type']) { // close the previous type list if any if ($prev_type !== FALSE) echo '/ul'; // new Type list echo 'ul' . $row['Type']; } // print out the rest of the row like : // Place Name and Place Abbr and ther link echo 'li'.$row['place name']; echo ' ajump '.$row['place abbr'].'/a'; //... } //... ? or maybe I missed something? - Original Message - From: Kath [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 3:17 PM Subject: [PHP] Databases, arrays and woes I have a MySQL table which stores information like this: | Type | Place Name | Place Abbrv | and lets say I have data in the table like: Example #1: | Office | Bill's Office | bo | | Store | Millcreek Supply | mcs | | Office | Harry's Office | ho | | Store | Sam's Discount Taxidermy | sdt | | Shipping | East Coast Distribution Facility | ecdf | What I'd like to do is be able to have PHP grab the information out of the database and sort like this on a webpage: Type Name #1: - Place Name (with hyperlink using the abbrv) - Place Name (with hyperlink using the abbrv) Type Name #2: - Place Name (with hyperlink using the abbrv) - Place Name (with hyperlink using the abbrv) For a better illustration, using the information from Example #1: Example #2: Office - Bill's Office (link using bo) - Harry's Office (link using ho) Store - Millcreek Supply (link using mcs) - Sam's Discount Taxidermy (link using sdt) Shipping - East Coast Distribution Facility (link using ecdf) So basically it has to group the common Type fields together and list them together and make a hyperlink. What is the best way to do this? I've tried arrays, different MySQL calls, voodoo, ouija boards and drinking, but nothing has gotten me what I need. btw, the information in Type is not a set number. There could be 2 or 200 different Type. (Otherwise this would be much easier and I might not have a hangover from aforementioned drinking ;p ) - k -- 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] help with strings...
$GLOBALS[substr($string, 0, 1)] or : $tmp = substr($string, 0, 1); ${$tmp} = 'add whatever value you want'; - Original Message - From: Stig-Ørjan Smelror [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 31, 2001 9:35 AM Subject: [PHP] help with strings... Hei all. I've got this string, $string = test; and I want to make a $t; out of $string. Is this possible? I tried ${substr($string, 0, 1)}, but that didn't work ;) Any help appreciated. TIA. -- Stig-Ørjan Smelror Systemutvikler Linux Communications AS Sandakerveien 48b Box 1801 - Vika N-0123 Oslo, Norway tel. +47 22 09 28 80 fax. +47 22 09 28 81 http://www.lincom.no/ -- 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] passing variables between scripts?
I think, the built-in session management can solve your problem: http://www.php.net/manual/en/ref-session.php Briefly, you should register your variable into the session and after reloading the page you can get it back. peculiarly: http://www.php.net/manual/en/function-session-register.php hth, Papp Gyozo - [EMAIL PROTECTED] - Original Message - From: Jon Thompson Coon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, September 01, 2001 4:14 AM Subject: [PHP] passing variables between scripts? I can't cope the fact that I loose my variables every time I reload the page. If someone could point me to the right direction, I'd be grateful. Present problem: I have a script that has some globals (surprise). Within this script, pretty deep in a function call tree, a function saves a query into an array and saves it to a global. Then an user makes an selection and the script reloads itself. After this I'd like to my hands on the saved query, but the global variable where it's saved seems to get initialised on reload. How to get around this? Sessions? I'm pretty new (a forthnight and wery little documentation) to server side programming, so I'm probably misunderstanding some basics. Most of my problems are related to this area, so anyone bold enough to anwer will probably pounded with several questions more. Thank you in advance Jon Thompson Coon -- 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] Cookies
http://www.phpbuilder.com/columns/chriskings20001128.php3 - Original Message - From: Jason Radley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 31, 2001 5:11 PM Subject: [PHP] Cookies Does anyone know how to share cookies between servers. What I want to do is set a cookies on non secure server for a secure server. Here is setcookie(SessionID,$sessid,time() + 7200,https://domainname.com;); 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]
Re: [PHP] array search
yes, in_array($person, $people)! however, you may take a look into the manual. - Original Message - From: Joseph Bannon [EMAIL PROTECTED] To: PHP (E-mail) [EMAIL PROTECTED] Sent: Friday, August 31, 2001 5:40 PM Subject: [PHP] array search I have an array of names, like below... $people = array(Jim,John,JP); Is there a way in an IF statement to see if someone's name is in the array? Like... if ($people =~ $person) { } I don't want to have to create a foreach loop to go through the array to see if that person is there. Joseph -- 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] fix my query please
Well, T1 INNER JOIN T2 For each row R1 of T1, the joined table has a row for each row in T2 that satisfies the join condition with R1. T1 LEFT OUTER JOIN T2 First, an INNER JOIN is performed. Then, for each row in T1 that does not satisfy the join condition with any row in T2, a joined row is returned with NULL values in columns of T2. Thus, the joined table unconditionally has at least one row for each row in T1. and as you can see join condition is nothing to do with equality of respective columns, which means you can state any kind of join condition (non-equal as well as equal join) - Original Message - From: ERISEN, Mehmet Kamil [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 28, 2001 10:46 PM Subject: Re: [PHP] fix my query please Hello Jeremy, Two things: FROM users LEFT OUTER JOIN picks using(id) Where users.uid picks.user_id 1- when you do OUTER join, you do NOT have to use the . That's what outher join means. 2- what is id? Is it a column? shouldn't it be uid? Maybe that's your problem. --- Jeremy Morano [EMAIL PROTECTED] wrote: an somebody please fix up my query. $connection = @mysql_connect(l, c, c) or die(Couldn't connect.); $db = @mysql_select_db($db_name, $connection) or die(Couldn't select database.); $sql = SELECT distinct users.uid , users.username FROM users LEFT OUTER JOIN picks using(id) Where users.uid picks.user_id ; $result = @mysql_query($sql,$connection) or die(Couldn't execute query.); while ($row = mysql_fetch_array($result)) { $usersleft = $row['username']; $uid = $row['uid']; $my_string=$usersleftbr; echo $my_string; } -- 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] = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.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] -- 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] real optional parameters
yes, you just declare the default value of the arguments such as : my_function ($first = 'no-value', $second = 0, $third = null ) Note that the default value must be a constant expression and any defaults should be on the right side of any non-default arguments or you can achieve the very pretty function-overloading using the funtion handling function. Check it out: http://www.php.net/manual/en/function.func-get-arg.php http://www.php.net/manual/en/function.func-get-args.php http://www.php.net/manual/en/function.func-num-args.php - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 29, 2001 2:22 PM Subject: [PHP] real optional parameters How can I declare optional parameters as used by strpos, substr, etc. to specify the offset? I do not want to have to preceed some functions with the @-operator, and preceeding all for consistency wouldn't be an option, I think. Is it possible at with user-defined functions? quick help is appreciated. thanks. D. Alvarez Arribas [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] htaccess and $PHP_AUTH_USER
Hi, There is a few scripts on Zend pages. I'm sure, this one of them will be very helpful: http://www.zend.com/zend/tut/authentication.php - Original Message - From: Rene Fournier [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 28, 2001 9:24 PM Subject: [PHP] htaccess and $PHP_AUTH_USER Please, someone, help me... What I want to do: Have a user prompted for an ID/password, both of which (if valid), get passed to a PHP script, which then uses the ID/password to selectively display certain fields of a table. (For example, if the user logs in as Sales, he would only see the sales-related fields of the tables. Whereas, if the user logs in as Production, she would see the production-related fields. Pretty simple.) I've read the PHP docs on $PHP_AUTH_USER. One stupid question: Must I use the htaccess directory-protection feature of Apache in order for this to work (or is$PHP_AUTH_USER not dependent on Apache (or any web server) at all)? I mean, from reading the docs, it seems as if the value stored in $PHP_AUTH_USER comes what the user types into the Apache-spawned dialog box (when the user types the URL containing that password-protected directory.)?? The thing is, when I turn password protection on for the directory in question, and add the users and passwords to the htaccess file, then go to the URL in the browser, I get prompted several times for a user and password--first, it seems, by Apache, then by the PHP code I copied from the docs. If anyone can help, I'd greatly appreciate it. Best would be some real code running in a similar server environment. (The site in question is running on www.fatcow.com servers--they're running PHP3 (shouldn't matter, right) and Apache.) MUCH thanks in advance... ...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] -- 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] LONGINT... ? to be or not to be?...
Hello, you should check the latest version of the manual: http://www.php.net/manual/en/language.types.integer.php more precisely and specifically the integer overflow section. I think, you should use the arbitrary precision integer extension. http://www.php.net/manual/en/ref.gmp.php hth - Original Message - From: Alexey Prohorenko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 28, 2001 8:47 PM Subject: [PHP] LONGINT... ? to be or not to be?... Hello, I have one question. How can PHP work with longint (in C we call them unsigned long) variables? F.e., I want to do next thing: 65536 4096 = 0 (this is right) 65536 65536 = 65536 (again, everything is okay) 196608 65536 = 65536 (perfect, it works great) but, 3221225472 1073741824 = 0 (this is wrong, right answer isn't 0 but 2147483648) So, can anybody help me with this? Any suggestions? Thanks, anyway. Looking forward your answers. Will check my mailbox every 5 minutes. :-) -- green [http://www.extrasy.net] [http://www.unix-how-to.net] -- 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] Putting variables in a string
Hi, try to change the line in that loop to this one: $sql .= $key.' = '.$$key.', '; - Original Message - From: P.Agenbag [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 28, 2001 7:54 PM Subject: [PHP] Putting variables in a string I am trying to make a string that will contain variables. The resulting string will be a sql query string and must look something like update $table_name set key='$key' , next='$next' where id = $id Since the variable name is the same as the key name, I tried to generate this string with a foreach statement looking something like this: foreach( $myrow as $key=$val) { $sql .= $key = ' \$$key ' ,; } This then makes the string look as follow: key='$key',next='$next', and I just add the rest of the string to the front and back, yet, when I now try to use this string in the mysql_query() function, it does not recognise the '$key' and '$next' as variables and add them into the db as $key and $next. I need to know how I am going to make this string recognise the variables in them. -- 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]