do you have the image data in the database, or are all the images
stored in the filesystem?
it appears to be the latter... so i'd say either:
1) move the images into the webserver's document root,
or somewhere web-accessable.
2) symlink them permanently.
i can't understand why you'd wan
using the full pathname of the uptime binary should work.
although, there are issues on some servers that user
'nobody' (a common owner for apache) cannot get 'uptime'
information... so even if you get uptime to work correctly,
beware that it may return bogus data.
> -Original Message-
of course it can ;)
> -Original Message-
> From: Matthew Delmarter [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 01, 2001 9:13 PM
> To: PHP Mailing List
> Subject: [PHP] sending 5000+ emails - use PHP?
>
>
> I at looking at using PHP to send a monthly newsletter to 5000+ users who
> h
it's also a dangerously common misconception among
non-programmer manager-types that the more important
or essential a program is, the more lines of code
it will require
> -Original Message-
> From: Brad Hubbard [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] Pricing Advice Needed
>
confucious say:
typing it up in 20 minutes and then spending 2 hours
debugging is much worse than taking an hour to type it
up and spending only 20 minutes debugging ;)
> -Original Message-
> From: ReDucTor [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 02, 2001 3:31 AM
> To: [EMAIL PR
exec('passwd');
that's how you do it.
now figure out why it wont work. :)
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Moise Bertrand TACHAGO
> Sent: Monday, July 02, 2001 5:33 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to execute passwd
how did you install PHP? as CGI or apache module?
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 02, 2001 7:31 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How can i read php from browser??
>
>
> Hello,
> i have apache 1.3.19 configured wi
did you try viewing source to make sure that
the ACTION="" tag actually contains something?
AFAIR, MSIE will post to the same location if there's
no ACTION="", but netscape will not...
so it looks like your ACTION="" tag is empty, but
becuase IE and Netscape handle things differently,
you're ge
i dont know of a function to skip to the end of the
nearest ?>, and i suspect that there isn't one...
you can use other control func's to do what you need,
in the context that you're working in...
read up on: goto, break, continue, return
> -Original Message-
> From: Anil [mailto:[EMAI
ession->data['something'] = "someone"
// to count how many times this session was loaded
$session->data['counter']++;
// to save the $session->data[] array to the DB
$session->UpdateData();
// and if you use authentication on your site, and want
// to quickl
this is my guess at what's happening... i dont know
100% if that's why cookies aren't setting properly,
but here's an educated guess on my part:
probably becuase time() is seconds since 1970, and as
far as i understand, once it gets over 999,999,999
it will not work correctly becuase it will roll
does your browser prompt you to download the file when
you try and look at *.php files?
did you make the appropriate entires into the apache
httpd.conf and restart apache?
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 02, 2001 1:26 PM
> To
you could print "Set-Cookie: name=value; etc. etc. etc."
but setcookie(); is really what you want.
> -Original Message-
> From: Gonyou, Austin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 02, 2001 12:40 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Best Way to set cookies
>
>
> Id lik
nal Message-
> From: Richard Kurth [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 02, 2001 3:28 PM
> To: php
> Subject: Re[4]: [PHP] Problems with Netscape
>
>
> Hello scott,
> You are right the Action tag is empty in Netscape but in IE it is in
> there. How come it puts
Here's a little function i use to traverse an array
of arbitrary complexity... it uses recursion.
function array_traverse ($ary, $b=array()) {
while ( list($k,$v) = each($ary) ) {
print (join("", $b)) . "$k = $v\n";
array_push($b, "\t");
if ( is_array($ary[$k]) ) {
July 02, 2001 4:26 PM
> To: scott [gts]; php
> Subject: Re: [PHP] session handler class
>
>
> Hi Scott,
>
> I'd love to see the class you made but couldn't find a link in your email.
> Could you let me know where to find it?
>
> Thanks :)
>
> Aral
>
you will probably need to use two programs to
properly configure your linux box for networking
you have to configure a default gateway to tell the
linux networking stuff how to get out to the internet.
read the man pages on 'route' and 'ifconfig', the
binaries should be here:
/sbin/route
/
ok, grab all the files in this directory:
http://furt.com/php/session/
** read the "readme.txt" file
> -Original Message-
> From: Joe Rice [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] session handler class
>
> i would love to see this too, i think it was stripped.
>
> thanks,
> joe
you could either:
1) re-install apache with PHP as a module
2) install PHP as CGI and leave apache alone
if you're new to linux, and the box is not a production
machine, i highly reccomend option #2...
if apache ain't broke, dont fix it ;)
> -Original Message-
> From: Juan Pablo Rivera
try using "safe_mysqld &"
if 'mysqld' is not in your 'ps' list, then the
daemon is not running, and you cannot connect to it.
(check the mysql error logs for possible reasons)
> -Original Message-
> From: Daniel Guerrier [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 02, 2001 10:38 PM
>
try: fopen('http://server.com/index.php');
or you could probably grab the output of
'ping server.com' (assuming server.com accepts pings)
> -Original Message-
> From: Vikram Vaswani [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 03, 2001 1:48 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP
it might help.
it also helps to scour the configure output, looking
for all the lines that contain "sybase", becuase sometimes
even if you ask configure to use something, it might
not be properly found... and configure might spew out
a "sybase support ... no" in the configure output.
i r
from the shell:
mysql -u[username] -p[password] [database] < dumb.sql
> -Original Message-
> From: Roman [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 03, 2001 3:43 AM
> To: Php-General
> Subject: [PHP] Mysql
>
>
> How to run mysql batch program im mysql terminal.
> for example in fo
for a production machine, i'd say that compiling from
sources should always be the first option.
rpm's are great for ease of maintenence and simplicity
of intallation, but are not flexible at all.
sources are usually a tiny bit more complicated,
becuase you've got to figure out what to tell 'co
instead of giving them unique names, put them all into
a single array:
or, to automatically number them:
this way, you can deal only with $p[...]
instead of $p101, $p202, $p203
> -Original Message-
> From: Michael Benbow [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 03, 2001 5:
use split();
> -Original Message-
> From: AJDIN BRANDIC [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 03, 2001 6:10 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] search
>
>
> Hi all
>
> I've got search facility (php-mysql) which is very simple. If i search
> for 'dog' it will find an
that's stanard array behaviour...
$Info contains two elements,
$Info[0] and $Info[1]
$Info[0] contains four elements,
$Info[0][0], $Info[0][1], $Info[0][2], $Info[0][3]
try this function on your $Info variable to
see what it contains: array_traverse($Info);
func
does anyone know any good places to look for detailed
information about PHP's serialize(), unserialize()
(besides the PHP sources, becuase i'm already going
thru them)
i want to write serialize() and unserialize() in perl
so that arrays (no objects or references yet) can be
read/written by both P
From: Alexander Wagner [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 03, 2001 1:46 PM
> To: scott [gts]; php
> Subject: Re: [PHP] php serialize
>
>
> scott [gts] wrote:
> > i want to write serialize() and unserialize() in perl
> > so that arrays (no objects or refer
i've been working on porting the functionality of
PHP's serialize() and unserialize() functions that
will turn an array/hash into a simple string.
so far, i've got serialize() working in perl...
i attached the files, but you can also get them at:
http://furt.com/code/serialize/
if anyone feel
L PROTECTED]
> Subject: RE: [PHP] Fatal Error: Call to undefined function:
> sybase_connect() in
>
>
> hi Scott,
>
> i've tried below by deleting the old config.cache then run
> ./configure -with-apxs=/usr/sbin/apxs -with-sybase=/opt/sybase
> i am still getting the m
check the browser cache settings.
for some bizarre reason, almost every browser i've seen
has the default option set to "cache everything and never
look for updates"
> -Original Message-
> From: David OBrien [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] Something weird
>
>
> Sorry...
>
maybe it's just me, but caches drive me nuts...
i know... but IMO, i'll take a slight performance
hit any day to make sure i get the most recent page...
> -Original Message-
> From: Inércia Sensorial [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] Something weird
>
> > for some bizarre r
you could also use this:
function is_alphanum($data) {
return preg_match('/^\w+$/', $data);
}
> -Original Message-
> From: Steve Werby [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 06, 2001 3:32 PM
> To: John Monfort; [EMAIL PROTECTED]
> Subject: Re: [PHP] is_alpha_numeric ?
>
>
>
try using assoc. arrays also...
they're much nicer to deal with ;)
> -Original Message-
> From: James Atkinson [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 06, 2001 4:20 PM
> To: Chris Anderson; [EMAIL PROTECTED]
> Subject: RE: [PHP] Creating a Variable with the Name of a string
>
>
even when i had 28.8, i'd always turn the cache off
... a cache isnt a feature, it's a bug. :)
i wish everybody did the same... i get calls every once
in a while from clients asking "why isnt our page updated"
or "why doesnt this work" 9 times out of 10,
it's their browsers showing them outda
you could use a simple assoc. array for all the user's information,
and store that serialized in the database rather than serialize
the entire object.
that way, you'd have to store less information in the DB,
and wouldnt have to worry about breaking any of your code
in the future (or the object b
this also works:
but the way you have it currently written is perfectly OK.
it seems as if the problem is with your variable not being
set, rather than with your PHP code.
try explicitly setting the variable a few lines above
the output of the INPUT field
blah blah blah
PS: is the output ha
i just read an article in 2600 yesterday about supposed
PHP/CGI vulnerabilities. anyone else catch it?
personally, when i read the article, i started chuckling,
becuase the supposed "vulnerability" is not with PHP or
any particular language, but with shoddy "secure"
programming practises (which
do you have shell access, and do they have the CGI version of PHP?
you could always try running it from the command line
if you have access
> -Original Message-
> From: mike cullerton [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 10:25 AM
> To: [EMAIL PROTECTED]
> Subject: Re:
i dont quite think i understand the question, but if you
want to fetch results as an array with mysql, do this:
$result = mysql_query(" sql ");
mysql_fetch_array($result);
> -Original Message-
> From: Chris Oxenreider [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 12:39
you mean output the name of the variable??
what are you trying to do with that?
> -Original Message-
> From: Dallas K. [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 4:04 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Name of an array???
> Importance: High
>
>
> I need to echo t
i cannot seem to find any function that's similar to
perl's "caller()" function - to get information about the
file/function that is calling the current function.
for example, the test() function is called from scott.php
scott.php
Hello there
test.php
function test() {
without passing in
dont use --with-apxs or --with-apache
./configure --my-options
make
make test
make install
that should do it.
> -Original Message-
> From: Tyler Longren [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 3:07 PM
> To: Kevin Pratt; [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP as a sh
i wrote a little subroutine to make a directory full of
images into thumbnails...
it'll make thumbnail images of a specified height and width
and properly resize the original image to preserve the
height to width ratio.
the syntax of make_thumbs() is this:
make_thumbs($imagedir, $thumbsdir, $siz
try putting an .htaccess file into that directory.
or (as someone else already suggested) tell apache
to disallow access to *.inc files (or to the entire
directory)
> -Original Message-
> From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] how to hide dbconnect file if
Has anybody heard if this will affect PHP in any way?
Copied from the "Unix Guru mailing list":
-=-=-=-=-=-=-=-=-=-=-=-
The unix time() value becomes
10 digits for the first time on
Sun Sep 9 01:46:40 2001
For the first time in modern
computer history, the timestamp
will be something besid
if you dont specify an expiration time, the cookie
will hang around in memory until the browser is
closed... even if it's an empty cookie. (AFAIK)
if you really want it deleted, when the user "logs out"
setcookie("membership", "", time()-1);
that'll set the expire time to one second in the past,
of course ;)
try this method:
link to the counter with an IMG from your page
have counter.php increment a log file and
output an image showing the current number
of hits that "pagename" has gotten, so that
the IMG SRC will be digits.
(although, this is like reinventing the wheel,
there are pl
you should change the form field names to
$Children_Last[1], $Children_Last[2]
instead of hardcoding $Children_Last1
to make iteration thru the form easier
and handling of the data easier...
you can handle it all like this:
$Number_Children = 5;
$i = $Number_Children;
while ($i--) {
i
of
HTML you give it...
> -Original Message-
> From: david jarvis [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 11, 2001 12:54 PM
> To: scott [gts]
> Subject: Re: [PHP] Wierd cookie behiavor
>
>
> hmm, still no luck. The problem isnt that the cookie in in memory, the
&
you can't.
you have to write handler code to read in the
information being passed to the script and
properly execute a function.
(if anyone could arbitrarily execute any function
they wanted just by passing in the function name,
havoc would be wreaked on PHP programs everywhere :)
> -Origin
i agree that putting it all into one file is
usually bad form, but for small sites that dont
change much, it's usually OK to do something like:
file.php?page=Main
file.php?page=News
file.php?page=Contact
anything above 5-10 pages probably requires a
separate-page-per-section or fusebox-style de
well... ahem... netscape 4.x is 1996-97 technology.
4-5 years since the last major release of netscape
is an eternity of internet time in those
years, microsoft has been pouring money and time
into their browser no duh it kicks the crap
outta netscape 4.x :)
> -Original Message
personally, that's what i would do.
dealing with arrays usually makes the code a
lot cleaner and easier to follow than using
awkward constructs like ${$C_Last}{$i}
and besides, if you ever wanted to expand your
code, you could easily pass the entire array
to a function like so: children( $C_La
or throw in the needed number of closing tags
at the end of that specific message...
> -Original Message-
> From: Matthew Luchak [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 11, 2001 2:09 PM
> To: php php
> Subject: RE: [PHP] HTML tags in database fields
>
>
>
> sure. Quick and
this is like the last post on form submissions with
individually numbered elements...
if you can use an array, you should... it'll
make things easier for you in the long run.
> -Original Message-
> From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 11, 2001 2:15 PM
> To
making them relative is probably the best option
for portability and maintainability...
that way, you can change the underlying directory
structure and not have to change any of the actual
code... it's great if you ever have to change
servers, or if the directory structure undergoes
any structura
how do you have the data stored?
by ID number?
if you have it stored by ID number, just
put next/back links something like this:
0)? $id-1 : 0 );
$next = (($id<$max)? $id+1 : $max );
?>
previous
next
> -Original Message-
> From: Devin Atencio [mailto:[EMAIL PROTECTED]]
> Sent: Wednes
nal Message-
> From: Matthew Loff [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 11, 2001 3:59 PM
> To: 'scott [gts]'; 'php'
> Subject: RE: [PHP] Back/Forward
>
>
>
>
> Since IDs can disappear when records are delted, I think
perhaps they didnt compile PHP with mysql support...
> -Original Message-
> From: Matthew Loff [mailto:[EMAIL PROTECTED]]
> Subject: RE: [PHP] Fatal error: Call to undefined function:
> mysql_pconnect() in ...
>
> Have you tried a non-persistant connection? Does that work?
>
> mysql_co
try this:
$files = opendir($dir) or die("Cannot opendir $dir");
while ($file = readdir($files)) {
// do whatever
}
> -Original Message-
> From: Rory O'Connor [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 11, 2001 3:09 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] using GetImageSize i
run 'make clean'
find out where your current PHP stuff is *now*.
use that directory as --prefix=[dir] for the configure script.
make; make test; make install;
then, restart apache. always do this whenever you make
any changes to anything even remotely apache-related.
> -Original Message-
link to the mail form like this:
mailform.php?subject=Requesting+information+on
and in the mailform, have a subject field something
like this:
> -Original Message-
> From: Ed Peddycoart [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] php mail form with predefined subject
>
>
> I am in
a partial suggestion would be to try an fopen() on the
HTTP_REFERER if it was a static document like .html or .txt
but if someone is being redirected from a CGI script or
dyanmic page of any sort, it'll be virtually impossible
to find out exactly where they came from and if that
page is valid
and to answer one of the previous questions,
yes... it is *very* resource intensive to scan an entire
directory tree full of files every single time a user
wants to search
as far as i know, htdig indexes the information into one
big file, and just reads thru that... which will save you
load
i manage the production mysql database on a linux server
from my windows desktop at work
it's an extremely nice program. :)
many compliments to the authour, if he reads this list.
> -Original Message-
> From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 12, 200
P_REFERER < 10
>
> Thank you Scott for the various ideas. I am preventing an eventual 'no
> referer' situation with a default url provided by who opens an account.
>
> I am getting (and trying to give :)) help on this list, so I will ask
> first before doing... Is it no
some questions ;)
have you tried accessing the script non-secure?
is php properly installed and running on your server?
did you restart the server after installing PHP?
are you using a different server to handle secure queries?
does that server have php installed and configured properly?
> -
I have custom 404 error handling setup on my linux apache
box, however, there's a problem with files that have a PHP
extension. it seems that apache itself does not check for the
existence of the requested .php file and fires up PHP no matter
what. if PHP does not find the requested file, it'll
thanks... cant believe i didnt think of capturing
500 errors myself...
must mean the coffee's wearing off :)
> -Original Message-
> From: DAve Goodrich [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] apache not handling 404 errors for .php pages
>
> ErrorDocument 500 /path/to/my_error_
the RPM is a binary. if mysql support is not in the RPM,
there's no way to add it
if you want to install PHP the simplest way, get the
sources and compile it yourself as a stanalone binary
(NOT using --with-apache or --with-apxs)
then you can tweak it however you want, and compile
in suppor
also: mysql_escape_string()
will format data properly for use in MySQL queries
> -Original Message-
> From: Alexander Wagner [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] quotes
>
>
> Heidi Belal wrote:
> > I have a problem using apostrophes/single quotes.
> > I am using PHP and MySQL
Here is my code to turn a directory full of *files*
into thumbnail images. im sure you can adapt it to
your own needs... the code is a bit long-winded, but
it was my first attempt at writing thumbnail code,
so forgive me ;)
// example call to the function
make_thumbs('./pictures/cavern/', './
and as far as i know, perl's 'strict mode' has absolutely
nothing to do with typing of variables...
use strict; will force you to define all variables
with "my $var;" or "local $var;" before you assign values
to them or try and use them... but it doesnt do anything
about enforcing typing...
in
you could easily write yourself a typing function to take
care of all that (as someone suggested previously) using the
same familiar syntax as you want to use in the function
definition.
function pay($fromaccount, $toaccount, $amount, $memo) {
$good = checkInput($fromaccount, "int", $toaccount
what do the tags look like?
or
<% %>
the first is a short tag
the second is an asp style tag
maybe you're looking at the wrong option in the 'ini' file.
> -Original Message-
> From: Ralph Guzman [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 12, 2001 11:17 PM
> To: Coulee Web; [EM
sessions or cookies is the way you probably want to go.
you could pass the variable around to each and every
form, but that is a pain in the ass, and extremely
prone to errors.
on the first page, where you check the user's ability to
use attachments, you could simply set a cookie
setcookie('co
like you said... as long as the database provider accepts
connections from outside, you can administer it from anywhere.
if the provider doesn't accept incoming connections, no amount
of tools and software will work for you.
> -Original Message-
> From: Alexander Skwar [mailto:[EMAIL PRO
no offense, but that's a bad kludge for the problem.
however, if you really want to do that, you could try
checking $SERVER_NAME and $HTTP_REFERER and other
enviornment variables like that...
what would be easier (and better practise) to do is to
verify that the incoming username is valid...
stat()
> -Original Message-
> From: Randy Johnson [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 13, 2001 4:09 PM
> To: scott [gts]; php
> Subject: RE: [PHP] forms and IP numbers
>
>
> I would like to pull the date and time of the creation of a file via a php
be *extremely* careful. eval() is like spawning another PHP
interpreter... it'll execute *any* code that you give it.
people could type in unlink(); and such commands and really
trash your webserver.
> -Original Message-
> From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
> Subject: [PH
you're passing the PHPSESSID incorrectly, it seems
you must do something like this:
or
header("Location: nextpage.php?$SID");
what you're doing now will go to page "input.php?=SID"
instead of "input.php?938sa9fa98f7daf987a9s" (or similar)
> -Original Message-
> From: David Allen [
Has anyone come across this before?
// compare 5 to the max value of an integer
if (5 < -2147483647) {
print "This is";
}
// knock a digit off the max and compare again
if (5 < -214748364) {
print "weird";
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL P
"
>
>
> // compare 5 to the max value of an integer
> if (5 < -2147483647) {
> print "This is";
> } else {
> print "Nothing ";
> }
>
> // knock a digit off the max and compare again
> if (5 < -214748364) {
> print "weird"
MAIL PROTECTED]]
> Sent: Friday, July 13, 2001 2:47 PM
> To: php
> Subject: RE: [PHP] peculiar behaviour of large integers with "<" and ">"
>
>
> I am running 4.0.6. Nothing prints to the screen using a cut and paste of
> the code below.
>
> &g
> -Original Message-
> From: Matthew Aznoe [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] Variable name declarations?
>
> However, I do have one complaint about PHP that seems to have a tendency to
> bite me far too often, and that is the lack of variable declaration. While
> I do not thi
any number of things could happen to the $directory variable...
it could be out of scope, gotten overwritten or unset by another
function, or it might just never have been saved to the database...
but the real problem with that code is that there are no
error checks on the file functions. that
from the manual:
[print is a language construct [EMAIL PROTECTED]]
The print() function returns a boolean indicating the status of the call. If the
write was successful, print() returns 1. If not, it returns 0. This can be used to
detect when the client has closed the connection, and appropriate m
read the docs for ereg... i hardly use it, so i dont know
for certain if it will match. (althouth the use of "^" at
beginning *and* end suggests that it wont do what you expect)
preg will match "aol.com" with this regexp:
preg_match('/aol.com/', $string )
> -Original Message-
> From: J
even numbers are even becuase they're divisible by 2
w/o a remainder... use this property to your advantage:
if ( $num % 2 ) {
print "$num is odd";
}
else {
print "$num is even";
}
> -Original Message-
> From: SED [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 1
$text = "Hello there, <>.
My name is <>";
$ASSIGN = array(test => "this is a test", 'name'=> 'BOB', );
$OPENTAG = "<<";
$CLOSETAG = ">>";
print preg_replace( "/$OPENTAG(.*?)$CLOSETAG/e", '$ASSIGN[$1]', $text );
prints:
Hello there, this is a test.
My name is BOB
To do what you want, throw
12:45 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] string replace using ereg
>
>
> Mmmm, thx , but I can't get it to work when I run your code,
>
> Parse error: parse error, expecting `T_VARIABLE' or `'$'' in Eval code on
> line 1
>
> Fat
hehe... that's what regular expressions are for.
they're extrememly powerful... but that doesnt mean that
you should only use them for extremely complicated situations.
they work great everywhere...
if you dont like "overdoing it", you might as well loop
thru the string character by character, C
i know it's silly to ask --
but did you look for "php" in /usr/local/bin/
> -Original Message-
> From: Lasse Andersson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 2:49 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] Do not get any PHP-binary in install?
>
>
for the quotes thing. you must have single quotes around the
values that will go to the database, and you must escape single
quotes inside the value with either "''" or "\'" (at least in
MySQL, both work)
and as for the database... IMO, you should download MySQL now and
save yourself a ton of t
did you try and capture error messages from the system calls?
webserver probably doesnt have permission to do what you want it to do.
> -Original Message-
> From: Reuben D Budiardja [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] Exec, system, passthru didn't work
>
> Hi,
> I tried to execu
Take a look at
http://www.php.net/manual/en/function.ereg-replace.php
There's a bit of sample code up there that may help...
-bob
--
Bob Scott Web / DB Developer
http://www.covalent.netCovalent Technologies, Inc.
On Mon, 16 Jul 1979, [EMAIL PROTECTED]
i know this is a silly question, but you're
not looking at it thru a web browser, are you?
browsers are for HTML and markup code.
the output on my computer is the same as
the manual output:
A very
long
wooo
ord.
> -Original Message-
> From: Tyler Longren [mailto:[EMAIL PROTECTED]
This will convert minutes to hours, then convert
to 12-hour am|pm based time. all hours have 60
minutes. it's simple mathematics to convert.
$m = 780;
$h = 0;
// convert to hours:minutes
while ($m >= 60) {
$h++;
$m -= 60;
}
print "$h:$m \n";
// convert to 12-hour am|pm
if (!$h) {
$suf
1001 - 1100 of 1933 matches
Mail list logo