[PHP] RE: [PHP-WIN] Sending arguments to a SP in PHP

2004-03-05 Thread Svensson, B.A.T. (HKG)
All morons who answer on this, make sure you send your bloody reply
to either the guy who asked the question in the first place or to
the PHP list - and NOT to me


//Anders - sick tired of all private help.


On Fri, 2004-03-05 at 09:48, Svensson, B.A.T. (HKG) wrote:
 Very is your problem located?
 
 Is the string not properly built by php?
 or is an error genereated when you try to execute the query?
 
 
 -Original Message-
 From: Harpreet K. Singh
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: 2004-03-04 21:55
 Subject: [PHP-WIN] Sending arguments to a SP in PHP
 
 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 Windows 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] RE: [PHP-WIN] Sending arguments to a SP in PHP

2004-03-05 Thread Svensson, B.A.T. (HKG)
Very is your problem located?

Is the string not properly built by php?
or is an error genereated when you try to execute the query?


-Original Message-
From: Harpreet K. Singh
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 2004-03-04 21:55
Subject: [PHP-WIN] Sending arguments to a SP in PHP

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 Windows 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] RE: [PHP-WIN] Re: [PHP] Replace of ' in a query

2004-02-17 Thread Svensson, B.A.T. (HKG)
Never trust the web...

Esacping is bad practis. Doing it, is to ask for trouble when you
try to port the code to another system that a) escapes in another
way, or b) does not escape at all, the transparent way to handle
quote are to quote them. This has been working for the last 40 to
50 years or so, and still works fine. Why not stay with a winner?

-Original Message-
From: Brent Baisley
To: carlos castillo
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 2004-02-17 21:02
Subject: [PHP-WIN] Re: [PHP] Replace of ' in a query

Look at the addslashes command. You should always escape the values you 
are accepting from user input. If you read almost any article on web 
site security, it will mention something called SQL injection among 
other things. This is a way to compromise your data.
For instance, what if a user entered:
1 OR A=A

Now what if you used that user input to filter a query. You may end up 
with:
SELECT * FROM db WHERE field=1 OR A=A

Which would return every record in the database.

On Feb 17, 2004, at 2:44 PM, carlos castillo wrote:

 Hi , i have the following problem, i have a form where a user can
input
 any text, on that text may be a char is ' char(39) when i try to 
 execute
 the sql query, i have an error for that ', i need to replace it for
the
 html tag, for example  is quot; or by chr(39) i dont know, and then
 execute the sql query.

 i really appreciate your help, thanks.

-- 
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

-- 
PHP Windows 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] RE: [PHP-WIN] Still can't pass variable through url

2003-08-08 Thread Svensson, B.A.T. (HKG)
[...]
 when i click my hyperlink page.php?year=$year?month=$month, it
[...]
 if the same case apply to php4.04, then there is
 no problem at all!

It's rather a mysterium why it worked at all. How did you
manage to get this working on php4.04? (It should not work!) 

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



[PHP] RE: [PHP-WIN] Password generator

2003-06-18 Thread Svensson, B.A.T. (HKG)

Create a string which is six char long,
(for instance shop the head and tail
of the first string if you are not able
to generate a six char string)

If you chop an 8 char string and MUST have
the special chars in the string then check
that the chopped char's is not a memember of
the special char's- If they are, regenerate a
new string an loop until they are not

Finally randomize the head and the tail with
you custom algorithm. E.g. an algoritm that
does not contain your 


Med vanliga halsningar fran Amsterdam. =) ;)


-Original Message-
From: Davy Obdam
To: PHP; PHP-WIN; PHP-DB
Sent: 2003-06-17 11:45
Subject: [PHP-WIN] Password generator

Hi people,

I have to make a password generator, but i have a little problem.

- It needs to generate password 8 characters long, and including 1 or 2 
special characters(like #$%*@).
- Those special characters can never appear as the first or last 
character in the string... anywhere between is fine.

I have a password generator script now that does the first thing... but 
the special character can be in front or back of the string wich it 
shouldnt.. i have been looking on the web for this but i havent found 
the answer. Below is my scripts so far.. 

Any help is appreciated, thanks for your time,

Best regards,

Davy Obdam




?php
// A function to generate random alphanumeric passwords in PHP
// It expects to be passed a desired password length, but it
// none is passed the default is set to 8 (you can change this)
function generate_password($length = 8) {

// This variable contains the list of allowable characters
// for the password.  Note that the number 0 and the letter
// 'O' have been removed to avoid confusion between the two.
// The same is true of 'I' and 1
$allowable_characters =
abcdefghefghijklmnopqrstuvwxyz0123456789%#*;
   
// We see how many characters are in the allowable list
$ps_len = strlen($allowable_characters);

// Seed the random number generator with the microtime stamp
// (current UNIX timestamp, but in microseconds)
mt_srand((double)microtime()*100);

// Declare the password as a blank string.
$pass = ;

// Loop the number of times specified by $length
for($i = 0; $i  $length; $i++) {
   
// Each iteration, pick a random character from the
// allowable string and append it to the password.
$pass .= $allowable_characters[mt_rand(0,$ps_len-1)];
   
}

// Retun the password we've selected
return $pass;
}

$password = generate_password();
echo $password;

?

-- 
---
Davy Obdam 
Web application developer

Networking4all
email: [EMAIL PROTECTED]
email: [EMAIL PROTECTED]
internet: http://www.networking4all.com
---




-- 
PHP Windows 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] RE: [PHP-WIN] CRON JOB

2002-07-17 Thread Svensson, B.A.T. (HKG)

% man crontab 

-Original Message-
From: MAAS
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 2002-07-17 14:51
Subject: [PHP-WIN] CRON JOB


What do I have to do before I can run my file.php as a cron job in
Linux?




-- 
PHP Windows 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] RE: [PHP-WIN] Site running from MySQL

2001-12-25 Thread Svensson, B.A.T. (HKG)

From: LaserJetter

Out of interest, would it be possible to load a webpage as a record in a
MySQL database, having another field as say a number or a unique name so
that a whole site could be placed in a database with a couple of php files?
Is there a limit on the size of a field in MySQL which would stop you doing
this though and would it be noticeably slower that html / php files?
I was only wondering as it would make full text searches an awful lot
simpler

Of course it is possible. (Why would it not be?)

I've don it my self (stored ptrocedures that builds HTML pages),
and especially the full text search you were talking about.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: [PHP-WIN] Passing Logined in Name form One Form to other Page

2001-12-19 Thread Svensson, B.A.T. (HKG)

From: Jack

Dear all
I had create the Login Page for the User to login before they 
can open the WebPage. What i want to do is to:

When the User had type the Username into the Inputbox, and click the submit
button, this Username will be memorized, and pass to other PHP Page.Then
when he go to some page which need to select data from MYSQL, it will read
the Username which passed from the Login Form and select the only Record to
him!

I heard about the Session, but how i can pass the Username to 
other page using Session??

To beging with, why not give the manual a try?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]