[PHP] number function

2003-03-20 Thread pei_world
anyone how to write a good number valid function?
regonise numbers like: real int





--
Sincerely your;

pei_world ( .::IT::. )








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



[PHP] Re: number function

2003-03-20 Thread pei_world
hi
thx for the last question
I have following function, I use it the check all the elements in the array
whether numeric or not. but I get the output : ++l++* and ++0++, the first
char in the string
===
 function check_int_float($array){
  $result=true;

   for($i=0; $isizeof($array); $i++){
 echo ++.$array[strlen($array)].++;
if($array[$i]!=){
  if(isdigit($array[$i])  $array[$i]!=.){
  $result=true;
 }else{
  $result=false;
   break;
  }//if
}//if
}//foreach
 return $result;
 }



--
Sincerely your;

pei_world ( .::IT::. )



Pei_world [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 anyone how to write a good number valid function?
 regonise numbers like: real int





 --
 Sincerely your;

 pei_world ( .::IT::. )










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



[PHP] function for $array

2003-03-20 Thread pei_world
I want to use the following function the test the array elements,
if all element is number return true, otherwise false;
but the command marked, it print out only the first char of every strings in
the array;
can help?

ie: ++0++ for 0.234

 function check_int_float($array){
  $result=true;

   for($i=0; $isizeof($array); $i++){
 echo ++.$array[$i].++;==
if($array[$i]!=){
  if(is_numeric($array[$i])){
  $result=true;
 }else{
  $result=false;
   break;
  }//if
}//if
}//foreach
 return $result;
 }

--
Sincerely your;

pei_world ( .::IT::. )






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



[PHP] simple arithmetic problem

2003-03-16 Thread pei_world
 I have a problem in time substraction.
the number print out correct, but don't know
why i cann't do the substraction between them
===
echo (time()).br;
echo (fgets($fp)). = br;
$new=time();
$old=fgets($fp);
echo .($new - $old).br;

ouput ==

1047832384
1047832349 =
1047832384


--
Sincerely your;

pei_world ( .::IT::. )






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



[PHP] Loading var from txt or php file

2003-02-28 Thread pei_world


I have a flash written to receive var from php file.
but I found one problem,
my problem is just can load the var from the file.
I have following AS code from a button. when I click this button twice, it
load up the var
but How can I load it befor the moive is going to play?
there is no point to ask user click one button before select the combo box
right?
again, thanks for help.

//
on (release) {
play();
loadVariables(test.txt, this); // get the data from php file

trace(array_num);
 test='';
for(g=0; garray_num; g++){
  buy[g]=this[buy+g];
   sell[g]=this[sell+g];
   test+=this[buy+g]+ - ;
}
for(m=0; marray_num; m++){
  test+=this[sell+m]+ ~ ;
}

  iList = new Array();
 myItem = new Object();
 myItem.label=Select one;
  myItem.data = -1;
 iList[0] = myItem;

 for (i=0; iarray_num; i++) {
  myItem = new Object();
  get_label = this[list_label+i]
  myItem.label = get_label;
  myItem.data = i;
  iList[i+1] = myItem;
 }

 list_currency.setDataProvider(iList);
 trace(get_label);

}

//===



--
Sincerely your;

pei_world ( .::IT::. )






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



[PHP] Re: Flash interaction with PHP

2003-02-24 Thread pei_world
I only found the actionscript for click button to load the varialbes. but If
I want to load variable when the moive start?
on (release) {
gotoAndPlay(2);
Status = Beginning Login Process.. Please Hold;
loadVariablesNum (Login.php?Name=+Name, 0);
}


--
Sincerely your;

pei_world ( .::IT::. )



Pei_world [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 do you know how to load the variables from php
 automatically when the flash start?
 I need to stick the loadvariable into a button click action,which is not
 what i want.

 thx

 --
 Sincerely your;

 pei_world ( .::IT::. )








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



[PHP] Dynamic combobox in Flash with PHP

2003-02-23 Thread pei_world
I have the following PHP code to generate output to the flash
//===
$query = SELECT currencyCode,currencyName,country,buyPrice,sellPrice
  FROM $CURRENCIES_TABLE order by currencyCode;;

 $db_linker = db_connection();
db_selection($db_linker);
 $result = mysql_query($query);
  $num=mysql_num_rows($result);
  echo array_num=.$num;
  for($i=0; $imysql_num_rows($result); $i++){
   echo
list_label.$i.=.mysql_result($result,$i,currencyCode).,.mysql_resul
t($result,$i,currencyName);
 }


 db_close($db_linker);


//==
==


also the following code in actionscript use to receivesend data.
but when I run the *.swf it cann't get the output from PHP,
so anyone can help

//
loadVariables(link.php, this, POST); // get the data from php file
/*
//==
iList = new Array();
myItem = new Object();
iList[0] = myItem;

for (i=0; iarray_num; i++) {
myItem = new Object();
test = this[list_label+i]
myItem.label = test
myItem.data = i;
iList[i+1] = myItem;
}

list_currency.setDataProvider(iList);

//




thx.

--
Sincerely your;

pei_world ( .::IT::. )






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



[PHP] Flash interaction with PHP

2003-02-23 Thread pei_world
do you know how to load the variables from php
automatically when the flash start?
I need to stick the loadvariable into a button click action,which is not
what i want.

thx

--
Sincerely your;

pei_world ( .::IT::. )






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



[PHP] Re: Variables not being received from form

2003-02-23 Thread pei_world
cann't see any thing without your form! I think it is misstyping error,
check your form variables name,
specially upper case or lower case!
but try
$rank = $HTTP_POST_VARS[rank];
$title_new = $HTTP_POST_VARS[titles];

--
Sincerely your;

pei_world ( .::IT::. )



Peter Gumbrell [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Thanks to those who have helped me with my two other questions this
 afternoon.
 In the function below, the update query at the end is inserting empty
values
 into the database. For some reason the lines:


 re not picking up the form values.

 Here is the complete function. I do not have a form action set so that I
can
 read the SQL message. The update query is working.


 function retrieve_select_listing($link, $workshop, $session, $username)
 {
 $query_retrieve = SELECT choice_ID, rank, workshop_id FROM choices_peter
 WHERE workshop_ID = '$workshop' AND username ='$username';
 $result1 = mysql_query($query_retrieve, $link) or die(display_db_query:
.
 mysql_error());
 $row1 = mysql_fetch_array($result1);
 $choice_id = $row1[0];
 $query_title = SELECT title, CONCAT(sessionlet, sesnumber) AS SessionID
 FROM ECOO2003 WHERE sessionlet = '$session';
 $result2 = mysql_query($query_title, $link) or die(display_db_query: .
 mysql_error());
 while ($columns = mysql_fetch_array($result2))
 {
 $column = $columns['title'];
 $sessionid = $columns['SessionID'];
 $selected = ;
 if ($sessionid == $row1['workshop_id'])
 {
 $selected = SELECTED;
 }
 $title_block .= OPTION name='title' value=\$sessionid\
 $selected$column/OPTION\n;
 }


 print trtd colspan=\4\;
 $selected_session = $HTTP_POST_VARS['titles'];
 print form method=\POST\ name=\update_workshop\ action=\\\n;

 print Change the rank of this workshop, or select another workshop from
 this session and click the update button.brbr/td/tr;

 print trtd colspan=\4\table border=\1\ width=\80%\;
 print trthworkshop/ththRank/ththWorkshop Title/th/tr;
 print trtd$row1[2]/tdtdinput type = \text\ name =\rank\
 value=$row1[1]/tdtdSELECT
 NAME=\titles\$title_block/SELECT/td/tr\n;
 print trtd colspan =\3\;
 print input type=\hidden\ name=\update_select\ value=\v\;
 print brAfter you have made your changes, click the Update button to
 confirm these.br/td/trtrtd;
 print INPUT TYPE=\Submit\ NAME=\Submit\ Value=\Update\/td;
 print td/tdtd/td/tr;

 print /table;
 print /form;


 if ($_POST['Submit']=='Update')
 {
 print updated!!;
 $rank = $HTTP_POST_VARS['rank'];
 $title_new = $HTTP_POST_VARS['titles'];
 print rank =$rankbr;
 print title# = $title_newbr;
 $query_update = UPDATE choices_peter SET rank = '$rank', workshop_id =
 '$title_new' WHERE choice_ID = '$choice_id';
 $update = mysql_query($query_update, $link) or die(display_db_query: .
 mysql_error());


 }
 }

 Many thanks

 Peter





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



[PHP] Re: Dynamic combobox in Flash with PHP

2003-02-23 Thread pei_world
how to active the variablesLoad(test.php,0) when the flash start to play
I mean auto load the variables

--
Sincerely your;

pei_world ( .::IT::. )



Michiel Van Heusden [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 my experience is
 that interaction between flash and php runs best through GET
 so, you could try using GET instead of POST

 and in your actionscript
 insert the ';' on the end of the lines for:
 test = this[list_label+i]
 myItem.label = test

 grace
 michiel


 Pei_world [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  I have the following PHP code to generate output to the flash
 
//===
  $query = SELECT currencyCode,currencyName,country,buyPrice,sellPrice
FROM $CURRENCIES_TABLE order by currencyCode;;
 
   $db_linker = db_connection();
  db_selection($db_linker);
   $result = mysql_query($query);
$num=mysql_num_rows($result);
echo array_num=.$num;
for($i=0; $imysql_num_rows($result); $i++){
 echo
 

list_label.$i.=.mysql_result($result,$i,currencyCode).,.mysql_resul
  t($result,$i,currencyName);
   }
 
 
   db_close($db_linker);
 
 
 

//==
  ==
 
 
  also the following code in actionscript use to receivesend data.
  but when I run the *.swf it cann't get the output from PHP,
  so anyone can help
 
  //
  loadVariables(link.php, this, POST); // get the data from php file
  /*
  //==
  iList = new Array();
  myItem = new Object();
  iList[0] = myItem;
 
  for (i=0; iarray_num; i++) {
  myItem = new Object();
  test = this[list_label+i]
  myItem.label = test
  myItem.data = i;
  iList[i+1] = myItem;
  }
 
  list_currency.setDataProvider(iList);
 
 
//
 
 
 
 
  thx.
 
  --
  Sincerely your;
 
  pei_world ( .::IT::. )
 
 
 
 
 





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



[PHP] Re: new to php, need help..

2003-02-21 Thread pei_world
I think the problem is your php.ini setting
the global_variable,
by default, it is off,coz more secure,so if you want to access the variable,
you need $_POST[variable] or $_GET[variable], also, $_env[HTTP_GET_VARIABLE]
or $_env[HTTP_POST_VARIABLE]
check out the manual on the web

--
Sincerely your;

pei_world ( .::IT::. )


Jonathan [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi all, i've only begun learning php around 1 week ago, i'm having trouble
 with this code,

 html
 head
 titleUntitled Document/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 /head

 body
 ?
 if (isset($subject)) { echo $subject[0]br /;
 echo $subject[1]p /; }
 else { $subject[0] = Enter Subject A;
 $subject[1] = Enter Subject B; } ?
 FORM ACTION=? echo $PHP_SELF; ?
 input type=text NAME=subject[0] value=? echo $subject[0]; ? /
 input type=text NAME=subject[1] value=? echo $subject[1]; ? /
 input type=submit value=Submit! /
 input type=reset value=Reset /
 /FORM

 /body
 /html

 i got the body code from www.linuxguruz.org

 but i can't seem to get my input value correct,

 rather then parsing the variable subject[0]

 it passes the words ? echo $subject[0]; ?  as the value instead,


 i'm using macromedia dreamweaver MX as my html text editor

 pls help... thanks!

 Jonathan






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




[PHP] how to get the array

2003-02-21 Thread pei_world
if my post variable is
$_POST[array]
How can I get the individual element of that array?
I found one way to do this is $two_array=$_POST[array],
but is there any other way to do so?

thx

--
Sincerely your;

pei_world ( .::IT::. )



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




[PHP] problem in PHP with ADODB connection, Microsoft JET Database

2003-02-19 Thread pei_world

when I try to connection to the access file using Microsoft Jet Engine. it
come up with following error!
can anyone help me?


$conn = new COM(ADODB.Connection);
$conn-Open(Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$database);

$query = SELECT * FROM user;

$result = $conn-Execute($query) or die(fail to connection to the
database!);
 if ($result-RecordCount()!=-1){
  //do something
}


--
Warning: Invoke() failed: Exception occurred. Source: Microsoft JET Database
Engine Description: Syntax error in FROM clause.
-
thx

--
Sincerely your;

pei_world ( .::IT::. )



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