http://www.php.net/mail includes an example of sending emails with multiple
attachments. For a more structured approach, try using Mail_Message @
http://opensource.visionp.biz/Mail_Message.120.0.html
Regards,
Erik Osterman
http://osterman.com/
alex at bartl dot net
28-Nov-2002 09:25
ould be not less than the number of
concurrent connections on the machine.
Well, that's that... Hope your PHP code is well written. :)
Erik Osterman
http://osterman.com/
-Original Message-
From: Boaz Yahav [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 12:55 PM
To: [EMAIL PR
"[$query]";
return mysql_query($query);
}
Usage:
$result = Query("INSERT INTO foo (var1, var2) VALUES( ?, ? )", $_POST[var1],
$_POST[var2]);
Regards,
Erik Osterman
http://osterman.com/
-Original Message-
From: Davy Campano [mailto:[EMAIL PROTECTED]
Sent:
remature
optimization is the root of all evil"
Best Regards,
Erik Osterman
http://osterman.com/
-Original Message-
From: jsWalter [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 21, 2003 4:12 PM
To: [EMAIL PROTECTED]
Subject: [PHP] advise on new class of mine
I'm in the pro
Sounds like what you want is the "in_array" function.
http://us4.php.net/manual/en/function.in-array.php
$cases = array( 5, 15, 30, 60, 90, 120 );
if ( in_array($count, $cases) ) {
EXECUTE PAGE
}
Regards,
Erik Osterman
http://osterman.com/
-Original Message-
F
code) in $file on line $line '$code'");
print "";
}
// Set up the callback
assert_options (ASSERT_CALLBACK, 'assert_callback');
Regards,
Erik Osterman
http://osterman.com/
-Original Message-
From: Robert Sossomon [mailto:[EMAIL PROTECTED]
contains the raw binary form of the file you wish to send.
Regards,
Erik Osterman
http://osterman.com/
-Original Message-
From: Stephen Craton [mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 5:07 PM
To: PHP List
Subject: [PHP] Downloading MySQL Files
I have a database which
case 'pdf': $mimeinfo = "application/pdf"; break;
case 'doc': $mimeinfo = "application/msword"; break;
default:$mimeinfo = "application/octet-stream";
}
Regards,
Erik Osterman
http://osterman.com/
-Original Message
Didn't know that it's RFC 1521 specific header and not valid in HTTP. =)
Thanks,
Erik Osterman
http://osterman.com/
-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 9:21 AM
To: Erik Osterman; [EMAIL PROTECTED];
[EMAIL
Hello,
I am having a problem testing out the use of cookies. I'm using a
tutorial from Wrox's "Beginning PHP4". It seems that I'm doing
everything correctly, but when I try to access the page in my browser, I
am not prompted as to whether or not I'd like to accept a cookie (which
is somethi
...
So the answer to no. 1 is now yes, but the cookie didn't get sent.
No. 2, I tried a sort of test (but the one you suggest gave me an error
message b/c it's trying to echo text in the headers or something).
No. 3, no errors.
I'm still reading the www.php.net page on setcookie().
hope this information serves someone else in the
future. Now I can go home (almost 8 PM!!).
-- Erik
On Wednesday, December 26, 2001, at 04:40 PM, Miles Thompson wrote:
> Erik,
>
> 1. Did you just try setting a cookie, plain, with no conditions.
> 2. Have you tested your conditions, or added
POST forms. But how should I
construct the variables for a "switch" statement? I'm left confused,
since these aren't written with the "$" prefix as most variables are...
Should it be:
case "_POST['insert']"
or should it be:
case
M, Ford, Mike [LSS] wrote:
>> -Original Message-
>> From: Erik Price [mailto:[EMAIL PROTECTED]]
>> Sent: 09 January 2002 19:22
>>
>> I'm trying to write my code in accordance with the PHP 4.1.0 security
>> advisory -- that is, I want to use the $_GET and $_POS
= "SELECT * FROM tablename WHERE
tablename.column=$criteria_integer";
But I thought that the $_GET variable could be used in the same way that
I historically used the simple variable name $criteria_integer .
Can anyone shed some light on how these predefined variables work in
this ins
query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);
echo $temprow["count"];
Yet, it works fine in the mysql client. Thus, I am led to believe that
PHP is not capable of constructing the same kinds of SQL statements that
can be constructed in the mysql client. Is this the case?
Erik
I tried that... I get the same error (same line and everything).
As a side note, I haven't ever had to quote the first argument in
mysql_query() before...
This is quite a conundrum, eh?
Erik
On Friday, January 11, 2002, at 04:25 AM, Kevin Stone wrote:
> Hmm I believe that the mys
On Thursday, January 10, 2002, at 04:39 PM, Rick Emery wrote:
> Show all your code. Did you open a connection to the MYSQL server? If
> so,
> show the code.
>
Okay, but I changed some personal info (that I know is definitely
correct):
Array Test
$tempsql = "SELECT COUNT(*)
Wait, my bad. Typo... all my fault.
I feel like an ass.
Erik
--
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]
nd echo each record's
contents (divisions.div_name and divisions.div_id) on each step. This
is to populate a box (listbox).
Any advice, anybody?
Thank you,
Erik
On Thursday, January 10, 2002, at 05:00 PM, Erik Price wrote:
> Wait, my bad. Typo... all my fault.
> I feel like an as
variables passed along in a querystring like this are available as
elements of the $_GET array, from what I understand, as an easy way to
send a variable (as opposed to the more lengthy "hidden form field"
method).
Erik
On Thursday, January 10, 2002, at 05:07 PM, Artie Ball wro
n't recognize whitespace. Technically, that newline is in
the SQL, not the PHP code itself.
-- Erik
--
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]
A quick question:
what function is used to remove an array element from an array? Like
array_pop(), except one by which I can refer to the element by its
associative index rather than just the last element of the array.
For more detail with what I'm doing, I have two versions of a
listbox
d, email went out and that is when you wrote your
second reply :). I have a better understanding of using associative
indexes from arrays in double-quoted statements now.
Erik
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e
h_array().
Does anyone know for sure if this is the case?
Erik
--
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]
constant are needed to perform non-string operations?
Thank you,
Erik
On Friday, January 11, 2002, at 01:06 PM, Philip Olson wrote:
>>> $sql = "SELECT * FROM tablename WHERE
>>> tablename.column=$_GET['criteria_integer']";
>>>
>>> but
EXCELLENT!
It worked perfect.
So $result can't be used twice -- I wonder if it somehow is altered by
the mysql_fetch_array() that is performed upon it.
Thanks Nick.
On Friday, January 11, 2002, at 05:23 PM, Nick Wilson wrote:
> I'll most likely be corrected (I just joined the list to brush u
Because, as a dope, I forget that you can invert IF statements like
that -- you're right, I'd rather do that than mess with the array.
Although the feedback on unset($arrayname['index']) was extremely useful
knowledge! Thank you everyone.
Erik
On Friday, January 11
here is correct (and I hope it is) then you
have helped me learn a fundamental element of the way PHP works, at
least with this command. I had not been thinking of $result as a
"container for results" before, rather as a "container for another
function for later use".
Aw
e output to be
$phone = "(555) 555-";
Can a regexp guru help me out? Thank you
Erik
--
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]
That looks cool -- is there anything like it that uses Tk or GTK?
On Monday, January 14, 2002, at 09:52 AM, Geoff Caplan wrote:
> Hi
>
>
>> TopStyle - http://www.bradsoft.com
>>
>
> I endorse that - it is an excellent product. And for casual use, they
> have a
> free version with nags.
>
> Geo
one know if it covers the Perl
syntax*? This seems like a good book to learn more.
Erik
* I don't know Perl
On Monday, January 14, 2002, at 11:11 AM, liljim wrote:
> I would use preg_replace to do this.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL
searchA'";
$result = mysql_query($query, $db);
while ($row = mysql_fetch_array($result)) {
$thingA = $row['thingA']; // the associative index is the column name
print $thingA;
}
Erik
--
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]
description of the process of
pulling a form variable from one of these arrays?
Thanks,
Erik
--
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]
LIKE '$lastname' OR
firstname LIKE '$firstname' OR age LIKE '$age' OR weight LIKE '$weight'";
Then it might do what you want. This will return the results when any
of the fields match, rather than ALL of them. But keep in mind that it
could very lik
ny additional security? If so, how?
Thank you all,
Erik
On Tuesday, January 15, 2002, at 03:55 PM, Johnson, Kirk wrote:
> Give this a read first, then come back if you still have questions ;)
>
> http://www.securereality.com.au/studyinscarlet.txt
>
> Kirk
>
>> --
Take notes.
On Tuesday, January 15, 2002, at 10:22 PM, Floyd Baker wrote:
>
>
>
> I'm stuck here too. Don't know that much in the first place except
> that I did get it together once. Apache/php4/mysql on win32... Now
> to upgrade it's all new again.
>
> I'm sure php config files are ok to
en.
Also make sure that you didn't just "cp php.ini-dist /usr/local/lib",
you also have to rename it "php.ini" (but I'm sure you did that).
Erik
On Wednesday, January 16, 2002, at 12:41 AM, Cary Mathews wrote:
> I am attempting to build a dynaminc module loada
f writing my
variables using predefined vars.
Erik
On Wednesday, January 16, 2002, at 11:38 AM, Johnson, Kirk wrote:
>> What is the purpose of the $_GET (or $HTTP_GET_VARS)
>> predefined variable? It seems that in the case of "get" variables,
>> malicious v
riable'];
$sql = "SELECT table.column FROM table WHERE criteria LIKE $variable";
or
$sql = "SELECT table.column FROM table WHERE criteria LIKE
${_POST['variable']}";
I was hoping someone could set me straight before I go off and awk these
sitewide changes
E
ile
the appropriate extension to be parsed by PHP, so that the data doesn't
get sent out if the page is requested (it gets turned into PHP code
which isn't passed along). But of course, if something damaged the PHP
pre-parser then you'd still be up a river.
Erik
On Wednesday, J
You mispelled the closing "" tag.
On Wednesday, January 16, 2002, at 04:33 PM, Nick Wilson wrote:
>
> * On 16-01-02 at 22:29
> * Richard said
>
>>
>> Hi there
>>
>> I just signed up for an account at Spaceports so I can play with PHP
> I
>> placed some PHP code in an HTML page and upl
to do some checking of the
variable before using it in a SQL statement. Thanks for the reminder.
Erik
On Wednesday, January 16, 2002, at 04:21 PM, Philip Hallstrom wrote:
> My advice would be to do it like this:
>
> $variable = $_POST['variable'];
> // some PHP code
This is a good one I just learned last week -- unset the variable. That
is,
unset($Arr[2]);
or
unset($Arr['cyanide']);
from what I understand, the discovery of this easy way to do this was
accidental. See the second annotation of "array_splice()" in the PHP
manual here for the details:
files associated with the
group "php". My web server runs as "nobody". Do I just add "nobody" to
the /etc/groups entry for the group "php" ? Or are you talking about a
more involved administrative setup...
Thank you
Erik
--
PHP General Mailing
files *AND* blocking access to them in httpd.conf?
Erik
--
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]
o something like that with JavaScript, possibly. Look
into a JavaScript tutorial somewhere or pick up a JavaScript book.
I don't know JavaScript but it would be something along the lines of
"onClick... do this", that's one of the commonly used JavaScript
features.
Erik
--
$TF_string = "Starscream, Megatron, Jetfire, Optimus Prime";
$TF_array = explode(", ", $TF_string);
print_r($TF_array);
(note the space after the comma in the first argument to "explode()",
this necessary to avoid the space being include in each element of the
I didn't know that either. Does this apply only when accessing strings
by character? Or are all conventional uses of brackets deprecated for
the purposes of arrays?
It doesn't say on that page
(http://www.php.net/manual/en/language.types.string.php , a bit more
than halfway dow
"or die" can be helpful but it can also occlude
valuable information.
Good luck I hope this works,
Erik
On Thursday, January 17, 2002, at 01:18 PM, Hawk wrote:
> Having a problem with this, I have a working login that supports
> multiple
> users, and I'm tryi
Yes thank you, I thought I would have heard about it before now if all
brackets were deprecated! ;) I bit, though, when I read that page you
linked to.
Thanks for the clarification though.
Erik
On Thursday, January 17, 2002, at 03:49 PM, Steve Edberg wrote:
> Sorry if I was less t
gned for future compatibility with any operating system. It can be
installed via Fink (http://fink.sourceforge.net) very easily, and is in
fact required by many Fink packages.
I must confess that I do not know much about it.
Erik
On Wednesday, January 16, 2002, at 08:01 PM, Richar
! Hindsight is
20/20, they say. I'm just starting out with programming, and I think
PHP is a great introduction.
Erik
On Thursday, January 17, 2002, at 07:15 PM, Robert Covell wrote:
> They are trying to prepare you for what "they believe" businesses want.
> What will gi
I thought that all of the source code for that book was available at
http://mysql.he.net/Downloads/Contrib/Examples
according to page 497.
Erik
On Thursday, January 17, 2002, at 08:48 PM, Mike C wrote:
> In electronic format that I can have? It is included in the book
> 'MyS
t thread), [] hasn't been
deprecated for all arrays, just the situations in which you want to
consider a string as an array of characters and are using a numeric
index to point to a specific character. Like so:
$string = "abcdefg";
echo $string{3};
(should print "d"
Check out phorum's source, I find it very well-documented and
educational.
I can't imagine how a collaborative effort can work with obfuscated
source...
On Saturday, January 19, 2002, at 05:03 AM, Geoff Caplan wrote:
> Some authors compound the problem by using cryptic variable names,
> thou
I'm not sure exactly what you need help with, but if you're getting any
errors, I'd recommend adding the resource identifier to your mysql_*
functions (usually ($db = mysql_connect(), but YMMV).
But I wonder if you were trying to do something else?
Erik
On Monday, January
a public web site.
>
> Your joking?
> No offence intended (don't you hate it when people say that?) but what
> on earth are you worried about 'performance issues' for.
>
> 10 users at a time?
>
> Sheeesh. :=)
I must have forgotten to mention that I'
ESSION['variableName'] the way you would any other variable.
Erik
PS: I'm not speaking definitively, just my own interpretation of the
manual.
On Wednesday, January 23, 2002, at 07:18 PM, Yasuo Ohgaki wrote:
> Jeff Sheltren wrote:
>>> What happens if you s
I just learned about a cool function -- "mysql_insert_id()".
You can read about it in the manual, but it sounds like it could be used
to get the AUTO_INCREMENT number from the database and you can then
append that number to your uploaded image file name.
Erik
On Thursday, Januar
On Thursday, January 24, 2002, at 05:01 PM, Lars Torben Wilson wrote:
> Robert, the $HTTP_*_VARS have, indeed, been deprecated, and this is
> noted in the manual.
Then it is safe to say that using $_* variables and -never- using
$HTTP_*_VARS variables is safe practice for forward-compatibili
ns in a creative
fashion
Good luck,
Erik
On Thursday, January 24, 2002, at 03:45 PM, [EMAIL PROTECTED]
wrote:
> Hello,
>
> I need to print out a list of directories, which is a piece of cake,
> just do something out of the manual:
> $handle = opendir('.');
>
In the face of tough economics, it's difficult to hold onto one's
ethics...
Not to start a flame war, but I really hope that the day doesn't come
that I'm forced to use a non-Unix platform for my development.
For now I have this luxury.
Erik
On Thursday, January 24
I could be wrong about this, but here goes:
Strings are in fact arrays. An array of characters. The code your
friend gave you manipulates this array in the same way that it would any
"normal" array. The only problem (not really a problem even) is that
when dealing with character-based arra
t are "optimized" according to the rules of relational
database SQL. It shouldn't matter to you where MySQL actually puts the
data, only whether or not your queries will return the results you want
in a timely fashion.
Erik
On Thursday, January 24, 2002, at 06:37 PM, Phil Schwarzman
upgrade)
Is there a resource that helps me weigh the cost-effectiveness of the
choices I made? (Note that the savings aren't as great as you might
think -- we already have Oracle and a hosting service that provides ASP,
but I wonder what the licenses would have cost us.)
Erik
--
Stupid. Animates a window that says "You should not have come here!" to
dance around the screen, then locks up the browser by having two new
windows call each other in a loop...
gotta love 'Force Quit' on Mac OS X. Or 'kill' in any other Unix. Or
'
n is met
specified immediately after the WHILE, as in:
while (x < $number_of_iterations) {
do some code
}
So what I'm wondering is,
Is it bad coding practice to make heavy use of "break" statements in
switch() flow control?
Thank you for your opinions,
Erik
--
PHP Gener
of everyone's day to read messages like this, even those of us with high
speed access. Don't you agree that if everyone took a few more words to
say what they mean, we'd actually save a bit of bandwidth in the long
run?
Cheers,
Erik
--
PHP General Mailing List (http://www.p
The training section is at http://mysql.com/training/index.html .
Erik
On Friday, January 25, 2002, at 05:36 PM, Ben Clumeck wrote:
> Is there any classes that anyone knows of for PHP & MySQL? I am just
> learning PHP and have bought a couple of books that have helped.
> However,
you intend to embed
PHP code in XML or XHTML, you will need to use the form to
conform to the XML. "
Better whip out that batch-file regex!! :)
Erik
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROT
e
this on what I've read in the PHP manual on using session variables
(there are some indented blockquotes that suggest this technique for
PHP4.1-using register_globals=off-turning PHP coders).
Erik
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAI
have register_globals = off in php.ini (4.1.0 on
Linux).
Thanks,
Erik
--
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]
hat used content from the latter. It was in
the papers.
Erik
--
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]
advanced
"remember" algorithm for what the user was doing at that point in their
session?
Erik
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addition
On Wednesday, January 30, 2002, at 02:19 PM, [EMAIL PROTECTED] wrote:
> Does anyone know of an organization who has built and maintains a web
> content management application for a large site?
>
>
Zope.
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTE
of the record
as the "value" attribute in .
Erik
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[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]
another file? Does the name of the page served not get
passed onto the include file, where $PHP_SELF is echoed?
Thanks for any insight you can give,
Erik
PS: I have an Apache directive that prevents any "*.inc" files from
being served, but that doesn't stop them from being par
e to their application?
I can write this code myself -- but I write pretty sloppy code and was
wondering if there is a neat, encapsulated algorithm that a lot of
people use because its effectiveness has been proven time and again. If
not, no worries, I look forward to writing it as best I can.
On Thursday, January 31, 2002, at 06:12 PM, Lars Torben Wilson wrote:
> On Thu, 2002-01-31 at 14:57, Erik Price wrote:
>> I'm running PHP 4.1.0 on LAMP w/register_globals=off
>
>
> Since register_globals is off,
ly set a directive in httpd.conf (assuming
you're using Apache) to deny any file serve request with the following
line:
Order allow,deny
Deny from all
Erik
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]
--
PHP General Mailing List (http:
other throughout the entire document. You can't have one entity with
double quotes and another one using singles.
Erik
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTE
XT field or something. (That's the less elegant, but easier way to do
it -- a harder way, but much better way, is to store the many-to-many
relationship into a foreign key table, but I'm still pondering whether
or not to go this route...)
Thanks!
Erik
Erik Price
Web Devel
201 - 300 of 847 matches
Mail list logo