[PHP] Re: sending variables

2001-02-20 Thread Ifrim Sorin

In test1.php you shoul have

?
$qry=getenv("QUERY_STRING");
$rosen=substr($qry,6);
print("$rosen");
?

Sorin Ifrim

Rosen [EMAIL PROTECTED] wrote in message
96tdvp$oo7$[EMAIL PROTECTED]">news:96tdvp$oo7$[EMAIL PROTECTED]...
 Hi,
 I have two simple php files:

 main.php:
 A HREF="test1.php?rosen=11"LIST/A

 test1.php:

 ?print("$rosen");?



 But this doesn't work !

 please HELP !



 Rsen Marinov







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



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




Re: [PHP] php variables in sql statements.

2001-02-19 Thread Ifrim Sorin

It is possible, but the syntax is :

  $sql = "select businessname from main where businesstype =
 'consultancy' and " .$community." != '0'";
This is the case where $comunity is the name of a field.

Regards
Sorin Ifrim

- Original Message -
From: Matt Davis [EMAIL PROTECTED]
To: Php Mailing List [EMAIL PROTECTED]
Sent: Monday, February 19, 2001 6:05 PM
Subject: [PHP] php variables in sql statements.


 Can someone tell me if this is possible.

 I have a PHP variable which i got from a html form using $HTTP_POST_VAR.
I
 collect a variable called Community. Therefore is it possible to have an
sql
 statement like this?

 file://create sql statement

  $sql = "select businessname from main where businesstype =
 'consultancy' and $community != '0'";


 if this is not ok how else can i extract a variable from another html
page.

 Matt.


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



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




Re: [PHP] Is it possible to send a html page via mail()???

2001-02-18 Thread Ifrim Sorin

Hi,

Try this :

?
 $qry=getenv("QUERY_STRING");

 $sirarg=explode("",$qry);
 $url_adr=$sirarg[0];
 $mail_adress=$sirarg[1];
 $fcontents = join ('', file ($url_adr));
 $posta=mail($mail_adress ,"Requested URL: ".$url_adr, $fcontents ,"From: 
[EMAIL PROTECTED]\n"."MIME-Version: 1.0\n"."Content-Type: text/html;\n");
 if ($posta ) {
  echo "The requested URL was  sent succesfully" ;
 }
 else {
  echo "There was an error while sending the requested URL " ;
 }
?

You should call the script like this : scriptname.php?page_adressemail_adress
Here is an example :

 
http://10.116.1.133/script/email.php3?http://10.116.1.133/documen/php_nou/function.mail.html[EMAIL PROTECTED]
   


HTH
Regards,
Sorin Ifrim


David Tandberg-Johansen [EMAIL PROTECTED] wrote in message 
96n7cs$inb$[EMAIL PROTECTED]">news:96n7cs$inb$[EMAIL PROTECTED]...
 Hello !
 
 I wonder if there are any class or script out there that you can give an url
 or file as an variable and then it sends this as html-mail to a given
 emailadress.
 
 david
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



Re: [PHP] REgular expression....difficult is it?

2001-02-18 Thread Ifrim Sorin

The ? meta-character is used for matching zero or one occurence of the
preceding character , in this case , l .
T'his means that you'll match all words that begin with 'Wi' and continue
with one or zero 'l' .

HTH
Sorin Ifrim

- Original Message -
From: Dhaval Desai [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 19, 2001 7:23 AM
Subject: [PHP] REgular expressiondifficult is it?


 Hi!


 I am not able to understand this REgular expression.

 /Wil?/

 would match "Winnie", "Wimpy" "Wilson" and "William",
 though not "Wendy" or "Wolf".

 Howz taht..?


 Can anybody explain me please.

 Thank You!
 Dhaval Desai

 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail - only $35
 a year!  http://personal.mail.yahoo.com/

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



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




Re: [PHP] Dir? Can I get a dir listing of the current dir my php file is in?

2001-02-17 Thread Ifrim Sorin

Hi,

You could try this:

 $script_name = getenv("PATH_TRANSLATED");
 $dir_name = dirname($script_name);
 $d = dir($dir_name);
 $i = 0;
 while ($file = $d-read())

$file_array[i]  = $file ;
 }

HTH
Sorin Ifrim


- Original Message -
From: Brandon Orther [EMAIL PROTECTED]
To: PHP User Group [EMAIL PROTECTED]
Sent: Saturday, February 17, 2001 5:03 AM
Subject: [PHP] Dir? Can I get a dir listing of the current dir my php file
is in?


 Hello,

 I am looking for a way to get a dir listing of the current dir my
phpscript
 is in and putting it into an array.  Does anyone have a quick way to do
 this?

 Thank you,

 
 Brandon Orther
 WebIntellects Design/Development Manager
 [EMAIL PROTECTED]
 800-994-6364
 www.webintellects.com
 


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



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




Re: [PHP] parse error driving me nuts ...

2001-02-15 Thread Ifrim Sorin

Try to use  ==  instead of  =

Sorin Ifrim

- Original Message - 
From: Andrew [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 15, 2001 5:33 PM
Subject: [PHP] parse error driving me nuts ...


 hi, can anyone help me spot the parse error?
 It's throwing up on the first "if" line, and for the life of me I cannot
 find it! :)
 
 tia,
 andrew
 
 ?php
 
 include("db_connect_params.inc");
 $sql="select path from PHOTO where pid =1";
 $link_id = mysql_connect($host, $usr, $pass);
 $result = mysql_db_query($database, $sql, $link_id) or die("no result");
 
 if ((mysql_num_rows($result)) = 1)
 
 {
  $row=mysql_fetch_array($result);
  extract($row);
  echo "img src =\"$path\"/imgbr";
 
 } else {
  if (!isset($ii)) $ii = 1;
  $i = 1;
  while($row=mysql_fetch_array($result))
  {
 extract($row);
 $displayed[$i]=$path;
 echo "a href=\"$PHP_SELF?ii=$i\"$i/anbspnbsp";
 $i++;
  }
  echo "img src =\"$displayed[$ii]\"/imgbr";
   }
 ?
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


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




Re: [PHP] hidden form field.

2001-02-13 Thread Ifrim Sorin

Hello,

The reason is that you might want to pass to PHP script that process
the form information that is not found in any other shown field of the form
,
 for example an id code.

HTH
Sorin Ifrim

- Original Message -
From: Angerer, Chad [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 5:14 PM
Subject: [PHP] hidden form field.


 Hello list,

 Can someone please explain to me in simple terms.  What the exact reason
is
 for putting hidden form fields into an html document that uses PHP to
 connect to a mySQL db .. or any db for that matter.  I have looked around
 and have not gotten a good clear answer?

 Thanks.

 Chad Angerer


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



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




Re: [PHP] Return ODBC Results to an array

2001-02-13 Thread Ifrim Sorin

You can use mysql_fetch_array() for each row returned in the cursor.

Sorin Ifrim


- Original Message - 
From: Karl J. Stubsjoen [EMAIL PROTECTED]
To: PHP Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 7:32 PM
Subject: [PHP] Return ODBC Results to an array


 Is there a way to return the results of a query straight into an array?
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


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




Re: [PHP] Return ODBC Results to an array

2001-02-13 Thread Ifrim Sorin

For ODBC, the function is odbc_fetch_into().

Sorin Ifrim

- Original Message - 
From: Karl J. Stubsjoen [EMAIL PROTECTED]
To: PHP Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 7:32 PM
Subject: [PHP] Return ODBC Results to an array


 Is there a way to return the results of a query straight into an array?
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


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




Re: [PHP] rewriting this SQL query to remove subselect

2001-02-11 Thread Ifrim Sorin

You could try a two step query:
  $querywords="CREATE TABLE  temptable SELECT  ... ";
  $sel_querywords=mysql_query($querywords);

 $search = "SELECT count(search_table.word) as score,
 search_table.qid,page_data.contents
  FROM search_table,page_data,temptable
  WHERE page_data.pID = search_table.qid AND search_table.word =
temptable.word
  GROUP BY search_table.qid
  ORDER BY score DESC";

  then drop temptable .

HTH
Sorin Ifrim

Scott Mebberson [EMAIL PROTECTED] wrote in message
967ab7$t1$[EMAIL PROTECTED]">news:967ab7$t1$[EMAIL PROTECTED]...
 Hi Guys,

 I understand that as of version 3.24, MySQL will support subselects. But
 untill then (because 3.23 is the latest stable release) I need to convert
 this SQL satement into something that can be used with v3.2? - the
version
 just before the latest release.

 $search = "SELECT count(search_table.word) as score,
 search_table.qid,page_data.contents
  FROM search_table,page_data
  WHERE page_data.pID = search_table.qid AND search_table.word
  IN($querywords)
  GROUP BY search_table.qid
  ORDER BY score DESC";

 Does anybody have any ideas, thanks for this guys. Any help is much
 appreciated.




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



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