php-general Digest 27 Oct 2002 17:35:57 -0000 Issue 1669
Topics (messages 121577 through 121602):
Mac OS X EI TEXTAREA Problem
121577 by: Dan Tappin
Trouble with switch statements
121578 by: Edward Kehoe
121579 by: Thoenen, Peter Mr. EPS
121580 by: eNetwizard Developers Team
121583 by: . Edwin
121596 by: Gareth Hastings
Re: predifined functions
121581 by: DaRk--ObJeCtS
121586 by: George William Smith
Form element names starting with the "+" character????
121582 by: Dan Tappin
121584 by: . Edwin
121594 by: Jonathan Sharp
121595 by: John W. Holmes
121600 by: Jonathan Sharp
Re: Mail Delivery errors when posting here ???
121585 by: . Edwin
newbie: php/mysql
121587 by: Mr. BuNgL3
Anyone used Luke Welling & Laura Thompsons shopping cart?
121588 by: Steve Jackson
121591 by: . Edwin
java integration
121589 by: A3-Mail Proxy Handler
121592 by: . Edwin
Error?
121590 by: Steve Jackson
121593 by: John W. Holmes
121599 by: Tony Crockford
Can anyone help please.
121597 by: Steve Jackson
121598 by: Tom Rogers
How to prevent failure email from being sent?
121601 by: Noah Spitzer-Williams
is it possible using mysql alone
121602 by: gamin
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 am setting a MySQL update page where a user is provided a HTML form to
update with data auto poulated from a MySQL database via PHP.
All the form element work except for TEXTAREA.
No matter what encoding I use (htmlspecial, htmlentities etc) I get the
browser displaying garbeld text.
Example:
MySQL data:
Headquartered in ABC Building in Anytown, Any Province, ABC Inc. employs
approximately 2,500 people and holds almost $9 billion in quality growth
assets. A fully integrated oil and gas company, ABC ranks second in
production and third in reserves relative to Canada's four other integrated
oil and gas companies and is the fourth-largest downstream retailer.
HTML TEXTAREA Source:
Headquartered in ABC Building in Anytown, Any Province, ABC Inc. employs
approximately 2,500 people and holds almost $9 billion in quality growth
assets. A fully integrated oil and gas company, ABC ranks second in
production and third in reserves relative to Canada's four other integrated
oil and gas companies and is the fourth-largest downstream retailer.
TEXTAREA Data:
5{d in ABC Building in Anytown, Any Province, ABC Inc. employs
approximately 2,500 people and holds almost $9 billion in quality growth
assets. A fully integrated oil and gas company, ABC ranks second in
production and third in reserves relative to Canada's four other integrated
oil and gas companies and is the fourth-largest downstream retailer.
Or
pd in ABC Building in Anytown, Any Province, ABC Inc. employs
approximately 2,500 people and holds almost $9 billion in quality growth
assets. A fully integrated oil and gas company, ABC ranks second in
production and third in reserves relative to Canada's four other integrated
oil and gas companies and is the fourth-largest downstream retailer.
I can't get the same results in Netscape 7 Mac or either Windows versions.
I will blame Microsoft unless there is some obscure encoding issue I can't
find. :^)
Thanks,
Dan
--- End Message ---
--- Begin Message ---
Ok...I just recently installed Apache1 and PHP 4.2.3 on my computer and I've
configured everything. However, I can't seem to get my switch statements to
accept variable values from the address bar. So if I type in:
http://www.my-site.com/index.php?select=1
It displays the text in the default part of the switch statement. I also
seem to get the following error message every time:
Notice: Undefined variable: select in c:\apache\apache\htdocs\index.php on
line 51
Here's the code for my switch statement as well:
switch($select)
{
case 1: print "About Stuff Goes Here.";
break;
case 2: print "Music Goes Here.";
break;
default:print "Testing...";
break;
}
--- End Message ---
--- Begin Message ---
switch($_GET['select']){
case 1:
......
-Peter
> -----Original Message-----
> From: Edward Kehoe [mailto:emkehoe@;learn.senecac.on.ca]
> Sent: Friday, October 25, 2002 19:47
> To: [EMAIL PROTECTED]
> Subject: [PHP] Trouble with switch statements
>
>
> Ok...I just recently installed Apache1 and PHP 4.2.3 on my
> computer and I've
> configured everything. However, I can't seem to get my switch
> statements to
> accept variable values from the address bar. So if I type in:
>
> http://www.my-site.com/index.php?select=1
>
> It displays the text in the default part of the switch
> statement. I also
> seem to get the following error message every time:
>
> Notice: Undefined variable: select in
> c:\apache\apache\htdocs\index.php on
> line 51
>
> Here's the code for my switch statement as well:
>
> switch($select)
> {
> case 1: print "About Stuff Goes Here.";
> break;
> case 2: print "Music Goes Here.";
> break;
> default:print "Testing...";
> break;
> }
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Use $_GET["select"] for the switch statement
Some of the people on this list would even recommend you make another
variable first, such as $userselect = $_GET["select"] and use
$userselect as your switch statement, though I think it pointless.
Or turn register_globals on in the php.ini file (not recommended)
-Samuel | http://enetwizard.net
-----Original Message-----
From: Edward Kehoe [mailto:emkehoe@;learn.senecac.on.ca]
Sent: Friday, October 25, 2002 1:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Trouble with switch statements
Ok...I just recently installed Apache1 and PHP 4.2.3 on my computer and
I've
configured everything. However, I can't seem to get my switch statements
to
accept variable values from the address bar. So if I type in:
http://www.my-site.com/index.php?select=1
It displays the text in the default part of the switch statement. I also
seem to get the following error message every time:
Notice: Undefined variable: select in c:\apache\apache\htdocs\index.php
on
line 51
Here's the code for my switch statement as well:
switch($select)
{
case 1: print "About Stuff Goes Here.";
break;
case 2: print "Music Goes Here.";
break;
default:print "Testing...";
break;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello,
"eNetwizard Developers Team" <[EMAIL PROTECTED]> wrote:
>
> Use $_GET["select"] for the switch statement
>
> Some of the people on this list would even recommend you make another
> variable first, such as $userselect = $_GET["select"] and use
> $userselect as your switch statement, though I think it pointless.
Perhaps, in a simple switch($_GET["select"]) statement. But there are
times that it makes more sense to assign a $_GET[''] or $_POST[''] to
another variable ;)
- E
...[snip]...
--- End Message ---
--- Begin Message ---
Edward,
Try
Case "1":
.....
Break;
-----Original Message-----
From: Edward Kehoe [mailto:emkehoe@;learn.senecac.on.ca]
Sent: Friday, October 25, 2002 6:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Trouble with switch statements
Ok...I just recently installed Apache1 and PHP 4.2.3 on my computer and
I've
configured everything. However, I can't seem to get my switch statements
to
accept variable values from the address bar. So if I type in:
http://www.my-site.com/index.php?select=1
It displays the text in the default part of the switch statement. I also
seem to get the following error message every time:
Notice: Undefined variable: select in c:\apache\apache\htdocs\index.php
on
line 51
Here's the code for my switch statement as well:
switch($select)
{
case 1: print "About Stuff Goes Here.";
break;
case 2: print "Music Goes Here.";
break;
default:print "Testing...";
break;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I d/l php and i searched through like i did before and i didnt find anything
usefull. I couldnt find anything that had functions in it. except for the
pear stuff. thx for replying though.
--
Dark |++| Darkobjects.com
"Justin French" <[EMAIL PROTECTED]> wrote in message
news:B9E1C49C.1569A%justin@;indent.com.au...
> on 27/10/02 2:31 PM, Jason Wong ([EMAIL PROTECTED]) wrote:
>
> > On Sunday 27 October 2002 10:40, DaRk--ObJeCtS wrote:
> >> alright i wanna know where i could see the source of predifened
functions
> >> like session_register. Thx.
> >
> > the manual?
>
> errr, no the SOURCE... download it from php.net... did around, do some
> multi-file search thingies...
>
> justin
>
--- End Message ---
--- Begin Message ---
http://cvs.php.net/co.php/php4/ext/session/session.c?login=2&r=1.336
G
"DaRk--ObJeCtS" <[EMAIL PROTECTED]> wrote in message
news:20021027024001.28357.qmail@;pb1.pair.com...
> alright i wanna know where i could see the source of predifened functions
> like session_register. Thx.
> --
> Dark |++| Darkobjects.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I have a simple method of creating easy form processing.... I thought....
I came up with the idea (I am not claiming to be the first) to have form
elements I want to update via MySQL starting with either "-" or "+".
Example:
+name=DAN
[EMAIL PROTECTED]
-notes=
id=1
The first 2 are required and will be updated, the 3rd is optional and will
be updated and the 4th (id) is simply passed as form data.
The idea here is that I parse the $_POST variable to auto create a "UPDATE
table SET name = 'Dan', email = '[EMAIL PROTECTED]' WHERE = 1" string for
MySQL.
The issue is that if I use the "+" to indicate a required field for error
trapping my $_POST array ends up like this:
+namD=AN
[EMAIL PROTECTED]
-notes=
id=1
Either this is a PHP / HTTP bug or I am up against some strange post naming
restriction. I searched the web, the PHP site (includeing the bugs) and
could not spot an obvious reference.
Any ideas out there?
Dan
--- End Message ---
--- Begin Message ---
Hello,
Are you sure you want to do something like this?
This seems like a good candidate for an "SQL injection"...
(Well, I'm not really sure how you're doing it so I could be wrong.)
Just wondering...
- E
"Dan Tappin" <[EMAIL PROTECTED]> wrote:
> I have a simple method of creating easy form processing.... I thought....
>
> I came up with the idea (I am not claiming to be the first) to have form
> elements I want to update via MySQL starting with either "-" or "+".
>
> Example:
>
> +name=DAN
> [EMAIL PROTECTED]
> -notes=
> id=1
>
> The first 2 are required and will be updated, the 3rd is optional and will
> be updated and the 4th (id) is simply passed as form data.
>
> The idea here is that I parse the $_POST variable to auto create a "UPDATE
> table SET name = 'Dan', email = '[EMAIL PROTECTED]' WHERE = 1" string for
> MySQL.
>
> The issue is that if I use the "+" to indicate a required field for error
> trapping my $_POST array ends up like this:
>
> +namD=AN
> [EMAIL PROTECTED]
> -notes=
> id=1
>
> Either this is a PHP / HTTP bug or I am up against some strange post
naming
> restriction. I searched the web, the PHP site (includeing the bugs) and
> could not spot an obvious reference.
>
> Any ideas out there?
>
> Dan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Dan Tappin wrote:
I have a simple method of creating easy form processing.... I thought....
I came up with the idea (I am not claiming to be the first) to have form
elements I want to update via MySQL starting with either "-" or "+".
Example:
+name=DAN
[EMAIL PROTECTED]
-notes=
id=1
The first 2 are required and will be updated, the 3rd is optional and will
be updated and the 4th (id) is simply passed as form data.
The idea here is that I parse the $_POST variable
This would be a BIG secuirty issue...as the input is 'tainted' until
otherwise proven safe. If you want to do this approach as you go through
each POST var, make sure you have a list of valid fields for the table
and make sure the field you're setting from POST actually IS a field in
the table.
I see what you're trying to do, I've done something somewhat similar and
it doesn't require a + or -.
I wrote a db class which builds my queries for me. Example snippit:
/* -- db.conf -- (table definitions) */
dbNewConn('conn', 'user:password@host');
dbNewDb('database', 'conn');
dbNewTable('my_table', 'database.table_name');
/* -- My script.php -- */
$d = array( 'name' => $_POST['name'],
'email' => $_POST['email']);
dbUpdate('my_table', $d, "id='{$_POST['id']}'");
As dbUpdate gets executed, if the connection isn't up, it connects to
the db server, next if it doesn't have a list of fields for the table it
lists the fields and 'caches' them during the script execution. And
finally it builds the query string. The resulting query is:
UPDATE database.table_name SET `name`='The Name',
`email`='[EMAIL PROTECTED]' WHERE id=1;
It handles all escaping, mysql functions etc. (so I could do: 'name' =>
'PASSWORD('.$_POST['name'].')' and it would be escaped propperly). This
code is running in a production application and have no had any
performance problems.
-js
to auto create a "UPDATE
table SET name = 'Dan', email = '[EMAIL PROTECTED]' WHERE = 1" string for
MySQL.
The issue is that if I use the "+" to indicate a required field for error
trapping my $_POST array ends up like this:
+namD=AN
[EMAIL PROTECTED]
-notes=
id=1
Either this is a PHP / HTTP bug or I am up against some strange post naming
restriction. I searched the web, the PHP site (includeing the bugs) and
could not spot an obvious reference.
Any ideas out there?
Dan
--- End Message ---
--- Begin Message ---
> I wrote a db class which builds my queries for me. Example snippit:
>
> /* -- db.conf -- (table definitions) */
> dbNewConn('conn', 'user:password@host');
> dbNewDb('database', 'conn');
> dbNewTable('my_table', 'database.table_name');
>
> /* -- My script.php -- */
> $d = array( 'name' => $_POST['name'],
> 'email' => $_POST['email']);
>
> dbUpdate('my_table', $d, "id='{$_POST['id']}'");
How do you differentiate between string updates and integer/float
updates? Or do you just put quotes around the numbers, too?
> As dbUpdate gets executed, if the connection isn't up, it connects to
> the db server, next if it doesn't have a list of fields for the table
it
> lists the fields and 'caches' them during the script execution. And
> finally it builds the query string. The resulting query is:
>
> UPDATE database.table_name SET `name`='The Name',
> `email`='[EMAIL PROTECTED]' WHERE id=1;
Wouldn't the 1 have quotes around it?
> It handles all escaping, mysql functions etc. (so I could do: 'name'
=>
> 'PASSWORD('.$_POST['name'].')' and it would be escaped propperly).
This
> code is running in a production application and have no had any
> performance problems.
How would you escape that? The contents of the PASSWORD function needs
to be surrounded by quotes (unless you're passing a column).
So you'd need
'name' => "PASSWORD('" . $_POST['name'] . "')"
wouldn't you? So if the name is "O'mallery" you'd end up with
'name' => "PASSWORD('O'mallery')"
How do you escape that without also escaping the quotes that delimit the
string?
---John Holmes...
--- End Message ---
--- Begin Message ---
John W. Holmes wrote:
I wrote a db class which builds my queries for me. Example snippit:
/* -- db.conf -- (table definitions) */
dbNewConn('conn', 'user:password@host');
dbNewDb('database', 'conn');
dbNewTable('my_table', 'database.table_name');
/* -- My script.php -- */
$d = array( 'name' => $_POST['name'],
'email' => $_POST['email']);
dbUpdate('my_table', $d, "id='{$_POST['id']}'");
How do you differentiate between string updates and integer/float
updates? Or do you just put quotes around the numbers, too?
On the 'input' side I use is_numeric() to test if the data is numeric.
But I haven't considered testing the field type itself. It's easy enough
to add. This hasn't come up yet in any of our development.
As dbUpdate gets executed, if the connection isn't up, it connects to
the db server, next if it doesn't have a list of fields for the table
it
lists the fields and 'caches' them during the script execution. And
finally it builds the query string. The resulting query is:
UPDATE database.table_name SET `name`='The Name',
`email`='[EMAIL PROTECTED]' WHERE id=1;
Wouldn't the 1 have quotes around it?
Yes it would, that was my typo... it should be id='1' but id I'm going
to assume is an int auto_increment, so the correct where clause should
be "id={$_POST['id']}"
It handles all escaping, mysql functions etc. (so I could do: 'name'
=>
'PASSWORD('.$_POST['name'].')' and it would be escaped propperly).
This
code is running in a production application and have no had any
performance problems.
How would you escape that? The contents of the PASSWORD function needs
to be surrounded by quotes (unless you're passing a column).
There's a "private" function which escapes all data and tests for the
function etc.
In the example data below: "PASSOWRD('O'mallery')" it would do:
1) Determine if it is a function:
Substr up to first '(' and see if the strtoupper of it is in_array()
which has all of the mysql functions.
2) Since it know's it's a function, it then takes the next char after
the '(' and if it's either a ' or " it does the next step.
3) Takes first part "PASSWORD(" and then the data portion "O'mallery"
and replaces quote with \quote in data. (This takes into account if you
passed the string 'PASSWORD("O'Mallery")' it would not escape the '.)
Next it rebuilds the string "PASSWORD(<quote>$DATA<quote>)"
Here is the code:
function dbPrepValue($value)
{
global $_DB_;
if ( is_numeric($value) )
{
return $value;
}
else
{
$tmp = strtoupper($value);
if ( 0 < ($t = strpos($tmp, '(') ) )
{
$tmp = substr($tmp, 0, ($t - 1) );
}
if ( in_array( $tmp, $_DB_['mysqlFunc'] ) )
{
$q = substr($tmp, ($t + 1), 1);
if ( $q == "'" || $q == '"' )
{
$func = substr($value, 0, $t);
$data = substr($value, ($t + 1), -2);
$value = "{$func}{$q}" . str_replace($q, "\{$q}",
$data) . "{$q})";
}
return $value;
}
else
{
return "'{$value}'";
}
}
}
While this code does not take into account EVERY valid query statement,
for those conditions you can just pass a raw query to dbQuery(). I'll
post a link to the class sometime this week.
-js
So you'd need
'name' => "PASSWORD('" . $_POST['name'] . "')"
wouldn't you? So if the name is "O'mallery" you'd end up with
'name' => "PASSWORD('O'mallery')"
How do you escape that without also escaping the quotes that delimit the
string?
---John Holmes...
--- End Message ---
--- Begin Message ---
I also receive this kind of message. What's happening?
- E
"Monty" <[EMAIL PROTECTED]> wrote:
> For some reason I get the following e-mail every time I make a post here
> recently and not sure why:
>
> -------
>
> This message was created automatically by mail delivery software (Exim).
>
> A message that you sent could not be delivered to one or more of its
> recipients. This is a permanent error. The following address(es) failed:
>
> [EMAIL PROTECTED]
> SMTP error from remote mailer after MAIL FROM:
> <[EMAIL PROTECTED]> SIZE=6478:
> host yun.yagibdah.de [192.168.0.1]: 550 rejected:
> administrative prohibition
>
> -------
>
> This is followed by a copy of my posting to the newsgroup which does get
> posted. Not sure why it's being rejected and where this is coming from.
Any
> clues??
>
> Monty
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hey...
I have a little problem... i want to read an encrypted field from mysql
database to a php variable... what is the code line that i must enter? (ex:
password validation in a login form)
Thanks...
--- End Message ---
--- Begin Message ---
I am developing a shopping cart based on the above authors shopping cart fom
their book. (Book is a must by the way). I am still pretty new to PHP and
MySQL and need some help with the cart. Basically I need to add a form to
adjust the quantity in the cart instead of just incrementing by one and then
allowing the user to change the amount when she gets there. I have tried
unsuccessfully for the last three days to do this.
the code that increments the cart is this but if anyone has used the
shopping module and knows how to adjust the code to add this fairly simple
procedure I'd appreciate it.
if($new)
{
//new item selected
if(!session_is_registered("cart"))
{
$cart = array();
session_register("cart");
$items = 0;
session_register("items");
$total_price = "0.00";
session_register("total_price");
}
if($cart[$new])
$cart[$new]++;
else
$cart[$new] = 1;
$total_price = calculate_price($cart);
$items = calculate_items($cart);
}
--- End Message ---
--- Begin Message ---
Hello,
What is your PHP version? Perhaps, the problem has something to do with
"register_globals"?
What exactly is the problem you're having? Any error messages?
- E
PS.
The book is really great--it's part of my library :)
"Steve Jackson" <[EMAIL PROTECTED]> wrote:
> I am developing a shopping cart based on the above authors shopping cart
fom
> their book. (Book is a must by the way). I am still pretty new to PHP and
> MySQL and need some help with the cart. Basically I need to add a form to
> adjust the quantity in the cart instead of just incrementing by one and
then
> allowing the user to change the amount when she gets there. I have tried
> unsuccessfully for the last three days to do this.
>
> the code that increments the cart is this but if anyone has used the
> shopping module and knows how to adjust the code to add this fairly simple
> procedure I'd appreciate it.
>
> if($new)
> {
> //new item selected
> if(!session_is_registered("cart"))
> {
> $cart = array();
> session_register("cart");
> $items = 0;
> session_register("items");
> $total_price = "0.00";
> session_register("total_price");
> }
> if($cart[$new])
> $cart[$new]++;
> else
> $cart[$new] = 1;
> $total_price = calculate_price($cart);
> $items = calculate_items($cart);
>
> }
>
--- End Message ---
--- Begin Message ---
Hi,
I have an ssl class which does not work when called within php but works from console.
I reported this as a bug to php.net. (Algorithm [Sun bla bla] not found)
But while the bug is examined, I have to use this class from my website.
1. Do someone knows how can I integrate my site with java?
2. Is jsp like php?
3. What extras should I install to use jsp from linux/apache?
4. Does jsp works with php on the same server?
5. If so, can I exchange variables between jsp and php?
Thanx...
--- End Message ---
--- Begin Message ---
Hello,
"A3-Mail Proxy Handler" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have an ssl class which does not work when called within php but
> works from console. I reported this as a bug to php.net. (Algorithm
> [Sun bla bla] not found)
>
> But while the bug is examined, I have to use this class from my website.
>
> 1. Do someone knows how can I integrate my site with java?
I'm not sure if I understand your question correctly but perhaps it has
something to do with #3?
> 2. Is jsp like php?
Well, it depends on what you mean. One thing is for sure: they're both
programming languages :) er, scripting languages ;)
Judge for yourself: http://java.sun.com/products/jsp/
> 3. What extras should I install to use jsp from linux/apache?
http://jakarta.apache.org/tomcat/ ?
> 4. Does jsp works with php on the same server?
Yes.
> 5. If so, can I exchange variables between jsp and php?
I'm not sure. But I'm sure it's not impossible...
- E
--- End Message ---
--- Begin Message ---
I get the following error and I don't know why this is the code:
if($new)
{
$details = get_product_details($new);
if($details["catid"])
$target = "show_cat.php?catid=".$details["catid"];
//line 55 is the bracket below.
}
$path = $PHP_SELF;
$path = str_replace("show_cart.php", "", $path);
Error:
Warning: Can only count STRING and INTEGER values! in
/www/u1255/shop_testing/show_cart.php on line 55
Any ideas? all I'm trying to do is pass a qty from a form?
--- End Message ---
--- Begin Message ---
The error is probably coming from line 39 in the show_cart.php file
where you're using the array_count_values() function. I'm not sure why
it says line 55 in the error if that's the actual file you're using.
Read the manual page on array_count_values for a possible explanation.
www.php.net/array_count_values
---John Holmes...
> -----Original Message-----
> From: Steve Jackson [mailto:steve@;webpage.co.uk]
> Sent: Sunday, October 27, 2002 9:00 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Error?
>
> here are the 3 files.
> the main problem i have is to adjust a shopping cart using a form
field so
> I'll send you all three pages. The output_fns page has display cart
and
> category functions. Show_cart page is the one where I'm getting the
error
> and product_fns has a calculation of the items in the cart.
>
>
>
> > -----Original Message-----
> > From: John W. Holmes [mailto:holmes072000@;charter.net]
> > Sent: 27 October 2002 15:56
> > To: 'Steve Jackson'
> > Subject: RE: [PHP] Error?
> >
> >
> > Can you send me the entire file to look at?
> >
> > > -----Original Message-----
> > > From: Steve Jackson [mailto:steve@;webpage.co.uk]
> > > Sent: Sunday, October 27, 2002 7:14 AM
> > > To: Php-General
> > > Subject: [PHP] Error?
> > >
> > > I get the following error and I don't know why this is the code:
> > >
> > > if($new)
> > > {
> > > $details = get_product_details($new);
> > > if($details["catid"])
> > > $target = "show_cat.php?catid=".$details["catid"];
> > > //line 55 is the bracket below.
> > > }
> > > $path = $PHP_SELF;
> > > $path = str_replace("show_cart.php", "", $path);
> > >
> > >
> > > Error:
> > >
> > > Warning: Can only count STRING and INTEGER values! in
> > > /www/u1255/shop_testing/show_cart.php on line 55
> > >
> > > Any ideas? all I'm trying to do is pass a qty from a form?
> >
> >
--- End Message ---
--- Begin Message ---
>
> if($new)
> {
> $details = get_product_details($new);
> if($details["catid"])
> $target = "show_cat.php?catid=".$details["catid"];
> //line 55 is the bracket below.
> }
> $path = $PHP_SELF;
> $path = str_replace("show_cart.php", "", $path);
>
>
> Error:
>
> Warning: Can only count STRING and INTEGER values! in
> /www/u1255/shop_testing/show_cart.php on line 55
>
> Any ideas? all I'm trying to do is pass a qty from a form?
Maybe it's me, but shouldn't there be a { on or around this line:
if($details["catid"]) ****?
> $target = "show_cat.php?catid=".$details["catid"];
--- End Message ---
--- Begin Message ---
I have two test carts online at the moment.
This one works fine:
http://www.violasystems.com/shop/
this one is the one I want to get working
http://www.violasystems.com/shop_testing/
The code for the first shop basically increments the cart by one when the
submit button is added using the commented out code.
$qty = $formqty;
if($cart[$new])
//$cart[$new]++;
$cart[$new] = $cart[$new] + $qty;
else
$cart[$new] = 1;
$total_price = calculate_price($cart);
$items = calculate_items($cart);
I have added the rest (taking a variable from the form $formqty and adding
it to the cart)
Can anyone see why doesn't this work?
--- End Message ---
--- Begin Message ---
Hi,
Monday, October 28, 2002, 1:44:37 AM, you wrote:
SJ> I have two test carts online at the moment.
SJ> This one works fine:
SJ> http://www.violasystems.com/shop/
SJ> this one is the one I want to get working
SJ> http://www.violasystems.com/shop_testing/
SJ> The code for the first shop basically increments the cart by one when the
SJ> submit button is added using the commented out code.
SJ> $qty = $formqty;
SJ> if($cart[$new])
SJ> //$cart[$new]++;
SJ> $cart[$new] = $cart[$new] + $qty;
SJ> else
SJ> $cart[$new] = 1;
SJ> $total_price = calculate_price($cart);
SJ> $items = calculate_items($cart);
SJ> I have added the rest (taking a variable from the form $formqty and adding
SJ> it to the cart)
SJ> Can anyone see why doesn't this work?
You seem to have other problems than the code here ..
Warning: Invalid argument supplied for foreach() in
/www/u1255/shop_testing/show_cart.php on line 30
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Hey guys,
My service sends out emails every few days to members who wish to have
stats sent to them. The problem is once an email becomes inactive, I the
webmaster gets a failure email sent to me. This is starting to add up and I
can get upwards of 20 of these a day. It just seems likea waste of space
and bandwidth... is there anyway I can prevent this?
If i delete the webmaster email key in php.ini will my emails not have a
reply address?
Thanks!
- Noah
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi,
I want to know if it is possible to do the following in Mysql 3.xx or do
i have to write out a php script.
table1 has a columns A,B,C table2 also has columns A,B,C. The data in column
A is differnt in both tables (though 90% is identical) i want to update B,C
in table2 where table1.A = table2.A. ANY CLUES ?
here is what i tried - insert into table1 (B) select t1.B from table1 t1,
table2 t2 where t1.A = t2.A
THIS is only for column B- but it tells me i cant have table2 in the from
clause
thx in advance
gamin.
--- End Message ---