php-general Digest 25 Mar 2002 12:40:27 -0000 Issue 1247
Topics (messages 89952 through 90011):
Re: what's "undefined index" ?
89952 by: Martin Towell
89970 by: Jason Wong
Re: [PHP-DEV] Resume of my problem
89953 by: Zak Greant
mcrypt kills Apache children
89954 by: Thalis A. Kalfigopoulos
Why?
89955 by: Alberto Wagner
89956 by: Zak Greant
89959 by: Martin Towell
89962 by: maxwello.hotpop.com
89991 by: Matt Parlane
89994 by: Gunter Ohrner
90001 by: Arve Bersvendsen
Re: Retrieving POP mail
89957 by: Kearns, Terry
Text Editor
89958 by: Hiroshi Ayukawa
89964 by: Yasuo Ohgaki
89968 by: Tyler Longren
Re: [NEWMAN] Why?
89960 by: Philip J. Newman
problem with multiple cookies, PHP, and proxypass under apache
89961 by: Vincent Cunniffe
89965 by: Tom Rogers
89966 by: Tom Rogers
89969 by: Vincent Cunniffe
Image Displayed From Database
89963 by: Shaun Martinec
89975 by: Miguel Cruz
Creating an SQL database and finding the path to SQL
89967 by: Ivan Olson
Re: Image manipulation with PHP on RHLinux 7.1
89971 by: Jason Wong
Re: Trouble with mysql_pconnect unable to connect to database?
89972 by: Jim Hankins
Re: Non-Cache in forms?
89973 by: David Robley
Re: Displaying a 2 column html table with N elements
89974 by: David Robley
Form & POST
89976 by: Kevin Maynard
89979 by: Jason Wong
Re:[PHP] Why?
89977 by: Liam
Re:[2] [PHP] Text Editor
89978 by: Liam
How to use bind arguments
89980 by: Vincent Bergeron
89983 by: Martin Towell
When Click a HyperLink, Promp password before Showing the Page
89981 by: Jack
89982 by: Justin French
Is there anyway to save a file into Mysql database
89984 by: Jack
Regular Expression Challenge
89985 by: Cameron Just
89987 by: Thalis A. Kalfigopoulos
89989 by: Matt Moreton
89990 by: Matt Moreton
mail...
89986 by: Mantas Kriauciunas
How to Pass the Username which from Windows Login
89988 by: Jack
Re: Does anybody use UltraDev?
89992 by: Philippe Saladin
>From To to BCC in a Mail script
89993 by: anti-blank
89995 by: Jason Wong
89999 by: Justin French
Re: Rebuilding PHP4 with IBM DB2 Support Causes Apache to Die Upon Restart
89996 by: Josep Raurell
e-mail list app
89997 by: Michael A. Peters
Resume/recover uploads in PHP 4.2 ? WAS: RE: upload forms, how much was uploaded
before upload fails..
89998 by: Jimmy Lantz
Empty strings
90000 by: Manuzhai
Re: Still REG EX
90002 by: liljim
No php being built...
90003 by: rjp.sedric.demon.co.uk
HELP ME PLEASE: php not run on IIS 4.0
90004 by: Berlina
Re:[PHP] HELP ME PLEASE: php not run on IIS 4.0
90005 by: Liam
File Upload
90006 by: David McInnis
[newbie] Something is messed up, anybody can help?
90007 by: Mantas Kriauciunas
Uploading files without an HTML form
90008 by: Sam Rose
php 4.1.2 XSLT on solaris
90009 by: ghislain MUKOKA
MS Access data => mySQL database
90010 by: Thomas Edison Jr.
reg-ex
90011 by: John Fishworld
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 ---
"undefined variable" is when you try to use a variable before you set it, eg
$foobar
"undefined index" is when you try to reference an array index before you set
it, eg $foobar[10]
-----Original Message-----
From: Kai Schaetzl [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 11:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] what's "undefined index" ?
When I enable display of warnings I get an "undefined index" warning
instead of an "undefined variable" for some variables.
Why and what's the difference?
Warning: Undefined index: KundeRemark in
C:\Server\www\conadmin\admin-beta\lib\kunden_functions.inc on line
138
Warning: Undefined variable: KundeStatusNeu_show in
C:\Server\www\conadmin\admin-beta\lib\kunden_functions.inc on line
192
Kai
--
Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com
IE-Center: http://ie5.de & http://msie.winware.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Monday 25 March 2002 08:35, Martin Towell wrote:
> "undefined variable" is when you try to use a variable before you set it,
> eg $foobar
> "undefined index" is when you try to reference an array index before you
> set it, eg $foobar[10]
Just to extend the explanation further. The most common cause of undefined
index is the use of unquoted array keys:
$doo = array('dah' => 'dib');
echo $doo[dah]; # incorrect, undefined index error
echo $doo['dah']; # correct, no error
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
Life is a game of bridge -- and you've just been finessed.
*/
--- End Message ---
--- Begin Message ---
On March 25, 2002 01:50, you wrote:
> HI,
>
> I have a functino write in c, like as:
>
> void addvalue ( int a, int b, int *c )
> {
> *c = a + b;
> }
>
> in php
>
> <?
>
> phpinclude ("alexlib");
> addvalue ( 1, 2, c );
> print ( "Value c = $c ");
>
> ?>
>
> what the procedure to make this ?
To briefly answer your question:
You could write code like this:
function av ($a, $b, &$c) {
$c = $a + $b;
}
For more information, review the section on References
and Functions in the PHP manual.
--zak
--- End Message ---
--- Begin Message ---
I have PHP4.1.2 with libmcrypt4.2.22. I had a script that worked just fine yesterday
testing an mcrypt scenario, and (of course) today it just kills the httpd serving the
page and I get this in error_log:
[Sun Mar 24 08:31:36 2002] [notice] child pid 1049 exit signal Segmentation fault (11)
The script looks more or less as follows:
$input="text";
$key="key";
$enc_descr=mcrypt_module_open(MCRYPT_RIJNDAEL_256,"",MCRYPT_MODE_CBC,"");
srand((double)microtime()*1000000);
$init_vector=mcrypt_create_iv(mcrypt_enc_get_iv_size($enc_descr),MCRYPT_RAND);
mcrypt_generic_init($enc_descr,$key,$init_vector);
$max_key_len=mcrypt_enc_get_key_size($enc_descr);
if(strlen($key)>=$max_key_len){
//truncate the key to a valid length
$key=substr($key,0,$max_key_len);
}
$encrypted_data=mcrypt_generic($enc_descr,$input);
$base64enc_encrypted_data=base64_encode($encrypted_data);
mcrypt_generic_end($enc_descr);
Something I'm missing? I found somewhere on the mcrypt page saying "compile with
--disable-posix-threads". Can anyone verify this is the problem before I get into
recompiling everything?
TIA,
thalis
--- End Message ---
--- Begin Message ---
Why everyone uses $foo or $foobar as examples?
--- End Message ---
--- Begin Message ---
On March 31, 2002 04:39, Alberto Wagner wrote:
> Why everyone uses $foo or $foobar as examples?
http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=foo
--zak
--- End Message ---
--- Begin Message ---
could also use $blah, $test, $temp, $xxx, etc, but it's what a lot of are
used to, I guess
-----Original Message-----
From: Zak Greant [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 12:16 PM
To: Alberto Wagner; Php General Mailling List
Subject: Re: [PHP] Why?
On March 31, 2002 04:39, Alberto Wagner wrote:
> Why everyone uses $foo or $foobar as examples?
http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=foo
--zak
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
See also:
http://www.tuxedo.org/~esr/jargon/html/entry/metasyntactic-variable.html
Maxwell
> > Why everyone uses $foo or $foobar as examples?
>
> http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=foo
--- End Message ---
--- Begin Message ---
There's even an RFC published on this:
http://www.faqs.org/rfcs/rfc3092.html
Matt
"Alberto Wagner" <[EMAIL PROTECTED]> wrote in message
878USUPYSS0CQKNLWUHCFBEBFCJD.3ca676e7@alberto">news:878USUPYSS0CQKNLWUHCFBEBFCJD.3ca676e7@alberto...
> Why everyone uses $foo or $foobar as examples?
>
>
>
--- End Message ---
--- Begin Message ---
Matt Parlane wrote:
> There's even an RFC published on this:
> http://www.faqs.org/rfcs/rfc3092.html
"1 April 2001"? ;)
The HTTP-based network protocol for controlling coffee machines was not bad,
either.
I'm already really curious for the RFC published this April, the 1th. :-)
Greetinx,
Gunter Ohrner
--
Nanny Ogg looked him up and down or, at least, down and further down.
"You're a dwarf," she said. -- Nanny Ogg meets Casanunda
(Terry Pratchett, Witches Abroad)
-+-+-+-+-+- PDEPP Webserver: http://pdepp.SourceForge.net/ -+-+-+-+-+-
--- End Message ---
--- Begin Message ---
Gunter Ohrner wrote:
> The HTTP-based network protocol for controlling coffee machines
> was not bad, either.
Which we seriously considered implementing here at my job. But: A
webcam and a pair of legs suffices.
--
Arve X-No-Archive? Never
He's the greatest cowboy of them all
--- End Message ---
--- Begin Message ---
>
> Did you read php.net/imap_open ?
I only just found this. I've been going through the functions and there a so
many of them (a good thing) that I couldn't find the information I needed.
Now that I have read the imap_open() function, I feel a bit silly about
saying the doco is sparse.
Now I'm trying to figure out how to list the messages in that mailbox.
All I want is a way to "list all messages" then I can use the other
functions to retrieve the details.
Don't worry, I think I will eventually figure it out.
When I do, I'll have to make a tutorial so others can also see an example of
a simple application of mailbox checking.
I must say, the range of functions is quite impressive :)
[TK]
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 25 March 2002 11:04 AM
> To: Kearns, Terry
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Retrieving POP mail
>
>
> Did you read php.net/imap_open ?
>
> On Mon, 25 Mar 2002, Kearns, Terry wrote:
>
> > The documentation for the IMAP functions is, er, virtually
> > non-existent. I'm not looking to read several sets of RFCs - all I
> > want to do it check a POP account on Exchange for messages and
> > retrieve them.
> >
> > Does anyone know if there is a tutorial on this somewhere?
> >
> >
> > [TK]
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
--- End Message ---
--- Begin Message ---
Hello,
What text editor do you use to write PHP?
I use Maruo editor http://www.ac.wakwak.com/~tetsuyat/maruo/ more than 1
year.
Is there any better text editor for PHP?
Thanks,
Hiroshi Ayukawa
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top
--- End Message ---
--- Begin Message ---
Hiroshi Ayukawa wrote:
> Hello,
>
> What text editor do you use to write PHP?
> I use Maruo editor http://www.ac.wakwak.com/~tetsuyat/maruo/ more than 1
> year.
> Is there any better text editor for PHP?
Emacs is _much_ better than HideMaru.
I use emacs for most text editing. If you need multi byte char
under windows, use Meadow (it's a Emacs(Mule) for Windows, kind of).
I use php-mode/folding-mode for PHP sources.
If you are looking for IDE, ZendStudio is the way to go.
--
Yasuo Ohgaki
--- End Message ---
--- Begin Message ---
If you want a regular text editor, I suggest Textpad or Context.
If you want an IDE, I suggest Maguma.
Tyler
----- Original Message -----
From: "Hiroshi Ayukawa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 24, 2002 7:27 PM
Subject: [PHP] Text Editor
> Hello,
>
> What text editor do you use to write PHP?
> I use Maruo editor http://www.ac.wakwak.com/~tetsuyat/maruo/ more than 1
> year.
> Is there any better text editor for PHP?
>
> Thanks,
> Hiroshi Ayukawa
> http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Good good question?
----- Original Message -----
From: "Alberto Wagner" <[EMAIL PROTECTED]>
To: "Php General Mailling List" <[EMAIL PROTECTED]>
Sent: Sunday, March 31, 2002 2:39 PM
Subject: [PHP] Why?
> Why everyone uses $foo or $foobar as examples?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
Hi,
I have an apache server which is configured to pass some requests through to a
secondary, chrooted apache server. For each virtual domain that passes through,
I have an entry in httpd.conf which looks like :
ProxyPass / http://domain.hosted.mydomain.com/
ProxyPassReverse / http://domain.hosted.mydomain.com/
Now, everything runs fine in the secondary server, which has an identical config
to the first apart from being chrooted. (Identical means that a diff of the two
config files shows paths only).
However, when a PHP page on the secure server creates more than one cookie and
attempts to pass it back through the proxy to the client, it doesn't appear. On
the possibility that it might be a browser issue, I grabbed the raw return data,
and in fact, there is only one cookie header returned. No matter how many cookies
I create in PHP, whether multidimensional or of different names, only the very
last one returns to the client.
If anyone can shed light on this problem, I'd be very grateful.
The full system config is :
Linux 2.2.19, uniprocessor
Apache 1.3.24
PHP 4.2
Regards,
Vincent
--- End Message ---
--- Begin Message ---
Hi
This may solve your problem
http://archive.covalent.net/apache-bugdb/2000/05/0082.xml
Tom
At 12:09 PM 25/03/2002, Vincent Cunniffe wrote:
>Hi,
>
>I have an apache server which is configured to pass some requests through to a
>secondary, chrooted apache server. For each virtual domain that passes
>through,
>I have an entry in httpd.conf which looks like :
>
> ProxyPass / http://domain.hosted.mydomain.com/
> ProxyPassReverse / http://domain.hosted.mydomain.com/
>
>Now, everything runs fine in the secondary server, which has an identical
>config
>to the first apart from being chrooted. (Identical means that a diff of
>the two
>config files shows paths only).
>
>However, when a PHP page on the secure server creates more than one cookie and
>attempts to pass it back through the proxy to the client, it doesn't
>appear. On
>the possibility that it might be a browser issue, I grabbed the raw return
>data,
>and in fact, there is only one cookie header returned. No matter how many
>cookies
>I create in PHP, whether multidimensional or of different names, only the very
>last one returns to the client.
>
>If anyone can shed light on this problem, I'd be very grateful.
>
>The full system config is :
>
> Linux 2.2.19, uniprocessor
> Apache 1.3.24
> PHP 4.2
>
>Regards,
>
>Vincent
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi
Found this follow up too
http://archive.covalent.net/apache-bugdb/2000/05/0084.xml
Tom
At 12:09 PM 25/03/2002, Vincent Cunniffe wrote:
>Hi,
>
>I have an apache server which is configured to pass some requests through to a
>secondary, chrooted apache server. For each virtual domain that passes
>through,
>I have an entry in httpd.conf which looks like :
>
> ProxyPass / http://domain.hosted.mydomain.com/
> ProxyPassReverse / http://domain.hosted.mydomain.com/
>
>Now, everything runs fine in the secondary server, which has an identical
>config
>to the first apart from being chrooted. (Identical means that a diff of
>the two
>config files shows paths only).
>
>However, when a PHP page on the secure server creates more than one cookie and
>attempts to pass it back through the proxy to the client, it doesn't
>appear. On
>the possibility that it might be a browser issue, I grabbed the raw return
>data,
>and in fact, there is only one cookie header returned. No matter how many
>cookies
>I create in PHP, whether multidimensional or of different names, only the very
>last one returns to the client.
>
>If anyone can shed light on this problem, I'd be very grateful.
>
>The full system config is :
>
> Linux 2.2.19, uniprocessor
> Apache 1.3.24
> PHP 4.2
>
>Regards,
>
>Vincent
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Tom Rogers wrote:
> Hi
> This may solve your problem
> http://archive.covalent.net/apache-bugdb/2000/05/0082.xml
Thanks for this and the followup : unfortunately the second patch is
actually incorporated into the main Apache code now, so that's not the
problem.
Also, I've now confirmed that the problem occurs at the proxy rewrite
stage out in the main Apache server, so it's not actually a PHP issue
at all.
I'll go bother the httpd folks so ;-)
regards,
Vin
--- End Message ---
--- Begin Message ---
I'm using mysql to store images that I load through a script called
photo.php. I pass it the ID and it displays the image. No problem. However,
when I right-click on the image in my browser (IE6) and choose properties,
it doesn't seem to recognize the format or size even though I'm sending
Content-Type and Content-Length headers. Are there additional headers I need
to send to get this functionalily or is it just because the file extension
of the script is .php and not .gif or .jpg? Also when I right-click and
choose "Save As" it only lets me save as a bmp. Again, it displays fine, I
would just like to make it work like a real image.
--- End Message ---
--- Begin Message ---
On Sun, 24 Mar 2002, Shaun Martinec wrote:
> I'm using mysql to store images that I load through a script called
> photo.php. I pass it the ID and it displays the image. No problem. However,
> when I right-click on the image in my browser (IE6) and choose properties,
> it doesn't seem to recognize the format or size even though I'm sending
> Content-Type and Content-Length headers. Are there additional headers I need
> to send to get this functionalily or is it just because the file extension
> of the script is .php and not .gif or .jpg? Also when I right-click and
> choose "Save As" it only lets me save as a bmp. Again, it displays fine, I
> would just like to make it work like a real image.
Internet Explorer is very dumb about internet file types - it thinks the
whole world plays the DOS game of identifying files by the end of the
name ("extensions" or whatever they call it). You can fool it by providing
a URL that appears to belong to a certain file type. For instance, instead
of making a link to "imagedisplay.php?id=45", make a link that points to
"imagedisplay.php/picture.jpg?id=45". PHP will still find your
imagedisplay.php script, and IE will be happy too.
miguel
--- End Message ---
--- Begin Message ---
Forgive me for being so new, But i dont know where to start or where to
start to look for this...
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
--- End Message ---
--- Begin Message ---
On Monday 25 March 2002 08:06, Dale & Lora Marshall wrote:
> I guess I should clarify. If the image that's referenced in the
> database is, for example, 700x300, I want to reduce it to 600
> pixels wide, keeping the height proportional. Then, save that
> image to a new name somewhere else in the filesytem. Then I want
> to reduce the image further to 300 pixels wide, again keeping the
> height proportional. And save that image elsewhere.
Manual > Image functions
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
The light at the end of the tunnel may be an oncoming dragon.
*/
--- End Message ---
--- Begin Message ---
No, the @ was in the right place (if memory serves me the book said this
suppresses the error output.) The problem was my sock file was not in the
default location so I had to specify it. If you check the thread the answer
is there on how to find where your sock is located.
Best Regards,
Jim Hankins
"Gerard Samuel" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is that supposed to be ->
> $db = @mysql_pconnect("localhost", "bookorama", "bookorama123");
>
> Jim Hankins wrote:
> > I'm doing a simple database connection using the follow syntax:
> >
> > <html>
> > <head>
> > <title>Book-O-Rama Search Results</title>
> > </head>
> > <body>
> > <h1>Book-O-Rama Search Results</h1>
> > <?
> > if (!$searchtype || !$searchterm)
> > {
> > echo "You have not entered search details. Please go back and try
> > again.";
> > exit;
> > }
> >
> > $searchtype = addslashes($searchtype);
> > $searchterm = addslashes($searchterm);
> >
> > @ $db = mysql_pconnect("localhost", "bookorama", "bookorama123");
> >
> > if (!$db)
> > {
> > echo "Error: Could not connect to database. Please try again
later.";
> > exit;
> > }
> >
> > When I go to the search page and hit submit (after removing the @ to
see an
> > error on the mysql_pconnect line)
> > I get Warning: Can't connect to local MySQL server through socket
> > '/tmp/mysql.sock' (2) in
/home/jhankins/public_html/mydirectory/results.php
> > on line 17
> >
> > I can telnet to the host and with the same username and password access
the
> > database tables etc. What gives? I'm using
> > 4.0.6 of PHP and apache under Redhat Linux 7.2. Mysql is working fine
from
> > command line and remote via odbc?
> >
> > Also tryed mysql_connect with same problem.
> >
> >
> >
> >
> >
> >
>
>
--- End Message ---
--- Begin Message ---
In article <001801c1d38d$6b016eb0$0201a8c0@zaireweb>,
[EMAIL PROTECTED] says...
> Alright,
>
> When I submit a form, and shoot out an error, such as "Please fill in email address"
>and then send them back to the form, the form seems to be blank...
>
> Why? What is happening that the form isn't keeping the previously posted data?
>
> My error function looks like so
>
> function crapout($msg, $hidden_msg = FASE) {
> echo($msg);
> if($hidden_msg != "FALSE") {
> echo('<!-- ' . $hidden_msg . ' -->');
> }
> exit;
> }
>
> Thanks,
> Eric Coleman
>
You are aware that exit halts execution of the script?
--
David Robley
Temporary Kiwi!
Quod subigo farinam
--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
says...
> Hello,
>
> I am trying to display a HTML table of 2 cells with "n" elements... This means
> an unknown number of lines.
>
> I need to use 2 FOR loops (one to determine the number of <TR> and one to
> create the 2 cells needed). This is a bit to overwellming for me...
>
> I have:
>
> $result = connect_db("select prod_id,photo from prod where cat_id=1");
> $Rows = pg_NumRows($result);
> $lines_TOT = ceil($Rows/2);
>
>
> for($TR=0; $TR < $ligne_TOT; $TR++){
> print "<tr>\n";
>
> for($TD=0; $TD < 2;$TD++){
> $photo=pg_Result($result,$TD,photo);
> $prod_id=pg_Result($result,$TD,prod_id);
> print "<td>";
> if ($prod_id != ""){
> print "<img src=\"../photo/". $photo. "s.jpg\" border=0>\n";
> } else {
> print " ";
> }
> print "</td>";
> }
> }
>
>
> As you can see, the second loop cant continue to display the next product... So
> the first line with the 2 images are ok but the other lines are identical, so
> if I have 10 products, I see only 1 and 2 over 5 lines!
>
> How can I solve this? To have 2 columns per line, I must limit the loop but I
> need to continue at that point on the second line...
>
> Thank you for any assistance!
>
What about something like:
<TABLE><TR>
<?php
$i = 1; // This is counter for number of records processed
$items = 2; // how many cells per row
$result = connect_db("select prod_id,photo from prod where cat_id=1");
while($row = pg_fetch_array($result, PGSQL_ASSOC)) {
extract($row);
if($i % $items == 0) {
echo '</TR><TR>';
}
echo '<TD><img src="../photo/'. $photo. 's.jpg" border=0></TD>\n";
$i++;
}
?>
</TR></TABLE>
Uses the modulus operator to keep track of how many rosws/columns you
have. Untested, of course.
--
David Robley
Temporary Kiwi!
Quod subigo farinam
--- End Message ---
--- Begin Message ---
Maybe someone can shed some light on this. I have a form to handle a file
upload, but through the same form I would like to gather data as well. For
example, ID, Price & Picture.
Now I set up my form to handle the file upload, and that all works great,
but I can't seem to access the other variables. Can I use for form to
collect data and files?
My code is as follows:
<File 1>
<form name="Update" enctype="multipart/form-data" action="Update2.php"
method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" colspan="4" nowrap>
<table border="0" cellpadding="0" cellspacing="4" width="100%">
<tr>
<td width="205" rowspan="7" valign="middle">
<b>Input Picture Here:</b><br>
<INPUT TYPE="FILE" NAME="userfile" SIZE="35">
</td>
<td width="*" valign="middle">
<b>Price:</b><br>
<INPUT TYPE="TEXT" NAME="Price" SIZE="10">
</td>
<...>
<File #2>
global $HTTP_POST_FILES;
//Update Listing
$Price = $HTTP_POST_VARS['Price'];
if(!empty($HTTP_POST_FILES['userfile']['tmp_name'])) {
$filename = $HTTP_POST_FILES['userfile']['tmp_name'];
$newname = "/images/".$ID."_01.jpg";
copy($HTTP_POST_FILES['userfile']['tmp_name'],$newname);
}
<...>
Now whether I use the $Price alone or $HTTP_POST_VARS['Price'] I get
nothing.
Thanks,
Kevin
--- End Message ---
--- Begin Message ---
On Monday 25 March 2002 12:47, Kevin Maynard wrote:
> Maybe someone can shed some light on this. I have a form to handle a file
> upload, but through the same form I would like to gather data as well. For
> example, ID, Price & Picture.
>
> Now I set up my form to handle the file upload, and that all works great,
> but I can't seem to access the other variables. Can I use for form to
> collect data and files?
[snip]
> Now whether I use the $Price alone or $HTTP_POST_VARS['Price'] I get
> nothing.
If you're using php > 4.0.6 then use $_POST[] instead of $HTTP_POST_VARS[].
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
"Hello," he lied.
-- Don Carpenter, quoting a Hollywood agent
*/
--- End Message ---
--- Begin Message ---
25/03/2002 3:01:36 PM
"FBAR" was a term used in the second world war.
It turned into "FUBAR" for better pronounciation.
"FUBAR" turned into "FOO BAR"
FBAR stands for:
Fucked Beyond All Recognition
I hope you find this completely unrelated snippet
of trivial knowledge amusing, as I certainly do :-)
Alberto Wagner <[EMAIL PROTECTED]> wrote on 31/03/2002 2:39:35 AM:
>
>Why everyone uses $foo or $foobar as examples?
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
25/03/2002 3:05:00 PM
Editplus is the best
www.editplus.com
"Tyler Longren" <[EMAIL PROTECTED]> wrote on 25/03/2002 3:34:22 AM:
>
>If you want a regular text editor, I suggest Textpad or Context.
>
>If you want an IDE, I suggest Maguma.
>
>Tyler
>
>----- Original Message -----
>From: "Hiroshi Ayukawa" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, March 24, 2002 7:27 PM
>Subject: [PHP] Text Editor
>
>
>> Hello,
>>
>> What text editor do you use to write PHP?
>> I use Maruo editor http://www.ac.wakwak.com/~tetsuyat/maruo/ more than 1
>> year.
>> Is there any better text editor for PHP?
>>
>> Thanks,
>> Hiroshi Ayukawa
>> http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top
>>
>>
>> --
>> 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 ---
Hi!
A function like this one:
function SendQuery($li_connect, $ls_query, $args)
{
return ibase_query($li_connect, $ls_query, $args);
}
ibase_query is an Interbase function which declaration is:
int ibase_query ( [int link_identifier, string query [, int bind_args]])
Why can't something like this be done? Is there a way to pass to a function
a variable parameter and then use the complete set as another function
parameter?
Thanks
VB
--- End Message ---
--- Begin Message ---
I don't know if this is the thing you're after, but...
http://www.php.net/manual/en/function.func-get-args.php
HTH
Martin
-----Original Message-----
From: Vincent Bergeron [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 4:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to use bind arguments
Hi!
A function like this one:
function SendQuery($li_connect, $ls_query, $args)
{
return ibase_query($li_connect, $ls_query, $args);
}
ibase_query is an Interbase function which declaration is:
int ibase_query ( [int link_identifier, string query [, int bind_args]])
Why can't something like this be done? Is there a way to pass to a function
a variable parameter and then use the complete set as another function
parameter?
Thanks
VB
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Dear all
Can someone pls tell me how i can make a behavior in php which when a user
click on a hyperlink, then a page for login will appear first and then once
the username and password is right, the page of which user aiming to browse
will show, otherwise a error message will tell the user that the username
or password ar not correct.
I know it will be easy if there is only one hyperlink, but what happen if
there are many of them?
Thx very much
Jack
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
The action you want shouldn't really take effect on the client side
(hyperlink) itself, because this would no doubt rely on JavaScript and would
be pathetically insecure.
Instead, what you need to think about is protecting certain pages with a
username password, and *possibly* maintaining this user/data in sessions, so
they only have to do it once.
There is a pretty good tutorial on this exact topic on Site Point:
http://www.WebmasterBase.com/article/319
I used this tutorial and code base as the basis of my own session management
and user login stuff.
It does use MySQL to maintain the users in a table, but the principal of how
he works with headers and exits could be applied to a flat file of
user/password records.
Note: it does use cookies, which you may or may not consider an issue.
Justin French
--------------------
Creative Director
http://Indent.com.au
--------------------
on 25/03/02 4:49 PM, Jack ([EMAIL PROTECTED]) wrote:
> Dear all
> Can someone pls tell me how i can make a behavior in php which when a user
> click on a hyperlink, then a page for login will appear first and then once
> the username and password is right, the page of which user aiming to browse
> will show, otherwise a error message will tell the user that the username
> or password ar not correct.
> I know it will be easy if there is only one hyperlink, but what happen if
> there are many of them?
>
> Thx very much
> Jack
> [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
Dear all
Can someone pls tell me is php will be able to grep text from MS Word and
then save that word file into MYSQL database? Which means is MYSQL will be
able to store files into it's table?
Thx a lot
jack
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi,
I am trying to pull out the following information via a regular expression.
The string I am searching on is 'wed-thurs 9:35, 14:56, 18:35'
and I want it to retreive
wed
thurs
9:35
14:56
18:35
The regular expression I am using is
([a-z]+)-([a-z]+) +([0-9]{1,2}:?[0-9]{0,2})[, ]*
It seems to be grabbing the
wed
thurs
9:35
but I can't seem to retrieve the rest of the times.
Anyone have any ideas?
BTW
There can be any number of 'times' in the string and also the 'times' can
be with or without the colon and the minutes, hence the '}:?[0-9]{0,2}'
part of the regexp.
--- End Message ---
--- Begin Message ---
Why a regexpr?
Do one explode() on the " "
Clean up the commas from the elements [1],[2] & [3] of the returned array
and on element[0] do an additional explode on "-"
cheers,
--t.
On Mon, 25 Mar 2002, Cameron Just wrote:
> Hi,
>
> I am trying to pull out the following information via a regular expression.
>
> The string I am searching on is 'wed-thurs 9:35, 14:56, 18:35'
>
> and I want it to retreive
> wed
> thurs
> 9:35
> 14:56
> 18:35
>
> The regular expression I am using is
> ([a-z]+)-([a-z]+) +([0-9]{1,2}:?[0-9]{0,2})[, ]*
>
> It seems to be grabbing the
> wed
> thurs
> 9:35
> but I can't seem to retrieve the rest of the times.
>
> Anyone have any ideas?
>
> BTW
> There can be any number of 'times' in the string and also the 'times' can
> be with or without the colon and the minutes, hence the '}:?[0-9]{0,2}'
> part of the regexp.
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Perl Compatible Regular Expression:
"/'([a-z]+)-([a-z]+)\s([0-9]+:[0-9]+),\s([0-9]+:[0-9]+),\s([0-9]+:[0-9]+)'/"
Assuming the days of the week are always lower case? if not then use
[a-zA-Z] for the day matching.
Hope this helps.
--
Matt.
----- Original Message -----
From: "Cameron Just" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 25, 2002 6:15 AM
Subject: [PHP] Regular Expression Challenge
> Hi,
>
> I am trying to pull out the following information via a regular
> expression.
>
> The string I am searching on is 'wed-thurs 9:35, 14:56, 18:35'
>
> and I want it to retreive
> wed
> thurs
> 9:35
> 14:56
> 18:35
>
> The regular expression I am using is
> ([a-z]+)-([a-z]+) +([0-9]{1,2}:?[0-9]{0,2})[, ]*
>
> It seems to be grabbing the
> wed
> thurs
> 9:35
> but I can't seem to retrieve the rest of the times.
>
> Anyone have any ideas?
>
> BTW
> There can be any number of 'times' in the string and also the 'times' can
> be with or without the colon and the minutes, hence the '}:?[0-9]{0,2}'
> part of the regexp.
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Oh, I didnt read the bit at the bottom about the times appearing any number
of times. Off the top of my head I think this should work...
PREG:
"/'([a-z]+)-([a-z]+)\s(?:([0-9]+(?::[0-9]+|))(?:,\s)?)*'/"
--
Matt
----- Original Message -----
From: "Cameron Just" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 25, 2002 6:15 AM
Subject: [PHP] Regular Expression Challenge
> Hi,
>
> I am trying to pull out the following information via a regular
expression.
>
> The string I am searching on is 'wed-thurs 9:35, 14:56, 18:35'
>
> and I want it to retreive
> wed
> thurs
> 9:35
> 14:56
> 18:35
>
> The regular expression I am using is
> ([a-z]+)-([a-z]+) +([0-9]{1,2}:?[0-9]{0,2})[, ]*
>
> It seems to be grabbing the
> wed
> thurs
> 9:35
> but I can't seem to retrieve the rest of the times.
>
> Anyone have any ideas?
>
> BTW
> There can be any number of 'times' in the string and also the 'times' can
> be with or without the colon and the minutes, hence the '}:?[0-9]{0,2}'
> part of the regexp.
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hey PHP General List,
Why do i get 5 copies of each email? not always but sometime 3
sometimes 2 sometimes 5. Is this the only me (coz something is
messed up with mail server or mail client) or some ppl also gets
more than one
:------------------------------:
Have A Nice Day!
Mantas Kriauciunas A.k.A mNTKz
Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt
--- End Message ---
--- Begin Message ---
Dear all
I want to prevent user to make another login before they can browse the
Intranet, so is there anyway that php can grep the username from the windows
Login or Domain Login?
Which means if a user can login to the Windows NT, then he/she will have the
right to browse the Intranet!
Thx a lot
Jack
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
People in my company use Dreamweaver for static pages, so it was evident for
us to use Dreamweaver UltraDev (with PHAkt app server extension) to help
building php pages.
Nevertheless, in fact, we use UltraDev to design the pages (great tool for
the layout), but often something like Html-Kit or UltraEdit for the php
code.
Regards,
Philippe
"....::: Rober2 :::...." <[EMAIL PROTECTED]> a écrit dans le message news:
[EMAIL PROTECTED]
> Hey!
>
> Does anybody use UltraDev for PHP?
> Any comments about it?
>
> (Personally I go for Visual PHP Studio)
>
>
--- End Message ---
--- Begin Message ---
I've got this script here to send out a mail whenever I enter an update to my site to
my mailing list.
The problem is it wants to dump everyone's email into the To field, and since I don't
want to give my
users email addresses away I need to convert this to the bcc field. Below is the
original code and then
the modification that I made (which doesn't seem to work). Also if anyone has any
idea how to include
in this block a line to tell php to send this as HTML email as well that would be even
more helpful.
Thanks.
ORIGINAL CODE:
$mailpost = $mailpost;
$mailpost = str_replace("{setting_site_name}", $setting_site_name, $mailpost);
$mailpost = str_replace("{setting_site_url}", $setting_site_url, $mailpost);
$mailpost = str_replace("{setting_mail_email}", $setting_mail_email, $mailpost);
$mailpost = str_replace("{post_poster}", $cookie_username, $mailpost);
$mailpost = str_replace("{post_headline}", $headline, $mailpost);
$mailpost = str_replace("{post_date}", date("M d, Y", time()), $mailpost);
$mailpost = str_replace("{post_post}", $post, $mailpost);
$to = "";
$query = mysql_query("SELECT * FROM members");
while ($member = mysql_fetch_array($query)) {
if ($to == "") {$to = $member['email'];}
else {$to .= ", " . $member['email'];}
}
$from = "from: " . $setting_mail_email;
mail ($to, $setting_site_name, $mailpost, $from) or $emailsuccess = "Failure sending
email.";
if ($emailsuccess == "") {$emailsuccess = "Email Sent Successfully.";}
}
My MODIFIED CODE:
$mailpost = $mailpost;
$mailpost = str_replace("{setting_site_name}", $setting_site_name, $mailpost);
$mailpost = str_replace("{setting_site_url}", $setting_site_url, $mailpost);
$mailpost = str_replace("{setting_mail_email}", $setting_mail_email, $mailpost);
$mailpost = str_replace("{post_poster}", $cookie_username, $mailpost);
$mailpost = str_replace("{post_headline}", $headline, $mailpost);
$mailpost = str_replace("{post_date}", date("M d, Y", time()), $mailpost);
$mailpost = str_replace("{post_post}", $post, $mailpost);
$bcc = "";
$query = mysql_query("SELECT * FROM members");
while ($member = mysql_fetch_array($query)) {
if ($bcc == "") {$bcc = $member['email'];}
else {$bcc .= ", " . $member['email'];}
}
$from = "from: " . $setting_mail_email;
mail ($bcc, $setting_site_name, $mailpost, $from) or $emailsuccess = "Failure sending
email.";
if ($emailsuccess == "") {$emailsuccess = "Email Sent Successfully.";}
}
--- End Message ---
--- Begin Message ---
On Monday 25 March 2002 15:31, anti-blank wrote:
> I've got this script here to send out a mail whenever I enter an update to
> my site to my mailing list. The problem is it wants to dump everyone's
> email into the To field, and since I don't want to give my users email
> addresses away I need to convert this to the bcc field. Below is the
> original code and then the modification that I made (which doesn't seem to
> work). Also if anyone has any idea how to include in this block a line to
> tell php to send this as HTML email as well that would be even more
> helpful. Thanks.
[snip]
> My MODIFIED CODE:
> $mailpost = $mailpost;
> $mailpost = str_replace("{setting_site_name}", $setting_site_name,
> $mailpost); $mailpost = str_replace("{setting_site_url}",
> $setting_site_url, $mailpost); $mailpost =
> str_replace("{setting_mail_email}", $setting_mail_email, $mailpost);
> $mailpost = str_replace("{post_poster}", $cookie_username, $mailpost);
> $mailpost = str_replace("{post_headline}", $headline, $mailpost);
> $mailpost = str_replace("{post_date}", date("M d, Y", time()), $mailpost);
> $mailpost = str_replace("{post_post}", $post, $mailpost);
> $bcc = "";
> $query = mysql_query("SELECT * FROM members");
> while ($member = mysql_fetch_array($query)) {
> if ($bcc == "") {$bcc = $member['email'];}
> else {$bcc .= ", " . $member['email'];}
> }
> $from = "from: " . $setting_mail_email;
> mail ($bcc, $setting_site_name, $mailpost, $from) or $emailsuccess =
> "Failure sending email."; if ($emailsuccess == "") {$emailsuccess = "Email
> Sent Successfully.";} }
Forgive me if I'm wrong, but all it seems you have done is used a different
variable name to hold the list of recipients (from $to to $bcc). That in
itself is hardly likely to change the behaviour of mail() to do what you want.
Read the manual *again* (you have already read it haven't you?) for how to
use cc: and bcc: in mail().
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
After your lover has gone you will still have PEANUT BUTTER!
*/
--- End Message ---
--- Begin Message ---
on 25/03/02 6:31 PM, anti-blank ([EMAIL PROTECTED]) wrote:
> I've got this script here to send out a mail whenever I enter an update to my
> site to my mailing list.
> The problem is it wants to dump everyone's email into the To field, and since
> I don't want to give my
> users email addresses away I need to convert this to the bcc field. Below is
> the original code and then
> the modification that I made (which doesn't seem to work). Also if anyone has
> any idea how to include
> in this block a line to tell php to send this as HTML email as well that would
> be even more helpful.
To answer your question, you'd need to set the $to to a dummy address, or
*perhaps* to null, and use headers to add a Bcc line with the address on it.
Instead of $from, you should build a $headers var, of which Bcc is one of.
UNTESTED:
<?
$bcc = "";
$query = mysql_query("SELECT * FROM members");
while ($member = mysql_fetch_array($query))
{
if ($bcc == "")
{
$bcc = $member['email'];
}
else
{
$bcc .= ", " . $member['email'];
}
}
$from = "From: " . $setting_mail_email . "\r\n";
$to = "[EMAIL PROTECTED]";
$headers = $from.$bcc;
mail ($to, $setting_site_name, $mailpost, $headers) or $emailsuccess =
"Failure sending email.";
?>
HOWEVER, Instead of sending the email in one hit ie:
"Bcc: [EMAIL PROTECTED], [EMAIL PROTECTED], etc"
Use the while loop of your SQL query to send the mail individualy to each
recipient.
This has a few benefits:
1. They can see exactly which address they recieved the email through, which
is mighty helpfull for people like me with 10+ email address' all hitting my
one POP box
2. You can personalise the email with things like:
a) Greeting them with their name
b) "you are currently subscribed as [EMAIL PROTECTED],
to remove your self, or modify your subscription, visit
this URL: http://site.com/mail.php?subscriber_id=1&page=edit"
3. You can split the query into smaller chunks, for ISPs with limits on
script timeouts etc etc.
4. customise the content of the email to suit thier interests
Plus a heap more probably...
MY VERSION, UNTESTED:
<?
$mailpost = $mailpost;
$mailpost = str_replace("{setting_site_name}", $setting_site_name,
$mailpost);
$mailpost = str_replace("{setting_site_url}", $setting_site_url, $mailpost);
$mailpost = str_replace("{setting_mail_email}", $setting_mail_email,
$mailpost);
$mailpost = str_replace("{post_poster}", $cookie_username, $mailpost);
$mailpost = str_replace("{post_headline}", $headline, $mailpost);
$mailpost = str_replace("{post_date}", date("M d, Y", time()), $mailpost);
$mailpost = str_replace("{post_post}", $post, $mailpost);
$to = "";
$from = "from: " . $setting_mail_email;
$query = mysql_query("SELECT * FROM members");
while ($member = mysql_fetch_array($query))
{
if ($to == "")
{
$to = $member['email'];
mail ($to, $setting_site_name, $mailpost, $from) or $emailsuccess =
"Failure sending email.";
}
}
?>
> ORIGINAL CODE:
> $mailpost = $mailpost;
> $mailpost = str_replace("{setting_site_name}", $setting_site_name, $mailpost);
> $mailpost = str_replace("{setting_site_url}", $setting_site_url, $mailpost);
> $mailpost = str_replace("{setting_mail_email}", $setting_mail_email,
> $mailpost);
> $mailpost = str_replace("{post_poster}", $cookie_username, $mailpost);
> $mailpost = str_replace("{post_headline}", $headline, $mailpost);
> $mailpost = str_replace("{post_date}", date("M d, Y", time()), $mailpost);
> $mailpost = str_replace("{post_post}", $post, $mailpost);
> $to = "";
> $query = mysql_query("SELECT * FROM members");
> while ($member = mysql_fetch_array($query)) {
> if ($to == "") {$to = $member['email'];}
> else {$to .= ", " . $member['email'];}
> }
> $from = "from: " . $setting_mail_email;
> mail ($to, $setting_site_name, $mailpost, $from) or $emailsuccess = "Failure
> sending email.";
> if ($emailsuccess == "") {$emailsuccess = "Email Sent Successfully.";}
> }
>
>
>
> My MODIFIED CODE:
> $mailpost = $mailpost;
> $mailpost = str_replace("{setting_site_name}", $setting_site_name, $mailpost);
> $mailpost = str_replace("{setting_site_url}", $setting_site_url, $mailpost);
> $mailpost = str_replace("{setting_mail_email}", $setting_mail_email,
> $mailpost);
> $mailpost = str_replace("{post_poster}", $cookie_username, $mailpost);
> $mailpost = str_replace("{post_headline}", $headline, $mailpost);
> $mailpost = str_replace("{post_date}", date("M d, Y", time()), $mailpost);
> $mailpost = str_replace("{post_post}", $post, $mailpost);
> $bcc = "";
> $query = mysql_query("SELECT * FROM members");
> while ($member = mysql_fetch_array($query)) {
> if ($bcc == "") {$bcc = $member['email'];}
> else {$bcc .= ", " . $member['email'];}
> }
> $from = "from: " . $setting_mail_email;
> mail ($bcc, $setting_site_name, $mailpost, $from) or $emailsuccess = "Failure
> sending email.";
> if ($emailsuccess == "") {$emailsuccess = "Email Sent Successfully.";}
> }
>
>
--- End Message ---
--- Begin Message ---
I think --with--ibm-db2 only works as statically linked with apache, no as module.
And do you have the db2 connect librarys instaled in the system ?
I copy here an article that works for my, I dont remenber where I see, maybe in
faqs.com:
-------------------------------------
Sep 21st, 2000 13:04
Remo Ronchitelli
The connection from a Linux Web Server
equipped with Apache and PHP 4
to an IBM AS/400 (OS400 and DB2/400)
system is possible and works fine.
The same connection works with IBM
mainframes equipped with OS/390,
MVS/ESA, VM/ESA, VSE/ESA and IBM DB2.
The only strict requirement is the
version of OS400 operating system:
it must be V4R2 with native TCP/IP
support.
The following is the hierarchical
list of Software Layers used in the test.
++Linux RedHat 6.1
------(Korn Shell pdksh rpm package required)
++Apache Web Server 1.3.12
++PHP 4.0.2 statically linked to Apache
------ with-ibm-db2 option enabled
++IBM DB2Connect Personal Edition for Linux
------ V7.1 free from somewhere in ibm.com
The IBM DB2 UDB DB2Connect Personal Edition
installation is performed via Korn shell script
"db2setup". Use all the features you can select,
and installl:
DB2 Administration Client
DB2 Connect Personal Edition
Db2 Application Development Client
The DB2 instance created on Linux is:
"db2inst1" and password "ibmdb2" (defaulted).
After this you can install PHP 4
--with-ibm-db2 option enabled.
You get some weak compilation warnings
but don't worry (it would be better they missed).
For PHP it looks exactly like you had
installed IBM DB2 UDB Personal Edition
(the whole DB2 engine "without" DB2Connect).
On the AS/400 side you have to start
"drda" tcp servers at port "446" (defaulted).
On the AS/400 side you need also
authorized userid and password.
Along with IBM DB2Connect you get full
HTML documentation (useful and clear).
Now return to Linux:
login as "db2inst1" password "ibmdb2" and
type: "db2" (DB2 command line processor).
This is the necessary to inform DB2Connect
about the reality of DB2400 DataBase on the
AS/400. Thatis:
1. 'catalog tcpip node YOUR_FREE_NODE_NAME
remote TCP_IP_ADDRESS_OF_AS400
server 446
remote_instance AS400_SYSTEM_NAME
system YOUR_FREE_SYSTEM_NAME
ostype OS400'
(446 is the default port number of drda server)
(ostype must be "OS400")
2. 'catalog dcs database YOUR_DB_NAME
as DB2400_REAL_NAME'
(DB400_REAL_NAME is the cataloged name of
DB2 system in the AS/400 or the RDBNAME of AS/400)
3. 'catalog database YOUR_DB_NAME as PHP_DB_NAME
at node YOUR_FREE_NODE_NAME
authentication DCS'
(if you choose authentication "SERVER" it doesn't work).
4. 'connect to PHP_DB_NAME
user AS400_USERID
using AS400_PASSWORD'
5. (Caution to escape double quotes!)
'bind \"[EMAIL PROTECTED]
BLOCKING ALL SQLERROR CONTINUE
MESSAGES DDCS400.MGS GRANT PUBLIC\" '
6. 'connect reset'
7. 'terminate'
(quit from DB2 Command Line Processor).
You can now access DB2/400 from a PHP script
enabled with:
'putenv
("LD_LIBRARY_PATH=/home/db2inst1/sqqlib/lib:$LD_LIBRARY_PATH"); '
'putenv ("DB2INSTANCE=db2inst1"); '
'odbc_connect(PHP_DB_NAME, AS400_USERID, AS400_PASSWORD);'
Warning: The Table name referenced in your PHP script
must be qualified with the "collection" or "library" name
of AS/400 DB2 system. Example:
"SELECT * FROM AS400LIB.TABLE"
The default would be
"SELECT * FROM DB2INST1.TABLE" (surely wrong).
Take your fun with AS/400 or Mainframe system!
Remo Ronchitelli
[EMAIL PROTECTED]
--------------------------------------------------------
Josep R. Raurell
Quoting Derek Battams <[EMAIL PROTECTED]>:
> Currently I have Apache and PHP4 (using the Apache module for PHP4) working
> just fine on my server. However, the RPMs I installed for mod_php4 didn't
> include IBM DB2 support. So I took the source RPM and modified it by
> simply
> adding the following line to the spec file:
>
> --with-ibm-db2
>
> I appended this to the CFLAGS parameter in the spec file. I then rebuilt
> the RPMs and everything built fine. I then installed them and that was
> fine. However, when I try to restart Apache nothing happens. It just
> exits
> immediately with nothing written to any logs. If I remove the
> '--with-ibm-db2' flag from the spec file, rebuild the RPMs, then reinstall
> them without DB2 support then Apache restarts fine and operates with no
> problems. DB2 is installed, configured, and running on the server. I've
> spent numerous hours (on the weekend none the less) trying to figure this
> out, but with no luck. Any help would be greatly appreciated.
>
> Thanks,
>
> Derek
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Anyone know of a free app that allows users to submit-
name, nickname, e-mail addy
app sends a url confirm to e-mail addy.
upon confirm, the info gets stored in a mysql database with the email
encrypted.
addresses should only be decryptable with a key that does not need to be
stored on the machine.
Thanks.
--- End Message ---
--- Begin Message ---
Hi
following up on the text below...
Will there then be possible to recover uploads in 4.2?
Maybe even resuming uploads? (wishfull thinking) ?
Cheers
Jimmy
Rasmus Lerdorf wrote:
Re: [PHP] upload forms, how much was uploaded before upload fails..
You'll probably need PHP 4.2 for uploads that big to work well. Before
4.2 uploads were buffered in ram, so no, you have no way to recover a
broken upload.
On Sun, 24 Mar 2002, Gerhard Hoogterp wrote:
> Hello all,
>
> I'm still having problems uploading BIG files (15MB and more) Is there a
way
> to find howmuch data was uploaded before the connection was broken?
>
> For some weird reason no browser has a half decent user feedback if it come
> to upload forms.
>
> Gerhard
--- End Message ---
--- Begin Message ---
I have an array with elements of which a lot are empty strings (according to
var_dump, string (0)). I try to unset() these elements from the array by
checking for $p[$i] == "", or strlen($p[$i]) < 1, or !$p[$i], but it only
deletes a few of them, not all. Anyone have an idea as to how this could be
the case?
TIA...
Manuzhai
--- End Message ---
--- Begin Message ---
Have a look at this:
function ValidateUrl($url) {
// Check the syntax
if
(!preg_match("!((https?|ftp)://)(www\.)?([a-zA-Z0-9/\-]*)+\.([a-zA-Z0-9/\-]*
)+([a-zA-Z0-9/\-\.]*)?!", $url)) {
return false;
}
// If it's correct, then try and open it....
if (!@fopen($url, "r")) {
return false;
}
return true;
}
if (!ValidateUrl("http://www.yoursite.com")) {
echo "Invalid url";
} else {
echo "It's there.";
}
Not particularly clean, but it seems to work ok. Will check for http,
https, ftp, followed by an optional www. followed by numbers, digits,
hyphens etc. If it gets passed that check, then the function then attempts
to open the url. You may need to play around with it a little...
~James
"John Fishworld" <[EMAIL PROTECTED]> wrote in message
004001c1d2cc$caff60e0$04010a0a@fishworld">news:004001c1d2cc$caff60e0$04010a0a@fishworld...
> Okay good point but still why doesn't it work ?
>
> thanks
> john
>
>
> > On Sun, 24 Mar 2002, John Fishworld wrote:
> > > I'm still playing about trying to validate an url
> > > www(dot)something(dot)something !
> > >
> > > I thought this would work but know
> > >
> > > if (ereg("^(w{3})(\\.)([a-zA-Z]+)(\\.)([a-z]{2,4})$", $str))
> >
> > First of all, web server hostnames don't need to start with www.
Secondly,
> > they can have any number of components (separated by periods) from 1 to
> > dozens. Thirdly, the last term doesn't have to be 4 characters or less.
> >
> > > ([a-z]{2,4})$ = at least 2 leters eg de but upto 4 eg info
> >
> > .museum...
> >
> > miguel
> >
> >
>
>
--- End Message ---
--- Begin Message ---
G'day.
Problem:
Following [b] install trail in INSTALL using php 4.1.2 source distro,
and with the configure setup shown below [1].
Conditions:
Using Mandrake 7 / updated bintools / kernel 2.4..95.214 / kde 2.2.2
gcc 2.95.2
Apache 1.3.23 already successfully built from source, installed & running.
Observations:
--[1]-------------------------------------------------------------
#!/bin/bash
# PHP build 22-mar-02
rm -rf configure.cache
./configure \
--prefix=/opt/G \
--with-mysql=/usr/local/mysql \
--enable-track-vars \
--with-apache=../../apache_1.3.23
----------------------------------------------------------------
I find that after [what appears to be] a successul completion of the gmake
no php executable bas been built
( make test failed 'no rule to make target ' )
The only build problem encountered up to this point was in 'microtiime.c'
----read FAQ article, applied `broken library test' which did not produce 'a
stream of errors' so proceeded to patch microtime.c by forcing #include
<sys/resource.h> on the assumprion that base libs actually OK.
after looking at ~/Makefile et.al , it appears that 'gmake php' should
make the php executable.
-[2]-------------------------------------------------------------------
/bin/sh /home/pkg/apache/PHP/php-4.1.2/libtool --silent --mode=link gcc \
-I. -I/home/pkg/apache/PHP/php-4.1.2/ -I/home/pkg/apache/PHP/php-4.1.2/main \
-I/home/pkg/apache/PHP/php-4.1.2
-I/home/pkg/apache/apache_1.3.23/src/include \
-I/home/pkg/apache/apache_1.3.23/src/os/unix
-I/home/pkg/apache/PHP/php-4.1.2/Zend \
-I/usr/local/mysql/include/mysql
-I/home/pkg/apache/PHP/php-4.1.2/ext/xml/expat \
-I/home/pkg/apache/PHP/php-4.1.2/TSRM -g -O2 -o php -export-dynamic
stub.lo libphp4.la
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
gmake: *** [php] Error 1
--------------------------------------------------------------------
>From [2] it seems that either ~/stub.lo must be made from something other
than ~/stub.c (which is blank) or that libphp4.la should contain a
procedure main() -- strange?
================================
I have had a dig on the news:// list archive - works with konqueror
(didn't know that!) but found only one tangential reference.
Anyway, before digging further, does any of this look familiar to U lot?
Regards, RJP
--
RJP - <[EMAIL PROTECTED]> <http://www.sedric.demon.co.uk>.
--- End Message ---
--- Begin Message ---
Hi,
Im trying to install PHP 4.1.2 under Windows 2000 Server and IIS 4.0
* If I configure PHP as a MODULE, all run but SESSIONS DON'T WORK
* If I configure PHP as a CGI, SESSIONS WORK but ORACLE MODULE for PHP not
load
Any ideas?
Anybody can help me?
Advanced thanks,
Berli
--- End Message ---
--- Begin Message ---
25/03/2002 8:27:51 PM
hehehe
You could start with loosing IIS, it's bad news.
The port of Apache for windows is good, if not, Xitami's also quite good.
http://www.apache.org/dist/httpd/binaries/win32/
http://www.xitami.com/
But, no, sorry. I can't help you.
"Berlina" <[EMAIL PROTECTED]> wrote on 25/03/2002 10:19:46 AM:
>
>Hi,
>
>Im trying to install PHP 4.1.2 under Windows 2000 Server and IIS 4.0
>
>* If I configure PHP as a MODULE, all run but SESSIONS DON'T WORK
>* If I configure PHP as a CGI, SESSIONS WORK but ORACLE MODULE for PHP not
>load
>
>Any ideas?
>Anybody can help me?
>
>Advanced thanks,
>Berli
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I wrote s script to upload a file. The script works, but when I point
my browser to the file it downloads, but I can no longer open the file
in MS Word. What is happening to my file? My client is Windows and the
server is Linux.
David McInnis
--- End Message ---
--- Begin Message ---
Hey PHP General List,
Intro:
I am creating small login script and few things doesn't work right.
Code is hare:
admin.php
if(isset($subm_login))
{
$session["logged"]=0;
$session["uzeriz"]="";
$result = mysql_query("select * from uzer where user='$uzr_name' and
pass='$uzr_passwd'");
if(!$result) {
echo "This error should not be hare. But it sayes that it could not
search for your user";
} else {
if(mysql_num_rows($result)!=1) {
echo "Login Not Found";
} else {
while($row = mysql_fetch_row($result)){
$session["uzeriz"]=$row["user"];
$session["logged"]=1;
$session["pass"]=$row["pass"];
}
}
}
session_register("session");
}
if( $session["logged"]==1 )
{
draw_admin_menu($session["uzeriz"]);
}
if( $session["logged"]==0 )
{
draw_login_box();
}
--------------
adm_func.php (this file is included in admin.php)
function draw_admin_menu($uzer)
{
global $session;
echo "<p>User Logged In</p>\n";
echo "<p>--------------</p>\n";
echo "<p>$uzer</P>\n";
}
------------------------------
Problem:
the problem is that i cant see $uzer its empty. nothing is
there....what i am doing wrong? all table names and everything is
correct but i get empty thing.
If that is dumb question im sorry :) i am kinda new in this :)
:------------------------------:
Have A Nice Day!
Mantas Kriauciunas A.k.A mNTKz
Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt
--- End Message ---
--- Begin Message ---
Hi there,
I was wondering if it is possible to upload an known file without having to
use an HTML form with the post command?
If so, could you point me in the right direction?
Thanks alot
Sam Rose
p.s. I'm only on the digest list, so it would be really handy if you could
send any replies back to me as well. Thanks.
--- End Message ---
--- Begin Message ---
Hi
I m under SOLRIS 8 on Sparc
My question is How fixe this errors on APACHE start whith php module.
Apache ERROR MSG on start
"Syntax error on line 205 of /opt/local/apachessl/conf/httpd.conf:
Cannot load /opt/local/apachessl/libexec/libphp4.so into server: ld.so.1:
/opt/local/apachessl/bin/httpd: fatal: /opt/local/apachessl/libexec/libphp4.so: open
failed: No such file or directory
./bin/apachectl start: httpd could not be started
"
could you Help me please
Ghislain MUKOKA
Unix System Ingineer
Ingénieur Système Unix
AOL FRANCE
+33172250682
--- End Message ---
--- Begin Message ---
Can anyone tell me how to convert/send data stored in
an MS Access database to a mySQL table through PHP??
T. Edison Jr.
=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
*******************************************
__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
--- End Message ---
--- Begin Message ---
How can I change this to accept spaces as well ?
(ereg("^[A-Za-zÀ-ÖØ-öø-ÿ]*$", $str))
--- End Message ---