Forms, $_POST and showing data between to numeric values

Hi.
Really stuck with my SQL query.... pretty new to SQL so struggaling with this... heres my scenario..
I have a Form on a .php page that has drop down menus for a user to select options based on location, type of job and min. salary and max. salary. This then submits using the POST method the results of the options (using $_REQUEST) to a results.php page.
The text field queries work great.... with this query:-
SELECT jobs.clocation, jobs.Ref_id, jobs.RefCode, jobs.jobtitle, jobs.blurb, jobs.Consultant, jobs.Salary, jobs.tlocation, jobs.Sector, jobs.Type
FROM jobs
WHERE jobs.clocation = '$_REQUEST[clocation]' AND jobs.Sector  = '$_REQUEST[Sector]' AND jobs.Type = '$_REQUEST[Type]'
Where I'm having problems is getting it to work with the values... I'd like them to be able to choose a Min Salary.. (the drop down menu includes options of 10000 , 20000, etc) and a Max Salary (again 10000 , 20000 etc) and then the results show any data between those values.
Cant figure out where I am going wrong.. please help
Thank you

loopynutter wrote:
 The text field queries work great.... with this query:-
Sure. And it works even better for a hacker. That is, perhaps, the most insecure piece of code I have seen in a long time.
First off, $_REQUEST is insecure because it contains POST, GET, and cookie values.
Next, you're injecting $_REQUEST values directly into your SQL query. Hackers will have a field day trashing your database. Take a look at http://en.wikipedia.org/wiki/SQL_injection to see the danger you're exposing yourself to.
If you're using the PHP mysql functions, you must pass your values first to mysql_real_escape_string(). You should also use $_POST or $_GET instead of $_REQUEST.
As for getting results between different values, use BETWEEN ... AND (http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_between).

Similar Messages

  • How do I place a fixed image and show it between two pages like the Global on Page 3 (LOE)?

    How do I place a fixed image and show it between two pages like the Global on Page 3 (LOE)?

    Ohoh, I do think so. It's the trick. Thanks
    BTW, How about including a widget within real time RSS feed?

  • Interactive form is not showing data during design time

    Hello,
    I have created a interactive form to display PDF. It is of 12 page. I created and checked in the code to DTR but now when I checked out the DC and and edited the interactive form for further update it is not showing any thing in the design time,showing only one blank page. However if I build and run that checked out project it is showing the proper data at runtime, so now i am unable to update the pdf.
    Please help and let me know what to do.

    Hi Timo,
    Sorry for the late response and not specifying more in detail.
    My Jdeveloper version is 11.1.1.6 R1.  When I ran for the first time, it was working fine. Then later on, when I was running it was opening completely blank screen.
    I thought it is something to do with the permission to the task flow. I have opened web.xml and jazn-data.xml file to check and closed without tweaking these files.
    Now, I was not able to open the page in the designer also. It was just showing hierarchy of all the components.
    I copied the backup again and it worked. What could be the reason so that I can avoid doing this in future?
    Is this related to Jdeveloper bug as I have seen on other forums highlighting this issue.

  • Please help with restoring different apps and their data between 2 iPads

    I just bought a new iPad Air 2 . I currently have 2 iPads, 1st gen and iPad 2nd, each with its own set of apps and their data. I backed up each older iPad manually as  a full backup. I created a separate library for one of them when doing this. Now I want to transfer iPad 1st gen apps and data to iPad 2nd, so I reset iPad 2nd to factory and then restored from the manual back up of the iPad 1st gen and it seems to work fine. Before that I had backed up iPad 2nd's current data. So now I now I want to transfer the iPad 2nd apps and data to the new iPad Air. I selected the backup by the time stamp that I had backed up iPad 2nd. I didn't know how to rename each iPad to something unique. It restored from backup, but it's all the apps and data from my iPad 1st gen backup, not iPad 2nd.
    I'm utterly confused. Even when I have the separate iTunes library open it shows all the manual backups I performed, so it's not truly a separate library. Do I need to manually install/remove the various apps on the newer iPad?

    If you only have 1 file per quarter, one obvious thing to do would be to edit out the time in between plays, the time-outs, and the like. That is easily done in iMovie.
    Having said that, importing (and exporting) in high definition takes time, and your times do not seem unreasonable.
    Message was edited by: AppleMan1958

  • How Do I Filter a Report Using a Multi Select List Box and Specifying Date Between Begin Date and End Date

    Hope someone can help.  I have tried to find the best way to do this and can't seem to make sense of anything.  I'm using an Access 2013 Database and I have a report that is based on a query.  I've created a Report Criteria Form.  I
    need the user to be able to select multiple items in a list box and also to enter a Begin Date and End Date.  I then need my report to return only the records that meet all selected criteria.  It works fine with a ComboBox and 1 selection but can't
    get it to work with a List Box so they can select multiple items.  Any help is greatly appreciated while I still have hair left. 

    The query should return all records.
    Let's say you have the following controls on your report criteria form:
    txtStart: text box, formatted as a date.
    txtEnd: text box, formatted as a date.
    lbxMulti: multi-select list box.
    cmdOpenReport: command button used to open the report.
    The text boxes are used to filter the date/time field DateField, and the list box to filter the number field SomeField.
    The report to be opened is rptReport.
    The On Click event procedure for the command button could look like this:
    Private Sub cmdOpenReport_Click()
    Dim strWhere As String
    Dim strIn As String
    Dim varItm As Variant
    On Error GoTo ErrHandler
    If Not IsNull(Me.txtStart) Then
    strWhere = strWhere & " AND [DateField]>=#" & Format(Me.txtStart, "yyyy-mm-dd") & "#"
    End If
    If Not IsNull(Me.txtEnd) Then
    strWhere = strWhere & " AND [DateField]<=#" & Format(Me.txtEnd, "yyyy-mm-dd") & "#"
    End If
    For Each varItm In Me.lbxMulti.ItemsSelected
    strIn = strIn & "," & Me.lbxMulti.ItemData(varItm)
    Next varItm
    If strIn <> "" Then
    ' Remove initial comma
    strIn = Mid(strIn, 2)
    strWhere = strWhere & " AND [SomeField] In (" & strWhere & ")"
    End If
    If strWhere <> "" Then
    ' Remove initial " AND "
    strWhere = Mid(strWhere, 6)
    End If
    DoCmd.OpenReport ReportName:="rptMyReport", View:=acViewPreview, WhereCondition:=strWhere
    Exit Sub
    ErrHandler:
    If Err = 2501 Then
    ' Report cancelled - ignore
    Else
    MsgBox Err.Description, vbExclamation
    End If
    End Sub
    If SomeField is a text field instead of a number field, change the line
            strIn = strIn & "," & Me.lbxMulti.ItemData(varItm)
    to
            strIn = strIn & "," & Chr(34) & Me.lbxMulti.ItemData(varItm) & Chr(34)
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Best approach to transfer and transform data between two Oracle Instances

    Let me first preface this post with the fact that I am an Oracle newb.
    The current problem I am trying to solve is how to quickly transfer data from a customers legacy database into a new normalized destination that is modeled differently than the legacy data. So, the data not only has to be transferred, but also transformed (into normalized tables)
    We have discovered, the hard way, that reading the data using a C++ application and performing inserts (even with indexing and constraints disabled) is just way too slow for what we need. We are dealing with around 20 million records here. I need to determine what the best approach extracting this data out of the source and inserting it into the destination. Any comments or tips are greatly appreciated.
    Note: I have read about SQL*Loader and mentioned it to management, but they seem resistant to this approach. It's not totally out of the question though.

    Oracle has a lot of technologies that fall under the general heading of "replication" to choose from. Going from a database to a flat file and back to another database is generally not the most efficient solution-- it's generally much easier to go straight from one database to another.
    Oracle provides materialized views, Streams, and Change Data Capture (CDC)-- any of these would be able to give your new system incremental feeds of data from the old system's data and could be used by whatever routines you write to transform the data between data models.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How do i plot with the operating system time in one plot and show lines between cursors in another using the same XY graph?

    I am having some trouble graphing two plots at once. One plot is to show the current temperature inside a chamber as a function of time. I am trying to pick the current time and temperature each second and plot it with each point being connected by a line. I am able to show a moving, blinking dot each second but I can't figure out how to develop an actual line with these dots. To make matters worse, the blinking dot is back in the year 1903. I understand that it uses seconds elapsed since 1903, and am trying to find out how to graph the current temperature with the system time.
    The second plot is just 5 moveable cursors that are to be connected by a line. I am able to move the cursors and retrieve the position information, but I can't make a line between them.
    I have attached my main .vi, though you may have to pick the graphing part off to have it work for you.
    Attachments:
    Main Module Chamber Testing I_O every 30 sec.vi ‏288 KB

    You're not creating the XY graph data correctly. I've attached an example with a couple of simple XY Graphs. One is using a couple of shift registers to hold the spearate x and y arrays. I think this is what you were trying to do. The other one uses a VI from the shipping examples called XY Chart. It makes an XY Grpah act like a chart. I've also shown the correct way to display current time.Message Edited by Dennis Knutson on 05-12-2005 03:51 PM
    Attachments:
    XY Graph.vi ‏41 KB

  • How to make a checkbox hide and show div between two different pages

    Hi
    I am developing a mobile site application.
    Currently I need to make a checkbox effect.
    Here is how I want the checkbox to work for me..
    I want users to click on the checkbox, for an option on the editor as well as its content on the live mobile to hide.
    These are two different files which contains the user interface.(the live mobile file and the editor file)
    Now how can I make it possible to make both options hide or show at the same time after a user clicks on the
    checkbox to show or hide.
    Is it possible for a checkbox created on a different file affects an external file to hide a div within that file?
    If so kindly advice me on this.
    Thanks in advance

    There are several tutorials out there for dissolving a layer, turning text to sand, and similar things. Use any/all of those and then time remap that composition to make the particles form into your word.

  • How can i swap the content such as messages, calendar entries, apps and app data between two iphone 4s?

    I have a Iphone 4s and my friend has one too and we want to switch phones but do not want to lose any data or message or calendar entries, we want the same exact content avaliable in my phone swapped to his and his to mine. how can this be done?

    Back up your phones onto your respective computers with iTunes, swap phones, Reset them and when you connect it to iTunes, instead of "Set up as a new iPhone", click on restore from back up

  • Comparing two columns in two tables using partial text strings and copying data between tables

    I have two tables:
    The Vendor table is supplied by a clothing manufacturer and lists product data by row with a column that contains a unique manufacturer ID, such as T5C4.  In this table is a short product description and a long product description that I need to find and copy into the second table, Inventory.
    The Inventory table is an export from our Magento store.  Each row contains a unique inventory number in a column that includes but does not match the unique manufacturer ID from the Vendor table.  For example, the unique inventory number could be T5C4-W12, or RED-T5C4W12 or some other variation.
    For each product in Inventory, I need to find the matching product in Vendor, and then copy the short description and long description from Vendor to Inventory.
    Any tips?  Thanks!
    Karl

    Karl,
    Here's a start, as you requested.
    The formula for Our Inventory Row is:
    =IFERROR(MATCH("*"&A&"*", Our Inventory :: A, 0), "n/a")
    The formula for Brief Description in the inventory table is:
    =IFERROR(INDEX(ABC Products :: $A$1:$C$9,MATCH(ROW(), ABC Products :: $D, 0), 2), "n/a")
    The formula for the Full description in the inventory table is:
    =IFERROR(INDEX(ABC Products :: $A$1:$C$9,MATCH(ROW(), ABC Products :: $D, 0), 3), "n/a")
    The Manufacturer's table knows the concise product numbers, so it has the ability to search the Inventory table for it's product id's using wildcards and it then displays the line number of the item in the inventory table. The Inventory table can then search the manufacturer's table for its row number and can reference the brief and full descriptions.
    This approach has a serious limitation. It will only find the first occurrence in the inventory. Now, if you want to accept this, you can sort all the found descriptions and pull them out of the inventory table, and then the next product in line will display it's description too.
    I wish I could do better with this, but it's all I can come up with at this point, knowing only what you have told me.
    Jerry

  • HT201272 Is there any way to transfer game saves and level data between devices without jailbreaking?

    I've had a 4s for a couple years and have quite a few games. I would like to tranfer in game data levels to my new iPad mini so I dont have to restart them from the beginning. Is there anyway of doing this without jailbreaking and messing around with ssh?

    Click here and follow the instructions.
    (95680)

  • Moving Images and All Data between 2 Connected Macs via LR 3?

    I have an older MBP 17" and a couple year old Mac Pro, both running OS 10.5.8, which are sitting next to each other and I can transfer data wirelessly.  Both running Lightroom 3.4.1.
    I have about a year of photos in Lightroom on my MBP and I'd like to be able to open up Lightroom on the Mac Pro and transfer or otherwise Import those photos, metadata, and the various versions of the photos I've tweaked.
    What is the best way to do this?  Do I choose Import in Lightroom on my Mac Pro or is there another procedure that might avoid whatever pitfalls exist with that method?  I've wanted to do this for quite some time but am afraid of screwing something up and losinig valuable images.
    I'd appreciate hearing from people who have successfully accomplished it.
    Thanks,
    Greg

    Fuji F30 just came to the market. The correct driver for that camera may be missing in 10.3.9. which is probably older than the F30. In case you have Adobe Photoshop or Photoshop Elements, you could download the latest update and probably have the F30 supported in that way (?). The same thing could help with reading the card correctly. This is my experience with other digital cameras.

  • ALV - show blank cell if numeric value is zero

    Hi
    I have an ALV with serveral numeric and decimal fields.
    Is it possible without a lot of effort (like assigning a separate cell with the visibilty attribute for each cell) to hide the cell content if the value is zero instead of showing 0 or 0,00 and so on .
    Thanks
    Thomas

    >
    Thomas Jetzinger wrote:
    > Hi
    >
    > I have an ALV with serveral numeric and decimal fields.
    >
    > Is it possible without a lot of effort (like assigning a separate cell with the visibilty attribute for each cell) to hide the cell content if the value is zero instead of showing 0 or 0,00 and so on .
    >
    > Thanks
    > Thomas
    I have a feeling that a cell variant or dynamic manipulation of visibility is going to be the correct answer.  The data type rules will always fire for the conversion exit on output.  You could maybe create a custom domain with its onw conversion exit but I would think that would actually lead to more work than just using hte cell variant/visibility property.

  • Show dates with no corresponding values

    Howdy all....
    I have a report that quantifies newspaper draws by the day of the week for the purpose of giving to the delivery persons. I am trying to use a cross-tab to show the amount of papers for each location, in columns by the day of week. When a location is closed on a particular day (having a null entry in the draw record), there is simply no record for that day, leading to a situation where as one looks down the column in the cross tab table, one is not necessarily looking at the same day's data in the column. For instance, if Sunday is the first day of the sales week, I would like Sunday to be the entire first column, irrespective of the amount allocated to that location, so that the entire column sums to be the total for that date rather than for the first day that the location has papers assigned to it. Every location would have a value for all seven days, regardless of the number of days with draws assigned.
    Hope that make sense. I'm certain that it's something that should be apparent to me, but it just isn't. Any help is greatly appreciated!
    Edited by: MicahY on May 3, 2011 4:47 PM

    YOu will need to build a manual cross tab where you have formula to define your columns.
    eg
    @sunday
    if dayofweek(yourdatefield) = 1 then valuefield else 0
    repeat for each day. add these to details and suppress detail section
    Add sum summary to your relevant group.
    Now you will get a column for each day irresepective as to whether there is data or not.
    Ian

  • Calling and manipulating data on an Interactive Adobe form from ABAP report

    Dear All,
    Can you please tell me how to call an interactive adobe from from a custom adobe form?
    If so how can we pass and receive data between the interactive adobe form and the abap report program?
    Thank you.
    Regards,
    Prosenjit.

    Hi,
    It is possible to call an Interactive Adobe form from ABAP report and pass data into the form. If you search the forum, you will get many threads explaining the process. Let me know if you have any specific questions on this.
    Regards,
    Sanoosh

Maybe you are looking for