php-general Digest 28 Feb 2001 17:54:33 -0000 Issue 539

Topics (messages 41953 through 42047):

Move a file from dir to another or delete file..?
        41953 by: Dhaval Desai
        41954 by: Simon Garner
        41957 by: Yasuo Ohgaki
        41982 by: Christian Reiniger
        41997 by: Tim Ward

Double Click
        41955 by: Fabian Fabela
        41956 by: Joe Stump
        41962 by: Ovidiu EFTIMIE

function not working?
        41958 by: Kurth Bemis
        42037 by: Chris Lee

++$i and $i++ whatz the difference?
        41959 by: Dhaval Desai
        41960 by: Jay Klehr
        41968 by: ..s.c.o.t.t..

subscript my mail-id for php
        41961 by: B Satish , Gurgaon

subscribe my mail-id for php mailing lists
        41963 by: B Satish , Gurgaon

Re: LDAP Listing
        41964 by: Fredrik Wahlberg

what is wrong with this sniplet?
        41965 by: Jacky
        41971 by: Alvin Tan
        41972 by: Jacky
        41973 by: Jacky
        41974 by: Simon Garner
        41983 by: Christian Reiniger
        41988 by: Yasuo Ohgaki

curl functions problems
        41966 by: Dezider Góra

Re: Exception Handling in php
        41967 by: Ovidiu EFTIMIE

Caller's __LINE__
        41969 by: elias
        41970 by: CC Zona
        41976 by: Neil Kimber
        42010 by: Christian Dechery
        42036 by: Joao Prado Maia

Getting form name
        41975 by: Matt Williams
        41977 by: Simon Garner
        41979 by: Matt Williams

Re: Another question about using shmop!
        41978 by: Christian Reiniger

Re: File downloading?
        41980 by: Christian Reiniger

multiple databases
        41981 by: Michael Hall
        41984 by: Simon Garner
        41985 by: Michael Hall
        41987 by: Simon Garner
        41993 by: Christian Reiniger

Re: Revised [PHP] COM and PHP
        41986 by: Daniel Tryba

Hebrew websites transition with php3 ..
        41989 by: Aviv Revach
        41998 by: Boaz Yahav
        41999 by: Aviv Revach

optimal way of counting votes in online poll
        41990 by: Vikram Vaswani
        41992 by: Simon Garner

found a bug with  File Uploads..
        41991 by: Dhaval Desai
        42035 by: Chris Lee
        42043 by: TTT

Re: while loop and modulus?
        41994 by: Tim Ward

illegal string index
        41995 by: E. Uytterhoeven
        42034 by: Chris Lee

Re: Members area
        41996 by: Miles Thompson

webmin like tools in php
        42000 by: Mitchell Hagerty

PHP and iPlanet on Solaris
        42001 by: Montgomery-Recht, Evan
        42045 by: Kelly Corkill

PHP and SVG
        42002 by: Joe Sheble (Wizaerd)
        42022 by: Phil Driscoll

Problems with PHP4 CGI binary
        42003 by: Philip Reynolds

POST Referral
        42004 by: Boget, Chris
        42005 by: Matt

A small Q
        42006 by: Harshdeep S Jawanda
        42008 by: Matt
        42009 by: Clayton Dukes
        42011 by: Philip Reynolds
        42013 by: Robert Vetter

formating output
        42007 by: george
        42033 by: Chris Lee

interpolating functions into here-docs
        42012 by: kevin1

PHP and printing
        42014 by: fano
        42018 by: Michael Meinl

include_once
        42015 by: Hardy Merrill
        42021 by: Hardy Merrill

Retrieving Version numbers.
        42016 by: ACNS-ONLINE Webmaster
        42024 by: Batonik

PHP / mySQL Problem
        42017 by: Michael Gorner

Re: mySQL table joins are slow, need rebuild?
        42019 by: Steve Segarra

How to disable some functions?
        42020 by: Batonik
        42030 by: Philip Reynolds

redefine constants
        42023 by: Christian Dechery
        42026 by: Neil Kimber
        42031 by: Chris Lee

user_error() default error type
        42025 by: Christian Dechery

Test. Please, ignore!
        42027 by: Alex Puritche

Pluralize a word for searching a database
        42028 by: Robert V. Zwink

iPlanet issue...
        42029 by: Montgomery-Recht, Evan

Manuel Lemos's PHP POP3 class
        42032 by: Adrian Murphy

putenv() question.
        42038 by: Carter Comunale

second select how???
        42039 by: Miguel Loureiro
        42042 by: Jason Jacobs

Re: re:mod_dav and dreamweaver 4.0
        42040 by: Michael A. Peters

Re: PHP single user??
        42041 by: Chris Lee

Re: [PHP-WIN] Re: [PHP] Revised [PHP] COM and PHP
        42044 by: Alain Samoun

exchange data between javascript & php!
        42046 by: kaab kaoutar

Pulling my hair out over Netscape...
        42047 by: Jackson, Michael

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------


Hi!


Well I would like to move a file from one directoy to
another using php and a web browser.
I could just find a function to move an uploaded file
but not a normal file which is allready there in some
directory.


Is there any way I can move a file from one directory
to another and also is tehre any way I can delete a
particluar file in a directory..




Thank You!
Cheers!~
Dhaval Desai




__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




From: "Dhaval Desai" <[EMAIL PROTECTED]>

> Hi!
> 
> 
> Well I would like to move a file from one directoy to
> another using php and a web browser.
> I could just find a function to move an uploaded file
> but not a normal file which is allready there in some
> directory.


<?php
    system("mv dir1/oldname.html dir2/newname.html");
?>


> 
> 
> Is there any way I can move a file from one directory
> to another and also is tehre any way I can delete a
> particluar file in a directory..
> 
> 


<?php
    system("rm badfile.html");
?>


Easy :-)







> Hi!
> 
> 
> Well I would like to move a file from one directoy to
> another using php and a web browser.
> I could just find a function to move an uploaded file
> but not a normal file which is allready there in some
> directory.

These are probably you are looking for.

http://www.php.net/manual/en/ref.dir.php 
(working with directory)
http://www.php.net/manual/en/ref.filesystem.php
(copy(), unlink() etc)

You might want to use sysetm() or like with care.
(Note: I'm not recommending to use system() to move
or delete files. Use of system() could make security hole easily)
http://www.php.net/manual/en/ref.exec.php
(system(), exec(),etc)

Regards,
--
Yasuo Ohgaki

> 
> 
> Is there any way I can move a file from one directory
> to another and also is tehre any way I can delete a
> particluar file in a directory..
> 
> 
> 
> 
> Thank You!
> Cheers!~
> Dhaval Desai
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> 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]
> 
> 




On Wednesday 28 February 2001 06:51, you wrote:

> Well I would like to move a file from one directoy to
> another using php and a web browser.
> I could just find a function to move an uploaded file
> but not a normal file which is allready there in some
> directory.

look at the filesystem functions:
rename () (or safer: copy()+unlink())
unlink()

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

CPU not found. retry, abort, ignore?





> -----Original Message-----
> From: Dhaval Desai [mailto:[EMAIL PROTECTED]]
> Sent: 28 February 2001 05:51
> To: [EMAIL PROTECTED]
> Subject: Move a file from dir to another or delete file..?
> 
> 
> Hi!
> 
> 
> Well I would like to move a file from one directoy to
> another using php and a web browser.
> I could just find a function to move an uploaded file
> but not a normal file which is allready there in some
> directory.
> 

I haven't tried it but would rename work?, i.e. rename("old_path/file.txt",
"new_path/file.txt")

> 
> Is there any way I can move a file from one directory
> to another and also is tehre any way I can delete a
> particluar file in a directory..

unlink();

> 
> 
> 
> 
> Thank You!
> Cheers!~
> Dhaval Desai
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail. 
> http://personal.mail.yahoo.com/

        Tim Ward
        Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html




Hi,

I have a page, and when I have to add a product I use a form, many people are used to 
make double click in every task, so when the product is sent with a double click in 
the send button, the program send it twice to the data base.

What can I do to prevent this?

Thank you.

Fabian Fabela
[EMAIL PROTECTED]
www.vacagorda.com





Make the id field on the db entry unique - the second query will fail. You 
should also be doing error checking on whether or not the record exists already.

--Joe

On Wed, Feb 28, 2001 at 12:15:38AM -0600, Fabian Fabela wrote:
> Hi,
> 
> I have a page, and when I have to add a product I use a form, many people are used 
>to make double click in every task, so when the product is sent with a double click 
>in the send button, the program send it twice to the data base.
> 
> What can I do to prevent this?
> 
> Thank you.
> 
> Fabian Fabela
> [EMAIL PROTECTED]
> www.vacagorda.com
> 

-- 

-------------------------------------------------------------------------------
Joe Stump, PHP Hacker, [EMAIL PROTECTED]                                 -o)
http://www.miester.org http://www.care2.com                                 /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison     _\_V
-------------------------------------------------------------------------------





Use something like this
<script language="JavaScript">
var submitcount=0;
function checkSubmit(s)

   if (submitcount == 0)
      {
      submitcount++;
          s.value = "  Sending...  ";
      return true;
      }
   else
      {
      alert("This form has already been submitted.  Thanks!");
      return false;
      }
   }
</script>
<input type="button" value="Proceed" name="send" onClick="if
(checkSubmit(this.form.send)) this.form.submit();">


And of course you should verify the id field in tha data base as Joe said.

Ovidiu

-----Original Message-----
From: Fabian Fabela [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 28, 2001 8:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Double Click


Hi,

I have a page, and when I have to add a product I use a form, many people
are used to make double click in every task, so when the product is sent
with a double click in the send button, the program send it twice to the
data base.

What can I do to prevent this?

Thank you.

Fabian Fabela
[EMAIL PROTECTED]
www.vacagorda.com






i can't get his function to work.  i pass the correct data to it...but no 
results....

heres the function

        function display_contents($table,$session)
        {
                $count = 0;
                $result = mysql_query( "SELECT * FROM $table WHERE 
session='$session'");
                        while($row = mysql_fetch_array($result)){
                                $result_inv = mysql_query( "SELECT * FROM 
retailseafood WHERE 
pid='$row[items]'");
                                $row_inventory = mysql_fetch_array($result_inv);
                                $contents[ "items"][$count] = $row_inventory[pid];
                                $contents[ "price"][$count] = $row_inventory[price];
                                //$contents[ "quantity"][$count] = $row[quantity];
                                $contents[ "total"][$count] = ($row_inventory[price] * 
$row[quantity]);
                                $count ++;
                        }
                $total = $this->cart_total($table,$session);
                $contents[ "final"] = $total;
                return $contents;
        }
        // return number of items in cart

and heres what i do to call the function

<A href="cart.php?action=display">View Contents Of Cart</A>

what or where am i doing/going wrong?

~kurth





your function

 function display_contents($table,$session)
 {
  $count = 0;
  $result = mysql_query( "SELECT * FROM $table WHERE session = '$session'");
  while($row = mysql_fetch_array($result))
  {
   $result_inv = mysql_query( "SELECT * FROM retailseafood WHERE pid = 
'{$row['items']}' ");
   $row_inventory = mysql_fetch_array($result_inv);
   $contents['items'][$count] = $row_inventory['pid'];
   $contents['price'][$count] = $row_inventory['price'];
   $contents['total'][$count] = $row_inventory['price'] * $row['quantity'];
   $count ++;
  }
  $total = $this->cart_total($table, $session);
  $contents['final'] = $total;
  return $contents;
 }

looks ok, there are some code snippits missing ($this->cart_total()) but I'll assume 
its rudamentry. the code you are missing is how your accually calling your function

<a href="cart.php?action=display">View Contents Of Cart</A>

is a url, you forgot to include the src of cart.php to see where you are accually 
calling the function.

cart.php
<?php

    if ($action == 'display')
        display_contents('some_table', $sessionID);

?>

please email me if you have more questions or comments.


-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]




"Kurth Bemis" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
i can't get his function to work.  i pass the correct data to it...but no 
results....

heres the function

function display_contents($table,$session)
{
$count = 0;
$result = mysql_query( "SELECT * FROM $table WHERE session='$session'");
while($row = mysql_fetch_array($result)){
$result_inv = mysql_query( "SELECT * FROM retailseafood WHERE 
pid='$row[items]'");
$row_inventory = mysql_fetch_array($result_inv);
$contents[ "items"][$count] = $row_inventory[pid];
$contents[ "price"][$count] = $row_inventory[price];
//$contents[ "quantity"][$count] = $row[quantity];
$contents[ "total"][$count] = ($row_inventory[price] * $row[quantity]);
$count ++;
}
$total = $this->cart_total($table,$session);
$contents[ "final"] = $total;
return $contents;
}
// return number of items in cart

and heres what i do to call the function

<A href="cart.php?action=display">View Contents Of Cart</A>

what or where am i doing/going wrong?

~kurth


-- 
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]





Hi!

I have a simple question. Please see the code below:

<?php

for($i=0; $i<=10; $i++)
{
echo "$i<br>";

}
?>

Now, See this code:

<?php

for($i=0; $i<=10; ++$i)
{
echo "$i<br>";

}
?>

I get the same out put from both the Scrits. What's
the difference then anywayz?


Thank You!
Dhaval Desai














__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




>From what I've read in the manual one is a post increment and the other is a
pre increment.

YOu may not see the difference in a loop statement...   but if you use
simple variables like the php manual does, you'll get different results.

ref:

http://www.php.net/manual/en/language.operators.increment.php

Jay Klehr

ConsoleCity
www.consolecity.com

-----Original Message-----
From: Dhaval Desai [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 28, 2001 12:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] ++$i and $i++ whatz the difference?


Hi!

I have a simple question. Please see the code below:

<?php

for($i=0; $i<=10; $i++)
{
echo "$i<br>";

}
?>

Now, See this code:

<?php

for($i=0; $i<=10; ++$i)
{
echo "$i<br>";

}
?>

I get the same out put from both the Scrits. What's
the difference then anywayz?


Thank You!
Dhaval Desai














__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
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]





one is post-increment, and one is pre-increment:

POST-increment ($i++)
$i = 1;
print $i++;
print "\n"
print $i;

prints :
1
2
becuase $i is printed out and *then* it is incremented, so
the next print statement prints out the incremented value,
not the print $i++; statement

PRE-increment (++$i)
$i = 1;
print ++$i;
print "\n"
print $i;

prints :
2
2
becuase $i is incremented, and *then* printed out.



> -----Original Message-----
> From: Dhaval Desai [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 27, 2001 23:50
> To: [EMAIL PROTECTED]
> Subject: [PHP] ++$i and $i++ whatz the difference?
> 
> 
> Hi!
> 
> I have a simple question. Please see the code below:
> 
> <?php
> 
> for($i=0; $i<=10; $i++)
> {
> echo "$i<br>";
> 
> }
> ?>
> 
> Now, See this code:
> 
> <?php
> 
> for($i=0; $i<=10; ++$i)
> {
> echo "$i<br>";
> 
> }
> ?>
> 
> I get the same out put from both the Scrits. What's
> the difference then anywayz?
> 
> 
> Thank You!
> Dhaval Desai
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail. 
> 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]
> 





can you subscribe my mail-id for Php general mailing lists


satish




can you subscribe my mail-id for php general mailing lists



satish




This is a small test I wrote a couple of days ago that does just that. 
Hope it works for you. 

/Fredrik

<?php
$ldapserver = "orchide.habeebee.com";
$basedn = "dc=habeebee, dc=com";

$dir =ldap_connect($ldapserver);        // Connect to server

if ($dir) {
  ldap_bind($dir);                      // Bind to the server
  $result = ldap_search($dir, $basedn, "sn=*");  // query connection, set 
the base and look for any ”sn”

  $info = ldap_get_entries($dir, $result);  // The results get sent to 
the $info object

  for ($i=0; $i<$info["count"]; $i++) { // Count is a ldap feature that 
contains the length of the resultset
    echo $info[$i]["cn"][0];    // choose any parameter you want see here
  }

  ldap_close($dir);
} 
?>

>>>>>>>>>>>>>>>>>> Ursprungligt meddelande <<<<<<<<<<<<<<<<<<

Mike Tuller <[EMAIL PROTECTED]> skrev 2001-02-28, kl. 01:31:09 
angående ämnet [PHP] LDAP Listing:


> I want to create a list of everyone on the LDAP server, and none of the
> examples I have in my books seems to work. What functions should I use to
> connect to the server, and list users in the LDAP to create a phone book
> type list to print out? Could someone also give me some sort of example 
that
> I can look at?

> Mike Tuller


> --
> 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]




people,
I tried to write out email using sniplet below, the email will write out the hyper 
link so that reciever can click on the link to go to the page. What happen is that the 
reciever recieve the actual link instead of the hyper link I made, so I wonder what 
did I do wrong. I have mad sure that the email software I used to test can read html 
format ( I use outlook express).

  $mailTo  =   "[EMAIL PROTECTED]";
  $mailSubject = "test";
  $mailBody    = "Dear sir, \n\n";
  $mailBody    = "Below is the link you can click on, \n\n";
  $mailBody   .= "<html><body>Please Click <a 
href=\"www.php.net\">Here</a></body></html> to view the request details";
  $mailHeaders = "From: [EMAIL PROTECTED]\n";
  mail($mailTo, $mailSubject, $mailBody, $mailHeaders);

Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"




Hi Jacky,

The problem is a HTML one. Use "http://" followed by the address in your <a
href> tag.

Regards,
@lvin

-----Original Message-----
From: Jacky [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 01, 2001 5:40 AM
To: [EMAIL PROTECTED]
Subject: [PHP] what is wrong with this sniplet?


people,
I tried to write out email using sniplet below, the email will write out the
hyper link so that reciever can click on the link to go to the page. What
happen is that the reciever recieve the actual link instead of the hyper
link I made, so I wonder what did I do wrong. I have mad sure that the email
software I used to test can read html format ( I use outlook express).

  $mailTo  =   "[EMAIL PROTECTED]";
  $mailSubject = "test";
  $mailBody    = "Dear sir, \n\n";
  $mailBody    = "Below is the link you can click on, \n\n";
  $mailBody   .= "<html><body>Please Click <a
href=\"www.php.net\">Here</a></body></html> to view the request details";
  $mailHeaders = "From: [EMAIL PROTECTED]\n";
  mail($mailTo, $mailSubject, $mailBody, $mailHeaders);

Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"





Sorry,
It was the mistyping. i actually put http:// in the a href. I just forgot to
type it in the mail. So what else could it be?
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
----- Original Message -----
From: Alvin Tan <[EMAIL PROTECTED]>
To: Jacky <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, February 28, 2001 3:39 AM
Subject: RE: [PHP] what is wrong with this sniplet?


> Hi Jacky,
>
> The problem is a HTML one. Use "http://" followed by the address in your
<a
> href> tag.
>
> Regards,
> @lvin
>
> -----Original Message-----
> From: Jacky [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 01, 2001 5:40 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] what is wrong with this sniplet?
>
>
> people,
> I tried to write out email using sniplet below, the email will write out
the
> hyper link so that reciever can click on the link to go to the page. What
> happen is that the reciever recieve the actual link instead of the hyper
> link I made, so I wonder what did I do wrong. I have mad sure that the
email
> software I used to test can read html format ( I use outlook express).
>
>   $mailTo  =   "[EMAIL PROTECTED]";
>   $mailSubject = "test";
>   $mailBody    = "Dear sir, \n\n";
>   $mailBody    = "Below is the link you can click on, \n\n";
>   $mailBody   .= "<html><body>Please Click <a
> href=\"www.php.net\">Here</a></body></html> to view the request details";
>   $mailHeaders = "From: [EMAIL PROTECTED]\n";
>   mail($mailTo, $mailSubject, $mailBody, $mailHeaders);
>
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
>
>
> --
> 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]
>
>





I am not sure but I think may be it is because whatever the mail() write out
in the body part will be recognised as text message, so even if we try to
make it to write out the HTML syntax, it won't work. It could be real stupid
to make such a notice but I can't think of anything else. Can you?
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
----- Original Message -----
From: Alvin Tan <[EMAIL PROTECTED]>
To: Jacky <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, February 28, 2001 3:39 AM
Subject: RE: [PHP] what is wrong with this sniplet?


> Hi Jacky,
>
> The problem is a HTML one. Use "http://" followed by the address in your
<a
> href> tag.
>
> Regards,
> @lvin
>
> -----Original Message-----
> From: Jacky [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 01, 2001 5:40 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] what is wrong with this sniplet?
>
>
> people,
> I tried to write out email using sniplet below, the email will write out
the
> hyper link so that reciever can click on the link to go to the page. What
> happen is that the reciever recieve the actual link instead of the hyper
> link I made, so I wonder what did I do wrong. I have mad sure that the
email
> software I used to test can read html format ( I use outlook express).
>
>   $mailTo  =   "[EMAIL PROTECTED]";
>   $mailSubject = "test";
>   $mailBody    = "Dear sir, \n\n";
>   $mailBody    = "Below is the link you can click on, \n\n";
>   $mailBody   .= "<html><body>Please Click <a
> href=\"www.php.net\">Here</a></body></html> to view the request details";
>   $mailHeaders = "From: [EMAIL PROTECTED]\n";
>   mail($mailTo, $mailSubject, $mailBody, $mailHeaders);
>
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
>
>
> --
> 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]
>
>






From: Jacky [mailto:[EMAIL PROTECTED]]
> >
> >
> > people,
> > I tried to write out email using sniplet below, the email will write out
> the
> > hyper link so that reciever can click on the link to go to the page.
What
> > happen is that the reciever recieve the actual link instead of the hyper
> > link I made, so I wonder what did I do wrong. I have mad sure that the
> email
> > software I used to test can read html format ( I use outlook express).
> >
> >   $mailTo  =   "[EMAIL PROTECTED]";
> >   $mailSubject = "test";
> >   $mailBody    = "Dear sir, \n\n";
> >   $mailBody    = "Below is the link you can click on, \n\n";
> >   $mailBody   .= "<html><body>Please Click <a
> > href=\"www.php.net\">Here</a></body></html> to view the request
details";
> >   $mailHeaders = "From: [EMAIL PROTECTED]\n";
> >   mail($mailTo, $mailSubject, $mailBody, $mailHeaders);
> >



You need to tell the mail reader that the message is HTML, using a
Content-Type header. Plus your message is not well-formed HTML anyway
(message should be an HTML document, not HTML inside plain text). Try this:


<?php
    $mailTo  =   "[EMAIL PROTECTED]";
    $mailSubject = "test";
    $mailBody    = "<html><body>Dear sir, \n\n";
    $mailBody   .= "Below is the link you can click on, \n\n";
    $mailBody   .= "Please Click <a
    href=\"http://www.php.net\">Here</a> to view the request
details</body></html>";
    $mailHeaders  = "From: mailto:[EMAIL PROTECTED]\n";
    $mailHeaders .= "Content-Type: text/html\n";
    mail($mailTo, $mailSubject, $mailBody, $mailHeaders);
?>


Cheers

Simon Garner





On Wednesday 28 February 2001 22:40, you wrote:
> people,
> I tried to write out email using sniplet below, the email will write
> out the hyper link so that reciever can click on the link to go to the
> page. What happen is that the reciever recieve the actual link instead
> of the hyper link I made, so I wonder what did I do wrong. I have mad
> sure that the email software I used to test can read html format ( I
> use outlook express).
>
>   $mailTo  =   "[EMAIL PROTECTED]";
>   $mailSubject = "test";
>   $mailBody    = "Dear sir, \n\n";
>   $mailBody    = "Below is the link you can click on, \n\n";
>   $mailBody   .= "<html><body>Please Click <a
> href=\"www.php.net\">Here</a></body></html> to view the request
> details"; $mailHeaders = "From: [EMAIL PROTECTED]\n";
>   mail($mailTo, $mailSubject, $mailBody, $mailHeaders);

Add a "Content-Type: text/html" to $mailHeaders (& add a http:// to the 
link)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

CPU not found. retry, abort, ignore?




You don't need to write <a href=.....> for outlook , if  you put space
before and after URL unless you want to send HTML mail. Outlook thinks it's
a URL if you write correct URL and many other UMA treats URL or Email
address as link.

i.e. www.php.net is not correct URL,  my outlook express thinks it is a URL
though...
http://www.php.net/ is correct URL and you should be able to click it to
open it.

If you want to send HTML mail, take a look at whole HTML formatted mail
including headers in your mail box. You will get how to compose HTML
formatted mail.

Regards,

--
Yasuo Ohgaki

----- Original Message -----
From: "Jacky" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 01, 2001 6:40 AM
Subject: [PHP] what is wrong with this sniplet?


people,
I tried to write out email using sniplet below, the email will write out the
hyper link so that reciever can click on the link to go to the page. What
happen is that the reciever recieve the actual link instead of the hyper
link I made, so I wonder what did I do wrong. I have mad sure that the email
software I used to test can read html format ( I use outlook express).

  $mailTo  =   "[EMAIL PROTECTED]";
  $mailSubject = "test";
  $mailBody    = "Dear sir, \n\n";
  $mailBody    = "Below is the link you can click on, \n\n";
  $mailBody   .= "<html><body>Please Click <a
href=\"www.php.net\">Here</a></body></html> to view the request details";
  $mailHeaders = "From: [EMAIL PROTECTED]\n";
  mail($mailTo, $mailSubject, $mailBody, $mailHeaders);

Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"





Hi,

I have problem when using curl function to redirect to page. I use it
when I need to check for valid informations on the and because there are
passwords, I don't want to send it via GET in url. So I use curl to
redirect to the originating page. The script's name is saveplacer.php. I
use this code:
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL,"$HTTP_REFERER");
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $poststring = "placerid=$placerid"
.. "&" . "pwd=$pwd" );
 curl_exec ($ch);
 curl_close ($ch);

Redirecting works, desired page shows up, but in browser's urlbar I get
http://mydomain/mysite/saveplacer.php and not
http://mydomain/mysite/add1.php as expected. I have checked the script
for empty spaces, headers, but nothing there. It shows the add1.php
script and url is different.
Has anyone experienced this?
I use Apache 1.3.17/PHP 4.0.4Pl1 on Windoze 2000 Pro. Even I don't think
it's anything to do with the problem.




I think that would be nice to have a try-catch to better control of the
code.

Ovidiu

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 27, 2001 9:09 PM
> To: kevin1; [EMAIL PROTECTED]
> Subject: Re: [PHP] Exception Handling in php
>
>
> Addressed to: kevin1 <[EMAIL PROTECTED]>
>               [EMAIL PROTECTED]
>
> ** Reply to note from kevin1 <[EMAIL PROTECTED]> Tue, 27 Feb
> 2001 08:10:05 -0500
> >
> > Is there any equivalent to Java's try-catch or Perl's eval{BLOCK}if($@)
> > structure in PHP?
>
> No.
>
> There has been some discussion about adding it on the developers list,
> but I don't expect to see it any time soon.
>
>
>
>
> Rick Widmer
> Internet Marketing Specialists
> http://www.developersdesk.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]
>





Hello.
I want to make a small function that sends a debug message:

  function debuginfo($msg)
 {
  echo"<b>the message is $msg, at line" . __LINE__ . " </b><br>";
 }

in my code:
 line 1
 line 2
 line x: debuginfo("hello!!!");

is there is anyway to show the caller's line number? in this case 'x' ?







In article <97ifmk$p85$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("elias") wrote:

>   function debuginfo($msg)
>  {
>   echo"<b>the message is $msg, at line" . __LINE__ . " </b><br>";
>  }
> 
> in my code:
>  line 1
>  line 2
>  line x: debuginfo("hello!!!");
> 
> is there is anyway to show the caller's line number? in this case 'x' ?

Pass __LINE__ to the function as one of its arguments:

 function debuginfo($msg, __LINE__)
  {
   echo"<b>the message is $msg, at line" . __LINE__ . " </b><br>";
  }

-- 
CC




Better still - use the set_error_handler() to define an error handler that
will output your debug statement and create your dbug message using
trigger_error(). Your registered error_handler will automatically receive
line number, file name and some other useful parameters.


-----Original Message-----
From: CC Zona [mailto:[EMAIL PROTECTED]]
Sent: 28 February 2001 09:37
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Caller's __LINE__


In article <97ifmk$p85$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("elias") wrote:

>   function debuginfo($msg)
>  {
>   echo"<b>the message is $msg, at line" . __LINE__ . " </b><br>";
>  }
>
> in my code:
>  line 1
>  line 2
>  line x: debuginfo("hello!!!");
>
> is there is anyway to show the caller's line number? in this case 'x' ?

Pass __LINE__ to the function as one of its arguments:

 function debuginfo($msg, __LINE__)
  {
   echo"<b>the message is $msg, at line" . __LINE__ . " </b><br>";
  }

--
CC

--
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]








>Pass __LINE__ to the function as one of its arguments:
>
>  function debuginfo($msg, __LINE__)
>   {
>    echo"<b>the message is $msg, at line" . __LINE__ . " </b><br>";
>   }

that won't work since __LINE__ returns the exact line where it's used... so 
it will always show the line of the function header...
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer






On Wed, 28 Feb 2001, Christian Dechery wrote:

>
> >Pass __LINE__ to the function as one of its arguments:
> >
> >  function debuginfo($msg, __LINE__)
> >   {
> >    echo"<b>the message is $msg, at line" . __LINE__ . " </b><br>";
> >   }
>
> that won't work since __LINE__ returns the exact line where it's used... so
> it will always show the line of the function header...
> ____________________________
> . Christian Dechery (lemming)
> . http://www.tanamesa.com.br
> . Gaita-L Owner / Web Developer
>

Okay, simple enough.

Pass __LINE__ as one of its arguments and just use a real variable name on
the function declaration.

function debuginfo($msg, $line_num)
{
  echo"<b>the message is $msg, at line $line_num </b><br>";
}

debuginfo($msg, __LINE__);

This will probably result in a line number that is one integer bigger than
what you want. For instance the error happened on line 40 and you are
actually calling this function on line 42. You can then just substract 2
from that and you will get the real line number. It's ugly, but works (or
should anyway ;).

Regards,
Joao

--
João Prado Maia <[EMAIL PROTECTED]>
http://phpbrasil.com - php com um jeitinho brasileiro
--
Contribua com o projeto de tradução do manual online do PHP
http://phpbrasil.com/traducao.php
--





Hi

Is there a way I can get the name of the form that has been posted?

Looking at the form vars I don't see a name var or such in there.

TIA

M@




From: "Matt Williams" <[EMAIL PROTECTED]>

> Hi
>
> Is there a way I can get the name of the form that has been posted?
>
> Looking at the form vars I don't see a name var or such in there.
>
> TIA
>
> M@


The NAME attribute of the FORM element is intended for scripting purposes
only.

But you should be able to achieve the desired effect with a hidden INPUT
element:


<form name="someform" method="POST">
<input type="hidden" name="formname" value="someform">
</form>



Cheers

Simon Garner





Thanks Simon.

You would have though as it there they would make it part of the form.

thanks again.

M@




On Wednesday 28 February 2001 00:15, you wrote:
> > Does it provide a faster performance, if I use these rather than
> > store things in mysql DB, I know this might be stupid, but I have to
> > make sure this.
>
> I belive shared memory is *much* faster than MySQL.

Well, I'd say it depends. For only a bit of simple data it's fine. But 
for more the optimizations of a database (indices etc) may make the db 
faster (remember most of the DB will be in RAM as well).
And a database is just *much* simpler and safer to use.

> Shared memory is not for the faint of heart.

> I can't think of any more, but that's mostly because I consider shared
> memory "too tricky for me" and have never played with it...

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

CPU not found. retry, abort, ignore?




On Wednesday 28 February 2001 01:06, you wrote:
> > Great, thanks.
> > I looked at the file(), but it sounded like is was just for
> > local file use.
>
> oops, should've been include(). Sorry :)

include () is surely wrong for that. fpassthru (as someone else 
mentioned), file() and (my personal favourite) readfile() are the 
functions of choice

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

CPU not found. retry, abort, ignore?




I'd like to run this past anyone who'd care to comment before I get too
far down the track I'm considering taking with a PHP web portal site.

Is it a wise idea to have a PHP web application running on multiple
databases? Everything I've done to date has run off one database, no
matter how large it got. With the current small portal site, the idea is
to break a monolithic database up into around 10 smaller databases, each
of which should be able to be backed up to a floppy. Not all databases are
called on each page, but up to 6 or so could be.

What are the performance implications (slower, obviously, but 10 times
slower?). Performance beyond what the human mind can perceive is not
relevant to me.

Should I use mysql_connect or mysql_pconnect for each db connection ?

Should I be careful to use mysql_close with each connection?

Any advice appreciated.

Mick





From: "Michael Hall" <[EMAIL PROTECTED]>

> I'd like to run this past anyone who'd care to comment before I get too
> far down the track I'm considering taking with a PHP web portal site.
>
> Is it a wise idea to have a PHP web application running on multiple
> databases? Everything I've done to date has run off one database, no
> matter how large it got. With the current small portal site, the idea is
> to break a monolithic database up into around 10 smaller databases, each
> of which should be able to be backed up to a floppy. Not all databases are
> called on each page, but up to 6 or so could be.
>
> What are the performance implications (slower, obviously, but 10 times
> slower?). Performance beyond what the human mind can perceive is not
> relevant to me.
>
> Should I use mysql_connect or mysql_pconnect for each db connection ?
>
> Should I be careful to use mysql_close with each connection?
>
> Any advice appreciated.
>
> Mick
>


Do you mean 10 different database servers, or 10 databases on the one
server?

As far as I know, separate databases on the one server give the same
performance as separate tables in one database.

With separate database servers you will run into new problems such as:

-) additional connection overhead for each server, if you need to access
more than one server in a page
-) can't combine data from servers, e.g. can't JOIN tables

Persistent connections may or may not help. Using persistent connections
could negate the connection time overhead, but you get a memory overhead
instead - if you have 40 connections open, there's got to be 40 mysqld
processes (threads?) running too.


Cheers

Simon Garner






> Do you mean 10 different database servers, or 10 databases on the one
> server?

10 databases on the one server.

> As far as I know, separate databases on the one server give the same
> performance as separate tables in one database.

Music to my ears.

> With separate database servers you will run into new problems such as:
> -) can't combine data from servers, e.g. can't JOIN tables

OK ... I didn't realise I could join tables across seperate databases.
Anywhere where joins are necessary, I'm using the one database.

Thanks

Mick





From: "Michael Hall" <[EMAIL PROTECTED]>

>
> > Do you mean 10 different database servers, or 10 databases on the one
> > server?
>
> 10 databases on the one server.
>
> > As far as I know, separate databases on the one server give the same
> > performance as separate tables in one database.
>
> Music to my ears.


Well, I'm pretty sure on that, but don't quote me ;-)

If you think about it though, each table is just a set of files in a
directory with the name of the database. It should not be any slower to
access a table in one directory compared to a table in another directory
(unless you split those directories onto separate physical disks or
somesuch - but you could do the same thing using symlinks and one database).

As for implementation in your script, you do not need to reconnect to access
a different database; just do mysql_select_db("dbname") to switch between
the databases. Or use mysql_db_query("dbname", "query").

However, there is probably no point in using 10 different databases - save
yourself some complication and just use one.


>
> > With separate database servers you will run into new problems such as:
> > -) can't combine data from servers, e.g. can't JOIN tables
>
> OK ... I didn't realise I could join tables across seperate databases.
> Anywhere where joins are necessary, I'm using the one database.
>
> Thanks
>
> Mick
>


Indeed you can:

7.19 SELECT Syntax
"You can refer to a column as col_name, tbl_name.col_name, or
db_name.tbl_name.col_name."

http://www.mysql.com/doc/S/E/SELECT.html


Cheers

Simon Garner





On Wednesday 28 February 2001 09:42, you wrote:

> Is it a wise idea to have a PHP web application running on multiple
> databases? Everything I've done to date has run off one database, no

If you get *really much* traffic, it's wise to split things up to 2 or 3 
databases (each on a dedicated machine):

* Normal data
* Session data
* evtl. Cached pages / parts

> each of which should be able to be backed up to a floppy. Not all

If each part fits on a floppy, forget it. For these sizes it'n not worth 
the effort (and can, in fact, slow down things)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

CPU not found. retry, abort, ignore?




On Mon, Feb 05, 2001 at 03:05:24PM -0500, Conover, Ryan wrote:
> I have been trying the following example from the PHP developer's cookbook
> and it keeps giving me the following error.
> 
> Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5
> <? //line 1
> $excel_handle = new COM("excel.application"); //line2
> $excel_handle->Visible = false; //line3
> $worksheet = $excel_handle->workbooks->add(); //line4
> $worksheet->Cells(1,1)->value = "Name"; //line5
> $worksheet->SaveAs("temp.xls"); //line6
> $excel_handle->quit(); //line7
> //line8
> ?> //line9
> 
> Anyone that has Com and PHP experience help please

I didn't test it in PHP (only in wscript.exe), but it seems the example 
is wrong. It should be (line 4 -> 4a, 4b):

excel_handle = new COM("Excel.Application"); //line2
excel_handle.Visible = true; //line3
workbook = excel_handle.Workbooks.Add(); //4a
worksheet=workbook.WorkSheets.Add(); //4b
worksheet.Cells(1,1).Value = "Name"; //line5
worksheet.SaveAs("temp.xls"); //line6
excel_handle.quit(); //line7

This seems to work.





Hey!

I've just joined this mailing-list, therefore, first of all, I would like 
to say hello to everybody.


Now, regarding the issue..

As some of you might know, handling with Hebrew websites is rather 
difficult. Hebrew words often come-out in reversed order (i.e. 'lmth' 
instead of 'html').

I'm working on a php3 script which would help me do the following -
Load an existing HTML file which consists Hebrew words (as well as English 
words and HTML tags), then reversing the Hebrew words back to order.

The problem I'm dealing with is how to reverse only the Hebrew words and 
not the entire
document, which contains HTML tags and English words as well.
The function 'hebrev()' does the process of reversing, but it reverses tags 
as well.


I would really appreciate it, if anyone will find some spare time to help me.


Thank you in advance -

   Aviv Revach

XOR-Coders Mega Programming Resource Site! -
         http://members.xoom.com/xorcoders/





Hi Aviv

Let me give you a small tip about Hebrew on the net.

The proper Hebrew code which was adopted by the Israeli Institute of
Standards
is the Logical standard. This standard is automatically supported by IE 4.x
and 5.x
and also by Netscape 6.x.

The percentage of not IE4.x or 5.x users in Israel is less than 3%.

3 of the major portals in Israel (Walla, Nana and MSN) are already moving to

logical Hebrew.

So why use Visual Hebrew?

In case you decide to go with Visual in any case, did you try hebrevc()?

Sincerely

      berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.
 

-----Original Message-----
From: Aviv Revach [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 1:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Hebrew websites transition with php3 ..


Hey!

I've just joined this mailing-list, therefore, first of all, I would like 
to say hello to everybody.


Now, regarding the issue..

As some of you might know, handling with Hebrew websites is rather 
difficult. Hebrew words often come-out in reversed order (i.e. 'lmth' 
instead of 'html').

I'm working on a php3 script which would help me do the following -
Load an existing HTML file which consists Hebrew words (as well as English 
words and HTML tags), then reversing the Hebrew words back to order.

The problem I'm dealing with is how to reverse only the Hebrew words and 
not the entire
document, which contains HTML tags and English words as well.
The function 'hebrev()' does the process of reversing, but it reverses tags 
as well.


I would really appreciate it, if anyone will find some spare time to help
me.


Thank you in advance -

   Aviv Revach

XOR-Coders Mega Programming Resource Site! -
         http://members.xoom.com/xorcoders/


-- 
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]




Hey!

Thank you for the quick reply.

I do have some questions regarding your answer.

 From what I know and have seen so far, there are more than just 3% 
Internet users in Israel which use Netscape 4.x (I use it myself...).
Are you sure that I should just ignore these people, and just use logical 
Hebrew?

Also, quite a lot of people started using Opera lately.. (ain't speaking 
about Israeli users).
Does Opera supports Logical Hebrew? If so, from which version?


Best Regards -

   Aviv Revach


At 15:20 28/02/01 +0200, Boaz Yahav wrote:
>Hi Aviv
>
>Let me give you a small tip about Hebrew on the net.
>
>The proper Hebrew code which was adopted by the Israeli Institute of
>Standards
>is the Logical standard. This standard is automatically supported by IE 4.x
>and 5.x
>and also by Netscape 6.x.
>
>The percentage of not IE4.x or 5.x users in Israel is less than 3%.
>
>3 of the major portals in Israel (Walla, Nana and MSN) are already moving to
>
>logical Hebrew.
>
>So why use Visual Hebrew?
>
>In case you decide to go with Visual in any case, did you try hebrevc()?
>
>Sincerely
>
>       berber
>
>Visit http://www.weberdev.com Today!!!
>To see where PHP might take you tomorrow.
>
>
>-----Original Message-----
>From: Aviv Revach [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, February 27, 2001 1:43 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Hebrew websites transition with php3 ..
>
>
>Hey!
>
>I've just joined this mailing-list, therefore, first of all, I would like
>to say hello to everybody.
>
>
>Now, regarding the issue..
>
>As some of you might know, handling with Hebrew websites is rather
>difficult. Hebrew words often come-out in reversed order (i.e. 'lmth'
>instead of 'html').
>
>I'm working on a php3 script which would help me do the following -
>Load an existing HTML file which consists Hebrew words (as well as English
>words and HTML tags), then reversing the Hebrew words back to order.
>
>The problem I'm dealing with is how to reverse only the Hebrew words and
>not the entire
>document, which contains HTML tags and English words as well.
>The function 'hebrev()' does the process of reversing, but it reverses tags
>as well.
>
>
>I would really appreciate it, if anyone will find some spare time to help
>me.
>
>
>Thank you in advance -
>
>    Aviv Revach
>
>XOR-Coders Mega Programming Resource Site! -
>          http://members.xoom.com/xorcoders/
>
>
>--
>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]


XOR-Coders Mega Programming Resource Site! -
         http://members.xoom.com/xorcoders/





Hi all!

I have a question as to the optimal method of counting and storing votes in
an online poll.

Once a user answers the poll by clicking on one of three options, I am
performing a query on a table which holds values for each option. Currently I
- query the table to get the current count
- increment the count by 1
- UPDATE the table with the new value

I wonder: what happens if two users submit the answer simulatneously, and
the answer is the same. Will only of those votes register? Or will the SQL
somehow be "queued" so that both are counted?

If the former - is there any other, better way to do this?

I am using mySQL as the database, and PHP to process the form and execute
the query.

Please CC your response to the address above also.

TIA

Vikram Vaswani





From: "Vikram Vaswani" <[EMAIL PROTECTED]>

> Hi all!
>
> I have a question as to the optimal method of counting and storing votes
in
> an online poll.
>
> Once a user answers the poll by clicking on one of three options, I am
> performing a query on a table which holds values for each option.
Currently I
> - query the table to get the current count
> - increment the count by 1
> - UPDATE the table with the new value
>
> I wonder: what happens if two users submit the answer simulatneously, and
> the answer is the same. Will only of those votes register? Or will the SQL
> somehow be "queued" so that both are counted?


And so you should wonder :)

You have created a race condition - if the table is updated between your
SELECT and your UPDATE, then your UPDATE will be using incorrect values.

The solution is very simple - instead of querying the current value and
incrementing it in PHP, let MySQL do the work:

UPDATE polls SET votecount=votecount+1 WHERE pollid=$poll

There are all sorts of manipulations you can do to the data during queries,
and they're all usually much better than trying to do the same thing in your
application.

http://www.mysql.com/doc/F/u/Functions.html


Cheers

Simon Garner





Hi!

I think I just found a bug in php.

I try to upload a file of size 37.0 K and you know
what happens.,,

The browser takes its own time..and the stupid thing
doesnot upload the file.

If I upload a file of size 2k then it uploads..


I have specified the file size in the form as :

<FORM ENCTYPE="multipart/form-data"
ACTION="upload.php" METHOD="POST">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE"
value="100000">

In Php.ini file I have found 8M is the maximum size..


I am running php 4.0.3pl1 wioth Apache on Windows 98.
I also have a server on Cqhost.com

I have seen the same happen there,.too...


Is this a bug or a problem..??


Please Reply

Cheers!~
Dhaval Desai







__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




try droping the max_file_size entry, does it help? I run on linux and my file uploads 
work from all browsers but opera.

<input type=hidden name='MAX_FILE_SIZE' value='100000'>

is a silly thing php has added, the only purpose I could ever see for this is to 
prevent people from uploading 3G files, but if this is the case, should the security 
not be server side, vs client side? as you mentioned, modify php.ini to change your 
limit. does anyone know another use for this ?


-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]


"Dhaval Desai" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi!

I think I just found a bug in php.

I try to upload a file of size 37.0 K and you know
what happens.,,

The browser takes its own time..and the stupid thing
doesnot upload the file.

If I upload a file of size 2k then it uploads..


I have specified the file size in the form as :

<FORM ENCTYPE="multipart/form-data"
ACTION="upload.php" METHOD="POST">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE"
value="100000">

In Php.ini file I have found 8M is the maximum size..


I am running php 4.0.3pl1 wioth Apache on Windows 98.
I also have a server on Cqhost.com

I have seen the same happen there,.too...


Is this a bug or a problem..??


Please Reply

Cheers!~
Dhaval Desai







__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
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]





Hi ,
in fact it doesn't do much ( at least on the couple browser I tested it) :
whatever you put as a limit the file will upload ...
this is a p.. in  the a... because if you do the check on the server it can
only be done when the upload is complete : pretty unfair to tell the user
that he has no more space when he spent 20 minutes uploading a file ( we use
audio files and they might be fairly big)

but apart from that I recently upgraded to 4.04pl1 and I have the same
problem (which didn't happen before) that is described by Dhaval , running
on Linux (RHT 7.0 with plenty'o patch ... , Apache 1.3.14) ...

changing the max file size doesn't do much :-(

the uploaded file seems to have 'type multipart...' and other junk caracters
added at the beginning of the file after the copy (which returns a success
error code !!!)

it seems to be a bug in 4.04pl1

help ....

--
Thierry TABARD
Digital Sound Planet
http://www.digitalsoundplanet.com
""Chris Lee"" <[EMAIL PROTECTED]> wrote in message
97jbpe$m17$[EMAIL PROTECTED]">news:97jbpe$m17$[EMAIL PROTECTED]...
> try droping the max_file_size entry, does it help? I run on linux and my
file uploads work from all browsers but opera.
>
> <input type=hidden name='MAX_FILE_SIZE' value='100000'>
>
> is a silly thing php has added, the only purpose I could ever see for this
is to prevent people from uploading 3G files, but if this is the case,
should the security not be server side, vs client side? as you mentioned,
modify php.ini to change your limit. does anyone know another use for this ?
>
>
> --
>
>  Chris Lee
>  Mediawaveonline.com
>
>  ph. 250.377.1095
>  ph. 250.376.2690
>  fx. 250.554.1120
>
>  [EMAIL PROTECTED]
>
>
> "Dhaval Desai" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!
>
> I think I just found a bug in php.
>
> I try to upload a file of size 37.0 K and you know
> what happens.,,
>
> The browser takes its own time..and the stupid thing
> doesnot upload the file.
>
> If I upload a file of size 2k then it uploads..
>
>
> I have specified the file size in the form as :
>
> <FORM ENCTYPE="multipart/form-data"
> ACTION="upload.php" METHOD="POST">
> <INPUT TYPE="hidden" name="MAX_FILE_SIZE"
> value="100000">
>
> In Php.ini file I have found 8M is the maximum size..
>
>
> I am running php 4.0.3pl1 wioth Apache on Windows 98.
> I also have a server on Cqhost.com
>
> I have seen the same happen there,.too...
>
>
> Is this a bug or a problem..??
>
>
> Please Reply
>
> Cheers!~
> Dhaval Desai
>
>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> 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]
>
>






you don't need to, but if you really want to ... 

echo "<table border=\"0\">\n";
echo "<tr>\n";
 
$photocount = 0;
 
while($row = mysql_fetch_array($result))
{       $smallpic = $row['smallpic'];
 
        echo "<td>$smallpic</td>\n";
 
        if (($photocount % 3) == 2)
        {       echo "</tr>\n<tr>\n";
        }
        $photocount++;
}

// this should add empty cells until the row is complete
while ($photocount % 3)
{       echo("<td></td>");
        $photocount++;
}

 
 echo "</tr>\n";
 echo "</table>";

        Tim Ward

> -----Original Message-----
> From: James, Yz [mailto:[EMAIL PROTECTED]]
> Sent: 27 February 2001 19:18
> To: [EMAIL PROTECTED]
> Subject: while loop and modulus?
> 
> 
> OK, using this code:
> 
> <?
> 
> echo "<table border=\"0\">\n";
> echo "<tr>\n";
> 
> $photocount = 0;
> 
> while($row = mysql_fetch_array($result)) {
>      $smallpic = $row['smallpic'];
> 
>  echo "<td>$smallpic</td>\n";
> 
>  if (($photocount % 3) == 2) {
>      echo "</tr>\n<tr>\n";
>  }
>  $photocount++;
> 
>      }
> 
> echo "</tr>\n";
> echo "</table>";
> 
> ?>
> 
> And 8 photos in the table, I'm getting this output:
> 
> <table border="0">
> <tr>
> <td>sm982438092.gif</td>
> <td>sm982437452.gif</td>
> <td>sm982439016.gif</td>
> </tr>
> <tr>
> <td>sm982529915.gif</td>
> <td>sm983222652.gif</td>
> <td>sm983222686.gif</td>
> </tr>
> <tr>
> <td>sm983222868.gif</td>
> <td>sm983222919.gif</td>
> </tr>
> </table>
> 
> Great, except it's missing an end cell, and after a few hours 
> fiddling about
> with code last night, I still didn't get any further in 
> working out how I
> was going to echo a table cell even if data's missing.  So, 
> any help would
> be appreciated.
> 
> Apologies for what're probably "easy" questions.  I slog away 
> at work all
> day, come back hoping to get something productive done on 
> this, and the
> ol'brain won't take it.  Frustrating, to say the least.
> 
> James.
> 
> 
> 




Hi,

I made a site that uses the following code:

$id = base64_decode($go);                            // decoding ID
$DataBaseNaam = "teller";                            // name of DB
include('connect.inc.php3');                            // connection to DB
$query = "select * from kl".$id;//query
$result = mysql_db_query($DataBaseNaam, $query);    // getting ResultSet
$t=0;
while ($waarden = mysql_fetch_array($result))    // extracting ata from RS
   {
   $ip[$t] = $waarden[ip];                        // IP value (varchar) <--
This line generates the problem..?
   $datum[$t] = $waarden[datum];            // date value (integer)
   $urlprov[$t] = $waarden[urlprov];        // URL value (varchar)
   $t++;
   }

On a locale machine (using PHP4) I didn't have any problems, but on internet
(using PHP 3.0.16) I got the warning "illegal string index on line ..." I
only get this warning if I want to extract IP numbers from my DB. Does
anyone knows why I get this warning ?

Thanks,

Eelco






I usually put '' around my indexs if they are not numeric, sometimes I dont have to 
sometimes I do, so I allways do.

$ip[$t] = $waarden['ip'];

another note is check if there are any NULL entries in the 'ip' field in your db. if a 
field is NULL then php does not create that index. and you will get an undefined index 
error.

mysql> alter table TABLE_NAME change VAR_NAME VAR_NAME varchar(255) NOT NULL ;

please email me if you have more questions or comments, I am interested in knowing how 
this works for you


-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]



""E. Uytterhoeven"" <[EMAIL PROTECTED]> wrote in message 
97ir7c$e8v$[EMAIL PROTECTED]">news:97ir7c$e8v$[EMAIL PROTECTED]...
Hi,

I made a site that uses the following code:

$id = base64_decode($go);                            // decoding ID
$DataBaseNaam = "teller";                            // name of DB
include('connect.inc.php3');                            // connection to DB
$query = "select * from kl".$id;//query
$result = mysql_db_query($DataBaseNaam, $query);    // getting ResultSet
$t=0;
while ($waarden = mysql_fetch_array($result))    // extracting ata from RS
   {
   $ip[$t] = $waarden[ip];                        // IP value (varchar) <--
This line generates the problem..?
   $datum[$t] = $waarden[datum];            // date value (integer)
   $urlprov[$t] = $waarden[urlprov];        // URL value (varchar)
   $t++;
   }

On a locale machine (using PHP4) I didn't have any problems, but on internet
(using PHP 3.0.16) I got the warning "illegal string index on line ..." I
only get this warning if I want to extract IP numbers from my DB. Does
anyone knows why I get this warning ?

Thanks,

Eelco



-- 
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]





Brandon,

The tutorials are there - look for them. They collectively describe all 
that you want to do vis-a-vis database manipulation.

Miles


At 06:58 PM 2/27/01 -0800, you wrote:
>Yea i cant find a good Tut, ok...
>i have a members directory with the inside that folder is status, goodies,
>ect........ and i want to get the information out my database for that
>specific member, how would i connect to my database, what would i select from
>"members" (my database) to get the field for that one person, so i can put
>there infomation when the logg in the members area
>
>Miles Thompson wrote:
>
> > Brandon,
> >
> > It's a little confusing.
> >
> > Are you saying:
> >     1. You have the members area - a directory, what?
> >     2. You have created a database containing your members information.
> > and now you:
> >     3. Want to know how to connect to the database?
> >     4. Add information to the database about the members?
> >     5. Have the members add information to the database?
> >
> > Which database are you using?
> > What kind of information do you want to capture?
> >
> > We need more information - Miles Thompson
> >
> > PS Have you looked at the PHP  & database tutorials at various php sites,
> > like www.thickbook.com, devshed, php essentials, php builder etc.? /mt
> >
> > At 05:34 PM 2/27/01 -0800, Brandon Feldhahn wrote:
> > >Hi, eveyone, my name is brandon, and i made a members area for my site,
> > >a database driven http authentication and a database for all my members
> > >i got everything working but how do i make a database connection that
> > >recieve the infomation for that user that has loggin into the members
> > >area.
> > >If i wasen clear enough just tell me.
> > >
> > >
> > >--
> > >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]





are there tools like webmin (web based admin tools)  in php?

http://www.webmin.com/webmin/

tks
mitch






I got the latest snapshot of php to compile on solaris (4.0.4pl1 wouldn't).

Anyways I edited the mime.types and obj.conf as described in the
installation instructions, but right now it's trying to download the
test.php file I created instead of processing.  Is there anything not in the
documentation that I need to add.

thanks,

evan




Sounds like the server doesn't have or recognize the mime type, ala on
apache in srm.conf:
application/x-httpd-php3 phtml php3 php

I'm not familiar with iPlanet but on apache I would check the mime type
definition, apache httpd.conf and make sure to restart the server to reload.


On Wed, 28 Feb 2001, Montgomery-Recht, Evan wrote:

> Date: Wed, 28 Feb 2001 09:33:26 -0500
> From: "Montgomery-Recht, Evan" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP and iPlanet on Solaris
> 
> I got the latest snapshot of php to compile on solaris (4.0.4pl1 wouldn't).
> 
> Anyways I edited the mime.types and obj.conf as described in the
> installation instructions, but right now it's trying to download the
> test.php file I created instead of processing.  Is there anything not in the
> documentation that I need to add.
> 
> thanks,
> 
> evan
> 
> -- 
> 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]
> 

Kelly

303-444-1671
Boulder, Colorado






Even though the WC3 hasn't fully finalized the spec for SVG, it's still a 
viable option for doing some dynamic graphics work using the Adobe 
plugin.  Has anybody been messing around with generating dynamic SVG code 
with PHP?





>Even though the WC3 hasn't fully finalized the spec for SVG, it's still a
>viable option for doing some dynamic graphics work using the Adobe
>plugin.  Has anybody been messing around with generating dynamic SVG code
>with PHP?

I haven't done so yet but it's certainly on my 'to do' list. We do a simple
drawing program for schools which exports SVG, and I had toyed with the idea
of generating an SVG extension module for PHP, however I couldn't dream up
many functions which you couldn't easily implement in php itself.

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org






Hi, 
I'm having problems with the PHP CGI binary (version 4.0.4pl1).
The bug is basically the bug reported here:
http://bugs.php.net/bugs.php?id=8506

It's exactly the same problem, replicated, now we need the CGI
binary version working, not only does this look very unprofessional
on the sites, but it means cookies cannot work.
This has been reported last December and it's a fairly serious
problem (basically makes the CGI binary close to unuseable for us)
Does anyone know of a fix, I tried messing around with Actions and
AddHandlers in Apache but to no avail.
Would anyone have an inkling as to what I might be doing wrong?
Or is it just a bug that needs to be fixed asap?
Phil.




Is it possible, in PHP, for a page to determine if it
was accessed via a form's submission (POST/GET)?

IOW, if you click on a link to get to a page, you can
find out (usually; I know it's not 100%) what page
the user was at before when s/he clicked the link by
accessing the $HTTP_REFERER variable.  Is there
any way to do the same type of check but determine
if it was due to the submission of a form (instead of
by a link as $HTTP_REFERER would suggest)?

Thanks!

Chris




getenv('REQUEST_METHOD');

.matt
----- Original Message ----- 
From: "Boget, Chris" <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[EMAIL PROTECTED]>
Sent: Wednesday, February 28, 2001 2:49 PM
Subject: [PHP] POST Referral


> Is it possible, in PHP, for a page to determine if it
> was accessed via a form's submission (POST/GET)?
> 
> IOW, if you click on a link to get to a page, you can
> find out (usually; I know it's not 100%) what page
> the user was at before when s/he clicked the link by
> accessing the $HTTP_REFERER variable.  Is there
> any way to do the same type of check but determine
> if it was due to the submission of a form (instead of
> by a link as $HTTP_REFERER would suggest)?
> 
> Thanks!
> 
> Chris
> 





Hi,

Does the extension of files that are require()-d or include()-d in PHP
have to be ".inc"? Can it be ".php"?

All examples seem to show this extension as ".inc". Could there be any
problems if the extension is kept ".php"?

--
Regards,
Harshdeep Singh Jawanda.






No, they can have any extension..

.matt
----- Original Message ----- 
From: "Harshdeep S Jawanda" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Wednesday, February 28, 2001 3:04 PM
Subject: [PHP] A small Q


> Hi,
> 
> Does the extension of files that are require()-d or include()-d in PHP
> have to be ".inc"? Can it be ".php"?
> 
> All examples seem to show this extension as ".inc". Could there be any
> problems if the extension is kept ".php"?
> 
> --
> Regards,
> Harshdeep Singh Jawanda.
> 
> 
> 
> -- 
> 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]





It can bee .poopoo if you want it to be :-)


----- Original Message ----- 
From: "Harshdeep S Jawanda" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Wednesday, February 28, 2001 10:04 AM
Subject: [PHP] A small Q


> Hi,
> 
> Does the extension of files that are require()-d or include()-d in PHP
> have to be ".inc"? Can it be ".php"?
> 
> All examples seem to show this extension as ".inc". Could there be any
> problems if the extension is kept ".php"?
> 
> --
> Regards,
> Harshdeep Singh Jawanda.
> 
> 
> 
> -- 
> 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]





Harshdeep S Jawanda's [[EMAIL PROTECTED]] 20 lines of wisdom included:
:>Hi,
:>
:>Does the extension of files that are require()-d or include()-d in PHP
:>have to be ".inc"? Can it be ".php"?
:>
:>All examples seem to show this extension as ".inc". Could there be any
:>problems if the extension is kept ".php"?

No problems at all, only reason I would recommend a different
extension is that you can disallow the viewing of the included files
in apache with the extension ".inc" as follows:
<Files ~ "\.inc$">
        Order allow,deny
        Deny from all
</Files>

Regards,
Phil.






Harshdeep S Jawanda wrote:
> 
> Hi,
> 
> Does the extension of files that are require()-d or include()-d in PHP
> have to be ".inc"? Can it be ".php"?
> 
> All examples seem to show this extension as ".inc". Could there be any
> problems if the extension is kept ".php"?

I don't know what examples you mean, but:

the name of the included/required file in PHP does not matter. However
the best thing is always to use the extention "*.php" to make sure the
files are always going thru the PHP interpreter, even when someone
access them directly by its URL.

Robert




  I am developing a site which will have a web based admin panel, just now
you can alter the scrolling headlines through the panel.
  But I want to be able to let the user modify, delete and create new
headline, this isnt  proble but i dong know how to format the output.
  What i want is for it to dispaly the headlines that are in the table be it
2 or 5 how do i take info from a table and get it to echo the code as many
times as needed(dependingon the headlines in the table) so the code would be
like this
but how do i also stop it from displaying the same fields ie exact same
headline link etc. and how do i get this so that 3 news stories = 3 lines
code

  myScroller1.addItem("<b><? echo "$headline" ; ?><a href='<? echo
"$newslink"; ?>'> latest news news</a>,  news news news</b>");

Hope you understand it, I dont think i do.

George






some code snipits would help, but lets see what we can do.

I like arrays, they work for me, there are lots of ways todo things, arrays will help.

echo "<b>{$headline[0]}</b><a href='{$newslink[0]}'>Latest news</a> blah blah<br> \n";
echo "<b>{$headline[1]}</b><a href='{$newslink[1]}'>Latest news</a> blah blah<br> \n";
echo "<b>{$headline[2]}</b><a href='{$newslink[2]}'>Latest news</a> blah blah<br> \n";

you can also accompish this nicer with a foreach loop

foreach($headline as $pos => $val)
    echo "<b>{$headline[$pos]}</b><a href='{$newslink[$pos]}'>Latest news</a> blah 
blah<br> \n";

more info at

http://php.net/manual/en/control-structures.foreach.php

email me with more questions, I am eager to help


-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]





""george"" <[EMAIL PROTECTED]> wrote in message 
97j42g$314$[EMAIL PROTECTED]">news:97j42g$314$[EMAIL PROTECTED]...
  I am developing a site which will have a web based admin panel, just now
you can alter the scrolling headlines through the panel.
  But I want to be able to let the user modify, delete and create new
headline, this isnt  proble but i dong know how to format the output.
  What i want is for it to dispaly the headlines that are in the table be it
2 or 5 how do i take info from a table and get it to echo the code as many
times as needed(dependingon the headlines in the table) so the code would be
like this
but how do i also stop it from displaying the same fields ie exact same
headline link etc. and how do i get this so that 3 news stories = 3 lines
code

  myScroller1.addItem("<b><? echo "$headline" ; ?><a href='<? echo
"$newslink"; ?>'> latest news news</a>,  news news news</b>");

Hope you understand it, I dont think i do.

George



-- 
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]





How would this be done?






Hello php-general,

  Hi, I'm working with php4 and mysql on a suse 6.3
  I made a program for an ISP that creates accounts, clients,
  payments, invoices.
Everymonth they need to print like a quote (a list of every non paid
thing) its ok, I could do that, I mean in the screen... Is it possible
to print it in a printer automatically? I mean.. I dont want to view
it on the screen.. I want it to print all the records alone
Can you help me???

Thanks

-- 
Best regards,
 fano                          mailto:[EMAIL PROTECTED]






>   Hi, I'm working with php4 and mysql on a suse 6.3
>   I made a program for an ISP that creates accounts, clients,
>   payments, invoices.
> Everymonth they need to print like a quote (a list of every non paid
> thing) its ok, I could do that, I mean in the screen... Is it possible
> to print it in a printer automatically? I mean.. I dont want to view
> it on the screen.. I want it to print all the records alone
> Can you help me???
e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

Well, you could simply use a shell script....

use something like

mylsq -psomepassword dbname -H -e "SQL-QUERY" | html2ps | lpr

-H puts out HTML-format

-e executes the query in ""

html2ps formats the output to postscript, which is printed via lpr...

works fine with me...

you could simply include this in your crontab....




Redhat 6.1 Linux
PHP 4.0.4pl1
Apache 1.3.14

Anyone using "include_once"?  I'm executing a PHP script "A.php"
by referring to it in my Netscape browser URL - script A.php does
an include_once of "B.php" - B.php contains a database connect
function that does a connect to an Oracle database.

I purposely brought down the Oracle database to force a connect
error.  I have an "error_log" statement in the connect failure
that prints to our webserver error log - the connect error was
reported fine.  ***THEN, I added more text to the error_log
output for that connect failure, but the new text is *NOT*
appearing in any subsequent connect failures.

Why won't my new text appear in the error?  I've tried changing
the "include_once" to "include", and the same thing happened.
I even tried restarting the webserver, but it had no affect.

This is driving me nuts!  Help please.

TIA.

-- 
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com




Solved - I was changing a copy of the code that the webserver
was NOT looking at.  "include_once" works fine.

Appologies.

-- 
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com

Hardy Merrill [[EMAIL PROTECTED]] wrote:
> Redhat 6.1 Linux
> PHP 4.0.4pl1
> Apache 1.3.14
> 
> Anyone using "include_once"?  I'm executing a PHP script "A.php"
> by referring to it in my Netscape browser URL - script A.php does
> an include_once of "B.php" - B.php contains a database connect
> function that does a connect to an Oracle database.
> 
> I purposely brought down the Oracle database to force a connect
> error.  I have an "error_log" statement in the connect failure
> that prints to our webserver error log - the connect error was
> reported fine.  ***THEN, I added more text to the error_log
> output for that connect failure, but the new text is *NOT*
> appearing in any subsequent connect failures.
> 
> Why won't my new text appear in the error?  I've tried changing
> the "include_once" to "include", and the same thing happened.
> I even tried restarting the webserver, but it had no affect.
> 
> This is driving me nuts!  Help please.
> 
> TIA.
> 
> -- 
> Hardy Merrill
> Mission Critical Linux, Inc.
> http://www.missioncriticallinux.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]

-- 
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com




Hey all,

New to the list.  The only reason I joined was because searching the =
archive is a joke.  Try to search for something using more than one word =
and you get it all. hehe.

Anyway,  I tryed a search and didn't find anything on this so here goes.

I need to retrieve the version number from differant programs.  example: =
"perl -v", or "sendmail -bt -d0", etc..

The problem is that (for example perl) the program returns a bunch of BS =
that isn't needed.  Does anyone know of a way to access this info =
easily?  Maybe capture the return in a string and then parse to the =
numbers?  Not sure how I should do this.  Any info would be helpful.  =
Thanks.

Chuck





On Wed, 28 Feb 2001, ACNS-ONLINE Webmaster wrote:

> I need to retrieve the version number from differant programs.  example: =
> "perl -v", or "sendmail -bt -d0", etc..
>
> The problem is that (for example perl) the program returns a bunch of BS =
> that isn't needed.  Does anyone know of a way to access this info =
> easily?

I.e. with perl try using:
perl -e 'print $]'

In other cases "preg_match" would be helpful, I guess.

Greets,
        Batonik





Hello,

First a bit of background, I'm running apache 1.3.12, php 4.03 and MySQL
3.23.22 under the Windows platform.

My problem is simply that when I write stuff to database tables full stops
are represented as copyright symbols when I view the data again. This is
probably me just being stupid - I'm guessing I've overlooked something
obvious.

If you need more information just ask me,

Thanks in advance,

Michael Gorner.





It also seems you have a semicolon in your query, mysql_query()
specifically states not to have on at the end of your queries, so I am
guessing this may be a factor...

Steve

Joe Stump wrote:
> 
> You need to remember a few things when it comes to joins:
> 
> the joined fields must be the EXACT same definition
>         - example: a join on id int(9) and id int(3) will NOT be optimized
>         - more: a join on id char(9) and id int(9) is REALLY NOT optimized :O)
> 
> We have an accounts table with userID as the key char(15) (don't ask, it's an
> old design made by a former employee) which has roughly 1.6 million rows in it.
> We regularily do joins on it with other tables that have thousands of records
> in less than .05 seconds.
> 
> This sounds like a table structure problem to me.
> 
> --Joe
> 
> On Tue, Feb 27, 2001 at 02:21:53PM -0800, Jason wrote:
> > hi,
> >
> > i have a query that is comparing a table with 1235 rows with another that
> > has 635 rows. The query looks like this:
> >
> > $res = mysql_query("select cust_info.ID, cust_info.first_name,
> > cust_info.last_name, cust_info.address, cust_info.datestamp from cust_info,
> > cust_order_info where cust_info.ID=cust_order_info.cust_id order by
> > $mainsort" . $order . ";");
> >
> > The parse time with the join is 19 seconds. I have to do a join because
> > there a different methods that the user must be able to sort by. The parse
> > time on the cust_info table alone, with a order by is .95 seconds.
> >
> > Now, we have a RPM binary of mySQL, and when performing the query, not only
> > is it slow, but sometimes will dump its core.
> >
> > Does anyone see anything wrong with the query, or should we consider
> > building the source on our box.. or?
> >
> > Thanks.
> >
> >
> > --
> > 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]
> 
> --
> 
> -------------------------------------------------------------------------------
> Joe Stump, PHP Hacker, [EMAIL PROTECTED]                                 -o)
> http://www.miester.org http://www.care2.com                                 /\\
> "It's not enough to succeed. Everyone else must fail" -- Larry Ellison     _\_V
> -------------------------------------------------------------------------------
> 
> --
> 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]





Hi,

        I've heard that it is possible, for security reasons, to disable
such functions like phpinfo(). How can I do this?

Greets,
        Batonik





Batonik's [[EMAIL PROTECTED]] 15 lines of wisdom included:
:>Hi,
:>
:>      I've heard that it is possible, for security reasons, to disable
:>such functions like phpinfo(). How can I do this?

You can edit the sources... 
PHP4:   $PHP_BASE_DIR/ext/standard/basic_functions.c

You're looking for a struct called 
function_entry basic_functions[] 

On my version (4.0.4-pl1) it's on line 91.
Your functions are listed there..

for example, delete line "PHP_FE(time,                  NULL)"
which is on line 100 on my version disables the time function.
However, why you want to disable functions is beyond me, to make PHP
"safe" you're going to have to disable a LOT of functions..

There might be some PHP4 way to disable functions, I think there
might be some way to do it from php.ini, but I can't find it
offhand.
Phil.





why can't I redefine __LINE__?

like define(LN,__LINE__);

it's a rather big constant to put in code to generate my error messages, I 
was thinking more of L, or LN... but if I redefine it, it assumes the value 
of de redefine() line of code... so it's not really redefining a constant 
it's only atributing LN the value of __LINE__...

and in the manual I saw examples where redefining constants were used...
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer





define() gives you a literal copy of the value of the second parameter. In
this case your second parameter is __LINE__. The value of __LINE__
represents the current line number of the define statement. Once defined the
value assigned remains constant, irrespective of whether or not __LINE__
changes later on. You could 'redefine' the value - but you'd just get the
line number of the redefinition.

You really want a reference (pointer) to the __LINE__ constant, however, you
can't have references to constants. So, you just plain can't do it.

If you think about it, this is a pain only with the parser 'constants', you
wouldn't need a reference to your own constants as they never change.




-----Original Message-----
From: Christian Dechery [mailto:[EMAIL PROTECTED]]
Sent: 28 February 2001 16:13
To: [EMAIL PROTECTED]
Subject: [PHP] redefine constants


why can't I redefine __LINE__?

like define(LN,__LINE__);

it's a rather big constant to put in code to generate my error messages, I
was thinking more of L, or LN... but if I redefine it, it assumes the value
of de redefine() line of code... so it's not really redefining a constant
it's only atributing LN the value of __LINE__...

and in the manual I saw examples where redefining constants were used...
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


--
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]







consants must be scalar, they can not be references.

http://php.net/manual/en/function.define.php

what your looking for is this.

<?php

    define(LN, &__LINE__);

?>

this is invalid syntax though, I dont know how to answer your question though, sorry 
:(


-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]




"Christian Dechery" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
why can't I redefine __LINE__?

like define(LN,__LINE__);

it's a rather big constant to put in code to generate my error messages, I 
was thinking more of L, or LN... but if I redefine it, it assumes the value 
of de redefine() line of code... so it's not really redefining a constant 
it's only atributing LN the value of __LINE__...

and in the manual I saw examples where redefining constants were used...
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
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]





Can't I change the default value for error type in user_error or trigger_error?

I wanted to echo an error everytime a query failed because of syntax errors 
so I'd to something like:

$q="select * from bogustable";
mysql_query($q) or trigger_error(mysql_error()." in ".$q,E_USER_ERROR);
-----------------> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kinda BIG don't u think?


this would do exactly what I need when an query fails cuz of syntax error:
- echoes the error, the query and the line of code
- stop the execution of the script

I NEED all of those, and that E_USER_ERROR in every call is making that 
function call get huge. Isn't there a way I can't default it to that 
instead of E_USER_NOTICE (which doesn't really help)...
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer





php-general,

    Test. Please, ignore!

-- 
 Regards,
 Alex                          mailto:[EMAIL PROTECTED]

 May all your Internet Dreams come true!
 http://www.intellinetusa.com/






Has anyone every written a function in php to pluralize an english word,
particularly when searching a database?

function pluralize($word){
return array of pluralized words;
}

Any help would be appreciated.  Seems like their might be a nice regex
waiting to handle this?  Thanks!

Robert Zwink
http://zwink.levitate.org





I just noticed a problem with iPlanet...

Appearently once I got php working, then I tried geting things working on
multiple virtual domains.  So this is what happens. Using the standard
test.php <?php phpinfo(); ?>.

The script works from the root directory of each virtual domain.

What doesn't work is and directory's under the root directory.  basicly
returns a error message that says it cannot find the file, and that's due to
the fact that it's looking at the following line in the obj.conf file.  This
is for the main one.

Nametrans fn="document-root" root="/usr/netscape/server4/docs"

Then I change it to reflect it for the virtual domain and it works for that
virtual domain, but no others and then all of the sudden if there's anything
on the main page, ofcourse that doesn't work.

help.

evan




anyone using this class:

whats a good way to extact the address of who sent the mail and stick it in
a variable,in order
to reply?





Hi,

I am wondering about putenv().

I would like to set an environment variable in php and then have that
variable available to a Perl script.

I am doing something like this.

The php file:
<?
$myName = "carter";
putenv("A_NAME=$myName");
?>

Then in the Perl script:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print $ENV{'A_NAME'};
exit;

I think I may be misunderstanding how environment variables work.

Any thoughts?

Carter





Hello all,
I have a dynamic select box, according information in database, but I want to restrict 
a second select box with the choice made in the first select box, but my problem is 
that I only know the value of the first one after submit form. It is possible to know 
a choice of a select box without submited ?? 
T.Y.
Best Regards
Miguel Loureiro <[EMAIL PROTECTED] >




Mmhmm...onChange() event...it's javascript.  Go to webmonkey.com and search
for it.  They have a cute little tutorial about how to do that.  Good luck.

Jason

----- Original Message -----
From: Miguel Loureiro <[EMAIL PROTECTED]>
To: php-gen <[EMAIL PROTECTED]>
Sent: Wednesday, February 28, 2001 12:50 PM
Subject: [PHP] second select how???


Hello all,
I have a dynamic select box, according information in database, but I want
to restrict a second select box with the choice made in the first select
box, but my problem is that I only know the value of the first one after
submit form. It is possible to know a choice of a select box without
submited ??
T.Y.
Best Regards
Miguel Loureiro <[EMAIL PROTECTED] >






Not DreamWeaver specifically- but to make sure the problem is DreamWeaver and not 
something else, try connecting with a different webDAV client.

I can personally vouch for Goliath under Mac OS and DAVExplorer under x86 Linux 
(DAVExplorer requires you have the JRE installed- and that java is in your path. 
DAVExplorer also works on Wndows).

On Wednesday, February 28, 2001, at 07:59 PM, Joseph H Blythe wrote:

> Hello, 
>  
> Sorry if this is a little off topic but has anyone successfully used mod_dav with 
> dreamweaver 4.0, I have mod_dav setup but am having trouble connecting to it via 
> dreamweaver. 
>  
> If anyone has successfully used this could they email me privately, as I don't want 
>to waste 
> any more bandwidth on this list. 
>  
> Cheers, 
>  
> Joseph 
>  
> --  
> 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] 
>  
>  

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
Abriasoft Senior Developer

http://www.abriasoft.com/

(510)  623-9726x357
Fax: (510) 249-9125




sounds like a db prodblem, vs php. could be wrong. check your config file. for the max 
users.


-- 

 Chris Lee
 Mediawaveonline.com

 ph. 250.377.1095
 ph. 250.376.2690
 fx. 250.554.1120

 [EMAIL PROTECTED]

"Todd Cary" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I am having a very strange problem: PHP 4.0.4 on a NT 4 platform with
IIS 5 is only allowing one surfer to do a DB Select.  If the DB is busy
with the first user, the page is not available to other users.  And I
have no problems with Win 2K.

Am I missing something very obvious?

Todd

--
Todd Cary
Ariste Software
[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]





Among other articles, look at the COM functions in PHP4 article:
http://www.phpbuilder.com/columns/

Alain

On Wed, Feb 28, 2001 at 11:35:15AM +0100, Daniel Tryba wrote:
> On Mon, Feb 05, 2001 at 03:05:24PM -0500, Conover, Ryan wrote:
> > I have been trying the following example from the PHP developer's cookbook
> > and it keeps giving me the following error.
> > 
> > Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5
> > <? //line 1
> > $excel_handle = new COM("excel.application"); //line2
> > $excel_handle->Visible = false; //line3
> > $worksheet = $excel_handle->workbooks->add(); //line4
> > $worksheet->Cells(1,1)->value = "Name"; //line5
> > $worksheet->SaveAs("temp.xls"); //line6
> > $excel_handle->quit(); //line7
> > //line8
> > ?> //line9
> > 
> > Anyone that has Com and PHP experience help please
> 
> I didn't test it in PHP (only in wscript.exe), but it seems the example 
> is wrong. It should be (line 4 -> 4a, 4b):
> 
> excel_handle = new COM("Excel.Application"); //line2
> excel_handle.Visible = true; //line3
> workbook = excel_handle.Workbooks.Add(); //4a
> worksheet=workbook.WorkSheets.Add(); //4b
> worksheet.Cells(1,1).Value = "Name"; //line5
> worksheet.SaveAs("temp.xls"); //line6
> excel_handle.quit(); //line7
> 
> This seems to work.
> 
> 
> -- 
> PHP Windows 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]




Hi!
i want to when i click on a button, i execute some php syntax !
i also want to give a php variable to a javascript function
Thanks

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





       Hello everyone...  I've been developing a PHP app here for a while
now, and I have been encountering some most frustrating situations in which
something will work in IE but not Netscape.  Some of this seems to be IE's
allowances for sloppy coding... :)  But here's a new one.  I have a form,
that if you were to submit this form once, it will always retain the same
value.  I.E. I enter  a value, hit OK.  Then I press the back button.  Then
I enter a DIFFERENT value, and hit OK.  The SAME value is passed to the PHP
script!  I'm using the post method, and I haven't found a way to shake this
yet!  This is afflicting Netscape 4.7 and Netscape 6.  Driving me crazy....

      Thanks in advance,
      Michael


Reply via email to