PHP Rounding Up Issue

Hi Chaps,
I have an SQL query that calculates a word count multiplied by a fixed figure:
"...$pricegross = ($row_rsInvPending['projanalysis_total']*$row_rsInvPending['costbase']);..."
Then use a bit of php code to round up the figure to 2 decimal places....
<?php echo number_format($pricegross, 2, '.', ''); ?>
I then total up $pricegross for all records:
".....SELECT SUM(projanalysis_total) as total_pricegross..."
If I have two records:
($pricegross) 1. £2.295
($pricegross) 2. £2.295
There are both displayed as £2.30, which is what I want
Then the total ($total_pricegross) shows up as £4.59, but what I want is: £4.60
Is this possible?
Hope this is clear?!

I don't know php, but wouldn't you just use the same rounding function (assuming that's what number_format is doing)?
<?php echo number_format($total_pricegross, 2, '.', ''); ?>

Similar Messages

  • CSS rounded border issue

    I've got a CSS rounded border issue. Safari (4.0.3) is drawing a slight white artifact on the rounded corners. Look at the comparison between the Safari screenshot and the Firefox (3.5.x) screenshot (look at the border on the Watch button):
    http://www.prototypos.com/screenshots/safariroundedborder.png
    http://www.prototypos.com/screenshots/firefoxroundedborder.png
    Do folks on the Apple Safari dev team read this site? If so, I'd appreciate it if they take a look at this issue.
    thanks, Chuck
    Message was edited by: Dr. Chuck
    Message was edited by: Dr. Chuck

    Are you doing this with CSS3 ? If your using CSS 3 you know it hasn't really been fully implemented in all browsers, (even if they say so). Even tho CSS 3 is out and running, I myself tend to shy away from stuff like round corners.
    No Apple won't see this.

  • Unit price in Invoice form(Rounding up issues)

    Hi Gurus!
    In my smartform I have used a formula to get the unit price of an item line which is giving me rounding up issues as it is calulating upto the 3 decimal places that I require in my output. Is it possible to grab the unit price field (KEBTR) directly into my form for the unit price so that I get the actual amount as in SAP into my invoice output rather than caluclting it in my code so that there is no discripancies.
    Like it shows on my form sometimes 98.999 or sometime 99.001 instaed of 99.00 as is in under the condition tab of the invoice, I would like it to show straght as is in SAP 99.000 rather tahn doing caluction and coming to a smallest decimal value.
    CLEAR: g_unit_price, g_min_charge_flag, g_item_tot, g_skto_kwert.
    * get skto amount (Cash discount)
    LOOP AT gt_konv INTO gs_konv WHERE kposn = gs_gen_del-itm_number AND
    kschl = 'SKTO'.   "Cash discount
    g_skto_kwert = gs_konv-kwert.
    EXIT.
    ENDLOOP.
    * For rental contracts there is no delivery so surcharges must be removed from net.
    IF is_bil_invoice-hd_gen-bil_type = 'ZFV'.
    CLEAR gs_gen_del-kzwi3.
    LOOP AT gt_konv INTO gs_konv WHERE
    kposn = gs_gen_del-itm_number AND
    stunr BETWEEN 230 AND 289.
    gs_gen_del-kzwi3 = gs_gen_del-kzwi3 + gs_konv-kwert.
    ENDLOOP.
    ENDIF.
    g_item_tot = gs_gen_del-netwr - gs_gen_del-kzwi3.
    IF gs_gen_del-fkimg <> 0.
    g_unit_price = g_item_tot / gs_gen_del-fkimg.
    ENDIF.
    Thanks
    Edited by: Aarav  Agnihotri on Jun 11, 2009 6:58 PM

    Hi Aarav,
    Check this links
    [Rounding|Rounding]
    [Rounding off value|Re: Rounding off value]
    Read Above for a clear idea about Rounding values.
    [Rounding of the Values|Rounding of the Values]
    [Quantity & Rounding condition values|Re: Quantity & Rounding condition values]
    [Rounding down values|Re: Rounding down values]
    For More results Search In SDN...
    Thanks & regards,
    Dileep .C

  • Php-cgi install issue

    I had the php package installed until I realized I needed php-cgi for what I want to do.  When I tried to install php-cgi it complained about php being installed so I removed php.  But now when I try to install php-cgi, I get this...
    % pacman -S php-cgi
    resolving dependencies... done.
    looking for inter-conflicts...
    error: unresolvable package conflicts detected
    error: failed to prepare transaction (conflicting dependencies)
    :: php: conflicts with php-cgi
    The weird part is that php has been removed.  Any ideas folks?

    i think this is a bug ... i dunno( if it's pacman of pkg related ), however .. you can get round it, ( or should ) by installing php as it was before .. then pacman -S php-cgi, this should prompt with a conflict warning, just issue Y, to replace it (note: don't remove it manually).
    if that's what you did, i unfortunately have no other solution.

  • PHP email form - issue with who it's from

    Hi,
    I've got a referral page on my site where the user puts in their details and a friends details and the form fires off a email to the friend. The form is in HTML and posts it to a PHP file. The problem is I get in the email for who it's from:
    from
    "Scott Bradshaw"@server74.ukservers.net
    I don't want the
    @server74.ukservers.net
    in their.
    Is this an issue with PHP files and forms or is their a way round it? I know I could do a mailto: form but don't want to. What are my options?
    Thanks, Scott

    I'm making the website for someone and they had the hosting set up already but thanks for telling me. I think this is right what I've done:
    function detectSuspect($val, &$ok) {
      if (preg_match('/Content-Type:|Cc:|Bcc:/i', $val)) {
        $ok = false;
    $YourName = Trim(stripslashes($_POST['YourName']));
    $YourEmail = Trim(stripslashes($_POST['YourEmail']));
    $RefName = Trim(stripslashes($_POST['RefName']));
    $RefEmail = Trim(stripslashes($_POST['RefEmail']));
    $EmailFrom = $YourEmail;
    $Subject = $RefName;
    $EmailTo = $RefEmail;
    // validation
    $validationOK=true;
    detectSuspect($YourName, $validationOK);
    detectSuspect($YourEmail, $validationOK);
    detectSuspect($RefName, $validationOK);
    detectSuspect($RefEmail, $validationOK);
    if (!$validationOK) {
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
      exit;
    // prepare email body text
    $Body = "Hi $RefName,
    $YourName thought you would be interested in viewing this online video called A
    tale of 2 customers (< 3 mins).
    www.easybench.org/ataleof2customers3";
    $Body2 = "";
    $Body2 .= "User Name: ";
    $Body2 .= $YourName;
    $Body2 .= "\n";
    $Body2 .= "User Email: ";
    $Body2 .= $YourEmail;
    $Body2 .= "\n";
    $Body2 .= "Referral Name: ";
    $Body2 .= $RefName;
    $Body2 .= "\n";
    $Body2 .= "Referral Email: ";
    $Body2 .= $RefEmail;
    $Body2 .= "\n";
    // send email
    $success = mail($EmailTo, $Subject, $Body, "From: $EmailFrom<$EmailFrom>");
    mail("[email protected]", "Referral details", $Body2, "From: [email protected]");
    // redirect to success page
    if ($success){
      print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyou2.html\">";
    else{
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
    ?>
    I've also got a feedback form thing too, the script above wouldn't work for it I guess as it's protecting against different thing but what's the best way to protect the feedback form? I've heard of a honeypot thing where create hidden form field.
    Thanks, Scott

  • Rounding off Issue (Net Value not equal to Net Price * quantity)

    Dear Gurus,
    Here is an interesting issue.The default calculation done in the pricing procedure is two decimal places.Now we consider a real scneario,consider the net value of 324 quantities of an item calculated is 36,049.86 .When it is divided by quantity  the resulting value of net price is 111.265 but the system shows 111.27 by rounding it off.
    Now here comes the problem,my client needs the rate to be shown on the order script to be two decimal places and the net value should be equal  quantity * net price.So if we apply this,
    324 * 111.27 = 36051.48
    But the net value calculated by the system is 36,049.86.So it can be consluded that:
    "Quantity * Net Price Shown is not Equal to Net Value calculated by the System"
    Need an urgent resolution,project is stuck on this
    Regards,
    Sam Ahmed
    Edited by: Lakshmipathi on Nov 3, 2011 12:14 PM
    Please dont add URGENT in subject or in your post

    Here is the pricing procedure,
    We start with the amount condition types
                                            Unit Price        Units Condition Value
    ZMRP     MRP                     1,700.00           10     PAC     55,080.00      
    ZTRP     Trade Price     1,445.00           10     PAC     46,818.00      
    ZDPR     Dist. Price     1,445.00           10     PAC     46,818.00         (GL)
    Using Trade Price we apply the product discount of 23%
    ZPRD     Product Discount     23.000-     %                    10,768.14-
    Then we send discount amount to the gl by using condition type ZDIS
    ZDIS      Discount Value     100.000-     %           10,768.14-      (GL)
    tHE RESULTING NET VALUE IS  36,049.86      as 46818.00 - 10,768.14
         Order Item value     111.27      1     PAC     36,049.86      
    And the Net Price is 111.27

  • PHP Delete Record Issue

    I've set up a simple database for adding event news to a
    site. I'm pretty new to PHP, but I have the Insert, Update, and
    Display pages working properly. However the Delete Record page is
    being a big pain. I have it set up just as it explains in
    Dreamweaver Help, as well as a tutorial i am using as a backbone
    for this project. Its a form with a hidden filed that is
    dynamically pulling my ID. I have the Delete behavior pointing at
    the same ID and record set.
    My Delete link is properly setting up a dynamic page with the
    title of record to be deleted showing up just fine. Also, the
    redirect page is correct after hitting the Delete button. Which
    makes me believe the issue is happening in somewhere in the
    behavior. None of my records are being deleted when I go back to
    the Display page. They are still there. Im pointing the behavior at
    my Primary record so im not sure what's going on. I'm a first-timer
    to this. Any help would be much appreciated.
    Here is my code:

    Hi
    I was reading your post and realized that I had the same
    troubles the first time I tried to setup a record deletion page.
    I hope the following helps.
    What I ended up doing was to set up 3 pages..
    1) a user list page of all users in the users table
    2) a confirmation page to show user info
    3) a delete page which does the actual deletion
    This first page was a simple repeat region table showing the
    entire list of users in the database table. I linked the username
    to the conformation page with a simple URL Parameter to isolate the
    user I want to delete
    Here is the code
    <a href="admin_users_delconfirm.php?id=<?php echo
    $row_rsUsers['id']; ?>
    The on the confirmation page I have a delete button graphic
    which is linked to the delete page in the same way.
    Code:
    <a href="admin_users_delete.php?id=<?php echo
    $row_rsUsers['id']; ?>
    Finally on the delete page I applied the" delete record"
    server behaiviour so that the deletion is done when the page loads.
    You can also have it redirect back to the master list of users when
    the deletion is done.
    It may seem a little redundant to have 3 pages, but the
    purpose of the 2nd page is to give the user an opportunity to
    change their mind and also to remind them that the delete action
    cannot be undone.
    I hope this helps you.
    Good Luck and Good Coding!

  • Re:Total(LC) Rounding off issue in Sale Order document ..!!!

    Dear SAP Members,
    My end user facing a issue while entering the sale order.The scenario is,For a item say 'X',its quantity is 24,unit price is 41.15,discount is 8%,then the total amount (ie)Total (LC) should be 908.59, but the system shows as 908.64.Why I'm getting this issue.
    I have given Rounding Method by currency.
    Display settings as:
    Amount-2
    Price-2
    Rates-4
    Quantities-2
    Percent-6
    Units-2
    Currency settings:
    Rounding Method-Round to one.
    Decimals-Default
    I have tried all possibilities in test database but still I'm facing the same issue..
    Please give me solution to solve this issue.
    With Regards,
    Revathy

    The software's logic is as follows it calculates the unit price after discount then times that rounded amount to the quantity. That is also why there is net unit price on the row level if you look in the DB. You could do a manual adjustment on the total but that will play abound with the discount a bit. Business one logic is very relational and because of the cascading of header tables and row level tables the calculations are not intuitive to most users. But on the upside you are guarantee consistent rounding by the software across the board.

  • MariaDB, PHP, and mysql_connect() issue on Installation scripts

    I searched for this issue and turned out nothing..
    I am using an installation script on my web server and i get this error:
    function mysql_connect() not found:
    Your system does not appear to have mysql available within php
    I followed the wiki and have uncommented the following lines
    extension=pdo_mysql.so
    extension=mysqli.so
    extension=mysql.so
    I have also restarted the httpd daemon several times. I am using MariaDB because I know arch is dropping mysql. I followed the MariaDB wiki too and have it set-up properly.
    Here is my "mysqli" section of phpinfo()
    MysqlI Support    enabled
    Client API library version     mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
    Active Persistent Links     0
    Inactive Persistent Links     0
    Active Links     0
    Directive    Local Value    Master Value
    mysqli.allow_local_infile    On    On
    mysqli.allow_persistent    On    On
    mysqli.default_host    no value    no value
    mysqli.default_port    3306    3306
    mysqli.default_pw    no value    no value
    mysqli.default_socket    /var/run/mysqld/mysqld.sock    /var/run/mysqld/mysqld.sock
    mysqli.default_user    no value    no value
    mysqli.max_links    Unlimited    Unlimited
    mysqli.max_persistent    Unlimited    Unlimited
    mysqli.reconnect    Off    Off
    and here is "mysqlnd" in phpinfo()
    mysqlnd
    mysqlnd    enabled
    Version     mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $
    Compression     supported
    SSL     supported
    Command buffer size     4096
    Read buffer size     32768
    Read timeout     31536000
    Collecting statistics     Yes
    Collecting memory statistics     No
    Tracing     n/a
    Loaded plugins     mysqlnd,example,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password
    API Extensions     mysqli
    MySQL is running as I have set-up a database and user for this installation script.

    I dropped to the command line and tried to run php and realized that mysql.so was named mssql.so..
    so for anyone that has this issue, when you install php, unless they change it next release, that's a typo you have to fix when uncommented the mysql extension
    Last edited by evil (2013-03-31 19:34:12)

  • Q of Q round number issue

    Hi All,
    I cannot use round function in Query of Query. I can cast the number as integer like:
    <cfquery dbtype="query">
         select cast(myValue as integer) finalNumber
         from myQuery
    </cfquery>
    where myValue = 65.7, but the result is 65, it should be 66.
    It is a work around this issue?
    Thanks!

    Here is my code solution Dan:
         <cfloop from="1" to="#totalYears#" index="y">
                <cfset tempYear = qryResult["year_" & #y#] />
                <cfset QuerySetCell(firstQuery, "year_#y#", round(tempYear))>
            </cfloop>
    Thanks!

  • Rounding Profile Issue in Article Master - IS Retail System

    Hi,
    We have an Issue with the Rounding Profile in Article Master of IS Retail System.
    Rounding Profile (50) Maintained at Purchasing View of Article Master (MM41 & MM42) and the same is getting copied to Logistic DC View and Logistic Stores of Article Master
    Scenario: -
    DC Rounding Profile is being incorrectly applied to Store to Distibution Ceter STO
    Return STO between Stores (xx01 u2013 xx10) and Distribution Center (Site u2013 XXAA and XXBB)
    Store is returning the Stock to the Distribution Center. While creation of Return STO, System is taking the Rounding Profile QTY maintained at Purchasing View of Article Master Record.
    Configuration Done:
    The Rounding Profile Field hide at the Logistic: DC View and Logistic: Store View of Article Master (OMSR  MARC-RDPRF).Hence the Rounding Profile Field at Both Logicstics View got disappeared in Article Master Screens. But still the entries are visible at MARC Table.
    Issue:-
    The system is picking the Wrong Qty (50) instead of 1 Qty while creation of Return STO between Stores and Distribution Center.The System is prompting the Qty 50 (Which is maintained in Purchasing View of Article Master but No Rounding Profile is maintained at Logistic: DC View and Logistic: Stores View of the same Article).
    REQUIREMENT:
    While creation of Return STO between the Stores and Distribution Center the Rounding Profile should be inactive.
    The system should pick up the Right Qty entered instead of Rounding Profile Qty.
    Your valuable suggestions or advises are highly appreciated...
    Regards,
    Sateesh.Kandula
    Edited by: VijayaSateeshKumar Kandula on Nov 8, 2010 11:52 PM

    Hi,
    We have resolved this Issue using the Configuration Change in OMSR and programatically.
    Thanks
    Sateesh.Kandula

  • PHP mysql PDO issue

    Hi all,
    I just installed LAMP stack following the instructions in Wiki.  Looks like PHP 5.3.6 will not load PDO drivers for mysql.  phpinfo() shows the following line for PDO:
    PDO support    enabled
    PDO drivers    no value
    I have extensions mysqli.so, mysql.so and pdo_mysql.so uncommented in the php.ini.
    php -m shows only PDO and mysqlnd loaded.
    My application works fine on Ubuntu server running PHP 5.3.3.
    Did anyone else run into this problem before?
    Thanks in advance.

    Ok,
    I found that copying the php.ini.pacnew over the old one and uncommenting the appropriate extensions it started working.  But I stumbled over some strange beahiour with error reporting. When I activate
    Development Value: E_ALL | E_STRICT
    This brakes the pdo extensions ... very annoying.

  • PHP and MySQL issue {subject edited by moderator}

    Using Dreamweaver and PHP.   On one page, I have a form with an Insert Field (LastName) that enter into the SQL database. SQL database has the ID auto-increment.   When I click on Send (with the data entered into the database), I want the new page to open and display the ID field.  but when I insert a new id and I click Send it still displays the old id, whereas I want to display a new ID

    This code for isert page
    <?php require_once('Connections/pendaftaran.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form")) {
      $insertSQL = sprintf("INSERT INTO maklumat_fail (fail_tajuk, fail_no, fail_seksyen, fail_hari, fail_bulan, fail_tahun, fail_rakbesi, fail_laci, fail_baris) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['fail_tajuk'], "text"),
                           GetSQLValueString($_POST['fail_no'], "int"),
                           GetSQLValueString($_POST['fail_seksyen'], "text"),
                           GetSQLValueString($_POST['fail_hari'], "int"),
                           GetSQLValueString($_POST['fail_bulan'], "text"),
                           GetSQLValueString($_POST['fail_tahun'], "int"),
                           GetSQLValueString($_POST['fail_rakbesi'], "text"),
                           GetSQLValueString($_POST['fail_laci'], "text"),
                           GetSQLValueString($_POST['fail_baris'], "text"));
      mysql_select_db($database_pendaftaran, $pendaftaran);
      $Result1 = mysql_query($insertSQL, $pendaftaran) or die(mysql_error());
      $insertGoTo = "detailPendaftaran.php?" . $row_Recordset1['fail_tajuk'] . "=";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form")) {
      $updateSQL = sprintf("UPDATE maklumat_fail SET fail_no=%s, fail_seksyen=%s, fail_hari=%s, fail_bulan=%s, fail_tahun=%s, fail_rakbesi=%s, fail_laci=%s, fail_baris=%s WHERE fail_tajuk=%s",
                           GetSQLValueString($_POST['fail_no'], "int"),
                           GetSQLValueString($_POST['fail_seksyen'], "text"),
                           GetSQLValueString($_POST['fail_hari'], "int"),
                           GetSQLValueString($_POST['fail_bulan'], "text"),
                           GetSQLValueString($_POST['fail_tahun'], "int"),
                           GetSQLValueString($_POST['fail_rakbesi'], "text"),
                           GetSQLValueString($_POST['fail_laci'], "text"),
                           GetSQLValueString($_POST['fail_baris'], "text"),
                           GetSQLValueString($_POST['fail_tajuk'], "text"));
      mysql_select_db($database_pendaftaran, $pendaftaran);
      $Result1 = mysql_query($updateSQL, $pendaftaran) or die(mysql_error());
      $updateGoTo = "detailPendaftaran.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $updateGoTo));
    mysql_select_db($database_pendaftaran, $pendaftaran);
    $query_Recordset1 = "SELECT * FROM maklumat_fail";
    $Recordset1 = mysql_query($query_Recordset1, $pendaftaran) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>SISTEM PENDAFTARAN FAIL</title>
    <style type="text/css">
    .right {
      text-align: right;
    body {
      background-color: #6699CC;
    </style>
    </head>
    <body><form action="<?php echo $editFormAction; ?>" name="form" method="POST">
      <center>
        <p><img src="mps.png" width="1119" height="244" /></p></center>
      <table width="332" border="0" align="center">
          <tr>
            <td><h1 class="K">PENDAFTARAN FAIL</h1></td>
          </tr>
      </table>
        <p> </p>
        <table width="200" border="2" align="center" class="l">
          <tr>
            <td><center isoptional="l">Maklumat Fail</center></td>
          </tr>
      </table>
        <p> </p>
        <center><table width="587" border="6">
          <tr>
            <td width="567" height="233"><table width="560" height="206" border="0">
                <tr>
                  <td width="147" class="right"><strong>No. Fail</strong></td>
                  <td width="10">:</td>
                  <td width="432">MPSepang
                    <input name="fail_no" type="text" id="fail_no" size="40" /></td>
                </tr>
                <tr>
                  <td class="right"><strong>Tajuk Fail</strong></td>
                  <td>:</td>
                  <td><textarea name="fail_tajuk" cols="40" rows="5" id="fail_tajuk"></textarea></td>
                </tr>
                <tr>
                  <td class="right"><strong>Seksyen</strong></td>
                  <td>:</td>
                  <td><select name="fail_seksyen" size="Seksyen" id="fail_seksyen">
                      <option>Seksyen</option>
                      <option>Pentadbiran</option>
                      <option>Web, Latihan &amp; Komuniti</option>
                      <option>Rangkaian &amp; Infrastruktur</option>
                      <option>Sistem</option>
                  </select></td>
                </tr>
                <tr>
                  <td class="right"><strong>Tarikh Fail Dibuka</strong></td>
                  <td>:</td>
                  <td><select name="fail_hari" size="Hari" id="fail_hari">
                      <option>Hari</option>
                      <option>1</option>
                      <option>2</option>
                      <option>3</option>
                      <option>4</option>
                      <option>5</option>
                      <option>6</option>
                      <option>7</option>
                      <option>8</option>
                      <option>9</option>
                      <option>10</option>
                      <option>11</option>
                      <option>12</option>
                      <option>13</option>
                      <option>14</option>
                      <option>15</option>
                      <option>16</option>
                      <option>17</option>
                      <option>18</option>
                      <option>19</option>
                      <option>20</option>
                      <option>21</option>
                      <option>22</option>
                      <option>23</option>
                      <option>24</option>
                      <option>25</option>
                      <option>26</option>
                      <option>27</option>
                      <option>28</option>
                      <option>29</option>
                      <option>30</option>
                      <option>31</option>
                    </select>
                      <label for="bulan2"></label>
                      <select name="fail_bulan" size="Bulan" id="bulan2">
                        <option>Bulan</option>
                        <option>Januari</option>
                        <option>Februari</option>
                        <option>Mac</option>
                        <option>April</option>
                        <option>Mei</option>
                        <option>Jun</option>
                        <option>Julai</option>
                        <option>Ogos</option>
                        <option>September</option>
                        <option>Oktober</option>
                        <option>November</option>
                        <option>Disember</option>
                      </select>
                      <label for="fail_tahun"></label>
                      <select name="fail_tahun" size="Tahun" id="fail_tahun">
                        <option>Tahun</option>
                        <option>2014</option>
                        <option>2015</option>
                        <option>2016</option>
                        <option>2017</option>
                        <option>2018</option>
                      </select>
                      <label for="tarikhBuka"></label></td>
                </tr>
                <tr>
                  <td bgcolor="#FFFFFF" class="right"> <label><strong>Lokasi</strong></label></td>
                  <td>:</td>
                  <td>Rak Besi
                    <label>
                      <select name="fail_rakbesi" size="Seksyen" id="fail_rakbesi">
                        <option>Rak Besi</option>
                        <option>A</option>
                        <option>B</option>
                      </select>
                      Laci
                      <select name="fail_laci" size="Seksyen" id="fail_laci">
                        <option>Laci</option>
                        <option>A1</option>
                        <option>A2</option>
                        <option>A3</option>
                        <option>A4</option>
                        <option>B1</option>
                        <option>B2</option>
                        <option>B3</option>
                        <option>B4</option>
                      </select>
                      Baris
                      <select name="fail_baris" size="Seksyen" id="fail_baris">
                        <option>Baris</option>
                        <option>1</option>
                        <option>2</option>
                        <option>3</option>
                        <option>4</option>
                        <option>5</option>
                        <option>6</option>
                        <option>7</option>
                        <option>8</option>
                        <option>9</option>
                        <option>10</option>
                        <option>11</option>
                        <option>12</option>
                        <option>13</option>
                        <option>14</option>
                        <option>15</option>
                        <option>16</option>
                        <option>17</option>
                        <option>18</option>
                        <option>19</option>
                        <option>20</option>
                      </select>
                    </label></td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td><label>
              <div align="center">
                <input type="submit" name="submit" id="submit" value="Submit" />
              </div>
            </label></td>
          </tr>
      </table>
      </center>
        <p> </p>
    <center>
          <p>
            <label></label>
          <p> </p>
      </center>
      <center>
        <p><img src="nwUWE4K.jpg" width="1119" height="200" /></p>
      </center>
      <input type="hidden" name="MM_insert" value="form" />
      <input type="hidden" name="MM_update" value="form" />
    </form>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>
    This for display page
    <?php require_once('Connections/pendaftaran.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $colname_Recordset1 = "-1";
    if (isset($_GET['fail_baris'])) {
      $colname_Recordset1 = $_GET['fail_baris'];
    mysql_select_db($database_pendaftaran, $pendaftaran);
    $query_Recordset1 = sprintf("SELECT * FROM maklumat_fail WHERE fail_baris = %s", GetSQLValueString($colname_Recordset1, "text"));
    $Recordset1 = mysql_query($query_Recordset1, $pendaftaran) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>SISTEM PENDAFTARAN FAIL</title>
    <style type="text/css">
    .right {
      text-align: right;
    body {
      background-color: #6699CC;
    </style>
    </head>
    <body><form action="" method="get">
      <center>
        <p><img src="mps.png" width="1119" height="244" /></p>
      </center>
        <p><center>
        </p>
        <p> </p>
        <p> </p>
        <center>
          <table width="406" border="0">
            <tr>
              <td width="247"><h1>Fail telah berjaya didaftar!!</h1></td>
            </tr>
          </table>
          <p> </p>
          <table width="389" border="6">
            <tr>
              <td><table width="370" height="174" border="0">
                <tr>
                  <td width="129" class="right"><strong>No.Fail</strong></td>
                  <td width="8">:</td>
                  <td width="211"><?php echo $row_Recordset1['fail_no']; ?></td>
                </tr>
                <tr>
                  <td class="right"><strong>Tajuk Fail</strong></td>
                  <td>:</td>
                  <td><?php echo $row_Recordset1['fail_tajuk']; ?></td>
                </tr>
                <tr>
                  <td class="right"><strong>Seksyen</strong></td>
                  <td>:</td>
                  <td><?php echo $row_Recordset1['fail_seksyen']; ?></td>
                </tr>
                <tr>
                  <td class="right"><strong>Tarikh Fail Dibuka</strong></td>
                  <td>:</td>
                  <td><?php echo $row_Recordset1['fail_hari']; ?><?php echo $row_Recordset1['fail_bulan']; ?><?php echo $row_Recordset1['fail_tahun']; ?></td>
                </tr>
                <tr>
                  <td class="right"><strong>Lokasi</strong></td>
                  <td>:</td>
                  <td><?php echo $row_Recordset1['fail_rakbesi']; ?><?php echo $row_Recordset1['fail_laci']; ?><?php echo $row_Recordset1['fail_baris']; ?></td>
                </tr>
              </table></td>
            </tr>
          </table>
          <p><a href="test1.php">MENU</a></p>
          <p> </p>
          <p> </p>
      </center>
        <p> </p>
        <p><img src="nwUWE4K.jpg" width="1119" height="200" /></p>
    </form>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>

  • PHP external authentication issue

    Trying to login to AFCS connection using external authentication.
    PHP file generates a key correctly and everything seems to fine up until i get to using the key inside flex.
    at the login stage i get the following error in the console trace from the library login call
    As far as i can tell everything is right... how can i tell what is wrong with the authentication key?
    AFCS Beta Build # : 1.1
    requestInfo https://connectnow.acrobat.com/{roomname}?exx=eDp7dXRmOF9lbmNvZGUoZGFyaXVzKX06OmRtOmFnZW50ZG06aHR0cHM6Ly9jb25uZWN0bm93LmF jcm9iYXQuY29tL2hpaW50ZXJmYWNlL2RtOjEwMDo4N2NmNWUwMjIzZTVhMmFkYzI2MmY4MDVlNWJmMWVlM2Y4OTJlY 2Qx&mode=xml&x=0.2519759591668844
    #THROWING ERROR# bad authentication key

    There are a few mistakes in the key. There is some PHP 'code' in it (wrong string expansion ?) and you are using a full URL instead of the room name.
    If you want more details send me a private message, but you should check the way you call the get authentication token method.

  • Php and float issue

    I have created a <div "content"> with inside two divs:
    <div "left"> and <div "right">
    I want both to be adjacent, so the left div I float. In the left I want some images and text, in the right I want a php form. This form works perfect in a regular division, and also in the <div "right"> as long as I don't float the left division.
    This is the php function: <?php include_once("gbcf-v3/form.php"); ?>
    The widht of the div is sufficient for the form; the webpage appears properly with the form showing, if I don't float the left div (but then the form shows up underneath to the right of the left div. If I float the left div, to get the form show up adjacent to the left div, the webpage stays blanc. And yes, I transfer the styles directory to my server every time I change a style.
    What do I do wrong?
    Thanks for any help,
    Erik
    Here is the link to the page, showing the php form in the wrong place (underneath instead of to the right of my text and image):
    http://mysafety.be/inbraakbeveiliging%20promoties%20v2.html

    The css errors have been corrected, the html errors are in process. I already have the form where I want: http://mysafety.be/inbraakbeveiliging%20promoties%20v2.html
    There are still errors, but I see you've managed to get the form where you want it.
    1. I am puzzled by your xhtml comment, more out of ignorance then anything else: when starting up this site I choose xhtml v1.0 transitional just because I was thought to do so in one of the Dreamweaver tutorials. Should I rather use HTML 4.0 transitional straight away in the future?
    Since you are just starting out, I recommend learning 4.01 Strict. This will make your HTML documents easier to upgrade to 5.0x when it is eventually approved. Others may recommend using 4.01 Transitional as you develope your skills in HTML. I personally think Transitional is good for those who learned the old, deprecated and/or obsolete versions and need to transition to the stricter versions. (XHTML uses 4.01 Strict as its starting point).
    What is the pro and con of html 4.0 transitional vs xhtml 1.0 transitional?
    IMO, XHTML is more a fad than anything. It DOES have its place, but it has been, at best, poorly implemented. And if you do not know what it is for, or how to use its features, it doesn't make much sense to use that DOCTYPE. Here are some specifics written by others http://en.wikipedia.org/wiki/Xhtml#Criticism
    Mark A. Boyd
    Keep-On-Learnin' :-)

Maybe you are looking for