php-general Digest 23 Jun 2003 23:47:50 -0000 Issue 2135
Topics (messages 152487 through 152553):
Re: Passing Date/Time
152487 by: Ford, Mike [LSS]
Re: Convert KB to MB?
152488 by: Ford, Mike [LSS]
Re: Getting at $_POST values using a loop
152489 by: Ford, Mike [LSS]
152511 by: zbranigan
Uploading/retrieving binary files into Oracle??
152490 by: Michael Champagne
Re: Chomp, Chomp, Chomp
152491 by: Dan Joseph
- Default Date
152492 by: Gary Ogilvie
152493 by: Jay Blanchard
152494 by: Dan Joseph
152495 by: Jon Haworth
Is there an RTFM for 'use strict' ?
152496 by: Dave Restall - System Administrator
152497 by: Jay Blanchard
152498 by: CPT John W. Holmes
sending headers
152499 by: Petre Agenbag
152502 by: Mario Oberrauch
152503 by: CPT John W. Holmes
152507 by: Paul Chvostek
Re: SQL injection
152500 by: Johnson, Kirk
Re: correct session format?
152501 by: Johnson, Kirk
Form creator tool
152504 by: Karina S
152505 by: Edward Peloke
Performance question
152506 by: Hardik Doshi
152508 by: CPT John W. Holmes
152509 by: Paul Chvostek
152512 by: Boaz Yahav
Re: how to call php from C?
152510 by: Robert Cummings
Cool use for gmstrftime...
152513 by: Wendell Brown
image galleries
152514 by: Alan Quirk
152516 by: bbonkosk.tampabay.rr.com
152526 by: Johnny Martinez
<?xml version="1.0" encoding="UTF-8>
152515 by: Doug Essinger-Hileman
152517 by: Milan Reznicek
152518 by: Joseph Szobody
152519 by: John Nichel
152521 by: David Otton
152522 by: CPT John W. Holmes
Re: <?xml version=
152520 by: David Nicholson
Defining Super Globals
152523 by: Denis 'Alpheus' Cahuk
152525 by: Jay Blanchard
152529 by: Tom Rogers
152530 by: Leif K-Brooks
header() issues....
152524 by: Mike At Spy
152528 by: CPT John W. Holmes
open_basedir restriction in effect
152527 by: Logan McKinley
Re: Search Engines and Last-Modified Header
152531 by: Wendell Brown
House for rent - Good price
152532 by: o_j_p_p.icnet.com.ve
152553 by: Leif K-Brooks
vpopmail functions
152533 by: David D
Berkeley db
152534 by: Logan McKinley
Date problem
152535 by: Logan McKinley
152536 by: Mike Migurski
152551 by: Dan Joseph
Change image file size dynamically
152537 by: Hardik Doshi
152540 by: Chris Sherwood
free dynamic MENU
152538 by: David Elìas Sánchez Vásquez
152539 by: Jeff Harris
uploading images
152541 by: Tyler Longren
Problem with GET variables
152542 by: Sid
152543 by: Johnson, Kirk
apache mod_php memory leak, need help.
152544 by: Ray Aspeitia
set_error_handler always returns false
152545 by: Jeff Stewart
152546 by: Lars Torben Wilson
Source/version control?
152547 by: J J
152548 by: John Nichel
152549 by: Mike Migurski
152550 by: Chris Sherwood
mysql_error problem
152552 by: Ben Edwards
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 ---
> -----Original Message-----
> From: Kyle Babich [mailto:[EMAIL PROTECTED]
> Sent: 20 June 2003 17:55
>
> I have a input field in a form that is disabled by javascript
> but is assigned a value in the code that is the RFC 822
> formated date. Why is this field not included in the $HTTP_POST_VARS?
>
> Here is the page I am talking about:
> http://babich.us/xlog/post.php
>
> When the page is submitted all other values are passed except
> the date/time value, why? How do I fix it?
Disabled input fields aren't included in the submited values by definition.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Sævar Öfjörð [mailto:[EMAIL PROTECTED]
> Sent: 22 June 2003 01:27
>
> Actually, if we want too go into details, according to the
> international
> standard for units, there is a big difference in 'M' and 'm'.
> 'M' means
> Mega and 'm' means milli. You are probably aware of that Mega is 10 in
> the power of 3 but milli is 10 in the power of -3. The difference is,
> like, a million.
Well, if we're going to get *really* picky, lower-case b is the SI abbreviation for
bar, the unit of pressure -- so I'm afraid I read Mb as Megabar (and wince at the
thought!), and mb as millibar. As there's no international standard abbreviations for
bit and byte, they really should be written out in full (Mbyte, Gbit, etc.), although
I can appreciate the desire to use as few keystrokes as possible! Since, as far as
I'm aware, B has no SI meaning, I can just about cope with kB, MB for kilobytes,
Megabytes, and so on -- but mb will always be millibar to me (and raise a wry smile
whenever I see it in memory-size contexts!).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Dave Alger [mailto:[EMAIL PROTECTED]
> Sent: 23 June 2003 05:12
>
> This one is causing me a few headaches. How should I be doing this?
>
> On my previous page I've created a series of fields using a
> loop so that a
> field is created like this:
>
> echo "<hr>$fieldname:<input name='Field$n' maxlength='25'>";
>
> On my next page then I've got to try to read these values. I
> could do this
> as $_POST['Field0'], $_POST['Field1'] etc but a loop is what
> is required.
>
> I've tried getting at the value by:
>
> $a=$_POST['Field$n'];
>
> and
>
> $nb='$'."_POST['Field".$n."']";
> $a=$$nb;
>
> And neither works. How should I be doing it?
Well, ideally I'd go with the array-based rewrite already offered -- but if you must
stick with fields named Field1, Field2 etc., use one of these:
$a = $_POST["Field$n"];
$a = $_POST['Field'.$n];
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
>>>>> "Dave" == Dave Alger <[EMAIL PROTECTED]> writes:
Dave> Hi all, This one is causing me a few headaches. How should I
Dave> be doing this?
Dave> On my previous page I've created a series of fields using a
Dave> loop so that a field is created like this:
Dave> echo "<hr>$fieldname:<input name='Field$n' maxlength='25'>";
Here's a way to do it so that the field numbers are not required to be
contiguous. You don't really have to copy $_POST to $myPostVars
except that, in the code from which this snippet was extracted, there
are further processing steps which depend on the fact that none of the
form variables left in $myPostVars have been processed yet.
,----
|
| $myPostVars= $_POST;
|
| reset ($myPostVars);
| while (list ($key, $val) = each ($myPostVars)) {
| if (preg_match("/^Field[0-9]+", $key )) {
| list($i)= sscanf($key, "Field%d");
| FieldAry[$i]= $val;
| unset($myPostVars[$key]);
| }
| }
`----
--
no toll on the internet; there are paths of many kinds;
whoever passes this portal will travel freely in the world
--- End Message ---
--- Begin Message ---
Can anyone point me to some sample code for uploading and later retrieving PDFs
or other binary files into an Oracle BLOB field? I've been searching for some
time and haven't been able to come up with anything. It looks like there's
new LOB functions for OCI but they aren't documented at all on the PHP site.
Does anyone have a good tutorial or sample code on doing something like this.
Thanks in advance for any assistance.
Mike Champagne
[EMAIL PROTECTED]
******************************************************************
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction, unless specifically agreed otherwise. All market
prices, data and other information are not warranted as to
completeness or accuracy and are subject to change without
notice. Any comments or statements made herein do not
necessarily reflect the views or opinions of Capital Institutional
Services, Inc. Capital Institutional Services, Inc. accepts no
liability for any errors or omissions arising as a result of
transmission. Use of this communication by other than intended
recipients is prohibited.
******************************************************************
--- End Message ---
--- Begin Message ---
Hi,
chop and rtrim just take out white space. Perl's chomp takes off the last
character no matter what it is.
$foo = substr($foo, 0, -1);
That will emulate Perl's chomp.
-Dan Joseph
> -----Original Message-----
> From: Sparky Kopetzky [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 20, 2003 6:38 PM
> To: PHP General
> Subject: [PHP] Chomp, Chomp, Chomp
>
>
> Does anyone have a piece of code that emulates a Perl 'Chomp'
> function? I need one.
>
> Thanks in advance!!
>
> Robin E. Kopetzky
> Black Mesa Computers/Internet Services
> www.blackmesa-isp.net
>
>
--- End Message ---
--- Begin Message ---
Hi everyone,
I am about to start work on a PHP script and I need to know how to
today's date. Is there a default variable built into PHP that has
today's date?
Many thanks
Gary Ogilvie
--- End Message ---
--- Begin Message ---
[snip]
I am about to start work on a PHP script and I need to know how to
today's date. Is there a default variable built into PHP that has
today's date?
[/snip]
RTFM at http://www.php.net/date
HTH!
Jay
--- End Message ---
--- Begin Message ---
www.php.net has a few useful things on there, one of them is the date()
function.
-Dan Joseph
> -----Original Message-----
> From: Gary Ogilvie [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 23, 2003 9:22 AM
> To: 'PHP General'
> Subject: [PHP] - Default Date
>
>
> Hi everyone,
>
> I am about to start work on a PHP script and I need to know how to
> today's date. Is there a default variable built into PHP that has
> today's date?
>
> Many thanks
>
> Gary Ogilvie
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi Gary,
> Is there a default variable built into PHP that has
> today's date?
Have a look at http://php.net/date for this - http://php.net/mktime will
probably be of interest as well.
Cheers
Jon
--- End Message ---
--- Begin Message ---
Hi,
Done a lot of Perl & PHP coding over the years and one thing I _really_
liked about Perl is its 'use strict;' directive. For those of you not
familiar with Perl, this made the script die if you don't (among other
things) declare your variables before using them.
Once the fingers are flying, stupid typing mistakes often come in and
it is more often when a variable name is being typed. It would be
interesting to see how many PHP coders out there have spent ages trying
to find a bug in their code that was due to them mis-spelling a variable
or method name.
Anyway, I can't find a reference to anything in the manual that will
force PHP to strictly check variable names etc. to see if they are
declared before use and if not throw up an error.
Can somebody tell me which M to FR ?
Regards,
Dave
mail/php/2003-06-23.tx php-general
+----------------------------------------------------------------------------+
| Dave Restall, IIRC Limited, PO Box 46, Skelton, Cleveland, TS12 2GT. |
| Tel. +44 (0) 1287 639309 Mob. +44 (0) 7973 831245 Fax. +44 (0) 1287 635955 |
| email : [EMAIL PROTECTED] [EMAIL PROTECTED] Web : http://www.iirc.net |
+----------------------------------------------------------------------------+
| No man's ambition has a right to stand in the way of performing a simple |
| act of justice. |
| -- John Altgeld |
+----------------------------------------------------------------------------+
--- End Message ---
--- Begin Message ---
[snip]
'use strict;' directive
[/snip]
One thing you can do is
error_reporting(E_ALL);
(see http://www.php.net/errorfunc )
but there is nothing really that operates the way 'use strict' does.
However, if you have an undefined variable this will give it back to you
if it does not contain a value (say you have a variable named $vdog and
you mis-typed it as $vgod). You may also want to consider 'define' at
http://www.php.net/define....but again, it is not the same as 'use
strict'.
HTH!
Jay
--- End Message ---
--- Begin Message ---
> Done a lot of Perl & PHP coding over the years and one thing I _really_
> liked about Perl is its 'use strict;' directive. For those of you not
> familiar with Perl, this made the script die if you don't (among other
> things) declare your variables before using them.
>
> Once the fingers are flying, stupid typing mistakes often come in and
> it is more often when a variable name is being typed. It would be
> interesting to see how many PHP coders out there have spent ages trying
> to find a bug in their code that was due to them mis-spelling a variable
> or method name.
>
> Anyway, I can't find a reference to anything in the manual that will
> force PHP to strictly check variable names etc. to see if they are
> declared before use and if not throw up an error.
>
> Can somebody tell me which M to FR ?
The closest you can come is to set your error_reporting() to E_ALL. Then
you'll get notices about undefined variables and keys for arrays, but the
script will not die. You can do some FR at www.php.net/error_reporting. :)
---John Holmes...
--- End Message ---
--- Begin Message ---
Hi List
I am having trouble using headers.
I try to include a redirect header in my script, but is fails with the
familiar ( headers already sent) error.
I KNOW you should put the headers call where it will cause the first
output, and I do that, the only thing happening infront of the headers
call is an include statement to my main db class; this class has
absolutely NO output unless a function is called (which it is not)...
What am I missing?
--- End Message ---
--- Begin Message ---
> Hi List
>
> I am having trouble using headers.
>
> I try to include a redirect header in my script, but is fails with the
> familiar ( headers already sent) error.
>
> I KNOW you should put the headers call where it will cause the first
> output, and I do that, the only thing happening infront of the headers
> call is an include statement to my main db class; this class has
> absolutely NO output unless a function is called (which it is not)...
>
> What am I missing?
Hi too
May be spaces/empty lines before/after <?php/?> .
--
Mario Oberrauch
-----------------------------------------------------------
CREATO - creative online systems - Spindler KEG
Hafenstrasse 47 - 51, 4020 Linz, Austria
Tel: +43 (0) 732/9015 5940
Fax: +43 (0) 732/9015 5949
Email: [EMAIL PROTECTED]
-----------------------------------------------------------
--- End Message ---
--- Begin Message ---
> I try to include a redirect header in my script, but is fails with the
> familiar ( headers already sent) error.
>
> I KNOW you should put the headers call where it will cause the first
> output, and I do that, the only thing happening infront of the headers
> call is an include statement to my main db class; this class has
> absolutely NO output unless a function is called (which it is not)...
>
> What am I missing?
The error message tells you exactly what you need to know. "Output started
at xxx.php:12" or something similar. That gives you the file name and line
number where "output" was started. Begin your troubleshooting there. Ensure
you don't have any whitespace before or after the opening/closing <? and ?>
tags (like an extra newline at the end of the included file).
---John Holmes...
--- End Message ---
--- Begin Message ---
On Mon, Jun 23, 2003 at 04:26:40PM +0200, Petre Agenbag wrote:
>
> I am having trouble using headers.
>
> I try to include a redirect header in my script, but is fails with the
> familiar ( headers already sent) error.
>
> I KNOW you should put the headers call where it will cause the first
> output, and I do that, the only thing happening infront of the headers
> call is an include statement to my main db class; this class has
> absolutely NO output unless a function is called (which it is not)...
>
> What am I missing?
I assume your database inclusion script is spitting out something you
didn't intend it to. It could be as simple as an extra blank line after
your closing '?>'.
To find out what's going on, use a command line like:
curl -D- http://hostname/path/to/script.php | more
Assuming you have curl installed of course. If not, try looking at your
script output through http://samspade.org/t/safe .
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canada http://www.it.ca/
Free PHP web hosting! http://www.it.ca/web/
--- End Message ---
--- Begin Message ---
> Hi,
> Is there any way, doc, article, example, idea, suggestion to how to
> prevent sql injection on php sites...
http://www.nextgenss.com/papers/advanced_sql_injection.pdf
http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf
Kirk
--- End Message ---
--- Begin Message ---
> So what is the diffirent between :
> session_start ();
> $_SESSION['eventid'] = 'arma2';
> and
> session_start ();
> session_register('arama2');
Use the first method to create session variables when register_globals is
"off" in the php.ini file. Use the second method when it is "On".
http://www.php.net/session
Kirk
--- End Message ---
--- Begin Message ---
Hello,
I have to make a lot of input and edit form to mysql tables. Is there any
tool with it I can easy make php based html forms?
I mean eg.: User can select fields from mysql table and the tool generate an
input or an edit form to it.
Thanks!
--- End Message ---
--- Begin Message ---
Karina,
I am not exactly sure of all it does but a link was posted on phparch today
http://www.phparch.com/news/283 (read the user comments at the bottom) about
formWizard, it may be worth a look.
Eddie
-----Original Message-----
From: Karina S [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2003 10:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Form creator tool
Hello,
I have to make a lot of input and edit form to mysql tables. Is there any
tool with it I can easy make php based html forms?
I mean eg.: User can select fields from mysql table and the tool generate an
input or an edit form to it.
Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi Group,
I have a question regarding retrieving the
information. I have the functionlity in which on every
user click, system needs to retrieve information for
particular user and display the page according to the
retrieved information. Now question is which is the
scalable solution? (1) Retrieve information from the
database on each user click. (2) Retrieve information
from the session (here information is retrieved once
and stored in the session file on the server, when
user logs into the system)
Please let me know
Thanks
Hardik
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
--- End Message ---
--- Begin Message ---
> I have a question regarding retrieving the
> information. I have the functionlity in which on every
> user click, system needs to retrieve information for
> particular user and display the page according to the
> retrieved information. Now question is which is the
> scalable solution? (1) Retrieve information from the
> database on each user click. (2) Retrieve information
> from the session (here information is retrieved once
> and stored in the session file on the server, when
> user logs into the system)
Benchmark it and find out yourself.
I'm sure 99% of the people here are going to jump on this and say SESSION is
the way to go, and I'd probably agree with them up front. But the only way
to really tell with your program is to benchmark each possibility. If you're
already establishing a database connection for other uses, then one more
query may not be a big deal versus opening an file and reading it, but
you'll never know the real answer until you try both of them. Now, if you
only use the database connection to get this information, then yeah,
sessions will definitely be faster when you remove the database connection
entirely.
---John Holmes...
--- End Message ---
--- Begin Message ---
On Mon, Jun 23, 2003 at 08:09:57AM -0700, Hardik Doshi wrote:
>
> Hi Group,
Hi Hardik.
> I have a question regarding retrieving the
> information. I have the functionlity in which on every
> user click, system needs to retrieve information for
> particular user and display the page according to the
> retrieved information. Now question is which is the
> scalable solution? (1) Retrieve information from the
> database on each user click. (2) Retrieve information
> from the session (here information is retrieved once
> and stored in the session file on the server, when
> user logs into the system)
I'd go for (2). Try to avoid constant database lookups if you don't
really need them. The database server takes alot more resources to find
a piece of data than mod_php4 takes to pull it out of a session file.
Even data stored in cookies can be moved to session variables for use by
the session. If page views then do not require database cycles *or*
repeated cookie-based network traffic, you save both CPU and bandwidth.
And the session data goes away when the session is destroyed.
Anything you can do to save CPU and bandwidth is good. Unless you own
shares in Intel and Cisco, of course.
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canada http://www.it.ca/
Free PHP web hosting! http://www.it.ca/web/
--- End Message ---
--- Begin Message ---
It depends on your HW / Application / number of visitors.
If you are planning to have many visitors and plan this number to
constantly
grow than you should avoid going to the DB as much as possible.
Sincerely
berber
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
-----Original Message-----
From: Hardik Doshi [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2003 5:10 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Performance question
Hi Group,
I have a question regarding retrieving the
information. I have the functionlity in which on every
user click, system needs to retrieve information for
particular user and display the page according to the
retrieved information. Now question is which is the
scalable solution? (1) Retrieve information from the
database on each user click. (2) Retrieve information
from the session (here information is retrieved once
and stored in the session file on the server, when
user logs into the system)
Please let me know
Thanks
Hardik
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
>
> Hello,
> I have a working C program that runs like a cgi
> by sending back a web page. I would like include in it
> some authentication code by checking
>
> $au = $_SESSION['AuthenticatedUser']
>
> previously set up by a php script.I don't like to recode
> all in php because I expect a nasty performace slowdown.
>
> Can I call session_start() and so on from my C program?
> Any example code?
I'm not sure how you would go about doing this, a more natural
solution IMHO would be to incorporate your C code into a PHP
extension which would then give you access to the C library you
have written directly in PHP.
Cheers,
Rob.
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'
--- End Message ---
--- Begin Message ---
How many times have you manually calculated the hours, minutes and
seconds between two dates? I was doing that again (for the million'th
and one times) and thought.... there should be a different way to do
this.... Here is what I came up with (I don't know if it's more
efficient than the old stand by's or not, but it is different).
<?PHP
$cTime = time() - filemtime( $_SERVER["SCRIPT_FILENAME"] );
printf( "Script Age: %d days %s",
(int)($cTime / 86400),
gmstrftime( "%H:%M:%S", $cTime ) );
?>
--- End Message ---
--- Begin Message ---
I've had a look around lots of script sites (hotscripts, etc) and there are
lots of scripts for gd-library galleries, but unfortunately the server i'm
using does not support it, and I really want to have a gallery where
pictures can be uploaded and all the appropriate directories are created
automatically (i'm not that good with code just yet) but instead of listing
pages of thumbnails it just automatically lists the pics in the gallery as
text links.
I hope you can be of some help, I can't find anything anywhere on the whole
internet like this.
--- End Message ---
--- Begin Message ---
Well,
Start here to read about how to upload files to a web server..
http://us2.php.net/features.file-upload
And then as for displaying them, look into some standard HTML to display the
text links, and possibly this solutions for readin directory contents:
http://us2.php.net/manual/en/ref.dir.php
HTH
-Brad
> I've had a look around lots of script sites (hotscripts, etc) and there are
> lots of scripts for gd-library galleries, but unfortunately the server i'm
> using does not support it, and I really want to have a gallery where
> pictures can be uploaded and all the appropriate directories are created
> automatically (i'm not that good with code just yet) but instead of listing
> pages of thumbnails it just automatically lists the pics in the gallery as
> text links.
>
> I hope you can be of some help, I can't find anything anywhere on the whole
> internet like this.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
I highly recommend this Gallery: http://sourceforge.net/projects/gallery
I've used it in many webs, it's very fast, modular, handles multiple formats
and is fairly easy to customize. Here is a web that I integrated it with:
http://www.roundaboutdesigns.com/gallery
Johnny
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2003 6:20 AM
To: Alan Quirk; [EMAIL PROTECTED]
Subject: Re: [PHP] image galleries
Well,
Start here to read about how to upload files to a web server..
http://us2.php.net/features.file-upload
And then as for displaying them, look into some standard HTML to display the
text links, and possibly this solutions for readin directory contents:
http://us2.php.net/manual/en/ref.dir.php
HTH
-Brad
> I've had a look around lots of script sites (hotscripts, etc) and there
are
> lots of scripts for gd-library galleries, but unfortunately the server i'm
> using does not support it, and I really want to have a gallery where
> pictures can be uploaded and all the appropriate directories are created
> automatically (i'm not that good with code just yet) but instead of
listing
> pages of thumbnails it just automatically lists the pics in the gallery as
> text links.
>
> I hope you can be of some help, I can't find anything anywhere on the
whole
> internet like this.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
When I include <?xml version="1.0" encoding="UTF-8"?> in my html
code, I get a parse error. The version is 4.1.2; phpinfo() reports
that XML support is turned on. Can anyone help with this?
Doug
--- End Message ---
--- Begin Message ---
It may happen because your HTML is not written in an XML standard.
----- Original Message -----
From: "Doug Essinger-Hileman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 23, 2003 7:22 PM
Subject: [PHP] <?xml version="1.0" encoding="UTF-8>
>
> When I include <?xml version="1.0" encoding="UTF-8"?> in my html
> code, I get a parse error. The version is 4.1.2; phpinfo() reports
> that XML support is turned on. Can anyone help with this?
>
> Doug
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I believe this is because the PHP engine thinks that the "<?xml" is a PHP opening tag.
1. Turn off short PHP tags (short_open_tag in php.ini)
-OR-
2. Use this instead: <?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
Joseph
"Doug Essinger-Hileman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>
> When I include <?xml version="1.0" encoding="UTF-8"?> in my html
> code, I get a parse error. The version is 4.1.2; phpinfo() reports
> that XML support is turned on. Can anyone help with this?
>
> Doug
>
>
--- End Message ---
--- Begin Message ---
Doug Essinger-Hileman wrote:
When I include <?xml version="1.0" encoding="UTF-8"?> in my html
code, I get a parse error. The version is 4.1.2; phpinfo() reports
that XML support is turned on. Can anyone help with this?
Doug
Do you have short tags disabled in you php.ini? If not, try turning it
off, and restarting your web server.
--- End Message ---
--- Begin Message ---
On Mon, 23 Jun 2003 13:22:40 -0400, you wrote:
>
>When I include <?xml version="1.0" encoding="UTF-8"?> in my html
>code, I get a parse error. The version is 4.1.2; phpinfo() reports
>that XML support is turned on. Can anyone help with this?
"<?" opens a php block. Then the PHP interpreter attempts to parse "xml
version="1.0" encoding="UTF-8""
try
<? echo ('<?xml version="1.0" encoding="UTF-8"?>' . "\r\n"); ?>
or turning short tags off.
--- End Message ---
--- Begin Message ---
> When I include <?xml version="1.0" encoding="UTF-8"?> in my html
> code, I get a parse error. The version is 4.1.2; phpinfo() reports
> that XML support is turned on. Can anyone help with this?
The first two characters are opening up a PHP block of code, so you get a
parse error. Either disable short open tags in php.ini, or use
<?
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?>
---John Holmes...
--- End Message ---
--- Begin Message ---
Hello,
This is a reply to an e-mail that you wrote on Mon, 23 Jun 2003 at 18:18,
lines prefixed by '>' were originally written by you.
> When I include <?xml version="1.0" encoding="UTF-8"?> in my html
> code, I get a parse error. The version is 4.1.2; phpinfo() reports
> that XML support is turned on. Can anyone help with this?
> Doug
Make sure that you correctly escape the <? or PHP will interperate it as
an opening PHP tag. The other alternative is to disable short opening tag
support in php.ini.
HTH
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/
(developed entirely in PHP)
--- End Message ---
--- Begin Message ---
Can some1 tell me how can I define Super Globals (like the Application
Scope in ASP)?
--- End Message ---
--- Begin Message ---
[snip]
Can some1 tell me how can I define Super Globals (like the Application
Scope in ASP)?
[/snip]
Start here http://us4.php.net/globals
--- End Message ---
--- Begin Message ---
Hi,
Tuesday, June 24, 2003, 3:36:12 AM, you wrote:
DAC> Can some1 tell me how can I define Super Globals (like the Application
DAC> Scope in ASP)?
Have a look at msession, that will allow you to setup application wide
variables
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Denis 'Alpheus' Cahuk wrote:
Can some1 tell me how can I define Super Globals (like the Application
Scope in ASP)?
You can't.
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt
to decrypt it will be prosecuted to the full extent of the law.
--- End Message ---
--- Begin Message ---
Does anyone know if there are issues with using the header() function inside
frames? Is there extra stuff that needs to be added to it to get it to work
correctly?
Or if there were issues with header in php 4.06?
Thanks,
-Mike
--- End Message ---
--- Begin Message ---
> Does anyone know if there are issues with using the header() function
inside
> frames? Is there extra stuff that needs to be added to it to get it to
work
> correctly?
No... each frame is it's own HTTP request. PHP operates server side so it
has no idea of "frames". It simply processes the code and redirects the
request or sends the appropriate header.
> Or if there were issues with header in php 4.06?
Dunno about that, look at the changelogs, maybe?
---John Holmes...
--- End Message ---
--- Begin Message ---
I am getting the following error when I am trying to include a file using
include("includes\handle_errors.inc");
<--------------------------------------------->
Warning: open_basedir restriction in effect. File is in wrong directory
in /var/hosting/www/www.site.com/http/PHP/compare.php on line 4
<--------------------------------------------->
I created this whole site on my machine and have just attempted to move it to my ISP
who has phpinfo(); disabled
Thanks in advance,
~Logan
--- End Message ---
--- Begin Message ---
On Wed, 28 May 2003 10:23:22 -0500, Wendell Brown wrote:
>To force all of the pages (both pseudo-static and dynamic) to generate
>a "Last-Modified" header, I set up prepend.php script which is
>configured as a directory level (.htaccess) parm to auto_prepend_file.
As appears to be the usual case with php, I have found that I was doing
things the HARD way. While an auto_prepend will work, there is a
Apache specific ini setting that will turn on automatic generation of
the Last-Modified AND ETAG headers! If you change the default value
for "last_modified" to on in your php.in or add the following to your
.htaccess file, php will generate both a default Last-Modified header
AND an ETAG:
php_flag last_modified on
Anyone care to comment on whether or not there is a down side to having
an etag on a dynamic page related to search engines (or caches for that
matter)....
Here is the link - NOTE that the docs do NOT mention the ETAG, but my
testing is that this ini change also enables that functionality as
well!
http://us3.php.net/manual/en/ref.apache.php
--- End Message ---
--- Begin Message ---
Hello all mailing list, House for rent - Good price, :), bye.
URL : http://www.geocities.com/rapogo
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
Hello all mailing list, House for rent - Good price, :), bye.
URL : http://www.geocities.com/rapogo
Can someone PLEASE unsubscribe the spammer?
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt
to decrypt it will be prosecuted to the full extent of the law.
--- End Message ---
--- Begin Message ---
http://fr2.php.net/manual/fr/function.vpopmail-add-alias-domain-ex.php
How can i do to use vpopmail functions ?
What doesnt that means ?
vpopmail_add_alias_domain_ex
(4.0.5 - 4.2.3 only) ?
Is there a set of php scritp that allows to manage vpopmail, I have vqadmin
in perl but it has some bug on my machine ...
i d like to manage account via php ...
Is there any extension to do so ?
Thanks.
--- End Message ---
--- Begin Message ---
I have absolutely no experience with Berkeley db but have been told by my
ISP that it is what I need to use. How do I connect to it? Do I use SQL to
set up the structure? does it accept standard SQL? If anyone knows of a good
resource that would be wonderful as well.
Thanks in advance,
~Logan
--- End Message ---
--- Begin Message ---
I am storing dates in an Access database in a field with a "Date/Time" Type
the date is being generated using date("n/d/Y h:i a"). It appears to be
stored in Access correctly but when I output it to the page using PHP it
seems to be changing. It is being stored in the database as "6/19/2003
1:44:00 PM" but being displayed on the page as "1056044640"
Thanks in advance,
~Logan
--- End Message ---
--- Begin Message ---
>I am storing dates in an Access database in a field with a "Date/Time" Type
>the date is being generated using date("n/d/Y h:i a"). It appears to be
>stored in Access correctly but when I output it to the page using PHP it
>seems to be changing. It is being stored in the database as "6/19/2003
>1:44:00 PM" but being displayed on the page as "1056044640"
>Thanks in advance,
That's a timestamp - it's the number of seconds since the Unix Epoch
(1/1/1970 GMT), and you can read up about conversion here: php.net/date
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html
--- End Message ---
--- Begin Message ---
Hi,
That looks like a unix timestamp. Try this:
Echo date("Y/m/d h:i:s", "1056044640");
www.php.net/date
Check that link to see the lettering codes and the syntax, I
might be off on what I typed up there, but you'll get the concept.
-Dan Joseph
-----Original Message-----
From: Logan McKinley [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2003 5:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Date problem
I am storing dates in an Access database in a field with a "Date/Time"
Type
the date is being generated using date("n/d/Y h:i a"). It appears to
be
stored in Access correctly but when I output it to the page using PHP it
seems to be changing. It is being stored in the database as "6/19/2003
1:44:00 PM" but being displayed on the page as "1056044640"
Thanks in advance,
~Logan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi Group,
Is there any way to change the image size (Not height
and width. I am talking about image file size)
dynamically?
Our users upload the big files and we want to find a
way so once user upload such file, system will
automatically generate the small file and store both
versions on the server location. Later on this small
file will show up as the thumbnail. Once user clicks
on thumbnail then system will show the original big
file.
Thanks
Hardik
-----
Hardik K. Doshi
Web Application Developer
Institute of Design
Illinois Institute of Technology
350, North Lasalle Street
Chicago, Illinois 60610
312.595.4907 (direct)
312.595.4901 (fax)
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
--- End Message ---
--- Begin Message ---
check out this link it should have the answers your looking for
http://ca3.php.net/manual/en/function.imagecreatefromjpeg.php
----- Original Message -----
From: "Hardik Doshi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 23, 2003 2:14 PM
Subject: [PHP] Change image file size dynamically
> Hi Group,
>
> Is there any way to change the image size (Not height
> and width. I am talking about image file size)
> dynamically?
>
> Our users upload the big files and we want to find a
> way so once user upload such file, system will
> automatically generate the small file and store both
> versions on the server location. Later on this small
> file will show up as the thumbnail. Once user clicks
> on thumbnail then system will show the original big
> file.
>
> Thanks
>
> Hardik
>
> -----
>
> Hardik K. Doshi
> Web Application Developer
>
> Institute of Design
> Illinois Institute of Technology
> 350, North Lasalle Street
> Chicago, Illinois 60610
>
> 312.595.4907 (direct)
> 312.595.4901 (fax)
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hi folks
I'd like to know if you know any page where I can download a tree dynamic
menu made in PHP.. The options of this menu will be pulled from a mysql
database
thanks
David
--- End Message ---
--- Begin Message ---
On Jun 23, 2003, "David Elìas Sánchez Vásquez" claimed that:
|
|Hi folks
|
|I'd like to know if you know any page where I can download a tree dynamic
|menu made in PHP.. The options of this menu will be pulled from a mysql
|database
|
|thanks
|
|David
I know this breaks the "rules/recommendations" that were just discussed on
this list about whether a function should output, but tough. IRIC, this
was lifted from somewhere on phpbuilder.com
<?php
function build_select_box($result, $name, $checked_val="*Choose an Option*")
{
/*
Takes a $result set, with the first column being the "id" or value
and the second column being the text you want displayed.
The second parameter is the $name you want assigned to this form element
The third parameter is optional. Pass the value of the item that should be
selected by default.
*/
$rows=mysql_num_rows($result);
print("<SELECT NAME=\"$name\">");
for ($i=0; $i<$rows; $i++) {
print("\n<OPTION VALUE=\"".mysql_result($result,$i,0)."\"");
if(mysql_result($result,$i,1) == addslashes($checked_val)) {
print(" SELECTED style='background-color: #FFFFCE'"); }
print(">".stripslashes(mysql_result($result,$i,1)));
print("</OPTION>");
} // End for
print("\n</SELECT>\n");
} // End function
print("<HTML><BODY><FORM action=\"action.php\">");
$SQLQuery="SELECT col1, col2 FROM table ORDER BY col2";
$mysql_result=mysql_query($SQLQuery, $database_link);
build_select_box($mysql_result,"selected_item");
print("</form></body></html>");
?>
--
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.
--- End Message ---
--- Begin Message ---
Hi,
I'm trying to upload a small image via a form. This code worked with php
versions prior to 4.1.0. I assume it would still work if register_globals
was turned on.
Here's the error:
Warning: fread(): supplied argument is not a valid stream resource in
/home/sites/site2/users/tyler/web/upload.php on line 28
And here's line 28:
$data = fread(fopen($_POST['binFile'], "r"), filesize($_POST['binFile']));
Am I doing that correctly? If you need to see more code, let me know.
Thanks everyone!
Tyler Longren
--- End Message ---
--- Begin Message ---
Hello,
I just updated PHP on my local computer from PHP 4.0.2 to 4.3.2 (Yes, I know, its a
very very long time). I also downloded the latest version of Apache and installed PHP
as a module. Now PHP runs fine on the server. I have a small problem though. Variables
being sent via the GET method are not getting parsed. I can acess these variables via
the $_GET["variable"] method but not through $variable. Any idea why. Most of my old
PHP scripts accessed the variables directly by their name and so this will be a very
very big problem for me. Any idea how I can get this old feature back.
Thank you.
- Sid
--- End Message ---
--- Begin Message ---
Set register_globals to "On" in php.ini.
Kirk
> -----Original Message-----
> From: Sid [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 23, 2003 3:52 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Problem with GET variables
>
>
> Hello,
>
> I just updated PHP on my local computer from PHP 4.0.2 to
> 4.3.2 (Yes, I know, its a very very long time). I also
> downloded the latest version of Apache and installed PHP as a
> module. Now PHP runs fine on the server. I have a small
> problem though. Variables being sent via the GET method are
> not getting parsed. I can acess these variables via the
> $_GET["variable"] method but not through $variable. Any idea
> why. Most of my old PHP scripts accessed the variables
> directly by their name and so this will be a very very big
> problem for me. Any idea how I can get this old feature back.
>
> Thank you.
>
> - Sid
>
--- End Message ---
--- Begin Message ---
Hello,
I hope someone can help me or point me in a good direction.
I have a database driven website, all ODBC to postgresql, that little
by little eats up resources on apache.
The child processes will start off at 30Mb of virtual memory and run
up around 230Mb each child. (see below ps output) before they start
dying.
It does not even take 700 accesses per child to max out memory.
I then start getting funny errors like access denied to file or could
not open socket, or file not found.
I read all to documentation and as far as I know, php should release
any defined query resources once the script executes.
I already code with odbc_close($conn); on all my pages. It is not
feasible to use odbc_free_result() on every query, due to the
complexity of scripts, but the documentation for odbc_free_result
says you shouldn't have to.
That is the only thing that I can think of that could be draining
this much resources. Is there any good way to find out what is eating
up the memory. Anyone else run into this.
I'm running apache 1.3.27 with php 4.3.2 (happened in version 4.3.1
also) on mac OSX SERVER 10.2.4
Thanks in advance,
Ray A.
PS OUTPUT
---------------------------------------------------------------------------
root 468 0.0 0.3 30992 2152 ?? Ss 4Jun03 1:30.04
/usr/sbin/httpd
www 1743 0.0 1.2 222600 10032 ?? S 8:00AM 2:16.31
/usr/sbin/httpd
www 1767 0.0 1.1 220560 9592 ?? S 8:01AM 1:58.56
/usr/sbin/httpd
www 1806 0.0 1.1 215800 9588 ?? S 8:13AM 1:46.92
/usr/sbin/httpd
www 1876 0.0 1.1 210360 9532 ?? S 8:44AM 1:56.10
/usr/sbin/httpd
www 1878 0.0 1.3 224304 10904 ?? S 8:44AM 2:13.93
/usr/sbin/httpd
www 1879 0.0 1.2 219880 9912 ?? S 8:44AM 2:10.85
/usr/sbin/httpd
--- End Message ---
--- Begin Message ---
I'm using PHP 4.3.1 as an Apache module. No matter what I try, I can't get
set_error_handler() to do anything other than return false. Under what
circumstances does this happen?
<?php
function doobee($errno, $errstr, $errfile, $errline, $errcontext) {
echo "Handled.";
}
$retval = true;
if (($retval = set_error_handler("doobee")) == false) echo "Didn't work.";
// echos every time
?>
--
Jeff S.
--- End Message ---
--- Begin Message ---
On Mon, 2003-06-23 at 15:12, Jeff Stewart wrote:
> I'm using PHP 4.3.1 as an Apache module. No matter what I try, I can't get
> set_error_handler() to do anything other than return false. Under what
> circumstances does this happen?
>
> <?php
> function doobee($errno, $errstr, $errfile, $errline, $errcontext) {
> echo "Handled.";
> }
>
> $retval = true;
> if (($retval = set_error_handler("doobee")) == false) echo "Didn't work.";
> // echos every time
> ?>
Note that it's not necessarily returning false here; it could be 0, or
the empty string, or an empty array...use the '===' operator to test
whether two operands are of the same type and evaluate to the same
value.
http://www.php.net/manual/en/language.operators.comparison.php
Noting from the manual that set_error_handler() returns FALSE on error,
or the name of the previously defined error handler (if there was one)
on success, I am thinking it's probably just returning the empty
string--you likely didn't have an error handler set up before.
http://www.php.net/set_error_handler
So replace your '==' with '===' and you should be good to go.
Hope this helps,
Torben
> --
> Jeff S.
--
Torben Wilson <[EMAIL PROTECTED]> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
--- End Message ---
--- Begin Message ---
What tools do you recommend or use for a team
environment that will allow us to maintain source
control and even offer some version tracking/history
in case we need to go back to old code?
We need the ability to check-in and check-out files in
a team environment --- normally just HTML and PHP type
files.
We have a local windows server we can work from or a
Linux development server that is remote. Primarily
work is done in Dreamweaver and Flash.
Low or no cost would be ideal.
Thoughts or suggestions are appreciated.
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
--- End Message ---
--- Begin Message ---
J J wrote:
What tools do you recommend or use for a team
environment that will allow us to maintain source
control and even offer some version tracking/history
in case we need to go back to old code?
We need the ability to check-in and check-out files in
a team environment --- normally just HTML and PHP type
files.
We have a local windows server we can work from or a
Linux development server that is remote. Primarily
work is done in Dreamweaver and Flash.
Low or no cost would be ideal.
Thoughts or suggestions are appreciated.
CVS...
http://www.cvshome.org/
--- End Message ---
--- Begin Message ---
>What tools do you recommend or use for a team environment that will allow
>us to maintain source control and even offer some version
>tracking/history in case we need to go back to old code?
>
>We need the ability to check-in and check-out files in a team environment
>--- normally just HTML and PHP type files.
>
>We have a local windows server we can work from or a Linux development
>server that is remote. Primarily work is done in Dreamweaver and Flash.
>
>Low or no cost would be ideal.
CVS is your best friend - I wrote a brief intro (see links to info and
client software at the bottom) for evolt last month; read it here:
http://evolt.org/article/A_brief_introduction_to_CVS/21/60153/index.html
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html
--- End Message ---
--- Begin Message ---
CVS is a known versioning tool... it resides on a linuxx or unix server and
is free (from gnu) if I remember correctly
otherwise its a google search
----- Original Message -----
From: "J J" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 23, 2003 3:31 PM
Subject: [PHP] Source/version control?
> What tools do you recommend or use for a team
> environment that will allow us to maintain source
> control and even offer some version tracking/history
> in case we need to go back to old code?
>
> We need the ability to check-in and check-out files in
> a team environment --- normally just HTML and PHP type
> files.
>
> We have a local windows server we can work from or a
> Linux development server that is remote. Primarily
> work is done in Dreamweaver and Flash.
>
> Low or no cost would be ideal.
>
> Thoughts or suggestions are appreciated.
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I am using the below function (error_db) witch is called thus:-
function query_db( $sql, $db ) {
$result = mysql_query( $sql, $db ) or
error_db( $sql, $db );
return $result;
}
But $sqlerr is always blank (it is set with '$sqlerr = mysql_error( $db
);'). Any idea why?
Ben
function error_db( $sql, $db ) {
global $SERVER_NAME;
global $SCRIPT_NAME;
table_top( "Database Error" );
table_middle();
$sqlerr = mysql_error( $db );
echo "<b>SQL:</b>:<BR>$sql<br><b>Error:</b><BR>$sqlerr";
table_bottom();
// Clost of table/html from calling script
table_bottom();
html_footer();
// Send error via email
$msg =
"Database error has accured on $SERVER_NAME\n\n.".
"The error message is :-\n\n".
"SQL:$sql\n\nError:$sqlerr\n\n".
"This message was ".
"generated by '$SERVER_NAME$SCRIPT_NAME'";
$subj = "Database error from $SERVER_NAME";
// Hard coded to minimize chance of this module erroring
$to = "[EMAIL PROTECTED]";
$from = "From: ".$to;
mail( $to, $subj, $msg, $from );
die();
}
****************************************************************
* Ben Edwards Tel +44 (0)1179 553 551 ICQ 42000477 *
* Homepage - nothing of interest here http://gurtlush.org.uk *
* Webhosting for the masses http://www.serverone.co.uk *
* Critical Site Builder http://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online http://www.cultureshop.org *
* i-Contact Progressive Video http://www.videonetwork.org *
* Fun corporate graphics http://www.subvertise.org *
* Bristol Indymedia http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
****************************************************************
--- End Message ---