[PHP] Problem with fopen()

2002-04-30 Thread Ben Turner

I am trying to complete an email application which will send messages to
lists. Problem is, I am trying to write the messages out so that they will
be available to a server application which actually sends the messages and
does all the dirty work but I am getting the error that I cannot create the
file in the directory.  I have tried chmod and chown on the directory but
nothing is working for me.  I have even gone so far as to make the owner of
the directory apache and the group of the directory apache but no luck.

I am asking this question here because I thought someone out there might be
able to give me some insight on how they solved a problem like this on their
servers Help!

Thanks!
Ben



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Problem with fopen()

2002-04-30 Thread Miguel Cruz

On Tue, 30 Apr 2002, Ben Turner wrote:
 I am trying to complete an email application which will send messages to
 lists. Problem is, I am trying to write the messages out so that they will
 be available to a server application which actually sends the messages and
 does all the dirty work but I am getting the error that I cannot create the
 file in the directory.  I have tried chmod and chown on the directory but
 nothing is working for me.  I have even gone so far as to make the owner of
 the directory apache and the group of the directory apache but no luck.
 
 I am asking this question here because I thought someone out there might be
 able to give me some insight on how they solved a problem like this on their
 servers Help!

Is the directory buried inside any directories that the Apache user 
doesn't have 'x' rights on?

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Problem with fopen()

2002-04-30 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Ben Turner) wrote:

 I am getting the error that I cannot create the
 file in the directory.  I have tried chmod and chown on the directory but
 nothing is working for me.  I have even gone so far as to make the owner of
 the directory apache and the group of the directory apache but no luck.

Have you already confirmed that Apache is running as  user apache and not 
some other name (nobody, www, web, http, etc.)?

Have you already confirmed that the Apache user has write permissions to 
the directory?

What is the full text of the error message?

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] error_reporting()

2002-04-30 Thread Boaz Yahav

Hi
 
This function keeps amazing me.
What is the highest possible value that i can give it to show all
possible errors / warnings etc...?
 
Thanks
 
berber
 



Re: [PHP] error_reporting()

2002-04-30 Thread Michal Dvoracek

Hi,

error_reporting(E_ALL);


BTW: RTFM!
Regards
Michal Dvoracek  [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] regular expressions help please

2002-04-30 Thread Ed Lazor

I've been banging my head against regular expressions all night... help 
would be greatly appreciated.  Could you give me examples on how to do the 
following?

Pull everything except a specific word from a sentence.  For example, 
pulling everything except the word run from the water run was steep.

Pull all words from a string starting with a specific letter or 
pattern.  For example, pulling all of the words starting with the letter r 
from run beep burp ran rin ron runt zoot zip pow

Pulling all words from a string excluding ones starting with a specific 
letter or pattern.  For example, pulling all of the words except ones 
starting with the letter r from run beep burp ran rin ron runt zoot zip pow

Pulling a word between two other words without having to know what the word 
is.  For example, pulling whatever word displays between the and 
sky.  If the string was the blue sky, the result would be the word 
blue.  If the string were the green sky, the result would be the word green.

I apologize in advance if these are really simple.  It's just that I'm new 
to regular expressions and reading all of the web page tutorials, manual 
pages, and mailing list archive messages has left me thinking I'm 
complicating something somewhere, because it really shouldn't be this hard.

Thanks in advance for any help you can offer.

-Ed


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] build array dinamicaly

2002-04-30 Thread Tim Ward

Be careful - I fell into this trap when I first started doing this sort
of thing. This code will produce an extra element on your array
with value logical false. You need to do ...

While ($array = mysql_fetch_array($result)) $myarray[] = $array;

... to avoid this

Tim Ward
Internet Chess www.chessish.com http://www.chessish.com 

--
From:  Richard Emery [SMTP:[EMAIL PROTECTED]]
Sent:  29 April 2002 21:57
To:  Rodrigo Peres; PHP
Subject:  Re: [PHP] build array dinamicaly

$query = SELECT name,address FROM tbl;
$result = mysql_query($query);
while($myarray[] = mysql_fetch_array($result);

- Original Message - 
From: Rodrigo Peres [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Monday, April 29, 2002 9:20 AM
Subject: [PHP] build array dinamicaly


Hi list,

I want to buil an multidimensional array with the results of Mysql,
but I
don't know how to do it.
What I need is:
SELECT name,adress from tbl_.

array name will receive the names
array adress will receive the adresses
and array clientes will contain both, so when i try to access i will
have
something like $cliente['nome'][0] or $clientes['adress'][1] and so
on.

Someone can help???

Thank's in advace

Rodrigo Peres


-- 
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




[PHP] If value is divisible by 2

2002-04-30 Thread Craig

I am trying to write an if statement that says if the value $foo is
divisible by 2 then echo text

i have tried mod but it isnt recognised

any ideas?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If value is divisible by 2

2002-04-30 Thread Marius Ursache

if(($i % 2)==0)
{
 $bg_color = $bg_color1;
}
else
{
 $bg_color = $bg_color2;
}
$i++;


Craig a écrit :

 I am trying to write an if statement that says if the value $foo is
 divisible by 2 then echo text

 i have tried mod but it isnt recognised

 any ideas?

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

--
  Marius Ursache (3563 || 3494)

   \|/  \|/
   '/ ,. \`
   /_| \__/ |_\
  \__U_/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If value is divisible by 2

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 16:05, Marius Ursache wrote:

 if(($i % 2)==0)


Or simply:

  if ($i % 2)

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
To thine own self be true.  (If not that, at least make some money.)
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If value is divisible by 2

2002-04-30 Thread Neil Freeman

if (($foo % 2) == 0)
{
echo text;
}

Neil

Craig wrote:
 
 *
 This Message Was Virus Checked With : SAVI 3.54 Feb 2002
 Last Updated 24th April 2002
 *
 
 I am trying to write an if statement that says if the value $foo is
 divisible by 2 then echo text
 
 i have tried mod but it isnt recognised
 
 any ideas?
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 15:51, Ed Lazor wrote:
 I've been banging my head against regular expressions all night... help
 would be greatly appreciated.  Could you give me examples on how to do the
 following?

Is this for a programming assignment/exercise? Do you /have/ to use regex? 
Other methods may be easier. I'll do the two simple ones:

 Pull everything except a specific word from a sentence.  For example,
 pulling everything except the word run from the water run was steep.

a) Use str_replace(), search for 'run ' (or ' run') and replace with ''.
b) explode() the string, put 'run' (and any other words you don't want) into 
an array, then use array_diff()

 Pull all words from a string starting with a specific letter or
 pattern.  For example, pulling all of the words starting with the letter r
 from run beep burp ran rin ron runt zoot zip pow

a) explode() the string, loop through array check 1st char of each element.

 I apologize in advance if these are really simple.  It's just that I'm new
 to regular expressions and reading all of the web page tutorials, manual
 pages, and mailing list archive messages has left me thinking I'm
 complicating something somewhere, because it really shouldn't be this hard.

As you can see, a bit of lateral thinking can get you the same results 
without the headbanging. Using regex can be expensive in terms of CPU cycles 
and very often simpler methods will suffice. By all means learn regexes as 
they are damn useful. But start simple then build upon it.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
A full belly makes a dull brain.
-- Ben Franklin

[and the local candy machine man.  Ed]
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] If value is divisible by 2

2002-04-30 Thread Marius Ursache

what e-mail client do you use jason?
i like that are fortunes in your signature. i supose that they are
automaticly set...

Jason Wong a écrit :

 On Tuesday 30 April 2002 16:05, Marius Ursache wrote:

  if(($i % 2)==0)

 Or simply:

   if ($i % 2)

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 To thine own self be true.  (If not that, at least make some money.)
 */

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

--
  Marius Ursache (3563 || 3494)

   \|/  \|/
   '/ ,. \`
   /_| \__/ |_\
  \__U_/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] regular expressions help please

2002-04-30 Thread John Fishworld

I'm trying to find files in my array
for example
=lg_imode.gif
and
=/db/imodeklein/edgar-IMODE-1-.gif

I want to differentiate between the files with slash at the front and ones
without so that
I can add a server path !
but as usual I' m having problems with the correct regex

At the moment I've got this to find files with forward slash
eregi_replace(([^\]+[/+]+[a-z_/-]+[gif]+[/$]) ,
and it seems to work.(although I think it's wrong)

And I'm trying this to find the files without the slash at the front
eregi_replace(([^\]+(a-z_)+[gif]$) ,

which is definately not working.

help !




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: regular expressions help please

2002-04-30 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Ed Lazor) wrote:

 I've been banging my head against regular expressions all night... help 
 would be greatly appreciated.  Could you give me examples on how to do the 
 following?
 
 Pull everything except a specific word from a sentence.
snip more examples

First you need to decide what you mean by word.  If it's simply the 
stuff separated by a space, then you might find it simpler to explode your 
sentences on the space character, then loop through the resulting array 
using string functions to do your comparisons .  Regex is great for the 
power and flexibility it offers, but if you're really struggling with the 
syntax, using constructs that are more familiar may help you move forward.

On the other hand, it's frequently the case that one needs a more 
sophisticated definition of word.  Is it just adjacent letters?  What if 
they're interrupted by a hyphen?  Are leading/trailing punctuation marks 
included?  Do adjacent digits count as words?   Etc. Once you've defined 
the pattern comprising a word, you can then translate it into regex--or 
get more help from others in making the translation.

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] STILL having Troubles getting GD support with jpegs, possiblity:PHP with GD jpeg support prebuilt?

2002-04-30 Thread Peter Revill


=
CC all Replies to [EMAIL PROTECTED]
=
Ok, im STILL having problems, im close to tears here that this is not 
working, its INFURIATING

so basically, I was hoping php 4.2 has support for Jpeg GD OR if someone 
has a prebuilt GD with JPEG they could send me? i would not ask normally 
but this just plain is NOT working and its getting to the point where im 
giving up in frustration
Here is the error, but i seriously doubt much can be done:

(p.s no response from the GD developer when i asked about installation 
issues)


[root gd-1.8.4]# make
gcc -I. -I/usr/include/freetype2 -I/usr/include/X11 
-I/usr/X11R6/include/X11 -I/usr/local/include 
-I/home/sites/www.gni.ms/users/develop/jpeg-6b 
-I/usr/local/include/libpng -I/usr/local/bin pngtogd.o -o pngtogd  
-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -lm -lgd -lz -jpeg
gcc: unrecognized option `-jpeg'
pngtogd.o: In function `main':
pngtogd.o(.text+0x6b): undefined reference to `gdImageCreateFromPng'
collect2: ld returned 1 exit status
make: *** [pngtogd] Error 1


Anyone could help it would be greatly appreciated
=
CC all Replies to [EMAIL PROTECTED]
=


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: PHP4.2.0 + Apache2 prints code

2002-04-30 Thread Yasuo Ohgaki

James Stuart wrote:
 I've installed Apache 2.0.35 with PHP 4.2.0 on both FreeBSD and Linux, and
 both yield the same result.  When the test.php page is accessed it returns
 ?php phpinfo(); ? instead of actually processing it.
 
 I have the lines:
 LoadModule php4_modulemodules/libphp4.so
 AddType application/x-httpd-php .php
 in my httpd.conf files, and the /server-info page displays the server as:
 Server Version: Apache/2.0.35 (Unix) PHP/4.2.0
 It also indicates that sapi_apache2.c is loaded.  I've tried making the
 php files +x, and also accessing them in directories that are set as Options
 ExecCGI, but nothing causes apache to actually process the php.
 
 I have to be doing something wrong here, but for the life of me I can't
 figure out what it is.  The only thing I can think of that might help is an
 AddHandler line, but I don't know what I'd put there as a handler.
 
 Any thoughts/comments/ideas would be greatly appreciated.
 

Read README file in the SAPI directory.

sapi/apache2filter/README

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Fw: [PHP] Null character as field seperator in a string.

2002-04-30 Thread The_RadiX


- Original Message -
From: The_RadiX [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Dave MacRae [EMAIL PROTECTED]
Sent: Wednesday, January 24, 2001 10:05 PM
Subject: Re: [PHP] Null character as field seperator in a string.


 Hey..

 yeah I might..


 I don't know if I am right or just blabbering crap

 but try to add these param's to your regex statement..


 preg_split(/\0/i, $buffer);


 note the i.. It should let it read past newlines.. although you're prob is
 with null (\0) chars..


 as I said.. Don't know if I am on the right track.. but it's worth a go
eh??





 good luck..

 - Original Message -
 From: Dave MacRae [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, April 29, 2002 8:26 PM
 Subject: [PHP] Null character as field seperator in a string.


  For historic reasons, I have a file that contains a number of records in
  which the fields are seperated by the NULL character, i.e,
 
  field1\0field2\0field3\0field4
 
  I need to parse out the fields from this string.
 
  The string is read into the program using
 
  $buffer = fgets(...).
 
  This would be no problem in Perl or C but I cannot get this to work in
 PHP.
 
  I have tried using
 
  preg_split(/\0/, $buffer);
 
  But this fails. I've tried walking through the string but it seems that
  $buffer only has the content up to the first NULL character.
 
  Does anyone have a simple solution to this problem.
 
  Regards
 
  Dave
 
  --
  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




Fw: [PHP] lookin for a Menuing System...

2002-04-30 Thread The_RadiX

Yes too true..


Quite well put..


That's why. I haven't read the rest of the posts on this topic yet as there
are heaps..

but when I started working on my project with my graphics man we discussed
the issue of using JS menus very thoroughly as yes Netscape and IE both have
very different implementations when it comes to using DIV's and layers..




check it out: http://spectrum.ausgamers.com/


Hopefully it should all go well, and for NS users the dynamic menu simply
won't be there and they can use the sidemenu navigation system... For IE
they can utilise both systems..


Please give feedback if you do run into problems though.. Would love to get
some broader testing on it..



If you wanna know how it runs I coded it myself and it uses a nice little
linked list-type PHP array system which can be dynamically modified through
each page (since the whole site runs off this really intergrated mysql
principle) which will reflect the changes in the navbar menu and popup JS
menus..




Ok.. well thx for feedback anyway.. Hope I can help..



- Original Message -
From: michael kimsal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 29, 2002 2:46 PM
Subject: Re: [PHP] lookin for a Menuing System...


 Miguel Cruz wrote:

 
 Do it in JavaScript, it works and it's client side so it will be
 faster.
 
 
  But take care - using JavaScript for site navigation is tricky business.
  Some people don't use it, some people can't use it (not supported by
their
  browsers / hardware / corporate policy), and search engines certainly
  won't follow those links.
 


 Can someone point me to hardware that is still in active use that can't
 handle javascript?

 Similarly, can someone point me to a company that specifically disables
 javascript as 'corporate policy'?  Back in 96-97, the 'no javascript'
 argument held, and probably holds today some if you're targetting
 handhelds and other 'non standard' devices.  But if someone specifically
 disables Javascript these days, a good portion of their web experience
 will not be as robust as it would otherwise be, and they probably won't
 notice that using your site is any worse than any other site.

 IMO, it's now like targetting only websafe colors because some people
 might only browse in 256 colors.  If they do that, about 80% of the
 web's content will look like crap anyway, and they won't specifically
 think my stuff looks all that much worse than anyone else's.


 --
 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




[PHP] Ask for Simple Databases and PHP

2002-04-30 Thread Kalpin Erlangga Silaen

Hi all,
I am looking for some aplication which use php and mysql for example
only.
For Your information, i am working to make databases aplication with PHP
as Interface. And there is must have several function like : Search,
Add, Checking if New data has been exist, Insert, Display and Update.

Please reply to me if you have suggestion or answer.

Thank you


--
  Kalpin Erlangga Silaen
 Kalpin is [EMAIL PROTECTED]
 Kalpin is not a irc warrior
   http://www.geocities.com/kalpinus
  Ready or Not, He will come



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] STILL having Troubles getting GD support with jpegs, possiblity: PHP with GD jpeg support prebuilt?

2002-04-30 Thread Tom Rogers

hi
Looks like you need -ljpeg ... your missing the l somewhere
Tom

At 06:35 PM 30/04/2002, Peter Revill wrote:

=
CC all Replies to [EMAIL PROTECTED]
=
Ok, im STILL having problems, im close to tears here that this is not 
working, its INFURIATING

so basically, I was hoping php 4.2 has support for Jpeg GD OR if someone 
has a prebuilt GD with JPEG they could send me? i would not ask normally 
but this just plain is NOT working and its getting to the point where im 
giving up in frustration
Here is the error, but i seriously doubt much can be done:

(p.s no response from the GD developer when i asked about installation issues)


[root gd-1.8.4]# make
gcc -I. -I/usr/include/freetype2 -I/usr/include/X11 
-I/usr/X11R6/include/X11 -I/usr/local/include 
-I/home/sites/www.gni.ms/users/develop/jpeg-6b -I/usr/local/include/libpng 
-I/usr/local/bin pngtogd.o -o pngtogd
-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -lm -lgd -lz -jpeg
gcc: unrecognized option `-jpeg'
pngtogd.o: In function `main':
pngtogd.o(.text+0x6b): undefined reference to `gdImageCreateFromPng'
collect2: ld returned 1 exit status
make: *** [pngtogd] Error 1


Anyone could help it would be greatly appreciated
=
CC all Replies to [EMAIL PROTECTED]
=


--
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




[PHP] argh please help! starting PHP error: Cannot load into server, uncompressis undefineed symbol

2002-04-30 Thread Peter Revill

I just finished recompiling PHP, and attempt to start the webserver 
agian, but i get the following error:
Setting up Web Service: Syntax error on line 58 of 
/etc/httpd/conf/httpd.conf:
Cannot load /etc/httpd/modules/libphp4.so into server: 
/etc/httpd/modules/libphp4.so: undefined symbol: uncompress
/usr/sbin/httpd

Please help!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Please CC all replies to arevill@bigpond.net.au for my last (andbelow) msg

2002-04-30 Thread Peter Revill

Peter Revill wrote:

 I just finished recompiling PHP, and attempt to start the webserver 
 agian, but i get the following error:
 Setting up Web Service: Syntax error on line 58 of 
 /etc/httpd/conf/httpd.conf:
 Cannot load /etc/httpd/modules/libphp4.so into server: 
 /etc/httpd/modules/libphp4.so: undefined symbol: uncompress
 /usr/sbin/httpd

 Please help!







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Book: Web Database Applications with PHP and MySQL

2002-04-30 Thread Mark Harwood

Hi All,

Has anyone got a copy of this book yet?  If so, what do you think of it?

Mark



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Book: Web Database Applications with PHP and MySQL

2002-04-30 Thread David Garcia Aristegui

I like it, i think it's the best for beguinners, and it's fine try to work withreal 
examples...

At 10:41 30/04/2002 +0100, Mark Harwood wrote:
Hi All,

Has anyone got a copy of this book yet?  If so, what do you think of it?

Mark



-- 
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




[PHP] ext/sockets: httpd waiting for TIME_WAIT

2002-04-30 Thread guido.d.berger

hello everyone,

sorry for the long post, but i am stumped and i want to be as precise as 
possible.

this is my setup:
php 4.2.0 with the socket extension, as a dynamically loaded module in 
apache 1.3.23. it is running on is a red hat 7.0 box with kernel 2.2.19.

this is was i am trying to do:
i am using the socket functions to connect to a server which is running a 
ticketing software using a specifically designed protocol; the details do 
not matter here. i'll call my webserver webserv.com, the client calling 
the script client.com and the ticketsystem tixserv.com.

i think i am doing everything by the book - just a simple one-shot 
tcp-client; writing some request to tixserv.com, reading the response and 
closing the connection. i am using socket_create(), socket_connect(), 
socket_write(), socket_read(), and finally socket_close(), pretty much the 
same way as the example 2 (Simple TCP/IP client) in the php manual. this 
seems to work well (no errors or warnings).

this is my problem:
if i monitor the connection attempts with netstat, i am seeing the 
following behaviour:

firstly, connections are established: from webserv.com to client.com and 
from webserv.com to tixserv.com:

tcpwebserv.com:1558 tixserv.com:45007SYN_SENT1126/httpd 

tcpwebserv.com:www  client.com:1894  ESTABLISHED 
1126/httpd

then, the connection from webserv.com to tixserv.com is closed (using 
socket_close() in the script), so the connection status goes to TIME_WAIT:

tcpwebserv.com:1558 tixserv.com:45007TIME_WAIT   - 

tcpwebserv.com:www  client.com:1894  ESTABLISHED 
1126/httpd

i see that to go to TIME_WAIT status is the correct way to behave for a 
socket. but the problem is that httpd somehow seems to wait for the 
TIME_WAIT status to go away and keeps the connection open during this time 
(ESTABLISHED). this takes a really long time (at least 30 seconds or more). 
at some time, the TIME_WAIT of the connection to tixserv.com finally goes 
away, and the connection to the client falls into that state:

tcpwebserv.com:www  client.com:1894  TIME_WAIT   - 


strange - my browser and php seem to ignore this: the script execution, 
measured with microtime(), is around 800 miliseconds, of which at least 90% 
is response time by tixserv.com which is fine. also, my browser does not 
need more than a second to display the script results. nonetheless, the 
httpd connection on the server stays ESTABLISHED for at least 30 seconds.

the scary thing about this is that it gets worse if i start to stress the 
server. i used jakarta-jmeter to simulate simultaneous requests. jmeter did 
not behave the same as my browser: it actually waited until the httpd 
connection status was really closed. this totally stressed webserv.com: i 
had response times around 600 seconds and more, with only 5 threads doing 2 
requests for the script. the load on webserv.com was huge during that time, 
sometimes i even had to stop apache to end the test.

i am not sure if this is a bug or a problem of my code/concept. ideas, anyone?

regards, guido 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] windows development - linux production

2002-04-30 Thread Ford, Mike [LSS]

 -Original Message-
 From: Lee P Reilly [mailto:[EMAIL PROTECTED]]
 Sent: 29 April 2002 22:06
 
 Just a quick question. I'm developing on a Windows machine right now,
 and will later move it onto Linux. Should I expect to run into major
 difficulty at all? I anticipate a few problems - mainly altering the
 file system interaction, maybe even database connections.
 
 I don't know if anybody else works this way, but if so... did you run
 into any problems, or was it a relatively smooth ride?

I'm running PHP 4.0.6 + Apache 1.3 + Oracle 8i on Windows NT as my development server, 
with the live site on 2 separate Solaris servers (Apache+PHP  Oracle).  I have 
absolutely no problems moving files from development to live, and for the vast 
majority of cases need to make no changes to scripts.  (But I'm not using stuff like 
email which is platform-dependent.)

File system interaction is also not a problem, so long as you stick to using / 
(rather than \) in all pathnames, have identical structures on both servers, and use 
relative pathnames whenever possible.  (Absolute pathnames beginning with a / also 
shouldn't be a problem so long as all your Windows files are on the same drive, such 
as C:.)  You might, however, come unstuck if you fall foul of rights restrictions on 
Linux which aren't enforced on your Windows machine.

If you do come across any essential differences, you may want to consider keeping an 
installation-specific include file on each machine which defines constants for the 
relevant values.  Then if a value ever changes (or you need a new one), you only need 
to edit the two include files, not all your individual script files.

The only other thing to watch for is functions that simply aren't defined under 
Windows.  Fortunately, most of these are well documented in the online manual -- but 
you need to keep an eye out for them!

Good luck!

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 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Insert in database

2002-04-30 Thread Ford, Mike [LSS]

 -Original Message-
 From: Justin French [mailto:[EMAIL PROTECTED]]
 Sent: 30 April 2002 00:04
 
 instead of
 
 echo(Hi ,$_POST['fname'],nbsp;,$_POST['lname'],Thank You For
 Registering !!!);
 
 try
 
 echo Hi .$_POST['fname'].nbsp;.$_POST['lname'].Thank You For
 Registering !!!;

You don't need to go as far as that.  Just removing the parentheses from the original 
statement would have done the trick -- the commas are fine.

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 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Insert in database

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 18:15, Ford, Mike   [LSS] wrote:

  echo(Hi ,$_POST['fname'],nbsp;,$_POST['lname'],Thank You For
  Registering !!!);

 You don't need to go as far as that.  Just removing the parentheses from
 the original statement would have done the trick -- the commas are fine.

Or keep the parentheses but replace the commas with a period ( , - . ).

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Many changes of mind and mood; do not hesitate too long.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] regular expressions help please

2002-04-30 Thread Ford, Mike [LSS]

 -Original Message-
 From: John Fishworld [mailto:[EMAIL PROTECTED]]
 Sent: 30 April 2002 09:32
 
 I'm trying to find files in my array
 for example
 =lg_imode.gif
 and
 =/db/imodeklein/edgar-IMODE-1-.gif
 
 I want to differentiate between the files with slash at the 
 front and ones
 without so that
 I can add a server path !

If all you want is to differentiate the ones where the first letter is a /, why 
don't you just check exactly that?

foreach ($array as $key=$fname):
if ($fname{0} =='/'):
// begins with slash -- add server path
endif;
endforeach;

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 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: If statement leading to another php page

2002-04-30 Thread David Robley

In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 Hello all,
 
 How can i force a transfer to another php page from an if statement?
 
 I have been trying:
 
 if (condition){
 
 echo A HREF=3Dwww.link.comLink/A;

echo 'A HREF=www.link.comLink/A';

the parser will get confused with all the  Alternatively you can escape 
 in a double quoted string thus

echo A HREF=\www.link.com\Link/A;

 
 }
 else {
 
 something else
 }
 
 without much luck, i keep getting parse errors. Thanks for anyhelp in
 advance!

But probably you really need header() to do an automatic redirect. See 
the manual for an example.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Page Numbers

2002-04-30 Thread Craig

Any one know how to display, go to page number on a record list page

eg

Prev 1|2|3|4|5|6... Next



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Page Numbers

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 18:41, Craig wrote:
 Any one know how to display, go to page number on a record list page

 eg

 Prev 1|2|3|4|5|6... Next

Yes.

http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Practical politics consists in ignoring facts.
-- Henry Adams
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: STILL having Troubles getting GD support with jpegs, possiblity:

2002-04-30 Thread David Robley

In article [EMAIL PROTECTED], [EMAIL PROTECTED] 
says...
 
 =
 CC all Replies to [EMAIL PROTECTED]
 =
 Ok, im STILL having problems, im close to tears here that this is not 
 working, its INFURIATING
 
 so basically, I was hoping php 4.2 has support for Jpeg GD OR if someone 
 has a prebuilt GD with JPEG they could send me? i would not ask normally 
 but this just plain is NOT working and its getting to the point where im 
 giving up in frustration
 Here is the error, but i seriously doubt much can be done:
 
 (p.s no response from the GD developer when i asked about installation 
 issues)
 
 
 [root gd-1.8.4]# make
 gcc -I. -I/usr/include/freetype2 -I/usr/include/X11 
 -I/usr/X11R6/include/X11 -I/usr/local/include 
 -I/home/sites/www.gni.ms/users/develop/jpeg-6b 

if your jpeg lib is in /home/sites/www.gni.ms/users/develop then that is 
allyou have to specify: use the parent directory not the absolute file 
name

 -I/usr/local/include/libpng -I/usr/local/bin pngtogd.o -o pngtogd  

here you probably want /usr/local for libpng - assuming that it is 
located in /usr/local/lib

 -L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -lm -lgd -lz -jpeg

wtf is -jpeg?

 gcc: unrecognized option `-jpeg'
 pngtogd.o: In function `main':
 pngtogd.o(.text+0x6b): undefined reference to `gdImageCreateFromPng'
 collect2: ld returned 1 exit status
 make: *** [pngtogd] Error 1
 
 
 Anyone could help it would be greatly appreciated
 =
 CC all Replies to [EMAIL PROTECTED]
 =
 
 

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Page Numbers

2002-04-30 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Craig declared
 Any one know how to display, go to page number on a record list page
 
 eg
 
 Prev 1|2|3|4|5|6... Next

Not certain as to what you mean but I'm pretty sure there is a good
article on building next/prev links on phpbuilder.com
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8zngFHpvrrTa6L5oRAthSAKCba5wRtMJE4V1asHmYJCyWSBUeUACfXSkq
AZT8lfMLG9lsRx31jnXyyNA=
=226P
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 16:31, John Fishworld wrote:
 I'm trying to find files in my array
 for example
 =lg_imode.gif
 and
 =/db/imodeklein/edgar-IMODE-1-.gif

Perhaps you should clarify your problem. First of all does your array contain 
just gif files (ie *.gif) or does it contain all sorts of files? (ie 
readme.txt, important.doc, funny.gif etc)

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
In a consumer society there are inevitably two kinds of slaves:
the prisoners of addiction and the prisoners of envy.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] regular expressions help please

2002-04-30 Thread John Fishworld

Okay right I'm experimenting with an i-mode parser !
I copy the file (url entered) to a local location !
Then read through the whole file line at a time and change/replace the
things that need replaceing !
On of the things that I need to replace is the links to the pictures so that
they still show even !
I've already got from the original file the original location
http://www.whatever.com
and now want to insert that in front of the gif files
ie
$imode_code[$i] = eregi_replace((img src=).+\.gif\ ,
\\1$next_path\\2,$imode_code[$i]);

There are just gif files in this !

Does that make more sense ?

 On Tuesday 30 April 2002 16:31, John Fishworld wrote:
  I'm trying to find files in my array
  for example
  =lg_imode.gif
  and
  =/db/imodeklein/edgar-IMODE-1-.gif

 Perhaps you should clarify your problem. First of all does your array
contain
 just gif files (ie *.gif) or does it contain all sorts of files? (ie
 readme.txt, important.doc, funny.gif etc)

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 In a consumer society there are inevitably two kinds of slaves:
 the prisoners of addiction and the prisoners of envy.
 */

 --
 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




[PHP] Re: Page Numbers

2002-04-30 Thread Manuel Lemos

Hello,

Craig wrote:
 Any one know how to display, go to page number on a record list page
 
 eg
 
 Prev 1|2|3|4|5|6... Next

This class does exactly what you asked:

http://www.phpclasses.org/browse.html/package/130.html

Here is a sample page:

http://www.phpclasses.org/browse.html/file/414/view/1/name/test_database_table_page.html

Regards,
Manuel Lemos


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] populating textboxes list boxes from database fields

2002-04-30 Thread Denis L. Menezes

Hello friends,

Can someone please tell me where I can find sample scripts for populating
textboxes and listboxes on a form(when the form opens) using the data from
fields in a table?

Thanks
Denis


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 19:17, John Fishworld wrote:
 Okay right I'm experimenting with an i-mode parser !
 I copy the file (url entered) to a local location !
 Then read through the whole file line at a time and change/replace the
 things that need replaceing !
 On of the things that I need to replace is the links to the pictures so
 that they still show even !
 I've already got from the original file the original location
 http://www.whatever.com
 and now want to insert that in front of the gif files
 ie
 $imode_code[$i] = eregi_replace((img src=).+\.gif\ ,
 \\1$next_path\\2,$imode_code[$i]);

 There are just gif files in this !

 Does that make more sense ?

Unfortunately, no. Could you post say 20 lines of this file you're talking 
about.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
You are in a maze of little twisting passages, all different.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] populating textboxes list boxes from database fields

2002-04-30 Thread John Holmes

Pull your data from the database, assign it to a variable, and echo it's
value to the text box.

input type='text' name'whatever' value='?=$DB_Row[Column]?'

For drop down boxes, it's a little different. You have to check each
value to see if it equals your DB value, and if it does, echo
selected.

select name='something'
option value='1' ? if($DB_Row[Col] == '1') { echo  selected; }
?One/option
option value='2' ? If($DB_Row[Col] == '2') { echo  selected; }
?Two/option
/select

I find it easier to use global arrays and functions to create select
boxes. Makes for cleaner code.

---John Holmes...

 -Original Message-
 From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 30, 2002 4:30 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] populating textboxes  list boxes from database fields
 
 Hello friends,
 
 Can someone please tell me where I can find sample scripts for
populating
 textboxes and listboxes on a form(when the form opens) using the data
from
 fields in a table?
 
 Thanks
 Denis
 
 
 --
 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




Re: [PHP] regular expressions help please

2002-04-30 Thread John Fishworld

$imode_code = file($url_file);
$file_name = basename($url_file);
$path = dirname($url_file);
$stripped_path = eregi_replace(^(.{2,6}://)?[^/]*/, , $path);

$next_path = eregi_replace($stripped_path, , $path);
$next_path_1 = eregi_replace(/$ , , $next_path);

// create and open a file to write to
$new_file = files/.$file_name;
$fh = fopen($new_file , w);

$lines = count($imode_code);
// echo Lines = $lines;

for ($i; $i$lines; $i++) {

// add server path to gifs with front slashes /hello/john.gif
// $imode_code[$i] = eregi_replace(([^\]+[/+]+[a-z_/-]+[gif]+[/$]),
$next_path_1\\0,$imode_code[$i]);

// add server path to gifs withour front slashes john.gif
// $imode_code[$i] = eregi_replace(\.gif ,
$next_path/\\0,$imode_code[$i]);

// changes links so also for server paths for html + chtml + php

// $imode_code[$i] = eregi_replace(([a-z_]+[.]+[chtml]),
$next_path_1\\0,$imode_code[$i]);
// $imode_code[$i] = eregi_replace(([^\]+[a-z_]+[\.html]+[\$]),
$next_path_1\\0,$imode_code[$i]);
// $imode_code[$i] = eregi_replace(([^\]+[a-z_]+[\.php]+[\$]),
$next_path_1\\0,$imode_code[$i]);

// replace imode pictos with a real gif
$imode_code[$i] = ereg_replace(#([0-9]{5}); , img
src=\pictos/\\1.gif\ border=\0\ , $imode_code[$i] );

// write the whole lot to file
fputs ($fh, $imode_code[$i]);
}
// close file
fclose($fh);
// display file
echo IFRAME border=0 marginWidth=0 src=\files/$file_name\ frameBorder=0
width=150 height=131 marginheigth=0
   /IFRAME;

?
/body
/html


 On Tuesday 30 April 2002 19:17, John Fishworld wrote:
  Okay right I'm experimenting with an i-mode parser !
  I copy the file (url entered) to a local location !
  Then read through the whole file line at a time and change/replace the
  things that need replaceing !
  On of the things that I need to replace is the links to the pictures so
  that they still show even !
  I've already got from the original file the original location
  http://www.whatever.com
  and now want to insert that in front of the gif files
  ie
  $imode_code[$i] = eregi_replace((img src=).+\.gif\ ,
  \\1$next_path\\2,$imode_code[$i]);
 
  There are just gif files in this !
 
  Does that make more sense ?

 Unfortunately, no. Could you post say 20 lines of this file you're talking
 about.

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 You are in a maze of little twisting passages, all different.
 */

 --
 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




[PHP] String check

2002-04-30 Thread David Orn Johannsson

Is ther any function that I could use to check if a string beguins wiht
a certin set of numbers, like
if string starts_w “324” {
do some stuff;
}
 
Regards, David
 
 http://www.atom.is/ 
Davíð Örn Jóhannssson
Vefforritari

Atómstöðin hf.
Garðastræti 37
101 Reykjavík

sími: 595-3643
fax: 595-3649
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 http://www.atom.is/ http://www.atom.is

 



Re: [PHP] populating textboxes list boxes from database fields

2002-04-30 Thread Justin French

If you're familiar with getting data out of a table, then I don't believe
you really need any examples.

Consider the following over view or what you might do with a CD store:

Get a product row from a data base into an array.  it might look something
like:

$myrow[id] (55)
$myrow[artist] (Nine Inch Nails)
$myrow[title] (The downward Spiral)
$myrow[price] (25.99)
$myrow[category] (Alternative)
$myrow[additional_info] (Limted edition cover art)

Apart from the category, these are all text fields, so build your form, and
echo these values into the form value=.  eg:

INPUT type=text value=?=$myrow[artist]? size=50 maxlength=255
etc etc

In the case of category, you might have 5 categories in a pull down.  the
aim would be to list all categories, and flag the current category as
SELECTED.  This can be done with an if statement:

SELECT name=category
OPTION value=rock ? if($myrow[category] == rock) { echo
SELECTED; } ?rock/OPTION
OPTION value=jazz ? if($myrow[category] == jazz) { echo
SELECTED; } ?jazz/OPTION
OPTION value=alternative ? if($myrow[category] == alternative) {
echo SELECTED; } ?alternative/OPTION
OPTION value=blues ? if($myrow[category] == blues) { echo
SELECTED; } ?blues/OPTION
/SELECT

This would echo SELECTED in the alternative OPTION only.


Check boxes, groups of radio buttons, etc etc can all be done in simular
ways.


Justin French

Creative Director
http://Indent.com.au






on 30/04/02 9:29 PM, Denis L. Menezes ([EMAIL PROTECTED]) wrote:

 Hello friends,
 
 Can someone please tell me where I can find sample scripts for populating
 textboxes and listboxes on a form(when the form opens) using the data from
 fields in a table?
 
 Thanks
 Denis
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] String check

2002-04-30 Thread 1LT John W. Holmes

if(substr($string,0,3) == 123)
{ //do some stuff }

---John Holmes...

- Original Message -
From: David Orn Johannsson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 8:03 AM
Subject: [PHP] String check


Is ther any function that I could use to check if a string beguins wiht
a certin set of numbers, like
if string starts_w 324 {
do some stuff;
}

Regards, David

 http://www.atom.is/ 
Davíð Örn Jóhannssson
Vefforritari

Atómstöðin hf.
Garðastræti 37
101 Reykjavík

sími: 595-3643
fax: 595-3649
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 http://www.atom.is/ http://www.atom.is





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] String check

2002-04-30 Thread Justin French

eregi() is the go... whilst the documentation is pretty thin on the actual
expressions, '^' checks for the pattern at the begining of a string.

?

if(eregi('^324', $string)) {
// 
// it did begin with 324
//
} else {
//
// it didn't
//
}

?

Justin French

Creative Director
http://Indent.com.au




on 30/04/02 10:03 PM, David Orn Johannsson ([EMAIL PROTECTED]) wrote:

 Is ther any function that I could use to check if a string beguins wiht
 a certin set of numbers, like
 if string starts_w “324” {
 do some stuff;
 }
 
 Regards, David
 
 http://www.atom.is/ 
 Davíð Örn Jóhannssson
 Vefforritari
 
 Atómstöðin hf.
 Garðastræti 37
 101 Reykjavík
 
 sími: 595-3643
 fax: 595-3649
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 http://www.atom.is/ http://www.atom.is
 
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] String check

2002-04-30 Thread 1LT John W. Holmes

I wouldn't recommend ereg() unless you have some complex pattern matching to
do. If you're always looking for the same string, in the same spot,then just
use substr(). Now...if you want to match _any_ 3 numbers, etc, then that's
when ereg() comes into play.

---John Holmes...

- Original Message -
From: Justin French [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 8:15 AM
Subject: Re: [PHP] String check


eregi() is the go... whilst the documentation is pretty thin on the actual
expressions, '^' checks for the pattern at the begining of a string.

?

if(eregi('^324', $string)) {
//
// it did begin with 324
//
} else {
//
// it didn't
//
}

?

Justin French

Creative Director
http://Indent.com.au




on 30/04/02 10:03 PM, David Orn Johannsson ([EMAIL PROTECTED]) wrote:

 Is ther any function that I could use to check if a string beguins wiht
 a certin set of numbers, like
 if string starts_w 324 {
 do some stuff;
 }

 Regards, David

 http://www.atom.is/ 
 Davíð Örn Jóhannssson
 Vefforritari
 
 Atómstöðin hf.
 Garðastræti 37
 101 Reykjavík
 
 sími: 595-3643
 fax: 595-3649
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 http://www.atom.is/ http://www.atom.is
 




--
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




Re: [PHP] If value is divisible by 2

2002-04-30 Thread Alexander Skwar

»Craig« sagte am 2002-04-30 um 09:00:33 +0100 :
 I am trying to write an if statement that says if the value $foo is
 divisible by 2 then echo text
 
 i have tried mod but it isnt recognised

if ($foo % 2){
echo foo is divisible by 2;
} else {
echo it is not;
}

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  |Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 6 days 7 hours 12 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Page Numbers

2002-04-30 Thread Pekka Saarinen

At 4/30/2002, you wrote:
Any one know how to display, go to page number on a record list page

eg

Prev 1|2|3|4|5|6... Next

Here's a very simplified demo of dropdown+arrows paging code I did for my 
gallery software.
It might not be the most clever code around, but it works, and scales well.

All you need to edit is the main query, couple fo arrow images, and 
database connect code to make it run.  It now feeds itself, so you might 
want to change that, too.
Live demo is e.g. http://photography-on-the.net/gallery/list.php?exhibition=1

--

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
head
 titlePaging demo by P.S./title
/head
body

?php
// total has to be a value queried from database (=how many results?),
// but to make this code shorter let's give it some value for this demo:
$total = 122;
// set global SERVER variable for different versions of PHP
if (isset($_SERVER)) $PHP_SELF = $_SERVER['PHP_SELF'];

// connect to the database with this file:
include (connect.php);

if (isset  ($HTTP_POST_VARS['perpage']))
{$perpage = $HTTP_POST_VARS['perpage'];
}
if (isset ($HTTP_POST_VARS['offset']))
{$offset = $HTTP_POST_VARS['offset'];
}
if (isset  ($HTTP_GET_VARS['perpage']))
{$perpage = $HTTP_GET_VARS['perpage'];
}
if (isset ($HTTP_GET_VARS['offset']))
{$offset = $HTTP_GET_VARS['offset'];
}
if (!isset ($perpage))
{$perpage = 10;
}
if (!isset ($offset))
{$offset = 0;
}

$fetchlist = mysql_query(

SELECT
 *
FROM
 your_table
LIMIT
 $offset,$perpage

 );
if (!$fetchlist) {
 $queryname = fetchlist;
 include(db_error.php);
}
?

FORM ACTION=?php echo($PHP_SELF); ? METHOD=POST 
name=FORM_page_change id=FORM_page_change
input type=hidden name=offset value=?php print $offset; ?
input type=hidden name=perpage value=?php print $perpage; ?
input type=hidden name=JS_SUBMIT_page_change value=yep
table border=0 cellspacing=3 
cellpadding=0trtdnbsp;nbsp;/tdtd?php

// PREV PAGE LINK WITH VERIFICATION
$prevlink = $offset-$perpage;
if ($prevlink=0) $prevlink=0;
print a href=\ . $PHP_SELF;
print ?offset= . $prevlink . perpage= . $perpage;
print \img src=\../graphs/left.gif\ width=\14\ hspace=\1\ 
height=\16\ border=\1\ alt=\previous page\/a;
print /tdtd;
print select name=\offset\ onchange=\function_submit_page_change()\ 
style=\border: 0px none;\;
print \r;


// THIS CODE BUILDS THE DROPDOWN MENU FOR PAGE SELECTION
$page = 1;
for ($i=0; $i=$total-1; )
{
 print option value=\;
 print $i;
 print \;
 if ($offset==$i) {print  selected;}
 print Page ;
 print $page . nbsp; ;
 print /option;
 print \r;
 $i=$i+$perpage;
 $page++;
}
print /select;
print \r;
print /tdtd;


// NEXT PAGE LINK WITH VERIFICATION
$nextlink = $offset+$perpage;
if ($nextlink=$total) $nextlink=$offset;
if ($nextlink=0) $nextlink=0;
print a href=\ . $PHP_SELF;
print ?offset= . $nextlink . perpage= . $perpage;
print \img src=\../graphs/right.gif\ width=\14\ height=\16\ 
border=\1\ alt=\next page\/a;
print /tdtd;


// JAVASCRIPT FOR THIS FORM
?
script language=JavaScript type=text/javascript
!--
function function_submit_page_change(){
document.FORM_page_change.submit();
 }
//--
/script
noscript
?php
//NON JAVASCRIPT MENU FOR BROWSERS WITHOUT JAVASCRIPT
print input type=\image\ src=\../graphs/jump_to.gif\ alt=\jump to 
selected page\ name=\SUBMIT_page_change\;
?
/noscript

/td/tr/table

?php
Print pbYou successfully listed results from  . $offset .  to  . 
($offset+$perpage) . /b;
?

/body
/html

--

Cheers,
Pekka
http://photography-on-the.net/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 19:43, John Fishworld wrote:

 $imode_code = file($url_file);
 $file_name = basename($url_file);
 $path = dirname($url_file);
 $stripped_path = eregi_replace(^(.{2,6}://)?[^/]*/, , $path);

  On Tuesday 30 April 2002 19:17, John Fishworld wrote:
   Okay right I'm experimenting with an i-mode parser !
   I copy the file (url entered) to a local location !
   Then read through the whole file line at a time and change/replace the
   things that need replaceing !
   On of the things that I need to replace is the links to the pictures so
   that they still show even !
   I've already got from the original file the original location
   http://www.whatever.com
   and now want to insert that in front of the gif files
   ie
   $imode_code[$i] = eregi_replace((img src=).+\.gif\ ,
   \\1$next_path\\2,$imode_code[$i]);
  
   There are just gif files in this !
  
   Does that make more sense ?
 
  Unfortunately, no. Could you post say 20 lines of this file you're
  talking about.

I mean the file that you're readingparsing, not your program.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The absent ones are always at fault.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Page Numbers

2002-04-30 Thread Pekka Saarinen

At 4/30/2002, you wrote:
At 4/30/2002, you wrote:
Any one know how to display, go to page number on a record list page

eg

Prev 1|2|3|4|5|6... Next

Here's a very simplified demo of dropdown+arrows paging code I did for my 
gallery software.
It might not be the most clever code around, but it works, and scales well.

All you need to edit is the main query, couple fo arrow images, and 
database connect code to make it run.  It now feeds itself, so you might 
want to change that, too.
Live demo is e.g. http://photography-on-the.net/gallery/list.php?exhibition=1

--

Damn, the code went corrupt on mailing. Can anyone tell how to post full 
code samples here?
You can get the code by viewing html source of
http://photography-on-the.net/gallery/pagingdemo.html
The code runs at http://photography-on-the.net/gallery/pagingdemo.php

Pekka


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] regular expressions help please

2002-04-30 Thread John Fishworld

Duh ! lol sorry !

Example 1

html
head
 meta http-equiv=content-type content=text/html;charset=iso-8859-1
 meta name=generator content=Edit Plus
 titleLocations/title
 /head
 body bgcolor=#6699FF
  div align=center
  pfont color=blackWelcome tobr
/fontfont color=redimg src=lg_imode.gif alt= height=36
width=120 align=baseline border=0br
 div align=leftYour Preference:/divbr
 a accesskey=1 href=schwul.php4#63879; Schwul/abr
 a accesskey=2 href=lesbisch.chtmlLesbisch/abr
/fontp/p
  /div
 /body
/html

Example 2

htmlheadtitlei-mode/title/head
body
div align=centerimg SRC=/imode/img/logo_40.gif vspace=3
alt=logobrimg src=/imode/img/desc.gif alt=E-Cards
verschicken/div

hr noshade size=2
nbsp;#59106;nbsp;a accesskey=1 href=#sAuswahl/abr
nbsp;#59107;nbsp;a accesskey=2
href=imode.fpl?op=categorylistuid=55%2eFAGAEpartner=Mehr Karten/abr
nbsp;#59108;nbsp;a accesskey=3
href=imode.fpl?op=searchlistuid=55%2eFAGAEpartner=Karten suchen/abr
nbsp;#59109;nbsp;a accesskey=4
href=imode.fpl?op=impressumuid=55%2eFAGAEpartner=Impressum/abr

hr noshade size=2
nbsp;a name=sfont color=#ccEdgars Auswahl/font/abr
div align=center
img src=/db/imodeklein/edgar-IMODE-1-.gif vspace=2br#59091;nbsp;a
href=imode.fpl?op=imodecardprefix=IMODEnummer=1suffx=uid=55%2eFAGAEpar
tner=verschicken/abr
img src=/db/imodeklein/edgar-IMODE-6-.gif vspace=2br#59091;nbsp;a
href=imode.fpl?op=imodecardprefix=IMODEnummer=6suffx=uid=55%2eFAGAEpar
tner=verschicken/abr
img src=/db/imodeklein/edgar-IMODE-2-.gif vspace=2br#59091;nbsp;a
href=imode.fpl?op=imodecardprefix=IMODEnummer=2suffx=uid=55%2eFAGAEpar
tner=verschicken/abr
img src=/db/imodeklein/edgar-IMODE-7-.gif vspace=2br#59091;nbsp;a
href=imode.fpl?op=imodecardprefix=IMODEnummer=7suffx=uid=55%2eFAGAEpar
tner=verschicken/abr

/div

hr noshade size=2
nbsp;#59115;nbsp;a accesskey=0
href=http://www.baesurl.com/imenu/;i-menu/a

/body
/html


 On Tuesday 30 April 2002 19:43, John Fishworld wrote:

  $imode_code = file($url_file);
  $file_name = basename($url_file);
  $path = dirname($url_file);
  $stripped_path = eregi_replace(^(.{2,6}://)?[^/]*/, , $path);

   On Tuesday 30 April 2002 19:17, John Fishworld wrote:
Okay right I'm experimenting with an i-mode parser !
I copy the file (url entered) to a local location !
Then read through the whole file line at a time and change/replace
the
things that need replaceing !
On of the things that I need to replace is the links to the pictures
so
that they still show even !
I've already got from the original file the original location
http://www.whatever.com
and now want to insert that in front of the gif files
ie
$imode_code[$i] = eregi_replace((img src=).+\.gif\ ,
\\1$next_path\\2,$imode_code[$i]);
   
There are just gif files in this !
   
Does that make more sense ?
  
   Unfortunately, no. Could you post say 20 lines of this file you're
   talking about.

 I mean the file that you're readingparsing, not your program.

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 The absent ones are always at fault.
 */

 --
 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




Re: [PHP] Database Duplication

2002-04-30 Thread Liam Gibbs

Maybe I should explain myself a little better. Sorry
for leaving out what turned out to be crucial details.

What is happening is I want to make a test user so
that, whenever I log in with that user, I can muck up
the database and not worry about what others will see
or permanent changes.

In the past, whenever I tested the site, I had to
quickly reset any changes I'd done to the database,
which sometimes involved an hour or more of work for
hidden bugs that I ended up overlooking.

The test user (whom only I know of) is needed to test
the Web site (make sure things are being deleted as
needed, etc.). What I envisioned is that, when I log
in as 'testuser', the database will be duplicated and
I'll use that. While I'm testing my site, mucking
things up, screwing up the data, I don't have to worry
about other users coming along and seeing these
changes, because they'll be seeing the original, ,
unscrewed data (which is why I need to use a muckable,
duplicate database), making changes, etc. This way,
that hour of work I mentioned would be eliminated.

When I log out, the database is useless because it's
only really test data (with enough real-life data
already populated in the database), and so it doesn't
matter what changes users have done in the meantime.

What I may do is just duplicate the database and have
a permanent, screwable database to play with, because
that seems like less of a load on the system. I just
wanted to have up-to-date data in my screwable
database. The above method looks like a lot of
processor time, etc., so just making a permanent test
data database may be the best option, so it doesn't
have to keep recopying. I just thought I'd throw out
the question and see if it was smaller than I thought
it would be.


__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Session Authentication etc...

2002-04-30 Thread Troy Lynch

I'm currently rewriting a website in PHP and something I'm looking to do is
login and logouts but also have a page to view who is logged at the present
time. I've kinda made some login code which basically checks the database
and then sets a cookie which I think I will change cause it looks like I
wonna do session variables. Anways anyone either know of a decent
authentication lib that I can use to check the users online and do
authentication or can someone point me in the right direction in doing this?

Thanks

Troy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Strange Form Action Type

2002-04-30 Thread Jack

Dear all
I had saw a form which is quite strange, because it look some as below:

form name=o_form, action=deposit_admin.php?save=yes method=post

as the deposit_admin.php is actually itself, but the ?save=yes is
represent what meaning?

Can someone pls tell me?


--
Thx a lot!
Jack
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Strange Form Action Type

2002-04-30 Thread Justin French

That's just something the programmer has put in there for the next script to
recognise.

It could have been ?shoe_size=14, and it could have also been done with

INPUT type=hidden name=save value=yes


Justin French


Creative Director
http://Indent.com.au




on 30/04/02 11:59 PM, Jack ([EMAIL PROTECTED]) wrote:

 Dear all
 I had saw a form which is quite strange, because it look some as below:
 
 form name=o_form, action=deposit_admin.php?save=yes method=post
 
 as the deposit_admin.php is actually itself, but the ?save=yes is
 represent what meaning?
 
 Can someone pls tell me?
 
 
 --
 Thx a lot!
 Jack
 [EMAIL PROTECTED]
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Database Duplication

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 21:57, Liam Gibbs wrote:
 Maybe I should explain myself a little better. Sorry
 for leaving out what turned out to be crucial details.

I think someone asked in response to your original post what db are you 
using?. You still haven't told us!

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The kind of danger people most enjoy is the kind they can watch from
a safe place.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Database Duplication

2002-04-30 Thread Richard Emery

I'm going to guess you are using mysql.

Before starting a test, dump your database with the mysqldump command.
Edit this file to create/use your test database.
Load your test database with this file.

This is too obvious and too easy...therefore, I assume you already did this
and it did not provide what you needed.
What additional functionality are you seeking?
- Original Message -
From: Liam Gibbs [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 8:57 AM
Subject: Re: [PHP] Database Duplication


Maybe I should explain myself a little better. Sorry
for leaving out what turned out to be crucial details.

What is happening is I want to make a test user so
that, whenever I log in with that user, I can muck up
the database and not worry about what others will see
or permanent changes.

In the past, whenever I tested the site, I had to
quickly reset any changes I'd done to the database,
which sometimes involved an hour or more of work for
hidden bugs that I ended up overlooking.

The test user (whom only I know of) is needed to test
the Web site (make sure things are being deleted as
needed, etc.). What I envisioned is that, when I log
in as 'testuser', the database will be duplicated and
I'll use that. While I'm testing my site, mucking
things up, screwing up the data, I don't have to worry
about other users coming along and seeing these
changes, because they'll be seeing the original, ,
unscrewed data (which is why I need to use a muckable,
duplicate database), making changes, etc. This way,
that hour of work I mentioned would be eliminated.

When I log out, the database is useless because it's
only really test data (with enough real-life data
already populated in the database), and so it doesn't
matter what changes users have done in the meantime.

What I may do is just duplicate the database and have
a permanent, screwable database to play with, because
that seems like less of a load on the system. I just
wanted to have up-to-date data in my screwable
database. The above method looks like a lot of
processor time, etc., so just making a permanent test
data database may be the best option, so it doesn't
have to keep recopying. I just thought I'd throw out
the question and see if it was smaller than I thought
it would be.


__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
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




Re: [PHP] Session Authentication etc...

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 22:57, Troy Lynch wrote:
 I'm currently rewriting a website in PHP and something I'm looking to do is
 login and logouts but also have a page to view who is logged at the present
 time. 

Assuming that you do not require a user to logout, there is no reliable 
method to determine whether a user is (still) logged in. The best you can do 
is know (1) When they logged in  (2) When their last request was.

 I've kinda made some login code which basically checks the database
 and then sets a cookie which I think I will change cause it looks like I
 wonna do session variables. Anways anyone either know of a decent
 authentication lib that I can use to check the users online and do
 authentication or can someone point me in the right direction in doing
 this?

There's something called php_lib_login that you can google for.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The Army needs leaders the way a foot needs a big toe.
-- Bill Murray
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Database Duplication

2002-04-30 Thread Liam Gibbs

 I'm going to guess you are using mysql.

Dagwood. I always leave details out. Doesn't matter
what it is. Yes, it's MySQL, and I'm forwarding this
to the list because you're not the only one that
caught my oversight. Sorry about that again.

 Before starting a test, dump your database with the
 mysqldump command.
 Edit this file to create/use your test database.
 Load your test database with this file.

Hmm. No I didn't do this. Not too familiar with all
the intricacies of MySQL (or SQL). I'll take a look at
dumping the database.

 This is too obvious and too easy...therefore, I
 assume you already did this
 and it did not provide what you needed.
 What additional functionality are you seeking?

I'm just seeking a database duplication that I can
throw away after I'm done.


__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Problem with array

2002-04-30 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I've got a form that creates checkboxes based on the number of rows on a table. The 
user has to check some of the boxes and then click submit. The boxes are named RG1, 
RG2, RG3, 

If there are 4 checkboxes and the user selects them all or selects the first, second 
and fourth, or the first third and fourth my code works. But if the user selects the 
second, third and fourth (He does not checks the first one) no information is recorded 
on my array.

Here's the code that I have to search the $HTTP_POST_VARS and then fill a array 
variable called $RG.


function SearchRGs() {
global $HTTP_POST_VARS;
global $RGs;

// fills the array variable RGs with the values of checked checkboxes that start 
with the name RG# (where # goes from 1,2,3,).
   // returns the qty of checked RGs and size of the $RGs array.

$index = count($HTTP_POST_VARS);
$count = 0;

for ($i=1; $i  $index; $i++) {
if (isset($HTTP_POST_VARS[RG$i])) {
$RGs[] = $HTTP_POST_VARS[RG$i];
$count++;
}
}

return $count;

}


Can anyone help me with this?

Why if I do not check the first checkbox on the form the array  is not filled.

Thank you,

Carlos Fernando.



Re: [PHP] Problem with array

2002-04-30 Thread Richard Emery

show the form.

- Original Message -
From: Carlos Fernando Scheidecker Antunes [EMAIL PROTECTED]
To: PHP-GENERAL [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 10:11 AM
Subject: [PHP] Problem with array


Hello All,

I've got a form that creates checkboxes based on the number of rows on a
table. The user has to check some of the boxes and then click submit. The
boxes are named RG1, RG2, RG3, 

If there are 4 checkboxes and the user selects them all or selects the
first, second and fourth, or the first third and fourth my code works. But
if the user selects the second, third and fourth (He does not checks the
first one) no information is recorded on my array.

Here's the code that I have to search the $HTTP_POST_VARS and then fill a
array variable called $RG.


function SearchRGs() {
global $HTTP_POST_VARS;
global $RGs;

// fills the array variable RGs with the values of checked checkboxes
that start with the name RG# (where # goes from 1,2,3,).
   // returns the qty of checked RGs and size of the $RGs array.

$index = count($HTTP_POST_VARS);
$count = 0;

for ($i=1; $i  $index; $i++) {
if (isset($HTTP_POST_VARS[RG$i])) {
$RGs[] = $HTTP_POST_VARS[RG$i];
$count++;
}
}

return $count;

}


Can anyone help me with this?

Why if I do not check the first checkbox on the form the array  is not
filled.

Thank you,

Carlos Fernando.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Announcement: Smarty template engine 2.1.0 released

2002-04-30 Thread Monte Ohrt

Homepage:
http://www.phpinsider.com/php/code/Smarty/

Most notable new features are block functions which act on
blocks of text {func}{/func}, and output filters which
act on the output of the templates.

Version 2.1.0
-

 - introduced output filters. (Andrei)
 - changed the way filters are loaded, added load_filter()
   API function and $autoload_filters variable. (Andrei)
 - added caching logic for expire times per cache file
   (Norbert Rocher, Monte)
 - fixed html_select_date when field separator is /
   (Roberto Berto, Monte)
 - added -MM-DD format support to html_select_date
   (Jan Rosier, Monte)
 - fixed cache_lifetime logic bug, also made -1 = never
   expire (Monte)
 - fixed directory separator issue for Windows. (Andrei)
 - added ability to use simple variables as array indices or
   object properties. (Andrei)
 - added ability to unregister pre/postfilters plugins at
   runtime. (Andrei)
 - added 'htmlall' attribute to escape modifier. (Monte)
 - added template_exists() API function. (Andrei)
 - fixed a problem with using dynamic values for 'file'
   attribute of {include_php} tag. (Andrei)
 - added $smarty.template variable. (Andrei)
 - fixed several plugins that would not work if the plugin
   directory was not the default one. (Andrei)
 - implemented support for block functions. (Andrei)
 - made it possible to assign variables in pre/postfilter
   plugins. (Andrei)



-- 
Monte Ohrt [EMAIL PROTECTED]
Director of Technology, ispi Inc.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Parsing XML

2002-04-30 Thread Fredrik Arild Takle

Hi,

this might be a silly question, but I really haven't used XML alot with PHP.
I've parsed som XML, when I do xml_parse it outputs the html-codes.

I want to make a variable out of it.. I've tried $output = xml_parse();



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] RE: Problem with array

2002-04-30 Thread Tim Ward

Try some diagnostics to tell you what's going on

In the page you're submitting to try
Foreach($HTTP_POST_VARS as $key=$value) echo($key=$valuebr);

Part of your problem may be that you're using the number of 
form elements returned to control the for loop. It doesn't
really have any significance in this context.

Is there any reason why you're not naming the checkboxes RG[1], RG[2], etc.?
This would make everything much easier - you can then do ...

Foreach ($HTTP_POST_VARS[RG] as $value) $RGs[] = $value


Tim Ward
Internet Chess www.chessish.com http://www.chessish.com 

--
From:  Carlos Fernando Scheidecker Antunes
[SMTP:[EMAIL PROTECTED]]
Sent:  30 April 2002 16:11
To:  PHP-GENERAL
Subject:  Problem with array

Hello All,

I've got a form that creates checkboxes based on the number of rows
on a table. The user has to check some of the boxes and then click submit.
The boxes are named RG1, RG2, RG3, 

If there are 4 checkboxes and the user selects them all or selects
the first, second and fourth, or the first third and fourth my code works.
But if the user selects the second, third and fourth (He does not checks the
first one) no information is recorded on my array.

Here's the code that I have to search the $HTTP_POST_VARS and then
fill a array variable called $RG.


function SearchRGs() {
global $HTTP_POST_VARS;
global $RGs;

// fills the array variable RGs with the values of checked
checkboxes that start with the name RG# (where # goes from 1,2,3,).
   // returns the qty of checked RGs and size of the $RGs array.

$index = count($HTTP_POST_VARS);
$count = 0;

for ($i=1; $i  $index; $i++) {
if (isset($HTTP_POST_VARS[RG$i])) {
$RGs[] = $HTTP_POST_VARS[RG$i];
$count++;
}
}

return $count;

}


Can anyone help me with this?

Why if I do not check the first checkbox on the form the array  is
not filled.

Thank you,

Carlos Fernando.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP 4.2.0 + Apache 2.0.35 (W2KSP2)

2002-04-30 Thread Kirk Babb

I have copied these three lines from the php install.txt file into
httpd.conf:

LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php

and php4ts.dll is in winnt\system32.  Apache freezes unless I comment out
those lines.  When I test php scripts from the command prompt inside the php
dir. (C:\php) I see the correct output, so I know php is working (as is my
install of php-gtk).  Where have I strayed from the path?

this worked for my install of Apache 1.3.24 and PHP 4.1.2, so I'm not sure
what's going on.

thanks for any and all help,

Kirk



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Specify php.ini location in windows

2002-04-30 Thread Patrick Lynch

Hi,
 
I am having a small problem with PHP/Windows.
 
[config]
Windows 2000 Server
IIS 5
PHP 4.0.6
 
I have a server with a php.ini in the c:\winnt directory and a site
running fine with that configuration.
 
I need to set up a new site, using a different php.ini. The new site is
set up in IIS but I cannot find a way to make PHP look to a different
php.ini other than the one in c:\winnt.
 
I have tried using the -c command line option in the app mappings
section but to no avail. Here is what I have in the executable text box:
C:\Inetpub\php\php.exe -c z:\Dir\With\Other\IniFile %s %s
 
PHP pages execute fine but a page with phpinfo() shows that php is still
reading the file from c:\winnt\php.ini
 
Any ideas?
 
Thanks in advance,
Patrick.



[PHP] Files sorted by date?

2002-04-30 Thread Randum Ian

Hi there,

I got a number of files in the directory /reviews/txt which are reviews.
They are submitted by people all over the world.

Can someone please tell me what I need to do so that I can display them in
date order, newest at the top on a webpage?

Cheers, Ian.
---
Randum Ian
DJ / Reviewer / Webmaster, DancePortal (UK) Limited
[EMAIL PROTECTED]
http://www.danceportal.co.uk
DancePortal.co.uk - Global dance music media


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] php command line

2002-04-30 Thread Ezra Nugroho

I was trying to compile php command line and got some problem.
Maybe some of you can help.

version: 4.1.2
I did:
./configure --with-ldap --with-oracle --with-oci8 
--with-mysql=/usr/src/mysql-3.23.43-pc-linux-gnu-i686 --enable-track-vars 
--disable-debug --prefix=/usr/local/apache/php 
--with-config-file-path=/usr/local/apache/lib --with-gd

when tested, it gave:
Failed loading /usr/local/apache/libexec/ZendOptimizer.so: 
/usr/local/apache/libexec/ZendOptimizer.so: cannot open shared object file: 
No such file or directory

I couldn't find ZendOptimizer.so anywhere.
Any clue?

Thanks,






Ezra Nugroho
Web/Database Application Specialist
Goshen College Information Technology Services
Phone: (574) 535-7706



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Files sorted by date?

2002-04-30 Thread heinisch

At 30.04.2002  17:24, you wrote:

Hi there,

I got a number of files in the directory /reviews/txt which are reviews.
They are submitted by people all over the world.

Can someone please tell me what I need to do so that I can display them in
date order, newest at the top on a webpage?

Cheers, Ian.
---
Randum Ian
DJ / Reviewer / Webmaster, DancePortal (UK) Limited
[EMAIL PROTECTED]
http://www.danceportal.co.uk
DancePortal.co.uk - Global dance music media
exec(ls -lc reviews/txt/*,$result);
for($i=0;$i  count($result);$i++)
{
 if(($result[$i] ==.)||($result[$i] ==..)
 {} // do notjing
 else
 {
 do something with $result[$i];
 }
}
HTH Oliver


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] _SERVER variable insd prnt sttmnt

2002-04-30 Thread Andrew Chase

For the sake of legibility you could always assign the contents of
$_SERVER['PHP_SELF'] to another variable before using it in the print
statement:

$PHP_SELF = $_SERVER['PHP_SELF'];

print LIA HREF='$PHP_SELF?letter=$chars[$cnt]';

Shouldn't be a problem security-wise as long as register_globals is off;
Even if somebody tried to pass an arbitrary value to PHP_SELF in the query
string, it would only show up in $_GET['PHP_SELF']. It also provides a quick
way to bring pre- 4.1.2 scripts relying on the old global $PHP_SELF up to
date.

-Andy


 -Original Message-
 From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 29, 2002 8:30 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] _SERVER variable insd prnt sttmnt


   // print LIA HREF='$_SERVER['PHP_SELF']?letter=$chars[$cnt]' .

 This is the problem with not breaking out of a string to display
 a variable.
 Ideally, you would do it this way:

 print LIA HREF=' . $_SERVER['PHP_SELF'] . ?letter= . $chars[$cnt] .
 ';

 But some people just have a problem with doing it that way, so you can use
 braces.

 print LIA HREF='{$_SERVER['PHP_SELF']}?letter={$chars[$cnt]}';


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Checking to see if a DELETE was successful from MSSQL

2002-04-30 Thread Joshua E Minnie

Can anyone tell me the best way to check that a DELETE query was successful.
I have tried using mssql_num_rows() and mssql_rows_affected() but it is
always telling me that the DELETE was successful, even when it shouldn't
have been.  Here is the code that I am trying to work with right now.

?
function delete_user($dbname, $user) {
  //connecting to db and getting table
  mssql_select_db($dbname) or die(Table unavailable);

  //deleting user from user table
  $query = DELETE FROM [users] WHERE [user] = '$user';
  $result = mssql_query($query) or die(Unable to delete user);
  if(mssql_num_rows($result)  0) echo User successfully deleted.br\n;
  else echo User does not existbr\n;
}
?

*Running PHP 4.1.2 on Windows NT 4.0 with MS SQL Server 2000

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Checking to see if a DELETE was successful from MSSQL

2002-04-30 Thread Steve Bradwell

Try this,

  $query = DELETE FROM [users] WHERE [user] = '$user';
  $result = mssql_query($query) or die(Unable to delete user);
  if ($result)
 //delete worked.
  else
 //delete failed.

-Original Message-
From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 12:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Checking to see if a DELETE was successful from MSSQL


Can anyone tell me the best way to check that a DELETE query was successful.
I have tried using mssql_num_rows() and mssql_rows_affected() but it is
always telling me that the DELETE was successful, even when it shouldn't
have been.  Here is the code that I am trying to work with right now.

?
function delete_user($dbname, $user) {
  //connecting to db and getting table
  mssql_select_db($dbname) or die(Table unavailable);

  //deleting user from user table
  $query = DELETE FROM [users] WHERE [user] = '$user';
  $result = mssql_query($query) or die(Unable to delete user);
  if(mssql_num_rows($result)  0) echo User successfully deleted.br\n;
  else echo User does not existbr\n;
}
?

*Running PHP 4.1.2 on Windows NT 4.0 with MS SQL Server 2000

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.




-- 
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




[PHP] XML to HTML?!

2002-04-30 Thread Fredrik Arild Takle

Hi,

this might be a silly question, but I really haven't used XML alot with PHP.
I've parsed some XML, when I do xml_parse it outputs the html-codes.

I want to make a variable out of it, so I can write it to a file. I've tried
$output = xml_parse();



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Files sorted by date?

2002-04-30 Thread Jason Wong

On Wednesday 01 May 2002 00:24, Randum Ian wrote:
 Hi there,

 I got a number of files in the directory /reviews/txt which are reviews.
 They are submitted by people all over the world.

 Can someone please tell me what I need to do so that I can display them in
 date order, newest at the top on a webpage?

First look at Directory functions
Then Filesystem functions
Then Array Functions

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Support your right to arm bears!!
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mail() errors and alternatives

2002-04-30 Thread John Hughes

For the second time in less than a week, the commercial Web service
provider where I have four domains hosted has managed to break PHP.
In particular, I get this message:

Warning: mail() is not supported in this PHP build 

I'm not interested in what causes the PHP mail() function to become
unavailable. My problem is that the mail() function -- or, more to
the point, the ability to send e-mail -- is mission critical. No
mail; no work. No work; unhappy boss. You get the idea.

I'm looking for ideas on how I can defend against mail() failures.
One idea I had would be to test 

if(mail($to, $subj, $body, $headers)
{
  /* report ok send */
} ELSE {
  /* do alternative send */
} 

Any ideas of how that alternative send could work?  

I do have an alternative service provider where I have access to PHP
that works. Any ideas on the best way to redirect the $to, $subj,
$body, $headers to a PHP script at the other domain and return some
notification that the send did not report errors?

TIA,

John Hughes
http://jomari.com




__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: PHP 4.2.0 + Apache 2.0.35 (W2KSP2)

2002-04-30 Thread Julio Nobrega Trabalhando

  Load the experimental apache2filter.dll instead.

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Kirk Babb [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have copied these three lines from the php install.txt file into
 httpd.conf:

 LoadModule php4_module c:/php/sapi/php4apache.dll
 AddModule mod_php4.c
 AddType application/x-httpd-php .php

 and php4ts.dll is in winnt\system32.  Apache freezes unless I comment out
 those lines.  When I test php scripts from the command prompt inside the
php
 dir. (C:\php) I see the correct output, so I know php is working (as is my
 install of php-gtk).  Where have I strayed from the path?

 this worked for my install of Apache 1.3.24 and PHP 4.1.2, so I'm not sure
 what's going on.

 thanks for any and all help,

 Kirk





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Database Duplication

2002-04-30 Thread Miguel Cruz

On Tue, 30 Apr 2002, Liam Gibbs wrote:
 Before starting a test, dump your database with the
 mysqldump command.
 Edit this file to create/use your test database.
 Load your test database with this file.
 
 Hmm. No I didn't do this. Not too familiar with all
 the intricacies of MySQL (or SQL). I'll take a look at
 dumping the database.

Something like:

   mysqladmin -u root create temp_db
   mysql -u root -e 'grant all access on temp_db to real_user'
   mysqldump -u real_user real_db | mysql -u real_user temp_db

and then when you're done:

   mysqladmin -u root drop temp_db

obviously adding -p to those lines as appropriate.

But it's not going to be that fast with large databases, and you'll have 
to work out some scheme for dealing with multiple users each needing their 
own copy.

We don't know nearly enough about your project to really work out 
alternatives for you, but I bet there's a good one somewhere. Temp tables, 
shadow tables in the same database, something.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] regular expressions help please

2002-04-30 Thread Miguel Cruz

On Tue, 30 Apr 2002, Ed Lazor wrote:
 Pull everything except a specific word from a sentence.  For example, 
 pulling everything except the word run from the water run was steep.

   $str = 'the water run was steep';
   print preg_replace('/(\s*water)/', '', $str);

 Pull all words from a string starting with a specific letter or 
 pattern.  For example, pulling all of the words starting with the letter r 
 from run beep burp ran rin ron runt zoot zip pow

   $str = 'run beep burp ran rin ron runt zoot zip pow';
   if (preg_match_all('/(\br\w+\b)/', $str, $matches))  
  print join(' ', $matches[1]);

 Pulling all words from a string excluding ones starting with a specific
 letter or pattern.  For example, pulling all of the words except ones
 starting with the letter r from run beep burp ran rin ron runt zoot zip
 pow

   $str = 'run beep burp ran rin ron runt zoot zip pow';
   if (preg_match_all('/([\b\W][^r]\w+\b)/', $str, $matches))
  print join(' ', $matches[1]);

 Pulling a word between two other words without having to know what the
 word is.  For example, pulling whatever word displays between the and
 sky.  If the string was the blue sky, the result would be the word
 blue.  If the string were the green sky, the result would be the word
 green.

   $str = 'the green sky';  
   if (preg_match('/the\s+(\S+?)\s+sky/', $str, $matches))
  print $matches[1];   

 I apologize in advance if these are really simple.  It's just that I'm
 new to regular expressions and reading all of the web page tutorials,
 manual pages, and mailing list archive messages has left me thinking I'm
 complicating something somewhere, because it really shouldn't be this
 hard.

Well, it's not trivial. Regular expressions is a whole complete language,
entirely separate from PHP, with a lot to learn. Practice enough, though,
and you'll start to see how you can do amazing things with it.

Also, I'd recommend using the Perl-style regex (preg_ rather than ereg_
functions) and reading 'man perlre' if it's installed on your system
(someone can probably suggest a web location for that text).

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] SQL Query (Group By)

2002-04-30 Thread Andrew Brampton

Hi,
This is more a SQL question that a php one, but here goes:

I have a table with 3 fields, Date, IP, ISP.
Basically I have written some php to store the following in the table each time 
someone hits a page on my site. Now I want to display some info about the users 
currently on my site, but I want to try and do it with 1 SQL query.

Basically I want to display a count of how many unique IPs there are on my site from 
each ISP... for example
3 NTL 
1 BT
5 Freeserve

but in each group there will be more than 1 entry for each user due to them causing a 
row in the table on each hit. I can't seem to group it together how I want with 1 
query. The best I can do is count how many rows are from each IP (but this figure is 
too high since it doesn't take into account that the IPs must be unique). Here is my 
current SQL:

$sql = SELECT ISP, COUNT(*) as total FROM track GROUP BY ISP ORDER BY total DESC;

I could make this work by doing some sorting in PHP once I get the data, but I would 
prefer to do it with SQL... Anyone know how to do what I want?

Thanks
Andrew



Re: [PHP] Checking to see if a DELETE was successful from MSSQL

2002-04-30 Thread Joshua E Minnie

I tried that already, it always returns true.  The reason is because it will
always return true since it is only deleting if the user exists.  This means
that the query will run and successfully complete.  But if the user does not
exist it still runs and completes successfully, but the user was not there.
So how do I detect that situation.

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.

Steve Bradwell [EMAIL PROTECTED] wrote:
 Try this,

   $query = DELETE FROM [users] WHERE [user] = '$user';
   $result = mssql_query($query) or die(Unable to delete user);
   if ($result)
  //delete worked.
   else
  //delete failed.

Original Message
 Can anyone tell me the best way to check that a DELETE query was
successful.
 I have tried using mssql_num_rows() and mssql_rows_affected() but it is
 always telling me that the DELETE was successful, even when it shouldn't
 have been.  Here is the code that I am trying to work with right now.

 ?
 function delete_user($dbname, $user) {
   //connecting to db and getting table
   mssql_select_db($dbname) or die(Table unavailable);

   //deleting user from user table
   $query = DELETE FROM [users] WHERE [user] = '$user';
   $result = mssql_query($query) or die(Unable to delete user);
   if(mssql_num_rows($result)  0) echo User successfully deleted.br\n;
   else echo User does not existbr\n;
 }
 ?

 *Running PHP 4.1.2 on Windows NT 4.0 with MS SQL Server 2000



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Checking to see if a DELETE was successful from MSSQL

2002-04-30 Thread Miguel Cruz

On Tue, 30 Apr 2002, Joshua E Minnie wrote:
 I tried that already, it always returns true.  The reason is because it
 will always return true since it is only deleting if the user exists.  
 This means that the query will run and successfully complete.  But if
 the user does not exist it still runs and completes successfully, but
 the user was not there. So how do I detect that situation.

You could always try preceeding it with a SELECT...

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Checking to see if a DELETE was successful from MSSQL

2002-04-30 Thread Joshua E Minnie

That was exactly what I needed.  Thanks, this group has been so helpful.

.:. Josh .:.

Miguel Cruz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Tue, 30 Apr 2002, Joshua E Minnie wrote:
  I tried that already, it always returns true.  The reason is because it
  will always return true since it is only deleting if the user exists.
  This means that the query will run and successfully complete.  But if
  the user does not exist it still runs and completes successfully, but
  the user was not there. So how do I detect that situation.

 You could always try preceeding it with a SELECT...

 miguel




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] parse error

2002-04-30 Thread Jule

Hey guys, i'm writing this guestbook script for my site, and i'm getting a 
random parse error where i think everything is normal, it gives it on line 26 
which is

echo Your entry will be posted!;

my script follows

Jule

--SCRIPT--

?php
$Guestbook[dateadd] = date(F j, Y H:i:s);
$Guestbook[name] = trim($Guestbook[name]);
$Guestbook[town] = trim($Guestbook[town]);
$Guestbook[email] = trim($Guestbook[email]);
$Guestbook[website] = trim($Guestbook[website]);
$Guestbook[favsong] = trim($Guestbook[favsong]);
$Guestbook[comments] = trim($Guestbook[comments]);
$Guestbook[mailinglist] = trim($Guestbook[mailinglist]);

$Host = localhost;
$User = ;
$Password = *;
$DBName = blindtheory;
$TableName = guestbook;
$TableName2 = mailinglist;
$Pattern = .+@.+..+;
$Pattern2 = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);

$Link = mysql_connect ($Host, $User, $Password);
$Query = INSERT into $TableName values('0', '$Guestbook[dateadd]', 
'$Guestbook[name]', '$Guestbook[town]', '$Guestbook[email]', 
'$Guestbook[website]','$Guestbook[favsong]', '$Guestbook[comments]');
$Link2 = mysql_connect ($Host, $User, $Password);
$Query2 = INSERT into $TableName2 values('0', '$Guestbook[dateadd]', 
'$Guestbook[name]', '$Guestbook[email]');

if (mysql_db_query ($DBName, $Query, $Link)) {
echo Your entry will be added;
} else {
echo There was an error in during the posting, please contact 
a 
href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the 
problem.br;
}

if (isset($Guestbook[mailinglist])) {

if (mysql_db_query ($DBName, $Query2, $Link2)) {
echo Your e-mail address was sucessfully added to our 
mailinglist;
} else {
echo There was an error in during the posting, please 
contact a 
href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the 
problem.br;
}
}
mysql_close ($Link);
mysql_close ($Link2);
?
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] XML to HTML?!

2002-04-30 Thread Alexander Skwar

»Fredrik Arild Takle« sagte am 2002-04-30 um 18:48:37 +0200 :
 I've parsed some XML, when I do xml_parse it outputs the html-codes.

Wrap into a output buffer.  ob_start, ob_get_contents

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  |Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 6 days 12 hours 49 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP Secure Connection: Alternative to Curl ?

2002-04-30 Thread [-^-!-%-

Hello everyone,

I have host that does not support Curl. I was wondering, if there was
another program I can use to make a secure connection (in PHP).

I need to make an ADC Connection to Authorize.net.


Pleae let me know.


FYI:
Do those of you who use Dreamweaver Ultradev  Phakt, Dreamweaver MX now
supports PHP. Macromedia ahs a pre-release on theri server. Check it out!


__John Monfort_
_+---+_
 P E P I E  D E S I G N S
   www.pepiedesigns.com
-+___+-



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Best BBS

2002-04-30 Thread Austin Marshall

R wrote:
 Hey all,
 
 This email is not for any questions/suggestions etc but a thank you note.
 Some time back i posted an email asking if anyone had any recomendation for
 a BBS system and I got a lot of replies.
 I thank each and every one of you who wrote in,
 after checking out the links or software names you gave me I have decided to
 use PHPBB2
 Will post a link to my site where this is installed after a week or so, tell
 me what you think.
 If you have any comments on why PHPbb2 is BAD for me lemme
 know.
 
 Cheers all  god bless.
 -Ryan.
 

To bring balance in the force, there is www.phpbb2.org.  It has a few 
arguments of why it is BAAADDD... I know i will never use phpbb2


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] parse error

2002-04-30 Thread Miguel Cruz

You're missing a closing quote on the assignment for $Query2. 

Come on people, keep your eyes open. This is basic stuff. Doesn't take 
any special genius to count quotes and braces.

miguel

On Tue, 30 Apr 2002, Jule wrote:
 Hey guys, i'm writing this guestbook script for my site, and i'm getting a 
 random parse error where i think everything is normal, it gives it on line 26 
 which is
 
 echo Your entry will be posted!;
 
 my script follows
 
 Jule
 
 --SCRIPT--
 
 ?php
   $Guestbook[dateadd] = date(F j, Y H:i:s);
   $Guestbook[name] = trim($Guestbook[name]);
   $Guestbook[town] = trim($Guestbook[town]);
   $Guestbook[email] = trim($Guestbook[email]);
   $Guestbook[website] = trim($Guestbook[website]);
   $Guestbook[favsong] = trim($Guestbook[favsong]);
   $Guestbook[comments] = trim($Guestbook[comments]);
   $Guestbook[mailinglist] = trim($Guestbook[mailinglist]);
 
   $Host = localhost;
   $User = ;
   $Password = *;
   $DBName = blindtheory;
   $TableName = guestbook;
   $TableName2 = mailinglist;
   $Pattern = .+@.+..+;
   $Pattern2 = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);
 
   $Link = mysql_connect ($Host, $User, $Password);
   $Query = INSERT into $TableName values('0', '$Guestbook[dateadd]', 
 '$Guestbook[name]', '$Guestbook[town]', '$Guestbook[email]', 
 '$Guestbook[website]','$Guestbook[favsong]', '$Guestbook[comments]');
   $Link2 = mysql_connect ($Host, $User, $Password);
   $Query2 = INSERT into $TableName2 values('0', '$Guestbook[dateadd]', 
 '$Guestbook[name]', '$Guestbook[email]');
 
   if (mysql_db_query ($DBName, $Query, $Link)) {
   echo Your entry will be added;
   } else {
   echo There was an error in during the posting, please contact 
a 
 href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the 
 problem.br;
   }
   
   if (isset($Guestbook[mailinglist])) {
 
   if (mysql_db_query ($DBName, $Query2, $Link2)) {
   echo Your e-mail address was sucessfully added to our 
mailinglist;
   } else {
   echo There was an error in during the posting, please 
contact a 
 href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the 
 problem.br;
   }
   }
   mysql_close ($Link);
   mysql_close ($Link2);
 ?
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Checking to see if a DELETE was successful from MSSQL

2002-04-30 Thread Steve Bradwell

I agree, try using a select after the delete.

-Steve.

-Original Message-
From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 30, 2002 1:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Checking to see if a DELETE was successful from MSSQL


I tried that already, it always returns true.  The reason is because it will
always return true since it is only deleting if the user exists.  This means
that the query will run and successfully complete.  But if the user does not
exist it still runs and completes successfully, but the user was not there.
So how do I detect that situation.

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.

Steve Bradwell [EMAIL PROTECTED] wrote:
 Try this,

   $query = DELETE FROM [users] WHERE [user] = '$user';
   $result = mssql_query($query) or die(Unable to delete user);
   if ($result)
  //delete worked.
   else
  //delete failed.

Original Message
 Can anyone tell me the best way to check that a DELETE query was
successful.
 I have tried using mssql_num_rows() and mssql_rows_affected() but it is
 always telling me that the DELETE was successful, even when it shouldn't
 have been.  Here is the code that I am trying to work with right now.

 ?
 function delete_user($dbname, $user) {
   //connecting to db and getting table
   mssql_select_db($dbname) or die(Table unavailable);

   //deleting user from user table
   $query = DELETE FROM [users] WHERE [user] = '$user';
   $result = mssql_query($query) or die(Unable to delete user);
   if(mssql_num_rows($result)  0) echo User successfully deleted.br\n;
   else echo User does not existbr\n;
 }
 ?

 *Running PHP 4.1.2 on Windows NT 4.0 with MS SQL Server 2000



-- 
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




[PHP] Re: Best BBS

2002-04-30 Thread Michael Kimsal

Austin Marshall wrote:

 
 To bring balance in the force, there is www.phpbb2.org.  It has a few 
 arguments of why it is BAAADDD... I know i will never use phpbb2
 


It's a pretty lame page/site that amounts to someone whining about
the fact that

1.  The phpbb website looks good, therefore they must have crap code and
2.  They have a lot of includes/requires/constants and if/else

If it's truly poor code, and the guy wants to criticize, then post
some code samples and point out WHY it's bad.

Personally, I agree - I had to do a bit of work with someone else's
phpbb site a few weeks ago and thought it was a horrible
mishmash of code/html.  But I'm not going to post a whole website
about how bad it is unless without giving specific examples.  :)

Michael Kimsal
http://www.logicreate.com
734-480-9961


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP Editors

2002-04-30 Thread Liam Gibbs

Does anybody know of any PHP project editors,
something that will group together all the PHP, INC,
HTML, CSS files together into one logical project?
Preferrably freeware/shareware, obviously.

__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] parse error

2002-04-30 Thread Steve Cayford

Looks like your problem is on line 24. See below.

-Steve

On Tuesday, April 30, 2002, at 12:48  PM, Jule wrote:

 Hey guys, i'm writing this guestbook script for my site, and i'm 
 getting a
 random parse error where i think everything is normal, it gives it on 
 line 26
 which is

 echo Your entry will be posted!;

 my script follows

 Jule

 --SCRIPT--

 ?php
   $Guestbook[dateadd] = date(F j, Y H:i:s);
   $Guestbook[name] = trim($Guestbook[name]);
   $Guestbook[town] = trim($Guestbook[town]);
   $Guestbook[email] = trim($Guestbook[email]);
   $Guestbook[website] = trim($Guestbook[website]);
   $Guestbook[favsong] = trim($Guestbook[favsong]);
   $Guestbook[comments] = trim($Guestbook[comments]);
   $Guestbook[mailinglist] = trim($Guestbook[mailinglist]);

   $Host = localhost;
   $User = ;
   $Password = *;
   $DBName = blindtheory;
   $TableName = guestbook;
   $TableName2 = mailinglist;
   $Pattern = .+@.+..+;
   $Pattern2 = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);

   $Link = mysql_connect ($Host, $User, $Password);
   $Query = INSERT into $TableName values('0', '$Guestbook[dateadd]',
 '$Guestbook[name]', '$Guestbook[town]', '$Guestbook[email]',
 '$Guestbook[website]','$Guestbook[favsong]', '$Guestbook[comments]');
   $Link2 = mysql_connect ($Host, $User, $Password);
   $Query2 = INSERT into $TableName2 values('0', '$Guestbook[dateadd]',
 '$Guestbook[name]', '$Guestbook[email]');

You're missing a final double quote here ^.


   if (mysql_db_query ($DBName, $Query, $Link)) {
   echo Your entry will be added;
   } else {
   echo There was an error in during the posting, please contact 
a
 href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the
 problem.br;
   }
   
   if (isset($Guestbook[mailinglist])) {

   if (mysql_db_query ($DBName, $Query2, $Link2)) {
   echo Your e-mail address was sucessfully added to 
 our mailinglist;
   } else {
   echo There was an error in during the posting, please 
contact a
 href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the
 problem.br;
   }
   }
   mysql_close ($Link);
   mysql_close ($Link2);
 ?
 --
 Jule Slootbeek
 [EMAIL PROTECTED]
 http://blindtheory.cjb.net

 --
 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




Re: [PHP] parse error

2002-04-30 Thread Jule

Thanks for that, yeah i should be more carefull before going to the list..
i'll watch out for it next time.

Jule

On Tuesday 30 April 2002 13:54, Miguel Cruz wrote:
 You're missing a closing quote on the assignment for $Query2.

 Come on people, keep your eyes open. This is basic stuff. Doesn't take
 any special genius to count quotes and braces.

 miguel

 On Tue, 30 Apr 2002, Jule wrote:
  Hey guys, i'm writing this guestbook script for my site, and i'm getting
  a random parse error where i think everything is normal, it gives it on
  line 26 which is
 
  echo Your entry will be posted!;
 
  my script follows
 
  Jule
 
  --SCRIPT--
 
  ?php
  $Guestbook[dateadd] = date(F j, Y H:i:s);
  $Guestbook[name] = trim($Guestbook[name]);
  $Guestbook[town] = trim($Guestbook[town]);
  $Guestbook[email] = trim($Guestbook[email]);
  $Guestbook[website] = trim($Guestbook[website]);
  $Guestbook[favsong] = trim($Guestbook[favsong]);
  $Guestbook[comments] = trim($Guestbook[comments]);
  $Guestbook[mailinglist] = trim($Guestbook[mailinglist]);
 
  $Host = localhost;
  $User = ;
  $Password = *;
  $DBName = blindtheory;
  $TableName = guestbook;
  $TableName2 = mailinglist;
  $Pattern = .+@.+..+;
  $Pattern2 = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);
 
  $Link = mysql_connect ($Host, $User, $Password);
  $Query = INSERT into $TableName values('0', '$Guestbook[dateadd]',
  '$Guestbook[name]', '$Guestbook[town]', '$Guestbook[email]',
  '$Guestbook[website]','$Guestbook[favsong]', '$Guestbook[comments]');
  $Link2 = mysql_connect ($Host, $User, $Password);
  $Query2 = INSERT into $TableName2 values('0', '$Guestbook[dateadd]',
  '$Guestbook[name]', '$Guestbook[email]');
 
  if (mysql_db_query ($DBName, $Query, $Link)) {
  echo Your entry will be added;
  } else {
  echo There was an error in during the posting, please contact 
a
  href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the
  problem.br;
  }
 
  if (isset($Guestbook[mailinglist])) {
 
  if (mysql_db_query ($DBName, $Query2, $Link2)) {
  echo Your e-mail address was sucessfully added to our 
mailinglist;
  } else {
  echo There was an error in during the posting, please 
contact a
  href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the
  problem.br;
  }
  }
  mysql_close ($Link);
  mysql_close ($Link2);
  ?

-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Hex2Bin??

2002-04-30 Thread Joshua E Minnie

I know that there is a built-in function for bin2hex(), but does any body
know have any code to do just the opposite, convert hex2bin?

--
Joshua E Minnie/CIO
[EMAIL PROTECTED]
Phone: 616.276.9690
Fax: 616.342.8750
Nextel: 616.862.2847

Don't work for recognition, but always do work worthy of recognition.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Hex2Bin??

2002-04-30 Thread Miguel Cruz

On Tue, 30 Apr 2002, Joshua E Minnie wrote:
 I know that there is a built-in function for bin2hex(), but does any body
 know have any code to do just the opposite, convert hex2bin?

Check the first comment in the manual under bin2hex.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong

On Tuesday 30 April 2002 21:09, John Fishworld wrote:
 Duh ! lol sorry !

 img src=/db/imodeklein/edgar-IMODE-1-.gif vspace=2br#59091;nbsp;a
 href=imode.fpl?op=imodecardprefix=IMODEnummer=1suffx=uid=55%2eFAGAEpa


Unfortunately, no. Could you post say 20 lines of this file you're
talking about.
 
  I mean the file that you're readingparsing, not your program.

Try this:

  preg_match_all(/src=(\'[a-z0-9_\/-]+\.gif\')/i, $input, $MATCH);
  print_r($MATCH);

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Money is its own reward.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Hex2Bin??

2002-04-30 Thread Joshua E Minnie

Although the first comment was not what I needed, I did find another
built-in function that converts between any base, base_convert($number,
$frombase, $tobase) worked wonderful for what I needed.

Josh

Miguel Cruz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Tue, 30 Apr 2002, Joshua E Minnie wrote:
  I know that there is a built-in function for bin2hex(), but does any
body
  know have any code to do just the opposite, convert hex2bin?

 Check the first comment in the manual under bin2hex.

 miguel




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] parse error

2002-04-30 Thread Richard Emery

When constructing $Query, end each line with a period (.) not a comma(,).
Same applies to $Query2.

$Query = INSERT into $TableName values('0', '$Guestbook[dateadd]'.
'$Guestbook[name]', '$Guestbook[town]', '$Guestbook[email]'.
'$Guestbook[website]','$Guestbook[favsong]', '$Guestbook[comments]');
$Query2 = INSERT into $TableName2 values('0', '$Guestbook[dateadd]'.
'$Guestbook[name]', '$Guestbook[email]');


- Original Message -
From: Jule [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 12:48 PM
Subject: [PHP] parse error


Hey guys, i'm writing this guestbook script for my site, and i'm getting a
random parse error where i think everything is normal, it gives it on line
26
which is

echo Your entry will be posted!;

my script follows

Jule

--SCRIPT--

?php
$Guestbook[dateadd] = date(F j, Y H:i:s);
$Guestbook[name] = trim($Guestbook[name]);
$Guestbook[town] = trim($Guestbook[town]);
$Guestbook[email] = trim($Guestbook[email]);
$Guestbook[website] = trim($Guestbook[website]);
$Guestbook[favsong] = trim($Guestbook[favsong]);
$Guestbook[comments] = trim($Guestbook[comments]);
$Guestbook[mailinglist] = trim($Guestbook[mailinglist]);

$Host = localhost;
$User = ;
$Password = *;
$DBName = blindtheory;
$TableName = guestbook;
$TableName2 = mailinglist;
$Pattern = .+@.+..+;
$Pattern2 = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);

$Link = mysql_connect ($Host, $User, $Password);
$Query = INSERT into $TableName values('0', '$Guestbook[dateadd]',
'$Guestbook[name]', '$Guestbook[town]', '$Guestbook[email]',
'$Guestbook[website]','$Guestbook[favsong]', '$Guestbook[comments]');
$Link2 = mysql_connect ($Host, $User, $Password);
$Query2 = INSERT into $TableName2 values('0', '$Guestbook[dateadd]',
'$Guestbook[name]', '$Guestbook[email]');

if (mysql_db_query ($DBName, $Query, $Link)) {
echo Your entry will be added;
} else {
echo There was an error in during the posting, please contact a
href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the
problem.br;
}

if (isset($Guestbook[mailinglist])) {

if (mysql_db_query ($DBName, $Query2, $Link2)) {
echo Your e-mail address was sucessfully added to our mailinglist;
} else {
echo There was an error in during the posting, please contact a
href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the
problem.br;
}
}
mysql_close ($Link);
mysql_close ($Link2);
?
--
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

--
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




Re: [PHP] parse error

2002-04-30 Thread Miguel Cruz

The commas were inside the string enclosed by . If changed to periods, 
that would create a SQL error.

miguel

On Tue, 30 Apr 2002, Richard Emery wrote:
 When constructing $Query, end each line with a period (.) not a comma(,).
 Same applies to $Query2.
 
 $Query = INSERT into $TableName values('0', '$Guestbook[dateadd]'.
 '$Guestbook[name]', '$Guestbook[town]', '$Guestbook[email]'.
 '$Guestbook[website]','$Guestbook[favsong]', '$Guestbook[comments]');
 $Query2 = INSERT into $TableName2 values('0', '$Guestbook[dateadd]'.
 '$Guestbook[name]', '$Guestbook[email]');
 
 
 - Original Message -
 From: Jule [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, April 30, 2002 12:48 PM
 Subject: [PHP] parse error
 
 
 Hey guys, i'm writing this guestbook script for my site, and i'm getting a
 random parse error where i think everything is normal, it gives it on line
 26
 which is
 
 echo Your entry will be posted!;
 
 my script follows
 
 Jule
 
 --SCRIPT--
 
 ?php
 $Guestbook[dateadd] = date(F j, Y H:i:s);
 $Guestbook[name] = trim($Guestbook[name]);
 $Guestbook[town] = trim($Guestbook[town]);
 $Guestbook[email] = trim($Guestbook[email]);
 $Guestbook[website] = trim($Guestbook[website]);
 $Guestbook[favsong] = trim($Guestbook[favsong]);
 $Guestbook[comments] = trim($Guestbook[comments]);
 $Guestbook[mailinglist] = trim($Guestbook[mailinglist]);
 
 $Host = localhost;
 $User = ;
 $Password = *;
 $DBName = blindtheory;
 $TableName = guestbook;
 $TableName2 = mailinglist;
 $Pattern = .+@.+..+;
 $Pattern2 = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);
 
 $Link = mysql_connect ($Host, $User, $Password);
 $Query = INSERT into $TableName values('0', '$Guestbook[dateadd]',
 '$Guestbook[name]', '$Guestbook[town]', '$Guestbook[email]',
 '$Guestbook[website]','$Guestbook[favsong]', '$Guestbook[comments]');
 $Link2 = mysql_connect ($Host, $User, $Password);
 $Query2 = INSERT into $TableName2 values('0', '$Guestbook[dateadd]',
 '$Guestbook[name]', '$Guestbook[email]');
 
 if (mysql_db_query ($DBName, $Query, $Link)) {
 echo Your entry will be added;
 } else {
 echo There was an error in during the posting, please contact a
 href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the
 problem.br;
 }
 
 if (isset($Guestbook[mailinglist])) {
 
 if (mysql_db_query ($DBName, $Query2, $Link2)) {
 echo Your e-mail address was sucessfully added to our mailinglist;
 } else {
 echo There was an error in during the posting, please contact a
 href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the
 problem.br;
 }
 }
 mysql_close ($Link);
 mysql_close ($Link2);
 ?
 --
 Jule Slootbeek
 [EMAIL PROTECTED]
 http://blindtheory.cjb.net
 
 --
 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




Re: [PHP] PHP Editors

2002-04-30 Thread r

Hey,
I use MacroMedia's ultra dev for my JSP/ASP pages but i know it supports
PHP.
The only problem i see is that it sure as hell aint free, you can use it for
the first 30 days of course...
after than i've heard that SOME people crack it and use it illegallybut
i dont know much about that..;-)
Cheers,
-Ryan

- Original Message -
From: Liam Gibbs [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 11:11 AM
Subject: [PHP] PHP Editors


 Does anybody know of any PHP project editors,
 something that will group together all the PHP, INC,
 HTML, CSS files together into one logical project?
 Preferrably freeware/shareware, obviously.

 __
 Do You Yahoo!?
 Yahoo! Health - your guide to health and wellness
 http://health.yahoo.com

 --
 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




  1   2   >