Form problem - invalid input

iv been using the same code to make input forms ever since i
started but im having this recurring problem with one form. when
people fill in the form when they hit send, sometimes it sends and
other times it goes to a blank screen which says "invalid
input!".there is a line at the top of the php code which mentions
this and then refers to $field for which there is nothing in the
form called this.is that the problem? why would it only work
sometimes?
the line of code is this:
<?
function checkOK($field)
if (eregi("\r",$field) || eregi("\n",$field)){
die("Invalid Input!");
the code for the page can be found here:
http://www.mathminds.co.uk/tutor_application_form.html
thanks.

Greetings,
It appears that you are checking for carrige returns or newlines in the form fields.
Then calling die(); if one or the other is found.
Why not do some form validation to sanitize the input from your form fields correctly.
HTH
-Rb

Similar Messages

  • Simple Form Problem: Cant press Enter in form without getting error message: Invalid Input

    The problem is very simple,
    I have several forms on my site such as the 'quick enquiry'
    form on the home page about half way down.
    http://www.party-invitation.co.uk/index.htm
    The user enters name- Works Fine
    user enters email address- Works Fine
    User enters a question- This is were the problem occurs when
    the users presses the Enter key. This seems to bring up a message
    that says Invalid Input.
    Does anyone know how i can allow people to use the Enter key
    in my forms to skip lines without causing this error message?
    Any help would be appreciated.
    Feel free to use the form to test it out.
    Thanks.
    Here is my php code for the form.
    <?
    function checkOK($field)
    if (eregi("\r",$field) || eregi("\n",$field)){
    die("Invalid Input!");
    $Name=$_POST['Name'];
    checkOK($Name);
    $Email=$_POST['Email'];
    checkOK($Email);
    $Question=$_POST['Question'];
    checkOK($Question);
    $to="[email protected]";
    $message="
    A Quick Enquiry has been submitted from
    www.Party-Invitation.co.uk
    Here are the details:
    Name: $Name
    Email: $Email
    Question: $Question
    if(mail($to,"Quick Enquiry: $Email $Name" ,$message,"From:
    $email\n")) {
    echo "";
    } else {
    echo; "There was a problem sending the mail. Please check
    that you filled in the form correctly.";
    ?>

    .oO(stuckinthesystem)
    > Here is my php code for the form.
    > <?
    This should be <?php for portability reasons. Short open
    tags are an
    optional feature and can be disabled.
    > function checkOK($field)
    > {
    > if (eregi("\r",$field) || eregi("\n",$field)){
    The old ereg_* functions should not be used anymore. Better
    would be
    something like
    if (preg_match("/[\n\r]/", $field)) {...}
    > $Name=$_POST['Name'];
    > checkOK($Name);
    > $Email=$_POST['Email'];
    > checkOK($Email);
    > $Question=$_POST['Question'];
    > checkOK($Question);
    The last check causes the error if the user enters multiple
    lines in the
    text area. You can remove that check, because line breaks in
    the email
    body are safe.
    > if(mail($to,"Quick Enquiry: $Email $Name"
    ,$message,"From: $email\n")) {
    > echo "";
    There's a typo in the last parameter. Variable names in PHP
    are
    case-sensitive, so $Email != $email. You should set
    error_reporting to
    E_ALL in your php.ini, so PHP will let you know about such
    errors.
    Micha

  • Log Error : Invalid Input Parameter %s for every SAP B1 Client

    Hi Everybody,
    in my company we have performed SAP B1 upgrade from 2007A to 8.81 PL07, in two steps upgrading first to PL04.
    Everything is working fine for all our clients, we are able to post and work normally with the system.
    The only annoying problem is an error message coming up every minute for every client in the log:
    SQLMessage       Error              I     Technical     Invalid input parameter: %s # #     MID=-1     BOID=-1     BO=     UserID=manager     C:\Program Files (x86)\SAP\SAP Business One\SAP Business One.exe     Version=8.81.315     Area=     PID=1316     TID=4340     D:\depot\BUSMB_B1\8.8_SP1_REL\SBO\8.8_SP1_REL\Application\__Engines\DBM\__DBMC_DataBase.cpp     9547
    I couldn't find anything regarding this topic in the forum, only one similar post but unanswered.
    We are using two server: one for the licence server and one for the database (the database server is clustered)
    Does anyone have any idea about this? Has it ever happened to anybody?
    Thanks for your help

    Hi Julie,
    it must be a triggered action from the system. The only problem is that log files grow very big, few mb every day, and it is a situation that's not very ideal. And also i don't want to turn them off because it is always a good resource for other errors.
    It is very strange that SAP hasn't noticed this behaviour and there isn't any note available for the purpose.
    Thanks for your help

  • File dialog in jsf form problem

    Dear community,
    I created a form with several input text fields, one of which is to input a filename to attach a file to a form entry. This field has a button next to it which pops up a file dialog. My problem is if I set the button's immediate property to true all the other inputs get lost when the response is rendered. If I set immediate to false other required input fields have to be entered before I can open the file dialog.
    Can anybody please help me out here?
    Thanks,
    Achim

    Hi Achim,
    Did you figure out the answer to your question? I am having the same problem.
    Thanks. -Ceily

  • Invalid input massage error

    dear all
    I want a solution to my problem .
    the problem is when ever i trying to use publish ios app i receive an invalid input massage
    my p12 and cer files are good and thy work on windows copy of flash
    now i am using mac copy (mac 10.7.1 )
    i already updated my flash and this is the version no# 11.5.1.349
    pls if anyone have solution i will appreciate the help.
    Message was edited by: php s

    If you have any knowledge of english you would read it and see 'invalid input' which means you settings aren't filled out properly to publish it.
    You have filled it out but it sounds like one of the options you have to fill out isn't written properly.
    Invalid input could be something like:
    43545435...43.54frgr
    Simply having characters it shouldn't have,
    Check it over and if don't work reinstall flash.

  • Invalid input syntax for type boolean???? ahhhhhh

    Hey all,
    Has anyone come accross the 'invalid input syntax for type boolean' error - its driving me crazy trying to figure out what is wrong with my function/java code!!!
    The postgres (using 8.1) function is:
    CREATE OR REPLACE FUNCTION selectstaffroles("varchar")
    RETURNS refcursor AS
    $BODY$
    DECLARE
    ResultSet refcursor;
    whereClause ALIAS FOR $1;
    BEGIN
    OPEN ResultSet FOR
    EXECUTE 'SELECT role.* FROM role left join staffrole on staffrole.roleid=role.roleid WHERE ' || whereClause;
    RETURN Resultset;
    END;
    $BODY$
    LANGUAGE 'plpgsql' VOLATILE;
    WhereClause sent via java code =
    c.colStaffRoleStaffID+"="+staff.getUserStaffID() -which basically is staffid=2
    Once this query is executed via the java code i get the 'invalid input syntax for type boolean: "staffid=2" ' error. However if I type select selectstaffroles('staffid=2') using pgAdmin SQL window - no problems!
    ANY HELP or suggestions will be greatly appreciated! - Thanks in advance!
    Eli

    Ahh soz - silly mistake which was corrected pretty much as soon as post was posted!
    Solution:
    Within another method the where clause sent to the database function was enclosed within quotes! Removing quotes = problem resolved!

  • Invalid input event for numeric control

    Need to catch the event when invalid input being through out, customer doesn't like the notify.
    George Zou
    http://webspace.webring.com/people/og/gtoolbox

    I haven't had a big problem with this, and I plan to continue to use numeric controls instead of making everything strings, but it does seem strange that CVI doesn't catch this.  I like the automatic range checking options, the programmable increment/decrement buttons, and the ease of use.
    You can use a quirk in CVI to catch this: if you enter an invalid number like 1.2.3 or 3...14159 or 1-2, CVI triggers EVENT_VAL_CHANGED, but leaves the original number unchanged.  So you can create a case in the callback for the numeric control for EVENT_VAL_CHANGED, and in that case check to see if the value is the same as the previous value.  If it is, assume an invalid input.  EVENT_VAL_CHANGED does not get fired if you just press Enter without changing the value.
    There are a couple of limitations or drawbacks to this approach.  It doesn't save your invalid entry, so you have to enter the whole thing again instead of just correcting your mistake.  EVENT_VAL_CHANGED also gets fired if you use Delete or Backspace, even if the number you end up with is the same as the previous.  So this approach will flag that as an invalid entry.
    See the attached example.
    Attachments:
    TestInvalidInput.zip ‏6 KB

  • Invalid Input Error When Compiling in CS5

    I am porting and AIR for Android app over to iPhone, but when I try to compile I get the following error:
    Invalid Input
    Invalid Input swf. Error executing : /Applications/Adobe Flash CS5/PFI/aot/lib/go.jar
    Has any one else seen this? Do you know how to fix it?
    Thanks.

    You need to update Flash CS5 under Help > Updates.
    I had the same problem. I thought Flash was up to date because the Adobe Updater pops up regularly. The Adobe Updater is just for CS4 apps, so you won't get the updates you need for CS5.
    ~Victoria~

  • The data Form is invalid. Check log for details.

    Hi All,
    I am getting the following error, when I try to open a form.
    The data form 1. Current Year Forecast Input Form is invalid. Check log for details.
    Could you please let us know the path of the log file.
    Thanks & Regards,
    Sravan Kumar.

    Hi,
    If you want to know what patch release you are you, then log into planning directly and click help > about
    The latest patch is :- 7229787 — You cannot open a Planning data form in Smart View, if in Planning preferences, the property for Indentation of Members on Page Display is set to Indent based on hierarchy.
    I believe John was referring to this bug which was resolved in patch 9.3.1.1.6 :-
    7229787 — You cannot open a Planning data form in Smart View, if in Planning preferences, the property for Indentation of Members on Page Display is set to Indent based on hierarchy.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • IOS7 Safari error Code: "invalid Input Data. No javascript allow." On payment by Credit cards. Pls help

    Its Not possible to make any payment by Credit Card. After filling in the Data Form and continuing to finish the payment an error window appears Witz the Text " invalid Input Data. No javascript allow..."  Orher Browsers are working well.
    How can i fix this Problem

    Its Not possible to make any payment by Credit Card. After filling in the Data Form and continuing to finish the payment an error window appears Witz the Text " invalid Input Data. No javascript allow..."  Orher Browsers are working well.
    How can i fix this Problem

  • Navigational Attribute Problem in Input Query

    Hi,
    I am having a problem in input query implementation which uses a navigational attribute. I have, for eg, only one char 'customer' in rows; i want to exclude the customers with the status D (deleted) from displaying (Status is nav. attr. of customer).  I tried this by restricting in filter, Status D-"exclude". But as soon as I do this, query no longer remains input ready! (I also tried putting the same restriction in Default Values area rather than Filter, but ended with the same result )
    I discovered that if, furthermore, I put Status in rows (with the above said restriction still remaining), query is again input ready.
    Can't we exclude values in the filter on an input query? I want to know if this is a restriction with IP or a bug?

    Hi Gregor,
    Thanks for the explanation. But this makes me wonder, because due to this restriction one of the BIG advantages queries had over the planning layouts of BPS, seems to be gone. I mean, using navigational attributes for filtering; if we have to always have a single value restriction on a nav. attr., this will really be restricting. Is it expected that this will be changed in a later SP?
    And there is another problem that is coming due to this. When I use the exclude filter and also the nav. attr. Status in rows, then the query becomes input ready, but there are warning messges displaying when the query opens saying -
    Characteristic Customer has no master data for "C1"
    Characteristic Customer has no master data for "C2"
    etc... (these are the customers with status D). We are on SP15.
    Please suggest what should I do to get rid of these messages?
    Edited by: Mayank Gupta on Apr 10, 2008

  • System.read.in(); -problems when inputting numbers

    Very wet behind the ears when it comes to java and having problems in inputting numbers. My course requires me to write a program that converts degrees c to degrees f. An addition is to have the user input the value of degrees c. When I input a value, say 0, then instead of c being that value it is 49 instead (maybe ASCII?). I sense that the problem is the System.in.read(); bit. I've preceded it with (int) and also tried (char) but to no avail. The other problem is how to get the program to accept a double figure or treble figure input (i.e 20 degrees c). My program is below. Any advice would be greatly appreciated.
    //This program is designed to convert degrees Celsius into degrees Fahrenheit
    class Ctof
         public static void main(String[]args)
         throws java.io.IOException
              //identify variables
              int c;
              double f; //double is needed as calculation involves fractions
              System.out.println("Please input a value of degrees Celsius then press [Enter]");
              c=(int)System.in.read();
              f=(c/(5.0/9.0))+32;
              System.out.println(c + " degrees Celsius"); //prints value of c
              System.out.println("This is " + f + " degrees Fahrenheit"); //prints value of f
    }

    I think this should work...
    import java.io.*;
    class Ctof
    static BufferedReader b;
    public static void main(String[]args)
    throws java.io.IOException
    //identify variables
    int c;
    double f; //double is needed as calculation involves fractions
    b = new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Please input a value of degrees Celsius then press [Enter]");
    c = Integer.parseInt(b.readLine());
    f=(c/(5.0/9.0))+32;
    System.out.println(c + " degrees Celsius"); //prints value of c
    System.out.println("This is " + f + " degrees Fahrenheit"); //prints value of f
    } I've added a BufferedReader to read data from the input stream (System.in). This then gets converted to an int. System.in.read() is only really for reading bytes.
    Andrew

  • Smart Form problem with address layout

    Hello everyone,
    I need your help please for a smart form problem. We need the address layout for great britain with street1, street2 etc. but currently street2 is alligned before street1.
    We are using the FM ADDRESS_INTO_PRINTFORM (SAP standard address node) and according to the documenation the layout for GB is different as we see it currently.
    We have checked the sold-to and all contact persons, they have as country GB and language EN maintained.
    In customizing for address screen layout there is nothing chosen (tested to set up Europe, but did not change anything).
    For the customizing 'specify my countries...' we have maintained GB as country with the address layout key 006, vehicle country key GB and language key EN.
    For the described setting shouldn't there be designed the address in our smart forms according to 006? Anyhting in customizing we missed?
    Thanks a lot for your answers.
    Torsten

    Hi,
    Try to use line priority of FM, below is a brief of documentation. You can read it more in FM documentation:
    Control Parameters
    See also the parameter documentation.
    ADDRESS_TYPE - Address type (from 3.0C)
    There are three types of address:
    Address type '1': addresses of firms or organizations; the address
    structure which is used in most SAP applications as 'Address'.
    Address type '2': address of a person
    Address type '3': work address, usually the address of a contact person
    in a company
    The default value SPACE for the address type is handled like type '1',
    and is needed for the upwards-compatibility of the function module.
    Which parameters are used for which address type is explained in the
    ADDRESS_TYPE parameter documentation.
    The three character "address layout key" of the recipient country (LAND1) controls which of the available country-specific routines is used to format addresses for the country in question. This key is stored in field T005-ADDRS and is entered in Customizing under Global settings -> Set countries -> Define countries, on the detail screen under "Address layout key".
    Keys for customer routines in the SAP enhancement SZAD0001 can be
    maintained via the transaction SM30 (extended table maintenance),table
    name T005A, in the customer name range, and be assigned in country customizing.
    The address attributes are passed in the structures ADDRESS1 (type 1), ADDRESS2 (type 2), ADDRESS3 (type 3) or ADRSWA_IN (type SPACE).
    NUMBER_OF_LINES (ADRSWA_IN-ANZZL)
    The number of lines available for the address layout. If the number of
    lines is not sufficient for the complete layout of an address, then
    lines are consecutively suppressed according to the rules of the country in question. Use the parameter LINE_PRIORITY (ADRSWA_IN-PRIOR) overrules the standard sequence in which the output lines are to be suppressed.
    LINE_PRIORITY (ADRSWA_IN-PRIOR)
    If not equal to SPACE, this field overwrites the standard sequence in
    which the lines are suppressed if the available number of lines ANZZL is
    insufficient.
    The standard sequence is defined as follows:
    Type 1:   'AP43HRT7I86LC2BS5O'       (GB:  'APRT4327I86CBS5LO')
    Type 2:   'APHRT7I86LCBS5O'          (GB:  'PRT7I86CBS5LO')
    Type 3:   'APF43HR7I86TLC2BSND5O'    (GB:  'APRT4327I86CBS5LNDIO')
    where (if they occupy a line of their own):
    A = Title
    P = Mandatory empty line 1
    F = Function of the contact person in the company
    4 = Name 4
    3 = Name 3
    H = Different city
    R = Region
    T = District
    L = Name of country
    C = Postal code
    T = District
    7 = Street 3 (field STR_SUPPL2)
    I = Street 5 (field LOCATION)
    8 = Street 4 (field STR_SUPPL3)
    6 = Street 2 (field STR_SUPPL1)
    L = Country
    C = Postal code
    2 = Name 2
    B = PO Box
    S = Street or PO Box
    5 = c/o name
    N = Name (and title) of a person
    D = Department
    O = City
    Which of these attributes are available for maintenance can vary. All
    fields exist in Business Address Services.
    STREET_HAS_PRIORITY (ADRSWA_IN-WAREN)
    'X': Street has priority over PO Box (delivery address for example)
    ' ': PO Box has priority over street. This is the default value.
    regards,

  • Problems with Input Ready Query

    Hello All,
    I'm facing problems with input ready query for BI IP.
    I've created the input query on aggregation level and maintianed all the planning settings.  It is not allowing me to edit, when i'm attaching in the web template.
    I also attached a button copy function, and i'm able to execute it and save it, but it not allowing me to change manually.
    I also enabled the 3rd option for keyfigures...data can be changed with planning functions and user input.
    Please help me in this regard.
    We have just started the development of BI-IP, please suggest me if there are any notes to be applied.
    Regards
    Kumar

    Hello Johannes,
    Yes I've set to the finest granularity...even if it is Only one characteristic and one key figure without any restrictions...
    I've checked even planning tab page under properties...it is also fine..
    But still it is not allaowing me to go to edit mode...this is a fresh instalation and the query i'm working is the first one...
    Please suggest me if there are any notes to be applied, we are on Support Pack 10.
    Regards
    Jeevan Kumar

  • Problem with input data format - not "only" XML

    Hi Experts,
    I have problem with input data format.
    I get some data from JMS ( MQSeries) , but input format is not clear XML. 
    This is some like flat file with content of XMLu2026.
    Example:
    0000084202008-11-0511:37<?xml version="1.0" encoding="UTF-8"?>
    <Document xmlns="urn:xsd:test.01" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance Sndr="0001" Rcvr="SP">
    ...content....
    </Document>000016750
    Problems in this file is :
    1. data before parser <? xml version="1.0"> -> 0000084202008-11-0511:37 
    2. data after last parser </Document> -> 000016750
    This data destroy XML format.
    Unfortunately XI is not one receiver of this files and we canu2019t change this file format in queue MQSeries ( before go to XI) .
    My goal is to get XML from this file:
    <?xml version="1.0" encoding="UTF-8"?>
    <Document xmlns="urn:xsd:test.01" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance Sndr="0001" Rcvr="SP">
    ...content....
    </Document>
    My questions:
    1. Is any way or technique to delete this data 0000084202008-11-0511:37  in XI from this file ?
    2. Is any way to get only XML from this file ?
    Thanx .
    Regards,
    Seo

    Hi Buddy
    What is the XI adapter using?
    If you use inbound File adapter content conversion you could replace these values with none and then pass it to the scenario.
    Does that help?
    Regards
    cK

Maybe you are looking for

  • Reg Global Variable in PI 7.1

    Dear All We have a scenario where we need to validate contents of variuos fields in an xml file. As the validations are complex we want to store the exceptions inside a global variable so that all the exceptions can be segregated at a single point. C

  • I have a Sony Camcorder DCR-TRV33 and have hooked the firewire cable to my iMac.  However, it doesn'

    I have a Sony DCR-TRV33 camcorder and it hooked to my iMac with the firewire cable but the iMac doesn't seem to recognize the camera.  The camera is set to VCR.  This particular model is not included in the supported camera list for ilife but seems t

  • Cannot log in from laptop (GUID error) using same ID/PW as on desktop, which works

    When logging into APP Store from my laptop (MacAir) , Entering user ID/PW returns error:  "No GUID is available. Contact Support for assistance." same user ID/PW works when logging in using my iMac desktop. Help returns no help when GUID error is ent

  • How to link a plant to a business partner?

    Hi, How to link a plant to a business partner? I mean, how to create a relationship between a back end Plant and a business partner in SRM? Thanks.

  • Doubt with MultiMapping

    Hey guys i m doin a multimapping scenario but getting some errors.its for test purposes so my source and target structures both are same . i m taking help from the followin the following blog /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm