php-general Digest 24 Apr 2001 22:13:44 -0000 Issue 647

Topics (messages 50041 through 50200):

how to install Win2K over Linux machine
        50041 by: howe
        50042 by: Dominick Vansevenant

Re: Fatal Errors and Error Handling
        50043 by: Geir Eivind Mork
        50054 by: Christian Reiniger
        50055 by: Svein Roar Nilsen
        50057 by: Boget, Chris
        50078 by: Christian Reiniger
        50093 by: Boget, Chris
        50098 by: Christian Reiniger
        50103 by: Boget, Chris
        50113 by: Christian Reiniger

Countdown in PHP
        50044 by: george
        50047 by: george
        50120 by: Phillip Bow

Anyone got the new Postgres 7.1 .rpms working?
        50045 by: Geoff Caplan
        50085 by: Meir Kriheli - MKsoft

PHP accessing the COM port?
        50046 by: sean.networkdata.co.uk
        50053 by: sean.networkdata.co.uk
        50064 by: Scott Fletcher
        50065 by: elias
        50145 by: sean.networkdata.co.uk

Vote results without refreshing the whole site!
        50048 by: Mohamedou

Re: PHP 4.0.5
        50049 by: Martín Marqués
        50067 by: The Doctor
        50075 by: Martín Marqués
        50082 by: The Doctor
        50111 by: Henrik Hansen

Re: Posting to a form
        50050 by: Adrian D'Costa
        50062 by: Matthew Luchak

Re: How to turn off warnings ???
        50051 by: Christian Reiniger

Re: Why is it dangerous to have register_globals on?
        50052 by: Euan Greig

Re: How to find the object name in a class?
        50056 by: Boget, Chris

Error Handling
        50058 by: Boget, Chris

The page cannot be displayed
        50059 by: Marcelo Pereira

Functions.
        50060 by: Anders Clerwall
        50117 by: Matt McClanahan

Re: Site Structure
        50061 by: Matthew M. Boulter
        50100 by: John Huggins

PHP "pl" vs. ususal version.
        50063 by: Scott Fletcher
        50069 by: Michael Kimsal

Re: Is there such an array like $array[][]?
        50066 by: Robert V. Zwink
        50086 by: Robert V. Zwink

How do I unsubscribe from this list
        50068 by: Walgamotte, David
        50070 by: Jon Haworth

Re: PHP script and new window.
        50071 by: Angerer, Chad
        50079 by: Nikhil Goyal

Re: Want to send email in html format
        50072 by: Charlie Llewellin
        50140 by: Romeo Manzur
        50172 by: Henrik Hansen

About sessions !!
        50073 by: Hassan Arteaga
        50077 by: Yasuo Ohgaki
        50080 by: Nicolas Guilhot
        50084 by: Hassan Arteaga
        50091 by: Hassan Arteaga
        50169 by: Meir Kriheli - MKsoft

Re: what is better? mysql_connect() or mysql_pconnect()?
        50074 by: Nikhil Goyal
        50125 by: Plutarck

FTP problem..
        50076 by: Chad Day
        50124 by: J. Jones

Re: Using <input type = 'button> rather than <input type =  'submit'>
        50081 by: Nikhil Goyal

Netscape Enterprise Server + PHP ?= possible
        50083 by: Daniel
        50088 by: Jon Haworth

no fetch
        50087 by: Wilbert Enserink

db to xls
        50089 by: Rahul Bhide
        50097 by: Calin Rotaru
        50101 by: Rahul Bhide
        50104 by: Andreas Landmark
        50105 by: Alok K. Dhir
        50106 by: Boget, Chris
        50115 by: Andrew Hill

create bar chart
        50090 by: Ali
        50092 by: Rahul Bhide
        50095 by: Ali
        50114 by: Data Driven Design
        50118 by: Grimes, Dean

Image Processing in PHP
        50094 by: Michael O'Neal
        50102 by: Joseph Bannon
        50116 by: Joseph Bannon

Re: About sessions !! (fwd)
        50096 by: johndmiller

including html pages inside an interface
        50099 by: Romulo Roberto Pereira
        50126 by: Romulo Roberto Pereira

newbie help with wildcard question
        50107 by: Publications

PATH_INFO and trans-sid
        50108 by: Chris Lee

Precedence question- cookie value over form value?
        50109 by: Dexter
        50110 by: Johnson, Kirk

Parse Error for a weirdo!
        50112 by: ouarz.net

Mail function
        50119 by: Krupiñski Marcin
        50176 by: Henrik Hansen

Newbie question about Classes
        50121 by: SED
        50127 by: Phillip Bow
        50129 by: Plutarck
        50160 by: Chris Anderson
        50168 by: Phillip Bow

Re: delete browser-cache
        50122 by: Plutarck

DOCUMENT_ROOT
        50123 by: Jordan Elver

Re: Want a Good Book for Ref on PHP
        50128 by: Chris Worth

insert into
        50130 by: shawn
        50134 by: Sterling
        50135 by: Johannes Janson
        50138 by: Philip Olson
        50142 by: Sterling

Hosting Service
        50131 by: Eugene Yi (InfoSpace Inc)

"reffered from" environmental variable?
        50132 by: Tom Beidler
        50153 by: CC Zona

PATH_INFO and trans-sid and output buffering doesnt work...
        50133 by: Chris Lee

Re: Looping through variables
        50136 by: Ashley M. Kirchner

A simple problem!
        50137 by: Subodh Gupta
        50139 by: Johnson, Kirk
        50141 by: Chris Lee
        50144 by: J. Jones

link variables space problem in netscape
        50143 by: Mark Lo
        50146 by: John Huggins
        50147 by: Brian S. Dunworth
        50148 by: Dan Lowe
        50149 by: Richard Crawford
        50150 by: Boget, Chris

Re: [PEAR] PEAR/DB: Random row from result set
        50151 by: Sebastian Bergmann

Autoupdate of page
        50152 by: Martin Skjöldebrand
        50159 by: Chris Anderson

Lines
        50154 by: Rafael Faria
        50155 by: Michael Stearne
        50156 by: Rafael Faria
        50157 by: Boget, Chris
        50158 by: Chris Anderson

checking if e-mail address and syntax are valid
        50161 by: Carlos Fernando Scheidecker Antunes
        50163 by: Martin Skjöldebrand
        50165 by: christopher hamilton
        50184 by: Sterling
        50186 by: Szii

OK, a little more specific migration issues.
        50162 by: S.J. Black
        50164 by: Chris Anderson
        50180 by: Henrik Hansen

getting rows from separate tables stacked in a single array ? (newbie, mysql)
        50166 by: Nicolas Mermet

checking url
        50167 by: Dmitry

Re: checkbox validation
        50170 by: Keyur Kalaria

.inc location security
        50171 by: Jason Dulberg
        50173 by: Rasmus Lerdorf

File Transfer over HTTPS
        50174 by: Michael Conley
        50175 by: Rasmus Lerdorf
        50189 by: Michael Conley
        50191 by: Rasmus Lerdorf
        50200 by: Michael Conley

Newline in a guestbook
        50177 by: Jimmy Bäckström
        50193 by: Henrik Hansen

Escaping Characters - URL Encoding.
        50178 by: Sterling
        50185 by: Alexander Wagner
        50187 by: Rasmus Lerdorf
        50190 by: Sterling

problem with storing & displaying image in db
        50179 by: Keyur Kalaria
        50196 by: Keyur Kalaria

Very important.
        50181 by: Padraic Tynan

include file by .htaccess
        50182 by: Keyur Kalaria
        50188 by: Keyur Kalaria
        50192 by: Rasmus Lerdorf

IRC CHAT
        50183 by: Rafael Faria
        50194 by: Henrik Hansen

getting values from apache_lookup_uri()
        50195 by: windeath
        50197 by: Rasmus Lerdorf

Globalness of variables? Functions & subs
        50198 by: Dexter
        50199 by: Rasmus Lerdorf

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------


Hello,
  Does anyone know how to uninstall linux completlt, coz i deleted the linux
partition the OS still remain Linux...then HANG after that....






First, this is not the list for this question !!

Try booting with a dos bootdisk and enter fdisk /mbr first before installing
w2k.

D.

-----Original Message-----
From: howe [mailto:[EMAIL PROTECTED]]
Sent: dinsdag 24 april 2001 12:23
To: [EMAIL PROTECTED]
Subject: [PHP] how to install Win2K over Linux machine


Hello,
  Does anyone know how to uninstall linux completlt, coz i deleted the linux
partition the OS still remain Linux...then HANG after that....



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






>  > http://www.php.net/manual/en/features.error-handling.php
>  > have you taken a deeper look into this?
>  Well, I have tried...

And what kind of problem did you encounter? 

>  My problem is that not displaying anything in case of an error is a
>  completely unacceptable solution. I *MUST* return a valid XML message in
>  a predefined format. If not, I am violating the standard we are

but that, as far as I've understand your case, isn't a problem. 

-- 
 php developer / CoreTrek AS        | Recent investments will yield a slight
 Sandnes / Rogaland / Norway        | profit. 
 web: http://www.moijk.net/         | 




On Tuesday 24 April 2001 12:14, Svein Roar Nilsen wrote:

> > beside, use @ in front of the command to pipe away the current error
> > or stop on-screen display of errors in general.
>
> My problem is that not displaying anything in case of an error is a
> completely unacceptable solution. I *MUST* return a valid XML message
> in a predefined format. If not, I am violating the standard we are

if (@foo_bar (42, 4711) == ERROR_CODE) {
   PrintXMLErrorMessage ();
}
else {
   GoOnProcessing ();
}

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

...10001000110101011010101101011110111010113...????




Geir Eivind Mork wrote:
> >  > http://www.php.net/manual/en/features.error-handling.php
> >  > have you taken a deeper look into this?
> >  Well, I have tried...
 
> And what kind of problem did you encounter?

The problem is that PHP generates fatal errors too often, and I have not
been able to find a way of trapping them. It also means that I am not
able to generate an error-message of the requiered form, e.g. something
like

<?xml version="1.0" encoding="UTF-8" ?>
<my_reply>
  <my_error>
    Internal server error
  </my_error>
</my_reply>

What I do not need, is something like

<br><b>Fatal error</b>:  XML parser error 7:
mismatched tag in <b>/var/www/[...]

And returning nothing would be even worse. 

The messages are meant to be machine-readable, meaning we must comply
with the standards.

> but that, as far as I've understand your case, isn't a problem.

Yes, it is. Because many functions generate fatal errors instead of
simply returning false or generating a warning. I have tried using the
set_error_handler(), but it only traps warnings and notices. It is
possible that I am doing something wrong, so if you can give me a short
working example, I should be really grateful! 


Svein Roar




> > My problem is that not displaying anything in case of an error is a
> > completely unacceptable solution. I *MUST* return a valid 
> > XML message in a predefined format. If not, I am violating the 
> standard we are
> if (@foo_bar (42, 4711) == ERROR_CODE) {
>    PrintXMLErrorMessage ();

I do not believe the above will work.  When using the "@" symbol
in front of an expression, it makes it so that the error code that is
returned is "0".  While writing my error handler class, in the 
function that processes whatever error is triggered, I check to see
if the error code is "0" and if it is, I do nothing because there was
an "@" symbol prepended to the expression.
You can read more about this in the error handling section of the
documentation.

Chris




On Tuesday 24 April 2001 14:47, Boget, Chris wrote:
> > > My problem is that not displaying anything in case of an error is a
> > > completely unacceptable solution. I *MUST* return a valid
> > > XML message in a predefined format. If not, I am violating the
> >
> > standard we are
> > if (@foo_bar (42, 4711) == ERROR_CODE) {
> >    PrintXMLErrorMessage ();
>
> I do not believe the above will work.  When using the "@" symbol
> in front of an expression, it makes it so that the error code that is
> returned is "0".  While writing my error handler class, in the

Wrong. From http://php.net/manual/en/language.operators.errorcontrol.php :
------
PHP supports one error control operator: the at sign (@). When prepended 
to an expression in PHP, any error messages that might be generated by 
that expression will be ignored.
------

The @ operator suppresses any error *message*, but leaves the return 
value intact. 
Just imagine that with your interpretation in the following snippet
$conn = @mysql_connect(...)
$conn would always be set to 0...

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

I sat laughing snidely into my notebook until they showed me a PC running
Linux. And oh! It was as though the heavens opened and God handed down a
client-side OS so beautiful, so graceful, and so elegant that a million
Microsoft developers couldn't have invented it even if they had a hundred
years and a thousand crates of Jolt cola.

- LAN Times




> > > standard we are
> > > if (@foo_bar (42, 4711) == ERROR_CODE) {
> > >    PrintXMLErrorMessage ();
> > I do not believe the above will work.  When using the "@" symbol
> > in front of an expression, it makes it so that the error 
> > code that is returned is "0".  While writing my error handler class, 
> > in the
> Wrong. From 
> http://php.net/manual/en/language.operators.errorcontrol.php :
> ------
> PHP supports one error control operator: the at sign (@). When prepended 
> to an expression in PHP, any error messages that might be generated by 
> that expression will be ignored.
> ------
> The @ operator suppresses any error *message*, but leaves the return 
> value intact. Just imagine that with your interpretation in the following 
> snippet
> $conn = @mysql_connect(...)
> $conn would always be set to 0...

Wrong back.  From:
http://php.net/manual/en/function.set-error-handler.php

----
It is important to remember that the standard PHP error handler is 
completely bypassed. error_reporting() settings will have no effect 
and your error handler will be called regardless - however you are 
still able to read the current value of error_reporting() and act
appropriately. Of particular note is that this value will be 0 if the 
statement that caused the error was prepended by the @ error-control
operator. 
----

Using your example, $conn wouldn't be '0' but if any error that is
generated by mysql_connect, that error code/number (what you are
going to be looking for) will be '0'.  So if, in the original function
f00_bar(), it tried to return any error code/number, that code/number
would be '0' (zero) by nature of having the "@" operator prepended
to the function call.
You don't have to believe me.  Set up your own error handler and
see for yourself what error number you get when the "@" symbol
is prepended to an expression.

Chris




On Tuesday 24 April 2001 16:48, Boget, Chris wrote:
> > > > standard we are
> > > > if (@foo_bar (42, 4711) == ERROR_CODE) {
> > > >    PrintXMLErrorMessage ();

> Wrong back.  From:
> http://php.net/manual/en/function.set-error-handler.php
>
> ----
> It is important to remember that the standard PHP error handler is
> completely bypassed. error_reporting() settings will have no effect
> and your error handler will be called regardless - however you are
> still able to read the current value of error_reporting() and act
> appropriately. Of particular note is that this value will be 0 if the
> statement that caused the error was prepended by the @ error-control
> operator.
> ----
>
> Using your example, $conn wouldn't be '0' but if any error that is
> generated by mysql_connect, that error code/number (what you are
> going to be looking for) will be '0'.  So if, in the original function
> f00_bar(), it tried to return any error code/number, that code/number
> would be '0' (zero) by nature of having the "@" operator prepended
> to the function call.

Well, we both are right. The snippet I suggested (top of this mail) 
*will* work, because the @ operator doesn't mess with the return value of 
the function. A custom error handling function installed via 
set_error_handler() will *not* work because it won't get the error code.

But I never suggested using set_error_handler() :)

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

I sat laughing snidely into my notebook until they showed me a PC running
Linux. And oh! It was as though the heavens opened and God handed down a
client-side OS so beautiful, so graceful, and so elegant that a million
Microsoft developers couldn't have invented it even if they had a hundred
years and a thousand crates of Jolt cola.

- LAN Times




> > > > > if (@foo_bar (42, 4711) == ERROR_CODE) {
> > > > >    PrintXMLErrorMessage ();


> Well, we both are right. The snippet I suggested (top of this mail) 
> *will* work, because the @ operator doesn't mess with the return 
> value of  the function. 

That is correct.  However, the "== ERROR_CODE" suggests that
an error code will be returned by foo_bar().  However, that code
will be suppressed by the "@" symbol and that is what I was commenting
on... the fact that the above example couldn't be used if you wanted
to print your own error messsage.

> A custom error handling function installed via set_error_handler() 
> will *not* work because it won't get the error code.

Well, it will work and it will still be called.  However, the error code
passed to it will be '0'.

> But I never suggested using set_error_handler() :)

But the issue at hand was the fact that the original poster
was using, and needed to use, set_error_handler to handle
their own errors.

Chris




On Tuesday 24 April 2001 17:14, Boget, Chris wrote:
> > > > > > if (@foo_bar (42, 4711) == ERROR_CODE) {
> > > > > >    PrintXMLErrorMessage ();
> >
> > Well, we both are right. The snippet I suggested (top of this mail)
> > *will* work, because the @ operator doesn't mess with the return
> > value of  the function.
>
> That is correct.  However, the "== ERROR_CODE" suggests that
> an error code will be returned by foo_bar().  However, that code
> will be suppressed by the "@" symbol and that is what I was commenting
> on... the fact that the above example couldn't be used if you wanted
> to print your own error messsage.

Functions return some value. Depending on the function, some ranges of 
returned values are interpreted as error code (e.g. 0 for mysql_connect). 
That is *not* in any way suppressed by @.

> > But I never suggested using set_error_handler() :)
>
> But the issue at hand was the fact that the original poster
> was using, and needed to use, set_error_handler to handle
> their own errors.

Well, "needed to use" might be incorrect, because return value evaluation 
can be used instead (unless some functions never signal errors via their 
return value). Aside from that you're right.

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

I sat laughing snidely into my notebook until they showed me a PC running
Linux. And oh! It was as though the heavens opened and God handed down a
client-side OS so beautiful, so graceful, and so elegant that a million
Microsoft developers couldn't have invented it even if they had a hundred
years and a thousand crates of Jolt cola.

- LAN Times




  i need to use PHP to countdown to a certain date, and display the 
output as 
  time left:days, hours, minutes, seconds
   The countdown coule be done with javascript, but however it must be 
done client side


 TIA
-- 
george
chiefmonkey@<my_pants>wisemonkeydesign.co.uk
remove my_pants to reply....
44 (0)1698 712537
44 (0)1698 712657





 I mean server side.
 What i thought icould do was use a cookie time() 
 but how do I extract the value and display it as day hour minute second 
format
 and also how do I change the value of the cookie to reflect the 
different times someone will log on.
 For instance by setting the cookie someone will have access for 3 hours 
but someone who enters the site an hour later will only have access for 
2.
 Any help would be great Ihave nearly finished this project and this is 
all that is hoiding me up, I am  starting to pull my hair out and the 
client is determined that it be done server side. 


-- 
george
chiefmonkey@<my_pants>wisemonkeydesign.co.uk
remove my_pants to reply....
44 (0)1698 712537
44 (0)1698 712657




Its easy enough to display a time and have it count down each time someone
views the page(get a timestamp and hardcode it in, then grab a current
timestamp when someone hits the page and compare the two), but if you want a
constant countdown updating constantly then it has to be client side.  The
only way around this would be to throw in a meta refresh tag set to refresh
every second.  This is not a viable option obviously, and technically it
would still be a client side alteration.  You said the countdown could be
done with Javascript which is a client side technology, and is what should
be used to do this.
--
phill

"george" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>  I mean server side.
>  What i thought icould do was use a cookie time()
>  but how do I extract the value and display it as day hour minute second
> format
>  and also how do I change the value of the cookie to reflect the
> different times someone will log on.
>  For instance by setting the cookie someone will have access for 3 hours
> but someone who enters the site an hour later will only have access for
> 2.
>  Any help would be great Ihave nearly finished this project and this is
> all that is hoiding me up, I am  starting to pull my hair out and the
> client is determined that it be done server side.
>
>
> --
> george
> chiefmonkey@<my_pants>wisemonkeydesign.co.uk
> remove my_pants to reply....
> 44 (0)1698 712537
> 44 (0)1698 712657
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Hi

I am trying to compile the latest version of PHP to work with the new
Postgres 7.1 on RedHat 6.2

I have installed the Postgres library, client and server .rpms without
any problems.

Then in the php file /ext/pgsql/php_pgsql.h I have changed the
#include from <postgres.h> to <postgres_fe.h> as recommended.

But my make is failing with the following error:

php_pgsql.h:32: postgres_fe.h: No such file or directory
php_pgsql.h:33: libpq-fe.h: No such file or directory
php_pgsql.h:39: libpq/libpq-fs.h: No such file or directory

So far as I can see, none of these files exist in my /usr tree.

Is this a bug with the rpm or am I doing something dumb? My linux
skills are basic so any help would be much appreciated

Geoff Caplan







----- Original Message ----- 
From: "Geoff Caplan" <[EMAIL PROTECTED]>
To: "PHP General List" <[EMAIL PROTECTED]>
Sent: Tuesday, April 24, 2001 12:33 PM
Subject: [PHP] Anyone got the new Postgres 7.1 .rpms working?


> Hi
> 
> I am trying to compile the latest version of PHP to work with the new
> Postgres 7.1 on RedHat 6.2
> 
> I have installed the Postgres library, client and server .rpms without
> any problems.
> 
> Then in the php file /ext/pgsql/php_pgsql.h I have changed the
> #include from <postgres.h> to <postgres_fe.h> as recommended.
> 
> But my make is failing with the following error:
> 
> php_pgsql.h:32: postgres_fe.h: No such file or directory
> php_pgsql.h:33: libpq-fe.h: No such file or directory
> php_pgsql.h:39: libpq/libpq-fs.h: No such file or directory
> 
> So far as I can see, none of these files exist in my /usr tree.
> 
> Is this a bug with the rpm or am I doing something dumb? My linux
> skills are basic so any help would be much appreciated
> 
> Geoff Caplan

I had the same problem, and solved it by creating a symlink name postgres.h
to fostgres-fe.h, and it is working great.

In ypur postgres include dir do:

ln -s postgres-fe.h postgres.h

Meir Kriheli
MKsoft computer systems

  'There's someone in my head but it's not me" - Pink Floyd





Hi,

I was wondering if anyone knew if I could acces the com port via PHP and
work with AT commands?

Someone has suggested something that MIGHT work - using fopen(com1... sorry
I dont know the correct syntax but as soon as I have managed to install php
I will give it a try.. in the meantime I would be grateful if you would let
me know if you think this will work..
many thanks

Sean






Hi all, me again.

I tried accessing the com port using fopen and was denied access... does
anyin have any other ideas?  I would really like to do this in php rather
than VB.

here is what I got...

Warning: fopen("COM1:","r+") - Permission denied in c:\web\test.php on line
6
Warning: Supplied argument is not a valid File-Handle resource in
c:\web\test.php on line 15


<[EMAIL PROTECTED]> wrote in message
9c3l86$lev$[EMAIL PROTECTED]">news:9c3l86$lev$[EMAIL PROTECTED]...
> Hi,
>
> I was wondering if anyone knew if I could acces the com port via PHP and
> work with AT commands?
>
> Someone has suggested something that MIGHT work - using fopen(com1...
sorry
> I dont know the correct syntax but as soon as I have managed to install
php
> I will give it a try.. in the meantime I would be grateful if you would
let
> me know if you think this will work..
> many thanks
>
> Sean
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






  You would need to set the file permission to the file itself, "COM1".
That would be the common errors.

Scott
<[EMAIL PROTECTED]> wrote in message
9c3q7s$lu3$[EMAIL PROTECTED]">news:9c3q7s$lu3$[EMAIL PROTECTED]...
> Hi all, me again.
>
> I tried accessing the com port using fopen and was denied access... does
> anyin have any other ideas?  I would really like to do this in php rather
> than VB.
>
> here is what I got...
>
> Warning: fopen("COM1:","r+") - Permission denied in c:\web\test.php on
line
> 6
> Warning: Supplied argument is not a valid File-Handle resource in
> c:\web\test.php on line 15
>
>
> <[EMAIL PROTECTED]> wrote in message
> 9c3l86$lev$[EMAIL PROTECTED]">news:9c3l86$lev$[EMAIL PROTECTED]...
> > Hi,
> >
> > I was wondering if anyone knew if I could acces the com port via PHP and
> > work with AT commands?
> >
> > Someone has suggested something that MIGHT work - using fopen(com1...
> sorry
> > I dont know the correct syntax but as soon as I have managed to install
> php
> > I will give it a try.. in the meantime I would be grateful if you would
> let
> > me know if you think this will work..
> > many thanks
> >
> > Sean
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






> Warning: fopen("COM1:","r+") - Permission denied in c:\web\test.php on
line
why 'COM1:' and not 'COM1' ?

-elias
http://eassoft.cjb.net


<[EMAIL PROTECTED]> wrote in message
9c3q7s$lu3$[EMAIL PROTECTED]">news:9c3q7s$lu3$[EMAIL PROTECTED]...
> Hi all, me again.
>
> I tried accessing the com port using fopen and was denied access... does
> anyin have any other ideas?  I would really like to do this in php rather
> than VB.
>
> here is what I got...
>
> Warning: fopen("COM1:","r+") - Permission denied in c:\web\test.php on
line
> 6
> Warning: Supplied argument is not a valid File-Handle resource in
> c:\web\test.php on line 15
>
>
> <[EMAIL PROTECTED]> wrote in message
> 9c3l86$lev$[EMAIL PROTECTED]">news:9c3l86$lev$[EMAIL PROTECTED]...
> > Hi,
> >
> > I was wondering if anyone knew if I could acces the com port via PHP and
> > work with AT commands?
> >
> > Someone has suggested something that MIGHT work - using fopen(com1...
> sorry
> > I dont know the correct syntax but as soon as I have managed to install
> php
> > I will give it a try.. in the meantime I would be grateful if you would
> let
> > me know if you think this will work..
> > many thanks
> >
> > Sean
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






please tell me how to set a file permission on com1 on windows98!

thanks,

sean


""Scott Fletcher"" <[EMAIL PROTECTED]> wrote in message
9c3urk$k0$[EMAIL PROTECTED]">news:9c3urk$k0$[EMAIL PROTECTED]...
>   You would need to set the file permission to the file itself, "COM1".
> That would be the common errors.
>
> Scott
> <[EMAIL PROTECTED]> wrote in message
> 9c3q7s$lu3$[EMAIL PROTECTED]">news:9c3q7s$lu3$[EMAIL PROTECTED]...
> > Hi all, me again.
> >
> > I tried accessing the com port using fopen and was denied access... does
> > anyin have any other ideas?  I would really like to do this in php
rather
> > than VB.
> >
> > here is what I got...
> >
> > Warning: fopen("COM1:","r+") - Permission denied in c:\web\test.php on
> line
> > 6
> > Warning: Supplied argument is not a valid File-Handle resource in
> > c:\web\test.php on line 15
> >
> >
> > <[EMAIL PROTECTED]> wrote in message
> > 9c3l86$lev$[EMAIL PROTECTED]">news:9c3l86$lev$[EMAIL PROTECTED]...
> > > Hi,
> > >
> > > I was wondering if anyone knew if I could acces the com port via PHP
and
> > > work with AT commands?
> > >
> > > Someone has suggested something that MIGHT work - using fopen(com1...
> > sorry
> > > I dont know the correct syntax but as soon as I have managed to
install
> > php
> > > I will give it a try.. in the meantime I would be grateful if you
would
> > let
> > > me know if you think this will work..
> > > many thanks
> > >
> > > Sean
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Dear all,

I have a survey script included in my site. After voting I need the results
but without refreshing the whole site just the script must load the new
results.
Every help will be apreciated

Yours

Moh


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com





On Mar 24 Abr 2001 01:33, Henrik Hansen wrote:
> Martín Marqués <[EMAIL PROTECTED]> wrote:
>  > On Lun 23 Abr 2001 22:13, Felix Kronlage wrote:
>  > > On Mon, Apr 23, 2001 at 03:00:07PM -0700, Dominique Paquin wrote:
>  > > > I asked when the new version of PHP was comming out at the beginning
>  > > > of the month and some one told me that it was comming out the week
>  > > > after. Haven't seen it yet, anyone knows the release date??
>  > >
>  > > RC7 got out a few days ago (Thursday I believe), and I think I recall
>  > > that unless lot's of things went wrong this is the last RC....
>  > >
>  > > -fkr
>  > >
>  > > ps. I guess, it's released once it works fine :)
>  >
>  > Why don't the publicate the RC's. I had a hard time getting RC5.
>
> they are freely avaialiable on the net for download. or you always
> have cvs :)

I have a CVS installed on one of my machines, but the RCX are not published 
on the web site. That's what I'm copmplaining about!!

Saludos... :-)

-- 
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-----------------------------------------------------------------
Martin Marques                  |        [EMAIL PROTECTED]
Programador, Administrador      |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------




On another front, will PHP 4.0.5 be compilable for a STATIC apache 2.0 Beta?




On Mar 24 Abr 2001 16:34, The Doctor wrote:
> On another front, will PHP 4.0.5 be compilable for a STATIC apache 2.0
> Beta?

As far as I know, yes! There is at configure time an option to use 
apache-2.0. Never used it.

saludos... :-)

-- 
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-----------------------------------------------------------------
Martin Marques                  |        [EMAIL PROTECTED]
Programador, Administrador      |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------




On Tue, Apr 24, 2001 at 11:01:27AM +0300, Martín Marqués wrote:
> On Mar 24 Abr 2001 16:34, The Doctor wrote:
> > On another front, will PHP 4.0.5 be compilable for a STATIC apache 2.0
> > Beta?
> 
> As far as I know, yes! There is at configure time an option to use 
> apache-2.0. Never used it.
> 
> saludos... :-)
>

For dynamic yes NOT for static. 




Martín Marqués <[EMAIL PROTECTED]> wrote:

 > I have a CVS installed on one of my machines, but the RCX are not published 
 > on the web site. That's what I'm copmplaining about!!

hmm I though they got a tag in the cvs resp, well it might be thats
only the releases that get a tag

-- 
Henrik Hansen





I had this problem when I saved the page as a .html rather than a .php

Adrian

On Mon, 23 Apr 2001, Wade wrote:

> I'm trying to do the following
> 
> <input type="text" tabindex=17 name="Aname" value=
> 
> <?
> echo strtoupper($Aname);
> ?>
> 
> But when Aname is multiple words, such as "Wade Williams", everything from
> the whitespace on gets cut off.
> 
> Any ideas how to fix this?
> 
> Thanks
> Wade
> 
> 
> 





you can't have whitespace in $vals....I would replace the whitespace
with _ and vice-versa when you want to ouput the $vals...

____________________________ 
Matthew Luchak 
Webmaster
Kaydara Inc. 
[EMAIL PROTECTED]




I'm trying to do the following

<input type="text" tabindex=17 name="Aname" value=

<?
echo strtoupper($Aname);
?>

But when Aname is multiple words, such as "Wade Williams", everything
from
the whitespace on gets cut off.






On Monday 23 April 2001 23:50, Roee Rubin wrote:
> Hello,
>
> I am a newbie to PHP and I am trying to get a number of scripts to
> work.
>
> Whenever I try to execute some code I receive 'warnings', that
> basically clutter up the screen. Since I am assuming that these are not
> fatal - is there  any way to turn them off?

Warnings are not fatal as such, but they often give hints that you have a 
bug somewhere. Correct your code.

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

...10001000110101011010101101011110111010113...????




Now I understand! I hadn't twigged to the danger of _internal_ variables
getting overwritten by bogus get/post variables.

Thanks to you all.

Euan

"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Actually it's not "dangerous" per se.
> >
> > However if can be very dangerous if you aren't being careful in your
code,
> > for instance, consider this.
> >
> > Let's say I've conditionally set $sql somewhere else in the code based
upon
> > certain conditions, which works fine. But let's say those conditions
aren't
> > met so $sql doesn't get set to anything since it's not really used. Now
> > consider this code:
> >
> > if ($sql)
> > {
> > $result = mysql_query($sql);
> > }
> >
> > Now that would be fine for all normal instances. But now what if someone
> > appends this onto the end of your url:
> >
> > ?query=
> >
> > ...plus something like "DROP databasename". It doesn't take too much
> > imagination to see what kind of things could happen if someone just had
a
> > little bit of knowledge about how your code works.
> >
> > Thus you have two options. One is of course to turn register_globals
off,
> > but ALWAYS ALWAYS _ALWAYS_ set a default for every variable you refer to
in
> > your script at some point before doing anything with it. So if you use
$sql
> > be 100% sure that it has been set $sql explicitly in your code before
doing
> > anything with it.
>
> Whether you turn register_globals off or not, you need to always watch
> cases like this.  I have seen many people say that register_globals is
> inherently insecure and then they turn it off and go through and use
> something like $HTTP_POST_VARS['sql'] everywhere they used to use $sql.
> This only makes it slightly more tedious to inject bogus variables into
> since the attacker now needs to make a trivial little form to inject stuff
> into the POST data instead of just sticking it onto the URL.
> Security-wise there is no difference whatsoever.
>
> Never never never trust user-supplied data implicitly.  Always check
> anything that could possibly come from the user.  For internal variables,
> always initialize them and just generally think things through as you
> write your scripts.  This is no different in PHP than in any other
> scripting language used for web work.
>
> -Rasmus
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






> *sigh* I'm thinking so too ;(
> Doh!
> However, I have at least a usable hack around.
> In the constructor of your class, add:
> function Class ($object_name) {
> global $pge;
> $pge = $object_name;
> }
> Then when you use create a new object of that type you must use:
> $objectname = new Class('objectname');

Heh.  This is exactly what I'm doing as it was the only work around
that I could find, too.

> Then in your code you just use ${$pge}-> to refer to it.

Yup.  However, before I do this, I check to make sure $pge is valid 
before I use it.  Otherwise, all kinds of nastiness can occur.

What I'm doing this for is my error reporting class.  I'm using a
wrapper function that calls my class' errorHandler() method since
you cannot specify a class method as the handler function.  Kind
of funky.  But doing this was the only way I could get around it.

> Sucks, doesn't it?

Yup.  But I'm sure there is a reason for it.  Kind of like whatever
the reason is that we cannot actually get a variable's name.

I.E.

$joe = "bob";

we cannot get that the above variable's name is "joe".
Oh, well.

Chris




Is there a good write up out there or can anyone offer
some insight to the rest of us as to how error handling
should be properly implemented?
Yes, PEAR has some error handling routines, but it
doesn't have any kind of information as to how it should
be "properly" implemented.  I've just finished writing a
pretty decent error handling class of my own but going
through my code, I see places where I can add the
trigger_error() function, but beyond that, I'm not sure
exactly how to process it all.
Up to now, I've just been doing some generic error
handling.  If a query fails, if a user enters the wrong 
value, I print out a message.  But now that I'm handling
all the errors, I'm finding that I'm getting so many more
messages from PHP than I was before.  For example, if
a variable wasn't "properly" initialized 

(ie, I'll get an error in this case:

$mode = "add";
if( $mode == "add" ) {
  $joe = "bob";

}

if( $joe ) {
  echo "You got here";

}

an error will be thrown by PHP saying that $joe is
uninitialized)

It's not as if that's a big deal.  It isn't.  But since I'm
getting more information than I need to actually give
the end user, it seems like kind of a daunting task to
start handling the errors myself.  It is something we
are going to need to do so I cannot put it off.  But I
am hoping that there is some sort of write up or tutorial
or something out there where I can learn from the
experience of others as to how something like this should
be done "properly".  I'd rather do something of this
magnitude right the first time.

As an aside,  in writing this class and seeing how PHP 
works in this regard, I've so much more respect for 
what PHP actually does behind the scenes with regards 
to error and syntax checking.  It was definitely a learning
experience.

Chris




Hi All,

I'm in troubles when I access Horde using win32 clients. This is a aplications built 
in PHP.
I can see (and fill) the form ``horde/imp/login.php'' but when it calls for 
``redirect.php'' (this file is at same folder that login.php) then I receive the 
famous ``this page cannot be displayed''.
I've read the php documentation but I dont think this is the problem......

Using unix clients the things goes very well...

What did I go wrong ??

See ya,

Marcelo Pereira
Unicamp - Brazil




Hi,
Is there a tutorial of some sort on how I add function sets to PHP4?
I've searched the net for more info about this other than what the PHP4.x
manual says, and I saw some reference to freshmeat, but I couldn't find
that.
Any help appreciated, thanks!
--
 /\ ASCII ribbon | Anders Clerwall * Product Development  Teligent Nordic AB
 \/   campaign   | P.O. Box 213, S-149 23 Nynäshamn, Sweden  *  http://pc131
 /\   against    | [EMAIL PROTECTED] * Mobile: +46 (0)70 749 56 57
/  \ HTML email. | "What's with the  'Intel  Inside'  warning label anyway?"








On Tue, Apr 24, 2001 at 03:06:40PM +0200, Anders Clerwall wrote:

> Hi,
> Is there a tutorial of some sort on how I add function sets to PHP4?
> I've searched the net for more info about this other than what the PHP4.x
> manual says, and I saw some reference to freshmeat, but I couldn't find
> that.
> Any help appreciated, thanks!

If you mean writing functions in PHP, that would be in the manual:

http://www.php.net/manual/en/functions.php

If you mean writing built-in functions (at the same level of
mysql_connect, array_reverse, etc) then you want

http://www.zend.com/zend/api.php

Or the README.SELF-CONTAINED-EXTENSIONS which is included in the PHP
source.

Matt





G'day all, I thought I'd mention how I developed my last project and got
around some of these problems, bear with me it can be quite complicated.
============================================================================
===
In the development we had to develop on many different servers, mine at
home, my partners at his place then two different ones at work. Here's the
site structure (Red Hat 7):

/var/www/api/           <-- all my code outside of the web tree
                 config/        <-- where all the API's config files go (*.cfg)
                 0.1/           <-- version 0.1 of my API
                     modules/   <-- all of my 0.1 version modules (*.lib)
                 0.2/           <-- version 0.2 of my API
                     modules/   <-- all of my 0.2 version modules (*.lib)
/var/www/html/v1/               <-- version 1 of the site (/html is Red Hat 7's name 
for
/htdocs)
/var/www/html/v2/               <-- version 2   "
---------------------------------------

[in PHP.INI]            include_path = .:/var/www/api/config:/var/www/api/modules

In each /HTML/?? directory there is a file -> api_connect.cfg

[in api_connect.cfg]    include 'api01.cfg'

This basically says use version 0.1 of the API for this website. This way as
I experiment and change my source code I can make an entire new version
branch of my source code (i.e., make /var/www/api/0.3/modules) and change
the 'api_connect.cfg' file to suit.

* How to access in a PHP and/or HTML-hybrid file?
  Easy! <?php include 'api_connect.cfg'; ?> at the top of your document.

--For-example--------------------------
My index file has a login form, therefore my index.html has the code
<?php include 'api_connect.cfg';
        // do other processing here, since that code sets up my API connection I
can use all my objects
        $dbase = new ApiDbaseConn(); //etc, etc, etc....
?>
<HTML>
<!-- blah, blah, blah -->
</HTML>

The include process would look like:                    --I--> Includes
/var/www/html/v1/index.html     --I-->
/var/www/html/v1/api_connect.cfg   --I-->   /var/www/api/config/api01.cfg
                                                                                       
         ^^^^^^^^^
** NOTE: This link takes advantage of the "/var/www/api/config" entry in the
PHP.INI include_path directive **

==Now=What??===What=does=API??.CFG=do?======================================
===
This is where the fun starts ;) Below is a *censored ;)* API04.CFG file:


[API04.CFG]
----------------------------------------------------------------------------
---
//--begin-file-guard--
$included_flag='__API_CONFIG_'.basename(__FILE__);
if(defined($included_flag)) {return true;} define($included_flag,TRUE);
//--end-file-guard---

/***************************************************************************
***/
/*==========================FRAMEWORK===CONSTANTS===========================
==*/
/***************************************************************************
***/
define('API_VERSION', '0.4');

//==[SITE-DETAILS]==========================================================
====
define('API_DEBUG_ON', 0);                                      // 0 - off; 1 - on
define('API_ERROR_ON', 0);                                      // 0 - off; 1 - on

$czServerName = 'vandyk';

switch ($czServerName)
{                       
        case 'vandyk':          define('SLASH', '/'); 
                                define('API_PATH', '/var/www/api'.SLASH);
                                        define('API_DBASE_PRIMARY','***CENSORED***');
                                        define('API_DBASE_SECONDARY','***CENSORED***');
                                        define('API_DBASE_DBASENAME','***CENSORED***');
                                        define('API_DBASE_PASSWORD','***CENSORED***'); 
         
                                        
define('API_DBASE_DBASENAME','***CENSORED***'); 
                                        $bIsUnix = TRUE;
                                        break;
        //---------------------------------------                                      
         
        case 'enki':            define('SLASH', '\\');                                 
         
                                        define('API_PATH', 'C:\apache\api'.SLASH);
                                        define('API_DBASE_PRIMARY','***CENSORED***');
                                        define('API_DBASE_SECONDARY','***CENSORED***');
                                        define('API_DBASE_DBASENAME','***CENSORED***');
                                        define('API_DBASE_PASSWORD','***CENSORED***'); 
         
                                        
define('API_DBASE_DBASENAME','***CENSORED***'); 
                                        $bIsUnix = FALSE;
                                        break;
        //---------------------------------------                                      
                                                         
        case 'fontaine':                // you get the idea
        //---------------------------------------                                      
         
        case 'morillo':         
// you get the idea
        //---------------------------------------
        case 'oakenfold':               // you get the idea
}


//==[LOCATIONS]=============================================================
====
define('API_CONFIG_PATH',                       API_PATH.'config'.SLASH);
define('API_LOGS_PATH',                         API_PATH.'logs'.SLASH);
define('API_LIB_PATH',                          
API_PATH.API_VERSION.SLASH.'modules'.SLASH);

//==[EXCEPTION-HANDLING]====================================================
====
include(API_LIB_PATH.'api_debug.lib');  // debugging


//==[LOGGING]===============================================================
====
include(API_LIB_PATH.'api_log_html.lib');

if ($bIsUnix) {
        if ( !isset($g_LOG) ) {
        $g_LOG = new ApiLogHtml('/tmp/api_debug.html','a+');
    }
} else {
        if ( !isset($g_LOG) ) {
        $g_LOG = new ApiLogHtml('c:/temp/api_debug.html',"a+");
    }
}

//==[COMPONENT-OBJECT-GROUP]================================================
====
include(API_LIB_PATH.'api_dbase.lib');
// I'll spare you the list of included modules

============================================================================
===
The key here is to note the following:

* At the very top of the config file I state what the Version of the API
this config is for. Therefore as you'll see in the definition of the
API_LIB_PATH ([LOCATIONS]) I concatenate the version number to the api path.

* Since we had so many servers this was solved with a switch statement and
settings the variable $czServerName

* In each server's section goes server-specific settings (dah, really?!)
Therefore to illustrate the portability of this I've left in the details for
two servers, vandyk (awesome DJ) and enki (Sumerian God of the Earth).
vandyk is Red Hat 7, enki is Win2K
        I set the direction of the /\ Slash (I later found out that doesn't matter,
you clever PHP developers you)
        I then set the all important API_PATH that establishes the initial base
root of the API files.
        Then everything else builds on the API_PATH constant by
.concatenating.it.with.other.things
The rest is self-explanatory.

============================================================================
===

This took alot (*cry tears of lost sleep - ahhhh stimulants ;)*) of
refining, but I like it and it worked well once it was inplace. Then all was
good.

Hope it provides someone out there some inspiration.

Happy Coding Guys!!

Matty.





This guy is proof that PHP programmers are a functional clever bunch and PHP
does not box us in with too many limits.

> -----Original Message-----
> From: Matthew M. Boulter [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 24, 2001 9:16 AM
> To: Steve Werby; Toby Miller; indrek siitan
> Cc: PHP General Mailing List
> Subject: RE: [PHP] Site Structure
>
>
>
> G'day all, I thought I'd mention how I developed my last project and got
> around some of these problems, bear with me it can be quite complicated.
> ==================================================================
> ==========
> ===
> In the development we had to develop on many different servers, mine at
> home, my partners at his place then two different ones at work. Here's the
> site structure (Red Hat 7):
>
> /var/www/api/         <-- all my code outside of the web tree
>                config/        <-- where all the API's config
> files go (*.cfg)
>                0.1/           <-- version 0.1 of my API
>                    modules/   <-- all of my 0.1 version modules (*.lib)
>                0.2/           <-- version 0.2 of my API
>                    modules/   <-- all of my 0.2 version modules (*.lib)
> /var/www/html/v1/             <-- version 1 of the site (/html is
> Red Hat 7's name for
> /htdocs)
> /var/www/html/v2/             <-- version 2   "
> ---------------------------------------
>
> [in PHP.INI]          include_path =
> .:/var/www/api/config:/var/www/api/modules
>
> In each /HTML/?? directory there is a file -> api_connect.cfg
>
> [in api_connect.cfg]  include 'api01.cfg'
>
> This basically says use version 0.1 of the API for this website.
> This way as
> I experiment and change my source code I can make an entire new version
> branch of my source code (i.e., make /var/www/api/0.3/modules) and change
> the 'api_connect.cfg' file to suit.
>
> * How to access in a PHP and/or HTML-hybrid file?
>   Easy! <?php include 'api_connect.cfg'; ?> at the top of your document.
>
> --For-example--------------------------
> My index file has a login form, therefore my index.html has the code
> <?php include 'api_connect.cfg';
>       // do other processing here, since that code sets up my API
> connection I
> can use all my objects
>       $dbase = new ApiDbaseConn(); //etc, etc, etc....
> ?>
> <HTML>
> <!-- blah, blah, blah -->
> </HTML>
>
> The include process would look like:                  --I--> Includes
> /var/www/html/v1/index.html   --I-->
> /var/www/html/v1/api_connect.cfg   --I-->   /var/www/api/config/api01.cfg
>
>                       ^^^^^^^^^
> ** NOTE: This link takes advantage of the "/var/www/api/config"
> entry in the
> PHP.INI include_path directive **
>
> ==Now=What??===What=does=API??.CFG=do?============================
> ==========
> ===
> This is where the fun starts ;) Below is a *censored ;)* API04.CFG file:
>
>
> [API04.CFG]
> ------------------------------------------------------------------
> ----------
> ---
> //--begin-file-guard--
> $included_flag='__API_CONFIG_'.basename(__FILE__);
> if(defined($included_flag)) {return true;} define($included_flag,TRUE);
> //--end-file-guard---
>
> /*****************************************************************
> **********
> ***/
> /*==========================FRAMEWORK===CONSTANTS=================
> ==========
> ==*/
> /*****************************************************************
> **********
> ***/
> define('API_VERSION', '0.4');
>
> //==[SITE-DETAILS]================================================
> ==========
> ====
> define('API_DEBUG_ON', 0);                                    //
> 0 - off; 1 - on
> define('API_ERROR_ON', 0);                                    //
> 0 - off; 1 - on
>
> $czServerName = 'vandyk';
>
> switch ($czServerName)
> {
>       case 'vandyk':          define('SLASH', '/');
>                               define('API_PATH', '/var/www/api'.SLASH);
>
> define('API_DBASE_PRIMARY','***CENSORED***');
>
> define('API_DBASE_SECONDARY','***CENSORED***');
>
> define('API_DBASE_DBASENAME','***CENSORED***');
>
> define('API_DBASE_PASSWORD','***CENSORED***');
>
> define('API_DBASE_DBASENAME','***CENSORED***');
>                                       $bIsUnix = TRUE;
>                                       break;
>       //---------------------------------------
>
>       case 'enki':            define('SLASH', '\\');
>
>                                       define('API_PATH',
> 'C:\apache\api'.SLASH);
>
> define('API_DBASE_PRIMARY','***CENSORED***');
>
> define('API_DBASE_SECONDARY','***CENSORED***');
>
> define('API_DBASE_DBASENAME','***CENSORED***');
>
> define('API_DBASE_PASSWORD','***CENSORED***');
>
> define('API_DBASE_DBASENAME','***CENSORED***');
>                                       $bIsUnix = FALSE;
>                                       break;
>       //---------------------------------------
>
>       case 'fontaine':                // you get the idea
>       //---------------------------------------
>
>       case 'morillo':
> // you get the idea
>       //---------------------------------------
>       case 'oakenfold':               // you get the idea
> }
>
>
> //==[LOCATIONS]===================================================
> ==========
> ====
> define('API_CONFIG_PATH',                     API_PATH.'config'.SLASH);
> define('API_LOGS_PATH',                       API_PATH.'logs'.SLASH);
> define('API_LIB_PATH',
> API_PATH.API_VERSION.SLASH.'modules'.SLASH);
>
> //==[EXCEPTION-HANDLING]==========================================
> ==========
> ====
> include(API_LIB_PATH.'api_debug.lib');        // debugging
>
>
> //==[LOGGING]=====================================================
> ==========
> ====
> include(API_LIB_PATH.'api_log_html.lib');
>
> if ($bIsUnix) {
>       if ( !isset($g_LOG) ) {
>         $g_LOG = new ApiLogHtml('/tmp/api_debug.html','a+');
>     }
> } else {
>       if ( !isset($g_LOG) ) {
>         $g_LOG = new ApiLogHtml('c:/temp/api_debug.html',"a+");
>     }
> }
>
> //==[COMPONENT-OBJECT-GROUP]======================================
> ==========
> ====
> include(API_LIB_PATH.'api_dbase.lib');
> // I'll spare you the list of included modules
>
> ==================================================================
> ==========
> ===
> The key here is to note the following:
>
> * At the very top of the config file I state what the Version of the API
> this config is for. Therefore as you'll see in the definition of the
> API_LIB_PATH ([LOCATIONS]) I concatenate the version number to
> the api path.
>
> * Since we had so many servers this was solved with a switch statement and
> settings the variable $czServerName
>
> * In each server's section goes server-specific settings (dah, really?!)
> Therefore to illustrate the portability of this I've left in the
> details for
> two servers, vandyk (awesome DJ) and enki (Sumerian God of the Earth).
> vandyk is Red Hat 7, enki is Win2K
>       I set the direction of the /\ Slash (I later found out that
> doesn't matter,
> you clever PHP developers you)
>       I then set the all important API_PATH that establishes the
> initial base
> root of the API files.
>       Then everything else builds on the API_PATH constant by
> .concatenating.it.with.other.things
> The rest is self-explanatory.
>
> ==================================================================
> ==========
> ===
>
> This took alot (*cry tears of lost sleep - ahhhh stimulants ;)*) of
> refining, but I like it and it worked well once it was inplace.
> Then all was
> good.
>
> Hope it provides someone out there some inspiration.
>
> Happy Coding Guys!!
>
> Matty.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





  I noticed when I install the PHP using hte version with "pl", like
PHP-4.0.4pl1, and compile Apache with this PHP.  Apache said it couldn't
compile the PHP and doesn't compile it.  I struggled with it for a few
hours.  Then I end up installing PHP-4.0.2 without the "pl" on it and
compile Apache and it work fine.

  What I had discover is that you can't install the PHP with the "pl"
without the version that doesn't have the "pl".  Is that true?   (To install
PHP version first before installing hte package level).

Scott








Scott Fletcher wrote:

>   I noticed when I install the PHP using hte version with "pl", like
> PHP-4.0.4pl1, and compile Apache with this PHP.  Apache said it couldn't
> compile the PHP and doesn't compile it.  I struggled with it for a few
> hours.  Then I end up installing PHP-4.0.2 without the "pl" on it and
> compile Apache and it work fine.
>
>   What I had discover is that you can't install the PHP with the "pl"
> without the version that doesn't have the "pl".  Is that true?   (To install
> PHP version first before installing hte package level).

No, that's not true.  I've seen fresh installs of PHP4.0.3pl1 which worked OK.






I have used the function usort() to sort multi-dimensional arrays before.
It might be a challenge to write the comparison function, but it is
possible.  I use 3-dim arrays all of the time.  Makes for a bit cleaner code
IMHO.

I suppose one thing to consider, is that if you have an enormous 3-dim
array, you are probably doing something wrong.  Generating a really big
array can be resource intense, and can slow you page down exponentially.
Select only parts of the recordset, or smaller chuck of the file for better
execution, but if your application requires a large 3-dim array, it works
just fine for me.

Robert Zwink

-----Original Message-----
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 8:06 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Is there such an array like $array[][]?


1. there are no multi-dimensional arrays in php, just single dimension
arrays each element of which may be an array (or any other variable type).
If you make every element of an array an array of size x, you will get what
can be used as a multi-dimensional array. But if you forget what it really
is, you'll run into problems like expecting to be able to sort
$array[$x][$y] by $y.
2. because of this you can have as many levels of an array as you want.

try :
$array[][][][] = "fred";
foreach($array as $level1)
        foreach($level1 as $level2)
                foreach($level2 as $level3)
                        foreach($level3 as $value)
                                echo($value);

        Tim Ward
        Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


> -----Original Message-----
> From: Plutarck [mailto:[EMAIL PROTECTED]]
> Sent: 17 April 2001 17:42
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Is there such an array like $array[][]?
>
>
> PHP can be a tad screwy with how it handles multi-dimensional
> arrays, but
> yes PHP handles them. No real speed problems with them either.
>
> But you may just want to use an associative array like:
>
> $loc = array("y" => $y, "x" => $x);
>
> Then just use $loc["y"] and $loc["x"].
>
> Just another option, but feel free to use multi-dimensional
> arrays. Just be
> aware that PHP supports only two dimensions (so $array[][][]
> will not work),
> and if you try and get fancy with sort() and count() you are
> going to give
> yourself a migraine.
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
> "Jack Dempsey" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > yes, that's a multi-dimensional array, which is fine in php (and
> > everything else i can think of =P)...
> >
> > -jack
> >
> > Scott Fletcher wrote:
> > >
> > > Hi!  I am wondering if there is such a php array that can
> take care of
> the x
> > > and y axis data.  I figure that using this array type,
> $axis[$x][$y]
> would
> > > do the trick.  Would it work?  If not, then education me
> on what would
> work!
> > > Thanks!
> > >
> > > Scott
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> >
>
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





I don't understand your different definitions:  "muti-dimensional" and
"array of arrays"

>From the manual:
Multi-Dimensional Arrays
Multi-dimensional arrays are actually pretty simple. For each dimension of
the array, you add another [key] value to the end:

> Tim Ward wrote:
> <snip>
> What looks like a 2d array is fact an array of arrays (and so
> on). If it's built right this can be treated as a multi-d array in many
> ways  ... but not all.

I wonder if you can help me understand this concept by giving an example of
what is possible with 1-dim arrays, but not with 3-dim arrays?

>From my point of view the only difference is writing a custom comparison
function when sorting, though this does seem logical considering the
additional complexity of multiple dimensions.

Thanks for your help.

Robert Zwink


-----Original Message-----
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 24, 2001 9:54 AM
To: 'Robert V. Zwink'
Subject: RE: [PHP] Is there such an array like $array[][]?


my point was that what appear to be multi-dimensional arrays in php are not
that at all. What looks like a 2d array is fact an array of arrays (and so
on). If it's built right this can be treated as a multi-d array in many ways
... but not all.

There seem to be a lot of queries from people confused about how to deal
with arrays of arrays and this often stems from a misconception that they
are actually multi-d arrays.

        Tim Ward
        Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


> -----Original Message-----
> From: Robert V. Zwink [mailto:[EMAIL PROTECTED]]
> Sent: 24 April 2001 14:33
> To: Tim Ward; [EMAIL PROTECTED]
> Subject: RE: [PHP] Is there such an array like $array[][]?
>
>
> I have used the function usort() to sort multi-dimensional
> arrays before.
> It might be a challenge to write the comparison function, but it is
> possible.  I use 3-dim arrays all of the time.  Makes for a
> bit cleaner code
> IMHO.
>
> I suppose one thing to consider, is that if you have an enormous 3-dim
> array, you are probably doing something wrong.  Generating a
> really big
> array can be resource intense, and can slow you page down
> exponentially.
> Select only parts of the recordset, or smaller chuck of the
> file for better
> execution, but if your application requires a large 3-dim
> array, it works
> just fine for me.
>
> Robert Zwink
>
> -----Original Message-----
> From: Tim Ward [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 18, 2001 8:06 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: [PHP] Is there such an array like $array[][]?
>
>
> 1. there are no multi-dimensional arrays in php, just single dimension
> arrays each element of which may be an array (or any other
> variable type).
> If you make every element of an array an array of size x, you
> will get what
> can be used as a multi-dimensional array. But if you forget
> what it really
> is, you'll run into problems like expecting to be able to sort
> $array[$x][$y] by $y.
> 2. because of this you can have as many levels of an array as
> you want.
>
> try :
> $array[][][][] = "fred";
> foreach($array as $level1)
>       foreach($level1 as $level2)
>               foreach($level2 as $level3)
>                       foreach($level3 as $value)
>                               echo($value);
>
>       Tim Ward
>       Senior Systems Engineer
>
> Please refer to the following disclaimer in respect of this message:
> http://www.stivesdirect.com/e-mail-disclaimer.html
>
>
> > -----Original Message-----
> > From: Plutarck [mailto:[EMAIL PROTECTED]]
> > Sent: 17 April 2001 17:42
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Is there such an array like $array[][]?
> >
> >
> > PHP can be a tad screwy with how it handles multi-dimensional
> > arrays, but
> > yes PHP handles them. No real speed problems with them either.
> >
> > But you may just want to use an associative array like:
> >
> > $loc = array("y" => $y, "x" => $x);
> >
> > Then just use $loc["y"] and $loc["x"].
> >
> > Just another option, but feel free to use multi-dimensional
> > arrays. Just be
> > aware that PHP supports only two dimensions (so $array[][][]
> > will not work),
> > and if you try and get fancy with sort() and count() you are
> > going to give
> > yourself a migraine.
> >
> >
> > --
> > Plutarck
> > Should be working on something...
> > ...but forgot what it was.
> >
> >
> > "Jack Dempsey" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > yes, that's a multi-dimensional array, which is fine in php (and
> > > everything else i can think of =P)...
> > >
> > > -jack
> > >
> > > Scott Fletcher wrote:
> > > >
> > > > Hi!  I am wondering if there is such a php array that can
> > take care of
> > the x
> > > > and y axis data.  I figure that using this array type,
> > $axis[$x][$y]
> > would
> > > > do the trick.  Would it work?  If not, then education me
> > on what would
> > work!
> > > > Thanks!
> > > >
> > > > Scott
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> > >
> >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>









                   





<quote src="bottom of every email">
To unsubscribe, e-mail: [EMAIL PROTECTED]
</quote>

HTH
Jon




-----Original Message-----
From: Walgamotte, David [mailto:[EMAIL PROTECTED]]
Sent: 24 April 2001 14:45
To: [EMAIL PROTECTED]
Subject: [PHP] How do I unsubscribe from this list




**********************************************************************
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**********************************************************************




ok, this issue seems to be deeper than what I thought.  I'll start from the
beginning.  I have a survey on my site built in php.  Is what I would like
to do is after the user votes, have the results pop-up in a new window.  The
survey is working so far as, if I remove the window.open the results will
display in the same browser window in a new page and the db will be updated.
However, when I add the onClick event handler the window that pops up is
blank and the database does not get updated.  The source in the pop-up
window reads </body></html>.  I have three files... index.phtml which is the
main page and I use include("poll.php"); on the index.phtml file to write
out the poll.  Then there is the vote.php which is used to update the db and
display the results.  Whew.. long winded.  Hopefully that will clear
anything up.

p.s.  If I change type="submit" to type="button" the pop-up window will load
the index.phtml page.  If anyone needs more code snippets or anything
please.. let me know.

Thanks again.

CAA  



-----Original Message-----
From: Plutarck [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 23, 2001 7:11 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP]PHP script and new window.


First of all, I believe since you are using javascript on your button you
shouldn't use type="submit". Change it to type="button", which means it will
have no effect for browsers that don't have javascript enabled when clicked.
That could be an error, for one. But then again, it might not.

It might cause it to be submitted to one page and opened on another, which
very well may be what you want to happen. However it might be that the
window is being opened first then the data is submitted second, thus the
error that's being caused. To fix it just add the window.open function in
the <head> area of your document, so that as soon as the page is viewed the
window pops up. Annoying if the user hits refresh, but what you could do is
use a Meta-Refresh to take them from the page that pops up the window to the
page that user should be normally seing.

Next, how is it that you are getting the data and what data are you getting?
For instance, are you using the id you are submitting to the other page to
see how that user voted? Or are you just tracking who's viewing that page?

Further, does what you are displaying depend on what id is being submitted?

Lastly, view source on your HTML page and ensure all the fields are getting
filled out like you expect them to. It happens all the time that by using
View Source I find what my problem was.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Angerer, Chad"" <[EMAIL PROTECTED]> wrote in message
9E35C54B0C7AD411B5C1009027DE539940B5EF@MSPMX01">news:9E35C54B0C7AD411B5C1009027DE539940B5EF@MSPMX01...
> I have searched high and low for thos but with no luck.  Hopefully someone
> will give me some good pointers.
>
> I have a poll on a page that I am building which uses php.  I would like
to
> have a new window open when the submit and view results links are
selected.
> I am using an onClick and the view results window works fine.  It is the
> submit button I am having trouble with.  The new window won't populate
with
> any info.
>
> Here is the form that I have on my page
>
> <form method="post" action="vote.php">
> <div class="pollTitle"><? echo $question; ?></div>
> <div class="pollResponse">
> <input type="Radio" name="response" value="1"><? echo $response1;
> ?><br>
> <input type="Radio" name="response" value="2"><? echo $response2;
> ?><br>
> <input type="Radio" name="response" value="3"><? echo $response3;
> ?><br></div>
> <input type="hidden" name="id" value="<? echo $id; ?>">
> <font size=-2><a href="#" onClick="window.open('archive.php?id=<?
> echo $id;
>
?>','archive','toolbar=no,status=no.location=no,menubar=no,top=50,left=50,he
> ight=250,width=200,scrollbars=no'); return false;">view
> results</a></font><br><br>
> <input type="submit" name="submit" value="Vote"
>
onClick="window.open('http://www.askedagain.com/vote.php','vote','toolbar=no
>
,status=no.location=no,menubar=no,top=50,left=50,height=250,width=200,scroll
> bars=no'); return false;">
> </form>
>
> The vote script works fine as if I just have it load in the current
browser
> window.  Is there something that I am missing?  Any help and/or ideas are
> much appreciated.
>
> Thanks again.
>
> CAA
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




""Plutarck"" <[EMAIL PROTECTED]> wrote in message
9c2gdi$170$[EMAIL PROTECTED]">news:9c2gdi$170$[EMAIL PROTECTED]...
> First of all, I believe since you are using javascript on your button you
> shouldn't use type="submit". Change it to type="button", which means it
will
> have no effect for browsers that don't have javascript enabled when
clicked.
> That could be an error, for one. But then again, it might not.

I had a similar requirement - to run a javascript when a form is submitted.
the best way to do this was to remove the 'onClick' event from the submit
button and instead make an 'onSubmit' event on the <form>

but remember that onSubmit must return true is the form is to be submitted,
false if the form is NOT to be submitted. It must return.

> It might cause it to be submitted to one page and opened on another, which
> very well may be what you want to happen. However it might be that the

Another good way to do that is to add a <TARGET="_blank"> option to the FORM
tag. Or you can add a TARGET="windowname" option, where windowname is a
window which your onSubmit code opened. This will submit the code and
display results in a new window

N






One fairly easy way is to use Richard Heyes html mail class available at

phpclasses.upperdesign.com


> I am working on a newsletter module. What I want
> to know is that how can we send a newsletter via
> email to all the subscribers in html format 
> with images in the htm too???
> 






Hi Geroge, you can do this:
Fist: make an php document with all the content of the letter at html ex:
$body .= " <html><head><title>any title</title></head> \n";
$body .= " <body bgcolor=\"#FFFFFF\" text=\"#000000\"> \n";
$body .= "<img src=\"http://your.domain.com/image/image.gif\"; width=\"330\"
height=\"38\"> \n";
$body .= " This is a mail at html \n";
$body .= " </body>
$body .= " </html>
note that the image will to be taken from your site...

Second: make the php script that will send the mail:
require("$body.php"); //the document that has all the html tags
$email ="[EMAIL PROTECTED] //the mail of the person that you want to contact
$topic = "any subject";
$from = "[EMAIL PROTECTED]";
$headers .= "From: $from \n";
$headers .= "reply-To:$from\nX-Mailer: PHP/" .phpversion()." \n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$headers .= "X-Priority: 1";
@mail($email, $topic, $body, $headers);
don't forget to put code next the mail() fuction or it will send you a
message telling that it has no content...
try it, if you have any problem, you can contact me...

George Alexander wrote:

> Hi,
>
> I am working on a newsletter module. What I want
> to know is that how can we send a newsletter via
> email to all the subscribers in html format
> with images in the htm too???
>
> Well I am able to send an html file as attachment
> using the php mail() function. But I still can't
> see the images in the htm file. What I think is
> the mail function just sends the file as text only
> and it will not pick up the images in the html file.
> So is there a way that I can send the html format
> with images via email.
>
> Please reply asap.
>
> regards
> George
>
> _____________________________________________________
> Chat with your friends as soon as they come online. Get Rediff Bol at
> http://bol.rediff.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
--------------------------------------
Romeo Manzur
Web Application Developer
iSilicom
Av. 27 de Febrero 904-A Desp 1, Centro
C.P.:86000
Villahermosa, Tabasco, Mexico
Tel.:(52)(9)3-12-4790
--------------------------------------






"George  Alexander" <[EMAIL PROTECTED]> wrote:

 > Hi,
 > 
 > I am working on a newsletter module. What I want
 > to know is that how can we send a newsletter via
 > email to all the subscribers in html format 
 > with images in the htm too???

read http://www.php.net/mail

-- 
Henrik Hansen





Hi !!

I just begin with PHP( but is the same as ASP ) and testing some examples...

loock at the code:

Page 1- Session.php

<?php
session_start();
$myvar = 1;
session_register("myvar");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <? echo $myvar; ?> times.<p>
To continue, <A HREF="session1.php">click here</A>
</body>
</html> 

___________________________________________________


Page 2- Session1.php
<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <?php echo $myvar; ?> times.<p>
Your SID is:  <?php echo SID; ?> <p>
</body>
</html> 


Page 1 is ok..but when I click to go to page 2  I receive this results..

Hello visitor, you have seen this page times.
Your SID is: SID 

Who can tell me what happend !!

Thank you in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]




SID does not work  unless you enable trans sid.

Regards,
--
Yasuo Ohgaki


"Hassan Arteaga" <[EMAIL PROTECTED]> wrote in message
7F548E90E63BD1118E4600609707771F8BEFAF@goliath">news:7F548E90E63BD1118E4600609707771F8BEFAF@goliath...
Hi !!

I just begin with PHP( but is the same as ASP ) and testing some examples...

loock at the code:

Page 1- Session.php

<?php
session_start();
$myvar = 1;
session_register("myvar");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <? echo $myvar; ?> times.<p>
To continue, <A HREF="session1.php">click here</A>
</body>
</html>

___________________________________________________


Page 2- Session1.php
<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <?php echo $myvar; ?> times.<p>
Your SID is:  <?php echo SID; ?> <p>
</body>
</html>


Page 1 is ok..but when I click to go to page 2  I receive this results..

Hello visitor, you have seen this page times.
Your SID is: SID

Who can tell me what happend !!

Thank you in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






You should also check if register_globals is set to ON in your php.ini file.
Otherwise you can't access you session variable just with $myvar !!

And in your code you never increment $myvar, so even if it works, you'll
always get 1.

Regards,

Nicolas Guilhot

-----Message d'origine-----
De : Yasuo Ohgaki [mailto:[EMAIL PROTECTED]]
Envoyé : mardi 24 avril 2001 16:11
À : [EMAIL PROTECTED]
Objet : Re: [PHP] About sessions !!


SID does not work  unless you enable trans sid.

Regards,
--
Yasuo Ohgaki


"Hassan Arteaga" <[EMAIL PROTECTED]> wrote in message
7F548E90E63BD1118E4600609707771F8BEFAF@goliath">news:7F548E90E63BD1118E4600609707771F8BEFAF@goliath...
Hi !!

I just begin with PHP( but is the same as ASP ) and testing some examples...

loock at the code:

Page 1- Session.php

<?php
session_start();
$myvar = 1;
session_register("myvar");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <? echo $myvar; ?> times.<p>
To continue, <A HREF="session1.php">click here</A>
</body>
</html>

___________________________________________________


Page 2- Session1.php
<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <?php echo $myvar; ?> times.<p>
Your SID is:  <?php echo SID; ?> <p>
</body>
</html>


Page 1 is ok..but when I click to go to page 2  I receive this results..

Hello visitor, you have seen this page times.
Your SID is: SID

Who can tell me what happend !!

Thank you in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





ok ..register_globals  are on !!
Ok $myvar always will be 1 ..but  when a try to print it is empty !!!..It is
just a test about session.

Thanks Nicolas !!

-----Original Message-----
From: Nicolas Guilhot [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 24, 2001 11:13 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] About sessions !!


You should also check if register_globals is set to ON in your php.ini file.
Otherwise you can't access you session variable just with $myvar !!

And in your code you never increment $myvar, so even if it works, you'll
always get 1.

Regards,

Nicolas Guilhot

-----Message d'origine-----
De : Yasuo Ohgaki [mailto:[EMAIL PROTECTED]]
Envoyé : mardi 24 avril 2001 16:11
À : [EMAIL PROTECTED]
Objet : Re: [PHP] About sessions !!


SID does not work  unless you enable trans sid.

Regards,
--
Yasuo Ohgaki


"Hassan Arteaga" <[EMAIL PROTECTED]> wrote in message
7F548E90E63BD1118E4600609707771F8BEFAF@goliath">news:7F548E90E63BD1118E4600609707771F8BEFAF@goliath...
Hi !!

I just begin with PHP( but is the same as ASP ) and testing some examples...

loock at the code:

Page 1- Session.php

<?php
session_start();
$myvar = 1;
session_register("myvar");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <? echo $myvar; ?> times.<p>
To continue, <A HREF="session1.php">click here</A>
</body>
</html>

___________________________________________________


Page 2- Session1.php
<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <?php echo $myvar; ?> times.<p>
Your SID is:  <?php echo SID; ?> <p>
</body>
</html>


Page 1 is ok..but when I click to go to page 2  I receive this results..

Hello visitor, you have seen this page times.
Your SID is: SID

Who can tell me what happend !!

Thank you in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Thaks !! Work fine !!!

Bye !!!

-----Original Message-----
From: Nicolas Guilhot [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 24, 2001 11:25 AM
To: Hassan Arteaga
Subject: RE: [PHP] About sessions !!


This code works just fine for me (with register_globals = ON), so it should
for you. If it doesn't then you have a configuration problem.

<?php
session_start();
if(!isset($HTTP_SESSION_VARS['myvar']))
{
  $myvar = 1;
  session_register("myvar");
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <? echo $myvar++; ?> times.<p>
To continue, <A HREF="session1.php">click here</A>
</body>
</html>


-----Message d'origine-----
De : Hassan Arteaga [mailto:[EMAIL PROTECTED]]
Envoyé : mardi 24 avril 2001 16:23
À : Php (E-mail)
Objet : RE: [PHP] About sessions !!


ok ..register_globals  are on !!
Ok $myvar always will be 1 ..but  when a try to print it is empty !!!..It is
just a test about session.

Thanks Nicolas !!

-----Original Message-----
From: Nicolas Guilhot [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 24, 2001 11:13 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] About sessions !!


You should also check if register_globals is set to ON in your php.ini file.
Otherwise you can't access you session variable just with $myvar !!

And in your code you never increment $myvar, so even if it works, you'll
always get 1.

Regards,

Nicolas Guilhot

-----Message d'origine-----
De : Yasuo Ohgaki [mailto:[EMAIL PROTECTED]]
Envoyé : mardi 24 avril 2001 16:11
À : [EMAIL PROTECTED]
Objet : Re: [PHP] About sessions !!


SID does not work  unless you enable trans sid.

Regards,
--
Yasuo Ohgaki


"Hassan Arteaga" <[EMAIL PROTECTED]> wrote in message
7F548E90E63BD1118E4600609707771F8BEFAF@goliath">news:7F548E90E63BD1118E4600609707771F8BEFAF@goliath...
Hi !!

I just begin with PHP( but is the same as ASP ) and testing some examples...

loock at the code:

Page 1- Session.php

<?php
session_start();
$myvar = 1;
session_register("myvar");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <? echo $myvar; ?> times.<p>
To continue, <A HREF="session1.php">click here</A>
</body>
</html>

___________________________________________________


Page 2- Session1.php
<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <?php echo $myvar; ?> times.<p>
Your SID is:  <?php echo SID; ?> <p>
</body>
</html>


Page 1 is ok..but when I click to go to page 2  I receive this results..

Hello visitor, you have seen this page times.
Your SID is: SID

Who can tell me what happend !!

Thank you in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




On Tuesday 24 April 2001 17:00, Hassan Arteaga wrote:
> Hi !!
>
> I just begin with PHP( but is the same as ASP ) and testing some
> examples...
>
> loock at the code:
>
> Page 1- Session.php
>
> <?php
> session_start();
> $myvar = 1;
> session_register("myvar");
> ?>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
> <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
> <meta name="ProgId" content="FrontPage.Editor.Document">
> <title>New Page 1</title>
> </head>
> <body>
> Hello visitor, you have seen this page <? echo $myvar; ?> times.<p>
> To continue, <A HREF="session1.php">click here</A>
> </body>
> </html>
>
> ___________________________________________________
>
>
> Page 2- Session1.php
> <?php
> session_start();
> ?>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
> <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
> <meta name="ProgId" content="FrontPage.Editor.Document">
> <title>New Page 1</title>
> </head>
> <body>
> Hello visitor, you have seen this page <?php echo $myvar; ?> times.<p>
> Your SID is:  <?php echo SID; ?> <p>
> </body>
> </html>
>
>
> Page 1 is ok..but when I click to go to page 2  I receive this results..
>
> Hello visitor, you have seen this page times.
> Your SID is: SID
>
> Who can tell me what happend !!
>
> Thank you in advanced !!!
>
> --
> M. Sc. Hassan Arteaga Rodríguez
> Microsoft Certified System Engineer
> Network Admin, WEB Programmer
> FUNDYCS, Ltd
> [EMAIL PROTECTED]

It should be echo $SID (I think) as this is a variable.
As for echo $myvar, You should register it again to use it,
so use session_register("myvar") before echoing it (You should 
increment it as well).
-- 
Meir Kriheli

  There's someone in my head, but it's not me - Pink Floyd




I believe a good article is at
http://www.php.net/manual/en/features.persistent-connections.php

""elias"" <[EMAIL PROTECTED]> wrote in message
9c3fi6$edm$[EMAIL PROTECTED]">news:9c3fi6$edm$[EMAIL PROTECTED]...
> hello...
> just asking...what is better in this case:
> i got lots of scripts and almost all of them needs to connect to the DB
and
> some of thems are accessed lots of times what is better to use in such
> cases:
> mysql_connect() or mysql_pconnect()...
> i mean will speed factor play a role when lots and lots of user tries to
> connect to the DB?
>
> -elias
> http://eassoft.cjb.net
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






If you are using PHP as CGI, pconnect is no different than connect.

If you are using PHP as an Apache module, persistant connections can be of
some help. But if your own mysql, I don't reccommend you bother with
pconnect.

MySQL is extremely efficient at creating connections, unlike databases like
Oracle and PostgreSQL which have heavier connection processes.

If MySQL is on a different server than your webserver is on, then you still
may gain some positive result from using persistant connections, but it will
be nothing impressive and could cause bad things to happen if Apache and
MySQL are set in certain ways and the site get's hammered with requests.

Still, with MySQL it's just not much worth using persistant connections,
because the effect is just so minor.

If you use a slower connecting database or if it's located on another
server, then it may be a good idea.


In other words persistant connections are not so wonderful that everyone
should use them in every instance. You'll have to judge on a case by case
basis.


--
Plutarck
Should be working on something...
...but forgot what it was.


""elias"" <[EMAIL PROTECTED]> wrote in message
9c3fi6$edm$[EMAIL PROTECTED]">news:9c3fi6$edm$[EMAIL PROTECTED]...
> hello...
> just asking...what is better in this case:
> i got lots of scripts and almost all of them needs to connect to the DB
and
> some of thems are accessed lots of times what is better to use in such
> cases:
> mysql_connect() or mysql_pconnect()...
> i mean will speed factor play a role when lots and lots of user tries to
> connect to the DB?
>
> -elias
> http://eassoft.cjb.net
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






I'm trying to write a script to ftp the contents of one directory structure
onto another server.. I'm having problems recursing the directories, either
it a) doesn't do it or b) gets stuck in a loop.

Here's the function I'm having the problem with..


function recurseUp()
{
        global $conn_id, $recurse;
        $handle=opendir('.');
        while (false!==($file = readdir($handle))) {
            if ($file != "." && $file != "..")
                echo "<br><b>$file</b><br>";
                {
                        //if dir then recurse
                        if (is_Dir($file)) {
                                        chDir($file);
                                        $result = ftp_chdir($conn_id, $file);
                                        if (!$result) {
                                                @ftp_mkdir($conn_id, $file);
                                                $result = ftp_chdir($conn_id, $file);
                                        }
                                        recurseUp();
                        } else {
                                //put
                                $result = ftp_put($conn_id, $file, $file, FTP_BINARY);
                                if (!$result) {
                                        echo "<BR><b>Error attempting retrieve file: 
$file</b>";
                                } else {
                                        echo "<BR>Remote File Successfully Saved as: 
$file";
                                }
                        }
            }
        }

        chDir('c:\inetpub\wwwroot\php\xfer');
        ftp_cdup($conn_id);
        closedir($handle);

}


Does anyone see the problem?  Thanks!

Chad





On Tue, Apr 24, 2001 at 10:10:58AM -0400, Chad Day wrote:
> I'm trying to write a script to ftp the contents of one directory structure
> onto another server.. I'm having problems recursing the directories, either
> it a) doesn't do it or b) gets stuck in a loop.
> 
> Here's the function I'm having the problem with..
> 
> 

Directory recursion has angered me many long nights.  Here is what I
finally came up with, which works perfectly.  This should be easily
changed into what you need.. it's just an example of the logic. ;)

This was meant to run from the command line with /usr/bin/php -q ;)

$base = $argv[1];
$i = 0;
$directory[$i] = array ($argv[1]);

while (1) {
        if ( @ is_array ($directory[$i])) {
        $subdirs = "";
                foreach ($directory[$i] as $dir) {
                        if (($dir_handle = @ opendir ($dir))) {
                                print ("Reading $dir\n");
                                        while (($file = readdir ($dir_handle)) !== 
false) {
     // Drop these two, else we'll be no better
     // than glibc's glob() ;)
                                        if (($file != '.') && ($file != '..')) {
                                                if ( ! ereg ('^/', $dir)) {
                                                        $temp = $base . $dir;
                                                } else { $temp = $dir; }
                                                if ( ! ereg ('/$', $temp)) {
                                                        $temp .= '/' . $file;
                                                } else { $temp .= $file; }
     // Consider dropping symlinks right here,
     // or treating them as a normal file.
                                                if ( @ is_dir ($temp)) {
                                                        $subdirs .= $temp . ',';
                                                } else { print ("\t$file\n"); }
                                        }
                                }
                                closedir ($dir_handle);
                        }
                }
                $i++;
                if ($subdirs) {
                        $directory[$i] = explode (',', substr ($subdirs, 0, ((strlen 
($subdirs) - 1))));
                }
        }
        else { break; }
}

Hope that helps a bit.  I know that was one of the most frustrating things
I've ever tried to figure out (in any language).  It's certainly not
perfect.. you will probably need to add a few more string checks to it,
but the basic logic seems flawless to me.

Good luck! ;)





also, using Method = POST will not show the vars in the URL, though it will be passed. 
Make it METHOD="GET" to show it in the URL.

N
  "Rene Maldonado" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi I think it woulf be better this way: 
          print "<form action = '$PHP_SELF?action=1' method = 'post'     name = 
'hello'>"; 
          print "<input type='text' name='var_hello'>"; 
          print "<input type  = submit value = 'Submit' >"; 
    

  and, the var name is $var_hello 

  this way, the value of your var do not appear in the URL, 

  This work for me... 
    
    

  Martin Cameron wrote: 

    Here is a simple form file that needs to pass a variable - $hello - from 
    the form to a new function. Unfortunately, it doesn't.  When you click 
    the submit button, the URL looks like this: 
         http://localhost/test5.php?action=1&hello= 

         It should have the variable there after the "hello=" 

    I suspect it's something to do with parent.location. Looking for a 
    solution. Here's the script: 

         <head> 
         </head> 
         <body bgcolor=white> 
         <? 
         define(INITIAL_PAGE,0); 
         define(SELECT,1); 
         function initial_page(){ 
            global $PHP_SELF,$hello; 
            print "<form action = '$PHP_SELF?action=1' method = 'post' 
         name = 'hello'>"; 
            print "<input type='text' name='hello'>"; 
            print "<input name = 'hello' type='button' value='Submit' 
         onClick=\"parent.location='$PHP_SELF?action=1&hello=$hello'\">"; 

            print "</form>"; 
         } 

         function select(){ 
            global $hello; 
            print "Hellooooooooooo, $hello!"; 
         } 

         initial_page(); 

         switch($action){ 
          case INITIAL_PAGE: 
            initial_page; 
            break; 
          case SELECT: 
            select(); 
            break; 
          default: 
            die ("Hello, can't find that function."); 
         } 
         ?> 
         </body> 
         </html> 

    The thing is that if you simply hit "enter" - rather than click the 
    "submit" button, the first directive in the <form> tag is invoked, and 
    the value of the $hello variable IS passed. 

    regards 
    Martin Cameron



------------------------------------------------------------------------------


  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]






Hi! I'm going to use PHP with Netscape Enterprise Server 3.5.1 (HP-UX). Is
it possible and what should I do?

As I understood from the documentation JSP is only one way. Do not want to
believe in it. :-)
Daniel






I would have thought you could use it as a CGI, if you can't get it running
as a module.

These manual pages look like they might be of use to you:
http://www.php.net/manual/en/install.netscape-enterprise.php
http://www.php.net/manual/en/install.hpux.php

Cheers
Jon


-----Original Message-----
From: Daniel [mailto:[EMAIL PROTECTED]]
Sent: 24 April 2001 15:21
To: [EMAIL PROTECTED]
Subject: [PHP] Netscape Enterprise Server + PHP ?= possible




Hi! I'm going to use PHP with Netscape Enterprise Server 3.5.1 (HP-UX). Is
it possible and what should I do?

As I understood from the documentation JSP is only one way. Do not want to
believe in it. :-)
Daniel



**********************************************************************
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**********************************************************************




Hello everybody,

I'm just starting out with php4 and I can use some help.
Below is a script I wrote. The dbase connections are allright (i have tested
them) , but the final result is 'no fetch'.
so something goes wrong in 'mysql_fetch_row' but I don't understand what.
Any of you have an idea?

Thanx.

W. Enserink


<?php

$global_dbh = mysql_connect($hostname, $user, $password);

if(!$global_dbh)
 die("no dbase connection");

$a = mysql_select_db('pdd', $global_dbh);
if(!$a)
 die("no dbase selection");


function display_db_table($tablename, $connection)
{
 $query_string = "select * from $tablename";
 print ("querystring = $query_string<BR>");
 $result_id = mysql_query($query_string, $connection);
 print("result_id = $result_id<BR>");
 $column_count = mysql_num_fields($result_id);
 print("column_count = $column_count<BR>");



print("<TABLE BORDER=1>\n");
while ($row = mysql_fetch_row($result_id));
 {
 if(!$row)
  die ("no fetch");
 print "row = $row[1]";
 print("<tr align = left valign = top>");
 for ($column_num = 0;
  $column_num < $column_count;
  $column_num++)
 print("<TD>$row[$column_num] $column_num</td>\n");

 print("</tr>\n");
 }
print("</table>\n");
}
?>

<html>
<body>
<table><tr><td>
<?php
display_db_table("test", $global_dbh);

?>
</TD></TR></TABLE>
</body>
</html>

-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------




Gurus,
    I want to query an oracle database and push the output to an MS
Excel spreadsheet . Currently I am dumping it to a csv text file and
reading into Excel.
    Is there a better way to do this?? Is there a php function for
this ??
Regards
~Rahul






You can query the oracle database and generate a text file with tab delimiter.
Then you can open this file in Excel.

Calin

On Tuesday 24 April 2001 10:31, Rahul Bhide wrote:
> Gurus,
>     I want to query an oracle database and push the output to an MS
> Excel spreadsheet . Currently I am dumping it to a csv text file and
> reading into Excel.
>     Is there a better way to do this?? Is there a php function for
> this ??
> Regards
> ~Rahul




Thanks Calin,
    I have already tried with the csv and the tab delimited text file  . I wanted
to know a better option
bye
`Rahul
Calin Rotaru wrote:

> You can query the oracle database and generate a text file with tab delimiter.
> Then you can open this file in Excel.
>
> Calin
>
> On Tuesday 24 April 2001 10:31, Rahul Bhide wrote:
> > Gurus,
> >     I want to query an oracle database and push the output to an MS
> > Excel spreadsheet . Currently I am dumping it to a csv text file and
> > reading into Excel.
> >     Is there a better way to do this?? Is there a php function for
> > this ??
> > Regards
> > ~Rahul
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





On Tue, Apr 24, 2001 at 08:37:19PM +0530, Rahul Bhide produced this golden nugget:
> Thanks Calin,
>     I have already tried with the csv and the tab delimited text file  . I wanted
> to know a better option
> bye
> `Rahul

Doubt there is a more effective solution with php (unless you write a class/
function that ouputs .xls), what you could do though is probably to use ODBC
to connect excel (if it supports odbc) and connect the oracle base through
ODBC...

-- 
Andreas D. Landmark / noXtension
Fortune's Fictitious Country Song Title of the Week:
        "How Can I Miss You if You Won't Go Away?"





If you really want to create Excel files directly from php, the attached
file (untested) may help.  I found this somewhere on the net while
looking for the same solution.

What I wound up using is the _excellent_ Spreadsheet::WriteExcel module
for Perl.  We simply call the perl CGI for that function of our web app.
Works great!  It also has a Spreadsheet::ParseExcel companion which
works equally well.

The only problem we had with this was not being able to get to the
contents of the session while in Perl.  Could have jumped through some
hoops to get it, but wound up hacking around it by using a long query
string with the pertinent parameters (ugly, but works).

Al

> -----Original Message-----
> From: 
> [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED].
> net] On Behalf Of Calin Rotaru
> Sent: Tuesday, April 24, 2001 5:59 PM
> To: Rahul Bhide; [EMAIL PROTECTED]
> Subject: Re: [PHP] db to xls
> 
> 
> You can query the oracle database and generate a text file 
> with tab delimiter. Then you can open this file in Excel.
> 
> Calin
> 
> On Tuesday 24 April 2001 10:31, Rahul Bhide wrote:
> > Gurus,
> >     I want to query an oracle database and push the output to an MS 
> > Excel spreadsheet . Currently I am dumping it to a csv text 
> file and 
> > reading into Excel.
> >     Is there a better way to do this?? Is there a php function for 
> > this ?? Regards
> > ~Rahul
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED] To contact the list 
> administrators, e-mail: [EMAIL PROTECTED]
> 
> 




>     I want to query an oracle database and push the output to an MS
> Excel spreadsheet . Currently I am dumping it to a csv text file and
> reading into Excel.
>     Is there a better way to do this?? Is there a php function for this ??

What I am doing is using PHP to generate an HTML table in the
format that I want to display the db results in.  Then, at the top
of this file, I include the following code:

<code_snippet>

Header("Content-Disposition: inline; filename=filename.xls");
Header("Content-Description: PHP3 Generated Data");
Header("Content-type: application/vnd.ms-excel; name='excel'");
flush();

</code_snippet>

The browser will get those headers, see that it's receiving an
excel file and proceed to launch Excel.  And Excel is good enough
to know and process HTML and your data is displayed appropriately.
It's very cool and very easy to implement.

Chris




Rahul,

Why not just create a pivot table in Excel directly to Oracle?
That way you would have a live view of the data.

Best regards,
Andrew
--------------------------------------
Andrew Hill - OpenLink Software
Director Technology Evangelism
Universal Data Access Integration
http://www.openlinksw.com
office:781.273.0900 x 27
mobile:781.608.4217

> -----Original Message-----
> From: Rahul Hari Bhide [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 24, 2001 11:07 AM
> To: Calin Rotaru
> Cc: Rahul Bhide; [EMAIL PROTECTED]
> Subject: Re: [PHP] db to xls
>
>
> Thanks Calin,
>     I have already tried with the csv and the tab delimited text
> file  . I wanted
> to know a better option
> bye
> `Rahul
> Calin Rotaru wrote:
>
> > You can query the oracle database and generate a text file with
> tab delimiter.
> > Then you can open this file in Excel.
> >
> > Calin
> >
> > On Tuesday 24 April 2001 10:31, Rahul Bhide wrote:
> > > Gurus,
> > >     I want to query an oracle database and push the output to an MS
> > > Excel spreadsheet . Currently I am dumping it to a csv text file and
> > > reading into Excel.
> > >     Is there a better way to do this?? Is there a php function for
> > > this ??
> > > Regards
> > > ~Rahul
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>





Hello,

how it is possible to create a bar chart in php? I appreciate any hint.

Ali





Ali,
    You need to install gd library with php .
Visit here for a reference tool
//www.sourceforge.net/projects/phplot/
bye
~Rahul
Ali wrote:

> Hello,
>
> how it is possible to create a bar chart in php? I appreciate any hint.
>
> Ali
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





Hello Rahul,

thanks for your reply. I already have got gd library installed. This tool
which have mentioned may help me further to create such a bar chart. I will
look at it.

Regards

Ali





You can use some coding and a few 1 pixel gifs to do this also

<img src="reddot.gif" width="<?php echo $width ?> height="10">

assuming you had made a red one pixel gif and called it reddot.gif that
would draw a bar 10 pixels high with a width of $width. With a short script
you can make bar graphs with a lot less overhead than using GD.

Data Driven Design
P.O. Box 1084
Holly Hill, Florida 32125-1084

http://www.datadrivendesign.com
http://www.rossidesigns.net
----- Original Message -----
From: Ali <[EMAIL PROTECTED]>
To: 'Php-General (E-mail)' <[EMAIL PROTECTED]>
Sent: Monday, April 23, 2001 10:37 AM
Subject: [PHP] create bar chart


> Hello,
>
> how it is possible to create a bar chart in php? I appreciate any hint.
>
> Ali
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>





I am using this class and it works very well. It is however, somewhat
confusing to understand. It took me about a weekend to fully understand and
use all of the functions. It does come with example PHP scripts that
demonstrate its capabilities. You will need TTF support - I am using
Freetype 2.0.

Have fun

Dean





Name: phpBarGraph

Author: thunter <[EMAIL PROTECTED]>

Description:
phpBarGraph is a bargraphing class for PHP. It allows one to have an
arbitrary number of bargraphs. phpBarGraph scales the bars to fit the area
you set. It is possible to cycle through colors for each bar. Each bar can
be its own color or they can all be the same color. Multiple bar graphs
can be placed on one image and the inter-bar spacing is configurable. 


URL: http://phpclasses.upperdesign.com/browse.html/package/181

-----Original Message-----
From: Ali [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 23, 2001 9:37 AM
To: 'Php-General (E-mail)'
Subject: [PHP] create bar chart


Hello,

how it is possible to create a bar chart in php? I appreciate any hint.

Ali


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Hi,

I want a client to be able to upload a file to the web server via PHP.  
Then, I want that image to be processed, scaled, and made into thumbnails 
and full-size images.  Is this possible with the image processing 
capabilities of PHP, or should I use something like Image Magick to do it 
server side?

Please copy your reply to [EMAIL PROTECTED] as I am on the digest 
version.  

Thanks in advance.


mto

Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
---------------------
 M   A   N   G   O
B  O  U  L  D  E  R 
---------------------
http://www.thinkmango.com
[EMAIL PROTECTED]
p-303.442.1821
f-303.938.8507






> I want a client to be able to upload a file to the web server via PHP.  
> Then, I want that image to be processed, scaled, and made into thumbnails 
> and full-size images.  Is this possible with the image processing 
> capabilities of PHP, or should I use something like Image Magick to do it 
> server side?



I'd like to know how to do this as well.

J









> Resizing (and resampling) an image:
>
> http://www.php.net/manual/en/function.imagecopyresized.php
> http://www.php.net/manual/en/function.imagecopyresampled.php



Is there anything extra in need to install?



J









try doing the session_register and then $myvar = 1;
I think when you do the session_register the value of $myvar gets
initialized to null.

---------- Forwarded message ----------
Date: Tue, 24 Apr 2001 11:23:17 -0300
From: Hassan Arteaga <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[EMAIL PROTECTED]>
Subject: RE: [PHP] About sessions !!

ok ..register_globals  are on !!
Ok $myvar always will be 1 ..but  when a try to print it is empty !!!..It is
just a test about session.

Thanks Nicolas !!

-----Original Message-----
From: Nicolas Guilhot [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 24, 2001 11:13 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] About sessions !!


You should also check if register_globals is set to ON in your php.ini file.
Otherwise you can't access you session variable just with $myvar !!

And in your code you never increment $myvar, so even if it works, you'll
always get 1.

Regards,

Nicolas Guilhot

-----Message d'origine-----
De : Yasuo Ohgaki [mailto:[EMAIL PROTECTED]]
Envoyé : mardi 24 avril 2001 16:11
À : [EMAIL PROTECTED]
Objet : Re: [PHP] About sessions !!


SID does not work  unless you enable trans sid.

Regards,
--
Yasuo Ohgaki


"Hassan Arteaga" <[EMAIL PROTECTED]> wrote in message
7F548E90E63BD1118E4600609707771F8BEFAF@goliath">news:7F548E90E63BD1118E4600609707771F8BEFAF@goliath...
Hi !!

I just begin with PHP( but is the same as ASP ) and testing some examples...

loock at the code:

Page 1- Session.php

<?php
session_start();
$myvar = 1;
session_register("myvar");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <? echo $myvar; ?> times.<p>
To continue, <A HREF="session1.php">click here</A>
</body>
</html>

___________________________________________________


Page 2- Session1.php
<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
Hello visitor, you have seen this page <?php echo $myvar; ?> times.<p>
Your SID is:  <?php echo SID; ?> <p>
</body>
</html>


Page 1 is ok..but when I click to go to page 2  I receive this results..

Hello visitor, you have seen this page times.
Your SID is: SID

Who can tell me what happend !!

Thank you in advanced !!!

--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





Hello!

This is the scenario:

(a) I have an interface that will be the main interface with the user

(b) I have a mail server (Mirapoint) that has a web interface

(c) The web interface for the Mirapoint server is inside frames

This is the problem:

(a) let's say that I log in as a user from the Mirapoint web e-mail server;
I will receive an interface for the user with all the e-mail readers and
commands let's say like compose new e-mail and delete e-mail.

(b) I want to show let's say the headers inside my interface.

How do I do that? Ideas?

Thank you,

Rom





Hello!

This is the scenario:

(a) I have an interface that will be the main interface with the user

(b) I have a mail server (Mirapoint) that has a web interface

(c) The web interface for the Mirapoint server is inside frames

This is the problem:

(a) let's say that I log in as a user from the Mirapoint web e-mail server;
I will receive an interface for the user with all the e-mail readers and
commands let's say like compose new e-mail and delete e-mail.

(b) I want to show let's say the headers inside my interface.

How do I do that? Ideas?

Thank you,

Rom





Thank you in advance for your response. I have an order form that I would
like to drop directly into my shopping cart. The following form and php
works great for the first input - part_number - is there a wildcard that I
can place at the end of the array so that the cart will pickup all part
numbers entered into the form?

<FORM ACTION="<?php print MTA_URL('/cart/dropin.php',array('part_number'=>
$part_number)); ?>" method="post">
  <INPUT TYPE="HIDDEN" NAME="Orderform" VALUE="No">
  <table width="22%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><b>Model or Part Number: </b></td>
    </tr>
    <tr>
      <td>
        <input type="Text" name="part_number">
      </td>
    </tr>
    <tr>
      <td>
        <input type="Text" name="part_number2">
      </td>
    </tr>
   etc...

Duffy Betterton
Director of Publications
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
www.mtadistributors.com <http://www.mtadistributors.com>
1-615-277-3265








I am playing with using PATH_INFO for variables, like the zend.com article, I like 
this but I want SID to follow a simmilar path. ie.

index.php?article=1234&PHPSESSID=xxxxxx

would be

index.php/article/1234/PHPSESSID/xxxxxx

but Im getting

index.php/article/1234?PHPSESSID=xxxxxx

is there a simple way to tell php to use the new format? other then 

// top
ob_start();

...

// bottom
echo ereg_replace("?PHPSESSID=". session_id(), "/PHPSESSID/". session_id(), 
ob_get_contents());

oi, what a mess ....


-- 

 Chris Lee
 [EMAIL PROTECTED]







Hi PHPers,

If I have a script that checks to see if a variaable is defined. The variaable is from 
a form and is sent to the script. There is also a cookie that may be set with a name 
as the same name as from the form. When the script checks and assuming the cookie is 
set and a value sent from the form , which value does the variable take on?

Thanks

Dexter





Depends :)

*If* the variables_order directive in php.ini is set to the default EGPCS
(Env,Get,Post,Cookie,Server), *and* register_globals in php.ini is on, *and*
there is not a session variable with the same name that has already been
assigned a value, *then* the value in the cookie will end up in the global
variable of the same name. The cookie value will also be in
$HTTP_COOKIE_VARS[], and the post value will also be in $HTTP_POST_VARS[].

Else, otherwise.

Kirk



> -----Original Message-----
> From: Dexter [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 24, 2001 12:33 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Precedence question- cookie value over form value?
> 
> 
> Hi PHPers,
> 
> If I have a script that checks to see if a variaable is 
> defined. The variaable is from a form and is sent to the 
> script. There is also a cookie that may be set with a name as 
> the same name as from the form. When the script checks and 
> assuming the cookie is set and a value sent from the form , 
> which value does the variable take on?
> 
> Thanks
> 
> Dexter
> 
> 




Hiya,

I am not a weirdo (at least I think so) ;)

Considere this (Notice the line number):
=======================================================================

    Parse error: parse error in test_the_bug.php on line 1

=======================================================================

Seem normal, isn't it... but i is not!!!

Since I last re-builted PHP,
all, error messages do not return the correct line number...
It is always saying line 1!

What I have done?!? I can't work it out...

I have rebuilt PHP many time now but with no success...
Apart that every thing work fine :( but it is quiete ennoying to track and
debug all my php errors :(

So my config is Linux RedhaT with PHP Version 4.0.4pl1
'./configure' '--with-mysql' '--with-apxs' '--with-gd=/usr/local'
'--with-jpeg-dir=/usr/local' '--enable-ftp' '--with-imap' '--with-zlib'
'--with-gettext'

PLEASE HELP! 
Thanks in advance!
Franck





Hi everbody !

When I use mail() function it seems not to work
what I can find in logs is :
Apr 24 16:51:01 xxx sendmail[10688]: f3OEp1U10688: SYSERR(nobody): Cannot
create ./dff3OEp1U10688: Permission denied

Why it doesn't work ???

System RH7.0 with sendmail

regards,
Marcin






Krupiński Marcin <[EMAIL PROTECTED]> wrote:

 > Hi everbody !
 > 
 > When I use mail() function it seems not to work
 > what I can find in logs is :
 > Apr 24 16:51:01 xxx sendmail[10688]: f3OEp1U10688: SYSERR(nobody): Cannot
 > create ./dff3OEp1U10688: Permission denied
 > 
 > Why it doesn't work ???

I don't think it's php that fails, maybe you should ask else where or
check that sendmail is installed correctly?

-- 
Henrik Hansen





Hi,

I have now been 3-4 months writing PHP-codes and read the PHP manual
throughout. But there is one thing I can't figure out properly (I think it's
not covered enough in the manual): Classes!

When and why would I use it?

Is it only to group certain functions or does it have a special function?

Thanks!

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

------------------------------------------
Phone:       (+354) 4615501
Mobile:      (+354) 8960376
Fax:         (+354) 4615503
E-mail:      [EMAIL PROTECTED]
Homepage:    www.sed.is <- New Homepage!
------------------------------------------





http://phpbuilder.com/columns/rod19990601.php3

This is almost a religious debate in itself, but some brief info anyway.

""SED"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I have now been 3-4 months writing PHP-codes and read the PHP manual
> throughout. But there is one thing I can't figure out properly (I think
it's
> not covered enough in the manual): Classes!
I am fairly certain it is covered in the manual. Chapter 13. Classes and
Objects(http://php.net/manual/en/language.oop.php)

> When and why would I use it?
It is a preferential manner of coding.  It is not strictly necessary in any
situation, but there are some arguments about when it should be used and
when it shouldn't(unless your a Java programmer).  I have found OOP to be
very useful for some large projects, and for others I have avoided it for no
other reason than I didn't feel like coding my app that way on that
particular day.

> Is it only to group certain functions or does it have a special function?
As I said it is just another style of coding.  Take a shot at writing an OO
app.  It takes some getting used to, but its something everyone should at
least know so at the very least you can understand someone else's code.

> Thanks!
>
> Regards,
> Sumarlidi Einar Dadason
>
> SED - Graphic Design
--
phill





I had trouble with classes too, but I think the main reason they are tough
at first is because since there is so much talk about how hard/cool object
oriented programming is, we think things are harder than they are.

Think of an object as a jar. Inside the jar are variables and functions
(refered to as "methods", for reasons that someone made up at some point),
mutch like the standard PHP functions.

The use of a class (which is a blueprint for PHP to use to see how an object
should be made) is to simplify coding and allow for variable and function
grouping.

To bring it all down nice and simple, Classes do nearly nothing that can't
be done without them. But they can make it a whole lot easier to do certain
things, and they allow more extensible and portable code to be made (which
is a good thing, certainly).


If you will need multiple instances of the same variables or functions, use
a Class. For instance if you need to have many things with the $color
variable, you could either put it in an associative array or stick it inside
it's own object.

It doesn't allow you to do anything you couldn't already, but it can really
make your life a whole lot simpler in many instances.

The key is to that procedural programming and object oriented programming
are not mutually exclusive. You can use a little of both. And if you are
going to use PHP, you should use both.

PHP isn't Java; it's not an OO language.
PHP isn't...um...FORTAN; it's not a purely PP language.


The world if formed from the void,
like utensils from a block of wood.
The Master knows the utensils,
yet keeps to the block:
thus he can use all things.



--
Plutarck
Should be working on something...
...but forgot what it was.



""SED"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I have now been 3-4 months writing PHP-codes and read the PHP manual
> throughout. But there is one thing I can't figure out properly (I think
it's
> not covered enough in the manual): Classes!
>
> When and why would I use it?
>
> Is it only to group certain functions or does it have a special function?
>
> Thanks!
>
> Regards,
> Sumarlidi Einar Dadason
>
> SED - Graphic Design
>
> ------------------------------------------
> Phone:       (+354) 4615501
> Mobile:      (+354) 8960376
> Fax:         (+354) 4615503
> E-mail:      [EMAIL PROTECTED]
> Homepage:    www.sed.is <- New Homepage!
> ------------------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Good definition. Another thing to note is that variables defined in a
class's body can be accessed by all the other class functions without
needing arguements to use them. Thats a nice feature
----- Original Message -----
From: "SED" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 24, 2001 12:46 PM
Subject: [PHP] Newbie question about Classes


> Hi,
>
> I have now been 3-4 months writing PHP-codes and read the PHP manual
> throughout. But there is one thing I can't figure out properly (I think
it's
> not covered enough in the manual): Classes!
>
> When and why would I use it?
>
> Is it only to group certain functions or does it have a special function?
>
> Thanks!
>
> Regards,
> Sumarlidi Einar Dadason
>
> SED - Graphic Design
>
> ------------------------------------------
> Phone:       (+354) 4615501
> Mobile:      (+354) 8960376
> Fax:         (+354) 4615503
> E-mail:      [EMAIL PROTECTED]
> Homepage:    www.sed.is <- New Homepage!
> ------------------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





and VB is a POOP language :)  (pseudo-Object oriented programming)
--
phill

> PHP isn't Java; it's not an OO language.
> PHP isn't...um...FORTAN; it's not a purely PP language.
> 
> 
> The world if formed from the void,
> like utensils from a block of wood.
> The Master knows the utensils,
> yet keeps to the block:
> thus he can use all things.
> 
> 
> 
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.






Can't.

PHP can't make the browser do much of anything. To clear the cache the user
will have to do it themselves.


--
Plutarck
Should be working on something...
...but forgot what it was.


"mohammed oda" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi
> how can i delete the browser-cache in PHP
> thanks
>
> --
> Mohammed Oda
> Leibniz str. 76
> 55118 Mainz
> Tel.06131-638350
>
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Hi,
Has any got any idea why $DOCUMENT_ROOT returns /usr/local/htdocs on my home 
machine but it should return /usr/local/htdocs/sitename or where ever I put 
it, but on my production machine it return what it should like 
/usr/local/sitename or whatever?

I'm trying to use it to help include files in different directories (see my 
previous post, site structure). Got any ideas about this?

Cheers,

Jord





I started with the Pro php programming book.

very useful and well written.

punt the baby book :)



On Mon, 16 Apr 2001 07:53:16 +0200, Martin Skj”ldebrand wrote:

>Kath wrote:
>
>> Professional PHP Programming:
>>
>http://www.amazon.com/exec/obidos/ASIN/1861002963/qid=987388364/sr=1-12/ref=
>> sc_b_13/002-2263539-0333643
>
>I've got Beginning PHP 4 (recommended) on the back cover of which it says
>that the next book could be "Professional PHP Programming.".
>However from what I saw in the book shop they cover lots of the same
>ground. I (and my employer) wouldn't like to pay for the same stuff again.
>Is there a significant difference between the two?
>
>Martin S.
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Could someone tell me how to actually execute this script please?

$hostname = "";
$username = "";
$password = "";
$dbName = "";
$userstable = "booking";

MYSQL_CONNECT($hostname, $username, $password)
 or die("Unable to connect to database");

@mysql_select_db( "$dbName")
 or die( "Unable to select database");

$mysql_query INSERT INTO $userstable (client, contact, email, address, city, state, 
zip, phone, fax, model, country, details, type)
VALUES('$client', '$contact', '$email', '$address', '$city', '$state', '$zip', 
'$phone', '$fax', '$model', '$country', '$details', '$type');

MYSQL_CLOSE();

?>

Thanks, also if you know any tutorials for PHP and MySQL

Shawn




H-

Here ya go. 

http://www.php.net/manual/en/function.pg-connect.php
This page and the links on the left hand column have everything you'll
ever want to know about db connects and sql queries. 8^) 

-Sterling


shawn wrote:
> 
> Could someone tell me how to actually execute this script please?
> 
> $hostname = "";
> $username = "";
> $password = "";
> $dbName = "";
> $userstable = "booking";
> 
> MYSQL_CONNECT($hostname, $username, $password)
>  or die("Unable to connect to database");
> 
> @mysql_select_db( "$dbName")
>  or die( "Unable to select database");
> 
> $mysql_query INSERT INTO $userstable (client, contact, email, address, city, state, 
>zip, phone, fax, model, country, details, type)
> VALUES('$client', '$contact', '$email', '$address', '$city', '$state', '$zip', 
>'$phone', '$fax', '$model', '$country', '$details', '$type');
> 
> MYSQL_CLOSE();
> 
> ?>
> 
> Thanks, also if you know any tutorials for PHP and MySQL
> 
> Shawn





""shawn"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
001c01c0cce3$c114c420$5c52a040@admin">news:001c01c0cce3$c114c420$5c52a040@admin...
>Could someone tell me how to actually execute this script please?

$mysql_query = mysql_query("INSERT INTO $userstable (client, contact, email,
address, city, state, zip, phone, fax, model, country, details, type)
VALUES('$client', '$contact', '$email', '$address', '$city', '$state',
'$zip', '$phone', '$fax', '$model', '$country', '$details', '$type')");

for tutorial look at
www.devshed.com
www.phpbuilder.com
www.webmonkey.com
www.hotscripts.com

just do a search on PHP and MySQL.

Cheers
johannes







Sterling, it appears Shawn is using MySQL, not PostgreSQL.  That said,
Shawn, have a look here :

  http://www.php.net/manual/en/ref.mysql.php

You'll see a list of MySQL functions, which are in your snippet below.
PHP functions such as :

  mysql_connect, mysql_select_db, mysql_query, mysql_fetch_array ...

Attend each manual page for further information on each function and note
the examples.  This tutorial may help :

  http://php.vamsi.net/mysql/
  http://www.sqlcourse.com/

Look around www.zend.com, php.faqts.com, www.phpbuilder.com and
www.devshed.com for a few more goodies, as well as many many other sites!  
Also note that when you view tutorials, they are not the only way.  Also
note the difference between SQL and PHP.  

Regards,
Philip


On Tue, 24 Apr 2001, Sterling wrote:

> H-
> 
> Here ya go. 
> 
> http://www.php.net/manual/en/function.pg-connect.php
> This page and the links on the left hand column have everything you'll
> ever want to know about db connects and sql queries. 8^) 
> 
> -Sterling
> 
> 
> shawn wrote:
> > 
> > Could someone tell me how to actually execute this script please?
> > 
> > $hostname = "";
> > $username = "";
> > $password = "";
> > $dbName = "";
> > $userstable = "booking";
> > 
> > MYSQL_CONNECT($hostname, $username, $password)
> >  or die("Unable to connect to database");
> > 
> > @mysql_select_db( "$dbName")
> >  or die( "Unable to select database");
> > 
> > $mysql_query INSERT INTO $userstable (client, contact, email, address, city, 
>state, zip, phone, fax, model, country, details, type)
> > VALUES('$client', '$contact', '$email', '$address', '$city', '$state', '$zip', 
>'$phone', '$fax', '$model', '$country', '$details', '$type');
> > 
> > MYSQL_CLOSE();
> > 
> > ?>
> > 
> > Thanks, also if you know any tutorials for PHP and MySQL
> > 
> > Shawn
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 






H-

You are right. My bust. 
Sorry for the errant info. 

Although I still highly recommend the site. 8^) 
-Sterling


Philip Olson wrote:
> 
> Sterling, it appears Shawn is using MySQL, not PostgreSQL.  That said,
> Shawn, have a look here :
> 
>   http://www.php.net/manual/en/ref.mysql.php
> 
> You'll see a list of MySQL functions, which are in your snippet below.
> PHP functions such as :
> 
>   mysql_connect, mysql_select_db, mysql_query, mysql_fetch_array ...
> 
> Attend each manual page for further information on each function and note
> the examples.  This tutorial may help :
> 
>   http://php.vamsi.net/mysql/
>   http://www.sqlcourse.com/
> 
> Look around www.zend.com, php.faqts.com, www.phpbuilder.com and
> www.devshed.com for a few more goodies, as well as many many other sites!
> Also note that when you view tutorials, they are not the only way.  Also
> note the difference between SQL and PHP.
> 
> Regards,
> Philip
> 
> On Tue, 24 Apr 2001, Sterling wrote:
> 
> > H-
> >
> > Here ya go.
> >
> > http://www.php.net/manual/en/function.pg-connect.php
> > This page and the links on the left hand column have everything you'll
> > ever want to know about db connects and sql queries. 8^)
> >
> > -Sterling
> >
> >
> > shawn wrote:
> > >
> > > Could someone tell me how to actually execute this script please?
> > >
> > > $hostname = "";
> > > $username = "";
> > > $password = "";
> > > $dbName = "";
> > > $userstable = "booking";
> > >
> > > MYSQL_CONNECT($hostname, $username, $password)
> > >  or die("Unable to connect to database");
> > >
> > > @mysql_select_db( "$dbName")
> > >  or die( "Unable to select database");
> > >
> > > $mysql_query INSERT INTO $userstable (client, contact, email, address, city, 
>state, zip, phone, fax, model, country, details, type)
> > > VALUES('$client', '$contact', '$email', '$address', '$city', '$state', '$zip', 
>'$phone', '$fax', '$model', '$country', '$details', '$type');
> > >
> > > MYSQL_CLOSE();
> > >
> > > ?>
> > >
> > > Thanks, also if you know any tutorials for PHP and MySQL
> > >
> > > Shawn
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




Can anyone please recommend me a cheap hosting service which supports PHP
and MySQL on Linux/BSD?  I need a place for www.couponvine.com.  Also any
joint venture proposal is welcomed.  Thank you.




I'm putting together a shopping cart that will be hit from two different web
sites and I would like to track where the order came from by setting a
cookie.

Is there an environmental variable that I could pull instead of giving each
web site a different url to point to the shopping cart? I've tried using the
following;

if (!isset($parasite))
{
  $parasite = getenv ("REMOTE_HOST");
  setcookie("reffrom",$parasite,time()+86400,"/",".flylikeaneagle.com");
}

That seems to set the browsers ip address not the ip address of the server
that's hosting one of the two sites that will be using the shopping cart.

Any help would be appreciated,
Tom

>>.>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>>
Tom Beidler
Orbit Tech Services
805.682.8972 (phone)
805.682.5833 (fax)
[EMAIL PROTECTED]
http://www.orbittechservices.com/
>>.>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>>






In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Tom Beidler) wrote:

>   $parasite = getenv ("REMOTE_HOST");
>   setcookie("reffrom",$parasite,time()+86400,"/",".flylikeaneagle.com");
> }
> 
> That seems to set the browsers ip address not the ip address of the server
> that's hosting one of the two sites that will be using the shopping cart.

phpinfo();

-- 
CC




<?php

 if (isset($PATH_INFO))
 {
  $var = explode('/', $PATH_INFO);
  for($c = 1; $c < count($var); $c += 2)
  {
   $$var[$c] = $var[$c + 1];
   $HTTP_GET_VARS[$var[$c]] = $var[$c + 1];
  }
 }

 function fix_session($output)
 {
  global $SID;

  $o_sid = '?'. $SID;
  $n_sid = '/'. str_replace('=', '/', $SID);

  $output = substr_count($output, $o_sid) .'<br>'. str_replace($o_sid, $n_sid, 
$output);
  return $output;
 }

 ob_start('fix_session');

?>

I am prepending this file and Im not getting the results I want. the substr_count is 
there just to show me how many instances its going to replace. well the answer is 11, 
there are 11 hard coded link.php?$SID and the rest (aprox 20) are all left upto 
trans-sid. they do not get replaced, the other hardcoded 11 do though as expected. how 
can I convert the trans-sid ones? without hardcoding every single link... ? thats alot 
of links and forms I have to replace....


-- 

 Chris Lee
 [EMAIL PROTECTED]







Dan Lowe wrote:

>     // List of variable names
>     $var_list = array ( 'var1', 'var2', 'var3', 'var4' );
>
>     while (list($key,$val) = each($var_list)) {
>         if ($$val == '') {
>             $url .= "&".$val."=";
>             $error = 1;
>         } else {
>             $url .= "&".$val."=". urlencode(stripslashes($$val)) ."";
>         }
>     }

    Goodie.  This is what I needed (as opposed to looping through the POST
Array because not all of them are being evaluated as blank.  Some of them
actually have something in them and I have to eval those differently.

    AMK4

--
W |
  |  I haven't lost my mind; it's backed up on tape somewhere.
  |____________________________________________________________________
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
  SysAdmin / Websmith                           .     800.441.3873 x130
  Photo Craft Laboratories, Inc.             .        eFax 248.671.0909
  http://www.pcraft.com                  .         3550 Arapahoe Ave #6
  .................. .  .  .     .               Boulder, CO 80303, USA






Can You figure out the mistake here...??

In the following code... In the function print_entry which I am calling in some other 
file, I want each entry to printed in a different colour.

$colour = array("808080","800000","FF00FF","0000FF","008080");
$colouroffset=0;


function print_entry($row,$preserve="")
{

    // walk through any arguments passed in after the first two
    $numargs = func_num_args();
    for ($i = 2; $i < $numargs; $i++)
    {
        $field = func_get_arg($i);

        // This will transform a label string to a valid database 
        // field name - e.g., "Last Name" becomes "last_name"
        $dbfield = str_replace(" ", "_", strtolower($field));

        $dbvalue = cleanup_text($row[$dbfield],$preserve);
        $name = ucwords($field);

        print <<<EOQ
        <tr>\n
        <td valign=top align=right><b><font 
color="#$colour[$colouroffset]">$name:</font></b></td>\n  // The problem is here.. the 
value of $colour[$colouroffset] is not             <td valign=top align=left><font 
color="#$colour[$colouroffset]">$dbvalue</font></td>\n               // getting 
substituted.  Can you tell me why??
        </tr>\n\n
        EOQ;
    }    

    $colouroffset++;
}

Subodh Gupta
I have learned, Joy is not in things, it is in us.
You will ultimately be known by what you give and not what you get.





Since $colour is assigned outside the function, it is in the global scope.
Add the line "global $colour;" to the function to use $colour in the
function's local scope.

Kirk

> -----Original Message-----
> From: Subodh Gupta [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 24, 2001 11:54 AM
> To: PHP General
> Subject: [PHP] A simple problem!
> 
> 
> Can You figure out the mistake here...??
> 
> In the following code... In the function print_entry which I 
> am calling in some other file, I want each entry to printed 
> in a different colour.
> 
> $colour = array("808080","800000","FF00FF","0000FF","008080");
> $colouroffset=0;
> 
> 
> function print_entry($row,$preserve="")
> {
> 
>     // walk through any arguments passed in after the first two
>     $numargs = func_num_args();
>     for ($i = 2; $i < $numargs; $i++)
>     {
>         $field = func_get_arg($i);
> 
>         // This will transform a label string to a valid database 
>         // field name - e.g., "Last Name" becomes "last_name"
>         $dbfield = str_replace(" ", "_", strtolower($field));
> 
>         $dbvalue = cleanup_text($row[$dbfield],$preserve);
>         $name = ucwords($field);
> 
>         print <<<EOQ
>         <tr>\n
>         <td valign=top align=right><b><font 
> color="#$colour[$colouroffset]">$name:</font></b></td>\n  // 
> The problem is here.. the value of $colour[$colouroffset] is 
> not             <td valign=top align=left><font 
> color="#$colour[$colouroffset]">$dbvalue</font></td>\n        
>        // getting substituted.  Can you tell me why??
>         </tr>\n\n
>         EOQ;
>     }    
> 
>     $colouroffset++;
> }
> 
> Subodh Gupta
> I have learned, Joy is not in things, it is in us.
> You will ultimately be known by what you give and not what you get.
> 
> 




your variable scope is local not the function

function name()
{
    global $variable;

}


-- 

 Chris Lee
 [EMAIL PROTECTED]


""Subodh Gupta"" <[EMAIL PROTECTED]> wrote in message 
002b01c0cce9$aa670b60$c834d6d2@subodhgu">news:002b01c0cce9$aa670b60$c834d6d2@subodhgu...
Can You figure out the mistake here...??

In the following code... In the function print_entry which I am calling in some other 
file, I want each entry to printed in a different colour.

$colour = array("808080","800000","FF00FF","0000FF","008080");
$colouroffset=0;


function print_entry($row,$preserve="")
{

    // walk through any arguments passed in after the first two
    $numargs = func_num_args();
    for ($i = 2; $i < $numargs; $i++)
    {
        $field = func_get_arg($i);

        // This will transform a label string to a valid database 
        // field name - e.g., "Last Name" becomes "last_name"
        $dbfield = str_replace(" ", "_", strtolower($field));

        $dbvalue = cleanup_text($row[$dbfield],$preserve);
        $name = ucwords($field);

        print <<<EOQ
        <tr>\n
        <td valign=top align=right><b><font 
color="#$colour[$colouroffset]">$name:</font></b></td>\n  // The problem is here.. the 
value of $colour[$colouroffset] is not             <td valign=top align=left><font 
color="#$colour[$colouroffset]">$dbvalue</font></td>\n               // getting 
substituted.  Can you tell me why??
        </tr>\n\n
        EOQ;
    }    

    $colouroffset++;
}

Subodh Gupta
I have learned, Joy is not in things, it is in us.
You will ultimately be known by what you give and not what you get.







On Tue, Apr 24, 2001 at 11:24:26PM +0530, Subodh Gupta wrote:
> Can You figure out the mistake here...??
> 
>         print <<<EOQ
>         <tr>\n
>         <td valign=top align=right><b><font 
>color="#$colour[$colouroffset]">$name:</font></b></td>\n  // The problem is here.. 
>the value of $colour[$colouroffset] is not             <td valign=top 
>align=left><font color="#$colour[$colouroffset]">$dbvalue</font></td>\n               
>// getting substituted.  Can you tell me why??
>         </tr>\n\n
>         EOQ;

This is more than likely due to the variable being enclosed in ""'s,
although I can't say for sure, as I've never used print() in this manner.

Try adding the '#' to the actual $colour[$colouroffset] value, then simply
replace "#$colour[$colouroffset]" with $colour[$colouroffset].




Hi,

     I am having a problem in link variables in netscape.  etc.
www.domain.com?xx=1&xxx=2&xxxx=mark lo&xxxee=polol

if the above link contains space, then everyting is faded after the space,
how to over come this problem in netscape.  In IE5, it is okay to have space
in link variables.

Thank you


Mark





IE may tolerate it, but you should transpose those spaces into the URL
encoded equiv.  I think this is %20 for a space, but check your hex table to
be sure.

Here is your function to do this.

http://www.php.net/manual/en/function.urlencode.php


IE tolerates a lot of slack programming.  Netscape tells it like it should
be so us it for testing your code along with IE.

John

> -----Original Message-----
> From: Mark Lo [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 24, 2001 2:23 PM
> To: *PHP mail list
> Subject: [PHP] link variables space problem in netscape
>
>
> Hi,
>
>      I am having a problem in link variables in netscape.  etc.
> www.domain.com?xx=1&xxx=2&xxxx=mark lo&xxxee=polol
>
> if the above link contains space, then everyting is faded after the space,
> how to over come this problem in netscape.  In IE5, it is okay to
> have space
> in link variables.
>
> Thank you
>
>
> Mark
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





At 02:23 AM 4/25/01 +0800, Mark Lo wrote:
>Hi,
>
>      I am having a problem in link variables in netscape.  etc.
>www.domain.com?xx=1&xxx=2&xxxx=mark lo&xxxee=polol
>
>if the above link contains space, then everyting is faded after the space, 
>how to over come this problem in netscape.  In IE5, it is okay to have 
>spacein link variables.

   The proper way to phrase "In IE5, it is okay to have spaces in link 
variables" is

"IE5, which doesn't follow the specifications of the language, works with 
spaces embedded in the links.  Netscape, which follows (at least that part 
of) the HTML specification, disallows embedded spaces in links."

   Meanwhile, try the urlencode() and urldecode() functions. :)

>Thank you

   Welcome.


  -------------------------------------
    Brian S. Dunworth
    Sr. Software Development Engineer
    Oracle Database Administrator
    The Printing House, Ltd.

    (850) 875-1500  x225
    <[EMAIL PROTECTED]>
  -------------------------------------





urlencode() will turn a space into "+".  If you want the real full codes
like "%20" you need to use rawurlencode() instead.

    http://www.php.net/manual/en/function.rawurlencode.php

 -dan

Previously, John Huggins said:
> IE may tolerate it, but you should transpose those spaces into the URL
> encoded equiv.  I think this is %20 for a space, but check your hex table to
> be sure.
> 
> Here is your function to do this.
> 
> http://www.php.net/manual/en/function.urlencode.php

-- 
Never underestimate the power of stupid people in large groups.
                                            -George Carlin




Two words:

URL Encode.



>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 4/24/01, 11:23:02 AM, "Mark Lo" <[EMAIL PROTECTED]> wrote regarding 
[PHP] link variables space problem in netscape:


> Hi,

>      I am having a problem in link variables in netscape.  etc.
> www.domain.com?xx=1&xxx=2&xxxx=mark lo&xxxee=polol

> if the above link contains space, then everyting is faded after the 
space,
> how to over come this problem in netscape.  In IE5, it is okay to have 
space
> in link variables.

> Thank you


> Mark


> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




> Two words:
> URL Encode.

Actually, one word: urlencode();

heheheh

Chris




"Tomas V.V.Cox" wrote:
> $row = $db_result->fetchRow($fetchmode, $row_number_to_fetch);

  Thanks.

> This feature is unsupported in oci8 and ibase :-(

  As of now, I can live with that.

-- 
 sebastian bergmann                            [EMAIL PROTECTED]
                                       http://www.sebastian-bergmann.de

 bonn.phpug.de | www.php.net | www.phpOpenTracker.de | www.titanchat.de




IS there a standard way of "auto-updateing" the contents of a page after a 
databas insert or edit? Do a SELECT updates the contents I can update 
tables I've noticed. Contents in select boxes (as in

 while ($row = mysql_fetch_row($secquery_res)) {
                    print "<option>$row[0]</option>";
                  }
)

is not automatically updated to match edits or inserts done on the same 
page. You have to initialize the select box again. Or is there another way?

M.




Hitting refresh would do it, you cant do anything client wise because the
box is being filled by the server code
----- Original Message -----
From: "Martin Skjöldebrand" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 24, 2001 3:53 PM
Subject: [PHP] Autoupdate of page


> IS there a standard way of "auto-updateing" the contents of a page after a
> databas insert or edit? Do a SELECT updates the contents I can update
> tables I've noticed. Contents in select boxes (as in
>
>  while ($row = mysql_fetch_row($secquery_res)) {
>                     print "<option>$row[0]</option>";
>                   }
> )
>
> is not automatically updated to match edits or inserts done on the same
> page. You have to initialize the select box again. Or is there another
way?
>
> M.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>







Hey Guys,
it's my first post on this list, and my doubt is...

how can i take a file.txt and

1 - know how many lines i have in this text
2 - print line 5 until 10

?

can someone help me?





---

[ r a f a e l   f a r i a] _____________________
[EMAIL PROTECTED]
WebMaster Universo Online - http://www.uol.com.br
Phone # +55 11 3038-8665





If you use the file() function to open up the file, it will put each 
line of the file into an array.  At that point you can say:

for($i=5;$i<11;$i++){

print $myFile[$i];

}


Michael


Rafael Faria wrote:

>
>
> Hey Guys,
> it's my first post on this list, and my doubt is...
>
> how can i take a file.txt and
>
> 1 - know how many lines i have in this text
> 2 - print line 5 until 10
>
> ?
>
> can someone help me?
>
>
>
>
>
> ---
>
> [ r a f a e l   f a r i a] _____________________
> [EMAIL PROTECTED]
> WebMaster Universo Online - http://www.uol.com.br
> Phone # +55 11 3038-8665
>
>







But how can i put into a var $total the total lines that i have into the file?

Rafael

>f you use the file() function to open up the file, it will put each line 
>of the file into an array.  At that point you can say:
>
>for($i=5;$i<11;$i++){
>
>print $myFile[$i];
>
>}
>
>
>Michael
>
>
>Rafael Faria wrote:
>
>>
>>
>>Hey Guys,
>>it's my first post on this list, and my doubt is...
>>
>>how can i take a file.txt and
>>
>>1 - know how many lines i have in this text
>>2 - print line 5 until 10
>>
>>?
>>
>>can someone help me?
>>
>>
>>
>>
>>
>>---
>>
>>[ r a f a e l   f a r i a] _____________________
>>[EMAIL PROTECTED]
>>WebMaster Universo Online - http://www.uol.com.br
>>Phone # +55 11 3038-8665
>>
>
>
>

---

[ r a f a e l   f a r i a] _____________________
[EMAIL PROTECTED]
WebMaster Universo Online - http://www.uol.com.br
Phone # +55 11 3038-8665





> > If you use the file() function to open up the file, it will 
> > put each line of the file into an array.  At that point you 
> > can say:
> But how can i put into a var $total the total lines that i 
> have into the file?

After you've used the file() function as suggestion above,
the total number of lines in the file is:

count( $myFile );

Chris




$Data = file("data.dat");
$Total = count($data);

That would get the lines from the file and give $total the number of lines.
----- Original Message -----
From: "Rafael Faria" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 24, 2001 4:03 PM
Subject: Re: [PHP] Lines


> But how can i put into a var $total the total lines that i have into the
file?
>
> Rafael
>
> >f you use the file() function to open up the file, it will put each line
> >of the file into an array.  At that point you can say:
> >
> >for($i=5;$i<11;$i++){
> >
> >print $myFile[$i];
> >
> >}
> >
> >
> >Michael
> >
> >
> >Rafael Faria wrote:
> >
> >>
> >>
> >>Hey Guys,
> >>it's my first post on this list, and my doubt is...
> >>
> >>how can i take a file.txt and
> >>
> >>1 - know how many lines i have in this text
> >>2 - print line 5 until 10
> >>
> >>?
> >>
> >>can someone help me?
> >>
> >>
> >>
> >>
> >>
> >>---
> >>
> >>[ r a f a e l   f a r i a] _____________________
> >>[EMAIL PROTECTED]
> >>WebMaster Universo Online - http://www.uol.com.br
> >>Phone # +55 11 3038-8665
> >>
> >
> >
> >
>
> ---
>
> [ r a f a e l   f a r i a] _____________________
> [EMAIL PROTECTED]
> WebMaster Universo Online - http://www.uol.com.br
> Phone # +55 11 3038-8665
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Hello all!

I would like to know if anyone has or know any PHP code to verify if a form entered 
e-mail address is valid?

I would like that things like 4$%^%$@@.com.br could not be sent. I only has to verify 
the syntax of it, the existance I believe should be harder to verify but if it is 
possible I would be glad if anyone could point me the way.

Thanks,

Carlos Fernando.




Carlos Fernando Scheidecker Antunes wrote:

> Hello all!
> 
> I would like to know if anyone has or know any PHP code to verify if a
> form entered e-mail address is valid?
> 
> I would like that things like 4$%^%$@@.com.br could not be sent. I only
> has to verify the syntax of it, the existance I believe should be harder
> to verify but if it is possible I would be glad if anyone could point me
> the way.

This is taken from PHP Developers Cookbook. Don't ask me exactly what it 
does, because I don't know. I think I can grasp the basics of it though.
It isn't fool proof tho.


if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", 
$users)) die ("Invalid email");

M.





I'd like to add to that, before someone spends a lifetime searching for an
answer ...

"Solution: There isn't one. You cannot do real-time validation of mail
addresses. You must pick from a number of compromises."

The section goes on describing how many RFC-valid addresses are
undeliverable and on the opposite side of the coin, some RFC-invalid
addresses are perfectly deliverable.

"Our best advice for verifying a person's mail address is to have them enter
their address twice, just as you would when changing a password."

- Chris

> > I would like to know if anyone has or know any PHP code to verify if a
> > form entered e-mail address is valid?
> >
> > I would like that things like 4$%^%$@@.com.br could not be sent. I only
> > has to verify the syntax of it, the existance I believe should be harder
> > to verify but if it is possible I would be glad if anyone could point me
> > the way.
>
> This is taken from PHP Developers Cookbook. Don't ask me exactly what it
> does, because I don't know. I think I can grasp the basics of it though.
> It isn't fool proof tho.
>
>
> if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$",
> $users)) die ("Invalid email");





H-

If you're wanting to do it *before* the user sends the form than
javascript is the way to go. 

http://developer.irt.org/script/email.htm

It's the very first FAQ. #122. 
-Sterling


Carlos Fernando Scheidecker Antunes wrote:
> 
> Hello all!
> 
> I would like to know if anyone has or know any PHP code to verify if a form entered 
>e-mail address is valid?
> 
> I would like that things like 4$%^%$@@.com.br could not be sent. I only has to 
>verify the syntax of it, the existance I believe should be harder to verify but if it 
>is possible I would be glad if anyone could point me the way.
> 
> Thanks,
> 
> Carlos Fernando.




Actually, you can check the validity of the SMTP port to semi-validate the
domain.  The name of the recipient would be harder, but again, through
your standard "user does not exist" error messages/codes, you could
tell if the domain is valid, but the user is not.

Checking to see if it's "syntactically correct" is trivial.  Validating the
domain
is rather simple as well (check the retcode on a whois lookup.)  Validating
the user would require interpretation of the return mail message(s).

Again, it's not "real-time" validation of anything except the
existance/validity
of the domain - not the user.

'Luck

-Szii


----- Original Message -----
From: "christopher hamilton" <[EMAIL PROTECTED]>
To: "Martin Skjoldebrand" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, April 24, 2001 1:39 PM
Subject: RE: [PHP] checking if e-mail address and syntax are valid


>
> I'd like to add to that, before someone spends a lifetime searching for an
> answer ...
>
> "Solution: There isn't one. You cannot do real-time validation of mail
> addresses. You must pick from a number of compromises."
>
> The section goes on describing how many RFC-valid addresses are
> undeliverable and on the opposite side of the coin, some RFC-invalid
> addresses are perfectly deliverable.
>
> "Our best advice for verifying a person's mail address is to have them
enter
> their address twice, just as you would when changing a password."
>
> - Chris
>
> > > I would like to know if anyone has or know any PHP code to verify if a
> > > form entered e-mail address is valid?
> > >
> > > I would like that things like 4$%^%$@@.com.br could not be sent. I
only
> > > has to verify the syntax of it, the existance I believe should be
harder
> > > to verify but if it is possible I would be glad if anyone could point
me
> > > the way.
> >
> > This is taken from PHP Developers Cookbook. Don't ask me exactly what it
> > does, because I don't know. I think I can grasp the basics of it though.

> > It isn't fool proof tho.
> >
> >
> > if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$",
> > $users)) die ("Invalid email");
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





Hi, All -

Have altered extension of all relevant php3 files to php. Now I have a
case of "code bleed"  when the php pages are called. The actual page
doesn't come up, but its source does.
Ideas? clues? suggestions?

Thanks in advance,

Alpha




That means the server isnt set to parse files with a .php extension. You'll
have to fix the associations in your server settings
----- Original Message -----
From: "S.J. Black" <[EMAIL PROTECTED]>
To: "PHP mail list" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, April 24, 2001 4:17 PM
Subject: [PHP] OK, a little more specific migration issues.


> Hi, All -
>
> Have altered extension of all relevant php3 files to php. Now I have a
> case of "code bleed"  when the php pages are called. The actual page
> doesn't come up, but its source does.
> Ideas? clues? suggestions?
>
> Thanks in advance,
>
> Alpha
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>





"S.J. Black" <[EMAIL PROTECTED]> wrote:

 > Hi, All -
 > 
 > Have altered extension of all relevant php3 files to php. Now I have a
 > case of "code bleed"  when the php pages are called. The actual page
 > doesn't come up, but its source does.
 > Ideas? clues? suggestions?

Your webserver probably dont understand that your script is of thetype
php and therefor dont execute the parser on your script, check your
webservers configuration file. Are you sure you have :
AddType application/x-httpd-php .php in you cont (for apache only) and
not just :
AddType application/x-httpd-php .php3 ?

maybe it helps

-- 
Henrik Hansen





Hi. 

This will probably sound simple to all of you but I am hitting my head on
a brick wall so far :-).

I need to generate a list (sorted by descending time) of different objects
referenced in multiple tables. All those objects share a key related to a
project.


This works splendidly from a single table :




$sql="select * from storyboards, where spot_id = \"$spot_id\" order by
date_posted desc";
$result=MySQL_query($sql,$db);
while($row=MySQL_fetch_array($result))
{
$qt_title = $row["title"];
$qt_duration = $row["duration"];
$qt_date_posted = $row["date_posted"]; //(timestamp)
$qt_description = $row["description"];
$qt_id = $row["quicktime_id"];
                                                                                       
    

}

Is there a mysql query that would allow me to stack complete rows in
multiple tables at once (It seems more elegant because I can sort them
while extracting them) or is there a way in PHP to concatenate results in
a single array and then sort them by time... ?

I tried to use a join query, wich produced an invalid query error. (I
think it tries to produce a table with merged data, not just a stack of
rows).
 

$sql4="select * from quicktimes, other_images, storyboards, where
quicktimes.spot_id, other_images.spot_id, storyboards.spot_id =
\"$spot_id\" order by date_posted desc";

thank you for your help !
nicolas




Hello all.
Can you tell me, how can I check url address?
Also I want to know error, which return.
     Dmitry






Hi jacky,

put an empty square bracket after the variable name as follows:
<input type="checkbox" name="id[ ]" value="$id">

assuming that your above statement is in a loop we will have following
structure:
*********************************
<form>
<input type="checkbox" name="id[ ]" value="$id">
<input type="checkbox" name="id[ ]" value="$id">
<input type="checkbox" name="id[ ]" value="$id">
etc...

<submit button>

</form>
************************************
now when you submit the form, an array named id[ ] will be posted .
this array will contain the number of elements/checkbox  which were checked
on.
so out of 25 checkboxes if you select only 5 checkboxes, then the size of
the array id[ ] will be only 5.

so with another loop you can retrieve all the values as follows:
***********************************
$i=0;
while($i<sizeof($id):

    $id[$i]=="blah";

    $i++;

endwhile;
***********************************

sorry for the poor explanation but i hope this will serve your purpose. if
you have any queries with this feel free to contact me.

regards

keyur
$$$$$$$


----- Original Message -----
From: "Jacky" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 19, 2001 1:13 AM
Subject: [PHP] checkbox validation


Hi all
I have a form with the checkbox like this
<form>
$query="select id from foo";
$result=($query,$con);
while ($row = mysql_fetch_array($result))
     {
<input type="checkbox" name="$id" value="on">
     }
....submit button and stuffs here...
</form>

After I submit to next page, at next page, how do I check which check box is
checked?
like this?

if ($id=="on") {
do something
}else{
do something
}

I did try this but did not work, what am i suppose to do to achieve this?
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"






I have about 20 virtual hosts on my server and all of them have shtml and
some php files that look to a directory /includes/ which is aliased (in the
srm.conf file) over to a main includes directory under the root dir.

Alias /includes/ /usr/local/etc/httpd/htdocs/includes/

If I change this alias to a directory above the root dir, I can still view
all of my .inc files in a browser even if I rename them to .inc.php

These .inc files are just plain text that get included into all .shtml files
on the virtual hosts.

I tried to do the deny *.inc but doing so just made it so the browser can't
even include them. So that won't do the trick.

Is there any way that I can make these .inc files not readable by viewing
them directly in the browser and still be able to include them into
documents? Same goes for the php config stuff. If I put a config.php script
above the root, how can I get the php script to read it -- is it the same
'ol /usr/etc/httpd/ sort of thing like cgi?

My main concern is to get this stuff more secure while still allowing all of
the virtual hosts to use the files. The contents of the files isn't exactly
top secret, its just a matter of a piece of mind.

Any ideas to sort this out are greatly appreciated! Thanks.
__________________
Jason Dulberg
Extreme MTB
http://extreme.nas.net





> I tried to do the deny *.inc but doing so just made it so the browser can't
> even include them. So that won't do the trick.

Uh, what?  Aren't these .inc files included by PHP scripts?  PHP has no
way of knowing whether you are denying access to them from the httpd.conf
level with a proper deny rule.

For example, I have a site where I want all the *.inc files in my
DocumentRoot directory to be inacessible, but in other directories I want
them to be viewable.  So I use a rule like this:

<LocationMatch "^/[^/]*.inc">
    Order allow,deny
    Deny from all
</LocationMatch>

Works perfectly.

-Rasmus





I have an Apache Web server running on a Linux server with OpenSSL and all
that good stuff.  The HTTPS works just fine.  Now, many software companies
would like to add new features into their software so that their application
(written in VB, C and who  knows what other languages) can create a text
file dump of their information and transfer the file to us over a secure
connection.  They (the software companies) don't want to have their
application interface with a browser as they don't know what browser their
customer uses and don't want to deal with the differences between them.

Bottom line- Is there a way that an application (not browser-based) can
transfer a file to my web server over HTTPS without going through the
browser?  Can they just open a connection on port 443 and transfer?  Where
does the encryption happen?  I have this happening easily through a browser
via a PHP script, but now I need to figure out how to do it without the
browser interface.

Any help is appreciated

Michael Conley





> Bottom line- Is there a way that an application (not browser-based) can
> transfer a file to my web server over HTTPS without going through the
> browser?  Can they just open a connection on port 443 and transfer?  Where
> does the encryption happen?  I have this happening easily through a browser
> via a PHP script, but now I need to figure out how to do it without the
> browser interface.

There is a command-line tool called curl that can do this.

See http://curl.haxx.se/docs/readme.curl.html

-Rasmus





I have gone through this documentation, but I don't see how to do what I
want to do.

My goal is to have someone on a Windows machine running a program be able to
transfer a file from the client workstation to my web server over HTTPS (but
without a browser).  With CURL, does the client need to run this app on
their system?  Of course, I would like this to be as simple and
non-intrusive as possible.

-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 24, 2001 2:25 PM
To: Michael Conley
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP] File Transfer over HTTPS


> Bottom line- Is there a way that an application (not browser-based) can
> transfer a file to my web server over HTTPS without going through the
> browser?  Can they just open a connection on port 443 and transfer?  Where
> does the encryption happen?  I have this happening easily through a
browser
> via a PHP script, but now I need to figure out how to do it without the
> browser interface.

There is a command-line tool called curl that can do this.

See http://curl.haxx.se/docs/readme.curl.html

-Rasmus




> My goal is to have someone on a Windows machine running a program be able to
> transfer a file from the client workstation to my web server over HTTPS (but
> without a browser).  With CURL, does the client need to run this app on
> their system?  Of course, I would like this to be as simple and
> non-intrusive as possible.

Yes, they would.  The SSL protocol is complex involving a key exchange and
then encryption done client-side.  You are going to have to run something
on the client to do this.

-Rasmus





If I wanted to use this utility to copy a file from a users (Windows)
workstation to my (Linux) webserver, how would I do this?  The program on
the users workstation will create a file called "info.txt" and place it in
c:\wow.  I want it to go to my server upload.mydomain.com.  How do I get the
file c:\wow\info.txt from the user to my web server over https?  

-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 24, 2001 2:45 PM
To: Michael Conley
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP] File Transfer over HTTPS


> My goal is to have someone on a Windows machine running a program be able
to
> transfer a file from the client workstation to my web server over HTTPS
(but
> without a browser).  With CURL, does the client need to run this app on
> their system?  Of course, I would like this to be as simple and
> non-intrusive as possible.

Yes, they would.  The SSL protocol is complex involving a key exchange and
then encryption done client-side.  You are going to have to run something
on the client to do this.

-Rasmus




Hey guys!
I'm writing a guestbook with mysql. My probblem is that when user enter at long word 
like blablablablablablablablablablablabla my html-tables gets screwed up. If someone 
is just fooling around the whole page design can be destroyed. I want to know how I 
can make sure that no word is longer than x characters. If a word should be longer 
than that, I would like the word divided into smaller parts with a - character at the 
end of the first word like this:

"this is a text in the guestbook.
if there is a really long word
like blablablablablablablabla-
blablabla it is divided into
smaller parts and a - char
is added to the first word."

I thought about reading the whole message into an array, and then loop through it and 
for each word check whether it is larger than x chars, and if so, change it. But 
couldn't that be a very memory consuming script if it should do that for every 
message? Anyone knows how I could do this?




Jimmy Bäckström <[EMAIL PROTECTED]> wrote:

 > I thought about reading the whole message into an array, and then loop through it 
 >and for each word check whether it is larger than x chars, and if so, change it. But 
 >couldn't that be a very memory consuming script if it should do that for every 
 >message? Anyone knows how I could do this?

Dont! look at the wordwrap function, in short in works like this:

echo wordwrap ($body, $length, "<br>");

read more here:

http://www.php.net/manual/en/function.wordwrap.php

-- 
Henrik Hansen





H-

I've been able to escape the 'space' character in a variable so it can
be safely passed through a URL but I'm having trouble finding anything
that works for escaping the '&' ampsand. 

Here is a snippet of code. 

$topic = "Aerospace & Commercial Space";

$link_value = str_replace("&", '%26', $topic);
$link_value = str_replace(' ', '%20', $topic);


Here's the strange part. 
If the "ampersand replace" is in front of the "space replace" the "space
replace" gets done but the ampersand doesn't. 

If the "ampersand replace" is done after the "space replace" the
ampersand get's replaced but the spaces do not. 

So for the code above the %20 was replaced but the & remained &.

I split the lines up for simplicity. Is that's what's causing the
problems? 
What am I missing here? 
Very confusing. 
Thanks for any info any one might have on this. 

Thoughts, Comments, Anecdotes? 
-Sterling




Sterling wrote:
> $topic = "Aerospace & Commercial Space";
>
> $link_value = str_replace("&", '%26', $topic);
> $link_value = str_replace(' ', '%20', $topic);

This should be
$link_value = str_replace("&", '%26', $topic);
$link_value = str_replace(' ', '%20', $link_value);

Anyway, this is this wrong way to go about it.
This line
$link_value = rawurlencode($topic);
will do the whole job.

regards
Wagner

-- 
"In place of infinity we usually put some really big number, like 15."
 - Anonymous Computer Science professor





> I've been able to escape the 'space' character in a variable so it can
> be safely passed through a URL but I'm having trouble finding anything
> that works for escaping the '&' ampsand.

php.net/urlencode

as for your code:

> $topic = "Aerospace & Commercial Space";
>
> $link_value = str_replace("&", '%26', $topic);
> $link_value = str_replace(' ', '%20', $topic);

You are using $topic both times.  Your second line should be:

  $link_value = str_replace(' ', '%20', $link_value);

-Rasmus





H-

Thank you very much!

I feel kinda dumb.
I think I'll take a break. 6 hours in front of a monitor is too much.
8^) 

Thanks for the assist. rawurlencode worked great. 
-Sterling


Alexander Wagner wrote:
> 
> Sterling wrote:
> > $topic = "Aerospace & Commercial Space";
> >
> > $link_value = str_replace("&", '%26', $topic);
> > $link_value = str_replace(' ', '%20', $topic);
> 
> This should be
> $link_value = str_replace("&", '%26', $topic);
> $link_value = str_replace(' ', '%20', $link_value);
> 
> Anyway, this is this wrong way to go about it.
> This line
> $link_value = rawurlencode($topic);
> will do the whole job.
> 
> regards
> Wagner
> 
> --
> "In place of infinity we usually put some really big number, like 15."
>  - Anonymous Computer Science professor




Hello everybody,

I am facing a strange problem while uploading and displaying images in a
database table.

I have taken blob field to store the images.

Images which are less then around 100kb are stored & displayed properly but
images which are greater than 100kb are giving problems while displaying
although no errors were generated while inserting them in database.

what could be the problem ? is it due to the blob type ?

i am using the following statements to insert the file to database.

insert.php
***********************************
$imgsize=GetImageSize($photofile);
$photo=addslashes(fread(fopen($photofile, "r"), filesize($photofile)));
$query="insert into photo(photoformat,photo,photowidth,photoheight) values
('$photoformat','$photo',$imgsize[0],$imgsize[1])";

$photoformat, $photofile are the input fields of the form which is
submitted.

***********************************

in my html pages i use the following <img> :

<img src=display.php?id=1>

and my display.php is as follows:

display.php
***********************************
$query="select * from photo where id='$id'";
$result=mysql_query($query);
$photo_rec=mysql_fetch_array($result);
Header( "Content-type: image/$photo_rec[photoformat]; name=".microtime());
echo $photo_rec["photo"];

***********************************


Thanks in advance

Keyur
$$$$$$$







Hello everybody,

I am facing a strange problem while uploading and displaying images in a
database table.

I have taken blob field to store the images.

Images which are less then around 100kb are stored & displayed properly but
images which are greater than 100kb are giving problems while displaying
although no errors were generated while inserting them in database.

what could be the problem ? is it due to the blob type ?

i am using the following statements to insert the file to database.

insert.php
***********************************
$imgsize=GetImageSize($photofile);
$photo=addslashes(fread(fopen($photofile, "r"), filesize($photofile)));
$query="insert into photo(photoformat,photo,photowidth,photoheight) values
('$photoformat','$photo',$imgsize[0],$imgsize[1])";

$photoformat, $photofile are the input fields of the form which is
submitted.

***********************************

in my html pages i use the following <img> :

<img src=display.php?id=1>

and my display.php is as follows:

display.php
***********************************
$query="select * from photo where id='$id'";
$result=mysql_query($query);
$photo_rec=mysql_fetch_array($result);
Header( "Content-type: image/$photo_rec[photoformat]; name=".microtime());
echo $photo_rec["photo"];

***********************************


Thanks in advance

Keyur
$$$$$$$






Hi.

Yesterday an email-virus entitled Emanuel was sent out over this list, and I am not 
sure by who. It came in the form of Emanuel.exe, and had an icon resembling that of a 
standalone flash projector file (pink diamond with a white multi-pointed asterisk-type 
thing in the middle).

This virus appears to be a backorifice or netbus style virus, and adds something to a 
system file that makes it so that *every* time you try to launch a program, it 
launches "Wintask.exe", which is *not* an official task, despite the name. It puts a 
green ICQ flower in your taskbar, and if you click it, a button pops up that says 
"Nunca <bla bla> esta button". The <bla bla> is because I forget the word for "push" 
in spanish, and I'm not about to open this program again -- It translates to "NEVER 
PUSH THE BUTTON" -- and trust me, *don't*, this, i have found, is what activates the 
virus.

I may have lost several weeks of work to this virus, and I advise you all to watch 
out, as it was likely sent inadvertantly.




Hello,

How can I include any html or php file via .htaccess .

I want to include an html file in a site contaning around 1000 pages. I want
to add  header & footer dynamically on these pages . Is there any way to
include header & footer on these pages using .htaccess file.


thanks in advance

keyur
$$$$$$$





Hello,

How can I include any html or php file via .htaccess .

I want to include an html file in a site contaning around 1000 pages. I want
to add  header & footer dynamically on these pages .
Is there any way to include header & footer on these pages using .htaccess
file.


thanks in advance

keyur
$$$$$$$






> How can I include any html or php file via .htaccess .
>
> I want to include an html file in a site contaning around 1000 pages. I want
> to add  header & footer dynamically on these pages .
> Is there any way to include header & footer on these pages using .htaccess
> file.

php_value auto_prepend_file header.html
php_value auto_append_file footer.php

-Rasmus





         Hi again,
have somewhere that i can find a chat that connect with irc server?



---

[ r a f a e l   f a r i a] _____________________
[EMAIL PROTECTED]
WebMaster Universo Online - http://www.uol.com.br
Phone # +55 11 3038-8665





Rafael Faria <[EMAIL PROTECTED]> wrote:

 >          Hi again,
 > have somewhere that i can find a chat that connect with irc server?

http://phpwizard.net/projects/phpIRC/

-- 
Henrik Hansen





I do

$var apache_lookup_uri("file");

echo $var['uri'] ; or anything else, I get nothing, so I do

var_dump($var['uri']);//is Null but...

var_dump($var);//everything is there?


help 





> $var apache_lookup_uri("file");

What is your exact line?  It obviously isn't that.

Something like:

  $var = apache_lookup_uri("/path/file.html");

should work just fine.  You need to pass this function a URI.  A URI being
the part of a URL after the hostname but including the leading /

-Rasmus





Hi PHPers,


I noticed that you have to use keyword "global" in front of globla var.- (one declared 
at the top of a  script outside any functions ) in order to access it inside a 
function. So merely designating a var. global is a little more involved than say Perl 
or other languages. You actually have to tell PHP that the function is global.

I see functions , are there subroutine calls. I guess not.     A function acts as a 
sub when it returns no value . A sub that returns a value is a function.


Thanks

Dexter






> I noticed that you have to use keyword "global" in front of globla
> var.- (one declared at the top of a script outside any functions ) in
> order to access it inside a function. So merely designating a var.
> global is a little more involved than say Perl or other languages. You
> actually have to tell PHP that the function is global.

Correct.  That is to avoid nasty side-effect bugs where global variables
override local variables in functions.  In PHP you need to declare which
global variables you intend to use inside a function.  Let's just say I
had a bad experience once related to this and that is why this is so.

You can use $GLOBALS['var_name'] in your function as a workaround if you
don't like declaring which globals you intend to use.

> I see functions , are there subroutine calls. I guess not.  A function
> acts as a sub when it returns no value . A sub that returns a value is
> a function.

I see no point in this distinction.  And no, PHP just has functions.  And
a function doesn't need to return anything.

-Rasmus



Reply via email to