On Friday 10 May 2002 13:14, Jason Soza wrote:
> Thanks for the code, but I already have:
> $result = mysql_query("SELECT * FROM table");
select *, min(datefield) as mindate, max(datefield) as maxdate from table;
Should work.
> It's been my general understanding that querying twice in one scr
Good day,
A friend of mine has been asked to set up a simple website for a third
party, which will be used by visitors to order products.
She has been programming for a little while now, but, she doesn't have much
experience with other web hosting companies (and neither do I, really). I
know th
On Friday 10 May 2002 14:27, Miguel Cruz wrote:
> There's really not much to it. The intval of '-' is 0, so it doesn't cause
> any problems.
>
> $numbers = file('path/logfile.txt');
> $total = 0;
> foreach ($numbers as $num) $total += intval($num);
Or use array_sum():
$numbers = file('pa
Hi.
When a database query is done and the results are put into an array, what
are the resources used? I name all arrays differently and was wondering how
it would affect the performance of the server if many people connected with
many arrays being full. I am assuming the array gets 'dropped' wh
ok, i have the following script
HTML File ---
Your name:
You email:
Product1
Product2
--- End HTML Form ---
Ok, its just a simple purchase script for a free online game..
I know how to get the value of the thing via $Prod1 or $Prod2.. however this
form is emailed, so how can i get
Hi all,
I need some opinions, what are some good modules to build into PHP?
I'm starting a hosting service (properly)
Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
There's really not much to it. The intval of '-' is 0, so it doesn't cause
any problems.
$numbers = file('path/logfile.txt');
$total = 0;
foreach ($numbers as $num) $total += intval($num);
miguel
On Fri, 10 May 2002, Liam MacKenzie wrote:
> another real basic question, how would I add up
Hello!
I need some help with subj function.
I execute that function before php_execute_script() but variables seems to
be not available within my script.
How can I register variable from the C program (/sapi/cli) to see it available in the
script ?
--
Regards,
Serguei I. Ivantsov
Hey all,
another real basic question, how would I add up all the numbers in a log
file in this format?
Start log file
6353
3309
294
762
6443
6353
3309
-
-
-
-
-
-
294
762
6353
6443
3309
-
-
-
-
-
-
-
-
294
867
859
7695
97
49
-
-
-
-
---
end log file
how can I
if you insist in using your existing loop, try this (in pseudo-code)
min_date = some really large date (31-Dec-2100 maybe?)
max_date = some really small date (01-Jan-1970 maybe?)
while (row = fetch(result))
{
if (curr_date > max_date) max_date = curr_date
if (curr_date < min_date) min_date
On 9 May 2002 at 15:25, Philip Hallstrom wrote:
> It has to do with precedence (I think). When inside a double quoted
> string PHP evalutes "$books[$val]" *first* and doesn't catch that
> there's more to it...
>
> You can do this:
>
> $html.= " Yaddda yadda " . $books[$val][display];
>
> And
On Fri, 10 May 2002, Liam MacKenzie wrote:
> I was wondering if anyone knows of a system that will keep track of the
> amount of bandwidth a site has used.
> For example, someone has webspace, but is limited to 1 gig of data transfer.
> Someone downloads a 500M file off their site, so they've obvi
On Thu, 9 May 2002, Jason Soza wrote:
> Thanks for the code, but I already have:
> $result = mysql_query("SELECT * FROM table");
>
> And I use while ($row = mysql_fetch_array($result)) along with extract($row)
> to get my data.
>
> It's been my general understanding that querying twice in one sc
Thanks for the code, but I already have:
$result = mysql_query("SELECT * FROM table");
And I use while ($row = mysql_fetch_array($result)) along with extract($row)
to get my data.
It's been my general understanding that querying twice in one script is bad.
How do I incorporate your code into my
On Friday 10 May 2002 13:02, Jason Soza wrote:
> If I have a MySQL field full of dates and other info, and my PHP script
> displays all this, how would I isolate the min and max in the date field?
> Like I want to print something like:
>
> Information, from 01-03-2001 through 01-03-2002
>
> If som
Hi all,
I was wondering if anyone knows of a system that will keep track of the
amount of bandwidth a site has used.
For example, someone has webspace, but is limited to 1 gig of data transfer.
Someone downloads a 500M file off their site, so they've obviously got 500M
left.
Is there a script th
If I have a MySQL field full of dates and other info, and my PHP script
displays all this, how would I isolate the min and max in the date field?
Like I want to print something like:
Information, from 01-03-2001 through 01-03-2002
If someone could give me an example or point me to the manual sec
> if ($VerifyPasword[ContactID] = $_SESSION['ContactID'])
>
> This statement is /always/ true if $_SESSION['ContactID'] is non-zero, or
> non-empty.
>
> If your code is copy-and-paste then the error is most likely because you
used
> a single 's' in $VerifyPasword[ContactID]. And also is better t
On Friday 10 May 2002 07:41, baldey_uk wrote:
> Hi sorry to annoy you AGAIN, but i cant seem to get it working i think
> its something to do with the order that i put things in:
>
>
> #end of html and start of php script
>
>
> #Take the Variables from enterdetails.php that are posted from an
On Friday 10 May 2002 10:52, Steve Buehler wrote:
> Nokeep writing to the list. Next time, you might actually
Good idea.
[snip]
> >What baffles me, is
> >
> > while ($VerifyPassword = mysql_fetch_array($PasswordCheckSQL)) {
> > // Compare UserIDs
> > if
On Thu, May 09, 2002 at 11:39:34PM -0400, Analysis & Solutions wrote:
> On Thu, May 09, 2002 at 03:17:09PM -0400, Josh & Valerie McCormack wrote:
>
> > 6 123 123 123 123 123 123 John Smith 456 456 456 456 4
>
> The odd replacement is due to the itterations for each record in the csv file
Pa
On Thu, May 09, 2002 at 03:17:09PM -0400, Josh & Valerie McCormack wrote:
> I'm doing a str_replace (same thing happens with ereg and preg) and when
> the pattern is found it's erasing everything after it and doing a
> strange replace, too.
>
> I'm using a seven column CSV (new_data.csv) where
> I am not an expert at PHP / MySQL. To me it would sound like the
> one = is assigning the $VerifyPasword[ContactID] whatever is in
> $_SESSION['ContactID'] which would mean that the else part would never be
> executed. Honestly though, there is a lot that I don't know. I know very
I
Nokeep writing to the list. Next time, you might actually
give the example like you did here so that, hopefully someone will be able
to answer you better (I have a problem of not including enough
myself). The first question, in itself, sounded like a basic question. I
would be
> Obviously most coders are in the middle ground.
> They are not writing "the killer app of all time"
> but is of significant value. I don't know what
> people on here are charging but I can't add $2880
> a year to my overhead for the zend encoder. Plus
> add $1875 per cpu for the zend ac
Can someone offer any help with the code below? I have a cookie that is
set and is separated by pipes (|). For each segment, I have to look up
the id in a text file. I can loop through the cookie and get each segment,
but when I open the text file and loop through it, it only matches the
first seg
This really isn't a PHP question at all. Anyway, you just need to give
nicknames to multiple instances of the same table (here I use e1 and e2).
Something like...
select order_id, e1.last_name, e2.last_name
from tools.orders, hr.emp_master e1, hr.emp_master e2
where orders.emp_id=e1.emp_i
Obviously most coders are in the middle ground.
They are not writing "the killer app of all time"
but is of significant value. I don't know what
people on here are charging but I can't add $2880
a year to my overhead for the zend encoder. Plus
add $1875 per cpu for the zend accelerator for
each
Miguel,
Thanks for following up. I got the zip functions all working last night.
I deconstructed a zip file created by ZipIt and was able to discover
where the PHP class was going wrong. Basically, there is a segment
called 'data descriptor' that was being written into the file without
the pr
Good evening all,
I have a strange situation which I cannot think myself out of. To make
it simple my db looks like this
(hr db, emp_master table)
++---+
| emp_id | last_name |
++---+
| 1 | smith |
| 3 | wesson|
|
What exactly goes wrong? Indeed, you _should_ have $_POST["testvar"]
available in the next page... The only problem I see is that you first
echo the input and only then do you start the forms... which is an HTML
problem, not a PHP one.
Bogdan
baldey_uk wrote:
>Hi sorry to annoy you AGAIN, bu
I'm trying to get DOMXML to work with PHP4.2.0. I've compiled with --with-dom and
phpinfo() says it's there:
DOM/XML enabled
libxml Version 2.4.18
HTML Support enabled
XPath Support enabled
XPointer Support enabled
The following program though doesn't seem to work:
$xmlstring='a valid xml docum
Im tearing my hair out over how buggy DOMXML is!
Im trying to get my Hosting provider to update to PHP 4.2 cause I hear alot
of memory leaks for DOMXML are dealt with in this versioncan anyone who
has 4.2 confirm or deny this??
Thanking you all in advance
Jarrad Kabral
--
PHP General
Hi sorry to annoy you AGAIN, but i cant seem to get it working i think
its something to do with the order that i put things in:
#end of html and start of php script
';
?>php
# end of php script back into html
Are your details correct?
If i put the echo or INPUT type outside of the
The code is pretty obvious in sapi/apache/mod_php4.c in the
init_request_info() function.
On Thu, 9 May 2002, Lenny Miceli wrote:
> I've tried to search the archives/bug reports/faq's and didn't find any
> definitive answers on the security issue dealing with the plain text password
> being kept
On Thu, 9 May 2002, Kevin Stone wrote:
>> If register_globals is off, then you'll get $_GET['id'] = 3 and
>> $_GET['sex'] = female. It's then up to you to make sure those are okay.
>> But at least $id and $sex won't get set until you explicitly set them in
>> your code.
>
> Hmm. No offense Migue
It has to do with precedence (I think). When inside a double quoted
string PHP evalutes "$books[$val]" *first* and doesn't catch that there's
more to it...
You can do this:
$html.= " Yaddda yadda " . $books[$val][display];
And I think this (or something close to it):
$html.= " Yaddda yadda {$
- Original Message -
From: "Miguel Cruz" <[EMAIL PROTECTED]>
To: "Patrick Hsieh" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, May 09, 2002 11:52 AM
Subject: Re: [PHP] register_globals in php4
> On Fri, 10 May 2002, Patrick Hsieh wrote:
> > php4.1 recommends to set register
Hi,
I've got an array like the following:
$books = array(
"1572316217" => array(
category=> 'tech',
display => 'Steve McConnell\'s Software Project
Survival Guide',
href=>
- Original Message -
From: "Patrick Hsieh" <[EMAIL PROTECTED]>
> Hello list,
>
> php4.1 recommends to set register_globals=off in php.ini to make php
> more strict. My question is, if I turn off register_globals, what will
> happen if any malicious user just try to modify the variable val
I've tried to search the archives/bug reports/faq's and didn't find any
definitive answers on the security issue dealing with the plain text password
being kept in PHP_AUTH_PW even when you use external authentication. Since
it seems like the developers haven't answered any of the bug reports rel
I have come across a situation where I need to temporarly change the user
profile in the middle of a script. I would prefer to do this than to change
ownership of files to allow the script to be able to read them. I don't
know whose files I will be reading when the script runs, however I need to
You can't set an array subscript using an array; it should be a numerical
value or a string.
What you want to do is
$division[$div_id] = $array;
Better yet, try:
$divison[$div_id] = mysql_fetch_array($result, MYSQL_ASSOC);
J
Steve Buehler wrote:
> I am trying to learn some new things i
> a table with several contents, and I have a form on every
> row, the problem is that the form is to big, so the tab le
> looks ugly, I tried with everything I could come up with,
The tags imply a break which adds space vertically. It's
contrary to doing good html and will most likely c
> I was talking in general. The BBS was simply an example to
> make things clearer. I am *not* developing a BB system!
> If you want you can think of a immaginary tool that makes
> a website load twice as fast, need the half web
> space and makes the website look nicer, of course at lowe
Hey guys,
Just wanted to let you know
Thanks for the help and solving my problem.
I posted that mail and 10 minutes later i got my answer...are these guys
(Matthew walker,Miguel cruz) helpful or what?
Helpful,kind people,quick answers this list is great, but its only the
people who make the list..
Line 25 looks like this:
$division[$div_id][$array]=array();
The first subscript to division is $div_id, which is fine.
The second one is $array, which is an array. That doesn't make any sense.
Array keys have to be strings or numbers. You'd have to create a separate
array at each subscrip
Any luck? I started playing with it but then ran into the fact that we
don't have the gz functions compiled into our PHP. Before I really dug in,
thought I'd check whether you got it working.
miguel
On Tue, 7 May 2002, Steven Walker wrote:
> Miguel,
>
> That is very nice of you! I found the
I am trying to learn some new things in the hopes that it would help me
with my mysql/PHP programming. The following code gives me an error: "
Warning: Illegal offset type in z.php on line 25 ".
$result=mysql_query("SELECT * FROM division");
while(($row=mysql_fetch_object($result))){
$div_id=$
Best bet is to go to any book store that carries programming books and pick
up a book on PHP. There are so many different things that you need to know
that nobody can mention them all here. The other option is to go to
http://www.php.net and read everything the site has.
$var = $value
assigns
echo join (',', $a1);
On Fri, 10 May 2002, r wrote:
> Here is the code:
> $a1[]="ryan1";
> $a1[]="ryan1.2";
> $a1[]="ryan2";
> $a1[]="ryan2.1.1.1.1.1";
> $a1[]="ryan3";
> $a1[]="ryan3.2";
> reset($a1);
>
> print("Tesing arrays:");
> while(list($aa1,$aa2) = each ($a1))
> {
> print($aa2 . ",");
>
Try this:
");
for($i=0; $i < count($a1); $i++) {
{
echo($a2[$i]);
if ($i != (count($a1) - 1)) {
echo ",";
}
}
?>
Matthew Walker
Senior Software Engineer
ePliant Marketing
-Original Message-
From: r [mailto:[EMAIL PROTECTED]]
Sent: Friday, May
Greetings my PHP people.
Will do things a bit backwork code first and what i want as that seems the
easiest way to explain
Here is the code:
");
while(list($aa1,$aa2) = each ($a1))
{
print($aa2 . ",");
}
?>
Which gives out the output:
Tesing arrays:
ryan1,
ryan1.2,
ryan2,
ryan2.1.1.1.1.1,
ryan3
Interesting that you mention that, when I do PHP-CLI > test.html
I get Version 4.2.0 ... which is the CGI version Built April 20 2002
However my web server (I run it as an SAPI module) has: "Apache/1.3.20
(Win32) PHP/4.2.0 running..." in the console window and gives me Version
4.1.2, Build M
Hello Guys!
I'm having troubles with not knowing the amount of data which is waiting
to be received in the buffer for a specific socket I can use fsockopen,
establish a connection, and write to the socket, I can read from the
socket just fine as well. The trouble I'm running into is illustrate
On Thu, 9 May 2002, Gert Mellak wrote:
>> If you just want to hide the error message, there's nothing wrong with
>> using @.
>
> ok, it's a new point of view... I've always thought that this is bad
> programming style!
It's bad if you're using it to hide errors rather than fixing them.
If you h
Might I suggest using PHP's urlencode() to encode the string, and
Javascript's function unescape()?
Matthew Walker
Senior Software Engineer
ePliant Marketing
-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 09, 2002 11:37 AM
To: [EMAIL PROTECTED]
Sub
I'm doing a str_replace (same thing happens with ereg and preg) and when
the pattern is found it's erasing everything after it and doing a
strange replace, too.
I'm using a seven column CSV (new_data.csv) where the first [0] column
is first name and the second [1] is last name. This is what I'
Anyone notice this... when you do a
you get "PHP Version 4.1.2", while my apache window
says "Apache/1.3.20 (Win32) PHP/4.2.0 running..."
-G
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
This might help you:
http://www.phpbuilder.com/columns/william19990908.php3?page=1
Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com
- Original Message -
From: "Thomas Edison Jr." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 09, 2002 12:2
Andreas Indahl <[EMAIL PROTECTED]> schrieb in im Newsbeitrag:
[EMAIL PROTECTED]
> I want to include text from a html-file that is online at another website.
> To be more precise: I want to include my seti-stats from
> http://setiathome.ssl.berkeley.edu/ on my own homepage. Can I do this with
> PH
Gert,
to prevent PHP to output any error messages, you can prefix the expression
with @, i.e.
$db = @mysql_connect( $host, $user, $password) or die ('Sorry, server is
down!');
Greetings,
Herb
- Original Message -
From: "Gert Mellak" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thur
I want to include text from a html-file that is online at another website.
To be more precise: I want to include my seti-stats from
http://setiathome.ssl.berkeley.edu/ on my own homepage. Can I do this with
PHP?
Sincerely
Andreas Indahl
--
PHP General Mailing List (http://www.php.net/)
To uns
use or die ("DB-server down"); at the end of you line.
"Gert Mellak" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi!
>
> When I open a database connection and i. e. the db-server is down,
> I get a very long, long error message telling me that the server is down.
>
> What I wa
J Smith <[EMAIL PROTECTED]> schrieb in im Newsbeitrag:
[EMAIL PROTECTED]
>
> You can write your own error handlers using set_error_handler(). Then,
> depending on the error code, you can decide whether you should display the
> error message, email it to you, log it, whatever.
>
> http://www.php.ne
You can write your own error handlers using set_error_handler(). Then,
depending on the error code, you can decide whether you should display the
error message, email it to you, log it, whatever.
http://www.php.net/manual/en/function.set-error-handler.php
If you just want to hide the error me
On Thursday 09 May 2002 1:23 pm, Dan Hardiker wrote:
> You could also use some form of spider to go through your website. These
> are usually aimed at downloading a website to your local machine, or for
> mass caching.
> This should have the effect your after with minimum fuss and no rewriting
>
You may also use blobs to store the images in the database. That may
induce some major slowdown for large numbers of images. I would suggest
going with a directory structure on the filesystem, managing the
structure from PHP and allowing no more that 100 images per directory.
For example:
On Fri, 10 May 2002, Patrick Hsieh wrote:
> php4.1 recommends to set register_globals=off in php.ini to make php
> more strict. My question is, if I turn off register_globals, what will
> happen if any malicious user just try to modify the variable values in
> the url? Say,
>
> http://www.domain
Hello list,
php4.1 recommends to set register_globals=off in php.ini to make php
more strict. My question is, if I turn off register_globals, what will
happen if any malicious user just try to modify the variable values in
the url? Say,
http://www.domain.com/xxx.php?id=3&sex=female
Does it wor
Thank you Miguel! I was missing the /86400 and it works much better now
:)
On Thu, 9 May 2002, Miguel Cruz wrote:
> On Wed, 8 May 2002, Scott St. John wrote:
> > Sorry to be so thick this morning, but I have a unix time stamp in my MS
> > Sql server that is the date, plus 60 days to expi
On Wed, 8 May 2002, Scott St. John wrote:
> Sorry to be so thick this morning, but I have a unix time stamp in my MS
> Sql server that is the date, plus 60 days to expire a password. I want to
> take today's date and compare to the two to see:
> 1)How many days until the password expires
> 2)If
LOL! A standard!? In Javascript!? You must be joking. :-)
Nope. But it's not difficult. You simply have to access the url string with
'document.location.href', parse out the values individually and replace the
space placeholders. Can't remember what the exact javascript function would
be..
73 matches
Mail list logo