php-general Digest 19 Aug 2003 09:57:40 -0000 Issue 2245
Topics (messages 159952 through 159995):
Mail() Problem Sending
159952 by: Ben C.
159958 by: Michael A Smith
159975 by: Cesar Aracena
159989 by: raditha dissanayake
159995 by: Ivo Fokkema
Re: READ RECEIPTS [WAS: $GLOBAL question]
159953 by: Dan Anderson
159955 by: Michael A Smith
159957 by: Michael A Smith
159960 by: Chris W. Parker
Re: need help with cookies
159954 by: Curt Zirzow
159964 by: Jaap van Ganswijk
Re: pop3 functions
159956 by: andu
159959 by: Dan Anderson
159991 by: raditha dissanayake
Re: [PUP] READ RECEIPTS [WAS: $GLOBAL question]
159961 by: Robin Kopetzky
URGENT PROPOSAL
159962 by: MRS EKI OMORODION
159965 by: MRS EKI OMORODION
Re: How configure PHP parser 4.3.x in IIS version 6.0?
159963 by: Jaap van Ganswijk
Re: If you ever had a Vic20
159966 by: Martin Towell
How to open a save-as dialog and then redirect after donwload?
159967 by: Jean-Christian IMbeault
159970 by: Jon Drukman
mysql_connect() fails randomly
159968 by: Jon Drukman
159971 by: Curt Zirzow
Re: Cannot output before input
159969 by: Chris Lee
Re: Problem with the post variables.
159972 by: Tom Rogers
Re: Problems with post (Again)
159973 by: Tom Rogers
Delimiter WITHOUT lots of IF's
159974 by: Cesar Aracena
159976 by: Ralph Guzman
159977 by: Ralph Guzman
159978 by: Cesar Aracena
159979 by: Ralph Guzman
159980 by: Cesar Aracena
159981 by: Curt Zirzow
159987 by: Ralph Guzman
159988 by: Cesar Aracena
159992 by: Ralph Guzman
Re: getting value of item in list box.
159982 by: KK
window.open("hai.php?id="one");
159983 by: murugesan
159984 by: Martin Towell
159985 by: murugesan
159986 by: Martin Towell
Re: XML Parser misbehaves with &
159990 by: raditha dissanayake
Re: Fatal error: [] operator not supported for strings
159993 by: Daniel
159994 by: desa15.necso.es
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 ---
I have recently had php installed on my server with sendmail. The server is behind a
firewall and SMTP is open on the firewall. However, when I execute the mail(), it
appears to have sent the mail, but I never receive it. I am not getting any error
messages. Has anyone ever run into this problem? Does anyone have any ideas?
--- End Message ---
--- Begin Message ---
My ideas: (in order of likelihood)
Idea #1: Your computer hates you.
Idea #2: Sendmail isn't running.
Idea #3: Sendmail isn't setup correctly.
Idea #4: You have been hacked by Saddam.
-Michael
:-)
Ben C. wrote:
I have recently had php installed on my server with sendmail. The server is behind a firewall and SMTP is open on the firewall. However, when I execute the mail(), it appears to have sent the mail, but I never receive it. I am not getting any error messages. Has anyone ever run into this problem? Does anyone have any ideas?
--- End Message ---
--- Begin Message ---
Before trying to guess what Saddam can and can't do with computers, try
sending e-mails to different addresses (different domains... NOT just
different usernames). Sometimes, the e-mail server you use is NOT
configured properly, so every e-mail does not gets to you.
It happened to me too when testing my server's sendmail. The e-mails
reached well one of my addresses but not another one. So I pointed the
e-mails to a Hotmail account and it reached it. Try it and see what
happens.
For some e-mail servers, you have to write lots of "extra headers" in
the e-mails in order to pass their guard.
HTH
Cesar Aracena
www.icaam.com.ar
> -----Mensaje original-----
> De: Ben C. [mailto:[EMAIL PROTECTED]
> Enviado el: Lunes, 18 de Agosto de 2003 06:28 p.m.
> Para: [EMAIL PROTECTED]
> Asunto: [PHP] Mail() Problem Sending
>
> I have recently had php installed on my server with sendmail. The
server
> is behind a firewall and SMTP is open on the firewall. However, when
I
> execute the mail(), it appears to have sent the mail, but I never
receive
> it. I am not getting any error messages. Has anyone ever run into
this
> problem? Does anyone have any ideas?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
/var/log/maillog file shold have some clues.
Cesar Aracena wrote:
Before trying to guess what Saddam can and can't do with computers, try
sending e-mails to different addresses (different domains... NOT just
different usernames). Sometimes, the e-mail server you use is NOT
configured properly, so every e-mail does not gets to you.
It happened to me too when testing my server's sendmail. The e-mails
reached well one of my addresses but not another one. So I pointed the
e-mails to a Hotmail account and it reached it. Try it and see what
happens.
For some e-mail servers, you have to write lots of "extra headers" in
the e-mails in order to pass their guard.
HTH
Cesar Aracena
www.icaam.com.ar
-----Mensaje original-----
De: Ben C. [mailto:[EMAIL PROTECTED]
Enviado el: Lunes, 18 de Agosto de 2003 06:28 p.m.
Para: [EMAIL PROTECTED]
Asunto: [PHP] Mail() Problem Sending
I have recently had php installed on my server with sendmail. The
server
is behind a firewall and SMTP is open on the firewall. However, when
I
execute the mail(), it appears to have sent the mail, but I never
receive
it. I am not getting any error messages. Has anyone ever run into
this
problem? Does anyone have any ideas?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Raditha Dissanayake
-------------------------------------------------------------
http://www.radinks.com/sftp/
Lean and mean Secure FTP applet with Graphical User Inteface.
just 150 Kilo Bytes
--- End Message ---
--- Begin Message ---
"Cesar Aracena" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
> For some e-mail servers, you have to write lots of "extra headers" in
> the e-mails in order to pass their guard.
[/snip]
True! But actually, I' ve seen people using only the 'From:' header to send
mail. Emails can then be dropped easily by servers thinking it is spam.
Ben, I don't know what headers you send, but you could try these headers:
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
$headers .= "From: Name <[EMAIL PROTECTED]>\r\n";
$headers .= "Reply-to: Name <[EMAIL PROTECTED]>\r\n";
$headers .= "Return-path: Name <[EMAIL PROTECTED]>\r\n";
$headers .= "Error-to: Name <[EMAIL PROTECTED]>\r\n";
mail("Yourname <[EMAIL PROTECTED]>", "Subject", $body, $headers);
HTH,
Ivo
--- End Message ---
--- Begin Message ---
On Mon, 2003-08-18 at 17:22, Robert Cummings wrote:
> This is pretty off topic -- but most clients also let you refuse to send
> receipts automatically -- which is how I deal with them.
Yes but read reciepts do exist for a purpose. If you happen to work at
a place where you /want/ read receipts to be replied to that doesn't
work. :) However if that is this guys case he should create a second
account for mailing lists only and block read receipts till his hearts
content.
-Dan
--- End Message ---
--- Begin Message ---
Dan Anderson wrote:
On Mon, 2003-08-18 at 17:22, Robert Cummings wrote:
This is pretty off topic -- but most clients also let you refuse to send
receipts automatically -- which is how I deal with them.
Yes but read reciepts do exist for a purpose. If you happen to work at
a place where you /want/ read receipts to be replied to that doesn't
work. :) However if that is this guys case he should create a second
account for mailing lists only and block read receipts till his hearts
content.
-Dan
My point exactly.
--- End Message ---
--- Begin Message ---
Thanks, I'd forgotten about that setting which I just did... I'm sorry
if everyone feels I've been too harsh, but I'm not saying I'm sorry for
what I said. :-)
-Michael
Robert Cummings wrote:
This is pretty off topic -- but most clients also let you refuse to send
receipts automatically -- which is how I deal with them.
Cheers,
Rob.
On Mon, 2003-08-18 at 17:04, Dan Anderson wrote:
p.s. Is there not an option on your mail reader to automatically send
read receipts? I mean, can't you have it by default send the receipt
instead of requesting your intervention? If not, you might like to think
about getting a better client. thanks!
You ever open a spam and 30 seconds later get a follow up spam? That's
what happens from automatically sending read reciepts. Also, spammers
love to use them as a tool to figure out who actually reads spam -- even
if you just click on it for a second to press the DEL key.
However, so many people request read reciepts that even though I wish
they didn't exist I can't see complaining to a mailing list about them.
-Dan
--- End Message ---
--- Begin Message ---
Michael A Smith <mailto:[EMAIL PROTECTED]>
on Monday, August 18, 2003 2:57 PM said:
> Thanks, I'd forgotten about that setting which I just did... I'm sorry
> if everyone feels I've been too harsh, but I'm not saying I'm sorry
> for what I said. :-)
While we're griping about things let me make a request of you Michael.
It would be really great if you would bottom post when you reply to
mailing lists. By bottom posting instead of top posting you keep the
natural flow of the English language going.
When you read a book/magazine/article/tutorial/man page/etc. do you read
from bottom to top or top to bottom?
Thanks!
Chris.
--- End Message ---
--- Begin Message ---
* Thus wrote Dan Anderson ([EMAIL PROTECTED]):
> I need to grab cookies from a web page and pass those cookies back to
> the web page when needed. I downloaded the cURL program and was playing
> with it, but don't understand how cURL functions correlate into the PHP
> equivalents.
>
> How would I strip the cookies from a web page, and send cookies?
> More importantly, if I have cookies from domain x which provides y
> cookies and go to a second web page from domain x which provides z
> cookies, if I go to another web page on domain x should I concatanate
> the y and z cookies, or just send the last z cookies recieved?
Send back all cookies that follow the rules here:
http://wp.netscape.com/newsref/std/cookie_spec.html
That is of course you want to accept the cookie.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
At 2003-08-18 16:17 -0400, Dan Anderson wrote:
>I need to grab cookies from a web page and pass those cookies back to
>the web page when needed. I downloaded the cURL program and was playing
>with it, but don't understand how cURL functions correlate into the PHP
>equivalents.
I don't know cURL, but when you want to get the cookies that
a server sends, whilst sending a page, I think you need to
use the fsockopen() function and send a proper GET or HEAD
or whatever command (see the manual under fsockopen).
This way, you'll also get the header of the HTML file
that is being send to you and that is what contains the
cookies.
>How would I strip the cookies from a web page, and send cookies?
You'd strip the cookies by interpreting the appropriate lines.
To send cookies, put them in the header of the GET request
that I described above. (But of the next request of course.)
>More importantly, if I have cookies from domain x which provides y
>cookies and go to a second web page from domain x which provides z
>cookies, if I go to another web page on domain x should I concatanate
>the y and z cookies, or just send the last z cookies recieved?
Cookies themselves specify to which documents on other parts
of the domain they should be returned. It's quite complicated.
Look for a link to the Netscape specification about this in
the PHP manual under cookies, header() etc.
Success!
Jaap
PS. I have also been fighting the cookie-monster again today! ;-)
--- End Message ---
--- Begin Message ---
On Mon, 18 Aug 2003 15:40:31 -0500
Ken <[EMAIL PROTECTED]> wrote:
> Those weird function names are taken straight from C. Blame the
> inventors of C. PHP is partly intended to be easy to learn for C
> programmers.
I'm wondering how many php users are C programmers...
Can only blame the php inventors for using a bad model.
>
> - Ken
>
> At 02:15 PM 8/16/2003 -0400, andu wrote:
> >I take the opportunity to express my 2 major problems I found with
> >php in the 2 months I've been using it.
> >First is the naming of functions (whoever was the illiterate one who
> >invented them) definitely not meant to be remembered or to represent
> >what they actually do. It's a shame to have to fill our minds with
> >such garbage: strcasecmp, strchr, strcmp, strcoll, strcspn, stripos,
> >stristr, strspn, strstr, to take just a few. A programming language
> >has already its problems for not being natural, no need to make it
> >even more so. Second, it the array overkill.
> >Nevertheless, I love it.
>
>
>
--
Regards, Andu Novac
--- End Message ---
--- Begin Message ---
> I'm wondering how many php users are C programmers...
> Can only blame the php inventors for using a bad model.
C and C++ were the first languages I learned and I think that it's a
terrific model. So powerful. But many C/C++ programmers aren't able to
code properly (or accident prone, or code drunk).
Thus we have found we need languages where power is limited, because
people write code with memory leaks, with errors, and other bugs that
can bring down an entire operating system ::coughs:: windows ::coughs::
windows :: coughs ::.
Of course I suppose it could be argued if human brains could support
programming in assembly we would have much more efficient programs. :-)
-Dan
--- End Message ---
--- Begin Message ---
andu wrote:
On Mon, 18 Aug 2003 15:40:31 -0500
Ken <[EMAIL PROTECTED]> wrote:
Those weird function names are taken straight from C. Blame the
inventors of C. PHP is partly intended to be easy to learn for C
programmers.
I'm wondering how many php users are C programmers...
Can only blame the php inventors for using a bad model.
Just because you cannot understand something does not mean it's bad.
Your mail arrived to this mailing list through several mail nodes
writted purely in C.
- Ken
At 02:15 PM 8/16/2003 -0400, andu wrote:
I take the opportunity to express my 2 major problems I found with
php in the 2 months I've been using it.
First is the naming of functions (whoever was the illiterate one who
invented them) definitely not meant to be remembered or to represent
what they actually do. It's a shame to have to fill our minds with
such garbage: strcasecmp, strchr, strcmp, strcoll, strcspn, stripos,
stristr, strspn, strstr, to take just a few. A programming language
has already its problems for not being natural, no need to make it
even more so. Second, it the array overkill.
Nevertheless, I love it.
--
Raditha Dissanayake
-------------------------------------------------------------
http://www.radinks.com/sftp/
Lean and mean Secure FTP applet with Graphical User Inteface.
just 150 Kilo Bytes
--- End Message ---
--- Begin Message ---
Sorry bat that - I deeply apologize for the mess I caused. I have an ISP and
send email billing out. The return receipt is to make sure the user gets the
email.
I have turned off the receipts and will NOT turn them on again,
Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020
--- End Message ---
--- Begin Message ---
MRS. EKI OMORODION
#8 Queens Drive Ikoyi
Lagos.
Email:[EMAIL PROTECTED]
INTRODUCTION: l am Mrs. Eki Omorodion l know this proposal will come to
you as a surprise because we have not met before either hysically or
through correspondence.
I have no doubt in your ability to handle this proposal involving huge
sum of money.
THE SUBJECT: MY HUSBAND CHIEF JOSEPH OMORODION (NowLate)
was the Royal Head of my Community, JESSE (an oil rich town) in Nigeria.
My late husband’S community produces 3.5% of the total crude oil
production in Nigeria and 0.5% of the Dollar value of each barrel is
paid to my husband as royalty by the Federal Government.
My husband was also the Chairman of OMPADEC,Jesse branch.
In his position as the Royal head and Chairman of the OMPADEC, Jesse
branch,he made some money which he left for me and our children as
the only thing to inherit.
The money is Twelve Million US Dollars($12M).
Though this said fund accumulated between the period 1976-1998.
Due to poor banking system in Nigeria and political instability as a
result of past Military rules (1985-1999), he deposited this
Money in a Strong Room/safe with an open beneficiary in Apex Bank of
Nigeria pending when he would finish arrangement to transfer it broad
as a CONTRACT PAYMENT.
He was planning this when he died late last year of Heart Attack.
THE PROPOSAL: Just before my husband died he called my attention to the
money and charged me to look for a foreigner who would assist me in the
transfer / investment of the funds abroad.
So l would be very grateful if you could accept to help me archieve
this great objective.
I promise to give you 20% of the total funds transferred to your vital
bank account as compensation for your assistance.
Five percent (5%)would be set aside to take care of all expenses we
may incure during the transaction.
To indicate your interest, contact me urgently and confidentially for
more information and the roles you will play in this business.
All the legal information concerning this Money will be sent to you
as soon as we agree together.
Send your reply through this mail box, or see the note below
Yours faithfully,
MRS. Eki Omorodion.
N.B
I will like you to provide me immediately with your full names,
telephone and fax numbers to enable my eldest son Humphrey Omorodion to
contact you.
He shall handle this transaction from A-Z on behalf of the family.
Alternatively you can call him on his telephone numbers
234-1-7767689, fax 234-1-7598907, fax 873-762-533-731
Ask him for the code and he shall respond GOODLUCK before discussion.
Just to be sure that you are speaking to him.
--- End Message ---
--- Begin Message ---
MRS. EKI OMORODION
#8 Queens Drive Ikoyi
Lagos.
Email:[EMAIL PROTECTED]
INTRODUCTION: l am Mrs. Eki Omorodion l know this proposal will come to
you as a surprise because we have not met before either hysically or
through correspondence.
I have no doubt in your ability to handle this proposal involving huge
sum of money.
THE SUBJECT: MY HUSBAND CHIEF JOSEPH OMORODION (NowLate)
was the Royal Head of my Community, JESSE (an oil rich town) in Nigeria.
My late husband’S community produces 3.5% of the total crude oil
production in Nigeria and 0.5% of the Dollar value of each barrel is
paid to my husband as royalty by the Federal Government.
My husband was also the Chairman of OMPADEC,Jesse branch.
In his position as the Royal head and Chairman of the OMPADEC, Jesse
branch,he made some money which he left for me and our children as
the only thing to inherit.
The money is Twelve Million US Dollars($12M).
Though this said fund accumulated between the period 1976-1998.
Due to poor banking system in Nigeria and political instability as a
result of past Military rules (1985-1999), he deposited this
Money in a Strong Room/safe with an open beneficiary in Apex Bank of
Nigeria pending when he would finish arrangement to transfer it broad
as a CONTRACT PAYMENT.
He was planning this when he died late last year of Heart Attack.
THE PROPOSAL: Just before my husband died he called my attention to the
money and charged me to look for a foreigner who would assist me in the
transfer / investment of the funds abroad.
So l would be very grateful if you could accept to help me archieve
this great objective.
I promise to give you 20% of the total funds transferred to your vital
bank account as compensation for your assistance.
Five percent (5%)would be set aside to take care of all expenses we
may incure during the transaction.
To indicate your interest, contact me urgently and confidentially for
more information and the roles you will play in this business.
All the legal information concerning this Money will be sent to you
as soon as we agree together.
Send your reply through this mail box, or see the note below
Yours faithfully,
MRS. Eki Omorodion.
N.B
I will like you to provide me immediately with your full names,
telephone and fax numbers to enable my eldest son Humphrey Omorodion to
contact you.
He shall handle this transaction from A-Z on behalf of the family.
Alternatively you can call him on his telephone numbers
234-1-7767689, fax 234-1-7598907, fax 873-762-533-731
Ask him for the code and he shall respond GOODLUCK before discussion.
Just to be sure that you are speaking to him.
--- End Message ---
--- Begin Message ---
At 2003-12-06 00:07 -0400, [EMAIL PROTECTED] wrote:
>I use the dll "php4isapi.dll" and it doesn't work,
>Could someone give me a hand?
We can't hear you yet, since you're living in the future.
Wait about 4 months and we will have received your
question!
Or adjust your clock...
Greetings,
Jaap
PS. And shaking hands with someone living 4 months into
the future is of course completely out-of-the-question.
PS2. Or are you perhaps somehow trying to compensate
for using MS technology? Are you trying to use MS's
not-yet-revealed technology already today, by cheating
with your clock-setting? But does that also mean that
you pay their license fees 4 months in advance? Perhaps
you should contact IBM? According to their TV-ads they
seem to be looking for 'magical business binoculars'
that can prevent them from making any more future
business mistakes...
--- End Message ---
--- Begin Message ---
> [snip]
> $found = 0;
> while ($mydata = mysql_fetch_object($news))
> {
> if ($mydata->StudentId == $StudentId)
> {$found = 1; break;}
> }
>
> if ($found==1){do this}else{do that}
> [/snip]
>
> Why two if's? Isn't if the student is found in the first if, don't you
> want to do stuff then? Just curious...
<late_reply>
It's so the "not found" condition can be checked and handled.. You'd still
need a second if to handle that..
eg
$found = 0;
while ($mydata = mysql_fetch_object($news))
{
if ($mydata->StudentId == $StudentId)
{do this; $found = 1; break;}
}
if (!$found){do that}
</late_reply>
Martin
--- End Message ---
--- Begin Message ---
I want to create the following:
1- A screen a series files and associated buttons
2- if the user clicks the button a "File | save as" dialog opens up
3- after the file the user is redirected to a new page
I've gotten 1 and 2 to work but I can't figure out how to do anything
after the file has finished downloading. I've tried header("Location: ")
but that doesn't work because it must be used before any input is sent.
The reason I want this functionality is that once a file is downloaded I
want the screen with the buttons to refresh itself and remove the
downloaded file from the list displayed to the user.
How can I accomplish this? All suggestions welcomed!
Jean-Christian Imbeault
--- End Message ---
--- Begin Message ---
Jean-Christian IMbeault wrote:
I want to create the following:
1- A screen a series files and associated buttons
2- if the user clicks the button a "File | save as" dialog opens up
3- after the file the user is redirected to a new page
I've gotten 1 and 2 to work but I can't figure out how to do anything
after the file has finished downloading. I've tried header("Location: ")
but that doesn't work because it must be used before any input is sent.
you can't really do it. best thing you can do is open a popup window to
actually do the downloading.
this is not a php question, btw.
-jsd-
--- End Message ---
--- Begin Message ---
i've got a library file that i require() in all my scripts. it starts
with this line:
$dbh=mysql_connect() or die("mysql connect failed: " . mysql_error());
about 5% of the time, this fails for no apparent reason. it just prints
mysql connect failed:
with no error message.
there's nothing wrong with the mysql server as far as i can tell. there
are tons of available connection slots.
any ideas?
it also happens with mysql_pconnect() too.
-jsd-
--- End Message ---
--- Begin Message ---
* Thus wrote Jon Drukman ([EMAIL PROTECTED]):
> i've got a library file that i require() in all my scripts. it starts
> with this line:
>
> $dbh=mysql_connect() or die("mysql connect failed: " . mysql_error());
The problem is the mysql_error() cant display what the problem is
because the connect failed. (this needs to change in the docs.)
Here is what you can do to get an error message of why it failed:
. Ensure your error_reporting level is high enought to allow
Warnings, and make sure display_errors is on.
or
. Turn on track_errors and use the variable $php_errmsg inplace
of mysql_error().
die("mysql connecte failed: $php_errmsg");
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
>ob_flush()
Thanks curt, it's working ^_^
--- End Message ---
--- Begin Message ---
Hi,
Tuesday, August 19, 2003, 12:03:51 AM, you wrote:
KKA> Guys I have a problem here.
KKA> I'm using PHP 4.3.2 and httpd 1.3.28.
KKA> Look my exemple.
KKA> I have a page whith a Form method post, and I submit this page to teste2.php, but
I dont can request de data from the text box...
KKA> #######################
KKA> This is the test page
KKA> <html>
KKA> <body>
KKA> <form action="teste2.php" method="post" enctype="multipart/form-data">
KKA> <input type="text" name="texto">
KKA> <input type="submit" value="ok">
KKA> </form>
KKA> </body>
KKA> </html>
KKA> #####################
KKA> Teste2.php
KKA> <?php
KKA> $string = $_POST['texto'];
KKA> echo "Var em post: ".$string."<br>";
KKA> echo "Var em get: ".$_GET['texto']."<br>";
KKA> //phpinfo();
?>>
KKA> ############################################
KKA> Some one can help me...???
KKA> Klaus Kaiser Apolinário
KKA> Curitiba online
is your second page Teste2.php or teste2.php ?
if Teste2.php it wont match your form declaration otherwise there is
nothing wrong with the code.
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Hi,
Tuesday, August 19, 2003, 2:26:35 AM, you wrote:
KKA> This is my log erros, I`ve changed my POST_MAX_SIZE in the php.in, and this value
is constant.
KKA> Unknown(0) : Warning - Unknown(): POST Content-Length of 215 bytes
KKA> exceeds the limit of -1048576 bytes
KKA> Klaus Kaiser Apolinario
KKA> Curitiba online
do you have - instead of = in the ini file?
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Hi all,
I need to create an automatic process for visitors who are adding items
into a shopping cart, be able to see how many MBs and how many CDs will
the order have.
>From this site, visitors will be able to choose one ore more software
products from a list of hundreds. I want them to check the cart to see
something like:
Total size: 872,43 MBs
Total CDs: 2
Total price: $XXX,XX
Now, I developed a decision function that works with a lot of IF
statements, but I only calculated a max o 6 CDs (690,00 MBs max. per
CD), but I want to be able to make this automatically... Can someone
help me with this?
BTW, Using PHP 4+ and MySQL 3+.
Thanks in advanced,
Cesar Aracena
www.icaam.com.ar
Note: The information inside this message and also in the attached files
might be confidential. If you are not the desired receptor or the person
responsible of delivering the message, we notify you that it's copy,
distribution, keep or illegal use of the information it has it's
prohibited. Therefore we ask you to notify the sender by replying this
message immediately and then delete it from your computer.
--- End Message ---
--- Begin Message ---
How are you keeping track of items added being added to the shopping
cart?
-----Original Message-----
From: Cesar Aracena [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 7:55 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Delimiter WITHOUT lots of IF's
Importance: High
Sensitivity: Confidential
Hi all,
I need to create an automatic process for visitors who are adding items
into a shopping cart, be able to see how many MBs and how many CDs will
the order have.
>From this site, visitors will be able to choose one ore more software
products from a list of hundreds. I want them to check the cart to see
something like:
Total size: 872,43 MBs
Total CDs: 2
Total price: $XXX,XX
Now, I developed a decision function that works with a lot of IF
statements, but I only calculated a max o 6 CDs (690,00 MBs max. per
CD), but I want to be able to make this automatically... Can someone
help me with this?
BTW, Using PHP 4+ and MySQL 3+.
Thanks in advanced,
Cesar Aracena
www.icaam.com.ar
Note: The information inside this message and also in the attached files
might be confidential. If you are not the desired receptor or the person
responsible of delivering the message, we notify you that it's copy,
distribution, keep or illegal use of the information it has it's
prohibited. Therefore we ask you to notify the sender by replying this
message immediately and then delete it from your computer.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
How are you keeping track of items added being added to the shopping
cart?
-----Original Message-----
From: Cesar Aracena [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 7:55 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Delimiter WITHOUT lots of IF's
Importance: High
Sensitivity: Confidential
Hi all,
I need to create an automatic process for visitors who are adding items
into a shopping cart, be able to see how many MBs and how many CDs will
the order have.
>From this site, visitors will be able to choose one ore more software
products from a list of hundreds. I want them to check the cart to see
something like:
Total size: 872,43 MBs
Total CDs: 2
Total price: $XXX,XX
Now, I developed a decision function that works with a lot of IF
statements, but I only calculated a max o 6 CDs (690,00 MBs max. per
CD), but I want to be able to make this automatically... Can someone
help me with this?
BTW, Using PHP 4+ and MySQL 3+.
Thanks in advanced,
Cesar Aracena
www.icaam.com.ar
Note: The information inside this message and also in the attached files
might be confidential. If you are not the desired receptor or the person
responsible of delivering the message, we notify you that it's copy,
distribution, keep or illegal use of the information it has it's
prohibited. Therefore we ask you to notify the sender by replying this
message immediately and then delete it from your computer.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Using a cookie (I know, I know...) I plant a cookie in the visitor's
browser when he opens the site with a random generated number which
expires when the browser(s) is closed. With that SID, PHP stores the
orders (one per line) into a "sessions" table in MySQL each with the
itemID. Is it fine or am I too messy?
TXS,
Cesar Aracena
>
> How are you keeping track of items added being added to the shopping
> cart?
>
> -----Original Message-----
> From: Cesar Aracena [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 18, 2003 7:55 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Delimiter WITHOUT lots of IF's
> Importance: High
> Sensitivity: Confidential
>
> Hi all,
>
> I need to create an automatic process for visitors who are adding
items
> into a shopping cart, be able to see how many MBs and how many CDs
will
> the order have.
>
> >From this site, visitors will be able to choose one ore more software
> products from a list of hundreds. I want them to check the cart to see
> something like:
>
> Total size: 872,43 MBs
> Total CDs: 2
> Total price: $XXX,XX
>
> Now, I developed a decision function that works with a lot of IF
> statements, but I only calculated a max o 6 CDs (690,00 MBs max. per
> CD), but I want to be able to make this automatically... Can someone
> help me with this?
>
> BTW, Using PHP 4+ and MySQL 3+.
>
> Thanks in advanced,
>
> Cesar Aracena
> www.icaam.com.ar
>
> Note: The information inside this message and also in the attached
files
> might be confidential. If you are not the desired receptor or the
person
> responsible of delivering the message, we notify you that it's copy,
> distribution, keep or illegal use of the information it has it's
> prohibited. Therefore we ask you to notify the sender by replying this
> message immediately and then delete it from your computer.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
No, that sounds about right.
So your table should have the following fields:
customer_session_id, item_id, quantity, final_price
so then all you have to do is query this table looking for all items in
customers shopping cart.
I am not quite sure how you are going about calculating orders in
customer's basket. You said you wrote a function with multiple IF
statements, can you show me the code for this function so that I can get
a better idea of what you are currently doing?
-----Original Message-----
From: Cesar Aracena [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 8:38 PM
To: 'Ralph Guzman'; [EMAIL PROTECTED]
Subject: RE: [PHP] Delimiter WITHOUT lots of IF's
Importance: High
Sensitivity: Confidential
Using a cookie (I know, I know...) I plant a cookie in the visitor's
browser when he opens the site with a random generated number which
expires when the browser(s) is closed. With that SID, PHP stores the
orders (one per line) into a "sessions" table in MySQL each with the
itemID. Is it fine or am I too messy?
TXS,
Cesar Aracena
>
> How are you keeping track of items added being added to the shopping
> cart?
>
> -----Original Message-----
> From: Cesar Aracena [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 18, 2003 7:55 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Delimiter WITHOUT lots of IF's
> Importance: High
> Sensitivity: Confidential
>
> Hi all,
>
> I need to create an automatic process for visitors who are adding
items
> into a shopping cart, be able to see how many MBs and how many CDs
will
> the order have.
>
> >From this site, visitors will be able to choose one ore more software
> products from a list of hundreds. I want them to check the cart to see
> something like:
>
> Total size: 872,43 MBs
> Total CDs: 2
> Total price: $XXX,XX
>
> Now, I developed a decision function that works with a lot of IF
> statements, but I only calculated a max o 6 CDs (690,00 MBs max. per
> CD), but I want to be able to make this automatically... Can someone
> help me with this?
>
> BTW, Using PHP 4+ and MySQL 3+.
>
> Thanks in advanced,
>
> Cesar Aracena
> www.icaam.com.ar
>
> Note: The information inside this message and also in the attached
files
> might be confidential. If you are not the desired receptor or the
person
> responsible of delivering the message, we notify you that it's copy,
> distribution, keep or illegal use of the information it has it's
> prohibited. Therefore we ask you to notify the sender by replying this
> message immediately and then delete it from your computer.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Ok. Here you have the entire function to see how many CD's the order
will contain:
function cart_cdqty()
{
$query = "SELECT * FROM sessions WHERE sess_sid =
".$_COOKIE['SID']."";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
$x = 0;
$n = 0;
for ($y = 0; $y < $num_rows; $y++)
{
$row = mysql_fetch_array($result);
$n = $n + $row[sess_itemsize];
}
if ($n > 0 AND $n <= 690.0) {
$x = 1;
} elseif ($n > 690.1 AND $n <= 1380.0) {
$x = 2;
} elseif ($n > 1380.1 AND $n <= 2070.0) {
$x = 3;
} elseif ($n > 2070.1 AND $n <= 2760.0) {
$x = 4;
} elseif ($n > 2760.1 AND $n <= 3450.0) {
$x = 5;
}
return $x;
}
Pretty long if someone wants to order 17MBs don't you agree?
Thanks for this,
Cesar Aracena
>
> No, that sounds about right.
>
> So your table should have the following fields:
>
> customer_session_id, item_id, quantity, final_price
>
> so then all you have to do is query this table looking for all items
in
> customers shopping cart.
>
> I am not quite sure how you are going about calculating orders in
> customer's basket. You said you wrote a function with multiple IF
> statements, can you show me the code for this function so that I can
get
> a better idea of what you are currently doing?
>
>
> -----Original Message-----
> From: Cesar Aracena [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 18, 2003 8:38 PM
> To: 'Ralph Guzman'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Delimiter WITHOUT lots of IF's
> Importance: High
> Sensitivity: Confidential
>
> Using a cookie (I know, I know...) I plant a cookie in the visitor's
> browser when he opens the site with a random generated number which
> expires when the browser(s) is closed. With that SID, PHP stores the
> orders (one per line) into a "sessions" table in MySQL each with the
> itemID. Is it fine or am I too messy?
>
> TXS,
>
> Cesar Aracena
>
> >
> > How are you keeping track of items added being added to the shopping
> > cart?
> >
> > -----Original Message-----
> > From: Cesar Aracena [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 18, 2003 7:55 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Delimiter WITHOUT lots of IF's
> > Importance: High
> > Sensitivity: Confidential
> >
> > Hi all,
> >
> > I need to create an automatic process for visitors who are adding
> items
> > into a shopping cart, be able to see how many MBs and how many CDs
> will
> > the order have.
> >
> > >From this site, visitors will be able to choose one ore more
software
> > products from a list of hundreds. I want them to check the cart to
see
> > something like:
> >
> > Total size: 872,43 MBs
> > Total CDs: 2
> > Total price: $XXX,XX
> >
> > Now, I developed a decision function that works with a lot of IF
> > statements, but I only calculated a max o 6 CDs (690,00 MBs max. per
> > CD), but I want to be able to make this automatically... Can someone
> > help me with this?
> >
> > BTW, Using PHP 4+ and MySQL 3+.
> >
> > Thanks in advanced,
> >
> > Cesar Aracena
> > www.icaam.com.ar
> >
> > Note: The information inside this message and also in the attached
> files
> > might be confidential. If you are not the desired receptor or the
> person
> > responsible of delivering the message, we notify you that it's copy,
> > distribution, keep or illegal use of the information it has it's
> > prohibited. Therefore we ask you to notify the sender by replying
this
> > message immediately and then delete it from your computer.
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
* Thus wrote Cesar Aracena ([EMAIL PROTECTED]):
> Ok. Here you have the entire function to see how many CD's the order
> will contain:
>
> function cart_cdqty()
> {
> $query = "SELECT * FROM sessions WHERE sess_sid =
> ".$_COOKIE['SID']."";
> $result = mysql_query($query);
> $num_rows = mysql_num_rows($result);
>
> $x = 0;
> $n = 0;
>
> for ($y = 0; $y < $num_rows; $y++)
> {
> $row = mysql_fetch_array($result);
> $n = $n + $row[sess_itemsize];
> }
For one, sql can handle this for you. much faster too, I might add.
just do something like:
select sum(sess_itemsize) from sessions where sess_id = ...
...
$result = mysql_query($query);
list($n) = mysql_fetch_row($result);
>
> if ($n > 0 AND $n <= 690.0) {
> $x = 1;
> } elseif ($n > 690.1 AND $n <= 1380.0) {
> $x = 2;
> } elseif ($n > 1380.1 AND $n <= 2070.0) {
> $x = 3;
> } elseif ($n > 2070.1 AND $n <= 2760.0) {
> $x = 4;
> } elseif ($n > 2760.1 AND $n <= 3450.0) {
> $x = 5;
> }
A simple division of the size per disk will give you the qty:
$x = ceil( $n / 690.0 );
Now it wont be so bad if someone is ording 30 disks worth... i'd
hate to see that if statment not to mention write it :)
You might want to check for $x < 0 cause I don't think the customer
will be happy if he has to pay you to send you his disks.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
I agree with Curt, use mySQL to get the sum of 'sess_itemsize' then
divide the result by size per disk to get quantity. So your function
should look something like this:
function cart_cdqty()
{
$query = "SELECT SUM(sess_itemsize) AS total_size
FROM sessions
WHERE sess_id = ".$_COOKIE['SID']."";
$result = mysql_query($query);
if($row = mysql_fetch_array($result))
{
$n = $row['total_size'];
$x = ceil( $n / 690.0 );
$cart_cdqty = array(
'quantity' => '$x',
'total_size' => '$n',
);
return $cart_cdqty;
} else {
return false;
}
}
Then all you do is call the function like this:
if(!$cdqty = cart_cdqty())
{
print 'no items found in your shopping cart';
} else {
print 'Total Size:' . $cdqty['quantity'] . '<BR>';
print 'Total CDs:' . $cdqty['total_size'] . 'MBs <BR>';
}
I have not tested this but it should work.
Ralph
-----Original Message-----
From: Cesar Aracena [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 8:54 PM
To: 'Ralph Guzman'; [EMAIL PROTECTED]
Subject: RE: [PHP] Delimiter WITHOUT lots of IF's
Importance: High
Sensitivity: Confidential
Ok. Here you have the entire function to see how many CD's the order
will contain:
function cart_cdqty()
{
$query = "SELECT * FROM sessions WHERE sess_sid =
".$_COOKIE['SID']."";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
$x = 0;
$n = 0;
for ($y = 0; $y < $num_rows; $y++)
{
$row = mysql_fetch_array($result);
$n = $n + $row[sess_itemsize];
}
if ($n > 0 AND $n <= 690.0) {
$x = 1;
} elseif ($n > 690.1 AND $n <= 1380.0) {
$x = 2;
} elseif ($n > 1380.1 AND $n <= 2070.0) {
$x = 3;
} elseif ($n > 2070.1 AND $n <= 2760.0) {
$x = 4;
} elseif ($n > 2760.1 AND $n <= 3450.0) {
$x = 5;
}
return $x;
}
Pretty long if someone wants to order 17MBs don't you agree?
Thanks for this,
Cesar Aracena
>
> No, that sounds about right.
>
> So your table should have the following fields:
>
> customer_session_id, item_id, quantity, final_price
>
> so then all you have to do is query this table looking for all items
in
> customers shopping cart.
>
> I am not quite sure how you are going about calculating orders in
> customer's basket. You said you wrote a function with multiple IF
> statements, can you show me the code for this function so that I can
get
> a better idea of what you are currently doing?
>
>
> -----Original Message-----
> From: Cesar Aracena [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 18, 2003 8:38 PM
> To: 'Ralph Guzman'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Delimiter WITHOUT lots of IF's
> Importance: High
> Sensitivity: Confidential
>
> Using a cookie (I know, I know...) I plant a cookie in the visitor's
> browser when he opens the site with a random generated number which
> expires when the browser(s) is closed. With that SID, PHP stores the
> orders (one per line) into a "sessions" table in MySQL each with the
> itemID. Is it fine or am I too messy?
>
> TXS,
>
> Cesar Aracena
>
> >
> > How are you keeping track of items added being added to the shopping
> > cart?
> >
> > -----Original Message-----
> > From: Cesar Aracena [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 18, 2003 7:55 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Delimiter WITHOUT lots of IF's
> > Importance: High
> > Sensitivity: Confidential
> >
> > Hi all,
> >
> > I need to create an automatic process for visitors who are adding
> items
> > into a shopping cart, be able to see how many MBs and how many CDs
> will
> > the order have.
> >
> > >From this site, visitors will be able to choose one ore more
software
> > products from a list of hundreds. I want them to check the cart to
see
> > something like:
> >
> > Total size: 872,43 MBs
> > Total CDs: 2
> > Total price: $XXX,XX
> >
> > Now, I developed a decision function that works with a lot of IF
> > statements, but I only calculated a max o 6 CDs (690,00 MBs max. per
> > CD), but I want to be able to make this automatically... Can someone
> > help me with this?
> >
> > BTW, Using PHP 4+ and MySQL 3+.
> >
> > Thanks in advanced,
> >
> > Cesar Aracena
> > www.icaam.com.ar
> >
> > Note: The information inside this message and also in the attached
> files
> > might be confidential. If you are not the desired receptor or the
> person
> > responsible of delivering the message, we notify you that it's copy,
> > distribution, keep or illegal use of the information it has it's
> > prohibited. Therefore we ask you to notify the sender by replying
this
> > message immediately and then delete it from your computer.
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Thanks Curt AND Ralph,
This makes it all a lot more clear and easy to understand. And yes, it
makes sense. I'll try it now and see what happens.
What I've never seen before is what you did with:
if($row = mysql_fetch_array($result))
that made me go LOL!!!
Thanks in advanced,
Cesar Aracena
www.icaam.com.ar
>
> I agree with Curt, use mySQL to get the sum of 'sess_itemsize' then
> divide the result by size per disk to get quantity. So your function
> should look something like this:
>
> function cart_cdqty()
> {
>
> $query = "SELECT SUM(sess_itemsize) AS total_size
> FROM sessions
> WHERE sess_id = ".$_COOKIE['SID']."";
>
> $result = mysql_query($query);
>
> if($row = mysql_fetch_array($result))
> {
> $n = $row['total_size'];
> $x = ceil( $n / 690.0 );
>
> $cart_cdqty = array(
> 'quantity' => '$x',
> 'total_size' => '$n',
> );
>
> return $cart_cdqty;
> } else {
> return false;
> }
>
> }
>
> Then all you do is call the function like this:
>
> if(!$cdqty = cart_cdqty())
> {
> print 'no items found in your shopping cart';
> } else {
> print 'Total Size:' . $cdqty['quantity'] . '<BR>';
> print 'Total CDs:' . $cdqty['total_size'] . 'MBs <BR>';
> }
>
> I have not tested this but it should work.
>
> Ralph
>
> -----Original Message-----
> From: Cesar Aracena [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 18, 2003 8:54 PM
> To: 'Ralph Guzman'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Delimiter WITHOUT lots of IF's
> Importance: High
> Sensitivity: Confidential
>
> Ok. Here you have the entire function to see how many CD's the order
> will contain:
>
> function cart_cdqty()
> {
> $query = "SELECT * FROM sessions WHERE sess_sid =
> ".$_COOKIE['SID']."";
> $result = mysql_query($query);
> $num_rows = mysql_num_rows($result);
>
> $x = 0;
> $n = 0;
>
> for ($y = 0; $y < $num_rows; $y++)
> {
> $row = mysql_fetch_array($result);
> $n = $n + $row[sess_itemsize];
> }
>
> if ($n > 0 AND $n <= 690.0) {
> $x = 1;
> } elseif ($n > 690.1 AND $n <= 1380.0) {
> $x = 2;
> } elseif ($n > 1380.1 AND $n <= 2070.0) {
> $x = 3;
> } elseif ($n > 2070.1 AND $n <= 2760.0) {
> $x = 4;
> } elseif ($n > 2760.1 AND $n <= 3450.0) {
> $x = 5;
> }
>
> return $x;
> }
>
> Pretty long if someone wants to order 17MBs don't you agree?
>
> Thanks for this,
>
> Cesar Aracena
>
> >
> > No, that sounds about right.
> >
> > So your table should have the following fields:
> >
> > customer_session_id, item_id, quantity, final_price
> >
> > so then all you have to do is query this table looking for all items
> in
> > customers shopping cart.
> >
> > I am not quite sure how you are going about calculating orders in
> > customer's basket. You said you wrote a function with multiple IF
> > statements, can you show me the code for this function so that I can
> get
> > a better idea of what you are currently doing?
> >
> >
> > -----Original Message-----
> > From: Cesar Aracena [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 18, 2003 8:38 PM
> > To: 'Ralph Guzman'; [EMAIL PROTECTED]
> > Subject: RE: [PHP] Delimiter WITHOUT lots of IF's
> > Importance: High
> > Sensitivity: Confidential
> >
> > Using a cookie (I know, I know...) I plant a cookie in the visitor's
> > browser when he opens the site with a random generated number which
> > expires when the browser(s) is closed. With that SID, PHP stores the
> > orders (one per line) into a "sessions" table in MySQL each with the
> > itemID. Is it fine or am I too messy?
> >
> > TXS,
> >
> > Cesar Aracena
> >
> > >
> > > How are you keeping track of items added being added to the
shopping
> > > cart?
> > >
> > > -----Original Message-----
> > > From: Cesar Aracena [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, August 18, 2003 7:55 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] Delimiter WITHOUT lots of IF's
> > > Importance: High
> > > Sensitivity: Confidential
> > >
> > > Hi all,
> > >
> > > I need to create an automatic process for visitors who are adding
> > items
> > > into a shopping cart, be able to see how many MBs and how many CDs
> > will
> > > the order have.
> > >
> > > >From this site, visitors will be able to choose one ore more
> software
> > > products from a list of hundreds. I want them to check the cart to
> see
> > > something like:
> > >
> > > Total size: 872,43 MBs
> > > Total CDs: 2
> > > Total price: $XXX,XX
> > >
> > > Now, I developed a decision function that works with a lot of IF
> > > statements, but I only calculated a max o 6 CDs (690,00 MBs max.
per
> > > CD), but I want to be able to make this automatically... Can
someone
> > > help me with this?
> > >
> > > BTW, Using PHP 4+ and MySQL 3+.
> > >
> > > Thanks in advanced,
> > >
> > > Cesar Aracena
> > > www.icaam.com.ar
> > >
> > > Note: The information inside this message and also in the attached
> > files
> > > might be confidential. If you are not the desired receptor or the
> > person
> > > responsible of delivering the message, we notify you that it's
copy,
> > > distribution, keep or illegal use of the information it has it's
> > > prohibited. Therefore we ask you to notify the sender by replying
> this
> > > message immediately and then delete it from your computer.
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Actually, I missed a few things on that function. It should look like
this:
function cart_cdqty()
{
$query = "SELECT SUM(sess_itemsize) AS total_size
FROM sessions
WHERE sess_id = ".$_COOKIE['SID']."";
$result = mysql_query($query);
if(!$row = mysql_fetch_array($result))
{
return false;
} else {
$n = $row['total_size'];
$x = ceil( $n / 690.0 );
$cart_cdqty = array(
'quantity' => $x,
'total_size' => $n
);
return $cart_cdqty;
}
}
-----Original Message-----
From: Ralph Guzman [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 11:41 PM
To: 'Cesar Aracena'; [EMAIL PROTECTED]
Subject: RE: [PHP] Delimiter WITHOUT lots of IF's
Sensitivity: Confidential
I agree with Curt, use mySQL to get the sum of 'sess_itemsize' then
divide the result by size per disk to get quantity. So your function
should look something like this:
function cart_cdqty()
{
$query = "SELECT SUM(sess_itemsize) AS total_size
FROM sessions
WHERE sess_id = ".$_COOKIE['SID']."";
$result = mysql_query($query);
if($row = mysql_fetch_array($result))
{
$n = $row['total_size'];
$x = ceil( $n / 690.0 );
$cart_cdqty = array(
'quantity' => '$x',
'total_size' => '$n',
);
return $cart_cdqty;
} else {
return false;
}
}
Then all you do is call the function like this:
if(!$cdqty = cart_cdqty())
{
print 'no items found in your shopping cart';
} else {
print 'Total Size:' . $cdqty['quantity'] . '<BR>';
print 'Total CDs:' . $cdqty['total_size'] . 'MBs <BR>';
}
I have not tested this but it should work.
Ralph
--- End Message ---
--- Begin Message ---
check out http://javascript.internet.com/forms/auto-drop-down.html
"Tim Winters" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I have a PHP page which pulls a bunch of data from a mySQL DB. I have 2
> list boxes in a form. One is populated automatically by my PHP code.
> But the second will be populated based on what is selected in the first.
>
> I don't know how to get out the value of the first listbox using JS.
>
> Can anyone help?
>
> Thx
>
> Tim Winters
> Creative Development Manager
> Sampling Technologies Incorporated
>
> 1600 Bedford Highway, Suite 212
> Bedford, Nova Scotia
> B4A 1E8
> www.samplingtechnologies.com
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> Office: 902 450 5500
> Cell: 902 430 8498
> Fax:: 902 484 7115
>
>
--- End Message ---
--- Begin Message ---
Hello all,
I need to pass a value from one page to another.This is done from a
link from page 1 to page 2.
In that I called a php file as
window.open("hai.php?id="one");
But I dont want ?id="one" to be displayed in the address bar.
How can I achieve this?.
-murugesan.
--- End Message ---
--- Begin Message ---
Hiya,
1. Turn off the address bar
or
2. Create a form with hidden elements, with method=post
open a window to a blank page, and name the window
submit the form to the newly, named, window
HTH
Martin
-----Original Message-----
From: murugesan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 19 August 2003 3:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] window.open("hai.php?id="one");
Hello all,
I need to pass a value from one page to another.This is done from a
link from page 1 to page 2.
In that I called a php file as
window.open("hai.php?id="one");
But I dont want ?id="one" to be displayed in the address bar.
How can I achieve this?.
-murugesan.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________ Information from NOD32 1.481 (20030812) __________
This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com
--- End Message ---
--- Begin Message ---
I have made the value hidden. How can I retrieve it in the next page in
php.
-murugesan
----- Original Message -----
From: "Martin Towell" <[EMAIL PROTECTED]>
To: "'murugesan'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 11:21 AM
Subject: RE: [PHP] window.open("hai.php?id="one");
> Hiya,
>
> 1. Turn off the address bar
>
> or
>
> 2. Create a form with hidden elements, with method=post
> open a window to a blank page, and name the window
> submit the form to the newly, named, window
>
> HTH
> Martin
>
> -----Original Message-----
> From: murugesan [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 19 August 2003 3:45 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] window.open("hai.php?id="one");
>
>
> Hello all,
> I need to pass a value from one page to another.This is done from
a
> link from page 1 to page 2.
> In that I called a php file as
>
> window.open("hai.php?id="one");
> But I dont want ?id="one" to be displayed in the address bar.
> How can I achieve this?.
>
> -murugesan.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> __________ Information from NOD32 1.481 (20030812) __________
>
> This message was checked by NOD32 for Exchange e-mail monitor.
> http://www.nod32.com
>
>
>
>
--- End Message ---
--- Begin Message ---
The same way you do any other variable passed in from a form...
$_POST['id']
or $HTTP_POST_VARS['id']
or $id
depending on your version of php and if you have register_globals on (for
the last one)
-----Original Message-----
From: murugesan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 19 August 2003 4:14 PM
To: Martin Towell; [EMAIL PROTECTED]
Subject: Re: [PHP] window.open("hai.php?id="one");
I have made the value hidden. How can I retrieve it in the next page in
php.
-murugesan
----- Original Message -----
From: "Martin Towell" <[EMAIL PROTECTED]>
To: "'murugesan'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 11:21 AM
Subject: RE: [PHP] window.open("hai.php?id="one");
> Hiya,
>
> 1. Turn off the address bar
>
> or
>
> 2. Create a form with hidden elements, with method=post
> open a window to a blank page, and name the window
> submit the form to the newly, named, window
>
> HTH
> Martin
>
> -----Original Message-----
> From: murugesan [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 19 August 2003 3:45 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] window.open("hai.php?id="one");
>
>
> Hello all,
> I need to pass a value from one page to another.This is done from
a
> link from page 1 to page 2.
> In that I called a php file as
>
> window.open("hai.php?id="one");
> But I dont want ?id="one" to be displayed in the address bar.
> How can I achieve this?.
>
> -murugesan.
>
--- End Message ---
--- Begin Message ---
Hello,
It's not misbehaving and it's not illegal xml. It's a well documented
fact that the character data function may be called more than once. The
normal programming practice is to put the strings that are given to you
at each call into a buffer. Then you write code in the end handler to
process it, and to reset the buffer after processing.
Justin Farnsworth wrote:
This is normal. You have illegal XML there, as it should be
in <![CDATA[ value ]]>. I have run across this, and have
to clean it up with an awk script. Ampersand is a no-no.
Just running xmllint on the file will tell you about the problem(s).
_justin
Jeff Bearer wrote:
I've come across this frustrating behavior with the XML parser when it
reads an escaped ampersand (&)
If the xml being evaluated is: <COLORS>Blue, Green & Red</COLORS>
it calls the character data handler 3 times:
the first time the $data is "Blue, Green "
the second time is "&"
and the third time is " Red"
Needless to say this is screwing up my parser, and the stuff I'm doing
won't make it easy to add this allowance. I'm hoping somebody can point
out a way to turn off this behavior. If this is the proper operation,
is it documented anywhere? I've been unable to find it.
--
Jeff Bearer, RHCE
Webmaster, PittsburghLIVE.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Raditha Dissanayake
-------------------------------------------------------------
http://www.radinks.com/sftp/
Lean and mean Secure FTP applet with Graphical User Inteface.
just 150 Kilo Bytes
--- End Message ---
--- Begin Message ---
I checked ant that is not the cause of this problem.
Any other sugesstion?
"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Daniel wrote:
>
> > hi, how do i solve this error?
> >
> > Fatal error: [] operator not supported for strings
> > in /var/www/html/p.../magazin/cos.php on line
> > 13
> >
> > line 13 is this line:
> >
> > $_SESSION["id_produs"][]=$_POST["id_produs"];
> >
> > no error when i run in local host , when i upload
> > in server (with PHP 4.2.2) only got this error.
> >
> > first time click is fine, but when i click the
> > product once again, i got tat fatal error....how
> > can i solve it?? pls advice. thanks.
>
> Sounds like you've already assigned a value to $_SESSION['id_produs']
> and are now trying to turn it into an array.
>
> $_SESSION['id_produs'] = 'string value';
> $_SESSION['id_produs'][] = 'some other value';
>
> Check your code...
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> PHP|Architect: A magazine for PHP Professionals – www.phparch.com
>
>
>
>
--- End Message ---
--- Begin Message ---
==
not
=
$_SESSION["id_produs"][]== $_POST["id_produs"];
Un saludo, Danny
"Daniel"
<[EMAIL PROTECTED] Para: [EMAIL PROTECTED]
o> cc:
Asunto: Re: [PHP] Fatal error: []
operator not supported for strings
19/08/2003 10:06
I checked ant that is not the cause of this problem.
Any other sugesstion?
"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Daniel wrote:
>
> > hi, how do i solve this error?
> >
> > Fatal error: [] operator not supported for strings
> > in /var/www/html/p.../magazin/cos.php on line
> > 13
> >
> > line 13 is this line:
> >
> > $_SESSION["id_produs"][]=$_POST["id_produs"];
> >
> > no error when i run in local host , when i upload
> > in server (with PHP 4.2.2) only got this error.
> >
> > first time click is fine, but when i click the
> > product once again, i got tat fatal error....how
> > can i solve it?? pls advice. thanks.
>
> Sounds like you've already assigned a value to $_SESSION['id_produs']
> and are now trying to turn it into an array.
>
> $_SESSION['id_produs'] = 'string value';
> $_SESSION['id_produs'][] = 'some other value';
>
> Check your code...
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> PHP|Architect: A magazine for PHP Professionals ? www.phparch.com
>
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---