Re: [PHP] How? First big letter

2004-06-25 Thread Miguel J. Jimnez
Use ucfirst()
Labunski wrote:
Hello, how to make the firs letter of the word Big?
for example I have:
$colour = car is red;
but I need:
$colour = Car is big.
Thank you very much,
I would look for the answer myself using google,
but I have no time for it.
I hope there is an easy solution for this.
Lab.
 

--
Miguel J. Jiménez
ISOTROL, S.A. (Área de Internet)
Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
mjjimenez AT isotrol DOT com   ---   http://www.isotrol.com
ICQ# 12670750
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] how could I call mail command in PHP file

2004-06-15 Thread Miguel J. Jimnez
Have you try mail() function?
Min Wang wrote:
Hello, all!
So glad to join this maillist. I'm a beginner of PHP. I'd like to call a mail command in a 
mail.php like the following:
?php
echo `mail -s test [EMAIL PROTECTED] my.txt`;
?
There was no error, but it didn't send the mail as I wished.
Other command lines like:
?php
echo `ls *`;
?
worked.
my.txt lies in the same directory as mail.php, and this command line works in the 
normal command line. But as a PHP file it doesn't work. What's wrong with this file? Could you give me 
some advices?
Thanks a lot!
Best!
Min
 

--
Miguel J. Jimnez
ISOTROL, S.A. (rea de Internet)
Avda. Innovacin n1, 3 - 41020 Sevilla (ESPAA)
mjjimenez AT isotrol DOT com   ---   http://www.isotrol.com
ICQ# 12670750
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Session name length

2004-05-25 Thread Miguel J. Jimnez
How much long can be the session name? What is the limit? 10, 40, 255 
alphanumeric chars? or what?
Thanks...

--
Miguel J. Jiménez
ISOTROL, S.A. (Área de Internet)
Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
mjjimenez AT isotrol DOT com   ---   http://www.isotrol.com
ICQ# 12670750
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] strip down Warnings

2004-03-10 Thread Miguel J. Jimnez
Use '@' before any function to avoid echoing warnings (JUST warnings)

--
Miguel J. Jiménez
ISOTROL, S.A. (Área de Internet)
Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
[EMAIL PROTECTED]
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] what does this mean?

2004-03-10 Thread Miguel J. Jimnez
That's a boolean casting; used for forcing a variable to become 
boolean... Hope it helps...

Harry Wiens wrote:

$this-styles['shadow'] = (boolean)$bool;
   
what does (boolean)$bool mean?

mfg.
harry wiens
 

--
Miguel J. Jiménez
ISOTROL, S.A. (Área de Internet)
Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
[EMAIL PROTECTED]
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Mail Headers

2004-03-08 Thread Miguel J. Jimnez
You can view the source from an email message with Outlook or Thunderbird, and it will show headers and all that stuff...

---
Miguel J. Jiménez
ISOTROL, S.A. (Área de Internet)
Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
[EMAIL PROTECTED]
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] MCRYPT Help

2004-03-02 Thread Miguel J. Jimnez
Hi, I have the following script that encode data using 3DES, but I 
cannot make a script to DECODE that data because all the tries return me 
thwe wrong string, can anybody tell me the right script to decode the data?

Copied from PHP Manual:

?php
   $key = this is a secret key;
   $input = Let us meet at 9 o'clock at the secret place.;
   $td = mcrypt_module_open('tripledes', '', 'ecb', '');
   $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
   mcrypt_generic_init($td, $key, $iv);
   $encrypted_data = mcrypt_generic($td, $input);
   mcrypt_generic_deinit($td);
   mcrypt_module_close($td);
   echo KEY = .$key.br;
   echo INPUT = .$input.br;
   echo ENCRYPTED = .$encrypted_data;
?
--
Miguel J. Jiménez
ISOTROL, S.A. (Área de Internet)
Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
[EMAIL PROTECTED]
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Messenger via PHP

2004-02-17 Thread Miguel J. Jimnez
Hi, I want to know if there's a way to send MSN messenger messages thru 
PHP... If there is How can I do it? Thanks...



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

[PHP] Help with a string replacement

2004-01-28 Thread Miguel J. Jimnez
Hi, I want to replace a string a:[whatever] with a 
href=[something][whatever].
[whatever] may be what ever substring possible... ie. I want to replace 
all occurences that exists being [whatever] a variable expression...
Thanks...


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

Re: [PHP] How to echo something if not exist?

2004-01-27 Thread Miguel J. Jimnez
Radwan Aladdin wrote:

Hi all..

I want to echo something if the GET value was not exist in the database..
So for example : The user enters his email address and if this email was not found in the field 
of the email addresses in the table.. then echo Invalid Email Address
So how to do it?

Regards..

You must use a select statement to know if it exists or not... kind of:
 
$rs = mysql_query(select email from table_name where email='$email');
if (mysql_num_rows($rs) == 0)
   // Does not exist
else
   // Does exist



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

Re: [PHP] Is this code right?

2004-01-19 Thread Miguel J. Jimnez
Radwan Aladdin wrote:

Hi all.. I made this code for the login.php page.. it will compare A value from the users machine (Serial) and with a value inside the database (In that users' row).. so after logging it will check if also this value is the same and then echo something..is the following code is right for that? :

?php 

$link = mysql_connect(localhost, Database username, Database password) or die(Could  
not connect:  . mysql_error()); 
mysql_select_db(Table name, $link); 

$UserName = $_GET['UserName']; 
$Password = $_GET['Password']; 
$Serial = $_GET['Serial']; 

$query = SELECT Serial, Password from accounts where UserName='$UserName'; 
$result = mysql_query($query) or die(Query errort:  . mysql_error()); 
$row = mysql_fetch_row($result) or die(User Not found:  . mysql_error()); 
$Serial = htmlspecialchars($row[0]); 
 

mysql_select_db is for selecting the database and NOT the table, the 
SELECT statement must be something like this: select SOMETHING from 
TABLE where WHERE_CLAUSE



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

Re: [PHP] date fiedl

2004-01-19 Thread Miguel J. Jimnez
Diana Castillo wrote:

Does anyone know if there is any speed advantage to saving a date as a unix
timestamp or a numeric field instead of a date field? (in Mysql)
thanks,
Well, I prefer using  an int(14) field for saving unix dates (so, I save 
the date as unix and not as date field). Thus is easier to work between 
dates adding and everything else...



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

Re: [PHP] Re: how to open a webpage

2004-01-12 Thread Miguel J. Jimnez
bernard wrote:

Hi,

Thanks for the suggestions !

Problem is solved sofar.

But how can I open the link in a new window, I tried (with my limited php
knowlegde) a lot of things, but i'ts not working :-(
 

To open the URL in a new window, you MUST use javascript.. You can 
output a HTMP page like this:
   script language=jaavscript
  window.open('otherPage.html');
   /script



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

Re: [PHP] $_SERVER['PHP_AUTH_USER'] doesn't work with location header for Mozilla.

2004-01-09 Thread Miguel J. Jimnez
I think it's because all headers must be sent BEFORE doing anything else ...



Scott Fletcher wrote:

Hi!

  The login page where the HTTP Authentication would pop-up asking the web
user to enter the user id and password to log in.  I'm using the PHP's
$_SERVER['PHP_AUTH_USER'] and it work okay in both Internet Explorer and
Gecko browsers, like Mozilla for example.  What I had discovered is that
when using the PHP's header, 'header(Location: https://whatever;); to go to
the next webpage (with HTTP Authentication is successful), is that HTTP
Authentication cease to exist on the next webpage for the Gecko browsers.
It work fine with Internet Explorer.
   Anyone know why does the Gecko browser lose the HTTP Authentication data
once the PHP location redirect header is used?  I'll post the code below.
--snip--
 if (!isset($_SERVER['PHP_AUTH_USER'])) {
// If empty, send header causing dialog box to appear
header('WWW-Authenticate: Basic realm=My Private Stuff');
header('HTTP/1.0 401 Unauthorized');
   } else if (isset($_SERVER['PHP_AUTH_USER'])) {
// If non-empty, open file containing valid user info
$filename = /usr/local/apache/conf/whatever;
$fp = fopen($filename, r);
$file_contents = fread($fp, filesize($filename));
fclose($fp);
// Place each line in user info file into an array
$line = explode(\n, $file_contents);
// For as long as $i is = the size of the $line array,
// explode each array element into a username and password pair
$i = 0;
while($i = sizeof($line)) {
 $data_pair = explode(:, $line[$i]);
 if (($data_pair[0] == $_SERVER['PHP_AUTH_USER'])  ($data_pair[1] ==
MD5($_SERVER['PHP_AUTH_PW']))) {
  $auth = 1;
  break;
 } else {
  $auth = 0;
 }
 $i++;
}
if ($auth == 1) {
   session_id($salt);
   session_start();
   $_SESSION['SESSION_IDENTIFIER'] = $salt;

//echo $_SERVER['PHP_AUTH_USER']. ;
   header(Location:
https://.$_SERVER['HTTP_HOST']./administration/main_menu.php?PHPSESSID=.$salt);
} else {
 header('WWW-Authenticate: Basic realm=My Private Stuff');
 header('HTTP/1.0 401 Unauthorized');
}
   }
 



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