php-general Digest 25 May 2002 19:08:02 -0000 Issue 1366

Topics (messages 99205 through 99254):

Re: Is this doable?
        99205 by: Sandman
        99216 by: John Holmes

Re: How is SESSION_ID passed?
        99206 by: Miguel Cruz

Re: Popup window from form on php page
        99207 by: Miguel Cruz

Session question
        99208 by: Christian Ista
        99218 by: John Holmes
        99219 by: Christian Ista
        99221 by: Jens Lehmann

PHP script
        99209 by: r
        99211 by: r
        99225 by: SP
        99231 by: r
        99232 by: SP
        99247 by: Chris Hewitt
        99249 by: Alex Shi
        99250 by: r

Re: IMPORTANT, wanna know about MY PROJECT SALE !!!
        99210 by: r
        99212 by: Liam MacKenzie

unexpected T_IF
        99213 by: Zac Hillier
        99214 by: Michael Virnstein

please help!!
        99215 by: Jolly Ng
        99233 by: Olexandr Vynnychenko
        99234 by: John Holmes

displaying an image with header(... does not work
        99217 by: andy
        99220 by: Jens Lehmann
        99222 by: andy

Switch() ?????
        99223 by: Vincent Kruger
        99227 by: Jens Lehmann

Server push?
        99224 by: Leif K-Brooks

Function Switch($pid) - NEED HELP
        99226 by: Vincent Kruger
        99228 by: Jens Lehmann
        99229 by: Jonathan Rosenberg
        99238 by: Rasmus Lerdorf

Storing img into db does not work with imagecreatefromjpeg?
        99230 by: andy

hosting
        99235 by: hassan
        99236 by: John Holmes
        99239 by: hassan

Can't get Apache and PHP to run together -each seems to work OK WinME
        99237 by: Adrian Greeman
        99242 by: Jens Lehmann

Re: SegFaults with PHP4.2.1 and Apache 2.0.36
        99240 by: Rasmus Lerdorf

Re: gmtime?
        99241 by: Jens Lehmann

Newbie Questionabout variables
        99243 by: Al
        99248 by: Alex Shi

Posting problem with Mozilla
        99244 by: Al

Need some advice concerning forms (multi select pulldown) and arrays
        99245 by: Victor Spång Arthursson
        99252 by: Miguel Cruz
        99254 by: Miguel Cruz

Socks Scripting
        99246 by: chris reeper

Adding Sessions Secretly....
        99251 by: Vincent Kruger
        99253 by: Miguel Cruz

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
In article <002e01c20370$4ebee8f0$b402a8c0@mango>,
 [EMAIL PROTECTED] (John Holmes) wrote:

> Can PHP do that? Of course. Can it do it that easily right out of the
> box. No. Just like the RXML backend is already written that parses
> <accessed per="day" /> into the appropriate number, the backend would
> have to be written for PHP to do the same thing. You'd have to write a
> template engine, basically, that'll look for special tags and do the
> appropriate PHP functions when it encounters them.
> 
> I think you'd be far better off learning PHP and just adapting an
> existing template engine to suit your needs. There are plenty of them
> out there. 

I have no problem with learning PHP, I like it alot. But in some instances, 
I like the RXML approcah better.

You talk about template engines, what are they and can you name some 
examples?

-- 
Sandman[.net]
--- End Message ---
--- Begin Message ---
Smarty is the only one that I really remember, as far as template
engines. 

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

There are others, like FastTemplate. Do a search on Google or
SourceForge and you'll come up with a couple dozen. 

What they do is separate the code from presentation. Instead of having
code in your HTML file to display how many hits the page has gotten,
you'd have a tag like {accessed_per_day}. The template engine will do
the function to get the number and replace {accessed_per_day} with the
appropriate number. 

---John Holmes...

> -----Original Message-----
> From: Sandman [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 3:34 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Is this doable?
> 
> In article <002e01c20370$4ebee8f0$b402a8c0@mango>,
>  [EMAIL PROTECTED] (John Holmes) wrote:
> 
> > Can PHP do that? Of course. Can it do it that easily right out of
the
> > box. No. Just like the RXML backend is already written that parses
> > <accessed per="day" /> into the appropriate number, the backend
would
> > have to be written for PHP to do the same thing. You'd have to write
a
> > template engine, basically, that'll look for special tags and do the
> > appropriate PHP functions when it encounters them.
> >
> > I think you'd be far better off learning PHP and just adapting an
> > existing template engine to suit your needs. There are plenty of
them
> > out there.
> 
> I have no problem with learning PHP, I like it alot. But in some
> instances,
> I like the RXML approcah better.
> 
> You talk about template engines, what are they and can you name some
> examples?
> 
> --
> Sandman[.net]
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
On Fri, 24 May 2002, Alex Shi wrote:
> I have created several web sites using php. In all these sites
> session id is passed via cookie. However I noticed that some
> times it was passed by url. I am thinking that to pass session
> id by url will be safer than by cookie.

You are thinking incorrectly; there's no particular difference. It's 
prettier by cookie, but doesn't work for everyone, so it's easiest to just 
use the built-in transparent session ID functionality as described in the 
manual. Most people get cookies, and those for whom that doesn't work get 
GET args.

miguel

--- End Message ---
--- Begin Message ---
On Fri, 24 May 2002, David Bourne wrote:
> The code (in Page1.php):
> 
> <form action="javascript: OpenWindow('Page2.php?a1=<? echo $a1; ?>&a2=<? 
> echo $a2; ?>&a3=<? echo $a3; ?>&a4=<? echo $a4; ?>', 
> 'Answers','toolbar=no,resizable=yes,scrollbars=yes,dependent=yes,status=0,
> alwaysRaised=yes,width=600,height=600');" method="post">
> 
> <input type="submit" value="Look at the Answers?">
> </form>
> 
> seems to work with the OpenWindow function in a JS header.
> 
> Any obvious problems with this?

Seems pretty sensible.

miguel

--- End Message ---
--- Begin Message ---
Hello,

I'm a newbie in PHP, I use a lot ColdFusion (at work).

With ColdFusion, it's very easy to create and use session variable. I do
something like that :
<cfset session.myvariable = "hello"> and this variable can be use
everywhere.

Could you tell me how that's work in PHP. I saw in help file session.start.
But it's not very clear for me.

Thanks for your help,

Bye




--- End Message ---
--- Begin Message ---
Just be sure you call session_start() on any page you want to access
session variables. 

Then you can set a variable by doing

$_SESSION["myvariable"] = "hello";

and then you can use $_SESSION["myvariable"] anywhere you want. 

This assumes the latest version of PHP. The procedure is similar on
older versions, you just have to use session_register().

---John Holmes...

> -----Original Message-----
> From: Christian Ista [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 4:45 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Session question
> 
> Hello,
> 
> I'm a newbie in PHP, I use a lot ColdFusion (at work).
> 
> With ColdFusion, it's very easy to create and use session variable. I
do
> something like that :
> <cfset session.myvariable = "hello"> and this variable can be use
> everywhere.
> 
> Could you tell me how that's work in PHP. I saw in help file
> session.start.
> But it's not very clear for me.
> 
> Thanks for your help,
> 
> Bye
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---

> Just be sure you call session_start() on any page you want to access
> session variables.
>

I have to call this function on each page I use session variable or juste
once ?

> This assumes the latest version of PHP. The procedure is similar on
> older versions, you just have to use session_register().

>From wich version session_start() is include ?

Bye


--- End Message ---
--- Begin Message ---
> > Just be sure you call session_start() on any page you want to access
> > session variables.
> >
>
> I have to call this function on each page I use session variable or juste
> once ?

The statement is pretty clear. You've to call it once on each page you want
to access session variables.

>
> > This assumes the latest version of PHP. The procedure is similar on
> > older versions, you just have to use session_register().
>
> From wich version session_start() is include ?

Don't know what you want, but session_start() is part of PHP since version
4.0

Jens



--- End Message ---
--- Begin Message ---
Hi Guys,

I need a PHP script that will allow me to upload/download chmod files etc on
a remote server...
I know there are loads of these scripts out there but being a newbie to PHP
I really dont know which one is good...
can you recomend any? coming from Java I love PHP so would appreciate if you
would recomend only a php script and not perl,servlet,asp etc.
Another problem is my webserver is something like
/wtn/cgi-bin/www/

all cgi scripts will have to be put in the cgi-bin directory of course but
must be called like this mysite.com/cgibin/script.pl

the php script should allow me access to this directory too!

ANY ideas or recomendations will be deeply appreciated esp from John Holmes,
Jason Wong, Miguel Cruz coz you guys are really brainy and have helped me in
the past so I know your advise is supurb.
I would tip my hat to you, but dont wear one...;-)

Cheers,
-Ryan A.


--- End Message ---
--- Begin Message ---
 Hi Guys,

 I need a PHP script that will allow me to upload/download chmod files etc
on
 a remote server...
 I know there are loads of these scripts out there but being a newbie to PHP
 I really dont know which one is good...
 can you recomend any? coming from Java I love PHP so would appreciate if
you
 would recomend only a php script and not perl,servlet,asp etc.
 Another problem is my webserver is something like
 /wtn/cgi-bin/www/

 all cgi scripts will have to be put in the cgi-bin directory of course but
 must be called like this mysite.com/cgibin/script.pl

 the php script should allow me access to this directory too!

 ANY ideas or recomendations will be deeply appreciated esp from John
Holmes,
 Jason Wong, Miguel Cruz coz you guys are really brainy and have helped me
in
 the past so I know your advise is supurb.
 I would tip my hat to you, but dont wear one...;-)

 Cheers,
 -Ryan A.



--- End Message ---
--- Begin Message ---
I'm not an expert but that doesn't sound like it's
possible.  I mean if you could upload files and
chmod them on a remote server you would have some
serious security issues.  The only thing I can
think of is you could upload files to your remote
datebase.



-----Original Message-----
From: r [mailto:[EMAIL PROTECTED]]
Sent: May 25, 2002 7:00 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP script


 Hi Guys,

 I need a PHP script that will allow me to
upload/download chmod files etc
on
 a remote server...
 I know there are loads of these scripts out there
but being a newbie to PHP
 I really dont know which one is good...
 can you recomend any? coming from Java I love PHP
so would appreciate if
you
 would recomend only a php script and not
perl,servlet,asp etc.
 Another problem is my webserver is something like
 /wtn/cgi-bin/www/

 all cgi scripts will have to be put in the
cgi-bin directory of course but
 must be called like this
mysite.com/cgibin/script.pl

 the php script should allow me access to this
directory too!

 ANY ideas or recomendations will be deeply
appreciated esp from John
Holmes,
 Jason Wong, Miguel Cruz coz you guys are really
brainy and have helped me
in
 the past so I know your advise is supurb.
 I would tip my hat to you, but dont wear
one...;-)

 Cheers,
 -Ryan A.




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


--- End Message ---
--- Begin Message ---
Hey there,
Guess you too are a newbie,
anyway, have been doing what you think is impossible for years using perl
and servlets without any problems,
And I know its possible with PHP too, since its possible i'm pretty sure
someone has used it in some app already or is going too, the php community
is FASSSST...
The problem is I have been using it on servers with paths to cgi something
like this

/home/somedotcom/cgi-bin/

but now the new path i have is

/home/cgi-bin/mydotTLD/ which of course resolves to http://mydotTLD/cgi-bin/
and I will need to administrator the files in the cgi-bin too.

Any ideas?

 -Ryan.

----- Original Message -----
From: "SP" <[EMAIL PROTECTED]>
To: "r" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 5:30 AM
Subject: RE: [PHP] PHP script


> I'm not an expert but that doesn't sound like it's
> possible.  I mean if you could upload files and
> chmod them on a remote server you would have some
> serious security issues.  The only thing I can
> think of is you could upload files to your remote
> datebase.
>
>
>
> -----Original Message-----
> From: r [mailto:[EMAIL PROTECTED]]
> Sent: May 25, 2002 7:00 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP script
>
>
>  Hi Guys,
>
>  I need a PHP script that will allow me to
> upload/download chmod files etc
> on
>  a remote server...
>  I know there are loads of these scripts out there
> but being a newbie to PHP
>  I really dont know which one is good...
>  can you recomend any? coming from Java I love PHP
> so would appreciate if
> you
>  would recomend only a php script and not
> perl,servlet,asp etc.
>  Another problem is my webserver is something like
>  /wtn/cgi-bin/www/
>
>  all cgi scripts will have to be put in the
> cgi-bin directory of course but
>  must be called like this
> mysite.com/cgibin/script.pl
>
>  the php script should allow me access to this
> directory too!
>
>  ANY ideas or recomendations will be deeply
> appreciated esp from John
> Holmes,
>  Jason Wong, Miguel Cruz coz you guys are really
> brainy and have helped me
> in
>  the past so I know your advise is supurb.
>  I would tip my hat to you, but dont wear
> one...;-)
>
>  Cheers,
>  -Ryan A.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Okay how about in your upload form, try putting in
the whole url instead of upload.php.  I don't know
if that would work.  You would have to have the
upload.php script on the remote server.

<form ENCTYPE="multipart/form-data" method="POST"
action="http://www.remoteserver.com/upload.php";>







-----Original Message-----
From: r [mailto:[EMAIL PROTECTED]]
Sent: May 25, 2002 10:03 PM
To: SP
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP script


Hey there,
Guess you too are a newbie,
anyway, have been doing what you think is
impossible for years using perl
and servlets without any problems,
And I know its possible with PHP too, since its
possible i'm pretty sure
someone has used it in some app already or is
going too, the php community
is FASSSST...
The problem is I have been using it on servers
with paths to cgi something
like this

/home/somedotcom/cgi-bin/

but now the new path i have is

/home/cgi-bin/mydotTLD/ which of course resolves
to http://mydotTLD/cgi-bin/
and I will need to administrator the files in the
cgi-bin too.

Any ideas?

 -Ryan.

----- Original Message -----
From: "SP" <[EMAIL PROTECTED]>
To: "r" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 5:30 AM
Subject: RE: [PHP] PHP script


> I'm not an expert but that doesn't sound like
it's
> possible.  I mean if you could upload files and
> chmod them on a remote server you would have
some
> serious security issues.  The only thing I can
> think of is you could upload files to your
remote
> datebase.
>
>
>
> -----Original Message-----
> From: r [mailto:[EMAIL PROTECTED]]
> Sent: May 25, 2002 7:00 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP script
>
>
>  Hi Guys,
>
>  I need a PHP script that will allow me to
> upload/download chmod files etc
> on
>  a remote server...
>  I know there are loads of these scripts out
there
> but being a newbie to PHP
>  I really dont know which one is good...
>  can you recomend any? coming from Java I love
PHP
> so would appreciate if
> you
>  would recomend only a php script and not
> perl,servlet,asp etc.
>  Another problem is my webserver is something
like
>  /wtn/cgi-bin/www/
>
>  all cgi scripts will have to be put in the
> cgi-bin directory of course but
>  must be called like this
> mysite.com/cgibin/script.pl
>
>  the php script should allow me access to this
> directory too!
>
>  ANY ideas or recomendations will be deeply
> appreciated esp from John
> Holmes,
>  Jason Wong, Miguel Cruz coz you guys are really
> brainy and have helped me
> in
>  the past so I know your advise is supurb.
>  I would tip my hat to you, but dont wear
> one...;-)
>
>  Cheers,
>  -Ryan A.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Ryan,

I may be missing something as I have not been monitoring this thread, 
but why not use ftp? It allows the file transfer and chmod. Perhaps its 
not available on the server that you need it to be, but its the normal 
way of putting web pages onto a server.

HTH
Chris

SP wrote:

>I'm not an expert but that doesn't sound like it's
>possible.  I mean if you could upload files and
>chmod them on a remote server you would have some
>serious security issues.  The only thing I can
>think of is you could upload files to your remote
>datebase.
>
>
>
>-----Original Message-----
>From: r [mailto:[EMAIL PROTECTED]]
>Sent: May 25, 2002 7:00 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] PHP script
>
>
> Hi Guys,
>
> I need a PHP script that will allow me to
>upload/download chmod files etc
>on
> a remote server...
> I know there are loads of these scripts out there
>but being a newbie to PHP
> I really dont know which one is good...
> can you recomend any? coming from Java I love PHP
>so would appreciate if
>you
> would recomend only a php script and not
>perl,servlet,asp etc.
> Another problem is my webserver is something like
> /wtn/cgi-bin/www/
>
> all cgi scripts will have to be put in the
>cgi-bin directory of course but
> must be called like this
>mysite.com/cgibin/script.pl
>
> the php script should allow me access to this
>directory too!
>
> ANY ideas or recomendations will be deeply
>appreciated esp from John
>Holmes,
> Jason Wong, Miguel Cruz coz you guys are really
>brainy and have helped me
>in
> the past so I know your advise is supurb.
> I would tip my hat to you, but dont wear
>one...;-)
>
> Cheers,
> -Ryan A.
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit:
>http://www.php.net/unsub.php
>
>
>


--- End Message ---
--- Begin Message ---
For file uploading:
http://www.php.net/manual/en/features.file-upload.php

For chmod:
http://www.php.net/manual/en/function.chmod.php

For the third question:
php has no restriction where php scripts have to be
put in. so just put the script where you want to upload file.

Hope these can help.

Alex


"R" <[EMAIL PROTECTED]> wrote in message
000801c203db$5ba81b20$0a6da8c0@lgwezec83s94bn">news:000801c203db$5ba81b20$0a6da8c0@lgwezec83s94bn...
> Hi Guys,
>
>  I need a PHP script that will allow me to upload/download chmod files etc
> on
>  a remote server...
>  I know there are loads of these scripts out there but being a newbie to
PHP
>  I really dont know which one is good...
>  can you recomend any? coming from Java I love PHP so would appreciate if
> you
>  would recomend only a php script and not perl,servlet,asp etc.
>  Another problem is my webserver is something like
>  /wtn/cgi-bin/www/
>
>  all cgi scripts will have to be put in the cgi-bin directory of course
but
>  must be called like this mysite.com/cgibin/script.pl
>
>  the php script should allow me access to this directory too!
>
>  ANY ideas or recomendations will be deeply appreciated esp from John
> Holmes,
>  Jason Wong, Miguel Cruz coz you guys are really brainy and have helped me
> in
>  the past so I know your advise is supurb.
>  I would tip my hat to you, but dont wear one...;-)
>
>  Cheers,
>  -Ryan A.
>
>
>

--- End Message ---
--- Begin Message ---
Hey,
thanks for writing,
The script will be on the remote server, but how do i access the cgi-bin
directory when it is below the host root...
eg:

/home/cgi-bin/mysite.com/upload.php

how will upload.php add/modify /cgi-bin/?


-Ryan A.

----- Original Message -----
From: "SP" <[EMAIL PROTECTED]>
To: "r" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 6:38 AM
Subject: RE: [PHP] PHP script


> Okay how about in your upload form, try putting in
> the whole url instead of upload.php.  I don't know
> if that would work.  You would have to have the
> upload.php script on the remote server.
>
> <form ENCTYPE="multipart/form-data" method="POST"
> action="http://www.remoteserver.com/upload.php";>
>
>
>
>
>
>
>
> -----Original Message-----
> From: r [mailto:[EMAIL PROTECTED]]
> Sent: May 25, 2002 10:03 PM
> To: SP
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP script
>
>
> Hey there,
> Guess you too are a newbie,
> anyway, have been doing what you think is
> impossible for years using perl
> and servlets without any problems,
> And I know its possible with PHP too, since its
> possible i'm pretty sure
> someone has used it in some app already or is
> going too, the php community
> is FASSSST...
> The problem is I have been using it on servers
> with paths to cgi something
> like this
>
> /home/somedotcom/cgi-bin/
>
> but now the new path i have is
>
> /home/cgi-bin/mydotTLD/ which of course resolves
> to http://mydotTLD/cgi-bin/
> and I will need to administrator the files in the
> cgi-bin too.
>
> Any ideas?
>
>  -Ryan.
>
> ----- Original Message -----
> From: "SP" <[EMAIL PROTECTED]>
> To: "r" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Saturday, May 25, 2002 5:30 AM
> Subject: RE: [PHP] PHP script
>
>
> > I'm not an expert but that doesn't sound like
> it's
> > possible.  I mean if you could upload files and
> > chmod them on a remote server you would have
> some
> > serious security issues.  The only thing I can
> > think of is you could upload files to your
> remote
> > datebase.
> >
> >
> >
> > -----Original Message-----
> > From: r [mailto:[EMAIL PROTECTED]]
> > Sent: May 25, 2002 7:00 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] PHP script
> >
> >
> >  Hi Guys,
> >
> >  I need a PHP script that will allow me to
> > upload/download chmod files etc
> > on
> >  a remote server...
> >  I know there are loads of these scripts out
> there
> > but being a newbie to PHP
> >  I really dont know which one is good...
> >  can you recomend any? coming from Java I love
> PHP
> > so would appreciate if
> > you
> >  would recomend only a php script and not
> > perl,servlet,asp etc.
> >  Another problem is my webserver is something
> like
> >  /wtn/cgi-bin/www/
> >
> >  all cgi scripts will have to be put in the
> > cgi-bin directory of course but
> >  must be called like this
> > mysite.com/cgibin/script.pl
> >
> >  the php script should allow me access to this
> > directory too!
> >
> >  ANY ideas or recomendations will be deeply
> > appreciated esp from John
> > Holmes,
> >  Jason Wong, Miguel Cruz coz you guys are really
> > brainy and have helped me
> > in
> >  the past so I know your advise is supurb.
> >  I would tip my hat to you, but dont wear
> > one...;-)
> >
> >  Cheers,
> >  -Ryan A.
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> > http://www.php.net/unsub.php
> >
> >
>
>

--- End Message ---
--- Begin Message ---
I would really like to call you scum but I think  the scumy people of this
world would object.
This aint a auction or any type of selling market, try greatdomains.com or
some such service,
I'll bet your little ding a ling that what ever you have on your site can be
made in a few days by over 80% of the people who recieve this list....or got
off the open source market,  so basically pal...shove it.

Have a bad day,
-Ryan

> On Fri, 24 May 2002, Kamran Shakil wrote:
> > I personally have got 10 big and small demanding , complete solution
> > websites, in php , made with access database with odbc connection
> > string......wanna sell them for adequate and handsome price ? wanna know
> > sites regarding sales and exchange of projects
>


--- End Message ---
--- Begin Message ---
Amen


----- Original Message -----
From: "r" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 8:36 PM
Subject: Re: [PHP] IMPORTANT, wanna know about MY PROJECT SALE !!!


> I would really like to call you scum but I think  the scumy people of this
> world would object.
> This aint a auction or any type of selling market, try greatdomains.com or
> some such service,
> I'll bet your little ding a ling that what ever you have on your site can
be
> made in a few days by over 80% of the people who recieve this list....or
got
> off the open source market,  so basically pal...shove it.
>
> Have a bad day,
> -Ryan
>
> > On Fri, 24 May 2002, Kamran Shakil wrote:
> > > I personally have got 10 big and small demanding , complete solution
> > > websites, in php , made with access database with odbc connection
> > > string......wanna sell them for adequate and handsome price ? wanna
know
> > > sites regarding sales and exchange of projects
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



--- End Message ---
--- Begin Message ---
Hmm, can anyone explain why I'm getting this error?

Parse error: parse error, unexpected T_IF in /usr/local/htdocs/san.loc/upload-img.php 
on line 34

Code reads:

11:#--if form submitted then process file upload
12:if($HTTP_POST_VARS['ttl']) {
13:
14: #--check if there is already a picture called this
15: include $DOCUMENT_ROOT . 'incs/db.php';
16: @mysql_select_db("infoNav") or die("unable to connect to table");
17: $qry = "SELECT ttl FROM imgLst WHERE site = $HTTP_SESSION_VARS[site_no] AND ttl = 
'$HTTP_POST_VARS[ttl]';";
18: $imgTst = MYSQL_QUERY($qry);
19: 
20: if(mysql_numrows($imgTst) < 1) {
21:
22:  #-- check file type 
23:  $ulf = $HTTP_POST_FILES['uplfile']['type'];
24:  if($ulf == 'image/pjpeg' || $ulf == 'image/gif') {
25: 
26:   #-- get ext
27:   ($ulf == 'image/pjpeg') ? $ext = '.jpg' : $ext = '.gif';
28: 
29:   #-- create unique filename
30:   $flNme = '\/imgs\/user-imgs\/' . time() . $REMOTE_HOST . $ext;
31:   $FulflNme = $DOCUMENT_ROOT . $flNme
32:  
33:   #-- check file is realy uploaded for security then copy to store folder
34:   if (is_uploaded_file($HTTP_POST_FILES['uplfile'])) {

Thanks

Zac
--- End Message ---
--- Begin Message ---
you can look here:
http://www.php.net/manual/en/tokens.php
to see what T_IF means.

31:   $FulflNme = $DOCUMENT_ROOT . $flNme

you forgot the ; at the end of the line.

Michael


"Zac Hillier" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
002a01c203cf$4f1d7780$667ba8c0@ws">news:002a01c203cf$4f1d7780$667ba8c0@ws...
Hmm, can anyone explain why I'm getting this error?

Parse error: parse error, unexpected T_IF in
/usr/local/htdocs/san.loc/upload-img.php on line 34

Code reads:

11:#--if form submitted then process file upload
12:if($HTTP_POST_VARS['ttl']) {
13:
14: #--check if there is already a picture called this
15: include $DOCUMENT_ROOT . 'incs/db.php';
16: @mysql_select_db("infoNav") or die("unable to connect to table");
17: $qry = "SELECT ttl FROM imgLst WHERE site = $HTTP_SESSION_VARS[site_no]
AND ttl = '$HTTP_POST_VARS[ttl]';";
18: $imgTst = MYSQL_QUERY($qry);
19:
20: if(mysql_numrows($imgTst) < 1) {
21:
22:  #-- check file type
23:  $ulf = $HTTP_POST_FILES['uplfile']['type'];
24:  if($ulf == 'image/pjpeg' || $ulf == 'image/gif') {
25:
26:   #-- get ext
27:   ($ulf == 'image/pjpeg') ? $ext = '.jpg' : $ext = '.gif';
28:
29:   #-- create unique filename
30:   $flNme = '\/imgs\/user-imgs\/' . time() . $REMOTE_HOST . $ext;
31:   $FulflNme = $DOCUMENT_ROOT . $flNme
32:
33:   #-- check file is realy uploaded for security then copy to store
folder
34:   if (is_uploaded_file($HTTP_POST_FILES['uplfile'])) {

Thanks

Zac


--- End Message ---
--- Begin Message ---
Hi Hi,

php + apache + win2000
or 
php + IIS + win2000
I don't know why my setting do not allow me to POST or GET variable which submit in 
html <form>
Please help!!!

Jolly
--- End Message ---
--- Begin Message ---
Hello Jolly,

Saturday, May 25, 2002, 9:13:02 AM, you wrote:

JN> Hi Hi,

JN> php + apache + win2000
JN> or 
JN> php + IIS + win2000
JN> I don't know why my setting do not allow me to POST or GET variable which submit 
in html <form>
JN> Please help!!!

JN> Jolly

Let us read your html and php code. I've never had such problems.

-- 
Best regards,
 Olexandr                            mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
> Saturday, May 25, 2002, 9:13:02 AM, you wrote:
>
> JN> Hi Hi,
>
> JN> php + apache + win2000
> JN> or
> JN> php + IIS + win2000
> JN> I don't know why my setting do not allow me to POST or GET variable
which submit in html <form>
> JN> Please help!!!
>
> JN> Jolly

Turn on register_globals or use the $_GET[], $_POST[], etc arrays.

If you don't know what I'm talking about, read the release notes on the
program you just installed (php).

---John Holmes...

--- End Message ---
--- Begin Message ---
Hi there,

I am pulling out an image out of a mysql blob field. The image is there, I
can see it in mysqlfront. So I pull it out of the db store it into a
variable and then do a:

 header("Content-type: image/pjpeg");
 echo $picture;

I do get a white screen and the browser is loading forever. I can not see
any error in that. Outputting text works, but not the image.

Thanx for any help,

Andy


--- End Message ---
--- Begin Message ---

> Hi there,
>
> I am pulling out an image out of a mysql blob field. The image is there, I
> can see it in mysqlfront. So I pull it out of the db store it into a
> variable and then do a:
>
>  header("Content-type: image/pjpeg");
>  echo $picture;
>
> I do get a white screen and the browser is loading forever. I can not see
> any error in that. Outputting text works, but not the image.
>
> Thanx for any help,
>
> Andy
>

Don't know if it's a typo, but it must be "image/jpeg" of course. Check your
loops (if any) and your strings (esp. " and '). Maybe it's better to post
the whole
source in this case.

Jens


--- End Message ---
--- Begin Message ---
sound pretty funny... but I opened the browser to test it again, and it
worked without problems :-) No clue why.

Anyway.. thank you

Andy


"Jens Lehmann" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > Hi there,
> >
> > I am pulling out an image out of a mysql blob field. The image is there,
I
> > can see it in mysqlfront. So I pull it out of the db store it into a
> > variable and then do a:
> >
> >  header("Content-type: image/pjpeg");
> >  echo $picture;
> >
> > I do get a white screen and the browser is loading forever. I can not
see
> > any error in that. Outputting text works, but not the image.
> >
> > Thanx for any help,
> >
> > Andy
> >
>
> Don't know if it's a typo, but it must be "image/jpeg" of course. Check
your
> loops (if any) and your strings (esp. " and '). Maybe it's better to post
> the whole
> source in this case.
>
> Jens
>
>


--- End Message ---
--- Begin Message ---
I have a script that switches.
switch($pid)
{
    case 1:
    break;

    case 2:
    break;
}

Now I'm doing a check in case 1 and if everything goes well, i want to
switch directly to case 2 while the script is runny.

How would i do that ???


--- End Message ---
--- Begin Message ---

> I have a script that switches.
> switch($pid)
> {
>     case 1:
>     break;
>
>     case 2:
>     break;
> }
>
> Now I'm doing a check in case 1 and if everything goes well, i want to
> switch directly to case 2 while the script is runny.
>
> How would i do that ???
>

Don't write "break;" in case 1.

Jens


--- End Message ---
--- Begin Message ---
Does php support server push?  I am trying to make a real-time chat. 
 Would server push be the best way, and if so, how would I do it? 
 Thanks for any help!

--- End Message ---
--- Begin Message ---
I have a script that switches.
switch($pid)
{
    case 1:
    break;

    case 2:
    break;
}

Now I'm doing a check in case 1 and if everything goes well, i want to
switch directly to case 2 while the script is runny.

How would i do that ???




--- End Message ---
--- Begin Message ---
> I have a script that switches.
> switch($pid)
> {
>     case 1:
>     break;
>
>     case 2:
>     break;
> }
>
> Now I'm doing a check in case 1 and if everything goes well, i want to
> switch directly to case 2 while the script is runny.
>
> How would i do that ???
>

Please don't post the same question several times.

Jens


--- End Message ---
--- Begin Message ---
-----Original Message-----
> From: Vincent Kruger [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 8:41 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Function Switch($pid) - NEED HELP

> I have a script that switches.
> switch($pid)
> {
>     case 1:
>     break;
>
>     case 2:
>     break;
> }

> Now I'm doing a check in case 1 and if everything goes
> well, I want to
> switch directly to case 2 while the script is runny.

> How would I do that ???

I'm not sure I'm understanding your question properly.  But does
this do what you want?

        switch ($pid) {
                case 1:
                        if (!test you want) then break;
                        // If test is true, execution "falls
                        // through" to next case
                case 2:
                        ...
                        break;
        }


--
JR

--- End Message ---
--- Begin Message ---
Just don't do the break in case 1 if you want to fall through to case 2.

On Sat, 25 May 2002, Vincent Kruger wrote:

> I have a script that switches.
> switch($pid)
> {
>     case 1:
>     break;
>
>     case 2:
>     break;
> }
>
> Now I'm doing a check in case 1 and if everything goes well, i want to
> switch directly to case 2 while the script is runny.
>
> How would i do that ???
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi there,

I would like to save images into a blob column. Works good if I use the tmp
file php has created after submitting the form.

But if I do some gd stuff like changing some colors with inside the image
and then save this immage, it does not work.

I used to save the image to a file with:   imagejpeg($picture, $name); //
this works
and now I try to save it to the db with:

   $picture = ImageCreateTrueColor($maxX, $dstY);
    //... some funky stuff like using the uuploaded file and mixing it with
a water mark
  $data = addslashes($picture);

  $stmt ="
       INSERT INTO test.picture_test
        (file_name, file_type, picture)
        VALUES
        ('$name', '$picture_location_type', '$data')
  ";

Like I said if I replace the $picture with the variable of the tmp field it
works fine.

I tryed also to do an imagejpeg before saving to the db, but it did not
change anything.

Thank you so much for any hint,

Andy


--- End Message ---
--- Begin Message ---
hi

anybody know of a hosting service that can be setup in a few minutes and i 
mean a few minutes that's all i got

Thank

___________________________________________________
Hassan El Forkani
Founder And Mantainer of :
http://WarmAfrica.com EveryOne's Africa
Freelance Internet Consultant / Web Applications Developper.
Email: [EMAIL PROTECTED]
Tel : 0021671880014
___________________________________________________

--- End Message ---
--- Begin Message ---
> anybody know of a hosting service that can be setup in a few minutes and i
> mean a few minutes that's all i got

I know of a great one...umm, just give me a few minutes to remember the
name.

---John Holmes...

--- End Message ---
--- Begin Message ---
OK
let me explain, this is an emergency situation

i need php 4.XXX with --enable-wddx plus allow remote fopen (the app reads 
remote xml files)
perl binary installed
access to one directory outside the web root (to store includes and classes 
library)
mysql database

disk space something like 50 megs is ok
i will be hosting a domain on the server
pop accounts (at least 2)
ftp
possibly ssh access (not necessary)




At 17:28 25/05/02, 1LT John W. Holmes wrote:
> > anybody know of a hosting service that can be setup in a few minutes and i
> > mean a few minutes that's all i got
>
>I know of a great one...umm, just give me a few minutes to remember the
>name.
>
>---John Holmes...

___________________________________________________
Hassan El Forkani
Founder And Mantainer of :
http://WarmAfrica.com EveryOne's Africa
Freelance Internet Consultant / Web Applications Developper.
Email: [EMAIL PROTECTED]
Tel : 0021671880014
___________________________________________________

--- End Message ---
--- Begin Message ---
I am not an advanced user but not incapable.  Please bear with me for
any amateurishness.

I am trying to get PHP to work with Apache.
I have a Windows ME PC, 2Mhz and 512 of RAM.

I want it only to learn PHP and then test out a few things, using
MySQL too.

I downloaded Apache version 1.3.24 and installed it plain and
simple.It starts up.

I have also installed PHP version 4.2.1.  I have also a version of
MySQL loaded (4.0.1) and that sits happily running under a
WinMySQLAdmin logo in the corner of the screen.

I carefully followed the help files and looked up articles and books
for instructions for setting up the config file and have made changes
to "Apache" so the relevant sections now read like this.
(There seem only to be a few necessary changes)./


........................QUOTE
   ScriptAlias /cgi-bin/ "C:/Program Files/Apache
Group/Apache/cgi-bin/"

    #
    # "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed
to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    <Directory "C:/Program Files/Apache Group/Apache/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>

</IfModule>

    ScriptAlias /php/ "C:/PHP/"



# End of aliases.

END QUOTE


and ..................


QUOTE

 #
    # AddType allows you to tweak mime.types without actually editing
it, or to
    # make certain files to be certain types.
    #
    AddType application/x-tar .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .phtml

    Action application/x-httpd-php "/php/php.exe"

END QUOTE

With this done the Apache config tester says the syntax is OK and when
I access "localhost"  (using IE6) up comes the Apache information page
saying it is running.

But when I ask for  "localhost/phpinfo.php"
(I have a phpinfo function written into a file with that extension)
I get an error 500 "internal configuration is wrong" message.



Maybe it is PHP that is wrong?    So I have checked all the changes
needed for installing PHP --- again after reading the php site and
looking a FAQs etc.

I mean putting the php4tl file into Windows/System etc and PHP.ini
into Windows.  (I used the Windows installer anyway and have again
carefully followed the changes needed to the INI file.)



Still the problem.

A PHP FAQ says that if you get a 500 error (internatl config problem)
it is worth testing with the command line:

php.exe -i


so I did this in DOS.     Reams of HTML stuff whizzed by.
According to the FAQ answer this means PHP  is OK.

So back to Apache.  But that is as above.

I tried Netscape version 2 and IE6   -   both give the same answer. So
it is not the browser because I have tried different ones.

It is not PHP because on the command line that works OK and shows
PHPINFO stuff.

It is not Apache because it says it is running in the browser windows
when you call localhost.

So - I am being driven slowly nuts with frustration.

May I ask for any ideas?

(I should add that I am a rank amateur trying to do all this so please
take it slowly).

Regards from
    Adrian Greeman



Regards from
    Adrian Greeman

52 Salterford Road, Tooting, London, SW17 9TF

Phone  +44 (0)20 8672 9661
Mobile  +44 (0)780 329 7447

Fax:  I can receive these
on the computer
but only when present
- please phone first

--- End Message ---
--- Begin Message ---
Maybe Apache and PHP have problems with the 2MHz-CPU. :-)

I can only guess what may be the problem:

1. You didn't write phpinfo.php correctly.
2. phpinfo.php is in the wrong directory.

I suggest this because if the apache-site comes up correctly and
phpinfo.php does not it _might_ be a directory problem. Please try to
put a test.html-file in your webserver-root and call it in your browser.

Jens


>  I am not an advanced user but not incapable.  Please bear with me for
> any amateurishness.
>
> I am trying to get PHP to work with Apache.
> I have a Windows ME PC, 2Mhz and 512 of RAM.
>
> I want it only to learn PHP and then test out a few things, using
> MySQL too.
>
> I downloaded Apache version 1.3.24 and installed it plain and
> simple.It starts up.
>
> I have also installed PHP version 4.2.1.  I have also a version of
> MySQL loaded (4.0.1) and that sits happily running under a
> WinMySQLAdmin logo in the corner of the screen.
>
> I carefully followed the help files and looked up articles and books
> for instructions for setting up the config file and have made changes
> to "Apache" so the relevant sections now read like this.
> (There seem only to be a few necessary changes)./
>
>
> ........................QUOTE
>    ScriptAlias /cgi-bin/ "C:/Program Files/Apache
> Group/Apache/cgi-bin/"
>
>     #
>     # "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed
> to whatever your ScriptAliased
>     # CGI directory exists, if you have that configured.
>     #
>     <Directory "C:/Program Files/Apache Group/Apache/cgi-bin">
>         AllowOverride None
>         Options None
>         Order allow,deny
>         Allow from all
>     </Directory>
>
> </IfModule>
>
>     ScriptAlias /php/ "C:/PHP/"
>
>
>
> # End of aliases.
>
> END QUOTE
>
>
> and ..................
>
>
> QUOTE
>
>  #
>     # AddType allows you to tweak mime.types without actually editing
> it, or to
>     # make certain files to be certain types.
>     #
>     AddType application/x-tar .tgz
>     AddType application/x-httpd-php .php
>     AddType application/x-httpd-php .php3
>     AddType application/x-httpd-php .php4
>     AddType application/x-httpd-php .phtml
>
>     Action application/x-httpd-php "/php/php.exe"
>
> END QUOTE
>
> With this done the Apache config tester says the syntax is OK and when
> I access "localhost"  (using IE6) up comes the Apache information page
> saying it is running.
>
> But when I ask for  "localhost/phpinfo.php"
> (I have a phpinfo function written into a file with that extension)
> I get an error 500 "internal configuration is wrong" message.
>
>
>
> Maybe it is PHP that is wrong?    So I have checked all the changes
> needed for installing PHP --- again after reading the php site and
> looking a FAQs etc.
>
> I mean putting the php4tl file into Windows/System etc and PHP.ini
> into Windows.  (I used the Windows installer anyway and have again
> carefully followed the changes needed to the INI file.)
>
>
>
> Still the problem.
>
> A PHP FAQ says that if you get a 500 error (internatl config problem)
> it is worth testing with the command line:
>
> php.exe -i
>
>
> so I did this in DOS.     Reams of HTML stuff whizzed by.
> According to the FAQ answer this means PHP  is OK.
>
> So back to Apache.  But that is as above.
>
> I tried Netscape version 2 and IE6   -   both give the same answer. So
> it is not the browser because I have tried different ones.
>
> It is not PHP because on the command line that works OK and shows
> PHPINFO stuff.
>
> It is not Apache because it says it is running in the browser windows
> when you call localhost.
>
> So - I am being driven slowly nuts with frustration.
>
> May I ask for any ideas?
>
> (I should add that I am a rank amateur trying to do all this so please
> take it slowly).
>
> Regards from
>     Adrian Greeman
>
>
>
> Regards from
>     Adrian Greeman
>
> 52 Salterford Road, Tooting, London, SW17 9TF
>
> Phone  +44 (0)20 8672 9661
> Mobile  +44 (0)780 329 7447
>
> Fax:  I can receive these
> on the computer
> but only when present
> - please phone first
>


--- End Message ---
--- Begin Message ---
The fact that some applications crash with Apache2+PHP is not strange at
all. There are likely a number of 3rd-party libraries which can currently
be linked into PHP that are not threadsafe and/or re-entrant.  It will
take a while before we identify these libraries and try to come up with
some workaround.  For now you can try going single-threaded and see if
that helps (although then you might as well just use Apache 1.3.x)

-Rasmus

On Fri, 24 May 2002, Rodolfo Segleau wrote:

>
> Not sure if you guys have already responded to this, but here we go (I'm
> checking the archives of PHP as I am writing this).
>
> I have Apache 2.0.36 running with PHP 4.2.1. Apache seg faults with a certain
> application (which has redirected me back here). Child processes quit with a
> signal 11. I know that PHP 4.2.1 doesn't have full support for Apache2, but it
> seems strange that only a few of all the applications written in PHP are
> causing this segfault. Below is the output of an strace done on the parent
> process:
>
> <begin logfile>
> select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
> gettimeofday({1022291150, 787056}, NULL) = 0
> fork()                                  = 15100
> wait4(-1, 0x11ffff818, WNOHANG|WUNTRACED, NULL) = 0
> select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
> <snip wait4s>
> ...
> </snip wait4s>
> wait4(-1, 0x11ffff818, WNOHANG|WUNTRACED, NULL) = 0
> select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
> wait4(-1, 0x11ffff818, WNOHANG|WUNTRACED, NULL) = 0
> select(0, NULL, NULL, NULL, {1, 0})     = ? ERESTARTNOHAND (To be restarted)
> --- SIGCHLD (Child exited) ---
> select(0, NULL, NULL, NULL, {0, 496784}) = 0 (Timeout)
> wait4(-1, [WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV], WNOHANG|WUNTRACED, NULL) =
>  15034
> gettimeofday({1022291166, 797450}, NULL) = 0
> write(11, "[Fri May 24 20:46:06 2002] [noti"..., 88) = 88
> gettimeofday({1022291166, 797869}, NULL) = 0
> wait4(-1, 0x11ffff818, WNOHANG|WUNTRACED, NULL) = 0
> select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
> <end of logfile>
>
>
>
> Any ideas?
>
> Cheers,
>
>
> Rodolfo
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---

> I don't know what gmtime() is supposed to do.  But is gmmktime() similar?
> http://www.php.net/manual/en/function.gmmktime.php
> -Kevin

Sorry, my first answer was incorrect. gmmktime() does not do what I want.
Do you have any other suggestion why we need/don't need gmtime()?

Jens


--- End Message ---
--- Begin Message ---

I hope this posting is not a duplicate.  I originally posted it yesterday,
but it doesn't show on the newsgroup for me.

Apparently you can set a variable as part of a URL statement.  For example:
www.company.com/index.php?admin=password.

Where "password" might be a simple variable to test as a rudimentary
authorization password.

I can't find anything like this on the php website or manual.

Can someone point me in the right direction?

Thanks....


--- End Message ---
--- Begin Message ---
Not sure what your question is....

In the case "password" is not a variable but the value of
the variable, while "admin" is the name of the variable.

Variables passed by url is obtained by GET method, and
in your script all vairables passed by GET method can be
accessed directly. So, in following script,

<?
.....
print $admin;
.....
?>

the result of print will be "password".

If this is not the answer to your quesiton, pls clarify.

Alex


"Al" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I hope this posting is not a duplicate.  I originally posted it yesterday,
> but it doesn't show on the newsgroup for me.
>
> Apparently you can set a variable as part of a URL statement.  For
example:
> www.company.com/index.php?admin=password.
>
> Where "password" might be a simple variable to test as a rudimentary
> authorization password.
>
> I can't find anything like this on the php website or manual.
>
> Can someone point me in the right direction?
>
> Thanks....
>
>

--- End Message ---
--- Begin Message ---
Anyone have a clue why I can't post messages with Mozilla [RC2]?

Goes through all the motions as if the message is sent.  Shows in my sent
folder and the terminal icon indicates the message is sent.

Works fine for all other newsgroup servers.

I'm posting this with IE6.


--- End Message ---
--- Begin Message ---
Hello!

I know it's possible to use arrays in combination with forms, but I need 
some advice about where to find some information/tutorial concerning how 
to use arrays together with "multi-select-tags"...

Sincerely

Victor

--- End Message ---
--- Begin Message ---
On Sat, 25 May 2002, Victor Spång Arthursson wrote:
> I know it's possible to use arrays in combination with forms, but I need
> some advice about where to find some information/tutorial concerning how
> to use arrays together with "multi-select-tags"...

Have a play with this little program - it should demonstrate all of the
things you'd want to do with getting data in and out of mult selects. If
it doesn't work, you may have an older version of PHP - in that case,
change "$_REQUEST" to "$HTTP_POST_VARS" and "$_SERVER['PHP_SELF']" to
"$PHP_SELF".

---------------
  <?

  $choices = array(1 => 'dog', 2 => 'cat', 3 => 'mouse', 4 => 'frog');

  if (is_array($_REQUEST['animals']))
  {           
    print '<p>You chose:</p><ul>';
    foreach ($_REQUEST['animals'] as $animal_id)      
      print "<li>{$choices[$animal_id]}</li>";
    print '</ul><hr>';
  }

  ?><form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
  <select multiple name="animals[]"><?

  foreach ($choices as $id => $name)
    print '<option '
      . (in_array($id, $_REQUEST['animals']) ? 'selected ' : '')     
      . "value='$id'>$name</option>";

  ?></select><input type="submit"></form>

---------------
miguel

--- End Message ---
--- Begin Message ---
Oops. I actually tried running it (cleverly waiting until after I posted 
it to the list) and I see that there are some warnings in the event that 
nothing has been selected (due to in_array operating on an undefined 
variable). Don't worry about them. Or change that last foreach clause to 
look like this:

  foreach ($choices as $id => $name)
    print '<option '
      . (is_array($_REQUEST['animals'])
        && in_array($id, $_REQUEST['animals']) ? 'selected ' : '')
      . "value='$id'>$name</option>";

(I added an is_array to make sure we don't send a null value as the second 
argument to in_array).

miguel

On Sat, 25 May 2002, Miguel Cruz wrote:
> Have a play with this little program - it should demonstrate all of the
> things you'd want to do with getting data in and out of mult selects. If
> it doesn't work, you may have an older version of PHP - in that case,
> change "$_REQUEST" to "$HTTP_POST_VARS" and "$_SERVER['PHP_SELF']" to
> "$PHP_SELF".
> 
> ---------------
>   <?
> 
>   $choices = array(1 => 'dog', 2 => 'cat', 3 => 'mouse', 4 => 'frog');
> 
>   if (is_array($_REQUEST['animals']))
>   {           
>     print '<p>You chose:</p><ul>';
>     foreach ($_REQUEST['animals'] as $animal_id)      
>       print "<li>{$choices[$animal_id]}</li>";
>     print '</ul><hr>';
>   }
> 
>   ?><form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
>   <select multiple name="animals[]"><?
> 
>   foreach ($choices as $id => $name)
>     print '<option '
>       . (in_array($id, $_REQUEST['animals']) ? 'selected ' : '')     
>       . "value='$id'>$name</option>";
> 
>   ?></select><input type="submit"></form>
> 
> ---------------
> miguel
> 
> 
> 

--- End Message ---
--- Begin Message ---
Hi, Is there any good info out there on how to connect to socks servers via
php.
Trying to redo the backend of my site to access a mysql database thats on
the other side of socks5 server. ?

-Chris


--- End Message ---
--- Begin Message ---
Adding data to session is the easy part!
Now i want to be clever and sneeky by adding data to the session with out
actually leaving the page that i am currently on.

Sort of like www.audiogalaxy.com when you click the satelite icon to
download an mp3.


--- End Message ---
--- Begin Message ---
On Sat, 25 May 2002, Vincent Kruger wrote:
> Adding data to session is the easy part!
> Now i want to be clever and sneeky by adding data to the session with out
> actually leaving the page that i am currently on.
> 
> Sort of like www.audiogalaxy.com when you click the satelite icon to
> download an mp3.

I'm pretty sure they just have a JavaScript that sends a request to the 
server. The page that it requests can of course do anything it wants with 
session data.

miguel

--- End Message ---

Reply via email to