RE: Changing case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Use the strtoupper() function

$var = strtoupper($var);

-----Original Message-----
From: Robert Sossomon [mailto:robert@xxxxxxxxxxxx] 
Sent: Wednesday, November 12, 2003 8:29 AM
To: php-general@xxxxxxxxxxxxx; php-db@xxxxxxxxxxxxx
Subject: Changing case

I have a form that allows for an item to be entered, the other pieces
have been fixed so far that were bogging me down, but now I am looking
for a way to convert any entry in the form to be UPPER case so that when
the quote is listed, they are alphabetical.  

The problem is if someone enters aa-1234 and the other items in the
quote are FF-2345 and QQ-3456 then the aa-1234 is UNDER them, instead of
on top.

/////////////////////////////////////
//
//   Store.php
//
/////////////////////////////////////
/*
  The following code allows for the addition of a non-stock item.  All
information is added automatically to the quoter for the salesman.
*/

$display_block .= "<HR>Input a new item: <form method=post
action=\"addspec.php\">&nbsp;&nbsp;&nbsp;&nbsp;Item ID:<input
type=\"text\" name=\"sel_item_id\"><BR>Description:<input type=\"text\"
name=\"sel_item_desc\"><BR>Quantity: <select name=\"sel_item_qty\">";
$display_block .= "<option value=\"0\">0</option><option value=\"1\"
selected>1</option>";
for ($i=2; $i < 301; $i++){
 $display_block .= "<option value=\"$i\">$i</option>";
}
$display_block .= "</select><input type=\"hidden\" name=\"SESSID\"
value=\"$PHPSESSID\"></td><td><input type=\"hidden\" name=\"url\"
value=\"$_SERVER[PHP_SELF]\"><BR>Price:<input type=\"text\"
name=\"sel_item_price\" size=\"5\"><input type=\"submit\"
name=\"submit\" value=\"Add to Cart\"></form>";


/////////////////////////////////////
//
//  addspec.php
//
/////////////////////////////////////
if ($_POST[sel_item_qty] != "0")
{
 if($_POST[sel_item_id] != "")
 {   
   //add info to cart table
   $addtocart = "insert into store_shoppertrack
values('','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]',
'$_POST[sel_item_price]','$_POST[sel_item_desc]', now())";
  
   mysql_query($addtocart);
  
   //redirect to showcart page
   header("Location:$_POST[url]");
   exit;
 } else {
  //send them somewhere else
  header("Location:ohcrud.php");
  exit;
 }
} else {
  //print message
  $display_block .= "<P>You must select a Quantity. Please <a
href=\"seestore.php\">continue to shop</a>!</P>";
 } 


TIA!!

Robert

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux