php-general Digest 12 Nov 2001 11:19:44 -0000 Issue 990
Topics (messages 74193 through 74256):
Re: Help with array in class needed
74193 by: ArsenKirillov
74194 by: ArsenKirillov
Re: putting the result of PHP code into a string
74195 by: Rasmus Lerdorf
Stripping IMG tags
74196 by: Richard S. Crawford
74197 by: Martin Towell
74198 by: Richard S. Crawford
74233 by: _lallous
Re: How to use class methods in callback ?
74199 by: Papp Gyozo
pass javascript variable to php without submit or reload
74200 by: Phieu Huynh
74201 by: Richard S. Crawford
74202 by: Phieu Huynh
please tell me
74203 by: boonlert phokaow
74204 by: Rasmus Lerdorf
74205 by: Richard S. Crawford
74207 by: Jeff Gannaway
Get Unbelieveable Artwork At No Cost To You + A Free Shopping Spree
[ydgpv]
74206 by: unique_art_offer.publicist.com
emailing attachments
74208 by: Don
74212 by: Don
74215 by: Martin Towell
74216 by: Don
executing another php.script
74209 by: David Tod Sigafoos
74211 by: Richard S. Crawford
74217 by: Martin Towell
User authentication problem.
74210 by: CaMeL
php newbie - need advice
74213 by: Scott Dudley
74222 by: David Robley
possible safe mode bug with opendir() ?
74214 by: operator.superprivate.com
74219 by: Yasuo Ohgaki
74221 by: operator.superprivate.com
74226 by: Yasuo Ohgaki
how do the thing?
74218 by: Galkov Vladimir
74224 by: Martin Towell
PHP/MySQL Question
74220 by: Peter Brown
Save to Desktop
74223 by: Sharat Hegde
74240 by: Matt McClanahan
74247 by: Sharat Hegde
Question about using system call/gzip
74225 by: Joelmon2001.aol.com
74227 by: David Robley
74228 by: Joelmon2001.aol.com
74230 by: David Robley
Resetting ID in mySQL DB
74229 by: Thomas Edison Jr.
74231 by: Jack Dempsey
Login verification
74232 by: Ashley M. Kirchner
74235 by: Jack Dempsey
mail() w/ mailing lists
74234 by: _lallous
74236 by: Henrik Hansen
74253 by: DL Neil
74255 by: PHPGalaxy.com
Re: Everything between something becomes an array element
74237 by: ArsenKirillov
imap_mail_compose correct?
74238 by: Martin Gutbrod
Unix timestamp ?
74239 by: De Necker Henri
74241 by: _lallous
Login Verification - snag!
74242 by: Ashley M. Kirchner
74243 by: Morten Winkler Jørgensen
PHP/MySQL
74244 by: phantom
74245 by: Morten Winkler Jørgensen
74246 by: Richard Black
apache + ftp!
74248 by: Benjamin
74254 by: Daniel Masur
74256 by: PHPGalaxy.com
Re: Classes Question
74249 by: Paul - Zenith Tech Inc
74250 by: Paul - Zenith Tech Inc
74251 by: Paul - Zenith Tech Inc
Lotus Domino & PHP
74252 by: Richard Black
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]
----------------------------------------------------------------------
--- Begin Message ---
AK>but when I try to copy the array outside the class using a function that
AK>only does a return $this->$data, I only get one sub-array of the
AK>whole one.
AK>
AK>Any ideas?
AK>
AK>Thanks
AK>
AK>Alexander
AK>
AK>Code:
AK>
AK>class Adressen {
AK> var $connect; // database-handle
AK> var $daten = array(); // array for data
AK>
AK> // Constructor
AK> function Adressen($datenbank) {
AK> $this->$connect = $datenbank->getConnect();
Be carefull :-)
$this->connect = $datenbank->getConnect();
AK> }
AK>
AK> // read data from database
AK> function readData() {
AK> $this->$daten = array();
AK> $result = mysql_query("select * from adressen");
AK> while($data = mysql_fetch_array($result)) {
AK> extract($data);
AK> $this->$daten[$AdressenID] = array("strasse" => $Strasse,
AK>"plz" => $PLZ,
AK>"ort" => $Ort, "land" => $Land, "telefon" => $Telefon, "telefax" =>
AK>$Telefax, "email" => $Email);
AK> }
AK> }
AK>
AK> function getData() {
AK> return $this->$daten;
Be carefull :-))
AK> return $this->daten;
AK> }
AK>}
AK>
AK>
AK>
-------------------------------------------- Here is working sanple is u are
losen again
<?
/*I've written a class that reads a database into an array. This works fine,
but when I try to copy the array outside the class using a function that
only does a return $this->$data, I only get one sub-array of the whole one.
Any ideas?
Thanks
Alexander
Code:
*/
class Adressen {
var $conn_ect; // database-handle
var $daten; // array for data
// Constructor
function Adressen($datenbank)
{
$it=$datenbank->getConnect();
echo $this->connect = $it;
// $result = mysql_query("select * from mysql.db");
// if (!$result){echo "false result !";exit();}
// print_r( $result );
}
// read data from database
function readData()
{
echo $this->connect;
$this->$daten = array();
$result = mysql_query("select * from mysql.db");
while($data = mysql_fetch_array($result))
{
extract($data);
$this->daten[$Db] = array("database" => $Db, "host_name" => $Host);
echo $Db." - ".$Host," <br>";
echo $j++."<br>";
}
}
function getData()
{
return $this->daten;
}
}
class MySQL
{
var $con_id;
function MySQL($host="localhost")
{
$this->con_id=mysql_connect($host);
}
function getConnect()
{
return $this->con_id;
}
}
$mydb=new MySQL;
$adr =new Adressen($mydb);
$adr->readData();
echo "<pre>";
print_r($adr->getData());
echo "</pre>";
?>
--- End Message ---
--- Begin Message ---
AK>but when I try to copy the array outside the class using a function that
AK>only does a return $this->$data, I only get one sub-array of the
AK>whole one.
AK>
AK>Any ideas?
AK>
AK>Thanks
AK>
AK>Alexander
AK>
AK>Code:
AK>
AK>class Adressen {
AK> var $connect; // database-handle
AK> var $daten = array(); // array for data
AK>
AK> // Constructor
AK> function Adressen($datenbank) {
AK> $this->$connect = $datenbank->getConnect();
Be carefull :-)
$this->connect = $datenbank->getConnect();
AK> }
AK>
AK> // read data from database
AK> function readData() {
AK> $this->$daten = array();
AK> $result = mysql_query("select * from adressen");
AK> while($data = mysql_fetch_array($result)) {
AK> extract($data);
AK> $this->$daten[$AdressenID] = array("strasse" => $Strasse,
AK>"plz" => $PLZ,
AK>"ort" => $Ort, "land" => $Land, "telefon" => $Telefon, "telefax" =>
AK>$Telefax, "email" => $Email);
AK> }
AK> }
AK>
AK> function getData() {
AK> return $this->$daten;
Be carefull :-))
AK> return $this->daten;
AK> }
AK>}
AK>
AK>
AK>
-------------------------------------------- Here is working sanple is u are
losen again
<?
/*I've written a class that reads a database into an array. This works fine,
but when I try to copy the array outside the class using a function that
only does a return $this->$data, I only get one sub-array of the whole one.
Any ideas?
Thanks
Alexander
Code:
*/
class Adressen {
var $conn_ect; // database-handle
var $daten; // array for data
// Constructor
function Adressen($datenbank)
{
$it=$datenbank->getConnect();
echo $this->connect = $it;
// $result = mysql_query("select * from mysql.db");
// if (!$result){echo "false result !";exit();}
// print_r( $result );
}
// read data from database
function readData()
{
echo $this->connect;
$this->$daten = array();
$result = mysql_query("select * from mysql.db");
while($data = mysql_fetch_array($result))
{
extract($data);
$this->daten[$Db] = array("database" => $Db, "host_name" => $Host);
echo $Db." - ".$Host," <br>";
echo $j++."<br>";
}
}
function getData()
{
return $this->daten;
}
}
class MySQL
{
var $con_id;
function MySQL($host="localhost")
{
$this->con_id=mysql_connect($host);
}
function getConnect()
{
return $this->con_id;
}
}
$mydb=new MySQL;
$adr =new Adressen($mydb);
$adr->readData();
echo "<pre>";
print_r($adr->getData());
echo "</pre>";
?>
--- End Message ---
--- Begin Message ---
Well, you can't do it like that at all. Look at the output buffering
documentation in the manual. ie. php.net/ob_start
-Rasmus
On Mon, 12 Nov 2001, ArsenKirillov wrote:
> I have an parse error ...
> <?
> $val="test";
> $code = <<<ENDM echo "<b>$val</b>\n"; ENDM;
> ?>
>
> at line 3 :-(
>
> AK>-----Original Message-----
> AK>From: Morten Gjetanger [mailto:[EMAIL PROTECTED]]
> AK>Sent: Saturday, November 10, 2001 6:46 PM
> AK>To: [EMAIL PROTECTED]
> AK>Subject: Re: putting the result of PHP code into a string
> AK>
> AK>
> AK>Ok. To be a bit more precise. the $code part could be any php code, e.g.
> AK>
> AK>$code = <<<ENDM
> AK>
> AK>require_once("someFile.inc");
> AK>
> AK>$array1 = someFunc1($param1);
> AK>
> AK>foreach($array1 as $val) {
> AK> echo "<td>$val</td>\n";
> AK>}
> AK>
> AK>ENDM;
> AK>
> AK>regards
> AK>
> AK>Morten Gjetanger
> AK>
> AK>"Morten Gjetanger" <[EMAIL PROTECTED]> skrev i melding
> AK>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> AK>> I'm quite sure there is a simple solution to the problem bellow!
> AK>>
> AK>> I like to evaluate som PHP code, but I want the result to be
> AK>putted into a
> AK>> string.
> AK>>
> AK>> example:
> AK>>
> AK>> $var = "Test1";
> AK>> $code = "<td><?php echo $var1?></td>";
> AK>> $html = someFunction($code);
> AK>>
> AK>> After this i want $html to contain "<td>Test1</td>
> AK>>
> AK>> I've checked the eval function, but it just evaluates the code and just
> AK>> outputs the result. I really wants the output into a string!
> AK>>
> AK>> regards
> AK>>
> AK>> Morten Gjetanger
> AK>>
> AK>>
> AK>
> AK>
> AK>
>
>
>
--- End Message ---
--- Begin Message ---
All I need to do is strip out IMG tags from strings; I don't want to strip
out all of the HTML, just the IMG tags, so the strip_tags() function won't
be adequate.
I've tried
eregi_replace("<img[^$]>","",$string);
but that doesn't seem to do any good (though the regexp works fine in Perl).
Any thoughts?
Sliante,
Richard S. Crawford
http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is
invisible to the eye." --Antoine de Saint Exupéry
"Push the button, Max!"
--- End Message ---
--- Begin Message ---
does this work?
eregi_replace("<img[^>]*>","",$string);
-----Original Message-----
From: Richard S. Crawford [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 10:38 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Stripping IMG tags
All I need to do is strip out IMG tags from strings; I don't want to strip
out all of the HTML, just the IMG tags, so the strip_tags() function won't
be adequate.
I've tried
eregi_replace("<img[^$]>","",$string);
but that doesn't seem to do any good (though the regexp works fine in Perl).
Any thoughts?
Sliante,
Richard S. Crawford
http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is
invisible to the eye." --Antoine de Saint Exupéry
"Push the button, Max!"
--
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]
--- End Message ---
--- Begin Message ---
Like a charm! Thanks for the quick help.
At 03:38 PM 11/11/2001, Martin Towell wrote:
>does this work?
> eregi_replace("<img[^>]*>","",$string);
>
>-----Original Message-----
>From: Richard S. Crawford
>[<mailto:[EMAIL PROTECTED]>mailto:[EMAIL PROTECTED]]
>Sent: Monday, November 12, 2001 10:38 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Stripping IMG tags
>
>All I need to do is strip out IMG tags from strings; I don't want to strip
>out all of the HTML, just the IMG tags, so the strip_tags() function won't
>be adequate.
>
>I've tried
>
> eregi_replace("<img[^$]>","",$string);
>
>but that doesn't seem to do any good (though the regexp works fine in Perl).
>
>Any thoughts?
>
>
>Sliante,
>Richard S. Crawford
>
><http://www.mossroot.com>http://www.mossroot.com
>mailto:[EMAIL PROTECTED]
>AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford
>"It is only with the heart that we see rightly; what is essential is
>invisible to the eye." --Antoine de Saint Exupéry
>
>"Push the button, Max!"
>
>--
>PHP General Mailing List (<http://www.php.net/>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]
Sliante,
Richard S. Crawford
http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is
invisible to the eye." --Antoine de Saint Exupéry
"Push the button, Max!"
--- End Message ---
--- Begin Message ---
$string = preg_replace('/<img[^>]*>/si', '', $string);
"Richard S. Crawford" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
All I need to do is strip out IMG tags from strings; I don't want to strip
out all of the HTML, just the IMG tags, so the strip_tags() function won't
be adequate.
I've tried
eregi_replace("<img[^$]>","",$string);
but that doesn't seem to do any good (though the regexp works fine in Perl).
Any thoughts?
Sliante,
Richard S. Crawford
http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is
invisible to the eye." --Antoine de Saint Exupéry
"Push the button, Max!"
--- End Message ---
--- Begin Message ---
array_filter($array, array(&$object_variable, 'methodname'));
you can pass an array to 2nd argument which encapsulates the handling object
(above just a reference to it) and a string containing the name of callback
method.
----- Original Message -----
From: "Andrew Kirilenko" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Ravi Ranganathan" <[EMAIL PROTECTED]>
Sent: Sunday, November 11, 2001 8:05 PM
Subject: RE: [PHP] How to use class methods in callback ?
> Hello!
>
> Try to use $instance_name and $method_name variables and make such calls:
> $$instance_name->$method_name();
>
> Best regards,
> Andrew Kirilenko.
>
> > -----Original Message-----
> > From: Ravi Ranganathan [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, November 11, 2001 8:49 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] How to use class methods in callback ?
> >
> >
> > Hi,
> > Can I specify a class method as a callback when using
> > array_filter. I tried
> > "classname::methodname" and it gave a parser error. Is it supported ?
> >
> > Ravi
> >
> >
>
> --
> 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]
>
--- End Message ---
--- Begin Message ---
<script language=javascript>
function changebuilding (which) {
sel_var = which.selectedIndex
<?
$sql_query = "select distinct room
from general.room_info
where building='$variable' group by level asc";
$sql_result = mysql_query($sql_query) or die (" Can't execute the
query");
$i=0;
while ($row = mysql_fetch_array($result_sec_level))
print ("ar[".$i++."] = \"".$row[0]."\";\n");
?>
for (i=0; i < ar.length; i++) {
option = new Option(ar[i])
document.myform.room.options[i]=option
}
}
</script>
<body>
<form name=myform>
Building : <select name=building onchange=changebuilding(this) >
<option>1</option>
<option>2</option>
<option>3</option>
</select>
Room : <select name=room >
</select>
</form>
</body>
I can pass the variable in building to $variable by submit button
but I want to pass the sel_var variable to $variable and dynamic update
the content in room.
--
phil
--- End Message ---
--- Begin Message ---
You can't do that without reloading the page; the PHP is parsed but once as
the page is loaded. Once the page is loaded, it's up to the browser to
deal with, and PHP washes its hands of the page. So the only way to get
new content from a PHP script is to reload the page.
It is possible to update the list in a select form element dynamically
based on input from other JavaScript variables, but it has to be done
entirely in JavaScript; you need to load every value into your
changebuilding() function and rebuild the script from there. Check out
http://javascript.internet.com/forms/auto-drop-down.html
for an example of how you might be able to adjust the contents of a select
drop-down list dynamically in JavaScript.
At 04:04 PM 11/11/2001, Phieu Huynh wrote:
><script language=javascript>
>function changebuilding (which) {
> sel_var = which.selectedIndex
> <?
> $sql_query = "select distinct room
> from general.room_info
> where building='$variable' group by level asc";
>
> $sql_result = mysql_query($sql_query) or die (" Can't execute the
>query");
>
> $i=0;
> while ($row = mysql_fetch_array($result_sec_level))
> print ("ar[".$i++."] = \"".$row[0]."\";\n");
> ?>
> for (i=0; i < ar.length; i++) {
> option = new Option(ar[i])
> document.myform.room.options[i]=option
> }
>}
></script>
><body>
><form name=myform>
>Building : <select name=building onchange=changebuilding(this) >
> <option>1</option>
> <option>2</option>
> <option>3</option>
> </select>
>Room : <select name=room >
> </select>
></form>
></body>
>
>
>I can pass the variable in building to $variable by submit button
>but I want to pass the sel_var variable to $variable and dynamic update
>the content in room.
>
>--
>
>phil
>
>--
>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]
Sliante,
Richard S. Crawford
http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is
invisible to the eye." --Antoine de Saint Exupéry
"Push the button, Max!"
--- End Message ---
--- Begin Message ---
Hi Richard,
I can workaround the problem by using switch in changebuilding() JS
and assign
a number to $variable, but the program is too long if I have 10 or 20
options.
Another way that I can think of that is putting action=demo1.php in
the form
and using js to submit the form when I change the option.
I am ok with dynamic update content by using JS.
thank for your reply
"Richard S. Crawford" wrote:
>
> You can't do that without reloading the page; the PHP is parsed but once as
> the page is loaded. Once the page is loaded, it's up to the browser to
> deal with, and PHP washes its hands of the page. So the only way to get
> new content from a PHP script is to reload the page.
>
> It is possible to update the list in a select form element dynamically
> based on input from other JavaScript variables, but it has to be done
> entirely in JavaScript; you need to load every value into your
> changebuilding() function and rebuild the script from there. Check out
>
> http://javascript.internet.com/forms/auto-drop-down.html
>
> for an example of how you might be able to adjust the contents of a select
> drop-down list dynamically in JavaScript.
>
> At 04:04 PM 11/11/2001, Phieu Huynh wrote:
>
> ><script language=javascript>
> >function changebuilding (which) {
> > sel_var = which.selectedIndex
> > <?
> > $sql_query = "select distinct room
> > from general.room_info
> > where building='$variable' group by level asc";
> >
> > $sql_result = mysql_query($sql_query) or die (" Can't execute the
> >query");
> >
> > $i=0;
> > while ($row = mysql_fetch_array($result_sec_level))
> > print ("ar[".$i++."] = \"".$row[0]."\";\n");
> > ?>
> > for (i=0; i < ar.length; i++) {
> > option = new Option(ar[i])
> > document.myform.room.options[i]=option
> > }
> >}
> ></script>
> ><body>
> ><form name=myform>
> >Building : <select name=building onchange=changebuilding(this) >
> > <option>1</option>
> > <option>2</option>
> > <option>3</option>
> > </select>
> >Room : <select name=room >
> > </select>
> ></form>
> ></body>
> >
> >
> >I can pass the variable in building to $variable by submit button
> >but I want to pass the sel_var variable to $variable and dynamic update
> >the content in room.
> >
> >--
> >
> >phil
> >
--
--- End Message ---
--- Begin Message ---
- i post the string in to database it work;
but when i read from database i can't get the string
no more than 256 character why?
__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com
--- End Message ---
--- Begin Message ---
Because your DB schema defines that column to be a type that can only hold
256 chars, I bet. Read your database docs.
-Rasmus
On Sun, 11 Nov 2001, boonlert phokaow wrote:
> - i post the string in to database it work;
> but when i read from database i can't get the string
> no more than 256 character why?
>
>
> __________________________________________________
> Do You Yahoo!?
> Find a job, post your resume.
> http://careers.yahoo.com
>
>
--- End Message ---
--- Begin Message ---
What data type do you have in the database for the string? Certain
datatypes -- varchar, for example -- can't accept values more than 256
characters in length.
At 05:24 PM 11/11/2001, boonlert phokaow wrote:
>- i post the string in to database it work;
>but when i read from database i can't get the string
>no more than 256 character why?
Sliante,
Richard S. Crawford
http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is
invisible to the eye." --Antoine de Saint Exupéry
"Push the button, Max!"
--- End Message ---
--- Begin Message ---
At 05:24 PM 11/11/01 -0800, boonlert phokaow wrote:
>- i post the string in to database it work;
>but when i read from database i can't get the string
>no more than 256 character why?
If you're using MySQL, try setting your COLUMN TYPE to TEXT. That will
hold entire paragraphs fo text. If your use VCARCHAR you're limited to
around 255 or 256 characters.
-Jeff
--- End Message ---
--- Begin Message ---
Win Free Art - No Strings Attached
Special
Announcement & Free Offer
[ Promotion End: 11-13-2001 - U.S.
Residents Only ]
Young Exciting Art
Publisher Introduces New Cutting-Edge Art.
Art Publisher Introduces Fresh New
Art On The Internet!
Help us with our demographics testing for this incredible new
artwork and you'll get a $395.00 fine art canvas reproduction.
v Select From The Work Of 13 Artists...
v Over 600 Images To Choose From!
Absolutely NO STRINGS attached to
this offer!
All you do is include the requested information in an e-mail to the address below.
Your name
E-mail address
You will then be sent a
confirmation email and an invitation to visit our website. You will then select the
artist of your choice and your favorite piece!
Our promise to you: We
will never sell or rent your e-mail address to anyone.
Win
$395.00 Fine Art On Canvas
All you do is simply click the confirmation link below to send your request by e-mail.
Free Art Offer Request: Subscribe Link
To qualify, please make sure the exact words ArtOffer
are in the subject line and that your first and last name are in the message.
Address Removal Instructions
This advertisement provides all recipients with a no-cost
method to permanently remove thier e-mail address from future mailings.
To permanently remove your address click here to send your request.
--- End Message ---
--- Begin Message ---
Hi,
I have a class that allows me to send e-mail with an attachment. I have a form that
gathers information and I would like to allow the user to attach a file from his local
drive. Is there a PHP routine that allows the user to browse his drive and choose a
file?
Thanks,
Don
--- End Message ---
--- Begin Message ---
Hi,
I have a class that allows me to send e-mail with an attachment. I have a form that
gathers information and I would like to allow the user to attach a file from his local
drive. Is there a PHP routine that allows the user to browse his drive and choose a
file?
Thanks,
Don
--- End Message ---
--- Begin Message ---
it's HTML
<input type="file" name="">
-----Original Message-----
From: Don [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 3:37 PM
To: php
Subject: [PHP] emailing attachments
Hi,
I have a class that allows me to send e-mail with an attachment. I have a
form that gathers information and I would like to allow the user to attach a
file from his local drive. Is there a PHP routine that allows the user to
browse his drive and choose a file?
Thanks,
Don
--- End Message ---
--- Begin Message ---
Thanks. I already tried that which allowed me to browse but...
In my form, I have:
<input type="file" name="filename">
My form line is :
<form method="POST" name="apply" action="result.html" ENCTYPE="multipart/form-data">
Yet when I submit, and check the value of $filename in my PHP script, it is empty???
Therefore, the attachment in my mail class
ends up being empty and not sent!!!
> it's HTML
> <input type="file" name="">
>
> -----Original Message-----
> From: Don [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 12, 2001 3:37 PM
> To: php
> Subject: [PHP] emailing attachments
>
>
> Hi,
>
> I have a class that allows me to send e-mail with an attachment. I have a
> form that gathers information and I would like to allow the user to attach a
> file from his local drive. Is there a PHP routine that allows the user to
> browse his drive and choose a file?
>
> Thanks,
> Don
>
--- End Message ---
--- Begin Message ---
I am sure that I am just .. missing this ..
>From one script I wish to 'execute' another script. How is this done?
Setting a link and clicking is not the answer .. one script loops
through all the 'selected' rows and I want to 'execute' another script
for each row .. can this be done?
thanks
DSig
David
--- End Message ---
--- Begin Message ---
I'm not clear on what it is that you are trying to accomplish. Could you
restate your question, please?
At 08:43 PM 11/11/2001, David Tod Sigafoos wrote:
>I am sure that I am just .. missing this ..
>
> >From one script I wish to 'execute' another script. How is this done?
>
>Setting a link and clicking is not the answer .. one script loops
>through all the 'selected' rows and I want to 'execute' another script
>for each row .. can this be done?
>
>thanks
>
>DSig
>David
Sliante,
Richard S. Crawford
http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is
invisible to the eye." --Antoine de Saint Exupéry
"Push the button, Max!"
--- End Message ---
--- Begin Message ---
include "file";
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 3:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] executing another php.script
I am sure that I am just .. missing this ..
>From one script I wish to 'execute' another script. How is this done?
Setting a link and clicking is not the answer .. one script loops
through all the 'selected' rows and I want to 'execute' another script
for each row .. can this be done?
thanks
DSig
David
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I found a lot of scripts which regarding this user authentication.
But most of them are using mysql for their userlist
What if I got a server which have users in it, and I want to reuse the
same list of users and password in the server.
What should I do ?
Thankyou
Jian An
--- End Message ---
--- Begin Message ---
i'm new to php and need some advice. i have a site currently composed
of static pages generated via a c program. i want to convert the site
to php. the first page is an explorer-like table listing summary
information. when a user clicks on a row in this table, they're taken
to a detail page which presents the same information contained in the
table of the calling page as well as a verbose description and an
image. being a neophyte, my quandry is this... i have to select all of
the data from my database table to render the explorer-like table and
since i've already hit the database, don't want to have to do so again
for the detail page. is there a standard way to handle such a thing? i
don't want to depend on cookies or any client-side cacheing mechanism
but want to keep it server side. the hosting service supports only
php3.
any and all recomendations appreciated.
here's the site so you can see what i'm talking about:
http://your-az-realtor.com
--- End Message ---
--- Begin Message ---
On Mon, 12 Nov 2001 15:16, Scott Dudley wrote:
> i'm new to php and need some advice. i have a site currently composed
> of static pages generated via a c program. i want to convert the site
> to php. the first page is an explorer-like table listing summary
> information. when a user clicks on a row in this table, they're taken
> to a detail page which presents the same information contained in the
> table of the calling page as well as a verbose description and an
> image. being a neophyte, my quandry is this... i have to select all of
> the data from my database table to render the explorer-like table and
That's probably not exactly the case; there would presumably be no reason
why you couldn't just select those details you want for the summary table?
> since i've already hit the database, don't want to have to do so again
> for the detail page. is there a standard way to handle such a thing?
> i don't want to depend on cookies or any client-side cacheing mechanism
> but want to keep it server side. the hosting service supports only
> php3.
>
> any and all recomendations appreciated.
>
> here's the site so you can see what i'm talking about:
> http://your-az-realtor.com
Out of curiosity, why do you not want to make multiple accesses to the
DB? It would seem to be the easiest, and probably best way of dealing
with the problem.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Earth was interesting, and worth the money I paid for it.
--- End Message ---
--- Begin Message ---
When in "safe mode" shouldn't PHP check to see if the directory that is
about to be opened with a opendir() function has the same UID as the PHP
script itself, and fail if the UIDs do not match?
Because in PHP 4.0.6 with safe_mode "on", a PHP script owned by "fred" can
open any directory owned by any other UID, so long as the directory is
under the "open_basedir". This does not seem right to me, as it allows a
user in safe_mode to browse all the files on the entire webserver, looking
for things he might be able to peek at with a web browser.
Please advise whether this should be a bug report.
A.
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
>
> When in "safe mode" shouldn't PHP check to see if the directory that is
> about to be opened with a opendir() function has the same UID as the PHP
> script itself, and fail if the UIDs do not match?
From 4.1.0, optional GID check is available.
>
> Because in PHP 4.0.6 with safe_mode "on", a PHP script owned by "fred" can
> open any directory owned by any other UID, so long as the directory is
> under the "open_basedir". This does not seem right to me, as it allows a
> user in safe_mode to browse all the files on the entire webserver, looking
> for things he might be able to peek at with a web browser.
>
> Please advise whether this should be a bug report.
Take a look at lastest implementation see if you still have issues.
http://snaps.php.net/
--
Yasuo Ohgaki
--- End Message ---
--- Begin Message ---
But where user "fred" can opendir() a directory owned by user "mary"
(underneath the open_basedir), that action doesn't even pass a UID check
if the UIDs are supposed to match in safe mode in order for the action to
be allowed.
How would an optional GID check help?
A.
> > When in "safe mode" shouldn't PHP check to see if the directory that is
> > about to be opened with a opendir() function has the same UID as the PHP
> > script itself, and fail if the UIDs do not match?
>
>
> From 4.1.0, optional GID check is available.
>
> Take a look at lastest implementation see if you still have issues.
>
> http://snaps.php.net/
>
> --
> Yasuo Ohgaki
>
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
> But where user "fred" can opendir() a directory owned by user "mary"
> (underneath the open_basedir), that action doesn't even pass a UID check
> if the UIDs are supposed to match in safe mode in order for the action to
> be allowed.
>
> How would an optional GID check help?
>
It may, it may not. It works like user/group permission as you
know. I don't know what you want to protect :)
Do you mean a script with "opendir()" shouldn't allow openning any
directory under "open_basedir" if UID does not match?
I think it should be allowed. It's perfectly valid to me.
What if directory is owned by other user, but there is files owned
by the user. Would you like to disallow to list directory? I guess
not.
You can protect file basis, why do you need other protection for
directories under open_basedir? Do you have good reason for this?
--
Yasuo Ohgaki
>
>
>>>When in "safe mode" shouldn't PHP check to see if the directory that is
>>>about to be opened with a opendir() function has the same UID as the PHP
>>>script itself, and fail if the UIDs do not match?
>>>
>>
>> From 4.1.0, optional GID check is available.
>>
>>Take a look at lastest implementation see if you still have issues.
>>
>>http://snaps.php.net/
>>
>>--
>>Yasuo Ohgaki
>>
>>
>
>
--- End Message ---
--- Begin Message ---
Good time of a day!
well... as for me the construction...
switch($action)
{
case ...
..........
}
...is not very elegant when number of cases over 40-60 or more and the only
thing they must do is start one function (often with the same name). for
example:
case 'add_user_form':
{
show_add_user_form();
break;
}
more interesting is to create txt file with records like:
add_user_form>show_add_user_form()
add_user_recoder>add_user_recoder()
.......
So read "show_add_user_form()" is not a problem but how tell PHP that this
is a name of function to start but a simple text string? ...
P/S: I know about reading php manual ;-) may be in an hour or two I'll get
answer on myself but may be somebody can answer qwicker? ;-)
Thancks!
Vladimr.
--- End Message ---
--- Begin Message ---
once you have read in the file and parsed it up, all you need to do then is
to find the correct "string" to execute and call it using :
eval($string);
happy coding
Martin T
-----Original Message-----
From: Galkov Vladimir [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 4:12 PM
To: [EMAIL PROTECTED]
Subject: [PHP] how do the thing?
Good time of a day!
well... as for me the construction...
switch($action)
{
case ...
..........
}
...is not very elegant when number of cases over 40-60 or more and the only
thing they must do is start one function (often with the same name). for
example:
case 'add_user_form':
{
show_add_user_form();
break;
}
more interesting is to create txt file with records like:
add_user_form>show_add_user_form()
add_user_recoder>add_user_recoder()
.......
So read "show_add_user_form()" is not a problem but how tell PHP that this
is a name of function to start but a simple text string? ...
P/S: I know about reading php manual ;-) may be in an hour or two I'll get
answer on myself but may be somebody can answer qwicker? ;-)
Thancks!
Vladimr.
--
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]
--- End Message ---
--- Begin Message ---
HI,
New to PHP/MySQL,
I was wondering if this was possible.
I have a users database with an auto-incremented userID field.
I have another message database (it's a message board database) - one of
the fields is a TEXT field with userIDs separated by carriage returns;
eg; if on one record userID 2 and userID 4 have both viewd that record,
the data in that field will look as follows:
2
4
I want to construct a SQL query for every user that logs in (I am
storing their userID as a session variable) so that I can filter out any
messages where a user has already viewed that record. So in the above
example that record should be filtered out if user 2 or user 4 has
viewed the record.
The query I constructed is:
SELECT * FROM messages WHERE userID != '$userid'
But this will not filter out any records like the one above where the
userID in the message database is separaed by carriage returns as above
(ie; it won't filter out messages for user 2 or user 4).
Hope this makes sense
Peter
--- End Message ---
--- Begin Message ---
Hello,
I need to capture the contents of a Form into a text file format and
automatically allow the user to Save the file to his desktop.
Here is what I am intending to do:
* Capture the form contents and save to a temporary file. This works fine.
* Provide some method of the user automatically downloading this. How do I
get this download to happen?
I want the screen which says "Open File or Save" to come up and then the
user can basically save to his desktop.
Can anyone help and suggest how do get the Form contents saved to the
Desktop?
Thanks for your help.
With Regards,
Sharat
*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************
--- End Message ---
--- Begin Message ---
On Mon, Nov 12, 2001 at 11:14:04AM +0530, Sharat Hegde wrote:
> Hello,
>
> I need to capture the contents of a Form into a text file format and
> automatically allow the user to Save the file to his desktop.
>
> Here is what I am intending to do:
> * Capture the form contents and save to a temporary file. This works fine.
> * Provide some method of the user automatically downloading this. How do I
> get this download to happen?
>
> I want the screen which says "Open File or Save" to come up and then the
> user can basically save to his desktop.
It's not even necessary to save the form data to a file on the server
if you're just going to remove it after the user downloads the text
file. The key to this is knowing the proper HTTP headers to send, to
inform the browser that it should download a file. Then simply print
the desired form data to stdout, and it'll be fed into the file that
the user saves.
For example:
<?
if ($action == 'Get Text File')
{
// Tell the browser to display a 'save file' dialog
Header('Content-Type: application/octet-stream');
Header('Content-Disposition: attachment; filename="formdata.txt"');
// Print the text to be sent as formdata.txt
echo "First text field: $firstfield\n";
echo "Second text field: $secondfield\n";
exit;
}
?>
<form method="post" action="<?= $PHP_SELF ?>">
First: <input type="text" name="firstfield"><br>
Seond: <input type="text" name="secondfield"><br>
<input type="submit" name="action" value="Get Text File">
</form>
Here, the form takes in two text strings, and offers them to the
browser as a file.
Matt
--- End Message ---
--- Begin Message ---
Hi Matt,
Thanks. That was very useful and it worked like a gem!
Three cheers to HTTP headers. Where do you get a simplified version of the
HTTP Header documentation - The W3C specs do not look like interesting
reading.
Regards,
Sharat Hegde
Phone: 6560360 Ext 4680
-----Original Message-----
From: Matt McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 2:25 PM
To: Sharat Hegde
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Save to Desktop
On Mon, Nov 12, 2001 at 11:14:04AM +0530, Sharat Hegde wrote:
> Hello,
>
> I need to capture the contents of a Form into a text file format and
> automatically allow the user to Save the file to his desktop.
>
> Here is what I am intending to do:
> * Capture the form contents and save to a temporary file. This works fine.
> * Provide some method of the user automatically downloading this. How do I
> get this download to happen?
>
> I want the screen which says "Open File or Save" to come up and then the
> user can basically save to his desktop.
It's not even necessary to save the form data to a file on the server
if you're just going to remove it after the user downloads the text
file. The key to this is knowing the proper HTTP headers to send, to
inform the browser that it should download a file. Then simply print
the desired form data to stdout, and it'll be fed into the file that
the user saves.
For example:
<?
if ($action == 'Get Text File')
{
// Tell the browser to display a 'save file' dialog
Header('Content-Type: application/octet-stream');
Header('Content-Disposition: attachment; filename="formdata.txt"');
// Print the text to be sent as formdata.txt
echo "First text field: $firstfield\n";
echo "Second text field: $secondfield\n";
exit;
}
?>
<form method="post" action="<?= $PHP_SELF ?>">
First: <input type="text" name="firstfield"><br>
Seond: <input type="text" name="secondfield"><br>
<input type="submit" name="action" value="Get Text File">
</form>
Here, the form takes in two text strings, and offers them to the
browser as a file.
Matt
*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************
--- End Message ---
--- Begin Message ---
Hello. I just want to confirm that if I use a system call to
execute gzip, so I can zip a directory, the file can be
decompressed by windows users
for example, if I visit
bleh.php and it compresses a directory /directory
will that file that it creates, which I download, be
able to be unpacked using a 'winzip' for example on a windows machine?
Please insert "Yes" :)
Thanks
Joel
--- End Message ---
--- Begin Message ---
On Mon, 12 Nov 2001 16:28, [EMAIL PROTECTED] wrote:
> Hello. I just want to confirm that if I use a system call to
> execute gzip, so I can zip a directory, the file can be
> decompressed by windows users
>
> for example, if I visit
> bleh.php and it compresses a directory /directory
> will that file that it creates, which I download, be
> able to be unpacked using a 'winzip' for example on a windows machine?
>
> Please insert "Yes" :)
>
> Thanks
>
> Joel
Presumably you mean tar and gzip, because gzip only compresses single
files; in which case the answer is a qualified 'yes' - qualified because
earlier versions of Winzip (and no, I don't remember when it changed)
don't do compressed tar files.
I believe this info is also on the Winzip site.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Now go away or I shall taunt you a second time!
--- End Message ---
--- Begin Message ---
Gzip only compresses single files?
So what if I want to compress a directory and have it download when a page is
accessed?
I thought gzip would allow this. To compress a specified directory
when page.php is accessed. This is confusing. I tried the zend.com articles,
too confusing to grasp. I am a bit confused
Thanks for your time, I appreciate it
--- End Message ---
--- Begin Message ---
On Mon, 12 Nov 2001 16:51, [EMAIL PROTECTED] wrote:
> Gzip only compresses single files?
>
> So what if I want to compress a directory and have it download when a
> page is accessed?
>
> I thought gzip would allow this. To compress a specified directory
> when page.php is accessed. This is confusing. I tried the zend.com
> articles, too confusing to grasp. I am a bit confused
>
> Thanks for your time, I appreciate it
Hmm, think I spoke too soon. It appears that you can concatenate several
files into one gzipped file - have a look at man gzip. Tarring and
zipping is a common way of doing this, however. (Not tarring and
feathering, usually reserved for those who give wrong advice...)
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
I'm at the corner of Walk and Don't Walk.
--- End Message ---
--- Begin Message ---
Hi,
I'm facing a problem. I made a simple DB with simple
adding records in DB operation. I've even put up a
JavaScript validation of the Form from where you add
info. And yet, in the display table, there are many
many blank fields. I don't know how they are
generated.
The Adding of info form is at :
http://www.mjimm.com/index.php3?page=fanlist_add.php3
The display of records is at :
http://www.mjimm.com/fanlist_view.php3
Now the Display table also Displays the ID of the
Record. If i go in my mySQL Admnin, and delete the
rows with blank or duplicate records.. the ID also is
deleted but then is alway missing from the list. That
is, if i delete Row with ID 78, the next record feeded
will start from 79 and not 78. So there's gonne be
missing ID's from Records. Which i don't want. But
which has already happened. How can i correct it??
I want to reset the entire IDs to reflect the true
Number of records after i delete the Empty/Blank Rows
& Duplicate Record Rows!! How can i do that! Please
help!!!!!
Cheers & Glory,
Thomas edison jr.
=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
*******************************************
__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com
--- End Message ---
--- Begin Message ---
say you have 100 records.
you delete number 36.
your db will then be
...
34
35
37
38
...
correct?
after a delete, you could then say:
update table set id_num=id_num-1 where id > 36
and this would update all relevant records
-----Original Message-----
From: Thomas Edison Jr. [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 1:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Resetting ID in mySQL DB
Hi,
I'm facing a problem. I made a simple DB with simple
adding records in DB operation. I've even put up a
JavaScript validation of the Form from where you add
info. And yet, in the display table, there are many
many blank fields. I don't know how they are
generated.
The Adding of info form is at :
http://www.mjimm.com/index.php3?page=fanlist_add.php3
The display of records is at :
http://www.mjimm.com/fanlist_view.php3
Now the Display table also Displays the ID of the
Record. If i go in my mySQL Admnin, and delete the
rows with blank or duplicate records.. the ID also is
deleted but then is alway missing from the list. That
is, if i delete Row with ID 78, the next record feeded
will start from 79 and not 78. So there's gonne be
missing ID's from Records. Which i don't want. But
which has already happened. How can i correct it??
I want to reset the entire IDs to reflect the true
Number of records after i delete the Empty/Blank Rows
& Duplicate Record Rows!! How can i do that! Please
help!!!!!
Cheers & Glory,
Thomas edison jr.
=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
*******************************************
__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.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]
--- End Message ---
--- Begin Message ---
I want to make a login page in PHP, which will check the
user/password against the system's user/password file (in my case,
/etc/passwd and /etc/shadow.) With the machine running PAM, how can I
have PHP do this?
Keep in mind I don't need to modify anything, just verify the
login. Once verified, the script either continues on to doing other
things, or it bombs with a bad login page.
--
H | "Life is the art of drawing without an eraser." - John Gardner
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
Director of Internet Operations / SysAdmin . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave, #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
i would think you could just use crypt() to check the pass against what you
read in from the file
-----Original Message-----
From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 2:27 AM
To: PHP-General List
Subject: [PHP] Login verification
I want to make a login page in PHP, which will check the
user/password against the system's user/password file (in my case,
/etc/passwd and /etc/shadow.) With the machine running PAM, how can I
have PHP do this?
Keep in mind I don't need to modify anything, just verify the
login. Once verified, the script either continues on to doing other
things, or it bombs with a bad login page.
--
H | "Life is the art of drawing without an eraser." - John Gardner
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
Director of Internet Operations / SysAdmin . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave, #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--
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]
--- End Message ---
--- Begin Message ---
Hello,
Is is advisable that I mail lots of users from a database via one call to
mail() ?
Or else, how do you think I should split the list and send my mails?
Is there is a way to tell if the mail was returned because the email address
was invalid?
Thanks.
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] (_lallous) wrote:
> Hello,
>
> Is is advisable that I mail lots of users from a database via one call to
> mail() ?
why not make a loop and send to one email at a time. if you have over
1000 I would use something else than mail(), ex direct to smtp with sockets.
> Is there is a way to tell if the mail was returned because the email address
> was invalid?
you can do a syntax check on the email before sending, but AFAIK you
cant check if the email address exists on the domain you are sending
to (bacause not all mailsevers give that info / not all sysadmins want
to give that info).
--
Henrik Hansen
--- End Message ---
--- Begin Message ---
> > Is is advisable that I mail lots of users from a database via one call to
> > mail() ?
>
> why not make a loop and send to one email at a time. if you have over
> 1000 I would use something else than mail(), ex direct to smtp with sockets.
Henrik,
It is my opinion (too?) that mail() is difficult to use in a non-trivial application.
I have not
used/investigated sockets. I have had good success with a 'wrapper class/function set'
for mail(). I'm wondering
if I should also look at what you have proposed.
What does the extra effort of using sockets give you that using a decent wrapper for
mail() wouldn't? For
example do you get a 'msg sent' confirmation advice?
Does the socket-based connection require more than standard access (Id/pswd) to the
SMTP server? -is it both
Linux and Windows compatible? -is it both in-house server and ISP compatible?
Please advise,
=dn
(will appreciate good web references if it would save you time)
--- End Message ---
--- Begin Message ---
I just finished making a bulk emailer script with the mail() function. I would
probably recommend doing a loop,
sending one email at a time. Seems that way you're not putting too much pressure on it
at one time (if that makes
any sense). If you can find a decently-written smtp-class that uses the socket
directly, that would be much better.
Then, you're not limit to sending to one mail server, and there's greater flexibility
in the code; room to edit/add
code when needed, and you have the opportunity to log specific error messages if ya
need to. The only problem is
finding an SMTP class that'll work without too much editing, unless you have the
socket knowledge to write your own.
Whether or not the socket commands in PHP work well in Windows or not, I've not a
clue. I know there are some
Windows issues with the mail() command as well, and a few other PHP functions that
just don't work under Windows. =)
--
>From PHPGalaxy.com, earn up to $10 per order selling our PHP Scripts
and Software on your Site. http://www.phpgalaxy.com/aff/
Also, get a fast free POP3 email account, you @php.la at
http://www.phpgalaxy.com/search/
--- End Message ---
--- Begin Message ---
U question was :
Everything __between something___ becomes an array element
What is wrong with answer :
tag[1]= <td><table><tr><td>foo</td><td>bar</td></tr></table>
tag[2]= <td>foo</td><td>bar</td>
:-)))
AK>-----Original Message-----
AK>From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
AK>Sent: Tuesday, November 06, 2001 5:18 PM
AK>To: [EMAIL PROTECTED]
AK>Cc: [EMAIL PROTECTED]
AK>Subject: Re: [PHP] Everything between something becomes an array element
AK>
AK>
AK>But .... watch this...
AK><body>
AK><table><tr><td><table><tr><td>foo</td><td>bar</td></tr></table></
AK>tr></table>
AK><table><tr><td>foo bar</td></tr></table>
AK></body>
AK>
AK>I think that the return result will be
AK><tr><td><table><tr><td>foo</td><td>bar</td></tr></table></tr></table>
AK><table><tr><td>foo bar</td></tr>
AK>
AK>Why? Beacuse you set PCRE to be greedy. I think that there is no
AK>easy way to
AK>solve the problem with nested <tr> tags.
AK>
AK>Regards,
AK>
AK>Andrey Hristov
AK>Web Developer
AK>Icygen Corporation
AK>BUILDING SOLUTIONS
AK>http://www.icygen.com
AK>
AK>
AK>On Tuesday 06 November 2001 02:57 am, you wrote:
AK>> Here is right implememtation of all i see
AK>>
AK>> <?
AK>> $co=0;
AK>> $str="<tr><td><table><tr><td>foo</td><td>bar</td></tr></table></tr>";
AK>> echo "<pre>";
AK>> GetTagElements($str);
AK>> echo "</pre>";
AK>>
AK>> function GetTagElements($str)
AK>> {
AK>> global $co;
AK>> if ($co++){echo "tag[".($co-1)."]= ".htmlentities($str)."<br>";}
AK>>
AK>>
AK>>
AK>$how=preg_match_all('~\<tr\>(.*)<\/tr\>~',$str,$var_match,PREG_SE
AK>T_ORDER);
AK>> if ($how)
AK>> for ($i=1;$i<count($vr=$var_match[0]);$i++)
AK>> {
AK>> GetTagElements($vr[$i]);
AK>> }
AK>> else return 0;
AK>> }
AK>>
AK>> ?>
AK>>
AK>> > -----Original Message-----
AK>> > From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
AK>> > Sent: Monday, November 05, 2001 11:13 PM
AK>> > To: [EMAIL PROTECTED]
AK>> > Subject: Re: [PHP] Everything between something becomes an
AK>array element
AK>> >
AK>> >
AK>> > Sorry
AK>> >
AK>> > $how=preg_match_all('|\<tr>(.*?)</tr\>|',$the_big_string,$matches,
AK>> > PREG_SET_O
AK>> > RDER);
AK>> >
AK>> > is the correct I think
AK>> >
AK>> > Excuses
AK>> >
AK>> > On Monday 05 November 2001 08:57 am, you wrote:
AK>> > > It gives me an error....:
AK>> > >
AK>> > > Warning: Compilation failed: nothing to repeat at offset 7 in
AK>> > > c:\www\innocenti\teste.php on line 17
AK>> > >
AK>> > > I think that 'offset' is like a letter from the regex, but I
AK>> >
AK>> > could not fix
AK>> >
AK>> > > it...
AK>
AK>--
AK>
AK>--
AK>PHP General Mailing List (http://www.php.net/)
AK>To unsubscribe, e-mail: [EMAIL PROTECTED]
AK>For additional commands, e-mail: [EMAIL PROTECTED]
AK>To contact the list administrators, e-mail: [EMAIL PROTECTED]
AK>
--- End Message ---
--- Begin Message ---
Hello,
does anybody have experience with function imap_mail_compose() ??
There is an example in the documentation but in my
script the "description" doesn't work. So the filename of the attachement
is not avaliable.
And why starts the $body-Array with $body[1] and not with body[0] ?
Martin
The System:
PHP Version 4.0.4pl1;
IMAP Support enabled
IMAP c-Client Version 4.1
The Script:
...
// Anlagen
$n=count($HTTP_POST_FILES["email_anlage"]["tmp_name"]);
if ($n>1 || ($n==1 &&
file_exists($HTTP_POST_FILES["email_anlage"]["tmp_name"][0]))) {
// multipart!!!
$body[1]["type"]=TYPEMULTIPART;
$body[1]["subtype"]="mixed";
// Eingabetext
$body[2]["type"]=TYPETEXT;
$body[2]["subtype"]="plain";
$body[2]["description"]=$email_betreff;
$body[2]["contents.data"]=$email_text;
for ($i=0;$i<$n;$i++) {
$j=$i+3;
$regs=array();
if
(!ereg("(.*)/(.*)",$HTTP_POST_FILES["email_anlage"]["type"][$i],$regs)) {
$regs[1]=TYPEAPPLICATION;
$regs[2]="octet-stream";}
else {
$mime_type=array("TEXT"=>0, "MULTIPART"=>1, "MESSAGE"=>2,
"APPLICATION"=>3, "AUDIO"=>4, "IMAGE"=>5, "VIDEO"=>6, "OTHER"=>7);
$regs[1]=strtoupper($regs[1]);
$regs[1]=$mime_type["$regs[1]"];}
$body[$j]["description"]=$HTTP_POST_FILES["email_anlage"]["name"][$i];
$body[$j]["type"]=$regs[1];
$body[$j]["subtype"]=$regs[2];
$body[$j]["encoding"]=ENCBINARY;
$fp=fopen($HTTP_POST_FILES["email_anlage"]["tmp_name"][$i],"r");
$body[$j]["contents.data"]=fread($fp,filesize($HTTP_POST_FILES["email_anlage
"]["tmp_name"][$i]));
fclose($fp);}
$email_text=imap_mail_compose($envelope,$body);}
...
--- End Message ---
--- Begin Message ---
What is the max. size of a timestamp in vanchar value ?
I have seen it varies between 9 & 10.Will it be bigger than 10 or not ?
--- End Message ---
--- Begin Message ---
timestamp is an integer.
you can convert it to hex string via sprintf("%x", timestamp) and store it.
so if timestamp is a 32bit integer than it's hexadecimal representation will
take 8 characters.
"De Necker Henri" <[EMAIL PROTECTED]> wrote in message
3A8ED7A62794D311AA7700508B6164EC08DCA384@SCPTS01">news:3A8ED7A62794D311AA7700508B6164EC08DCA384@SCPTS01...
> What is the max. size of a timestamp in vanchar value ?
> I have seen it varies between 9 & 10.Will it be bigger than 10 or not ?
--- End Message ---
--- Begin Message ---
I just realized I jumped the gun on myself with my question
earlier. /etc/shadow isn't accessible by anyone but root. With that
said, how can I build a login page in PHP, running as the web server
daemon process, that can validate the user against the system's shadow
file? I hate to have to duplicate the file with different permissions
just so that the process can read it when it needs to.
--
H | "Life is the art of drawing without an eraser." - John Gardner
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
Director of Internet Operations / SysAdmin . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave, #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
I hate to have to duplicate the file with different permissions
AMK> just so that the process can read it when it needs to.
How about persorm a exec("su username password") grabbing the output?
Or something like that...
--
Kind regards,
Morten Winkler
--- End Message ---
--- Begin Message ---
New to this, trying to insert record into DB
$Query = "INSERT INTO table_name (Obj,Descrip) VALUES (keyboard,Device
to pound on when frustrated.)";
$Results = mysql_query($Query)
or die ("Query FAILED");
I keep getting Failed Query messages here, any idea why? PHP/MySQL
manuals do not have examples of how to do this. Thanks.
--- End Message ---
--- Begin Message ---
p> $Query = "INSERT INTO table_name (Obj,Descrip) VALUES (keyboard,Device
p> to pound on when frustrated.)";
p> $Results = mysql_query($Query)
p> or die ("Query FAILED");
need to embed your strings in "" like
$Query = "INSERT INTO table_name (Obj,Descrip) VALUES (\"keyboard\",\"Device
to pound on when frustrated.\")";
--
Kind regards,
Morten Winkler
--- End Message ---
--- Begin Message ---
Try putting single quotes around the strings:
$Query = "INSERT INTO table_name (Obj,Descrip) VALUES ('keyboard','Device
to pound on when frustrated.')";
Another thing that would be useful is to use the mysql_error() function in your die,
which will give a better indication of the problem
-----Original Message-----
From: phantom [SMTP:[EMAIL PROTECTED]]
Sent: 12 November 2001 09:50
To: [EMAIL PROTECTED]
Subject: [PHP] PHP/MySQL
New to this, trying to insert record into DB
$Query = "INSERT INTO table_name (Obj,Descrip) VALUES (keyboard,Device
to pound on when frustrated.)";
$Results = mysql_query($Query)
or die ("Query FAILED");
I keep getting Failed Query messages here, any idea why? PHP/MySQL
manuals do not have examples of how to do this. 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]
--- End Message ---
--- Begin Message ---
hey group!
i have apache installed on an win2000 machine and now i need an good and
stable ftp server! which one does i take!
thank you, ben
--- End Message ---
--- Begin Message ---
on win32 i like g6ftp server
"Benjamin" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hey group!
>
> i have apache installed on an win2000 machine and now i need an good and
> stable ftp server! which one does i take!
>
> thank you, ben
>
>
>
--- End Message ---
--- Begin Message ---
I personally would recommend Serv-U. Latest version seems greatly stable,
beautiful GUI, multiple domain support, I've been using Serv-U for quite a few
years now, and it's just *never* let me down! It could seriously benefit from
comand-line account creation, which I may invent on my own. =)
--
>From PHPGalaxy.com, earn up to $10 per order selling our PHP Scripts
and Software on your Site. http://www.phpgalaxy.com/aff/
Also, get a fast free POP3 email account, you @php.la at
http://www.phpgalaxy.com/search/
--- End Message ---
--- Begin Message ---
Thanks for the help Pierre
Paul
"Pierre-Yves" <[EMAIL PROTECTED]> wrote in message
00c001c16940$47db1c90$0100a8c0@py">news:00c001c16940$47db1c90$0100a8c0@py...
> Hello,
>
> what I would do is build the instance of your mysql class in the
constructor
> of the user class
>
> class User{
> var $db;
>
> // constructor
> function User(){
> $this->db = new Mysql(True);
> }
>
> // function that show how to use the Mysql class in the User class
> function foo(){
> $this->db->sql_query("SELECT user FROM banned_users");
> }
> } // end class
>
> hope it help,
> py
>
>
> ----- Original Message -----
> From: "Paul - Zenith Tech Inc" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, November 09, 2001 11:26 AM
> Subject: [PHP] Classes Question
>
>
> > I'm hoping somebody has the answer to this!
> >
> > I have 3 pages, one a normal PHP page, and 2 which are classes.
> >
> > One class, is a MySQL class I have written to connect/update users, etc
> > And the other is the manage users on the system.
> >
> > Is there a way I can get the "users" class to talk to the "mysql" class?
> >
> > I have this code to make a new instance of the MySQL class (the True
means
> > use persistent connections) and a new instance of the users class
> >
> > $db = new MySQL(True);
> > $users = new Users();
> >
> > I am then using this code to check the list of banned users
> >
> > $users->CheckBannedUser("spacetowns",$db);
> >
> > In the CheckBannedUser function, I have this
> >
> > $db->sql_query("SELECT user FROM banned_users");
> >
> > But that does not work, (it works fine when used from the standard PHP
> page)
> >
> > Is it not possible to do what I am trying to do?
> > Or am I doing it all wrong?
> >
> > Many thanks,
> > Paul
> >
> >
> >
> >
> > --
> > 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]
> >
>
--- End Message ---
--- Begin Message ---
I did have a look in the manual, but I got lost half way through!
I always think it's a good idea to describe the problem well :)
Thanks,
Paul
"Andreas Landmark" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Sun, Nov 11, 2001 at 06:09:40PM -0000, PaulC wrote:
> > I'm hoping somebody has the answer to this!
> >
> > I have 3 pages, one a normal PHP page, and 2 which are classes.
> >
> > One class, is a MySQL class I have written to connect/update users, etc
> > And the other is the manage users on the system.
> >
> > Is there a way I can get the "users" class to talk to the "mysql" class?
> >
>
> Inheritance, let the users class inherit the functions of the mysql
> class, that's the nicest and probably the best way to do it.
>
> Read up on OO in the manual to find out how to do inheritance in PHP.
>
> <removed a pretty good description of the problem>
>
> --
> Andreas D Landmark / noXtension
> Every solution breeds new problems.
--- End Message ---
--- Begin Message ---
Thanks Andrew... I basically tried that, but without the ampersand symbols.
I'll give that a try
Many thanks,
Paul
"Andrew Kirilenko" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hello!
>
> Try to declare CheckBannedUser as "function CheckBannedUser ($foo, &$db)"
> and call it "$users->CheckBannedUsers("foo", &$db)"
>
> Note ampersand symbols!
>
> Best regards,
> Andrew Kirilenko.
>
> > -----Original Message-----
> > From: PaulC [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, November 11, 2001 8:10 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Classes Question
> >
> >
> > I'm hoping somebody has the answer to this!
> >
> > I have 3 pages, one a normal PHP page, and 2 which are classes.
> >
> > One class, is a MySQL class I have written to connect/update users, etc
> > And the other is the manage users on the system.
> >
> > Is there a way I can get the "users" class to talk to the "mysql" class?
> >
> > I have this code to make a new instance of the MySQL class (the True
means
> > use persistent connections) and a new instance of the users class
> >
> > $db = new MySQL(True);
> > $users = new Users();
> >
> > I am then using this code to check the list of banned users
> >
> > $users->CheckBannedUser("spacetowns",$db);
> >
> > In the CheckBannedUser function, I have this
> >
> > $db->sql_query("SELECT user FROM banned_users");
> >
> > But that does not work, (it works fine when used from the
> > standard PHP page)
> >
> > Is it not possible to do what I am trying to do?
> > Or am I doing it all wrong?
> >
> > Many thanks,
> > Paul
> >
> >
> >
> > --
> > 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]
> >
>
--- End Message ---
--- Begin Message ---
Hi,
Can anyone tell me the latest on whether or not PHP can talk tirectly to
Lotus Domino/Notes???
I've had a look through the archive, and as far as I can see there was a
project to do this which was going to be made available at the start of the
year, but I've not seen any mention of this more recently, other than
questions.
Any info greatly appreciated, as we have a number of companies we are
talking to who are standardised on Lotus across their organisation...
Thanks,
Richy
--- End Message ---