RE: [PHP] Passing variable
| From: | Maxim Maletsky | Date: | Thu, 07 Sep 2000 14:02:26 +0000 |
| Subject: | RE: [PHP] Passing variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15710@lists.php.net to get a copy of this message | ||
is $items an array?
if yes then make the form be
print "<FORM METHOD='POST' ACTION='./ordered_items.php3'
TARGET='bottom'>\n";
print "<INPUT TYPE=HIDDEN NAME='items[]' VALUE=$message>\n"; //
<--HERE
print "</FORM>\n";
ORA_CLOSE($cursor);
ORA_LOGOFF($handle);
print "</FORM>";
print "message=$message"; //Shows 1, Dickens, Charles, A Christmas
carol, 0-00-370078-X
print "</BODY></HTML>";
?>
Cheers!
-----Original Message-----
From: Ohlson Stefan [mailto:stohs@wmdata.com]
Sent: Thursday, September 07, 2000 10:34 PM
To: php-general@lists.php.net
Subject: [PHP] Passing variable
Hi!
I'm having problems with passing a variable ($message).
When I echo it in select_items.php3 it shows the correct data.
But when I echo it in the recieving script, ordered_items.php3, it just
shows the first 2-3 letters.
Anyone an idea what I'm doing wrong?
Thanks!
//Stefan
--------------------select_items.php3-----------------------------------
<?
print "<HTML><HEAD><TITLE></TITLE></HEAD>\n";
print "<BODY bgcolor='#D6D6D6'>\n";
query= "SELECT * FROM ITEMS WHERE something" ;
$handle = ORA_LOGON("XXX/YYY@ZZZ","") OR DIE("Unable to connect to
database");
$cursor = ORA_OPEN($handle) OR DIE("Unable to open database cursor");
$j=0;
ORA_PARSE($cursor, $query) OR DIE("Unable to parse query");
ORA_EXEC($cursor) OR DIE("Unable to run query");
while(ORA_FETCH($cursor)){;
$val2 = ORA_GETCOLUMN($cursor,2);
$val1 = ORA_GETCOLUMN($cursor,1);
$val0 = ORA_GETCOLUMN($cursor,0);
$j++ ;
$message .= " $j, $val2, $val1, $val0";
} // End of while
print "<FORM METHOD='POST' ACTION='./ordered_items.php3'
TARGET='bottom'>\n";
print "<INPUT TYPE=HIDDEN NAME='items' VALUE=$message>\n";
print "</FORM>\n";
ORA_CLOSE($cursor);
ORA_LOGOFF($handle);
print "</FORM>";
print "message=$message"; //Shows 1, Dickens, Charles, A Christmas
carol, 0-00-370078-X
print "</BODY></HTML>";
?>
---------------------ordered_items.php3-------------------------------
<?
mail("xxx@xxx.xxx","Order",$items, "From: yyy@yyy.yyy");
print "<HTML><HEAD><TITLE></TITLE></HEAD><BODY
bgcolor='#D6D6D6'>";
echo "items=$items"; //Shows 1,
print "</BODY></HTML>";
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net