RE: [PHP] British Pound
I assume you mean how do you display a British Pound in HTML The escape pound; Should do what you want. HTH Richy == Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: [EMAIL PROTECTED] -Original Message- From: karthikeyan [mailto:[EMAIL PROTECTED]] Sent: 19 September 2002 12:33 To: [EMAIL PROTECTED] Subject: [PHP] British Pound Hi all, How do i display British Pound through PHP. I can right now display Dollar Symbol but how do i display British Pound. karthikeyan. This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.messagelabs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Building PHP for windows
Sorry if this question has been asked before... Is it possible to build PHP on Windows using Borland's C++ Builder? All the docs I've seen talk about MS Visual C++, so I wondered if that's the only compiler that will build it. I've not seen any mention of other compilers. Cheers, Richy == Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Server date and time
Hi Christian, PHP code runs on the server, so any of the date/time functions which the language provides will give you the date/time on the server, rather than the client. HTH, Richy == Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: [EMAIL PROTECTED] -Original Message- From: Christian Ista [mailto:[EMAIL PROTECTED]] Sent: 10 September 2002 17:08 To: [EMAIL PROTECTED] Subject: [PHP] Server date and time Hello, When a use insert the row in a table, I'd like to know the date and time of this insertion. Is there a function to know the server date and time, not the local time user ? Bye -- 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] Calculating Totals from table columns without a second query to the DB
One thing I would add to Jay's out loud thoughts... Always consider alternative approaches. Using a single query and calculating the totals at the same time is fine if you have a small dataset, or (as in this case) are producing page totals (I'm assuming the dataset is paged to fit all on one page, so restricting the number of rows to 20, say). I had a situation where I had to report a bunch of stuff all at once, like 600 or 700 rows, and had to total 7 or 8 columns. In that case, I found it was far quicker to have separate queries for the row data and the totals, because the database was far quicker at totalling the stuff than the PHP code was. Now, where the cut off is I'm not sure. There are a huge number of factors which would be involved (size of dataset, choice of database, number of totals - and calculations required for these totals etc). I guess knowing plenty of alternatives - or at least understanding what you're doing enough to be able to think of alternatives - and thinking about stuff rather than just doing it the way you always did are the key points here. Just my tuppence... Richy == Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: [EMAIL PROTECTED] -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED]] Sent: 06 September 2002 16:33 To: [EMAIL PROTECTED] Subject: [PHP] Calculating Totals from table columns without a second query to the DB [thinking out loud] For small result sets where I am looking for column totals I generally issue 2 queries to the database, one for the data and one for the totals. This works fine, but for some things the database returns 100's or 1000's of records. To make this easier to use I page the records, showing an appropriate number of records for each page. The records for each page returned like so (normal); while($row = mysql_fetch_object($result)){ print(td . $row-value . /td\n); print(td . $row-another_value . /td\n); } The PHB would now like a totals per page and a grand totals. Easy enough with 3 queries each time the page is called, one for the records, one for the page totals, (using proper LIMIT queries) and one for the grand totals, but awfully inefficient and intensive. I suppose I could do something like this; while($row = mysql_fetch_object($result)){ print(td . $row-value . /td\n); print(td . $row-another_value . /td\n); $value1 = $value1 + $row-value; $value2 = $value2 + $row-another_value; } [/thinking out loud] In the process of typing this out I of course realized that this would work very well. Even if the database contains NULL values they are treated as zero. This gets me back to 2 queries, one of which only has to be issued once (the one for the grand totals, the results can be held in variables and echo'd or printed as needed). It also seems to be very efficient as the $value variables will only be doing a one time math operation each time through the while loop. For smaller results sets all on one page the same type of operation could be used for the grand totals as well, working the whole report down to a single query. I use a lot of crosstab queries where totals are needed along the bottom or right side, you can only do one within the original query. The other totals are left to another query ... usually. This should be a lesson to us all, we all try to over-compicate the issue sometimes. Usually a look at the docs/manual/FAQ/other-text-intensive-method-of-delivering-information will deliver the solution to a problem while some thought slowed to a reasonable speed (such as me typing out the problem above) will also allow natural logic to occur, producing a solution. Break down the process into managable portions, solving each portion before moving on to the next. Challenge; Can this be made as simple for rows too? Peace and I HTH someone else! Jay Hard work has a future payoff. Laziness pays off NOW. * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- 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] question
Can you provide a bit more info??? Maybe a real life example of what you're trying to accomplish??? Richy == Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 04 September 2002 15:26 To: [EMAIL PROTECTED] Subject: [PHP] question I have a php question. I would like to enter a while loop, but: I want it to be like this: when $a has a value, while $a... when $b has a value, while $b... (same statements as with $a) when $a has a value, and $b has a value, while $a and $b this is based on a search system in which the user can enter a, b or a and b. Can you help me with my problem, or help me find someone who can?! Thanks. Dore van Hoorn. -- 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: Betr: RE: [PHP] question
Where are you generating the query and fetching the row? And what are the queries being run? Possibly a better way to do the first bit would be as follows: $and = ; if ($itemname) { echo $n.nbsp;.$name./font; $and = and ; } if ($itemcolor) { echo $and.$c.nbsp;.$color./font; } (I've condensed the multiple echo statements into one to reduce the number of lines, but this is more about the logic) Depending on what your query is searching on and returning, you may be able to do it in a single query. HTH, Richy == Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 04 September 2002 15:41 To: Richard Black Subject: Betr: RE: [PHP] question if ($gevonden = 1) { echo nbsp;bThe search for ; if ($itemname) { echo $n; echo nbsp;; echo $name; echo /font; } if ($itemcolor) { if ($itemname) { echo and ; } echo $c; echo nbsp;; echo $color; echo /font; } echo delivers the following results/bp/; } so the above if statements handle the same problem. if $itemname has a value, print $n and $name if $itemcolor has a value, print $c and $color if $itemcolor has a value and $itemname has a value, the following will be printed: $n $name and $c $color After this if statement, a while statement is entered: while ($myrow = mysql_fetch_row($itemname)) { a lot of echo's } but what if, itemname is empty, but itemcolor is not. or what to do if both have a value?! I hope this explanes my problem more clearly!? Dore van Hoorn. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Anybody have a sucessfull use of ADO and php together ?
I don't know anything about Visual Foxpro, so I may be barking up the wrong tree here, but... Is there anyway you can use ODBC??? The ODBC functions work pretty well. HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Saci [mailto:[EMAIL PROTECTED]] Sent: 02 September 2002 15:25 To: [EMAIL PROTECTED] Subject: [PHP] Anybody have a sucessfull use of ADO and php together ? I tried to use , and have a lot of trouble. For example I can't read fields who is Date time type I can't read memo fields I can't update using the recordtset.updated methode. The only thing I haven't trouble is to show a read only set of characters rows Anybody know where I can find more information on use PHP and ADO together. The Php.net manual contain near nothing ( only few notes about ADO in COM section some writed by myself) Am I the unique trying to use Php and ADO together.? Since I'm making a migration of a working system from Visual Foxpro To Interbase I must USE ADO to acess the VFP databases. Until now the unique solution I found is to mix asp and php, since ASP do everthing that php didn't with ADO, but this isn't what i want, I'm tried to founf a way in php but my resources are near end. Anybody have experience and advanced examples to use ADO and PHP together. -- 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] whats wrong with this?
A single = will assing a value, even inside an if statement A double = (ie ==) will perform a comparison between 2 values, returning true if they evaluate to the same value, false otherwise A triple = (===) will do the same as ==, but also check that the types of the 2 variables match. Check out the PHP manual - http://www.php.net/manual/ - for more info HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Chris Barnes [mailto:[EMAIL PROTECTED]] Sent: 28 August 2002 17:12 To: Php-General (E-mail) Subject: [PHP] whats wrong with this? I just cant seem to work out why this doesn't work. My PHP book doesn't explain if statements very well so i have no idea if i am breaking a rule. $system_day = date(j); for($day = 1; $day 32; $day++){ if($day = $system_day){ echo match!; } else{ echo no match; } } the problem i am experiencing is that it seems the if statement is setting the $day value to equal $system_day instead of comparing their values if i add echo Day: . $day . System_day: . $system_day; before and after the if statement then the first result is something like Day: 1 System_day: 29 after the if statement has executed the result is Day: 29 System_day: 29 so you see, instead of if comparing $day to $system_day it is making $day equal to $system_day. any ideas why and how to fix this? help is most appreciated :) -- 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] Help with script - if possible
Try putting brackets round the date selection part. I think the database treats AND with a higher precedence than OR, and evaluates ANDs first. So what your query is doing is like A OR (B AND C) But what you want is (A OR B) AND C Where A is '$book_start_date' BETWEEN booking_start AND booking_end B is '$book_end_date' BETWEEN booking_start AND booking_end C is villa_id = '$place' HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Ray Healy (Data Net Services) [mailto:[EMAIL PROTECTED]] Sent: 28 August 2002 17:49 To: [EMAIL PROTECTED] Subject: [PHP] Help with script - if possible Hi All Thanks for everyones help in trying to get my script to work - I'm learning fast. But have the following problem: I am using the following select command for searching a table with regards to booked villas according to id number: $sql = SELECT COUNT(*) as count FROM bookings WHERE '$book_start_date' BETWEEN booking_start AND booking_end OR '$book_end_date' BETWEEN booking_start AND booking_end AND villa_id = '$place'; This counts as far as I believe an displays a 0 if available and number of times it occurs if unavailable. The problem I have is that still counts the number of entries regardless of the villa_id number it is given. In other words if I have a villa that is booked between 2002-04-10 and 2002-004-20 for villa_id 1 and I search using the same dates (via a FORM) but on villa_id 3 it still comes back and says that the villas is unavailable. Which of course it is wrong for villa_id 3 (it is villa_id 1 that is booked). I have tried to find a command (something like IF villa_id =3 THEN count) but to no avail that would only count if the villa_id matches as well. Can anyone help Thanks for your time. Ray -- 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] OO code and private functions
Can I make a function private in PHP, so that it can only be called from within an object of that class??? Just discovering the wonders of OO PHP... :-) == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [Class] Behaviour global variables
Not done any OO stuff with PHP, but I would hazard a guess that the problem is one of scope. Rather than global making available class variables, it makes available GLOBAL variables. And I'm guessing there isn't a global variable a or b, which is why they show up blank. HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Tim Stoop [mailto:[EMAIL PROTECTED]] Sent: 14 August 2002 14:27 To: [EMAIL PROTECTED] Subject: [PHP] [Class] Behaviour global variables Hi there, I'm forgetting something, but I can't seem to get to it... Consider the following Class. class Test { var $a; var $b; function Test() { $this-a = 2; $this-b = 5; } function Show() { global $a, $b; echo(a: .$a); echo(a: .$this-a); echo(b: .$b); echo(b: .$this-b); } } After proper initialisation, calling the function Show() gives: a: a: 2 b: b: 5 What am I forgetting here? Tia for answers! -- Kind regards, Tim -- 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] fruity arrays
snip $A_fruit_list = array('A1' = 'Fruit A1', 'A2' = 'Fruit A2', ); $B_fruit_list = array('B1' = 'Fruit B1', 'B2' = 'Fruit B2', ); then i do these: $var = B; $var_list = $var._fruit_list; //Note: variable variable below $fruit_array_of_choice = ${$var_list}; $FRUIT_code = array_keys($fruit_array), $FRUIT_name = array_values($fruit_array), /snip Shouldn't the parameter to array_keys (and obviously array_values too) be $fruit_array_of_choice, and not just $fruit_array??? That might stop the warnings... HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] relocation
Or even header(Location: index.php?var=valuevar2=value2); And you would probably want to follow that with exit; Rather than break; HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: [-^-!-%- [mailto:[EMAIL PROTECTED]] Sent: 13 August 2002 16:55 To: Christian Ista Cc: [EMAIL PROTECTED] Subject: Re: [PHP] relocation Perhaps with a HEADER statement. i.e. headers(index.php?var=valuevar2=value2); =P e p i e D e s i g n s www.pepiedesigns.com Providing Solutions That Increase Productivity Web Developement. Database. Hosting. Multimedia. On Tue, 13 Aug 2002, Christian Ista wrote: Hello, Is there a possibility to call (jump not include) with some parameters (index.php?var1=var2=) a php page without click. For example : case todo: call here index.php?var1=var2= --- jump to this page break; bye Christian, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] Credit Card suggestions
Doesn't md5 generate a 128 bit binary number??? That means there are 3.4028236692093846346337460743177e+38 possible combinations which can be generated. So surely the odds of 2 strings producing the same md5 code are 1 in 3.4028236692093846346337460743177e+38??? Having said that, I guess dictionary based attacks could break in fairly easily. That's why I always make my users have numbers and mixed case in their passwords. -Original Message- From: John S. Huggins [mailto:[EMAIL PROTECTED]] Sent: 13 August 2002 17:48 To: Robert Parker Cc: [EMAIL PROTECTED]; Adam Voigt Subject: Re: Re[2]: [PHP] Credit Card suggestions On Wed, 14 Aug 2002, Robert Parker wrote: -On Tuesday 13 August 2002 12:20 pm, you wrote: - Makes sense, except if you use upper and lowercase characters, - numbers, and symbols (as you should for secure passwords). I would - think that with these kind of passwords, storing the sheer number of - posibilites would get slightly large. And I mean even if it is easy - to break, it's more secure then storing them clear text. - - Adam Voigt - [EMAIL PROTECTED] - -Thing that really scares me about MD5 being used anywhere that's easily -accessible is what happens if 'pussycat' maps on to the same hash as -'H3ph!3s09Zw'. The crackers don't need the original password just something -that generates the same hash. Sure this is possible and I agree a concern. With MD5 there is some mathematically small chance this will happen. With SHA even smaller. However, where do we draw the line? I suppose requiring users to use long passphrases instead of passwords and MD5 that result would help with this issue. - -Bob Parker - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** -- 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] Bug reporting site
Anyone else having trouble getting to http://bugs.php.net ??? == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem Running my Scripts from IIS...
Sounds more like it's to do with the php.ini settings on the IIS box than IIS itself. http://www.php.net/manual/en/configuration.php#ini.error-reporting HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Kondwani Spike Mkandawire [mailto:[EMAIL PROTECTED]] Sent: 16 July 2002 13:46 To: [EMAIL PROTECTED] Subject: [PHP] Problem Running my Scripts from IIS... I have a problem running my Scripts from IIS... I test them on my localhost which is running Apache and PHP 4.2.1 and it works perfectly... However I get an undefined variable error running it on an IIS Server running PHP 4.2.1 Apart from these messages that make my send to pages look untidy, the Script still runs as expected on IIS... I have tried a couple of approaches: Stuck in some if and isset statements... Effect: It affects the running of the whole Script (Some of the variables loose info... and I am using locking quotations \)... I have tried sticking in @symbols and this has no effect I have tried sticking in if empty... This has a similar effect to if isset... Does anyone else have any ideas on what I could do? Kondwani -- 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] Final Year Computer Science Project involving PHP
It was a few years ago, waaay back in 96, but if its any kind of help my final year project was to design a hypertext documentation system for Java. All it did was take Java source files, and parse them to produce html output, where instances were linked to take you to the definition of that class, and class definitions were linked to take you to a list of instances of that class. 2 way linkage. Similarly for methods etc. I also added in code colorisation, so comments came up green, strings in blue etc. Doesn't sound that innovative now, but it was quite cool at the time. AND most of the things I had in there can now be seen in any good IDE. Ahead of my time... :-) One thing I did, and I assume you have to do something similar, is an evaluation in your project report. I made the source code available on my web page at university, and got folk on various java newsgroups to evaluate it for me. So not only did that section of the report get virtually written for me, but I got some fantastic feedback and ideas. Just my 2p... == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to set focus in a form field
You can do it with JavaScript. Something like: script language=JavaScript document.formname.fieldname.focus(); /script At the bottom of the page, replacing formname and fieldname with the appropriate values, obviously... HTH Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Andre Dubuc [mailto:[EMAIL PROTECTED]] Sent: 11 July 2002 16:26 To: [EMAIL PROTECTED] Subject: [PHP] How to set focus in a form field I have an annoying 'glitch' in the forms on my site: When a page loads, if it has a form on it, I would like the cursor to move to the first field, be 'set' - that is, I should see a cursor or blinking cursor in the first field. As it is now, on some pages, I either have to 'tab' to the first field, or click themouse in that field. Is there anyway to automate this, so that when a page loads it automatically goes to the first field, and 'highlights' the entry area? (Btw, I tried 'tabindex=1' but it still does not do what I'd like it to. Any ideas, suggestions, or admontions gratefully accepted. Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Wildcard
Theres no point selecting on a value if they've not specified one. The following code should generate a valid query, assumin that the default value for each value select value is an empty string: $query = SELECT * FROM table_name ; $where_string = WHERE ; $and = ; if ($select1 != ) { $where_string .= $and.col1 = '.addslashes($select1).'; $and = AND ; } if ($select2 != ) { $where_string .= $and.col2 = '.addslashes($select2).'; $and = AND ; } if ($select3 != ) { $where_string .= $and.col3 = '.addslashes($select3).'; $and = AND ; } if ($where_string != WHERE ) { $query .= $where_string; } And then run the query as normal. HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: César Aracena [mailto:[EMAIL PROTECTED]] Sent: 10 July 2002 11:50 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] Re: Wildcard Ok. Maybe I didn't express myself well (must be the 3-4 days awake ;) No, I don't have an example on-line 'couse this is something I'll start doing in a few days or hours. Well, just what it will probably be the search options at: http://www.icaam.com.ar/proyects/os-seek/ which I posted a few hours ago. What I want, is to let the visitor search for an OS developer by WORK-AROUND and/or LANGUAGE and/or LOCATION and have just ONE static query to handle all this. The thing is that if I make the query like this: SELECT * FROM table_name WHERE col1 = $elect1 AND col2 = $select2 AND col3 = $select3 I think maybe the script will go nuts if no option was selected (remember the and/or?). So I figured out that maybe by telling HTML that the default value of each SELECT box is % (or any kind of wildcard) the query might run as predicted. Does this makes ant sense now? Please go to the site I've mentioned before and afterwards (if have the time and will) go back a couple of dozens post back and read the post called *MORE WORK FOR US I HOPE* so you have a more clear understanding of what my need will be. Thanks, C. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 7:27 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Wildcard why put in your query you want to look for an value .. if they don't want to look for it ?.. vins writes: Shit. Doesn't really make sense Sorry... I probably don't understand do you have an online example. César aracena [EMAIL PROTECTED] wrote in message 000101c227fb$74eed940$68ed0dd1@gateway">news:000101c227fb$74eed940$68ed0dd1@gateway... Hi all. I'm trying to figure out how to do a search trough a MySQL db using LIKE or = but the thing is that I have 3 select boxes from where to choose the search terms. Can I use something like a wildcard instead of making several IF statements like this? SELECT * FROM table_name WHERE col1 = value1 AND col2 = value2 AND col3 = % % goes for an unselected select box (default value = %) in case the user doesn't want to make an *advanced* search, so it fetches all rows which does contains values 1 2. Thanks, mailto:[EMAIL PROTECTED] Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A simple javascript problem
Why is that a javascript problem? It may be that the guestbook expects the action variable to be registered as a global variable, but your server has this feature turned off. What is it not ddoing correctly?? Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Jon [mailto:[EMAIL PROTECTED]] Sent: 25 June 2002 12:20 To: [EMAIL PROTECTED] Subject: [PHP] A simple javascript problem Im the copy/paste guru and I want a downloaded php/mysql guestbook to work. Php and mysql works fine and Ive seen friends use this guestbook. But on my server a get file not found whenever a try to 'add' to the guestbook. 'Add' links to guestbook.php?action=add Seems like my server doesn't interprete the? correct. Is there anything really basic here Im missing... /Jon -- 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] Efficient PHP
One thing that springs to mind was something Sterling Hughes said at the PHP Conference in Frankfurt last year: If speed is an issue don't use objects, cos at the moment the oo implementation isn't particularly efficient, although it was something that would be addressed soon. Actually, for all I know this may have been addressed already... Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Ed Gorski [mailto:[EMAIL PROTECTED]] Sent: 28 May 2002 14:46 To: [EMAIL PROTECTED] Subject: [PHP] Efficient PHP Anyone know any good links on papers/articles/reports on creating efficient PHP scripts (ie functions to stay away from, good practices, etc). As a C programmer, I am a nut on efficiency and speed and I have been trying to read up on efficient PHP coding practices (besides obvious general coding practices). So can anyone offer any links or experiences? ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP+MySQL - Excel ?
You can use COM, if you're running on a Windows server. Haven't tried it myself, right enough... == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: 17 May 2002 17:32 To: Evan; [EMAIL PROTECTED] Subject: Re: [PHP] PHP+MySQL - Excel ? I guess you'd have to look around for exact specs on how Excel marks up it's source (if you want formatting, bold, etc), but it's quite easy to create a CSV (comma separated value) file which can easily be imported into Excel, if you're happy to have no formatting. I'm sure a quick dig around inside an xls file would help too. Justin French on 18/05/02 2:18 AM, Evan ([EMAIL PROTECTED]) wrote: Is it possible to create an excel file with some data from mySQL, using PHP ? Thanks, Evan -- 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] -loop question-
I'm assuming you want to send a list of passengers as the body of the text. Surely you want to do something like: $body = ''; for ($i = 0; $i $passengerNumberl ++$i) { $body .= $Name_Passenger_[$i].'\n'; } mail ($to, $subj, $body, $header); IE Prepare the list of passengers first, and then use that string as the message body??? HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Richard Bradley [mailto:[EMAIL PROTECTED]] Sent: 04 March 2002 13:54 To: [EMAIL PROTECTED] Subject: [PHP] -loop question- I want to run a loop inside of the body section of the mail() function. // CODE SNIPPLET // mail ($to, $subj, for ($i = 0; $i $passengerNumber; ++$i) { $Name_Passenger_[$i] } , $header); // ***END CODE SNIPPLET *// I can't seem to run the loop inside a variable either. Any suggestions? -- 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] -loop question-
Ooops... $i $passengerNumberl should of course read $i $passengerNumber; But you guessed that anyway, right??? Richy -Original Message- From: Richard Black [mailto:[EMAIL PROTECTED]] Sent: 04 March 2002 14:03 To: Richard Bradley; [EMAIL PROTECTED] Subject: RE: [PHP] -loop question- I'm assuming you want to send a list of passengers as the body of the text. Surely you want to do something like: $body = ''; for ($i = 0; $i $passengerNumberl ++$i) { $body .= $Name_Passenger_[$i].'\n'; } mail ($to, $subj, $body, $header); IE Prepare the list of passengers first, and then use that string as the message body??? HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Richard Bradley [mailto:[EMAIL PROTECTED]] Sent: 04 March 2002 13:54 To: [EMAIL PROTECTED] Subject: [PHP] -loop question- I want to run a loop inside of the body section of the mail() function. // CODE SNIPPLET // mail ($to, $subj, for ($i = 0; $i $passengerNumber; ++$i) { $Name_Passenger_[$i] } , $header); // ***END CODE SNIPPLET *// I can't seem to run the loop inside a variable either. Any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session variable scope - surprise!
I think session_register registers the variable and its value as a global. In this case, $test's global value is nothing. nada. Because it doesn't exist globally. In the reg() function, what is being output is a LOCAL variable called $test. Not a global value. If you put the line global $test; into the reg() function so that it reads: function reg() { global $test; $test = 13; session_register(test); echo in reg(), test=$testbr; } Then it should work as expected. Sure it *does* say in the docs somewhere that register_globals() is only applicable to global variables. HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Richard Fox [mailto:[EMAIL PROTECTED]] Sent: 04 March 2002 14:57 To: [EMAIL PROTECTED] Subject: [PHP] Session variable scope - surprise! This is a behavior I have not found documented, in fact the books I have read indicated that this would not be the case... given the script (with session.save_handler = files): ?php function reg() { $test = 13; session_register(test); echo in reg(), test=$testbr; } session_start(); reg(); echo test=$testbr; ? The output is: in reg(), test=13 test= I was quite surprised, but at least now I know why my code isn't working. I assume that $test is going out of scope after the function reg() exits. BUT, isn't registering a variable as a session variable supposed to give it superglobal status? I thought so. Can someone give me the 'official' explanation of this behavior? Many thanks, Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session variable scope - surprise!
$HTTP_SESSION_VARS only gets populated when you load another page. Or refresh the current one. To use your example again... ?php function reg() { $test = 13; session_register(test); echo in reg(), test=$testbr; } global $HTTP_SESSION_VARS; session_start(); $test = 12; reg(); if (session_is_registered(test)) { $tt = $HTTP_SESSION_VARS[test]; echo session variable test=$ttbr; } else echo You really don't know what you're doing, do you?br; ? Run this script, and it will give the output in reg(), test=13 session variable test= But... Refresh the page, and you should see: in reg(), test=13 session variable test=12 Because $HTTP_SESSION_VARS gets populated. Its something to do with HTTP headers I think - can't remember exactly why, but I know what happens. HTH, == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Richard Fox [mailto:[EMAIL PROTECTED]] Sent: 04 March 2002 15:26 To: [EMAIL PROTECTED] Subject: RE: [PHP] Session variable scope - surprise! OK, but then how do you explain: ?php function reg() { $test = 13; session_register(test); echo in reg(), test=$testbr; } global $HTTP_SESSION_VARS; session_start(); reg(); if (session_is_registered(test)) { $tt = $HTTP_SESSION_VARS[test]; echo session variable test=$ttbr; } else echo You really don't know what you're doing, do you?br; ? This still gives me the output: in reg(), test=13 session variable test= Aaargh! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session variable scope - surprise!
From the manual page for session_register on PHP.net: For each name, session_register() registers the global variable with that name in the current session. I tried your script below. The following was created in my session file: !test| Which I'm guessing means a variable which has not been instantiated. If it had held a value, it would look something like test|i:13; So to answer your questions... Session_register on an undefined global variable produces something like the above in the session file. Accessing the value later in the script has to depend on it being global, since to be registered in the session it has to be a global variable in the first place. HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Richard Fox [mailto:[EMAIL PROTECTED]] Sent: 04 March 2002 16:03 To: PHP Subject: RE: [PHP] Session variable scope - surprise! Then, when session_register(); is called (even on a variable which is going out of scope) what actually happens? Where is the data actually stored? I know it isn't in the file yet (I have session.save_handler = files) because nothing is written to the file until the script exits. So the memory for should either be in free store or on the stack. And, the second question: how can this memory, and the data it contains, be accessed later in the script (after the session_register) without having to depend on the original variable being global or not? Indeed, it appears that unless the registered variable is global, session_register will not work. (Reference my test script appended below, which can be loaded multiple times with no effect) This is undocumented! Note: I am not complaining about documentation, I am just trying to understand what exactly is happening when you register a session variable. Richard ?php function reg() { $test = 13; session_register(test); echo in reg(), test=$testbr; } session_start(); if (!session_is_registered(test)) reg(); echo HTTP_SESSION_VARS[test] = .$HTTP_SESSION_VARS[test].br; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session variable scope - surprise!
I just read further on the manual page for session_register. It also contains the following: Caution This registers a global variable. If you want to register a session variable inside a function, you need to make sure to make it global using global() or use the session arrays as noted below. Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I can't find the problem - parsing error
Swap round the and \ before the number 10 ie \10\ should be \10\ HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Pax [SMTP:[EMAIL PROTECTED]] Sent: 27 February 2002 15:47 To: [EMAIL PROTECTED] Subject:[PHP] I can't find the problem - parsing error I have the following line of code: $this-html=$this_html + tr td bgcolor=\$type_color\ class=\copy\ width=\10\ -- this line div align=\center\ ... /td /tr ; I get Warning: unexpected character in input '\' (ASCII=92) state=1 And Parse Error in the same line..I am just sitting and looking at that line and can't find the problem..can anyone see the problem? Paul -- 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] IE and Netscape
The problem isn't php related - its HTML. Try changing nbsp for nbsp; The semicolon is, strictly speaking, required for proper HTML syntax, but IE lets you get away with not having it. I guess Netscape doesn't. HTH, Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -Original Message- From: Alex Francis [SMTP:[EMAIL PROTECTED]] Sent: 19 February 2002 10:15 To: [EMAIL PROTECTED] Subject:[PHP] IE and Netscape The following code shows exactly what I want in IE5 but does not in Netscape. I have tried various combinations of slashes and quotes but can't get it to display properly. Can anyone show me the changes I need to make. Code: echo h6,$name, nbsp nbsp, E-mail:, nbsp,$email, nbsp nbsp,$date, nbsp nbsp, PostID:, nbsp,$id ,/h6; IE5:Debbie McNicol E-mail: [EMAIL PROTECTED] PostID: 180 Netscape: Debbie McNicol nbspE-mail:[EMAIL PROTECTED] nbspPostID:nbsp180 -- Alex Francis Cameron Design 35, Drumillan Hill Greenock PA16 0XD Tel 01475 798106 [EMAIL PROTECTED] http://www.camerondesign.co.uk This message is sent in confidence for the addressee only. It may contain legally privileged information. Unauthorised recipients are requested to preserve this confidentiality and to advise the sender immediately of any error in transmission. -- 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] odbc functions
Does anyone have experience of using odbc_primarykeys??? I'm writing a script to let me port a database from Access to MySQL without having to write all the table definitions by hand. But I can't get odbc_primarykeys to work - it comes back with: Warning: SQL error: , SQL state 0 in SQLPrimaryKeys I don't really know what the modifier and owner parameters should do, and suspect thats where the problem lies. I tried them as , % and . Running PHP 4.0.4 on NT 4.0 Workstation, with Access 97 Richy. == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] special chars in SQL string
Doesn't putting a backslash in front of the offending character escape it?? Isn't that what the PHP addslashes() function does??? Richy -Original Message- From: Daniel Harik [SMTP:[EMAIL PROTECTED]] Sent: 03 January 2002 19:00 To: [EMAIL PROTECTED] Subject:[PHP] special chars in SQL string Hello Guys how can escape chars like ' and so that MySQL doesn't report me errors all the time, for example when i try to add data like It's, i always have errors Thank You -- Best regards, Daniel -- 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] Checking for characters in string
Hi, I'm writing a page which will allow user's to register for an online service. They register a username and password. I want the password to contain at least one lowercase letter, at least one upper case letter, and at least one digit. So passW0rd would be valid, but password would not. Whats the most compact way to do this? substr? ereg? Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 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] Standard output (printf) question...
As far as I'm aware PHP does output to stdout. Whether or not we can actually access that stream is another question, and one I don't know the answer to. However, I do have a suggestion... Have you looked at the output buffering functions? They seem to implement what you're trying to do... http://www.php.net/manual/en/ref.outcontrol.php HTH, Richy -Original Message- From: Paul H. Breslin [SMTP:[EMAIL PROTECTED]] Sent: 21 December 2001 07:40 To: [EMAIL PROTECTED] Subject:[PHP] Standard output (printf) question... I'm trying to create a function that will generate output that could go to either a file or to the current browser directly. To do this I have something like: function GenerateOutput($out) { fwrite($out, Some stuff); fflush($out); } and to call it I tried: $stdout = fopen(php://stdout, w); GenerateOutput($stdout); But for some reason nothing shows in the browser when I do this. I can't seem to find information about what output stream printf is actually writing to. Do we have access to this stream? Can anyone provide a hint as to why the above doesn't work? Thanks. _ Paul H. Breslinhttp://Canadian-Artist.com mailto:[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]
[PHP] PHP / SSL
Hi, Bit off topic this, but I thought I'd ask anyway... I've been implementing a financial reporting system, in PHP, which will be running on the internet. Obviously, therefore, security is an issue. The system itself implements a username/password login system, but I want to be able to run it using SSL for obvious reasons. My problem is this: The server we have (Red Hat 7.0, Apache 1.3.14-3, open-ssl 0.9.5a-14, mod_ssl 2.7.1-3) came with ssl preconfigured and ready to use. It runs at 128 bit encryption which is fine as far as I'm concerned. The people who will be using the system, however, have a company standard browser which is IE 4 and only supports 40 bit encryption. And for various political reasons they don't want to upgrade all the browsers. So what I want to know is how easy it is to turn down the encryption level, and how to go about it. Any suggestions, pointers??? All the documentation I've come across thus far doesn't really cover anything like this Richy == Richard Black Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 435 3504 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] Re: max # of characters for links to work in emails?
Don't think thats necessarily true - what about news.bbc.co.uk or games.yahoo.com. Neither of them fits into the spec you described there... Richy -Original Message- From: Jerry Verhoef (UGBI) [SMTP:[EMAIL PROTECTED]] Sent: 19 December 2001 08:41 To: 'Chris Lee'; [EMAIL PROTECTED]; '[EMAIL PROTECTED]' Subject:RE: [PHP] Re: max # of characters for links to work in emails? The maximum allowed of characters in a domain name is 3 (www) + 64 (domainname) + 3 (tld) = 70 chars. So if you try to limit it within the 70 chars you should be safe. Jerry -Original Message- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 6:10 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: max # of characters for links to work in emails? a good guess would be every email client does it differnetly. unfort Id have to say try it yourself. Id imagine its long enough that you shouldnt have to worry about it, but I could be wrong. -- Chris Lee [EMAIL PROTECTED] Tom Churm [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hi, i'm working on an eCard project and somehow need to find out what the reasonable limit is on characters for urls in email bodies (normal text, not mime). i know that some mail clients will cut off urls that are too long or else throw a line break in the middle of them--thus rendering them 'unclickable'. and this is exactly what i wanna avoid. anyone have any advice to offer in this area? muchos gracias, tom -- 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] The information contained in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any form of disclosure, production, distribution or any action taken or refrained from in reliance on it, is prohibited and may be unlawful. Please notify the sender immediately. The content of the email is not legally binding unless confirmed by letter bearing two authorized signatures. -- 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] Checking a frames url..
You can get the URL of a frame using JavaScript - maybe you could pass this in somehow to the PHP script??? -Original Message- From: Necro [SMTP:[EMAIL PROTECTED]] Sent: 17 December 2001 08:59 To: [EMAIL PROTECTED] Subject:[PHP] Checking a frames url.. Lo all, I am trying to write a script that will output to a frame the current location within a site.. like Home :: Contact I need PHP to be able to check the url of the frame main and then parse out anything after the domain to decide what to output as the location. e.g. http://domain.com/contact/index.html (http://domain.com) -- forgotten (contact/index.html) If URL = contact/index.html { echo('Home :: Contact'); } If URL = business/index.html { echo('Home :: Business'); } Am I on the correct track with most of it?? I just cant work out how to grab the URL of a single frame. Thanx Andrew -- 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: PHP 4.1.0 released
Um, excuse me for pointing out the obvious, but isn't that the 4.0.6 Windows binaries? And wasn't the question about the 4.1.0 Windows binaries??? Which aren't on php.net yet.. Richy -Original Message- From: Stefan Rusterholz [SMTP:[EMAIL PROTECTED]] Sent: 11 December 2001 10:14 To: MindHunter Cc: PHP Subject:Re: [PHP] Re: PHP 4.1.0 released right from http://www.php.net/downloads.php which zeev mentions at the very top of his mail: PHP 4.0.6 installer [755Kb] - 23 June 2001 (link: http://www.php.net/do_download.php?download_file=php406-installer.exe) (CGI only, MySQL support built-in, packaged as Windows installer to install and configure PHP, and automatically configure IIS, PWS and Xitami, with manual configuration for other servers. N.B. no external extensions included) Please take your self time and comfort yourself to go to the php.net site and take a look yourself to point that bit out yourself - thank you. Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zurichbergstrasse 17 8032 Zurich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: MindHunter [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, December 11, 2001 6:42 AM Subject: [PHP] Re: PHP 4.1.0 released Where do we get the Windows Binaries? Cheers MH Zeev Suraski [EMAIL PROTECTED] wrote in message 5.1.0.14.2.20011210234236.0516bec0@localhost">news:5.1.0.14.2.20011210234236.0516bec0@localhost... After a lengthy QA process, PHP 4.1.0 is finally out. Download at http://www.php.net/downloads.php ! PHP 4.1.0 includes several other key improvements: - A new input interface for improved security (read below) - Highly improved performance in general - Revolutionary performance and stability improvements under Windows. The multithreaded server modules under Windows (ISAPI, Apache, etc.) perform as much as 30 times faster under load! We want to thank Brett Brewer and his team in Microsoft for working with us to improve PHP for Windows. - Versioning support for extensions. Right now it's barely being used, but the infrastructure was put in place to support separate version numbers for different extensions. The negative side effect is that loading extensions that were built against old versions of PHP will now result in a crash, instead of in a nice clear message. Make sure you only use extensions built with PHP 4.1.0. - Turn-key output compression support - *LOTS* of fixes and new functions As some of you may notice, this version is quite historical, as it's the first time in history we actually incremented the middle digit! :) The two key reasons for this unprecedented change were the new input interface, and the broken binary compatibility of modules due to the versioning support. Following is a description of the new input mechanism. For a full list of changes in PHP 4.1.0, scroll down to the end of this section. --- SECURITY: NEW INPUT MECHANISM First and foremost, it's important to stress that regardless of anything you may read in the following lines, PHP 4.1.0 *supports* the old input mechanisms from older versions. Old applications should go on working fine without modification! Now that we have that behind us, let's move on :) For various reasons, PHP setups which rely on register_globals being on (i.e., on form, server and environment variables becoming a part of the global namespace, automatically) are very often exploitable to various degrees. For example, the piece of code: ?php if (authenticate_user()) { $authenticated = true; } ... ? May be exploitable, as remote users can simply pass on 'authenticated' as a form variable, and then even if authenticate_user() returns false, $authenticated will actually be set to true. While this looks like a simple example, in reality, quite a few PHP applications ended up being exploitable by things related to this misfeature. While it is quite possible to write secure code in PHP, we felt that the fact that PHP makes it too easy to write insecure code was bad, and we've decided to attempt a far-reaching change, and deprecate register_globals. Obviously, because the vast majority of the PHP code in the world relies on the existence of this feature, we have no plans to actually remove it from PHP anytime in the foreseeable future, but we've decided to encourage people to shut it off whenever possible. To help users build PHP applications with register_globals being off, we've added several new special variables that can be used instead of the old global variables. There are 7 new special arrays: $_GET - contains form variables sent through GET $_POST - contains
RE: [PHP] encryption
MySQL has a PASSWORD() function which encrypts passwords for you!!! Retrieving the user records using the username and encrypted password as selection criteria will either bring back the appropriate record (ie the log in worked) or no record (ie password/username supplied were incorrect) HTH Richy -Original Message- From: Justin French [SMTP:[EMAIL PROTECTED]] Sent: 06 December 2001 12:33 To: php Subject:[PHP] encryption Hi, Can someone give me a brief over view of how to encrypt a password and store it in a MySQL DB, then be able to validate thier plain text password on login against the encrypted one on the DB? I'm guessing I: 1. encrypt the desired password with some sort of key (eg blahblah) which is hidden in a protected directory 2. write the encrypted password to the database Next time the user logs in: 1. take thier plain-text password they submit to login 2. encrypt it with the same key 3. compare it to the one on the database Or, is there something i'm missing, some sort of gaping big arse security hole, or some set of functions which take care of a heap of this stuff for me? If someone could point me to the right encryption tools / links / tutorials, i'd be gratefull. TIA Justin French -- 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] Maximum execution time of 30 seconds exceeded
The timeout is set in php.ini -Original Message- From: Christoph Starkmann [SMTP:[EMAIL PROTECTED]] Sent: 06 December 2001 17:09 To: [EMAIL PROTECTED] Subject:[PHP] Maximum execution time of 30 seconds exceeded Hi everybody! I wrote a script just to do some local replacement stuff here on my own machine. Is there any way to change the maximum execution time of PHP which seems to be restricted to 30 seconds Would be great if you could give me a hint on how to change this... Thanx alot, Kiko - It's not a bug, it's a feature. christoph starkmann mailto:[EMAIL PROTECTED] http://www.fh-augsburg.de/~kiko ICQ: 100601600 - -- 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] Access denied for user
I would hazard a guess that you have supplied a username/password/host combination that isn't valid. Check in the mysql.user table, and check that there is an entry there for the user and host. Thepassword should be encrypted so you won't know if its what you're typing, but you should be able to alter this to something else if you think it might be wrong. One other thing worth noting, is that MySQL only picks up changes to user's and user permissions when either the server process is restarted, or you instruct it to flush privileges. If this user has just been added then maybe something like this is your problem HTH Richy -Original Message- From: josep [SMTP:[EMAIL PROTECTED]] Sent: 06 December 2001 11:22 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject:[PHP] Access denied for user I get the following message when trying to view a php page Warning: Access denied for user: 'jupshoes@localhost' (Using password: YES) in /home/jupshoes/public_html/guest/index.php on line 27 Unable to connect to SQL server What is going wrong Josep -- 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] Displaying content on the fly
Try using the flush(); function. It flushes all output to the browser, and allows exactly the type of thing you're talking about here -Original Message- From: Darren Gamble [SMTP:[EMAIL PROTECTED]] Sent: 23 November 2001 16:17 To: '[EMAIL PROTECTED]' Subject:[PHP] Displaying content on the fly Good day, I've been using both Perl and PHP for some time now for dynamic content. I'm presently running PHP4 as an apache module. One difference that I've noticed is that PHP doesn't produce any output until the script is complete, whereas with Perl one could print doing this... , perform something, done. messages when performing long tasks. Is there any way to have this enabled? It would be quite appreciated, as I have a few web pages that perform very heavy database work and I would like to make the output hot so that I can print out statements as it progresses- and if there is a problem, the user will be able to identify where it failed. There doesn't appear to be a php.ini directive that does this, though... Thanks in advance, Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -- 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] Flash programming
Ming comes with a utility called swf2php or something like that, which MAY be able to convert a SWF file to PHP script that you can then work with. I say MAY, because the results are sometimes a bit unpredictable, and certain Flash constructs can cause it to fail miserably. But you might be lucky.. Richy -Original Message- From: Martin Towell [SMTP:[EMAIL PROTECTED]] Sent: 22 November 2001 02:32 To: [EMAIL PROTECTED] Subject:[PHP] Flash programming Anyone know how one can import a flash file into PHP for use with ming or something similar? It's an easy to make a flash animation with ming, but I'd like to be able to modify an existing flash file. thnx 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] Yet Another Mysql Problem
I've been using phpmyadmin 2.2.1 and found that importing data from a script requires you to be at the main page for the database, rather than the table page. Submitting it via the table page says it was executed successfully, but it wasn't. Haven't had time to look at whats causing it. I had a strange one today, where it gave me all sorts of errors about not having a valid db_link. Couldn't reproduce it though. -Original Message- From: Stephen Phillips [SMTP:[EMAIL PROTECTED]] Sent: 22 November 2001 17:16 To: [EMAIL PROTECTED] Subject:[PHP] Yet Another Mysql Problem File: ATT6.txt; charset = Windows-1252 -- 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] keeping my code!
Theres the Zend Encoder, but this is a bit pricey if you don't have a company to pay for it. Don't know if theres any free alternatives or not -Original Message- From: Ye Tun [SMTP:[EMAIL PROTECTED]] Sent: 14 November 2001 11:39 To: [EMAIL PROTECTED] Subject:[PHP] keeping my code! Hi all, I am not sure if this is the right list to ask. But I am wondering if I can keep my php code from Server Administrator of the web server I am putting my code on? Is there anyway I can encrypt or do something so that the server admin can't look at my code. REgards, Ye -- 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] Can If Else statements be split into code blocks??
Try putting curly brackets around the if and else clauses. I'm guessing the embeded html form counts as another statement in the program, which means you want to execute 2 statements if the strstr is true. I ALWAYS use curly brackets, even if I'm only executing one statemenet in my if, and I've never had problems with stuff like this. So... ?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.; } ? Should hopefully work... Richy -Original Message- From: Brad Melendy [SMTP:[EMAIL PROTECTED]] Sent: 13 November 2001 09:16 To: [EMAIL PROTECTED] Subject:[PHP] Can If Else statements be split into code blocks?? 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]
[PHP] Problems with headers in redirect
Hi, I'm hoping someone can help me with this one... I'm doing redirects to various types of file (Flash, Office, DWF etc) and have found a problem with IE5. I pass the script a document ID, and it retrieves the document record from a database, which stores the location of the file on the web server, and redirects the browser to the document. What happens is that the browser gets redirected, but doesn't get the content-type header, and subsequently can't display the document. Until yesterday I was using javascript redirection, which worked fine. However for other reasons (ie that didn't work with IE 5.5 or IE6) I had to change to using the header(Location: ) way. Only work around I can see is to do the redirection based on browser type (i.e. one way for IE5, the other for IE5.5/IE6) but thats messy. Any other ideas??? Richy -- 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/MySQL
Try putting single quotes around the strings: $Query = INSERT INTO table_name (Obj,Descrip) VALUES ('keyboard','Device to pound on when frustrated.'); Another thing that would be useful is to use the mysql_error() function in your die, which will give a better indication of the problem -Original Message- From: phantom [SMTP:[EMAIL PROTECTED]] Sent: 12 November 2001 09:50 To: [EMAIL PROTECTED] Subject:[PHP] PHP/MySQL New to this, trying to insert record into DB $Query = INSERT INTO table_name (Obj,Descrip) VALUES (keyboard,Device to pound on when frustrated.); $Results = mysql_query($Query) or die (Query FAILED); I keep getting Failed Query messages here, any idea why? PHP/MySQL manuals do not have examples of how to do this. 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]
[PHP] Lotus Domino PHP
Hi, Can anyone tell me the latest on whether or not PHP can talk tirectly to Lotus Domino/Notes??? I've had a look through the archive, and as far as I can see there was a project to do this which was going to be made available at the start of the year, but I've not seen any mention of this more recently, other than questions. Any info greatly appreciated, as we have a number of companies we are talking to who are standardised on Lotus across their organisation... Thanks, Richy -- 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]