Re: [PHP] Friday's Question

2013-09-23 Thread Eric K. Dickinson

54, Only when the surface of the desk is problematic.

On 09/20/2013 12:58 PM, Larry Martell wrote:

On Fri, Sep 20, 2013 at 10:51 AM, Tedd Sperling t...@sperling.com wrote:

Hi gang:

Do you use a Mousepad?

My reason for asking is that I've used a Mousepad ever since mice first came 
out (back when they had one ball).

Now that mice are optical (no balls), Mousepads are not really needed -- or so 
I'll told by the college -- you see, they don't provide Mousepads for their 
student's computers.

As such, I wondered what's the percentage of programmers still using a Mousepad?

Secondly, are Mousepads used primarily by older programmers (like me) while 
younger programmers don't use Mousepads, or what?

So -- please respond with:

Age: *
Mousepad: Yes/No


54 Yes



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Specifying endianness in Cross-Compiling PHP

2010-06-18 Thread Naga Kiran K
Hi,

We are cross-compiling PHP for PowerPC,Octeon platforms from FreeBSD
machine.

As we need to specify that PowerPC,Octeon platforms are big-endian during
cross-compilaintion.

Please suggest the best location to specify this endianness during
compilation phase.

Thanks,
Naga Kiran


[PHP] Re: [PHP-INSTALL] Getting file pointer from file descriptor

2010-04-16 Thread Naga Kiran K
Hi Rasmus,

Thanks for reply.
The requirement I was looking for is to read/write given only the file
descriptor number.

PHP-CGI binary is invoked by a webserver that runs in jail-directory and
doesn't have access to the file path directory.
So, it communicates with another daemon that opens a socket to that file and
in turn passes the file descriptor alone.

Can you please suggest if there is any API in PHP that serves this
requirement [read/write to given file descriptor]
Please let me know if I need to provide more information.

Thanks,
Naga Kiran

On Thu, Apr 15, 2010 at 7:33 PM, Rasmus Lerdorf ras...@lerdorf.com wrote:

 On 04/15/2010 06:52 AM, Naga Kiran K wrote:
  Hi,
 
  We are upgrading PHP from 5.2.3 to 5.3.2 and are facing few issues [like
  unsupported functions...]
 
  In PHP 5.2.3, fdopen was used to read/write to a file descriptor
  that's opened by another application.
 
  fdopen(fileDescriptorId,rw);  //It worked fine with PHP 5.2.3
 
  After PHP upgrade,its throwing undefined reference to 'fdopen'
 function.
 
  Please suggest whats the replacement for this in PHP 5.2.3 or any
  workaround.

 PHP has never had an fdopen() function.  It must be something in user
 space that provided that for you if you had it.

 -Rasmus




-- 
Regards,
Naga Kiran


[PHP] ereg_replace to preg_replace translation

2009-08-11 Thread m a r k u s

Hi all,

I see that from PHP 5.3.0 ereg_replace() function is deprecated and throws a 
warning.
I would like to use the preg_replace() function as an alternative of ereg_replace() function but... 
can't undestand the \n#[^\n]*\n expression.


$sql = ereg_replace(\n#[^\n]*\n, , $sql);

Any help for tranlation or alternative ?
Thanks

--
m a r k u s

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] open source forum

2009-07-26 Thread K. N. Lesmer
On Sun, 26 Jul 2009 14:50:03 +0200
mrfroasty mrfroa...@gmail.com wrote:

 Hello,
 
 I need some advice in picking a PHP forum for a group of people, I
 know there are couple of them but could somebody from here give
 advice on which one to choose.
 
 ***My strongest requirements I need localization support, as that
 software might need to be translated into a language other than
 English. ***Also the software should be a little bit easy to use,
 interms of administration as the clients computer literacy isnt so
 high enough. ***LAMP based software please :-)
 ***ofcourse open source software... :-P
 
 I know this phpBB, but what are other options?I have never played
 with a forum before.

I can strongly recommend Phorum (http://www.phorum.org/).

 Thanks for the input...
 
 GR
 mrfroasty
 
 -- 
 Extra details:
 OSS:Gentoo Linux
 profile:x86
 Hardware:msi geforce 8600GT asus p5k-se
 location:/home/muhsin
 language(s):C/C++,VB,VHDL,bash,PHP,SQL,HTML,CSS
 Typo:40WPM
 url:http://www.mzalendo.net
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


---
Mange venlige hilsner/Best regards

Kim Naim Lesmer
Programmer/Unix systemadministrator

Web: www.bitflop.com
E-mail : k...@bitflop.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] ReflectionMethod::invokeArgs

2009-04-23 Thread K. L.

Hi!

Please, tell me what's ReflectionMethod::invokeArgs first param for?
Since method always know it's class and it can only be invoked on it's own  
class.


Regards,
K.L.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Extract result from a https remote server response

2009-02-13 Thread m a r k u s

Shawn McKenzie wrote:

m a r k u s wrote:

Hi all,

Example : 
https://www.moneybookers.com/app/email_check.pl?email=t...@toto.comcust_id=123546password=123

The MB server response displayed is : Illegal operation.
We would like to put the result below in a php variable and process it .
An idea ?

PS: The server is secured. The php functions like file(), 
file_get_contents(), readfile(), fopen() has been tested.

Regards

--

m a r  k u s




Well, I don't know how you tested, but if fopen_wrappers are enabled in
php.ini, then this:

echo
file_get_contents('https://www.moneybookers.com/app/email_check.pl?email=t...@toto.comcust_id=123546password=123');

displays this:

Illegal operation


Seems to work for me.



The question is how to extract what is displayed to be processed by our script ?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Extract result from a https remote server response

2009-02-13 Thread m a r k u s

Shawn McKenzie wrote:

Shawn McKenzie wrote:

m a r k u s wrote:

Hi all,

Example : 
https://www.moneybookers.com/app/email_check.pl?email=t...@toto.comcust_id=123546password=123

The MB server response displayed is : Illegal operation.
We would like to put the result below in a php variable and process it .
An idea ?

PS: The server is secured. The php functions like file(), 
file_get_contents(), readfile(), fopen() has been tested.

Regards

--

m a r  k u s




allow_url_fopen = On



We have no control of the MB remote server configuration.

--
m a r k u s

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Extract result from a https remote server response

2009-02-13 Thread m a r k u s

Sorry all, I was testing in a Windows environment.
I feel like an idiot... :)

Thanks to all.

--
m a r k u s

Bruno Fajardo wrote:

Assigning the return of file_get_contents to a variable?
Didn't get your point...

2009/2/13 m a r k u s queribus2...@hotmail.com

Shawn McKenzie wrote:

Shawn McKenzie wrote:

m a r k u s wrote:

Hi all,

Example : 
https://www.moneybookers.com/app/email_check.pl?email=t...@toto.comcust_id=123546password=123
The MB server response displayed is : Illegal operation.
We would like to put the result below in a php variable and process it .
An idea ?

PS: The server is secured. The php functions like file(), file_get_contents(), 
readfile(), fopen() has been tested.
Regards

--

m a r  k u s



allow_url_fopen = On


We have no control of the MB remote server configuration.

--
m a r k u s

--
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] Extract result from a https remote server response

2009-02-12 Thread m a r k u s

Hi all,

Example :
https://www.moneybookers.com/app/email_check.pl?email=t...@toto.comcust_id=123546password=123
The MB server response displayed is : Illegal operation.
We would like to put the result below in a php variable and process it .
An idea ?

PS: The server is secured. The php functions like file(),
file_get_contents(), readfile(), fopen() has been tested.

Thanks,
Markus

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Secure way to handle pw on session.

2008-09-03 Thread k bah

 - Original Message -
 From: Dan Joseph [EMAIL PROTECTED]
 To: php-general@lists.php.net
 Subject: Re: [PHP] Secure way to handle pw on session.
 Date: Tue, 2 Sep 2008 15:35:26 -0400
 
 
 On Tue, Sep 2, 2008 at 3:27 PM, k bah [EMAIL PROTECTED] wrote:
 
 
   Hi,
 
   I noticed session files are kept on /tmp for a while, and even if they
  were immediately deleted, well, someone could use one of my php scripts to
  inject code and read them, since they belong to the httpd user.
   What's the best way to receive passwords thru a form and store them in the
  $_SESSION while I process other information to decide whether or not that
  user is able to proceed and login (check to see if user is also allowed to
  use that service, not just validate user/pw)? I use https, always, no plain
  http is used.
 
   Thanks
 
 
 I personally would recommend you never store passwords in $_SESSION.
 
 I don't know how your auth code works, but the way I've always done it would
 be to process everything when you his submit, with the password being in
 $_POST or $_GET, then after you authenticate the user, drop it and don't
 store it with sessions.  If you find you need it to be stored for other
 things, I'd suggest rethinking the design/checking you're doing.
 
 --
 -Dan Joseph
 


 You're right, and thanks to all replies, they were all helpful.
 I rechecked and, really, there's no reason to store password values anywhere, 
the only 2 places in my code where I use passwords I use it straight out from 
the POST. First I filter the content, only allowing to continue if 
preg_match_all() gives me a continue (I compare the return of 
preg_match_all() with strlen(), and if they are not the same, it means that the 
received POST value has at least 1 character that is not allowed), I was 
storing the value on the session, now I simply store it on a script variable 
(it will be unset once the script ends), and after that I pass it to another 
function (present on an included php file which actually communicates with the 
backend where hashed passwords are kept). As you said, after the input cleanup, 
I unset password on $_POST. Now it only stays on the script local variable, and 
the called function which does the real auth, once that function ends and the 
script (a form action url) ends, there's no password. Since I always use https, 
there's no reason to worry with the path between the user browser and the php 
script on the server that receives the POST. If there were no https, I would 
use javascript to not pass the password in plain text to the server.


 thanks again

=


-- 
Powered by Outblaze

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Secure way to handle pw on session.

2008-09-02 Thread k bah

 Hi,

 I noticed session files are kept on /tmp for a while, and even if they were 
immediately deleted, well, someone could use one of my php scripts to inject 
code and read them, since they belong to the httpd user.
 What's the best way to receive passwords thru a form and store them in the 
$_SESSION while I process other information to decide whether or not that user 
is able to proceed and login (check to see if user is also allowed to use that 
service, not just validate user/pw)? I use https, always, no plain http is used.

 Thanks

=


-- 
Powered by Outblaze

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Floats and avoid exponential notation - How?

2008-08-14 Thread k bah

 Hi,

 I'm working with floats because I have a big number to identify users, and the 
only operation I make with this number is to add something less than 
100 with 100 (one and ten zeros). Besides that I just need to 
use the number to search (= comparison). I never need the fractional part of 
the number. As I said, I only use float and not int because of the size of the 
number.
 I noticed PHP uses the number in exponential notation sometimes, this happened 
with both: 410 + 100 and 4153154 + 100. I'm using 
ctype_digit() to check when this happens. Is there a way to avoid that so that 
PHP always uses the decimal notation?

(The focus on my code is not to generate the new user id, I just need to 
generate it to do other things. Almost all my functions need to generate the 
new user id, as we cannot map the old user ids to the new user ids. I'm putting 
two systems together, at least for now, I need to use the old user id from 1 
external source and generate the new user id to operate user records on another 
external db.)

- code -- (receives old user id, and changes to the new format)
$_SESSION['some_array']['old_user_id'] = $userinfo[0]; // I got the number from 
DB. Say. 4153154..
$checking_old_user_id = (string)$_SESSION['some_array']['old_user_id']; 
// So I can use ctype_digit()
$_SESSION['some_array']['new_user_id'] = (float)100 + 
$userinfo[0];
$checking_new_user_id = (string)$_SESSION['some_array']['new_user_id'];
$_SESSION['some_array']['foo'] = $userinfo[1]; // Other data

if( ctype_digit($checking_old_user_id) == false ) { // Exponential 
notation detected
echo 'some message';
return false; // Script stops!
}
if( ctype_digit($checking_new_user_id) == false ) { // Exponential 
notation detected
echo 'some message';
return false;
}
if($_SESSION['some_array']['old_user_id']  0) { // Filter input
echo 'some message';
return false;
}
if($_SESSION['some_array']['new_user_id']  0) { // Filter input
echo 'some message';
return false;
}
- code

 Any ideas, suggestions? I would like to make php stop using the exponential 
notation so I don't need to bother with these checkings.

 thanks.

=


-- 
Powered by Outblaze

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php help.

2008-07-19 Thread Venky K Shankar
On Saturday 19 July 2008 01:11:38 pm Belinda wrote:
 Good morning

 I have just been browsing the web for help with a php problem that is
 driving me mad. I didn't want to post to the site so hope that this email
 may get a response. I thank you in advance.

 I am learning php myself(self-learning) but just can get me head around
 this error.(lack of knowledge L)



 With regard to [function.file-get-contents] can anyone explain this error
 to me...please :-)



 Warning:
 file_get_contents(http://www.ecofriendz.com/groups/orca/?action=group_last_
t opicsforum=Bea-Tropicaltrans=1) [function.file-get-contents]: failed to
 open stream: Connection refused in
 /home/sites/ecofriendz.com/public_html/inc/classes/BxDolGroups.php on line
 419.

 i think you are missing   in the function :
 see below :
[EMAIL PROTECTED]:~/py php -r ' 
file_get_contents(http://www.ecofriendz.com/groups/orca/?action=group_last_t;);
 '
[EMAIL PROTECTED]:~/py

 the URL must be inside  





 I cannot resolve this issue. any help will be gratefully appreciated.



 With Kindest Regards



 Belinda Marsh




[PHP] Floats and avoid exponential notation - How?

2008-07-17 Thread k bah

 Hi,

 From http://www.php.net/manual/en/language.types.float.php (second comment in 
that page, from kjohnson at zootweb dot com):

PHP switches from the standard decimal notation to exponential notation for 
certain special floats. You can see a partial list of 
such special values with this:

 Then he goes on about it and finishes with:

  I have to be honest: this is one of the strangest things I have seen in any 
language in over 20 years of coding, and it is a 
colossal pain to work around.

 I have the same problem. I have a big number I have to represent, it's usually 
1 followed by 10 zeros, the biggest value I'll 
have for it is 199, never more than this. I only make one operation 
with it, (+), most of the time I need that number as a 
string, and never need it's float representation, only the absolute value (in 
fact, it's never going to have a fractional part). I 
cannot use integers because it's bigger than the integer range. 

 If it goes to it's exponential representation, breaks my code. Users are 
identified by that number. I wrote a small function, but 
cannot be sure if it's going to work (report error when the exponential 
notation is used by php), mostly because on my tests, I 
can't precise when and to which of these numbers php chooses to use the 
exponential notation:

--- code
function checkFloat($float_var) {

$ar_empty = ;
$string_var = (string)$float_var;

$pattern = '/[0-9]|\./'; // From zero to nine and dots
$match_found = preg_match_all($pattern, $string_var, $ar_empty);

unset($ar_empty);
 if ($match_found != strlen($string_var)) {
return false;
} else {
return true;
}
}
--- code
 
 So, any suggestions/thoughts?
 Is there a way to prevent php from using the exponential notation for a float?


 thanks

=


-- 
Powered by Outblaze

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Check if var content was exceeded (float).

2008-07-09 Thread k bah


-- 
Powered by Outblaze

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP with C++[Zend Engine?]

2008-06-09 Thread Павел aka [R-K]
You wrote:

 4) Post questions here if you have problems but be sure you show that
 you've done 1-3 or we'll ignore you.
I read this book and some else,but nothing book helped me in writing Zend - 
Extension...
I'd like to wrote some similar but simplier them Zend Encoder... If you can, 
help me please.

PS.Sorry for my English.

-- 
===
С уважением, Манылов Павел aka [R-k]
icq: 949-388-0
mailto:[EMAIL PROTECTED]
===
А ещё говорят так:
A kid'll eat the middle of an Oreo, eventually.
[fortune]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP with C++[Zend Engine?]

2008-06-09 Thread Павел aka [R-K]
You wrote:

 4) Post questions here if you have problems but be sure you show that
 you've done 1-3 or we'll ignore you.
I read this book and some else,but nothing book helped me in writing Zend - 
Extension...
I'd like to wrote some similar but simplier them Zend Encoder... If you can, 
help me please.

PS.Sorry for my English.

-- 
===
С уважением, Манылов Павел aka [R-k]
icq: 949-388-0
mailto:[EMAIL PROTECTED]
===
А ещё говорят так:
A kid'll eat the middle of an Oreo, eventually.
[fortune]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP with C++[Zend Engine?]

2008-06-09 Thread Павел aka [R-K]
You wrote:

 4) Post questions here if you have problems but be sure you show that
 you've done 1-3 or we'll ignore you.
I read this book and some else,but nothing book helped me in writing Zend - 
Extension...
I'd like to wrote some similar but simplier them Zend Encoder... If you can, 
help me please.

PS.Sorry for my English.

-- 
===
С уважением, Манылов Павел aka [R-k]
icq: 949-388-0
mailto:[EMAIL PROTECTED]
===
А ещё говорят так:
A kid'll eat the middle of an Oreo, eventually.
[fortune]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Ignoring user cancel

2008-02-22 Thread K T Ligesh

 Hello,

 I have a php process running on lighty that should continue even if the user 
presses cancel in his browser. The default behavior is that the web-server will 
kill the cgi process on user cancellation. Is there some way I can prevent the 
user cancel from interfering with the php process. Can I ignore the 
web-server's kill in php or is this a configuration that should be handled at 
the web-server?

 Any help is greatly appreciated.

 Thanks a lot in advance.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Ignoring user cancel

2008-02-22 Thread K T Ligesh
 Yes, that was what I was looking for. Searching google for 'php ignore user 
interrupt', got me links on CPU interrupt management.

 Thanks again.

On Fri, Feb 22, 2008 at 05:56:45PM -0800, Casey wrote:
 ignore_user_abort(true);
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Php code in html buttons

2007-07-10 Thread k w

I'm trying to make a button execute some php code when the button is
clicked. I'm not sure if it is the button i'm coding wrong or the php code.
Here is the code I am using.

?php
echo button action='?php mysqli_query($connect,$query)?'Click/button;
?

I've got all my variables stored in the php page, and I know they are all
correct. But when I push the button it does nothing. I'm not quite sure what
I am doing wrong.

I have also tried

input type=button value=Click OnClick= ?php
mysqli_query($connect,$query); ?

and

form onclick=?php mysqli_query($connect,$query); ?
input type=button value=Click
/form

Obviously i'm a complete newbie. I'd appreciate any help. Thanks.


Re: [PHP] Selecting Rows Based on Row Values Being in Array

2007-07-05 Thread K. Hayes
No not trying to trick you at all.  It's just that because of an incident I 
had on a previous site with giving actual table names etc. I had another one 
helping me through forums.  I actually share too much info. as a result my 
DB was ruined...


At any rate had no clue about combined_string it showed me the error of my 
ways.  I am reading a file into an array using file( ).  So SELECT 
CONCAT(strName,strCity,strState) AS combined_string FROM central helped me 
to see error of my way so I changed the statement to.
SELECT * FROM central WHERE CONCAT(strName,' ',strCity,' ',strState) it 
worked.  So what do I owe you?


- Original Message - 
From: Jim Lucas [EMAIL PROTECTED]

To: kvigor [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Thursday, July 05, 2007 10:10 AM
Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array



kvigor wrote:

Sorry,
That was a typo there's on one IN clause.
here is how it reads: SELECT * FROM central WHERE 
CONCAT(strName,strCity,strState) IN('7orange50lbs','8purple60lbs').


So in my table I have 8 in size column, purple in color column, and 60lbs 
in weight column.


Since the concatenated value will be 8purple60lbs, shouldn't MySQL return 
that row?  Thanks for your patience.


Ok, well, here is what I would do now.  Just to make sure things are as we 
are assuming they are.


SELECT CONCAT(strName,strCity,strState) AS combined_string FROM central

print the results of that sql and see if combined_string looks like what 
we think it should be.


This you can do in phpmyadmin.

oh, what is up with the naming conventions?  Trying to trick us?

To me it would not be obvious that you are storing colors in column for 
what looks like a city name.


Just wondering...

--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Selecting Rows Based on Row Values Being in Array

2007-06-30 Thread K. Hayes

Will do.  Thanks.


- Original Message - 
From: Jim Lucas [EMAIL PROTECTED]

To: kvigor [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Saturday, June 30, 2007 1:46 AM
Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array



kvigor wrote:

Hello All,

I'm attempting to return rows from a mysql DB based on this criteria:

I have a list, in the form of an array that I need to compare against 
each row

in the table.  Where theres a match I need that entire row returned.

e.g.$varListof 3outOf_10Fields = array(6blue40lbs, 7orange50lbs, 
8orange60lbs, 9purple70lbs);


The array contains 3 of the db row fields in 1 value. However there are 
10 fields/columns in the table.


===
what table looks like  |
===
  size   colorweight
ROW 1| value1 | value1 | value1 | value1 | value1 | value1 |

So how could I set up a query that would SELECT the entire row, if the 
row contained $varListof 3outOf_10Fields[1].


Open to any suggestions or work arounds.  I'm playing with extract() but 
code is too crude to even post.



I would suggest approaching the problem with a slightly different thought.

just have the sql concat() the columns together and then compare.

something like this should do the trick

$list = array(
'6blue40lbs',
'7orange50lbs',
'8orange60lbs',
'9purple70lbs',
);

$SQL = 
SELECT *
FROM my_Table
WHERE CONCAT(value1, value2, value3) IN ('.join(',', $list).')
;

mysql_query($SQL);

this should take, for each row in the DB, value1 + value2 + value3 and 
create one string from them, then it will compare each string in the

IN (...)  portion to each entry in the $list array().

Let me know if you need any further help 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Form Data Filtering

2007-06-16 Thread K. Hayes

if(@sizeof($profanity)  0)
{
 echo div class='ermess1'br /Please bREMOVE/b the profanity in the 
following fields. Immediately!/div;


 foreach($profanity as $field = $value)
 {
  echo nbsp;nbsp;div{$label_array[$field]}/div; //line 114
 }
}
- Original Message - 
From: Stut [EMAIL PROTECTED]

To: kvigor [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Saturday, June 16, 2007 9:40 AM
Subject: Re: [PHP] Form Data Filtering



kvigor wrote:

if (in_array(strtolower($value), $profanity))
{
 $profanity[$field] = bad;
}

on php.net I haven't seen any example on using strtolower w/ arrays.

I tried this an I get the following output:

Please REMOVE the profanity in the following fields. Immediately!
Notice: Undefined offset: 0 in C:\htdocs\Sweepstakes\sosValidate.php on 
line 114



Notice: Undefined offset: 1 in C:\htdocs\Sweepstakes\sosValidate.php on 
line 114



Notice: Undefined offset: 2 in C:\htdocs\Sweepstakes\sosValidate.php on 
line 114



Notice: Undefined offset: 3 in C:\htdocs\Sweepstakes\sosValidate.php on 
line 114 ...etc.


 I also tried (in_array(strtolower($_POST[$value]), $profanity)) same 
result.


Which line is 114? I'm betting it's not the in_array line.

-Stut 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Install question

2007-06-15 Thread Paul K
I have just started with a clean install on a Windows XP Pro system, 
Apache 2.24 and PHP 5.2.3


Apache Monitor reports Apache/2.24(Win32)PHP/5.2.3.

I can access html files just fine but I can't even run a test program

?php
phpinfo();
?

Nothing displays.

Where do I look to see whats wrong?

Paul

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cant set info in DB...HELP

2007-06-02 Thread K. Hayes
What lists are you referring to?  Also this is how the examples show I've 
seen.


I know this is basic general stuff but I try many times before posting, and 
I have followed all directions given.


So this is what I did, and nothing is set DB still :-(

===NEW CODE=
  $regName = trim(strip_tags($_POST['conName'])); $regAddress = 
trim(strip_tags($_POST['conAddress']));
  $regCity = trim(strip_tags($_POST['conCity'])); $regState = 
trim(strip_tags($_POST['conState']));
  $regZip = trim(strip_tags($_POST['conZip'])); $regPhone = 
trim(strip_tags($_POST['conPhone']));


  $sclName = trim(strip_tags($_POST['schName'])); $sclAddress = 
trim(strip_tags($_POST['schAddress']));
  $sclCity = trim(strip_tags($_POST['schCity'])); $sclState = 
trim(strip_tags($_POST['schState']));

  $sclZip = trim(strip_tags($_POST['schZip']));

  $stoName = trim(strip_tags($_POST['strName'])); $stoCity = 
trim(strip_tags($_POST['strCity']));

  $stoState = trim(strip_tags($_POST['strState']));
//==Begin dbPopulation of Form 
info===


$dbserver = localhost;  // This will be where server name goes
$dbuser = root;  // This will be where username goes
$dbpassword = ; // This will be where password goes
$dbname = theDB;  // This will be where database name goes
$connection = mysqli_connect($dbserver, $dbuser, $dbpassword, $dbname) or 
die (mysqli_error($connection));


$regName = mysqli_real_escape_string($connection, $regName);
$regAddress = mysqli_real_escape_string($connection, $regAddress);
$regCity = mysqli_real_escape_string($connection, $regCity);
$regState = mysqli_real_escape_string($connection, $regState);
$regZip = mysqli_real_escape_string($connection, $regZip);
$regPhone = mysqli_real_escape_string($connection, $regPhone);
$sclName = mysqli_real_escape_string($connection, $sclName);
$sclAddress = mysqli_real_escape_string($connection, $sclAddress);
$sclCity = mysqli_real_escape_string($connection, $sclCity);
$sclState = mysqli_real_escape_string($connection, $sclState);
$sclZip = mysqli_real_escape_string($connection, $sclZip);
$stoName = mysqli_real_escape_string($connection, $stoName);
$stoCity = mysqli_real_escape_string($connection, $stoCity);
$stoState = mysqli_real_escape_string($connection, $stoState);

$sql_query = INSERT INTO contestants (conName, conAddress, conCity, 
conState, conZip, conPhone, schName, schAddress, schCity, schState, schZip, 
strName, strCity, strState) VALUES('$regName', '$regAddress', '$regCity', 
'$regState', '$regZip', '$regPhone', '$sclName', '$sclAddress', '$sclCity', 
'$sclState', '$sclZip', '$stoName', '$stoCity', '$stoState');


mysqli_query($connection,$sql_query); ?
===END NEW CODE=


- Original Message - 
From: Stut [EMAIL PROTECTED]

To: K.Hayes [EMAIL PROTECTED]
Cc: php-general php-general@lists.php.net
Sent: Saturday, June 02, 2007 9:52 PM
Subject: Re: [PHP] Cant set info in DB...HELP



Please include the list on all replies.

K.Hayes wrote:

I don't know if I'm escaping the 'vars correctly'.  If I'm wrong can you
give me an example?

snip

$sql_query = INSERT INTO contestants (conName, conAddress, conCity,
conState, conZip, conPhone, schName, schAddress, schCity, schState, 
schZip,

strName, strCity, strState) VALUES('$regName', '$regAddress', '$regCity',
'$regState', '$regZip', '$regPhone', '$sclName', '$sclName', '$sclCity',
'sclState', '$sclZip', '$stoName', '$stoCity', '$stoState'); 
$insert_query = mysqli_real_escape_string($connection, $sql_query);


mysqli_query($connection,$insert_query); ?


No, this is not the right way. I suggest you read the manual page on 
mysqli_real_escape_string (http://php.net/mysqli_real_escape_string). You 
need to run it on every variable you are using *in* the SQL query, not on 
the SQL query itself.


Google for a php mysqli tutorial - all this stuff is very basic and should 
be covered by most tutorials you'll find.


-Stut 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strange mysqli error

2006-08-23 Thread Richard K Miller


On Aug 23, 2006, at 2:33 AM, Jochem Maas wrote:


how do you know which object is destroyed first?

also you are using 3 different versions of php - not something that  
will

help narrow down the problem.

Richard K Miller wrote:

Good afternoon.  I'm getting a weird mysqli error in my object
destructor.  Here's an example:

?php

$db = new mysqli('localhost', USERNAME, PASSWORD, DATABASE);

class Test
{
function __construct()
{
global $db;

$db-query(SELECT 'test');
print_r($db-error);
}

function __destruct()
{
global $db;

$db-query(SELECT 'test');  // line 20
print_r($db-error);  // line 21
}
}

$test = new Test();


what happens if you add the following line:

unset($test);



No errors when I use unset().   I see what you mean about not knowing  
which object is destroyed first.  Maybe I'll have to use a non-OOP  
connection to MySQL, since it wouldn't appear there's any way to  
specify the order of destruction of objects.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strange mysqli error

2006-08-23 Thread Richard K Miller


On Aug 23, 2006, at 11:41 AM, Jochem Maas wrote:


you can still use OOP, only you can't rely on auto destruct with
regard to object existance.

try the ini settings auto_prepend_file auto_append_file

http://php.net/manual/en/ini.core.php#ini.auto-append-file

and use them to control the startup /or shutdown phase of your  
app. e.g:


class DB {
private $connObj; // obj of class DB
  // don't allow references to it outside the class 

	static function shutdown()  { unset(self::$connObj); /* trigger  
self::__destruct() */ }
	function __destruct()  { /* do stuff (which you could just as well  
do in self::shutdown()?) */ }

}

shutdown.php:
?php

DB::shutdown();



Jochem,

That's a good idea, and I'm glad to learn about the auto-append-file  
directive for the first time, but that seems a bit more hack-ey  
than I want.


Just to document this a bit more, this page has a quote supposedly  
from Andi Gutmans saying we must not rely in any way on the order of  
destruction during shutdown:


http://www.phpbuilder.com/board/archive/index.php/t-10293485.html

Previous bug reports on this issue:
http://bugs.php.net/bug.php?id=36034
http://bugs.php.net/bug.php?id=31326

Since these bugs don't appear to be slated for fixing, I submitted a  
request to change the documentation:

http://bugs.php.net/bug.php?id=38572

The documentation ought to reflect that we cannot rely on the the  
order of destruction rather than the current The destructor method  
will be called as soon as all references to a particular object are  
removed, which is incorrect.


But I'd actually prefer that the bug be fixed rather than the  
documentation changed.


Richard

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] strange mysqli error

2006-08-22 Thread Richard K Miller
Good afternoon.  I'm getting a weird mysqli error in my object  
destructor.  Here's an example:


?php

$db = new mysqli('localhost', USERNAME, PASSWORD, DATABASE);

class Test
{
function __construct()
{
global $db;

$db-query(SELECT 'test');
print_r($db-error);
}

function __destruct()
{
global $db;

$db-query(SELECT 'test');  // line 20
print_r($db-error);  // line 21
}
}

$test = new Test();

?


A. On my dev machine (Mac OS X + PHP 5.1.4 + MySQL 5.0.19) I get the  
following errors EVERY time:
Warning: mysqli::query() [function.mysqli-query]: Couldn't fetch  
mysqli in /Users/richard/Projects/data/private/mgftest.php on line 20
Warning: Test::__destruct() [function.Test---destruct]: Couldn't  
fetch mysqli in /Users/richard/Projects/data/private/mgftest.php on  
line 21


B. On my production server (FreeBSD + PHP 5.1.2 + MySQL 5.0.19) I  
SOMETIMES get the following error: (If I refresh the page repeatedly,  
sometimes there's an error, sometimes not.)
Warning: mysqli::query() [function.query]: Couldn't fetch mysqli in / 
usr/local/www/data/private/mgftest.php on line 20


C. On a commercial web host (PHP 5.0.4 + MySQL 5.0.22) I NEVER get  
any errors.


There's nothing else in my error logs, $db-errno is 0, and $db-error  
is empty.  Interestingly, I never get any errors from the constructor.


Any ideas?

Richard


---
Richard K. Miller
www.richardkmiller.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] �Թ����ʹ͡����µ��-����Ѻ����ӧҹ��Ш��������Ңͧ�Ԩ������ͼ�������ҡ�����˹���ѵ���ôԵ�����Թ��������Ҵ͡ᾧ

2006-06-30 Thread k. chin

ÊÔ¹àª×èÍ´Í¡àºÕéµèÓ-ÊÓËÃѺ¼Ùé·Ó§Ò¹»ÃШÓËÃ×Íà¨éҢͧ¡Ô¨¡ÒÃËÃ×ͼÙé·ÕèÍÂÒ¡à¤ÃÕÂ˹ÕéºÑµÃà¤Ã´ÔµËÃ×ÍÊÔ¹àª×èÍà¡èҴ͡ᾧæ
 
   ´éÇÂÊÔ¹àª×èÍ´Í¡àºÕé·ÕèµèÓ 0.69 - 0.99% 
äÁèÁÕ¤èÒ¸ÃÃÁà¹ÕÂÁ㹡ÒÃãªéǧà§Ô¹
   ¨ÐạÀÒÃÐ˹ÕéÊÙ§ ´Í¡àºÕéÂᾧÍÂÙè·ÓäÁ 
ã¹àÁ×èÍÁÕ·Ò§àÅ×Í¡·Õè´Õ¡ÇèÒ 
  â͹˹ÕéºÑµÃà¤Ã´ÔµËÃ×ÍÊÔ¹àª×èÍ ÁÒ¸¹Ò¤ÒþҳԪÂì 
·Õè´Í¡àºÕéµèÓ¡ÇèÒ 

   ¤Ø³ÊÁºÑµÔ¢Í§¼ÙéÊÁѤÃ
  - à¨éҢͧ¡Ô¨¡ÒÃ/¢éÒÃÒª¡ÒÃ/ÃÑ°ÇÔÊÒË¡Ô¨ ËÃ×;¹Ñ¡§Ò¹»ÃШÓ
- ºØ¤¤Å·ÑèÇä»·ÕèÁÕÃÒÂä´é»ÃШÓäÁèµéͧÁÕÊÔ¹·ÃѾÂì ËÃ×Í ºØ¤¤Å¤éÓ»ÃСѹ 
- ¼ÙéÊÁѤÃà¡èÒäÁèà¤Â¶Ù¡»ÃѺ 㹡ÒêÓÃÐà§Ô¹ã¹ªèǧàÇÅÒ 6 à´×͹·Õè¼èÒ¹ÁÒ
- ÁÕàºÍÃìâ·ÃÈѾ·ìºéÒ¹
 
-  ÍѵÃÒ´Í¡àºÕé¶١ÁÒ¡ ¤Ó¹Ç³áºº Å´µé¹Å´´Í¡ (0.69 - 0.99%/à´×͹)
-  ÊÒÁÒö¡Ùéä´é 5 à·èҢͧÃÒÂä´é ËÃ×ÍÊÙ§ÊØ´ 1,500,000 ºÒ·
-  ¼è͹ªÓÃÐẺʺÒÂæ 12 - 60 à´×͹  
-  ¶éÒªÓÃеçàÇÅÒã¹»Õáá »Õ¶Ñ´ä»Å´´Í¡àºÕéÂÍÕ¡»ÕÅÐ 0.25% 
-  ÊÒÁÒö»Ô´Ç§à§Ô¹·ÕèàËÅ×Íä´é¡è͹¡Ó˹´ËÅѧ¨Ò¡ 1 »Õ â´ÂäÁè¤Ô´´Í¡àºÕéÂàÅ 
 
  1. ¼ÙéÁպѵÃà¤Ã´Ôµ ËÃ×ÍÁÕÊÔ¹àª×èͺؤ¤Å¢Í§·Ø¡Ê¶ÒºÑ¹
   - ͹ØÁѵԷѹ·Õà·èҡѺǧà§Ô¹ÊÙ§Êش㹺ѵà 
ËÃ×Íǧà§Ô¹ÊÔ¹àª×èÍ·ÕèÍéÒ§ÍÔ§ÁÒ 
   - äÁèàªç¤ÀÒÃÐ˹ÕéÊÔ¹¢Í§·èÒ¹ 
   - äÁèµéͧãªéÊÅÔ»à§Ô¹à´×͹ ËÃ×Í Ê൷àÁé¹·ì 
   - äÁèµéͧÁպؤ¤ÅËÃ×ÍËÅÑ¡·ÃѾÂì¤éÓ»ÃСѹ 
   - ¡ÒÃÊÁѤçèÒ æ àÍ¡ÊÒûÃСͺäÁèÂØè§ÂÒ¡ 

  àÍ¡ÊÒûÃСͺ¡ÒÃÊÁѤÃ
-  ÊÓà¹ÒºÑµÃ»ÃЪҪ¹ áÅÐÊÓà¹Ò·ÐàºÕ¹ºéÒ¹
-  ãºá¨é§Ë¹ÕéºÑµÃà¤Ã´ÔµËÃ×ÍÊÔ¹àª×è͵ÑǨÃÔ§à´×͹ÅèÒÊØ´ËÃ×ÍÂé͹äÁèà¡Ô¹2à´×͹
-  ÊÓà¹ÒÊÁØ´¸¹Ò¤ÒÃ˹éÒáá·Õè¨ÐãË鸹ҤÒÃâ͹à§Ô¹à¢éÒ
   -  ãºà»ÅÕ蹪×èÍÊ¡ØÅ (¶éÒÁÕ) 

   2. ÊÓËÃѺ¼Ùé·ÕèäÁèÁÕËÃ×ÍäÁèÍéÒ§ÍÔ§ºÑµÃà¤Ã´ÔµËÃ×ÍÊÔ¹àª×èÍà´ÔÁ 
 
  -  ÃÒÂä´éÃÇÁ 10,000 áÅÐ 15,000 º./à´×͹¢Öé¹ä» 
  -  ÊÓËÃѺà¨éҢͧ¡Ô¨¡ÒÃÃÒÂä´é 20,000 º./à´×͹¢Öé¹ä» 
  -  ÍѵÃÒ´Í¡àºÕé¤ӹdzẺŴµé¹Å´´Í¡(àËÅ×ÍäÁè¶Ö§1%µèÍà´×͹)
  -  ÊÒÁÒö¡Ùéä´é 5 à·èҢͧÃÒÂä´éµèÍà´×͹ ¡Ùéä´é¶Ö§ 1,500,000 
ºÒ·
  -  ÊÒÁÒö¼è͹ªÓÃÐä´é µÑé§áµè 1 »Õ - 5 »Õ
  -  àÁ×èͪÓÃеçàÇÅÒ »Õ¶Ñ´ä»Å´ÍѵÃÒ´Í¡àºÕéÂŧÍÕ¡ 0.25%-1%
 
 àÍ¡ÊÒûÃСͺ¡ÒÃÊÁѤà 
o ÊÓà¹ÒºÑµÃ»ÃЪҪ¹ áÅÐÊÓà¹Ò·ÐàºÕ¹ºéÒ¹ 
o ÊÅÔ»à§Ô¹à´×͹ 
ËÃ×Í˹ѧÊ×ÍÃѺÃͧà§Ô¹à´×͹(µÑǨÃÔ§äÁèà¡Ô¹2à´×͹) 
o ÊÓà¹ÒºÑ­ªÕÍÍÁ·ÃѾÂìÂé͹ËÅѧ 3 à´×͹(µèÍà¹×èͧ¨Ò¡»Ñ¨¨ØºÑ¹) 
o ÊÓà¹ÒÊÁØ´ 
¸.˹éÒáá·ÕèÃкت×è͸¹Ò¤ÒÃ-àÅ¢ºÑ­ªÕ-ª×èͼÙéÊÁѤÃà¾×èÍâ͹à§Ô¹à¢éÒ 
o ãºà»ÅÕ蹪×èÍÊ¡ØÅ (¶éÒÁÕ)
   
3. ÊÓËÃѺà¨éҢͧ¡Ô¨¡ÒÃ(·ÐàºÕ¹¡ÒäéÒ-˨¡.-º.ÏÅÏ)
  -  ÊÓà¹ÒºÑµÃ»ÃЪҪ¹ áÅÐÊÓà¹Ò·ÐàºÕ¹ºéÒ¹
  -  
ÊÓà¹Ò¡Òè´·ÐàºÕ¹¡ÒäéÒ(ÍѺഷäÁèà¡Ô¹6à´×͹)
  -  ÊÐ൷àÁ¹·ìÂé͹ËÅѧ 6 à´×͹
  -  ÊÓà¹ÒÊÁØ´ ¸.˹éÒááà¾×èÍ¡ÒÃâ͹à§Ô¹à¢éҺѭªÕ
-  ÊÓà¹ÒºÑ­ªÕÃÒª×èͼÙé¶×ÍËØé¹ (¶éÒÁÕ)

 µÑÇÍÂèÒ§
à§Ô¹ÊÔ¹àª×èÍ …..1 »Õ.   2 »Õ.   ….3 »Õ. ….4 
»Õ. ….5 »Õ.
 ..30,000..   ..2,780   .1,530  ..1,120  
..…920  ..…800
 ..75,000..   ..6,920   .3,790  ..2,750 
..2,250 ..1,950
 100,000....9,170   .5,000  ..3,620 
..2,940 ..2,540
 200,000..   .18,250.9,890  .7,140  ..5,780 
..4,980
 300,000..   .27,220   14,690  10,550   
.8,510  ..7,300
 500,000..   .45,130   24,250  17,340  
13,920  11,900
 700,000..   .63,190   33,950  24,270  
19,490  16,660
 1,000,000   .90,260   48,490  34,670  27,840   
   23,790
 1,500,000  135,39072,730  52,000  41,750  
35,690

  ËÁÒÂà赯 : ºÃÔ¡ÒÃà¡çºàÍ¡ÊÒö֧·ÕèºéÒ¹áÅзÕè·Ó§Ò¹ã¹à¢µ¡Ãا෾ 
áÅлÃÔÁ³±Å 
µèÒ§¨Ñ§ËÇÑ´Êè§àÍ¡ÊÒ÷ҧä»ÃɳÕÂì
µÔ´µèÍÊͺ¶ÒÁä´é·Õè k. chin  06-7815050, 03-7797261
[EMAIL PROTECTED]
¢ÍÍÀÑÂà»ç¹ÍÂèÒ§ÊÙ§ ¶éÒËÒ¡àÁÅì¹Õéú¡Ç¹·èÒ¹

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] ��Ң�¶١ Licensed Windows XP Pro, win 98, 98 se, Office XP Small, Office

2006-06-28 Thread k. paisarn
àÃÒ¢Ò¶١ Licensed Windows XP Pro, win 98, 98 se, Office XP Small, Office 
XP Professional, Office Pro 2003 ¶Ù¡ÁÒ¡ ¢Í§á·éá¹è¹Í¹ 100 % 
µÔ´µèÍ  Paisarn  06-5881135
- Windows 95 ẺÁÕ CD ¤ÃºªØ´ 200 bath 
- Windows 98 book+COA only 800 bath 
- Windows 98 book+COA+CD 1,000 bath 
- Windows 98 SE book + COA + CD ÊÕ¢ÒÇãËÁè 1,500 bath 
- Windows 2000 Professional + CD  2,700 bath 
- Windows ME ¤ÙèÁ×Í + COA + CD 1,800 bath 
- Windows XP Home Edition ¤ÙèÁ×Í + COA 2,000 bath 
- Windows XP Home Edition ¤ÙèÁ×Í + COA + CD 2,700 bath
- Windows XP Professional ¤ÙèÁ×Í + COA 2,400 bath
- Windows XP Professional ¤ÙèÁ×Í + COA+CD 3,500bath
- Microsoft Office Pro 2003 7,500 bath
- Microsoft Office Basic 5500 
µÔ´µèÍ  ä¾ÈÒÅ  06-5881135   [EMAIL PROTECTED] 
«×éÍËÅÒªشÊèǹŴÂÔè§à¾ÔèÁ¤ÃѺ ºÃÔ¡ÒÃÊ觶֧·Õè ¡·Á.-µ¨Ç.¾ÃéÍÁãºàÊÃç¨ãËé 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] serialize() function

2006-04-13 Thread Richard K Miller
There's nothing special about the data returned by serialize() except  
that it can be safely written saved, transmitted, etc.  To do  
anything useful with it you have to unserialize() it.  The cool part  
about it is that you can serialize any data structure, like an entire  
array or object.


The Yahoo Developer center (ever friendly to PHP developers) talks  
about how their APIs can return serialized data for PHP:


http://developer.yahoo.com/common/phpserial.html

For example, use can use the Yahoo Search API to search for  
Seinfeld, unserialize the results, and have a beautiful array to use:


print_r(unserialize(file_get_contents(http://api.search.yahoo.com/ 
WebSearchService/V1/webSearch? 
appid=YahooDemoquery=Seinfeldresults=3output=php)));


(It's almost like making SOAP out of a REST call.)

Richard


On Apr 13, 2006, at 3:53 PM, Nicholas Couloute wrote:

Are there any tutorials and uses for serialize() ? I went to  
php.net and it isn't well documented as I would hope!

~Nick Couloute
co-owner/Web Designer
Sidekick2Music.Com



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Looping from A to Z

2006-02-19 Thread Richard K Miller
Good afternoon.  I'm having trouble getting PHP to loop from A  
through Z.  Here is what I tried, coming from a C background:


for ($l = A; $l = Z; $l++)
 echo $l;

// Returns A, B, C, ..., X, Y, Z, AA, AB, AC, AD, AE, ... YX, YY,  
YZ.  (26 * 26 results!)


Interestingly, if I make it a less than operation instead of less  
than or equal to, it works correctly (except for the Z):


for ($l = A; $l  Z; $l++)
 echo $l;

// Returns A, B, C, ..., W, X, Y  (25 results)

Anyone know why PHP would do that?

Richard

---
Richard K. Miller
www.richardkmiller.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Frameworks?

2006-01-27 Thread Richard K Miller
I haven't used them, but our local user group recently had a meeting  
on PHP frameworks[1].  The feeling of the people that have used them  
was that Symfony was a good project, and that CakePHP was a  
particularly large installation.  No one mentioned having used Prado,  
WACT or WASP.


We also had the creator of PHP on Trax present on the framework he  
created that very closely resembles Ruby on Rails.  His company used  
Trax to build KatrinaHousing.org, a site that helped hurricane  
victims find housing.  I have a copy of his (John Peterson's) slides  
on my website[2].


Richard

[1] http://uphpu.org/article.php?story=2006011715500753
[2] http://richardkmiller.com/blog/archives/2006/01/eventful-month-in- 
technology (third section)


On Jan 27, 2006, at 10:25 AM, Jay Paulson wrote:


Has anyone used any of the following frameworks?  What is the general
opinion of using frameworks etc?

WASP - http://wasp.sourceforge.net/content/
Symfony - http://www.symfony-project.com/
Prado - http://www.xisc.com/
WACT - http://www.phpwact.org/
CakePHP - http://www.cakephp.org/

--
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] wrapping anchor tags around a URL

2006-01-25 Thread Richard K Miller


On Jan 25, 2006, at 10:01 AM, Ahmed Saad wrote:


On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:

On 1/25/06, Ahmed Saad [EMAIL PROTECTED] wrote:

On 1/23/06, Richard K Miller [EMAIL PROTECTED] wrote:


function link_the_links($s) {
return preg_replace('@(http://[^\s]+)@sm', 'a href=$1 
$1/a', $s);

}


try looking ahead in the first regex
http://www.regular-expressions.info/lookaround.html



Wow, I was really glad you found that.  I had never heard of this  
before, but it looks like the solution.


However, my real life example still isn't working, even after adding  
what I think was the right look-ahead expression:


@(http://\S+)(?!\.)@   -- this still captures everything

@(http://\S+?)(?!\.)@-- this captures too little

Any ideas?  In any case, thanks for the article -- that was informative.

Richard

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] wrapping anchor tags around a URL

2006-01-23 Thread Richard K Miller
I wrote a little function to put anchor tags around a URL.  We're  
using it to make URL's in paragraphs of text linkable:


function link_the_links($s) {
return preg_replace('@(http://[^\s]+)@sm', 'a href=$1$1/a', $s);
}

Its only flaw (besides a goofy name) is that if a link comes at the  
end of a sentence, right before the period, the period ends up in the  
link, thus breaking the link.  I've got to somehow ignore the  
trailing period if it is present.


Any ideas?

Richard K Miller

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Frameworks

2005-12-23 Thread Richard K . Miller
I haven't tried them yet, but I've been tagging all the PHP  
frameworks I come across:


http://del.icio.us/rkm28/php+framework

The first one I want to try is PHP on Trax (http:// 
www.phpontrax.com/).  It was used to build the KatrinaHousing.org  
site that was used to provide housing for victims right after the  
hurricane.


Richard


---
Richard K. Miller
www.richardkmiller.com



On Dec 23, 2005, at 12:57 PM, Shawn McKenzie wrote:

Is there a good recent article on PHP Frameworks, or do people here  
has

a predominant one that outshines the others?

I'm looking for something that is easy to use, fast and stable.

Thanks!
-Shawn

--
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] MVC platform choice.

2005-12-01 Thread Richard K. Miller


On Dec 1, 2005, at 3:14 AM, Ahmed Saad wrote:


On 11/30/05, Gregory Machin [EMAIL PROTECTED] wrote:

Hi..
Any body recomend a good MVC platform that is easy to work with,  
and build

on...


http://www.agavi.org
0.10rc is already in the svn



I haven't tried these yet, but these are frameworks I've found:

http://www.phpontrax.com/

http://www.cakephp.org/

http://www.symfony-project.com/

http://www.phocoa.com/

http://www.bennolan.com/biscuit/

If anyone has used any of these, I'd be interested in a report.

Richard

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] readfile and get_file_contents don't work

2005-11-23 Thread Richard K . Miller
I compiled PHP from source on Fedora Core 4, but I must have left  
something out because readfile and get_file_contents aren't working.   
If I try to connect to a http://; address I get the error failed to  
open stream: HTTP request failed.  Any ideas why?


Richard

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Uploading more than one file

2005-11-21 Thread -k.
If you named the fields like this:
 
input type=file name=files[file_name_one] / 
input type=file name=files[file_name_two] / 
input type=file name=files[file_name_three] / 

Then did something like (or whatever):

?PHP
foreach ($_FILES[files][error] as $key = $error) {
echo $key.BR;
echo $_FILES[files][tmp_name][$key].BR;
echo $_FILES[files][name][$key].BR;
}
?

Would that do what you need to get done?




-k.



__ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Strange pg_escape_string behavior

2005-11-07 Thread -k.
While using pg_escape_string to clean data being placed in a query sent to me 
by the user i get
the following error after submitting the query with pg_execute:

pg_exec(): Query failed: ERROR: invalid regular expression: invalid escape \ 
sequence . 

It seems to happen when using just a \ or text ending with a \ but not if a 
\ is in the
middle of a string of text.

Why doesn't pg_escape_string catch this?

To restate it maybe a little more clearly, the error occurs when i do something 
like:
(Pretend $_POST['user_item'] has the value car\ in it )
?PHP
$user_item = pg_escape_string($_POST['user_item']);

$dbconn = pg_connect('some connection string that works');
$query  = SELECT * FROM some_table WHERE some_col = '$user_item' ;
$result = pg_execute($dbconn,$query);

?

I'm running PHP Version 4.3.4, and Apache 1.3.29.



-k.



__ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Trouble moving directory

2005-10-12 Thread -k.
I'm having trouble moving some directories. My script works fine on some 
directories but doesn't
move others. It seems to have trouble with directories with non alphanumeric 
charters. I'm running
Red Hat FC2. I'm trying to move the directory basically like this...

?Php

$source_dir = '/some/dir/Dir That Won't Move/';
$dest_dir   = '/some/other/dir/'

$cmd = escapeshellcmd(mv .$source_dir. .$dest_dir);
$result = shell_exec($cmd);

?

Is there some way to escape the characters in the directories? For example if i 
put a \ in front
of blank spaces it takes care of those (same for ',( etc.) but that 
obviously doesn't take
care of everything. I'm hoping there is something easy i'm overlooking here 
that will escape all
the characters.




-k.




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Trouble moving directory

2005-10-12 Thread -k.
--- Jasper Bryant-Greene [EMAIL PROTECTED] wrote:
 $source_dir = escapeshellarg( '/some/dir/Dir That Won't Move/' );


Unfortunately escapeshellarg doesn't work for all cases, it will escape the  ' 
 in that example
but it doesn't escape other characters such as  ) . So...

$source_dir = escapeshellarg( '/some/dir/Dir That (Won't Move)/' );

...fails as well. Any other ideas?




-k.



__ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] SOAP problem, (related to gethostbyname?)

2005-10-06 Thread -k.
I'm using the PEAR Soap package and having problem accessing another sites's 
webservices. When i
do something like this:

?PHP

$wsdl_url = 'some_wsdl.xml';
$WSDL = new SOAP_WSDL($wsdl_url); 
$client   = $WSDL-getProxy(); 

$web_service_result = $client - 
some_web_service($param1,$param2,$param3,$param4);

?

$web_service_result returns the soap_fault Object. The message portion contains 
the line
curl_exec error 6 Couldn't resolve host 'secure.example.com'  Also if i try 
to grab the WSDL
file from the remote server the script doesn't seem to grab the WSDL ( i get a 
bunch of Passed
variable is not an array or object errors ). I think the problem is curl can't 
resolve the
hostname. 

Also if i run
?PHP
echo gethostbyname('http://bugs.php.net');
?

It echos http://bugs.php.net;, no good.

When i try something like 
?PHP
$url = 'https://secure.example.com/index.html';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,TRUE);
$result = curl_exec($ch);

$cur_error = curl_error($ch);
curl_close($ch);   

echo $result;
echo BR Error: .$cur_error;
?

It doesn't echo out anything, however if run curl 
https://secure.example.com/index.html; from the
command line i get back the page found at that address.

I'm running PHP Version 4.3.4 with CURL support enabled (CURL Information:  
libcurl 7.9.8 (OpenSSL
0.9.7c) (ipv6 enabled) ) on Red Had.

If i ping 'secure.example.com' the address resolves properly.

Any tips on things to try? Should i reinstall curl? SSL? Anything else i should 
investigate?




-k.



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Curl problems

2005-09-22 Thread -k.
Here is my problem. I need to post an XML file to someone else's server. I'm 
trying to do this
with the curl package. 

Once I post the XML file to the other server one of two things will happen. The 
server will either
take the info in the XML file and forward the user along to some other page or 
the page will
return some errors, if for example there is something wrong with the XML i 
send. 

What I would like to do is post the data to the other server and if everything 
is OK just allow
the user to be forwarded along, otherwise I’d like to catch whatever errors the 
server spits back.


Setting this up on two of my development boxes seems to work fine. However when 
I try to send this
to the other server (which i have no control over) it doesn’t work. It's seems 
like it is having
trouble redirecting my request. When I send the request I get a “Server Error 
in '/' Application”
which looks to be like a generic ASP error( I guess). If I comment out the 
FOLLOWLOCATION
curl_setopt line all I get in response, other than headers, is Object moved 
message with a link,
the link however seems like a relative link because if i click on it tries to 
find the linked page
on my server. I'm wondering if something in my request is breaking whatever 
forwarding goes on
internally. 

Stiped to the basics this is my script:
?Php
$url = https://somebody.else.com/this/some_script.aspx;;

$postfields = array();
$postfields['some_xml'] = urlencode($some_xml_ive_generated);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$output = curl_exec($ch);
curl_close($ch);

print $output; 
?

A couple of things:
-I'm pretty new to curl so i could easily be overlooking something.
-The https:// doesn't seem to be the problem
-Generating a form that submits itself with javascript when loaded seems to 
work fine.
-The url in my location bar never seems to change even when i post between my 
two development
boxes and my simple response test script works.
-I have no idea what happens nor any control over the other box. I've e-mailed 
my contact there
with no response.
-The other box is running IIS6 with ASP (or at least that is what headers from 
it claim).
-The https://somebody.else.com/this/some_script.aspx link (the actual one not 
the  one used here
is definitely correct).
-Am i screwing up the headers or something?
-Is what I’m doing even possible?

Any suggestions for things to try? Or simple things I’ve overlooked? I’ve 
googled around and read
a few basic curl tutorials but they haven’t helped me sort this out.

 



-k.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Webservices and PHP?

2005-09-14 Thread -k.
You may also check out SOAP.  

There is a SOAP PEAR package...
http://pear.php.net/package/SOAP

With PHP 5 you can compile in a SOAP extension.
http://www.php.net/SOAP

I know you said you were running PHP 4.3.11 so the SOAP extension may not be an 
option. I think a
little googling with PHP and SOAP should turn up some pretty good results for 
you.



-k.




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with PEAR:SOAP [solved]

2005-09-13 Thread -k.
--- Jasper Bryant-Greene [EMAIL PROTECTED] wrote:
 Install the HTTP_Request package.

That did it. Anyone know why the SOAP package didn't complain about this when i 
installed it?




-k.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problem with PEAR:SOAP

2005-09-12 Thread -k.
I just installed the SOAP Pear package (version 0.9.1) when i try and:
require_once('SOAP/Client.php');

i get the following errors:
Warning: main(HTTP/Request.php): failed to open stream: No such file or 
directory in
/usr/local/lib/php/SOAP/WSDL.php on line 27

Fatal error: main(): Failed opening required 'HTTP/Request.php'
(include_path='.:/usr/local/lib/php') in /usr/local/lib/php/SOAP/WSDL.php on 
line 27

Line 27 in WSDL.php is, as you might guess, 
require_once 'HTTP/Request.php';

I looked in /usr/local/lib/php/ and there is no HTTP directory (much less a 
Request.php). I have
the HTTP PEAR package installed (Version 1.3.6 ). My question is should 
installing the HTTP
package put these files in /usr/local/lib/php ? If not what are these files? 
And where do i get
them? Am i missing a dependency or something? Did i install HTTP incorrectly?



-k.



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Job for SQL or PHP?

2005-08-03 Thread -k.
Just for the sake of example let's say i keep track of all of a customers 
previous orders in a
table like this:

Last_Order
--
Cust_ID
Item_No
No_ordered

When a customer places an order i put the order details in an a table like this:

Orders
---
Order_ID
Cust_ID
Item_No
No_ordered


Let's say when my customer returns he decides he wants everything he ordered 
previously plus some
other stuff. Assuming this customer has unique customer ID of 345 and his 
current new order id is
678. Can i copy his last order into the orders table with just a SQL statement 
like:

INSERT INTO Orders VALUES ('678',(SELECT * FROM Last_Order WHERE Cust_ID = 
'678')) 

What i want to do is grab all the data from Last_Order associated with cust_id 
345 (or whatever)
and insert it into the Orders table with a Order_ID in this case 678. Let me 
know if this isn’t
clear. This SQL obviously doesn't work, however, my question is there a way to 
do this with SQL
alone? Or do i need to grab all the records from the Last_Order table loop 
through the record set
and insert each new row into Orders individually?



-k.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Job for SQL or PHP?

2005-08-03 Thread -k.
--- Kristen G. Thorson [EMAIL PROTECTED] wrote:
 Try
 
 INSERT INTO Orders (SELECT '678',Cust_ID,Item_No,No_ordered FROM 
 Last_Order WHERE Cust_ID = '678')

Thanks that nailed it. You rock.



-k. 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regular expressions book

2005-08-03 Thread -k.
Has anyone here tried to learn  Regular expressions with RegexBuddy?

http://www.regular-expressions.info/regexbuddy.html

It looks pretty cool, and even has some PHP specific stuff, but you have to pay 
to play.




-k.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP error on form

2005-07-28 Thread -k.
--- Bruce Gilbert [EMAIL PROTECTED] wrote:
 Hello,
 
 I am trying to get a form to work integrating html
 with PHP.

I see a couple problems...

This line:
   if ($POST['sender_email'] ==) {

Should probably be:
if ($_POST['sender_email'] ==) {
Note the underscore in $_POST


Same thing here:
   if ($POST['message'] ==) {
Should probably be:
   if ($_POST['message'] ==) {


You are getting errors here:
$msg .=Senders Name:   $_POST['senders_name']\n;
$msg .=Senders E-MAIL: $_POST['senders_email']\n;
$msg .=Senders Name:   $_POST['message']\n\n;
$to =[EMAIL PROTECTED];
$subject = There has been a disturbance in the Force;
$mailheaders .=Reply-To: $_POST['sender_email']\n;

You can't echo out the post vars like that these lines need to look like:
$msg .=Senders Name:   .$_POST['senders_name'].\n;
$msg .=Senders E-MAIL: .$_POST['senders_email'].\n;
$msg .=Senders Name:   .$_POST['message'].\n\n;
$to =[EMAIL PROTECTED];
$subject = There has been a disturbance in the Force;
$mailheaders .=Reply-To: .$_POST['sender_email'].\n;

It sounds like the error on line 58 (whatever that is) is probably something 
similar to the last
problem.





-k.




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] [JOB] PHP/Java Web Developer -- Washington, DC area -- ON SITE

2005-05-25 Thread Alok K. Dhir

LOCAL INDIVIDUAL CANDIDATES ONLY -- WE ARE NOT LOOKING FOR TELEWORKERS OR 
CONSULTING COMPANIES.

Strongly Desired Skills (2.5+ years):

	- Large scale, highly available applications 
	  development on Unix/Linux platform

- PHP
- SQL
- D/HTML/Javascript/CSS
- XML
- OO programming
- Source code control (CVS)
- Good communication skills

Desired Skills:

- Java/JSP
- Perl
- C/C++
- Linux/Unix
- Windows NT/2000/XP

Plusses:

- Experience with Java web application servers:
  Tomcat, JBOSS, Web(logic|sphere), etc
- UML
- Ability to work under pressure
- Leadership ability

If you don't meet the skills, but firmly believe you are an outstanding 
candidate for the job, please don't hesitate to apply, and tell us why we 
should hire you anyway.

Please send a cover letter and resume with salary requirements to [EMAIL 
PROTECTED]

Note, Symplicity does not provide any relocation assistance.

Thank you.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MySql injections (related question)

2005-05-11 Thread -k.
I have a related question, many of you have suggested
using addslashes on your variables to prevent SQL
injections, but is it safer to use
mysql_real_escape_string (or mysql_escape_string)?
What is the benefit / cost of using
mysql_real_escape_string  rather than addslashes? When
using Postgres i always use pg_escape_string on
anything i send the DB's way. In fact the manual says
specifically to use pg_escape_string rather than
addslashes (however it doesn’t give that advice in
mysql_real_escape_string )...

http://us3.php.net/manual/en/function.pg-escape-string.php

Not being familiar with the internals of any of these
functions, i'm wondering which are safer or do they do
approximately the same thing? Is there any difference
in performance? Which method do you use and why?




-k.



__ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Restricting browser's a password manager pop-up

2005-04-28 Thread -k.
 The yes part is that it only appears based on the
 browsers intelligence in scanning the name of your
   form fields. Change username and password to  
  something, well.. more obtuse, and it often
gets rid of  the problem. Give it a shot and see
which combination   works for you.
 
You may also try adding autocomplete=Off in your
password input tag.



-k.



__ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php defense

2005-04-22 Thread -k.
As i recall Yahoo uses PHP. Quick Google turned up:
http://public.yahoo.com/~radwin/talks/yahoo-phpcon2002.htm

Also i remember it was a pretty big deal when
Friendster switched to PHP. And the resulting
improvement in performance was pretty dramatic.
O'Reilly has a good article.
http://www.oreillynet.com/pub/wlg/5155

Google around some, especially on the Friendster
switch, which as I recall caused quite a stir, for
more information.




-k.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: [NOVICE] SSL use

2005-04-22 Thread -k.
  from my php script, do i need to make a special
  connection to the database
  or is the same e.g pg_connect(host= localhost
 dbname=test user=p
  password=p)?
 
 You could add sslmode=require to attempt only an
 SSL connection.

I have couple related questions:

Is this necessary if the database is running on the
same machine (as implied by host= localhost)? If so
why?

Is it possible to make an SSL connection between
Apache and Postgres using Unix-domain sockets?




-k.



__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image and PHP

2005-04-14 Thread -k.
 --- Mario de Frutos Dieguez [EMAIL PROTECTED] wrote:
 I have a page where i place an image but i want when
 i show the image delete it. How can i do this?

Some good suggestions so far but to be a little more
explicit this is how you would do it. Essentially you
want  to have your image tag point to a script, have
that script pass the image to the browser then delete
the image.

Please note, this example code, for simplicity sake,
leaves out any security precautions. 

On you main page you'll have an image tag like:
img src=show_image.php?image_name=some_image.jpg

Then show_image.php will look something like this:
?Php

$filepath  = $_GET['image_name'];

$fd = fopen($filepath,'r');
fpassthru($fd);
fclose($fd);
unlink($filepath);
 
?

Remember though, as written you need to do some
validation on $filepath, because as is, this script
will pass anything to the user that is contained in
$_GET['image_name'] then delete it, so be careful.





-k.



__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] deleting $_SESSION

2005-04-11 Thread -k.
--- AndreaD [EMAIL PROTECTED] wrote:
 I have a session variable called
 
 $_SESSION['total'] the problem is I can't
 delete/reset it. I have tried

Try unset. 

unset($_SESSION['total']);


http://us4.php.net/manual/en/function.unset.php



-k.



__ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more. 
http://info.mail.yahoo.com/mail_250

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] db to xml using php

2005-03-17 Thread K Karthik
sir,

i downloaded the zip from
http://php.chregu.tv/sql2xml/. and then i couldnt know what i am suppose
to do..
when i tried running the file am getting error
Fatal error: main() [function.require]: Failed opening required
'XML/sql2xml.php' (include_path='.:/usr/local/lib/php') in
/home/kkarthik/web/XML_sql2xml-0.3.2/sql2xml_ext.php on line 20
what shd i do..
thanks,
karthik
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] [Fwd: db to xml using php]

2005-03-16 Thread K Karthik

---BeginMessage---
can anyone help me to write from db to xml using php.
if there is any site please do refer me.
thanks,
karthik

---End Message---
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] db to xml using php

2005-03-16 Thread K Karthik
can anyone help me to write from db to xml using php.
if there is any site please do refer me.
thanks,
karthik
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php-help

2005-03-09 Thread K Karthik
sir,
i'll explain my problem.and if anyone could help me i'll be thankful.
i am displaying a content read from a file into a text area of a form.
when i make changes andretrieve back in the text area, i encounter a 
problem..
i.e., when i enter text=please enter
i have an outputas text= / please enter/
thanks,
kkarthik

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php-help

2005-03-08 Thread K Karthik
sir,
iam new to php i'll explain my problem .if u could help i'll be very 
thankful...
in my mysql database i have two tables  i.e., table1  and table2.
 i have an array of result from one query  select feild1 from table1 
i have to use this result in another query.
select field2 from table 2 where field1 = (array of first query iterated)
can u help me doing this in php.
thanks,
karthik


[PHP] php-help

2005-03-08 Thread K Karthik
hello sir,
i am so happy about the immiediate response for any of my question.
i would like to create a static html page.
using cronjob regenerate it every 24 hours.
how can i do it using php.
thanks,
kkarthik
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php-help

2005-03-01 Thread K Karthik
dear friends,
can u help me to find the current directory where my php files are..  
using php.
thanks,
karthik

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] help me

2005-02-23 Thread K Karthik
dear sir,
i'd like to get a date from my database(mysql).and then show a combobox 
of calendar(date-month-year) with the retrieved data selected.
can you help me doing this?? am new to php.
thanks,
karthikeyan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] help me

2005-02-17 Thread K Karthik
can u help me to use $_SERVER['remote_addr'] to find the IP address ?
i am new to php. i also want to find what page of my site he is viewing ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] [php] -help me

2005-02-17 Thread K Karthik
i have got string as /home/karthik/welcome.php/view.php
i just need view.php how shall i remove rest of the string.
please do help me.i am new to php.
-thanks,
karthik
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] help me

2005-02-17 Thread K Karthik
i am so surprised for the immediate reply.thank you so much.
i'll be thank ful again if you could help me finding the current date 
and time using php.
thanks,
karthik

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Parsing whois lookup information

2005-02-09 Thread Harish Rao K

Hello,

For a project I need to parse whois domain lookup data. Have some
one parsed these data in PHP? Please let me know where can I find
them. I have already gone through google and couldn't find
anything useful. There is one .NET library
(http://www.hexillion.com/whois/) available, but it is charged.
:((. So if someone can help me out it would be grateful.

Thank you very much,
Harish Rao K.


Nous Infosystems
This e-mail transmission may contain confidential or legally privileged
information that is intended only for the individual(s) or entity(ies) named
in the e-mail address. If you are not the intended recipient, please reply to
the [EMAIL PROTECTED], so that arrangements can be made for proper
delivery, and then please delete all copies and attachments.Any disclosure,
copying, distribution, or reliance upon the contents of this e-mail, by any
other than the intended recipients, is strictly prohibited.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] help needed on imagettftext()

2005-01-28 Thread Harish Rao K
Hi Marek Kilimajer,

Thank You Marek it worked for me also.

-Harish Rao K
-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 27, 2005 9:19 PM
To: Harish Rao K
Cc: php-general@lists.php.net
Subject: Re: [PHP] help needed on imagettftext()


Harish Rao K wrote:
 Hello,

 While working with some CAPTCHA stuff I get the following
error:
 Fatal error: Call to undefined function imagettftext().
 I have compiled with GD support and all the supporting
libraries
 (Freetype, TTF, jpeg, X11R6 etc).

 What am I missing?

 Below is the configure command that I have used.

 './configure' '--with-gd'
 '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-pgsql'
 '--with-jpeg-dir=/usr/local/jpeg-6b'
 '--with-zlib-dir=/usr/local/zlib-1.2.1'
'--enable-gd-native-ttf'
 '--with-png' '--with-ttf'
 '--with-freetype-dir=/usr/local/freetype-2.1.9'
 '--with-xpm-dir=/usr/X11R6'

 Thanks  Regards,
 Harish Rao K,

make clean
make
make install

this helped me. I guess there are wrong dependencies in the
Makefiles

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Nous Infosystems
This e-mail transmission may contain confidential or legally privileged
information that is intended only for the individual(s) or entity(ies) named
in the e-mail address. If you are not the intended recipient, please reply to
the [EMAIL PROTECTED], so that arrangements can be made for proper
delivery, and then please delete all copies and attachments.Any disclosure,
copying, distribution, or reliance upon the contents of this e-mail, by any
other than the intended recipients, is strictly prohibited.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] help needed on imagettftext()

2005-01-27 Thread Harish Rao K
Hello,

While working with some CAPTCHA stuff I get the following error:
Fatal error: Call to undefined function imagettftext().
I have compiled with GD support and all the supporting libraries
(Freetype, TTF, jpeg, X11R6 etc).

What am I missing?

Below is the configure command that I have used.

'./configure' '--with-gd'
'--with-apxs2=/usr/local/apache2/bin/apxs' '--with-pgsql'
'--with-jpeg-dir=/usr/local/jpeg-6b'
'--with-zlib-dir=/usr/local/zlib-1.2.1' '--enable-gd-native-ttf'
'--with-png' '--with-ttf'
'--with-freetype-dir=/usr/local/freetype-2.1.9'
'--with-xpm-dir=/usr/X11R6'

Thanks  Regards,
Harish Rao K,


Nous Infosystems
This e-mail transmission may contain confidential or legally privileged
information that is intended only for the individual(s) or entity(ies) named
in the e-mail address. If you are not the intended recipient, please reply to
the [EMAIL PROTECTED], so that arrangements can be made for proper
delivery, and then please delete all copies and attachments.Any disclosure,
copying, distribution, or reliance upon the contents of this e-mail, by any
other than the intended recipients, is strictly prohibited.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Generic question : migrating from java based RPC server to PHP

2005-01-12 Thread Ranjan K. Baisak
This might be a very generic question.
I am in a process of migrating my java based RPC
server to PHP. Luckily with the help of the list I
could able to make sure that all rpc and xml related
function are getting excuted in Apache server. I am
using Apache2 in WInXP.
But still not sure from where I should start my
changes.
Any link or tutorial or case study regarding PHP's
SOAP and RPC service would help a lot.

regards,
Ranjan



__ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generic question : migrating from java based RPC server to PHP

2005-01-12 Thread Ranjan K. Baisak

--- Jochem Maas [EMAIL PROTECTED] wrote:
 generic questions suck - noone here is psychic! :-)
Ohh what a answer!!! I don't think anybody is psychic.
 8 pages on PHP+SOAP:
 http://www.devshed.com/c/a/Zend/PHP-SOAP-Extension/
 
Thanks a lot for your updation.

regards,
Ranjan



__ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Error loading extension dlls in WindosXP for PHP4.3.10

2005-01-11 Thread Ranjan K. Baisak

--- Lester Caine [EMAIL PROTECTED] wrote:

 I set the php.ini to look for the extensions where
 you installed PHP
 
I copied all dlls from PHP diectory to
WINDOWS/System32 directory and then it started
running. But still I am not sure how PHP picks up the
dll files. In my php.ini file I have set 
extension_dir = C:\PHP4\extensions\
so from this directory all dlls should be picked up
then why I need to copy again all dll files from php
directiry to system32.
Onething I am assuming that Apache interpreter picks
up dll files from c:\windows\system32 directory and
php interpreter picks from C:\PHP4\extensions
directory. This is just my guess.
Weird ... not sure what exactly happens?

regards,
Ranjan




__ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Error loading extension dlls in WindosXP for PHP4.3.10

2005-01-11 Thread Ranjan K. Baisak

--- Lester Caine [EMAIL PROTECTED] wrote:
 
 Apache does not use the php modules!
 There is no need to copy them to WINDOWS/System32
 Apache is only complaining because PHP will not
 start.
 Where have you actually got php.ini? the default is
 in c:\Windows
Well php.ini file is in c:\windows directory. If I am
not copying all dlls to c:\windows\system32 directory
then duirng Apache service startup, it displays error
messages as I have mentioned in my first mail.
 Apache is only complaining because PHP will not
 start.
So should I assume that even of Apache displays error
messages but actually all dlls are loaded and I can
use them in my php files?

regards,
Ranjan

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Error loading extension dlls in WindosXP for PHP4.3.10

2005-01-11 Thread Ranjan K. Baisak

--- Lester Caine [EMAIL PROTECTED] wrote:

 OK back up a step. So is PHP4 running if you do not
 enable the 
 php_xmlrpc module in php.ini?
Its running and I can see in service. But the specific
functions related to php_xmlrpc module are not
recognized, so I can say that this module is not
loaded.
 I'm on PHP5 now myself, and so that fixed a number
 if niggles which I 
 had with PHP4, so hopefully someone will wake up
 soon and provide the 
 real answer to the problem ;)
I never tried with PHP5. My server was written in java
and now I am trying to move to PHP. And as a newbie to
PHP so I am facing lots of problem .
Now I can keep it as is till it runs fine and as
suggested by you, if anybody can look into it will
help a lot.

regards,
Ranjan



__ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Error loading extension dlls in WindosXP for PHP4.3.10

2005-01-11 Thread Ranjan K. Baisak

--- Richard Lynch [EMAIL PROTECTED] wrote:
 
 Some questions for you:
 
 Does it REALLY have an extra .dll on the end in the
 message?
 Perhaps somebody goofed up somewhere, but rip of the
 '.dll' in your
 php.ini and see what happens...
 
 Did the php_xmlrpc.dll you have COME WITH the EXACT
 SAME php distribution?
 
 If it's from some other version, do *NOT* try to
 mix-n-match it.
 
 Worse than having it not work at all, is having it
 work flawlessly until
 you try to use the function that changed in that DLL
 between 4.x.y and
 4.x.z!
 
 Where the PHP DLLs are located *should* be set in
 php.ini, but one first
 has to be *sure* your php.ini file is being used.
 
 Take a step back and turn off all the extensions and
 change something
 innocuous in php.ini like the syntax highlighting
 colors (remember the old
 settings) and load up a ?php phpinfo();? page.
 
 Did your settings take effect?
 
 If not, where is PHP looking for php.ini? (at the
 top of phpinfo output)
 
 That's where your php.ini file has to go.
 
 *THEN* you can change php.ini and put your PHP
 extensions where they
 belong, which is almost for sure not down in your
 Windows\System32
 directory (shudder).
 
Well Richard, I could able to solve it by copying all
dlls into Windows\System32 directory. But still not
sure why I need to copy all dlls into system32
directory though I have mentioned in php.ini file that
extension_directory=c:\PHP4\extensions.

regards,
Ranjan



__ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Error loading extension dlls in WindosXP for PHP4.3.10

2005-01-10 Thread Ranjan K. Baisak
I am using PHP4.3.10 in WindowsXP. When I am trying to
use extension dlls e.g. php_xmlrpc.dll and when trying
to restart Apache2 Web Server, I am getting error
message as UnKnows():Unable to load dynamic library
'./php_xmlrpc.dll.dll' - The specified module could
not be found. The DLL file php_xmlrpc.dll is already
exists in Windows/System32 directory. Can anybody help
me to how to use extension dlls.

regards,
Ranjan



__ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Error loading extension dlls in WindosXP for PHP4.3.10

2005-01-10 Thread Ranjan K. Baisak
I am using PHP4.3.10 in WindowsXP. When I am trying to
use extension dlls e.g. php_xmlrpc.dll and when trying
to restart Apache2 Web Server, I am getting error
message as UnKnows():Unable to load dynamic library
'./php_xmlrpc.dll.dll' - The specified module could
not be found. The DLL file php_xmlrpc.dll is already
exists in Windows/System32 directory. Can anybody help
me to how to use extension dlls.

regards,
Ranjan



__ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] JOB: Developer, Washington DC Area

2004-07-19 Thread Alok K. Dhir
We have an immediate opening for an experienced web application 
developer who meets or exceeds the following criteria:

Required skills:
   - Experience developing and maintaining web based applications
   - PHP
   - SQL (Oracle, MySQL preferred)
   - D/HTML/Javascript/CSS
   - XML
   - OO programming
   - Source code control (CVS)
   - Ability to work under pressure
   - Strong written and oral communications skills (English)
Desired skills:
   - Java/JSP
   - Perl
   - C/C++
   - Linux/Unix administration
   - Windows NT/2000/XP administration
Plusses:
   - .NET development
   - Experience with Tomcat, BEA Weblogic, and/or IBM Websphere
   - Understanding of software development methodologies
   - Ability to work well individually or part of a team
   - UML
** Current or near future DC area residents only please.  This is not a 
remote position. 

** Symplicity does not currently offer a relocation allowance.
If you meet the requirements above, and are interested in working on 
exciting projects with a strong DC area company, please send a cover 
letter and resume with salary requirements to [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

--
Alok K. Dhir [EMAIL PROTECTED]
Symplicity Corporation
http://solutions.symplicity.com
703 351 6987 (w) | 703 351-6357 (f)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] LDAPv3

2004-06-29 Thread Andrey K. Korolyov
ldap_rename
Don't work :-(((
I have some problem with this function.
Script
$res = spliti(,,$dn);
$res[0] = ou=.$input['ou'];
$newrdn = implode(,,$res);
unset($res[0]);
$parentdn = implode(,,$res);

echo pre;
var_dump($dn);
var_dump($newrdn);
var_dump($parentdn);
echo /pre;

ldap_rename($this-ldap,$dn,$newrdn,$parentdn,false);
Where $dn - current dn
input['ou'] - new value for ou
Output
string(83) 
ou=WinAdmin,ou=otdel,ou=nazvanie,ou=asdf,ou=dsfsdf,ou=builtin,ou=AV,o=fcg,dc=bunker
string(86) 
ou=WinAdmin234,ou=otdel,ou=nazvanie,ou=asdf,ou=dsfsdf,ou=builtin,ou=AV,o=fcg,dc=bunker
string(71) 
ou=otdel,ou=nazvanie,ou=asdf,ou=dsfsdf,ou=builtin,ou=AV,o=fcg,dc=bunker

Invalid DN syntax
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: server side redirects

2004-03-04 Thread Anil Kumar K.

On Thu, 4 Mar 2004, matthew oatham wrote:

 Hi,
 
 I have a page that checks to see if a session exists and if so does a
 server side redirect - i tired using header(Location:
 membersArea.php); but I got an error about headers already sent, guess

HTTP 1.1 needs the redirect string of the form: Location: 
http://hostname/resource

Most of the browsers are tolerant in this case though. But it would be
good idea to stick with standards.

 this is because I have already output html before this php command. So I

Verify your PHP scripts. Make sure that there is no character ( space
character or even empty lines) lying around outside PHP open/close tags.

Avoid putting new lines, spaces, etc.. outside  PHP open/close tags
especially while writing library files which are meant for include-ing.

best
   Anil

--
Linuxense Information Systems Pvt. Ltd., Trivandrum, India
http://www.linuxense.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Sending arguments to a SP in PHP

2004-03-04 Thread Harpreet K. Singh
I am using PHP and sql server 2000.

I have a stored procedure which takes 3 arguments. The first argument is a
string and the rest 2 are integers.

For some reasons the call to the stored procedure is being trimmed.

My call is as follows
$oldquery=select var1,var2,var3,var4. from table order by var1;

$query=exec limitselect '. $oldquery .',. $limit .,. $offset;

i try to print the sql command
echo br.$query;

It prints out a trimmed string

exec limitselect 'select origin

is theri a limit to what one can send to a sp call

Please help i am totally confused.

Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Cybercash Dynamic Module

2004-02-24 Thread Anil Kumar K.

On Tue, 24 Feb 2004, Suhas wrote:

/snipped

 
 If I get the permission to complie PHP with give module, can I just go 
 with ./configure --with cybercah=DIR ?
 I think it will kill my original install. Is there any way to append the 
 configuration as needed? I am sure many of you may have similar situation.


Answer to the dump question (because none seems to give an answer :) ).  
Run phpinfo() and you will get the original configuration command in its
output. 

   Anil

-- 
Linuxense Information Systems Pvt. Ltd., Trivandrum, India
http://www.linuxense.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] UK Postcodes Format

2004-02-17 Thread Angela K Hilton
I 'Think' there are also different formats for military bases here and
overseas.

[this is a faint memory from validating post codes in a database some
years ago]

A

***
Angela K Hilton
Web  E-Learning Officer
ISD, UMIST
Tel: 0161 306 3109
***


-Original Message-
From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED] 
Sent: 17 February 2004 12:15
To: 'Roddie Grant'; Shaun; [EMAIL PROTECTED]
Subject: RE: [PHP] UK Postcodes Format

On 17 February 2004 10:43, Roddie Grant wrote:

 on 17/2/04 10:25 am, Shaun at [EMAIL PROTECTED] wrote:
 
  Hi,
  
  does anyone know the format of the postcodes in the UK so I can
  keep my database accurate? 
  
  Thanks
 
 
 Try http://javascript.internet.com/forms/uk-postcode-validation.html

Wow, at a glance I'd say that looks like pretty crappy JavaScript, and
also not a totally accurate UK postcode checker.

The only guaranteed way to fully validate a UK postcode is to purchase
the Royal Mail's Postcode Address File (PAF) (and subscribe to its
updates!), but you can validate the format fairly closely with some
simple rules.

For example, here's a regexp that matches valid UK postcode patterns:

   /[A-Z]{1,2}[0-9][0-9A-Z]? [0-9][ABD-HJLNP-UW-Z]{1,2}/

or, in English:

* an outward code consisting of:
  - 1 or 2 alphabetic characters
  - followed by 1 or 2 digits, or 1 digit and 1 letter

* a space

* in inward code consisting of:
  - 1 digit
  - followed by 2 letters, but not including C, I, K, M, O or V.

(The special code GIR 0AA also exists for the headquarters of the
formerly-Government-owned Girobank, now part of the Alliance 
Leicester, and is the only one that doesn't match these rules).

Although this will check for potentially valid formats, there are a
number of other checks you can make if you wish:

- the initial 1 or 2 letters come from a restricted set of about 120,
indicating the main sorting office which handles mail for an area --
generally they correspond to a large town or city (B - Birmingham, L -
Liverpool, LS - Leeds, etc.) but London ones are taken from the much
older London postal district names (E - East, EC - East Central, etc.)
and a few represent more general area names (ZE - Shetland Islands, for
example.  (I could probably produce a list of these fairly easily.)

- The range of values in the rest of the outward code is likewise
restricted; the range is different for each area, with many restricted
to 20 or less, and none uses the full set of 1-99; however, higher
values are often used for special purposes (98 and 99 for PO Boxes, for
example), and most of the larger areas have multiple disjoint ranges.

- The only postcodes which have a final letter in the outward portion
of the code are some of the London districts (off the top of my head,
EC, SW, W and WC only, I think, and maybe not all of those!).

- For each outward code, there may also be restrictions on the range
of inward codes, and these will again be different for each area (for
example, for my home outward code all inward codes begin with a 2; in
the neighbouring outward code, all inward codes begin with a 3).  These
are so numerous and diverse that they're not really worth bothering
about unless you're going the full-blown PAF route.

Anyway, this is probably already far more information than you were
expecting, so I'll shut up now!

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mt_strand

2004-02-13 Thread Angela K Hilton
Hi All
 
I could do with some pointers in using mt_strand.
 
I understand that because my server has PHP4.2.0 random number
generators need to be seeded using mt_strand or mt_rand.
 
I have the following code [created with the help of this list]:
 
?php
  $imgdir = /images/randomimages/;
  if ($handle = opendir($imgdir))
  {
while (false !==($file = readdir($handle)))
  {
if ($file != .  $file != ..)
{
  $random[] = $file;
}
  }
  closedir($handle);
  } 
  $image = $random[mt_rand(0, count($random)-1)];
?
?php include(/images/randomimages/$image); ?
 
 and have found the following in the PHP manual:
 
?php
// seed with microseconds
function make_seed() 
{
   list($usec, $sec) = explode(' ', microtime());
   return (float) $sec + ((float) $usec * 10);
}
mt_srand(make_seed());
$randval = mt_rand();
?
 
However - I'm not 100% sure how to incorporate it into my code - I have
tried a few things but each time I break the code.
 
Any help will be appreciated.
 
Thanks
Ange
***
Angela K Hilton
Web  E-Learning Officer
ISD, UMIST
Tel: 0161 306 3109
***
 


RE: [PHP] mt_strand

2004-02-13 Thread Angela K Hilton
Hamid

?php include(/images/randomimages/$image); ?

works fine - all the code works OK - apart from the seed issue.

A

***
Angela K Hilton
Web  E-Learning Officer
ISD, UMIST
Tel: 0161 306 3109
***


-Original Message-
From: Hamid Hossain [mailto:[EMAIL PROTECTED] 
Sent: 13 February 2004 10:45
To: [EMAIL PROTECTED]
Subject: RE: [PHP] mt_strand

Hi Angela,

I don't understand why you are using the following line:
?php include(/images/randomimages/$image); ?

You have to use somthing like:
img src=/images/randomimages/?= $image ?

The other part of your code looks fine to me.

Regards,
Hamid

---
Check Amazon.com's Latest PHP books:
http://www.amazon.com/exec/obidos/redirect?tag=zawraqclassif-20path=tg/
browse/-/295223

Start Accepting CreditCard at your site in minutes:
http://www.2checkout.com/cgi-bin/aff.2c?affid=106720

Download Alexa Tool Bar to stop Pop-ups for FREE:
http://download.alexa.com/?amzn_id=zawraqclassif-20

Download Ready-Made Templates for your site:
http://www.aplustemplates.com/cgi/affiliates/c1.cgi/zawraq_ad
---

Original Message Follows
From: Angela K Hilton [EMAIL PROTECTED]
To: PHP-General [EMAIL PROTECTED]
Subject: [PHP] mt_strand
Date: Fri, 13 Feb 2004 10:37:47 -

Hi All

I could do with some pointers in using mt_strand.

I understand that because my server has PHP4.2.0 random number
generators need to be seeded using mt_strand or mt_rand.

I have the following code [created with the help of this list]:

?php
   $imgdir = /images/randomimages/;
   if ($handle = opendir($imgdir))
   {
 while (false !==($file = readdir($handle)))
   {
 if ($file != .  $file != ..)
 {
   $random[] = $file;
 }
   }
   closedir($handle);
   }
   $image = $random[mt_rand(0, count($random)-1)];
?
?php include(/images/randomimages/$image); ?

  and have found the following in the PHP manual:

?php
// seed with microseconds
function make_seed()
{
list($usec, $sec) = explode(' ', microtime());
return (float) $sec + ((float) $usec * 10);
}
mt_srand(make_seed());
$randval = mt_rand();
?

However - I'm not 100% sure how to incorporate it into my code - I have
tried a few things but each time I break the code.

Any help will be appreciated.

Thanks
Ange
***
Angela K Hilton
Web  E-Learning Officer
ISD, UMIST
Tel: 0161 306 3109
***

_
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: weird header() (bug may be)

2004-02-12 Thread Anil Kumar K.

This is not a bug. Here you expect that the script should end executing
after the statement:header('Location:to_another_page.php') if the if
statement is true. But it won't and it proceeds to the next statement;
the next header statement:header('Location:to_previous_page.php');

An exit statement after the first header will solve the problem. With
most browsers, if multiple redirect headers are received, the last
instruction is followed. I'm not sure what the RFC says about this.

   Anil

On Thu, 12 Feb 2004, adwinwijaya wrote:

 Hello php-generaler's ,
 
   I have a script like this :
 
   if($foo == 'something'){
   header('Location:to_another_page.php') ;
   }else
   {
do another thing in here
   }
 
   header('Location:to_previous_page.php');
 
 
   I got a problem ... when $foo == 'something' .. it wont redirect me
   to to_another_page.php  but if I put die(); after calling
   header(); .. it will work ...
 
   is this the bug ?
 
   I use php 4.3.4 ... and Apache 2.x
 
   thanks
   
 
 

--

Linuxense Information Systems Pvt. Ltd., Trivandrum, India
http://www.linuxense.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Create a new directory on server.

2004-01-31 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote:

is there in PHP a function that create a new directory on server

This is a serious case of needing to RTFM. www.php.net/mkdir

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] random html +(hi)

2004-01-16 Thread Angela K Hilton
Hi All

I'm new to this list and I suppose fairly new to PHP - and hope that
this question is in keeping with the type of thing that's usually asked.

I'm trying to dynamically randomise a chunk of HTML that is used on a
page, aka  random image, so that each time a client opens the page [or
refreshes] a part of the page changes.  

The chunks of HTML are saved in their own directory as .htm files.  I
was hoping to adapt the following code I have managed to cobble together
to display random images:

?php
// images in folder
$total = 5;

// file type
$file_type = .htm, .gif, .jpg;

// dir location
$image_folder = dir/dir;

$start = 1;

$random = mt_rand($start, $total);

$image_name = $random . $file_type;

// print file name
// echo $image_name;

// display image
// echo img src=\$image_folder/$image_name\ alt=\$image_name\ /;

?

I'd like the code to take the HTML and place it in a div/div,
probably using a ?php require (); ? (I think I'm OK with this once
the code is sorted).  

However - I don't seem to be able to progress any further with this -
I'm sure I'm missing something very basic - but I just can't get past
this point.

I'd be grateful for any pointers with this.

TIA
ange

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] detecting flash in php

2004-01-08 Thread Leif K-Brooks
Louie Miranda wrote:

is there anyway of detecting flash? in php

Detecting whether the user has Flash enabled, you mean? No. PHP is 
server-side.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] A simple instruction

2004-01-01 Thread Leif K-Brooks
Dino Costantini wrote:

i have a file name with the path ex food/italy/pizza/margherita.php. how can i obtain the name of the file in this case margherita.php i know there is a function, but i don't remember it.

$_SERVER['PHP_SELF']

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP forms that are valid XHTML

2003-12-30 Thread Leif K-Brooks
Tim Burgan wrote:

In their forms they use the name attribute (ie. name=example) instead of
XHTML's id attribute (ie. id=example).
How can I fix this?

(X)HTML still requires name to be used for forms. It's usually best to 
use both name and ID for forms.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] DGS Search Script Modifications

2003-12-15 Thread K. Praveen Kumar
Dear All,
I recently downloaded the DGS search, which has the great features. Now
I would like to modify the script a bit.
Requirement:
I wanted to search different tables for the entered keywords. If find
the file name and id will be different for each so, I wanted to get the
id of that particular row and the type and show that as a link.

Example:
I have two tables. 1) Countries 2) Credits.
Countries table have the following fields: overview, description
Credits table have the following fields: overview, description

IF the given word matches the word in Countris.overview and
Credits.description then it should display
http://localhost/overview.php?CountryId=1 and
http://localhost/description.php?CountryId=10CreditId=3 Please suggest
me where I can modify the script to get the script working for me.


-- 
Thanks in Advance
Praveen Kumar
SoftPro Systems Ltd

---SOFTPRO DISCLAIMER--

Information contained in this E-MAIL and any attachments are
confidential being  proprietary to SOFTPRO SYSTEMS  is 'privileged'
and 'confidential'.

If you are not an intended or authorised recipient of this E-MAIL or
have received it in error, You are notified that any use, copying or
dissemination  of the information contained in this E-MAIL in any
manner whatsoever is strictly prohibited. Please delete it immediately
and notify the sender by E-MAIL.

In such a case reading, reproducing, printing or further dissemination
of this E-MAIL is strictly prohibited and may be unlawful.

SOFTPRO SYSYTEMS does not REPRESENT or WARRANT that an attachment
hereto is free from computer viruses or other defects. 

The opinions expressed in this E-MAIL and any ATTACHEMENTS may be
those of the author and are not necessarily those of SOFTPRO SYSTEMS.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] DGS Search Modifications

2003-12-15 Thread K. Praveen Kumar
Dear All,
I recently downloaded the DGS search, which has the great
features. Now
I would like to modify the script a bit.
Requirement:
I wanted to search different tables for the entered keywords. If
find
the file name and id will be different for each so, I wanted to get the
id of that particular row and the type and show that as a link.

Example:
I have two tables. 1) Countries 2) Credits.
Countries table have the following fields: overview, description
Credits table have the following fields: overview, description

IF the given word matches the word in Countris.overview and
Credits.description then it should display
http://localhost/overview.php?CountryId=1 and
http://localhost/description.php?CountryId=10CreditId=3 Please suggest
me where I can modify the script to get the script working for me.
-- 
Thanks  Regards
Praveen Kumar
SoftPro Systems Ltd

---SOFTPRO DISCLAIMER--

Information contained in this E-MAIL and any attachments are
confidential being  proprietary to SOFTPRO SYSTEMS  is 'privileged'
and 'confidential'.

If you are not an intended or authorised recipient of this E-MAIL or
have received it in error, You are notified that any use, copying or
dissemination  of the information contained in this E-MAIL in any
manner whatsoever is strictly prohibited. Please delete it immediately
and notify the sender by E-MAIL.

In such a case reading, reproducing, printing or further dissemination
of this E-MAIL is strictly prohibited and may be unlawful.

SOFTPRO SYSYTEMS does not REPRESENT or WARRANT that an attachment
hereto is free from computer viruses or other defects. 

The opinions expressed in this E-MAIL and any ATTACHEMENTS may be
those of the author and are not necessarily those of SOFTPRO SYSTEMS.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: spambothoney: script to pollute spammer's databases

2003-12-09 Thread Leif K-Brooks
Manuel Lemos wrote:

The latest spamming strategies consist on using valid sender addresses 
of inocent companies. Therefore, when you make up invalid addresses, 
all the bounces will go to the innocent companies mail servers. The 
more invalid addresses you make up the more harm you cause to innocent 
companies.
My strategy against spam is giving invalid addresses at my domain name, 
all of which redirect to [EMAIL PROTECTED] No innocent servers besides my 
own are harmed, and the spam is given to an authority who will (in 
theory) do something about it.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] removing line breaks

2003-12-05 Thread Leif K-Brooks
Roel Derckx wrote:

I want to remove line breaks from the front of a string, but i can't get it
to work. Who can help me?
Note that i only want to remove line breaks in the start of the string, all line 
breaks in
the rest of the string should remain.
ltrim()

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  1   2   3   4   5   6   7   8   9   >