Comparison of the post not producing desired do not result

During my form validation before update of database, I check if the 'hpropid' field is empty and echo a message appropriate (this works), then check if the field is between 3-15 characters (this also works), I finally check that the displayed value new is different from the original value by comparing the $_POST ['vpr'] to $_POST ['hpropid'] This is where I'm having problems, mainly if the values are the same I Don t want to search on the database to check if all records have the same reference number, but if the values are different I don't want she runs research and echo $error ['errprop'] error message.

When the values are the same, and I know that the values are the same that I placed the code to echo values, the search on the database is always run when it shouldn´t if my comparison works which creates the error which is incorrect. It seems that the line that causes my problem is: if ($_POST ["RVP"]! = $_POST ['hpropid']) {-fact echo the value of vpr is C23 and the value of hpropid is C23, so why if they are not equal the meaasge research and database error still gets executed?}

I pasted the full piece of code validation below:

Any help with this will be appreciated, thanks in advance.

If created empty field the error message at the echo in the body
If (empty($_POST['hpropid'])) {}
$error ['errpropid'] = 'Please enter the property reference. " }

Otherwise, if the field not between 3 to 15 characters create error message to echo in the body
else if (! empty($_POST['hpropid'])) {/ / check propid}
$_POST ['hpropid'] = trim($_POST['hpropid']);
$propid = $_POST ['hpropid'];
If {(strlen ($propid) < 3)
$error ['errpropid'] = 'Please enter a property reference that contains 3 to 15 characters';
}
$_POST ['hpropid'] = trim($_POST['hpropid']);
$propid = $_POST ['hpropid'];
If {(strlen ($propid) > 15)
$error ['errpropid'] = 'Please enter a property reference that contains 3 to 15 characters';
}
}

If the original value and the new value differ run the check on the database and the error message created

If the values are the same Don t run the serach on the database that nothing has been changed in this area
If (isset($_POST['vpr'])) {}
{If ($_POST ["RVP"]! = {$_POST ['hpropid']})}
echo POST vpr is: '. $_POST ["RVP"]. ' < br / > ';
echo hpropid POST is: '. $_POST ['hpropid']. ' < br / > ';

$LoginRS__query = sprintf ("SELECT hpropid FROM holidayletstable WHERE hpropid = %s", GetSQLValueString ($propid, "text") ");
@mysql_select_db ($database_connAdd, $connAdd);
$LoginRS = mysql_query ($LoginRS__query, $connAdd) or die (mysql_error ());
$loginFoundUser = mysql_num_rows ($LoginRS);

If there is a line in the database, the propid was found - can not match the requested reference
{if ($loginFoundUser)}
$error ["errprop"] = "$propid is already in use. Please enter a different property reference. « ;
}
}
}
}

tessimon wrote:

Why if they are not equal the meaasge research database and error still become executed?

Don't know. It may be because you have applied trim() to one, but not the other. Your code is rather repetitive and contains some errors (maybe you didn't copy it exactly in there). Try this:

$error = array();
// if field empty created error message to echo in body
if (empty($_POST['hpropid'])) {
  $error['errpropid'] = 'Please enter the property reference';
} else {
  $_POST['hpropid'] = trim($_POST['hpropid']);
  $len = strlen($_POST['hpropid']);
  if ($len < 3 || $len > 15) {
    $error['errpropid'] = 'Please enter a property reference that contains 3 - 15 characters';
  }
}

if (!$error && isset($_POST['vpr'])) {
  $_POST['vpr'] = trim($_POST['vpr']);
  // if original value and new value are different run check
  // on the database and created error message

  // if values are the same don´t run the serach on the database
  // as nothing has been changed in this field
  if ($_POST['vpr'] != $_POST['hpropid']) {
    echo 'POST vpr is: ' . $_POST['vpr'] . '
'; echo 'POST hpropid is: ' . $_POST['hpropid'] . '
'; $LoginRS__query = sprintf("SELECT hpropid FROM holidayletstable WHERE hpropid=%s", GetSQLValueString($propid, "text")); mysql_select_db($database_connAdd, $connAdd); $LoginRS=mysql_query($LoginRS__query, $connAdd) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); //if there is a row in the database, the propid was found // - can not add the requested reference if($loginFoundUser) { $error['errprop'] = "$propid is already in use. Please enter a different property reference."; } } }

Tags: Dreamweaver

Similar Questions

  • Download the poster not

    I just bought the Lightroom upgrade 4 but the English to download it link.  The serial number appears along with the language version multiple but not the English version.  Any ideas?

    Kevin,

    You can simply download here and use the same serial key

    http://www.Adobe.com/go/trylightroom/

    See you soon

    LP

  • Redirect to another page with parameter passing using the POST method

    Hello

    I need to redirect to another page and pass parameters to it with the POST (not GET) method. How can I do?

    So far, I tried the 2 options and none of them works very well:
    1. I wrote a pl/sql procedure, but if I run it, then the page runs on my server application instead of actually going to another page in another server (I see the neame of the procedure in the web browser's address bar). Is there a way to work around a bit so that really, it goes to another page and pass the variables?

    procedure do_post)
    p_api_url in varchar2)
    is
    l_http_req utl_http.req;
    l_http_resp utl_http.resp;
    l_response varchar2 (4000);
    l_post varchar2 (4000);
    v_line varchar2 (4000);
    v_wallet varchar2 (100): = "file:/etc/ORACLE/WALLETS/oracle5";
    v_wallet_pwd varchar2 (100): = "test1234".
    Start
    l_post: = ' VK_SERVICE = 1001 & VK_VERSION = 008 & VK_SND_ID = testvpos & VK_STAMP = 88';

    Utl_http.set_Proxy (apex_application.g_proxy_server, NULL);
    Utl_http.set_persistent_conn_support (true);
    Utl_http.set_transfer_timeout (300);
    Utl_http.set_wallet (v_wallet, v_wallet_pwd);
    l_http_req: = utl_http.begin_request (p_api_url, 'POST');
    Utl_http.set_header (l_http_req, "Proxy-Connection ',' Keep-Alive'");
    Utl_http.set_header ("l_http_req, 'Content-Type', ' application/x-www-formulaires-urlencoded; charset = utf-8 ');
    Utl_http.set_header (l_http_req, "Content-Length", length (l_post) ");
    Utl_http.write_text (l_http_req, l_post);
    l_http_resp: = utl_http.get_response (l_http_req);

    LOOP
    Utl_http.read_line (l_http_resp, v_line, TRUE);
    HTP.p (v_line);
    END LOOP;
    Utl_http.end_response (l_http_resp);

    EXCEPTION
    WHEN utl_http.end_of_body THEN
    Utl_http.end_response (l_http_resp);
    end do_post;


    2. the second option, I tried is to put this script to my page of request code:

    < name of the form = 'mounted' action = 'https://www.somekindofurl.com/cgi-bin/dv.sh/un3min.r. '
    method = "POST" target = "_top" >
    < input type = "hidden" name = "VK_SERVICE" value = "1001" >
    < input type = "hidden" name = "VK_VERSION" value = "008" >
    < input type = "hidden" name = "VK_SND_ID" value = "testvpos" >
    < input type = "hidden" name = "VK_STAMP" value = "88" >
    < input type = "submit" value = "Let's's Pay" >
    < / make >

    < / make >

    But it does not work as APEX has its own system of Forms control. Is it possible to play? I tried to delete #FORM # of page templates and it works fine then. The problem is that I have other forms on the page as well (login form + search form) so I can't remove this manipulation of shape native APEX. Is it possible to play with it?


    Thank you much in advance.

    Hi Ibenarobeno,

    Your form can live at the end of the page with all the hidden items.

    You can then control with buttons and fields within the form of the Apex.
    through a bit of javascript.

    Concerning

    Michael

  • Device HDD external Samsung install properly but don't S poster not in the workstation

    DEVICE SAMSUNG EXTERNAL HARD DRIVE INSTALL PROPERLY BUT DON'T S POSTER NOT IN THE WORKSTATION

    Please select your language from the drop-down menu above to post your question in the language of your choice. The forum in which you've posted is for English only. If you can't find your language above, support for additional international sites options are by following the link below:

    http://support.Microsoft.com/common/international.aspx

    Please select your language from the drop-down list above pour post your question in the language of your choice. The forum you have a posted in EST for English only. If you can't find the desired above language, en charge options pour Additional international locations can be found later in the link below:

    http://support.Microsoft.com/common/international.aspx

    Your question about Samsung HDD external refers to material. Please repost in the Vista Hardware forum:

    http://answers.Microsoft.com/fr-FR/Windows/Forum/windows_vista-hardware?page=1&tab=all

    Mersi.

  • I have published my new folio to an existing application on the app store and made public, but is not in the app store? The notify button does not always take me back to the Organizer screen producer folio.

    I have published my new folio to an existing application on the app store and made public, but is not in the app store? The notify button does not always take me back to the Organizer screen producer folio.

    Hello

    first of all a new folio you post of DPS, the folio will not appear in the App Store, but in the library of the application.

    If this is not the case:

    1 make sure that you have published the folio under the same account that you used to create the Viewer.

    2 - Make sure that you have used a product ID unique for this folio

    3. If the Notify button does not work, note that this feature is available for viewers of enabled notification

    Check whether or not you have the Notification turned on in the dashboard section, otherwise it is likely that this account is not the Application role are entrusted to him... which brings back us to the point #1

  • I read the messages on the screen split prooblem I have. I read the posts and I do not have the separator module of fox. Is there another way I can eliminate the split screen?

    I have firefox installed on both computers. The office displays not the split screen, but the laptop don't. I checked the posts and I have not the separator module of fox but still get the split screen when I click on a second site.

    Firefox has no built-in opportunity to split the screen. There are several add-ons that can split the screen to solve this to know what originally, using the procedure in this link - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

    Another possibility is that you have a few set bookmarks to open in the sidebar. If this only happens for a few bookmarks, right-click on the bookmark, and then select Properties. Make sure that the "Load this bookmark in the sidebar" option is not selected.

  • Satellite Pro A120 does not pass the POST

    Hello

    I'm a character 'J' on the upper left side of the screen immediately after the post (power on self test)?
    It will not go any futher.

    I got into the bios and everything seems fine here, I can boot from a cd, but that's all.
    Hard drive turn but not start.

    Any ideas please?

    Hello

    If you are able to access the BIOS.
    The HARD drive is recognized in the BIOS? You see the details of the HARD drive?
    If so, then that would mean that the HARD drive is ok and BIOS can see it.

    I don't know why J appears on the screen
    Have you seen other error messages or notifications?

    You said that you can boot from the CD. Have you checked if you boot the Linux Live disk?

    This doesn t require installation on the HARD disk, theoretically you should be able to start the distribution of Linux.

  • DEVICE SAMSUNG EXTERNAL HARD DRIVE INSTALL PROPERLY BUT DON'T S POSTER NOT IN THE WORKSTATION

    DEVICE HDD EXTERNAL 2.5 "HDD SATA SAMSUNG INSTALL PROPERLY BUT DON'T S POSTER NOT IN THE WORKSTATION

    Microsoft answers site provides support in English. The following Uniform Resource Locator (URL) will be low - you receive information appropriate for your set up support. Open the link and get your region from the drop-down list, and then click the arrow to continue.

    http://answers.Microsoft.com/fr-FR

  • 'Versions of the application and the database do not match' on the comparison of the annex

    Moved the database to a Server 2003 to server in 2012.  This has been the only change PM receive the message "the application and the database of the versions do not match" when they try to make a comparison of the annex.

    Thanks for your help.  You have provided very concise solutions to my problem, I ended up having also do the following:

    Trip, click the password in the admim.cmd to ensure that the password has been set successfully and deleted the file BREBootStrap.xml (let it recreate itself)

  • I bought Adobe Creative full package of cloud as a teacher, but applications that have tried to installed, they are the poster as the trial for 30 days, why it comes as version track and not as full version.

    I bought Adobe Creative full package of cloud as a teacher, but applications that have tried to installed, they are the poster as the trial for 30 days, why it comes as version track and not as full version, can someone help me on this, as I tried to reach the live chat, but can't find it

    Hello

    Adobe has established this link https://helpx.adobe.com/manage-account-membership/cc-reverts-to-trial.html

    After this, and if your applications make some problems you can use https://helpx.adobe.com/creative-suite/kb/trial--1-launch.html

    If necessary and for other issues, click on the http://helpx.adobe.com/contact.html until your arrival at the 'cat'. If it is 'open' (ago opening hours) Please use it, I personally had the best experiences. I quote Adobe Preran employee: the chat button is enabled as soon as there is an available agent to help.

    Hans-Günter

  • The poster image not centering in the browser

    My image of the poster (for display in IE8) is not centered in the browser window. This is the view as aligned with a big gap to the right of the image on the left. How can I fix it?

    Or I could (which I just discovered) just take my OAM file and place it in a page of Muse, thus ensuring that everything goes as it should.

    Thanks for chiming in well!

  • To mySQL, then the email form does not work after the insertion of the post

    I use the Spry framework to validate certain fields on a form and then insert all of the data forms in a database (with no problems). Then, I want to send an email with a few fields from the form submission.  Normally this works very well in the email PHP code that I have, BUT after adding the spry validation or after you add the insert after section of goto, email PHP code no longer receives the form post data.

    Any ideas what could cause the loss of the post of the form variables?

    Thank you!

    -Daniel Hoviss

    Normally the form sends the data to the processing page, I transmit not explicitly all variables form.

    Like this

    In fact, you pass form variables explicitly. It's that submit a form.

    When you submit a form, the variables are passed to the next page, through the GET method or the POST method. That's why you can access it using $_POST or $_GET. Variables exist only from one page to another. As soon as you redirect the user to another page, the values are destroyed. The code in Dreamweaver $insertGoTo uses the header() function to redirect the user to another page. This is why your variables are no longer available.

    The simple way around this is to add the email script immediately before the code that redirects the user. You can either put the E-mail script directly in the same page, or use a PHP include.

  • The poster image is not rendered, what am I doing wrong?

    That's what I use:

    < pageItemPosterHTML >

    <! [CDATA]

    " < img src = ' http://i62.Tinypic.com/ka0ia1.jpg "alt ="My Logo"> "

    []] >

    < / pageItemPosterHTML >

    I don't get a picture of the poster in muse. Any help is greatly appreciated

    That's how it's done. This answer has been provided by Nthsecret

    (1) I create a preview of my widget (e.g. with photoshop) image.

    (2) insert an image in a server or ftp;

    (3) I add the image in the .mucow file in this mode:

    ]]>

    ]]>

  • Image of the poster is not returned after playthrough

    Before video example was Cathi Kwon on http://www.osmf.org/configurator/fmp/ there a guy explaining what was the strobe and then the assigned poster image is returned. The new example is broken and I'm tearing my hair out trying to get that hosted adobe strobe to act properly and gives me the poster image after playthrough video.

    Please, someone look on this.

    It is by default the initial framework of 'post', you must set endOfVideoOverlay it if you want a diferent picture.

  • my keyboard suddenly begin to type a character over and over again and I can't stop it. Comes to post notes or elsewhere

    My keyboard suddenly started typing a character again and again and I couldn't stop. Arrived at post notes or anywhere where I tried to type. At the same time my wireless mouse began to be nervous and some characters appeared on my typing ("n" with 2 different symbols above it.) I rebooted, but not better - then changed my wireless keyboard - mouse always nervous. But my wireless keyboard does not produce the 'a' and 's' (the reason I went back to wired keyboard) so I reconnected the keyboard and the problem disappeared. Is there any other fix if this happens again?

    Change the batteries, and then maybe try to carefully clean the keyboard and especially around the defective key, or - if the switch or circuit is damaged, or if there was liquid damage, and it's not just a crud stuck in keyswitches - replace the keyboard.

Maybe you are looking for