php-general Digest 22 Jul 2002 12:54:28 -0000 Issue 1479

Topics (messages 108782 through 108851):

Re: Hex Help Please...
        108782 by: Georgie Casey
        108824 by: Martin Towell

Re: get a list of clients with PHP
        108783 by: Norbert Pfeiffer

Traversing an appendable file
        108784 by: Chris Earle

Amazon Web Service implemented in PHP
        108785 by: Daniel Kushner

Re: Sessions vs passing variables
        108786 by: Chris Earle
        108789 by: John Holmes
        108798 by: Mike Mannakee
        108800 by: John Holmes
        108803 by: Mike Mannakee
        108805 by: John Holmes
        108809 by: Mike Mannakee

Re: Submitting to cgi script
        108787 by: rdkurth.starband.net
        108791 by: Peter James

Re: HTML E-Mail
        108788 by: Alex Kirk

server performance
        108790 by: eat pasta type fasta
        108795 by: Chris Earle

Re: HTML E-mails
        108792 by: Chris Earle
        108846 by: Manuel Lemos

Re: Redirect Question
        108793 by: Chris Earle
        108794 by: Chris Earle
        108796 by: Jason Wong
        108799 by: Tim Luoma
        108833 by: JJ Harrison

NOT an easy upload
        108797 by: César Aracena
        108804 by: Chris Earle

Faster: Includes or DB Queries??
        108801 by: Monty
        108802 by: John Holmes

Oh, the problem
        108806 by: Chris Earle
        108811 by: César Aracena
        108816 by: Chris Earle

email
        108807 by: Bob Lockie
        108812 by: Bob Lockie
        108814 by: Peter
        108815 by: David Robley

Inline Images ?
        108808 by: Roberto Ramírez
        108810 by: John Holmes
        108813 by: Justin French

Using Javascript
        108817 by: Uma Shankari T.
        108818 by: Chris Earle
        108850 by: Martin Clifford

Re: Cookies - good or bad???
        108819 by: Chris Earle

Images of GD Library
        108820 by: Lord Loh.
        108835 by: Jason Wong

$HTTP_SERVER_VARS not accessible in Functions
        108821 by: Monty
        108837 by: Jason Wong

Re: html entry within XML "database"
        108822 by: Chris Earle

Re: how can this be? GET instead of POST -> db error
        108823 by: Chris Earle

automatic credit card processing
        108825 by: Dominic
        108826 by: Martin Towell
        108827 by: Dominic

Sessions without cookies : forms
        108828 by: PHPCoder
        108829 by: Richard Baskett

separated string by comas
        108830 by: rdkurth.starband.net
        108832 by: Martin Towell
        108836 by: Jason Wong

Session Tracking
        108831 by: Sachin Keshavan
        108838 by: John Holmes

Re: $HTTP_SERVER_VARS not accessible in Functions (fwd)
        108834 by: Sukumar .S

imagecolortransparent()
        108839 by: Nick
        108841 by: Tom Rogers

xslt_process
        108840 by: ctan
        108851 by: Peter Clarke

Newbie's question about \n
        108842 by: KK Lee
        108843 by: Niklas Lampén
        108844 by: Tom Rogers
        108845 by: Neil Freeman
        108848 by: KK Lee

multiple search
        108847 by: JJ Harrison

Re: include() and div align="top"
        108849 by: Jay Blanchard

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 ---
OK, i thought I found my solution but...

How come if I convert from "1000" from Binary to Hex in calculator, it
returns 8, but when I use the PHP bin2hex function, it returns loads of 3s
and 0s????


"Georgie Casey" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Rite,
>
> There's a PHP script that takes a monochrome BMP and converts it into some
> sort of hex code and I've noticed some patterns with this code. This image
> is 72 pixels wide by 14 high so there's 1008 pixels. In the code returned,
> theres 252 chars, which is 1008 divided by 4.
>
> So I guessed the image is split into 4 pixels each. So if I pass an image
> with the first pixel black and everyhting else white, it returns 8 for
those
> 4. If I pass an image with the first and second black, it returns c.
>
> With the first three black, it returns e. With the first 4, f. And if I
have
> the 5th pixel black it goes onto the next char code, eg returning f for
the
> first 4 pixels, then 8 for the 5th pixel black, ie the first pixel in the
> next 4. In total it returns f8.
>
> PS
> I tried reading in each pixel of the script, checking if it was black or
> white, 1 for black, 0 for white. Then converting these 0s and 1s from
> decimal to hex, then converting from binary to hex, but to no avail. Then
I
> tried taking a set of 4 1s or 0s and converting them, but still no luck.
>
> So my questions is, does anyone know how theyre encoding the image???? I
> could probably could decipher the coding with some experimentation but it
> really looks like hex and I might be wasting my time.
>
> TIA
>
>
>
>
>
>


--- End Message ---
--- Begin Message ---
Doesn't look like anyone has replied to you on the php-general mailing list.

Have a look at this page
http://www.wotsit.org/search.asp?s=graphics
some of the docs there might help you

HTH
Martin

-----Original Message-----
From: Georgie Casey [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 6:16 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Hex Help Please...


Rite,

There's a PHP script that takes a monochrome BMP and converts it into some
sort of hex code and I've noticed some patterns with this code. This image
is 72 pixels wide by 14 high so there's 1008 pixels. In the code returned,
theres 252 chars, which is 1008 divided by 4.

So I guessed the image is split into 4 pixels each. So if I pass an image
with the first pixel black and everyhting else white, it returns 8 for those
4. If I pass an image with the first and second black, it returns c.

With the first three black, it returns e. With the first 4, f. And if I have
the 5th pixel black it goes onto the next char code, eg returning f for the
first 4 pixels, then 8 for the 5th pixel black, ie the first pixel in the
next 4. In total it returns f8.

PS
I tried reading in each pixel of the script, checking if it was black or
white, 1 for black, 0 for white. Then converting these 0s and 1s from
decimal to hex, then converting from binary to hex, but to no avail. Then I
tried taking a set of 4 1s or 0s and converting them, but still no luck.

So my questions is, does anyone know how theyre encoding the image???? I
could probably could decipher the coding with some experimentation but it
really looks like hex and I might be wasting my time.

TIA







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello Richard,

> > My problem:
> > How can I receive a list of the PC's switched on
> > at present with PHP?
> > System calls are not a genuine solution.
> > The Script is not only to work under Linux.
> I don't think fsockopen's failure to open a socket
> will "kill" a PHP script...
harm,
I know that it like that is.
It annoys me already since PHP 3.0.3 ... :-(
Therefore I did not also ask for it.
I hope my problem to have clearly designated.


w. b. r. Norbert
______________________________
normally:   +49-(0)2292-681769
mobil call: +49-(0)177-2373368
------------------------------
e.o.m.

--- End Message ---
--- Begin Message ---
Is there any way to fseek (or something to the exact same effect) a file
opened with "a" or "a+"?

I've tried rewinding and fseeking appendable files, but neither work.

Opening up in "r+" gives me part of the desired result, but if where I want
to write is not at the end, it writes over things, which I obviously do not
want.


--- End Message ---
--- Begin Message ---
http://www.amazonlite.com/

--Daniel
--- End Message ---
--- Begin Message ---
What do you mean by pass? Using a GET method, POST, COOKIE or are you trying
to do something else (other than SESSION)?

"Mike Mannakee" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> When I try to pass a variable from one page to another the variable is
> completely inaccessible IF I have a session going.  The data has to be
> passed from one page to the next through the link, as the link tells which
> product the user hit.  Any thoughts?
>
> Mike Mannakee
>
>


--- End Message ---
--- Begin Message ---
> When I try to pass a variable from one page to another the variable is
> completely inaccessible IF I have a session going.  The data has to be
> passed from one page to the next through the link, as the link tells
which
> product the user hit.  Any thoughts?

Is there a variable by the same name in the session? If register_globals
is on, the session value could be overwriting the GET value.

---John Holmes...

--- End Message ---
--- Begin Message ---
No,

The strange thing is there isn't.  I have a test page that links to the
order form, having this html:

<form action="order_form.php" method="post">
<input type="hidden" name="prod_ids[]" value="9">
<input type="hidden" name="prod_ids[]" value="8">
<input type="hidden" name="prod_qtys[]" value="1">
<input type="hidden" name="prod_qtys[]" value="1">
<input type="submit" value="Order product"></form>


<p>
<a href=order_form.php?prod_ids[]=9&prod_qtys[]=1>Order</a>

I've tried it here as both a link and as hidden forms.  Neither on works if
I begin the script with:

if(!(session_id()))
 session_start();

I've actually figured a bit of a workaround by having the session begun on
earlier pages, and just continued on the order form.  I think when a session
is begun the server sends a cookie to the browser, and somehow that
transaction wipes out the variables, whether posted or passed by URL.  It's
a bit of a pain but it seems to be working.  I'm just now slightly nervous
that the order form is unable to begin a session if it needs to, but one
lives, right?

Mike


"John Holmes" <[EMAIL PROTECTED]> wrote in message
001b01c2311f$e19a2cc0$b402a8c0@mango">news:001b01c2311f$e19a2cc0$b402a8c0@mango...
> > When I try to pass a variable from one page to another the variable is
> > completely inaccessible IF I have a session going.  The data has to be
> > passed from one page to the next through the link, as the link tells
> which
> > product the user hit.  Any thoughts?
>
> Is there a variable by the same name in the session? If register_globals
> is on, the session value could be overwriting the GET value.
>
> ---John Holmes...
>


--- End Message ---
--- Begin Message ---
How are you testing whether the variables were passed or not? What
version of PHP are you using and is register_globals ON or OFF?

---John Holmes...

> -----Original Message-----
> From: Mike Mannakee [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 21, 2002 10:57 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Sessions vs passing variables
> 
> No,
> 
> The strange thing is there isn't.  I have a test page that links to
the
> order form, having this html:
> 
> <form action="order_form.php" method="post">
> <input type="hidden" name="prod_ids[]" value="9">
> <input type="hidden" name="prod_ids[]" value="8">
> <input type="hidden" name="prod_qtys[]" value="1">
> <input type="hidden" name="prod_qtys[]" value="1">
> <input type="submit" value="Order product"></form>
> 
> 
> <p>
> <a href=order_form.php?prod_ids[]=9&prod_qtys[]=1>Order</a>
> 
> I've tried it here as both a link and as hidden forms.  Neither on
works
> if
> I begin the script with:
> 
> if(!(session_id()))
>  session_start();
> 
> I've actually figured a bit of a workaround by having the session
begun on
> earlier pages, and just continued on the order form.  I think when a
> session
> is begun the server sends a cookie to the browser, and somehow that
> transaction wipes out the variables, whether posted or passed by URL.
> It's
> a bit of a pain but it seems to be working.  I'm just now slightly
nervous
> that the order form is unable to begin a session if it needs to, but
one
> lives, right?
> 
> Mike
> 
> 
> "John Holmes" <[EMAIL PROTECTED]> wrote in message
> 001b01c2311f$e19a2cc0$b402a8c0@mango">news:001b01c2311f$e19a2cc0$b402a8c0@mango...
> > > When I try to pass a variable from one page to another the
variable is
> > > completely inaccessible IF I have a session going.  The data has
to be
> > > passed from one page to the next through the link, as the link
tells
> > which
> > > product the user hit.  Any thoughts?
> >
> > Is there a variable by the same name in the session? If
register_globals
> > is on, the session value could be overwriting the GET value.
> >
> > ---John Holmes...
> >
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I'm on a server with php version 4.2.1 with register globals on.  The main
test has been can I access the variables in the script?  Oddly enough, if I
didn't use an array they are there for me.  Turns out it's only when I'm
trying to pass an array.  Single variables works fine.  I'm beginning to
think it's a bug.

Mike


"John Holmes" <[EMAIL PROTECTED]> wrote in message
001e01c2312e$a6149aa0$b402a8c0@mango">news:001e01c2312e$a6149aa0$b402a8c0@mango...
> How are you testing whether the variables were passed or not? What
> version of PHP are you using and is register_globals ON or OFF?
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Mike Mannakee [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, July 21, 2002 10:57 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Sessions vs passing variables
> >
> > No,
> >
> > The strange thing is there isn't.  I have a test page that links to
> the
> > order form, having this html:
> >
> > <form action="order_form.php" method="post">
> > <input type="hidden" name="prod_ids[]" value="9">
> > <input type="hidden" name="prod_ids[]" value="8">
> > <input type="hidden" name="prod_qtys[]" value="1">
> > <input type="hidden" name="prod_qtys[]" value="1">
> > <input type="submit" value="Order product"></form>
> >
> >
> > <p>
> > <a href=order_form.php?prod_ids[]=9&prod_qtys[]=1>Order</a>
> >
> > I've tried it here as both a link and as hidden forms.  Neither on
> works
> > if
> > I begin the script with:
> >
> > if(!(session_id()))
> >  session_start();
> >
> > I've actually figured a bit of a workaround by having the session
> begun on
> > earlier pages, and just continued on the order form.  I think when a
> > session
> > is begun the server sends a cookie to the browser, and somehow that
> > transaction wipes out the variables, whether posted or passed by URL.
> > It's
> > a bit of a pain but it seems to be working.  I'm just now slightly
> nervous
> > that the order form is unable to begin a session if it needs to, but
> one
> > lives, right?
> >
> > Mike
> >
> >
> > "John Holmes" <[EMAIL PROTECTED]> wrote in message
> > 001b01c2311f$e19a2cc0$b402a8c0@mango">news:001b01c2311f$e19a2cc0$b402a8c0@mango...
> > > > When I try to pass a variable from one page to another the
> variable is
> > > > completely inaccessible IF I have a session going.  The data has
> to be
> > > > passed from one page to the next through the link, as the link
> tells
> > > which
> > > > product the user hit.  Any thoughts?
> > >
> > > Is there a variable by the same name in the session? If
> register_globals
> > > is on, the session value could be overwriting the GET value.
> > >
> > > ---John Holmes...
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
> I'm on a server with php version 4.2.1 with register globals on.  The
main
> test has been can I access the variables in the script?  Oddly enough,
if
> I
> didn't use an array they are there for me.  Turns out it's only when
I'm
> trying to pass an array.  Single variables works fine.  I'm beginning
to
> think it's a bug.

Why are you trying to use an array? The values are there, I imagine you
are just trying to access them incorrectly.

> > > <a href=order_form.php?prod_ids[]=9&prod_qtys[]=1>Order</a>

For that URL, which you should be using quotes around, you'll have
$_GET['prod_ids'][0] --> 9 and $_GET['prod_qtys'][0] --> 1. Or,
$prod_ids[0] --> 9, etc, since register_globals is on.

---John Holmes...

--- End Message ---
--- Begin Message ---
Right, I understand I should be able to access them.  That's the whole
problem.  They're not there.

I can do one of two things and they magically become available:

1. Don't start the session.

2. Use single variables, not arrays.

#2, however, would create a problem in that I intend to set it up that a
person can have more than one item in their shopping cart.  This hoses that,
as I was planning on having the product ids passed as hidden fields so as
not to have to rely on the session functions to keep items in the shopping
cart.

Mike


"John Holmes" <[EMAIL PROTECTED]> wrote in message
002001c23131$e05a0670$b402a8c0@mango">news:002001c23131$e05a0670$b402a8c0@mango...
> > I'm on a server with php version 4.2.1 with register globals on.  The
> main
> > test has been can I access the variables in the script?  Oddly enough,
> if
> > I
> > didn't use an array they are there for me.  Turns out it's only when
> I'm
> > trying to pass an array.  Single variables works fine.  I'm beginning
> to
> > think it's a bug.
>
> Why are you trying to use an array? The values are there, I imagine you
> are just trying to access them incorrectly.
>
> > > > <a href=order_form.php?prod_ids[]=9&prod_qtys[]=1>Order</a>
>
> For that URL, which you should be using quotes around, you'll have
> $_GET['prod_ids'][0] --> 9 and $_GET['prod_qtys'][0] --> 1. Or,
> $prod_ids[0] --> 9, etc, since register_globals is on.
>
> ---John Holmes...
>


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

This worked now my question is. Is there a way to force it to submit with
POST rather than GET

Sunday, July 21, 2002, 5:12:30 PM, you wrote:


RH> Instead of doing it as a command, try it through the webserver....

RH> <?php

RH> header( "Location:
RH> http://localhost/cgi-bin/siteUserEmail/siteUserEmail.cgi?forwardaddr=$forwar
RH> daddr&aliases=$aliases&vacationmode=$vacationmode&vacationmsg=$vacationmsg&n
RH> ame=$name&group=$group&page=$page" );

?>>


RH> Or you can use something else...but send it to the web server...



RH> .: B i g D o g :.


RH> ----- Original Message -----
RH> From: <[EMAIL PROTECTED]>
RH> To: "B i g D o g" <[EMAIL PROTECTED]>; "php-general"
RH> <[EMAIL PROTECTED]>
RH> Sent: Sunday, July 21, 2002 6:15 PM
RH> Subject: Re[2]: [PHP] Submitting to cgi script


>> Hello B,
>> I just submitted directly to the cgi script and did it with a GET and
>> it worked so that is not the problem. Any other suggestions
>>
>> Sunday, July 21, 2002, 4:52:09 PM, you wrote:
>>
>>
>> BigDog> In your example you are using the method of POST to pass the form
RH> data to
>> BigDog> the cgi script.  However, when you pass the data to the cgi script
RH> from the
>> BigDog> php script you are using the GET method to pass the data.
>>
>> BigDog> Check and see if the cgi can accept with METHOD="GET"
>>
>> BigDog> .: B i g D o g :.
>>
>>
>> BigDog> ----- Original Message -----
>> BigDog> From: <[EMAIL PROTECTED]>
>> BigDog> To: "php-general" <[EMAIL PROTECTED]>
>> BigDog> Sent: Sunday, July 21, 2002 5:46 PM
>> BigDog> Subject: [PHP] Submitting to cgi script
>>
>>
>> >> How can I do this
>> >>
>> >> I have a form that I want to submit to a second php script that in turn
>> >> submits to a cgi script but I can not get it to work. If I submit
>> >> from the form to the cgi script it works just fine. But there are
>> >> something that I need to do with the data besides submitting to the
>> >> cgi script. Could you look at the sample code below and see if I am
>> >> doing something wrong. I hope this makes sense I am not quit sure how
>> >> to ask what I want to know
>> >> If I was submitting directly to the cgi script the form action would
>> >> look like this
>> >>  <FORM ACTION="/cgi-bin/siteUserEmail/siteUserEmail.cgi" METHOD="POST">
>> >>
>> >>
>> >>
>> >> <FORM ACTION="siteUserEmail.php" METHOD="POST">
>> >> <INPUT TYPE="TEXT" NAME="forwardaddr" SIZE="32" VALUE="">
>> >> <TEXTAREA NAME="aliases" ROWS="5" COLS="32"></TEXTAREA>
>> >> <INPUT TYPE="CHECKBOX" NAME="vacationmode" VALUE="on" >
>> >> <TEXTAREA NAME="vacationmsg" ROWS="5" COLS="32"></TEXTAREA>>
>> >> <INPUT TYPE="HIDDEN" NAME="name" SIZE="-1" VALUE="tester54321">
>> >> <INPUT TYPE="HIDDEN" NAME="group" SIZE="-1" VALUE="site53">
>> >> <INPUT TYPE="HIDDEN" NAME="page" SIZE="-1" VALUE="siteuseremail">
>> >> <input type="submit" name="Submit" value="submit">
>> >> </FORM>
>> >>
>> >> The siteUserEmail.php file
>> >> <?
>> >> $cmd="/cgi-bin/siteUserEmail/siteUserEmail.cgi?forwardaddr=$forwardaddr
>> >> &aliases=$aliases&vacationmode=$vacationmode&vacationmsg=$vacationmsg
>> >> &name=$name&group=$group&page=$page";
>> >> exec($cmd);
>> >> ?>
>> >> --
>> >> Best regards,
>> >>  rdkurth                          mailto:[EMAIL PROTECTED]
>> >>
>> >>
>> >> --
>> >> PHP General Mailing List (http://www.php.net/)
>> >> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>
>> --
>> Best regards,
>>  rdkurth                            mailto:[EMAIL PROTECTED]
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php





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

--- End Message ---
--- Begin Message ---
> This worked now my question is. Is there a way to force it to submit with
> POST rather than GET
>

Look at the CURL functions on php.net


--- End Message ---
--- Begin Message ---
Damn, what a flame war I've started! I had no idea... 

In any case, Richard: I agree that HTML e-mails, generally speaking, suck. 
The most HTML I **personally** think should be in an e-mail is a quick link 
to a web page, maybe a bit of text coloration/sizing for emphasis. 

However, **professionally**, I'm looking at something completely different. 
I run a small web services business looking for any form of cash possible, 
and a local portal site has offered to promote on their site an HTML 
e-mailing system that we create -- and they have customers *begging* for it. 
While I as an individual may despise HTML e-mail, I as a businessman cannot 
turn down such an obvious revenue-generation stream, especially in today's 
economy. 

I came to the list looking for technical help because it's something that I 
need to do, not something I want to promote. Whatever my motives may have 
been, though, there's no reason to launch such a tirade on the subject 
on-list -- if you want to bitch and moan and flame, it's just as easy to do 
off-list. 

Please, please, let's kill this thread and all the animosity going with it 
 -- *especially* since I've been kindly pointed in all the directions needed 
for technical help. 

Alex Kirk
--- End Message ---
--- Begin Message ---
Not exactly a PHP question, but you guys will know,

is there a significant performance difference in how long does it take a 
server to find files as the directories become more nested,

eg.

1. file index.php uses images from directory DIR

vs.

2. file index.php uses images from directory images/DIR

vs.

3. file index.php uses images from directory files/images/DIR

Thanks in advance,

R>



________________________--__-______-______________
eat pasta
type fasta

--- End Message ---
--- Begin Message ---
I think that's entirely dependent on the server's OS.  If the OS has a
problem, then yes, obviously, otherwise I don't see a reason (unless there
is a bug) for significant speed loss.
"Eat Pasta Type Fasta" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Not exactly a PHP question, but you guys will know,
>
> is there a significant performance difference in how long does it take a
> server to find files as the directories become more nested,
>
> eg.
>
> 1. file index.php uses images from directory DIR
>
> vs.
>
> 2. file index.php uses images from directory images/DIR
>
> vs.
>
> 3. file index.php uses images from directory files/images/DIR
>
> Thanks in advance,
>
> R>
>
>
>
> ________________________--__-______-______________
> eat pasta
> type fasta
>


--- End Message ---
--- Begin Message ---
What's so hard with stopping script kiddies (which is just about all you can
do with an e-mail to my knowledge -- aside from attachments).

In PHP or Perl you could easily write a script that kills ANY <SCRIPT> tags
and <APPLET> tags, as well as anything else that might pop up anything.  I
don't understand why no one just does that with C++, it's not even that hard
in that either (actually pretty easy because you just find the <SCRIPT> or
whatever tag and then delete everything until the end tag ... if that means
bye bye e-mail, then bye bye e-mail).  Is there some other flaw (other than
the awe-inspiring trust that of attachments that people have) that I don't
know about?

Maybe some day I might just have to work on something similar to this idea.


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

On 07/20/2002 07:14 PM, Alex Kirk wrote:
> I've just set out to build a PHP-based mail system that will be able to 
> send HTML e-mails to a variety of mail clients. So far, I'm having 
> moderate success: I can get Yahoo! and Hotmail to see the HTML, but not 
> Netscape Mail or Outlook Express.
> I was wondering, is there anything special I should be putting in my 
> mail() call to achieve broad compatibility? I'm already sending a header 
> that includes:
> MIME-Version: 1.0\r\n
> Content-type: text/html; charset=iso-8859-1\r\n
> Also, does anyone know of a list of mail client compatiblity levels with 
> HTML e-mail?

Just avoid using Javascript because most mail programs will disable it.

Other than that you ought to always send multipart-alternative MIME 
messages where the HTML version is indeed an alternative to a text 
version of your message. If you do not do that, some people will discard 
your messages confusing them with SPAM, unless what you are sendind is 
really solicited mail.


-- 

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
> Which versions of IE is somebody claiming can't handle a Location: header?

It's not version 6....


--- End Message ---
--- Begin Message ---
> Which versions of IE is somebody claiming can't handle a Location: header?

And it's not version 4 (I'm assuming not 5(.5) either)


--- End Message ---
--- Begin Message ---
On Monday 22 July 2002 10:35, Chris Earle wrote:
> > Which versions of IE is somebody claiming can't handle a Location:
> > header?
>
> And it's not version 4 (I'm assuming not 5(.5) either)

When you say version 4, which version 4 do you mean? Ditto for version 5. With 
so many patches and 'upgrades' issued for IE I won't surprised if there is 
some combination which causes Location: header to fail.

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

/*
All life evolves by the differential survival of replicating entities.
                -- Dawkins
*/

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

FWIW, a user note at http://www.php.net/manual/en/function.header.php 
says :

There is this nasty bug in IE 5 for Windows prior to service pack 2, 
described  in Microsoft knowledgebase article Q281197 which causes a 
problem with  redirecting.. if you submit a POST form to a page that 
uses header() to redirect  to another page after processing the form 
data, then IE will not display some of  the images on the page, if the 
user has an "external HTTP namespace handler"  (RealDownload for 
example) installed. It took me a very long time to figure this  out; I 
had no idea why my ads weren't displaying on IE for windows but worked 
fine everywhere else.



--- End Message ---
--- Begin Message ---
That answers my question.

Thanks,


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

"Tim Luoma" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> FWIW, a user note at http://www.php.net/manual/en/function.header.php
> says :
>
> There is this nasty bug in IE 5 for Windows prior to service pack 2,
> described  in Microsoft knowledgebase article Q281197 which causes a
> problem with  redirecting.. if you submit a POST form to a page that
> uses header() to redirect  to another page after processing the form
> data, then IE will not display some of  the images on the page, if the
> user has an "external HTTP namespace handler"  (RealDownload for
> example) installed. It took me a very long time to figure this  out; I
> had no idea why my ads weren't displaying on IE for windows but worked
> fine everywhere else.
>
>
>


--- End Message ---
--- Begin Message ---
Hi all. I’m trying to handle a picture upload. So far, I’ve made my
script store it where I want with the name I want. The only problem now,
is that it should store that given name into a MySQL DB table… I tried
it by calling a function which stores the picture and returns a variable
called $picname then use an UPDATE statement but that variable isn’t
passed… any ideas? The code looks like this:

function pic_upload($userid)
{
        if (is_uploaded_file($_FILES['devpicture']['tmp_name']))
        {
                $filename = $_FILES['devpicture']['tmp_name'];
                
                $realname = $_FILES['devpicture']['name'];
                
                $username = $userid.".jpg";
                
                copy($_FILES['devpicture']['tmp_name'],
"c:/apache/htdocs/os-seek/photos\\".$username);
                
                $username;
        }
        else
        {
                echo "Possible file upload attack: filename
".$_FILES['devpicture']['name'].".<br>";
        }
}

-------------------------------------------
and then the updating
-------------------------------------------

pic_upload($id);
                                        
$query = "UPDATE os_developers SET devpicture = '$username' WHERE devid
= $id";
$result = mysql_query($query) or die(mysql_error());

Thanks in advance,

Cesar Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621



--- End Message ---
--- Begin Message ---
>>function pic_upload($userid)
>>{
>>if (is_uploaded_file($_FILES['devpicture']['tmp_name']))
>>{
>>$filename = $_FILES['devpicture']['tmp_name'];
>>$realname = $_FILES['devpicture']['name'];

>>$username = $userid.".jpg";

>>copy($_FILES['devpicture']['tmp_name'],
"c:/apache/htdocs/os-seek/photos\\".$username);
>>$username;
>>}
>>else
>>{
>>echo "Possible file upload attack: filename
>>".$_FILES['devpicture']['name'].".<br>";
>>}
>>}

>>-------------------------------------------
>>and then the updating
>>-------------------------------------------

>>pic_upload($id);

>>$query = "UPDATE os_developers SET devpicture = '$username' WHERE devid
>>= $id";
>>$result = mysql_query($query) or die(mysql_error());

I don't exactly know what is wrong, but I can definitely tell you that you
have two gaping security holes with this code.  Unless you're doing checks
that you did not show (which is highly likely), $username and $id can be set
to anything.  I'm not exactly sure how important/unimpornant some of that
stuff is, but you might want to make sure you kill off MySQL comment code
inside there and other possible exploits.

The other problem with your code is that you're not debugging it.  Set up
echo statements here and there to make sure variables are defined as you
think they are, that's the biggest mistake I see myself and others make, not
defining variables as I think I am.


--- End Message ---
--- Begin Message ---
Is there much of a difference in speed or efficiency between INCLUDEing
files in a script or loading data from a database? I'm building a dynamic
menu system for a website and not sure if it would be faster to store button
data in a DB or just do it with Included files.


--- End Message ---
--- Begin Message ---
> Is there much of a difference in speed or efficiency between
INCLUDEing
> files in a script or loading data from a database? I'm building a
dynamic
> menu system for a website and not sure if it would be faster to store
> button
> data in a DB or just do it with Included files.

Includes are faster overall. If you already have a database connection
open for other things, then there won't be as much of an overhead for
using the database. 

---John Holmes...

--- End Message ---
--- Begin Message ---
It appears that $username isn't being defined within the scope of the query.
You define it only in the function.

Try do this instead:

$username = "";

function pic_upload($userid)
{
global $username;
//... the rest of the code
}
// now do the queries and everything else.

I think that will fix your problem.

"César aracena" <[EMAIL PROTECTED]> wrote in message
000301c23129$aebbab30$adc405c8@gateway">news:000301c23129$aebbab30$adc405c8@gateway...
Hi all. I'm trying to handle a picture upload. So far, I've made my
script store it where I want with the name I want. The only problem now,
is that it should store that given name into a MySQL DB table. I tried
it by calling a function which stores the picture and returns a variable
called $picname then use an UPDATE statement but that variable isn't
passed. any ideas? The code looks like this:

function pic_upload($userid)
{
if (is_uploaded_file($_FILES['devpicture']['tmp_name']))
{
$filename = $_FILES['devpicture']['tmp_name'];

$realname = $_FILES['devpicture']['name'];

$username = $userid.".jpg";

copy($_FILES['devpicture']['tmp_name'],
"c:/apache/htdocs/os-seek/photos\\".$username);

$username;
}
else
{
echo "Possible file upload attack: filename
".$_FILES['devpicture']['name'].".<br>";
}
}

-------------------------------------------
and then the updating
-------------------------------------------

pic_upload($id);

$query = "UPDATE os_developers SET devpicture = '$username' WHERE devid
= $id";
$result = mysql_query($query) or die(mysql_error());

Thanks in advance,

Cesar Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621





--- End Message ---
--- Begin Message ---
Chris. Thanks for living me a hand in such a fast way. It helped me
fine.

César.

> -----Original Message-----
> From: Chris Earle [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 22, 2002 12:51 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Oh, the problem
> 
> It appears that $username isn't being defined within the scope of the
> query.
> You define it only in the function.
> 
> Try do this instead:
> 
> $username = "";
> 
> function pic_upload($userid)
> {
> global $username;
> //... the rest of the code
> }
> // now do the queries and everything else.
> 
> I think that will fix your problem.
> 
> "César aracena" <[EMAIL PROTECTED]> wrote in message
> 000301c23129$aebbab30$adc405c8@gateway">news:000301c23129$aebbab30$adc405c8@gateway...
> Hi all. I'm trying to handle a picture upload. So far, I've made my
> script store it where I want with the name I want. The only problem
now,
> is that it should store that given name into a MySQL DB table. I tried
> it by calling a function which stores the picture and returns a
variable
> called $picname then use an UPDATE statement but that variable isn't
> passed. any ideas? The code looks like this:
> 
> function pic_upload($userid)
> {
> if (is_uploaded_file($_FILES['devpicture']['tmp_name']))
> {
> $filename = $_FILES['devpicture']['tmp_name'];
> 
> $realname = $_FILES['devpicture']['name'];
> 
> $username = $userid.".jpg";
> 
> copy($_FILES['devpicture']['tmp_name'],
> "c:/apache/htdocs/os-seek/photos\\".$username);
> 
> $username;
> }
> else
> {
> echo "Possible file upload attack: filename
> ".$_FILES['devpicture']['name'].".<br>";
> }
> }
> 
> -------------------------------------------
> and then the updating
> -------------------------------------------
> 
> pic_upload($id);
> 
> $query = "UPDATE os_developers SET devpicture = '$username' WHERE
devid
> = $id";
> $result = mysql_query($query) or die(mysql_error());
> 
> Thanks in advance,
> 
> Cesar Aracena
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
> 
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Sure thing.  Always love to help.

-Chris


"César aracena" <[EMAIL PROTECTED]> wrote in message
001801c23136$6748bb50$adc405c8@gateway">news:001801c23136$6748bb50$adc405c8@gateway...
Chris. Thanks for living me a hand in such a fast way. It helped me
fine.

César.

> -----Original Message-----
> From: Chris Earle [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 22, 2002 12:51 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Oh, the problem
>
> It appears that $username isn't being defined within the scope of the
> query.
> You define it only in the function.
>
> Try do this instead:
>
> $username = "";
>
> function pic_upload($userid)
> {
> global $username;
> //... the rest of the code
> }
> // now do the queries and everything else.
>
> I think that will fix your problem.
>
> "César aracena" <[EMAIL PROTECTED]> wrote in message
> 000301c23129$aebbab30$adc405c8@gateway">news:000301c23129$aebbab30$adc405c8@gateway...
> Hi all. I'm trying to handle a picture upload. So far, I've made my
> script store it where I want with the name I want. The only problem
now,
> is that it should store that given name into a MySQL DB table. I tried
> it by calling a function which stores the picture and returns a
variable
> called $picname then use an UPDATE statement but that variable isn't
> passed. any ideas? The code looks like this:
>
> function pic_upload($userid)
> {
> if (is_uploaded_file($_FILES['devpicture']['tmp_name']))
> {
> $filename = $_FILES['devpicture']['tmp_name'];
>
> $realname = $_FILES['devpicture']['name'];
>
> $username = $userid.".jpg";
>
> copy($_FILES['devpicture']['tmp_name'],
> "c:/apache/htdocs/os-seek/photos\\".$username);
>
> $username;
> }
> else
> {
> echo "Possible file upload attack: filename
> ".$_FILES['devpicture']['name'].".<br>";
> }
> }
>
> -------------------------------------------
> and then the updating
> -------------------------------------------
>
> pic_upload($id);
>
> $query = "UPDATE os_developers SET devpicture = '$username' WHERE
devid
> = $id";
> $result = mysql_query($query) or die(mysql_error());
>
> Thanks in advance,
>
> Cesar Aracena
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




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

I need help with sending email.
I can hear 127.0.0.1 doing something (I assume it sends email because there are no 
bounces).

I have the following in my php.ini file:

sendmail_from = [EMAIL PROTECTED]
sendmail_path = /usr/sbin/sendmail -t -i


The PHP is:
mail( $to, $subj, $Message );

I am sure all the variables are valid.



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

>try doing a echo eg
>
>$mail = mail( $to, $subj, $Message );
>echo $to;
>echo "<BR>";
>echo $subj;
>echo "<BR>";
>echo $Message;
>echo "<BR>";
>echo $mail;
>
>and see if that is setting the variables...if $mail = 1 then on php's side mail is 
>sent if it's 0 then u have an error

How can I see what the error is?

>> -----Original Message-----
>> From: Bob Lockie [mailto:[EMAIL PROTECTED]]
>> Sent: Monday, 22 July 2002 1:56 PM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] email
>> 
>> 
>> 
>> I need help with sending email.
>> I can hear 127.0.0.1 doing something (I assume it sends email 
>> because there are no bounces).
>> 
>> I have the following in my php.ini file:
>> 
>> sendmail_from = [EMAIL PROTECTED]
>> sendmail_path = /usr/sbin/sendmail -t -i
>> 
>> 
>> The PHP is:
>> mail( $to, $subj, $Message );
>> 
>> I am sure all the variables are valid.
>> 
>> 
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
>> 
>



--- End Message ---
--- Begin Message ---
> >try doing a echo eg
> >
> >$mail = mail( $to, $subj, $Message );
> >echo $to;
> >echo "<BR>";
> >echo $subj;
> >echo "<BR>";
> >echo $Message;
> >echo "<BR>";
> >echo $mail;
> >
> >and see if that is setting the variables...if $mail = 1 then on 
> php's side mail is sent if it's 0 then u have an error
> 
> How can I see what the error is?
> 


what do the echo's say? if they have no input then there's a error

also  but not 100% on this if u put 
error_reporting=E_ALL & ~E_NOTICE in php that might tell u where bouts the error is.. 
--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> 
> >try doing a echo eg
> >
> >$mail = mail( $to, $subj, $Message );
> >echo $to;
> >echo "<BR>";
> >echo $subj;
> >echo "<BR>";
> >echo $Message;
> >echo "<BR>";
> >echo $mail;
> >
> >and see if that is setting the variables...if $mail = 1 then on php's side mail is 
>sent if it's 0 then u have an error
> 
> How can I see what the error is?
> 

Check the logs for your MTA (sendmail, qmail whatever) for errors

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
Hello list...
 
 
Is there a way to display an image withouth sending the headers first?
 
I'm trying to display an inline image... but when I try it just only
send the raw image data...
 
I've thinking that I need to save an image first to disk and then
display the image later... 
 
I don't want to do this... but I wanna hear another possiblities before
doing that...
 
Any suggestions?
 
 
Roberto Ramírez
--- End Message ---
--- Begin Message ---
> Is there a way to display an image withouth sending the headers first?
> 
> I'm trying to display an inline image... but when I try it just only
> send the raw image data...
> 
> I've thinking that I need to save an image first to disk and then
> display the image later...
> 

You need to have a separate file that creates your images.

<img src='file.php'>

Where file.php should create your image headers and send the data.

---John Holmes...

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

I've never done much in the way of dynamic images, but I don't believe you
send images inline...

I believe browsers still need an image tag, but instead of myimage.gif, I'm
pretty sure you call a php script instead:

<IMG SRC="makeMeAnImage.php?id=myimage" />

makeMeAnImage.php outputs a GIF/JPG/PNG header, followed by the image data.


At least that's my (limited, theoretical) understanding.


Justin French

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

Hello,

 I need to display a value on the text box during onClick event where the
data is fetched from the database..I have given the code like this but it
is giving unterminated string constant..


<input type=text name=text1 onClick=(dd.value="<? echo $correct; ?>");


Can anyone please tell me how to solve this ... 


Thanks & Regards,
Uma

--- End Message ---
--- Begin Message ---
You use the "onClick" feature like this:

<input type="text" name="text1" onClick="dd.value='<? echo $correct; ?>'">
no semicolon unless there is more than one thing being called/defined -- you
use single quotes within the onClick's double quotes

"Uma Shankari T." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hello,
>
>  I need to display a value on the text box during onClick event where the
> data is fetched from the database..I have given the code like this but it
> is giving unterminated string constant..
>
>
> <input type=text name=text1 onClick=(dd.value="<? echo $correct; ?>");
>
>
> Can anyone please tell me how to solve this ...
>
>
> Thanks & Regards,
> Uma
>


--- End Message ---
--- Begin Message ---
Just my opinion, but it is ALWAYS a good idea to terminate statements with semicolons, 
no matter if there is or isn't additional statements.

But thanks Chris for at least using standardized HTML coding practices.  I can't stand 
it when I see tags and the like that don't cooperate with standards.

Martin

>>> "Chris Earle" <[EMAIL PROTECTED]> 07/22/02 01:18AM >>>
You use the "onClick" feature like this:

<input type="text" name="text1" onClick="dd.value='<? echo $correct; ?>'">
no semicolon unless there is more than one thing being called/defined -- you
use single quotes within the onClick's double quotes

"Uma Shankari T." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hello,
>
>  I need to display a value on the text box during onClick event where the
> data is fetched from the database..I have given the code like this but it
> is giving unterminated string constant..
>
>
> <input type=text name=text1 onClick=(dd.value="<? echo $correct; ?>");
>
>
> Can anyone please tell me how to solve this ...
>
>
> Thanks & Regards,
> Uma
>



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


--- End Message ---
--- Begin Message ---
Can't you say that about anything?

"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I don't use cookies either due to the fact that some web browser block the
> cookies and some web browser's bug that affected the cookie.  For example,
> if Internet Explorer have a bug with the cookie then it is gurantee that
> you'll never find MS to have this bug fix in a few days.  It could take 6
> months or a year.  So, what's the point with using hte cookie?
>
> "Analysis & Solutions" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > On Thu, Jul 18, 2002 at 03:38:51PM +0200, PHPCoder wrote:
> >
> > > What are the general feeling out there amongst developers about the
use
> > > of cookies?
> >
> > Cookies rely on client side.  I never rely on the client for anything.
> >
> > When it comes to examples of how to do things "The Right Way," I say go
> > take a look at amazon.com.  No cookies.  No Java'sCrap.  Works
flawlessly.
> >
> > --Dan
> >
> > --
> >                PHP classes that make web design easier
> >         SQL Solution  |   Layout Solution   |  Form Solution
> >     sqlsolution.info  | layoutsolution.info |  formsolution.info
> >  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
> >  4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
>
>


--- End Message ---
--- Begin Message ---
1. How can I store an image in a database.. ?
2. How can this be now used to create an image ?
3. Is there any way I can read an image from a remote site and save it's
minature view in my DB / file ? (How can an image be resized ?)



--- End Message ---
--- Begin Message ---
On Monday 22 July 2002 15:35, Lord Loh. wrote:
> 1. How can I store an image in a database.. ?
> 2. How can this be now used to create an image ?

Search archives for various combinations of:

  upload, image, mysql

> 3. Is there any way I can read an image from a remote site and save it's
> minature view in my DB / file ? (How can an image be resized ?)

After you've figured out 1 & 2, read up on fopen().

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

/*
Some don't prefer the pursuit of happiness to the happiness of pursuit.
*/

--- End Message ---
--- Begin Message ---
I'm trying to access some settings in the $HTTP_SERVER_VARS[] array, but,
within a custom function() this array appears empty. In the calling script,
however, the $HTTP_SERVER_VARS[] array is defined.

I thought this was supposed to be "superglobal" and available on every
level? If not, is there another command I can use? I also tried $_SERVER[]
but this appears to be always empty no matter what level I call it on.

Thanks.

Monty


--- End Message ---
--- Begin Message ---
On Monday 22 July 2002 13:46, Monty wrote:
> I'm trying to access some settings in the $HTTP_SERVER_VARS[] array, but,
> within a custom function() this array appears empty. In the calling script,
> however, the $HTTP_SERVER_VARS[] array is defined.
>
> I thought this was supposed to be "superglobal" and available on every
> level? If not, is there another command I can use? I also tried $_SERVER[]
> but this appears to be always empty no matter what level I call it on.

$HTTP_SERVER_VARS was never a superglobal. $_SERVER is a superglobal but only 
available on php 4.1.X or above. Read the docs for the details.

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

/*
Unprovided with original learning, unformed in the habits of thinking,
unskilled in the arts of composition, I resolved to write a book.
                -- Edward Gibbon
*/

--- End Message ---
--- Begin Message ---
You can of course use htmlspecialcharacters (check php manual if you don't
know what this is) and then it will kill every thing that generates errors.

"William S." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am experimenting with using an XML file as a
> database. One of the things I do is provide
> a way of adding records to the database by an
> html form.
>
> This seems to work out well so far unless one
> of the fields in a record contains an html
> reference. The result is a Sablotron parse error.
>
> What is the best way around this? Should I
> validate the form before it is submitted so that
> html references are rejected? How would I do this?
>
> --
> Bill
> Amsterdam, NL


--- End Message ---
--- Begin Message ---
The person could have been trying to break into the DB.

"Andy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi everybody,
>
> I am just trying to find out how some db errors happened during a user was
> browsing my web app.
>
> This is out of the Apache log:
>
> GET /subapp_profiles/act_upload_image.php HTTP/1.1" 200 160
> POST /subapp_profiles/act_upload_image.php HTTP/1.1" 302 5
>
> I do not have a clue where this GET request could come from. This has
caused
> a empty sql statement and therefore a db error. How can could this be
> achieved? By clicking back in the browser window? I dont think so since
the
> same user was on another site before.
>
> Has anybody a idea on that?
>
> Andy
>
>


--- End Message ---
--- Begin Message ---
Hi all
I try to automatically process cc payment. I use online clearing via a 
third party
--> so what I have to do:
1. SSL-TCP/IP connection to this third party-server
2. perform basic http authentication
3. send authorization request parameters to the software (via POST or GET)
4. receive + parse authorization response

1-3 is not a real problem, but how can I receive the response, before it 
is printed out to the browser/screen? I know I should get the response 
string into a variable so the whole procedure is "silent", but how?

thanks a lot for every little help!

cheers

dominic
-- 
dominic brander

________________________________________________________________________
dominic brander - snowflake productions gmbh - http://www.snowflake.ch
tel. 01 451 75 71 - fax. 01 451 63 80 - mobile 076 543 17 94

--- End Message ---
--- Begin Message ---
either use curl, and set to option to return the results to you to on
or use ob_start(), ob_get_contents(), etc

-----Original Message-----
From: Dominic [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 4:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] automatic credit card processing


Hi all
I try to automatically process cc payment. I use online clearing via a 
third party
--> so what I have to do:
1. SSL-TCP/IP connection to this third party-server
2. perform basic http authentication
3. send authorization request parameters to the software (via POST or GET)
4. receive + parse authorization response

1-3 is not a real problem, but how can I receive the response, before it 
is printed out to the browser/screen? I know I should get the response 
string into a variable so the whole procedure is "silent", but how?

thanks a lot for every little help!

cheers

dominic
-- 
dominic brander

________________________________________________________________________
dominic brander - snowflake productions gmbh - http://www.snowflake.ch
tel. 01 451 75 71 - fax. 01 451 63 80 - mobile 076 543 17 94


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
great! it works! thank you very much!
this is the code which does exactly what I wanted:
$ch = curl_init ();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "RESP_FORMAT=1");
$result= curl_exec ($ch);
curl_close ($ch);

cheerio



Martin Towell wrote:
> either use curl, and set to option to return the results to you to on
> or use ob_start(), ob_get_contents(), etc
> 
> -----Original Message-----
> From: Dominic [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 22, 2002 4:11 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] automatic credit card processing
> 
> 
> Hi all
> I try to automatically process cc payment. I use online clearing via a 
> third party
> --> so what I have to do:
> 1. SSL-TCP/IP connection to this third party-server
> 2. perform basic http authentication
> 3. send authorization request parameters to the software (via POST or GET)
> 4. receive + parse authorization response
> 
> 1-3 is not a real problem, but how can I receive the response, before it 
> is printed out to the browser/screen? I know I should get the response 
> string into a variable so the whole procedure is "silent", but how?
> 
> thanks a lot for every little help!
> 
> cheers
> 
> dominic


-- 
dominic brander

________________________________________________________________________
dominic brander - snowflake productions gmbh - http://www.snowflake.ch
tel. 01 451 75 71 - fax. 01 451 63 80 - mobile 076 543 17 94

--- End Message ---
--- Begin Message ---
Hi, thanks for all the replies on my two previous postings relating to 
sessions and cookies.
I have set my mind on using sessions but without cookies, so that 
entails passing the SID via relative URL's.
My problem comes in here, when I create a simple login page with a form 
that send username and password to the next page, I start_session(); and 
then in the form action, I append the url with <?=SID?> , but that 
causes two parse errors.

Warning: Cannot send session cookie - headers already sent by (output 
started at /home/www/index.php:3) in /home/www/index.php on line 4
 
Warning: Cannot send session cache limiter - headers already sent 
(output started at /home/www/index.php:3) in /home/www/index.php on line 4
 
The code is like so:
<html>
<head>
<?php
    session_start();
?>
   
</head>
<body>
<form name="form1" method="post" action="admin_select_project.php?<?=SID?>">
  <table border="0" cellspacing="0" cellpadding="0">
    <tr bgcolor="#CFCFCF">
      <td colspan="2">Admin Login
      </td>
    </tr>
    <tr>
      <td>Username:
      </td>
      <td><input type="text" name="username">
      </td>
    </tr>
    <tr>
      <td>Password:
      </td>
      <td><input type="text" name="password">
      </td>
    </tr>
    <tr>
      <td>
        <input type="submit" name="Submit4" value="Submit">
      </td>
    </tr>
  </table>
</form>
</body>
</html>
What am I missing...

Thanks


--- End Message ---
--- Begin Message ---
You need to start the session before any html.  So:

<?php session_start(); ?>
<html>

Cheers!

Rick

"Too much caution is bad for you. By avoiding things you fear, you may let
yourself in for unhappy consequences. It is usually wiser to stand up to a
scary-seeming experience and walk right into it, risking the bruises as hard
knocks. You are likely to find it is not as tough as you had thought.  Or
you may find it plenty tough, but also discover you have what it takes to
handle it." - Norman Vincent Peale

> From: PHPCoder <[EMAIL PROTECTED]>
> Date: Mon, 22 Jul 2002 08:36:44 +0200
> To: php-general <[EMAIL PROTECTED]>
> Subject: [PHP] Sessions without cookies : forms
> 
> Hi, thanks for all the replies on my two previous postings relating to
> sessions and cookies.
> I have set my mind on using sessions but without cookies, so that
> entails passing the SID via relative URL's.
> My problem comes in here, when I create a simple login page with a form
> that send username and password to the next page, I start_session(); and
> then in the form action, I append the url with <?=SID?> , but that
> causes two parse errors.
> 
> Warning: Cannot send session cookie - headers already sent by (output
> started at /home/www/index.php:3) in /home/www/index.php on line 4
> 
> Warning: Cannot send session cache limiter - headers already sent
> (output started at /home/www/index.php:3) in /home/www/index.php on line 4
> 
> The code is like so:
> <html>
> <head>
> <?php
>   session_start();
> ?>
>  
> </head>
> <body>
> <form name="form1" method="post" action="admin_select_project.php?<?=SID?>">
> <table border="0" cellspacing="0" cellpadding="0">
>   <tr bgcolor="#CFCFCF">
>     <td colspan="2">Admin Login
>     </td>
>   </tr>
>   <tr>
>     <td>Username:
>     </td>
>     <td><input type="text" name="username">
>     </td>
>   </tr>
>   <tr>
>     <td>Password:
>     </td>
>     <td><input type="text" name="password">
>     </td>
>   </tr>
>   <tr>
>     <td>
>       <input type="submit" name="Submit4" value="Submit">
>     </td>
>   </tr>
> </table>
> </form>
> </body>
> </html>
> What am I missing...
> 
> Thanks
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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

I have a string that is separated by spaces like this
$string="test test1 test2 test3";
how can I make the string so it is separated by comas like this
$string="test,test1,test2,test3";
I know this is probably simple but I just can't figure it out

  

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

--- End Message ---
--- Begin Message ---
$string = str_replace(" ", ",", $string);

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 4:57 PM
To: php-general
Subject: [PHP] separated string by comas



I have a string that is separated by spaces like this
$string="test test1 test2 test3";
how can I make the string so it is separated by comas like this
$string="test,test1,test2,test3";
I know this is probably simple but I just can't figure it out

  

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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Monday 22 July 2002 14:56, [EMAIL PROTECTED] wrote:
> I have a string that is separated by spaces like this
> $string="test test1 test2 test3";
> how can I make the string so it is separated by comas like this
> $string="test,test1,test2,test3";
> I know this is probably simple but I just can't figure it out

str_replace()

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

/*
Forced to support NT servers; sysadmins quit.
*/

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

This may be a pretty naive question.
Do we have to use the key word
session_register("variablename");
in every single page, in which we plan to use the "variablename"?. Or is it
possible that we register the variablename once, and in the subsequent pages
continue to access it using  $variablename ?

Thanks in advance,
Sachin.
--- End Message ---
--- Begin Message ---
> Do we have to use the key word
> session_register("variablename");
> in every single page, in which we plan to use the "variablename"?. Or
is
> it
> possible that we register the variablename once, and in the subsequent
> pages
> continue to access it using  $variablename ?

You just have to call it once. 

---John Holmes...

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


What is your PHP Version ?

Try putting the 

   global $HTTP_SERVER_VARS;
   print_r($HTTP_SERVER_VARS);

in your custom function  and check out what is it printing...

-S. Sukumar


> I'm trying to access some settings in the $HTTP_SERVER_VARS[] array, but,
> within a custom function() this array appears empty. In the calling script,
> however, the $HTTP_SERVER_VARS[] array is defined.
> 
> I thought this was supposed to be "superglobal" and available on every
> level? If not, is there another command I can use? I also tried $_SERVER[]
> but this appears to be always empty no matter what level I call it on.
> 
> Thanks.
> 
> Monty
> 
> 
> .
> 
> 


--- End Message ---
--- Begin Message ---
i get php to allocate a colour then make it transparent using
imagecolortransparent()

instead of turning it transparent it becomes black.

Is it something i'm doing wrong? can anyone help me?

thanx in advance


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

Monday, July 22, 2002, 8:47:39 PM, you wrote:

N> i get php to allocate a colour then make it transparent using
N> imagecolortransparent()

N> instead of turning it transparent it becomes black.

N> Is it something i'm doing wrong? can anyone help me?

N> thanx in advance

Post a bit of the code so we can see what you are doing

-- 
Tom

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

I'm trying to use xslt_process() to transform a variable containing XML data
with an xsl file into a result using PHP. Incidentally the XML is from an
external source, i.e. a database. However despite following the examples in
www.php.net I am unable to do so. The code works out to something like this:


if (! empty($searchword ))

   $query = "SELECT aml FROM arguments WHERE aml LIKE '%$searchword%'";
   $result = mysql_query($query) or die ("Query failed");
   $line = mysql_fetch_array($result, MYSQL_ASSOC);

var_dump($line);

// Create an array
$arguments = array('/_xml'=> $line);

//XSL file
$xsl = "./sheet1.xsl"; 

// Create an XSLT processor
$xslthandler = xslt_create();

// Perform the transformation
$html = xslt_process( $xslthandler, 'arg:/_xml', $xsl, NULL, $arguments);

// Detect errors
if (!$html) die ('XSLT processing error: '.xslt_error($xslthandler));

// Destroy the XSLT processor
xslt_free($xslthandler);

// Output the resulting HTML
print $html;    


What I get on the screen is:


Array ( [0] => "With the contents of my variable...")


And:


Warning: Sablotron error on line 1: XML parser error 2: syntax error in
/home/httpd/html/ctan/resultworkingcopy2.php on line 93
XSLT processing error: XML parser error 2: syntax error


What gives? I'm really frustrated and would greatly appreciate it if someone
would point out where I've made an error before I start ripping all my hair
out! Thanks... Thanks... Thanks!

Regards,
Chia
--- End Message ---
--- Begin Message ---


Ctan wrote:
> Hi all,
> 
> I'm trying to use xslt_process() to transform a variable containing XML data
> with an xsl file into a result using PHP. Incidentally the XML is from an
> external source, i.e. a database. However despite following the examples in
> www.php.net I am unable to do so. The code works out to something like this:
> 
> 
> if (! empty($searchword ))
> 
>    $query = "SELECT aml FROM arguments WHERE aml LIKE '%$searchword%'";
>    $result = mysql_query($query) or die ("Query failed");
>    $line = mysql_fetch_array($result, MYSQL_ASSOC);
> 
> var_dump($line);
> 
> // Create an array
> $arguments = array('/_xml'=> $line);
> 
> //XSL file
> $xsl = "./sheet1.xsl"; 
> 
> // Create an XSLT processor
> $xslthandler = xslt_create();
> 
> // Perform the transformation
> $html = xslt_process( $xslthandler, 'arg:/_xml', $xsl, NULL, $arguments);
> 
> // Detect errors
> if (!$html) die ('XSLT processing error: '.xslt_error($xslthandler));
> 
> // Destroy the XSLT processor
> xslt_free($xslthandler);
> 
> // Output the resulting HTML
> print $html;  
> 
> 
> What I get on the screen is:
> 
> 
> Array ( [0] => "With the contents of my variable...")
> 
> 
> And:
> 
> 
> Warning: Sablotron error on line 1: XML parser error 2: syntax error in
> /home/httpd/html/ctan/resultworkingcopy2.php on line 93
> XSLT processing error: XML parser error 2: syntax error
> 
> 
> What gives? I'm really frustrated and would greatly appreciate it if someone
> would point out where I've made an error before I start ripping all my hair
> out! Thanks... Thanks... Thanks!
> 
> Regards,
> Chia

I may be missing something, but your not parsing XML. Your $line 
contains an array of data from the database, not xml.




--- End Message ---
--- Begin Message ---
Dear ALL,

It seems that i have a very silly problem.
I can't get the new line escape character to work.
the following is my SIMPLE script and corresponding output.


PHP script:
<!DOCTYPE HTML PUBLIC
   "-//W3C//DTD HTML 4.0 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd"; >
<html>
<head>
  <title>TEST</title>
</head>
<body bgcolor="#ffffff">
  <?php
    echo "this should be printed out:\n";
    echo "this is a second line";
  ?>
</body>
</html>


Output in IE6:
this should be printed out: this is a second line


regards,

KK



--- End Message ---
--- Begin Message ---
If you check the source of your code you'll see that in source the text
is in two lines.
\n doesn't work as <br>, so this is about how HTML works, not plain
text.


Niklas

-----Original Message-----
From: KK Lee [mailto:[EMAIL PROTECTED]] 
Sent: 22. heinäkuuta 2002 14:01
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie's question about \n 


Dear ALL,

It seems that i have a very silly problem.
I can't get the new line escape character to work.
the following is my SIMPLE script and corresponding output.


PHP script:
<!DOCTYPE HTML PUBLIC
   "-//W3C//DTD HTML 4.0 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd"; >
<html>
<head>
  <title>TEST</title>
</head>
<body bgcolor="#ffffff">
  <?php
    echo "this should be printed out:\n";
    echo "this is a second line";
  ?>
</body>
</html>


Output in IE6:
this should be printed out: this is a second line


regards,

KK




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

###########################################
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###########################################
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/
--- End Message ---
--- Begin Message ---
Hello KK,

Monday, July 22, 2002, 9:00:47 PM, you wrote:

KL> Dear ALL,

KL> It seems that i have a very silly problem.
KL> I can't get the new line escape character to work.
KL> the following is my SIMPLE script and corresponding output.


KL> PHP script:
KL> <!DOCTYPE HTML PUBLIC
KL>    "-//W3C//DTD HTML 4.0 Transitional//EN"
KL>    "http://www.w3.org/TR/html4/loose.dtd"; >
KL> <html>
KL> <head>
KL>   <title>TEST</title>
KL> </head>
KL> <body bgcolor="#ffffff">
KL>   <?php
KL>     echo "this should be printed out:\n";
KL>     echo "this is a second line";
KL>   ?>
KL> </body>
KL> </html>


KL> Output in IE6:
KL> this should be printed out: this is a second line


KL> regards,

KL> KK

The browser will ignore newlines use <br> instead.

to use newlines the text could be enclosed in <pre> text\n more
text\n</pre> tags, but <br> is probably what you need.

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

--- End Message ---
--- Begin Message ---
nl2br()

KK Lee wrote:
> **************************************************************************
> This Message Was Virus Checked With : SAVI 3.59 May 2002 
> Last Updated 8th July 2002
> **************************************************************************
> 
> Dear ALL,
> 
> It seems that i have a very silly problem.
> I can't get the new line escape character to work.
> the following is my SIMPLE script and corresponding output.
> 
> 
> PHP script:
> <!DOCTYPE HTML PUBLIC
>    "-//W3C//DTD HTML 4.0 Transitional//EN"
>    "http://www.w3.org/TR/html4/loose.dtd"; >
> <html>
> <head>
>   <title>TEST</title>
> </head>
> <body bgcolor="#ffffff">
>   <?php
>     echo "this should be printed out:\n";
>     echo "this is a second line";
>   ?>
> </body>
> </html>
> 
> 
> Output in IE6:
> this should be printed out: this is a second line
> 
> 
> regards,
> 
> KK
> 
> 
> 
> 


-- 
----------------------
 www.curvedvision.com
----------------------

--- End Message ---
--- Begin Message ---
Dear ALL,
Thanks.


KK

Kk Lee ¼g¤J¡G

> Dear ALL,
>
> It seems that i have a very silly problem.
> I can't get the new line escape character to work.
> the following is my SIMPLE script and corresponding output.
>
> PHP script:
> <!DOCTYPE HTML PUBLIC
>    "-//W3C//DTD HTML 4.0 Transitional//EN"
>    "http://www.w3.org/TR/html4/loose.dtd"; >
> <html>
> <head>
>   <title>TEST</title>
> </head>
> <body bgcolor="#ffffff">
>   <?php
>     echo "this should be printed out:\n";
>     echo "this is a second line";
>   ?>
> </body>
> </html>
>
> Output in IE6:
> this should be printed out: this is a second line
>
> regards,
>
> KK

--- End Message ---
--- Begin Message ---
My question is what can I do if someone searches for php script for search?

I would want to use OR in my SQL statment. The problem is how do I write the
query so that it will detect the number of words sent then put enough ORs
and LIKE '%$search[1]% in?

Thanks.


Here is the script.

<?
include "includes/required.php";
$query = "
SELECT count(article_keyword.weight) as score, article_keyword.aid,
article_data.name, article_data.time, article_data.description
FROM article_keyword,article_data
WHERE article_keyword.aid = article_keyword.aid AND article_keyword.keyword
LIKE '%$search%'
GROUP BY article_keyword.aid
ORDER BY score DESC
";
$result = mysql_query($query) or die("Query failed: $query<br>" .
mysql_error());
$num_results = mysql_num_rows($result);
if($num_results == 0){
  echo "Your search returned no results. Try other keyword(s).";
 exit;
} elseif($num_results > 0){
  for ($i=0; $i < $num_results; $i++)
    {
   $row = mysql_fetch_array($result);
    echo '<tr><td>';
  do_hr();
  echo '<a href="full_article.php?aid='.$row['aid'].'">';
  do_h($row['name'].' - '.date('jS-M-Y',$row['time']), 3, 'n');
  echo '</a>';
    echo '</td></tr><tr><td>'.$row['description']."\n";
   echo '</td></tr>';
}
 }
?>

"Jj Harrison" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> To add search functionality I decieded this was the best table structure I
> could come up with for a  keywords table.
>
> Here it is:
>
> CREATE TABLE article_keyword (
>   aid int(11) unsigned NOT NULL default '0',
>   keyword char(50) NOT NULL default '',
>   weight tinyint(2) unsigned NOT NULL default '0',
>   PRIMARY KEY  (aid),
>   KEY keyword (keyword),
>   KEY aid (aid),
>   KEY weight (weight)
> ) TYPE=MyISAM;
>
> Using that structure could I get a decent search?
>
> I would probably add up the weight for each keyword(Where it is searched
> for). Then sort it by the most 'relevent' then I could use a join to get
the
> title, time etc of the article and return the results.
>
> What I am asking is that if this is a good table structure for something
> like this(N00B alert!). If not could you please give me a better one?
>
>
> --
> JJ Harrison
> [EMAIL PROTECTED]
> www.tececo.com
>
>
>
>


--- End Message ---
--- Begin Message ---
[snip]
 > When i use <div align="top"> on an include inside of a table
 > cell it dosen't work.  Any reason?

Almost certainly there'll be a reason.  Browse the page in question in
your web browser and then view the source - see if you've ended up with
your page source as you'd intended.  Most of these sorts of problems
come down to html that isn't valid for whatever reason.
[/snip]

"DIV" has no "top" attribute, all DIV are loaded from the top -> down.
http://www.w3.org/TR/html4/struct/global.html#h-7.5.4 . You may want to use
CSS to define your divs'.
Also, make sure that your include is call before any HTML head where the
LINK REL to the stylesheet might be.

HTH!

Jay

"Reality is for people who lack imagination "

*************************************
* Want to meet other PHP developers *
* in your area? Check out:          *
* http://php.meetup.com/            *
* No developer is an island ...     *
*************************************


--- End Message ---

Reply via email to