Jump to content

rayman0487

Members
  • Posts

    20
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

rayman0487's Achievements

Member

Member (2/5)

0

Reputation

  1. Barand, I'm not really sure what this statement does and can not seem to get it to work. requinix, I have tried a statement similar to what you have provided before posting. I'm back to fighting with this, but having a heck of time. Does anyone else have a suggestion on getting this to work? I'm thinking some kind of join, but I'm having such a difficult time.
  2. it should return 2 and 3 because pair_id for those appointments does not exists. Basically a "pair_id" is what ties a user's account to their google account. In this example, pair_id 1 and 2 both should have all 3 appointments on their calendars.
  3. First off, sorry for the crap title. What I'm trying to do is create a table to links appointments (stored in a table) to Google Calendar for multiple users. What I've got currently is an appointments Table with "appointment_id", google_calendar Table with pair_id, google_id, appointment_id. The pair_id is based on another query that is stored in an array. What I need is to select all the appointments.appointment_id that are NOT in google_calendar with a pair_id. So: Appointments 1 2 3 google_calendar 1 - 985 - 1 1 - 523 - 2 1 - 653 - 3 2 - 478 - 1 What I'm trying to get is appointment_id 2 and 3 for "pair_id" 2 - make sense? I'm hoping someone can help me out, but I've gotta run so I may not get back to this tonight, but I appreciate anyone's help. TYIA!
  4. Hey all, first up I want to say I'm writing this from my mobile phone so please disregard any spelling/grammar errors. I've developed a php web app and am just about to open a beta, but I want to create some help docs for it. I can't find anything only for a single pole help documents, even a simple phone/mysql with search function doesn't exists. Heck, I cant even find a single pole HTML template. I'd really rather not roll my own, right now I'm thinking just using MS Word and either distribution a PDF or spacing that as HTML. Does anyone know of anything simple and free that I just can't find? I'm hoping so! Thanks, R
  5. First off, sorry for my title, I really have no idea how to title this question. It's getting late, so I'm just going to jump right in. I have 2 tables -> customers and specification that contain the following: +--------------+ +----------------+ | Customers | | specification | +--------------+ +----------------+ | id | | cust_id | | name | | field_id | | | | field_value | +--------------+ +----------------+ specification 1 - 1 1 - 2 - awesome 2 - 1 2 - 3 3 - 1 3 - 2 - great 3 - 3 How can I Select CONCAT(customers.name,'|',customers.id) as customer_info and specification.field_value WHERE specification.field_id = 2 BUT if there is no field_id 2 then just not include that in my result? What I'm after: John|1, awesome Paul|2 Ryan|3, great I'm thinking this is simple, but my brain is not working well tonight. Thank you so much for your help, Ray
  6. Please disregard this topic. I fiddled around with cURL and got it working. If anyone knows how to delete or edit post, please let me know and I will do so. Thanks.
  7. Hey all! I have a web app that uses cURL to connect to a PHP API. Everything is working fine, but now I need to be able to download a file. My users are able to upload files to the API and they are saved on the server, but now I'm trying to download those files. If i navigate directly to api.php?file=somefile.pdf the API will output the file in the headers and I get the open to save or open the file as expected. Now, what I'm trying to do is get my client application to save the file, but I have no idea what to even Google. Everything I've tried is more about sending files to an API (uploading). So if anyone knows any good resources or how to do this please let me know. Sorry for any shortcomings in this post, but I type it out quickly, as I'm working on multiple things today and this is just one of those and is causing a huge headache. Thanks!
  8. As in, not include $_FILES? If so, yes that works just fine. That is why I'm stumped why it's having this result.
  9. Hey all. I have an issue that I cannot figure out today and it's driving me crazy. I have an API and a front-end application running on my Windows PC and my LAMP on AWS and I'm trying to upload a file from the front end to the API for the API to handle saving the file. On my window's machine it works fine, but on AWS it is not working, it is "changing" my array structure. For example see the simple debug output below: WINDOWS: Sending: Array ( [request] => UploadFile [CustomerID] => 1 [Category] => 1 [0] => @D:\Programs\xampp\CSTemp\1\1\home.txt ) API STARTING... 1 files submitted File Array: Array ( [0] => Array ( [name] => home.txt [type] => application/octet-stream [tmp_name] => D:\Programs\xampp\tmp\phpC4B2.tmp [error] => 0 [size] => 0 ) ) LINUX Sending: Array ( [request] => UploadFile [CustomerID] => 1 [Category] => 1 [0] => @/var/www/tmp/1/1/home.txt ) API STARTING... 1 files submitted File Array: Array ( [Category] => Array ( [name] => home.txt [type] => application/octet-stream [tmp_name] => /tmp/php1DBdoV [error] => 0 [size] => 0 ) ) As you can see, Linux is storing the file in $_FILES['Category'] and not just $_FILES which Windows is doing. I know the source code is exactly the same because I'm working from a SVN repository that automatically checks out the source code on AWS when I commit from my computer. Does anyone have any insight into this? I can provide additional code if needed, but the code appears to be working other than this issues.. Thanks for you help. -R
  10. Sorry, had a crazy week and then was out of town for the weekend. This is what I think I'm going to do. I was thinking about this over the weekend and it hit me today. I thought, "ya know, all customers will have this field, I mind as well "hard code" it into the DB." I think this is the best and cleanest solution. Thanks for taking the time to give the sql examples though. I appreciate the help.
  11. Hey All! I'm writing a PHP app that will be deployed to a LAMP on AWS. What I'm currently trying to do is get some customer data and it requires 3 tables to get all the relevant information. First my table structure (it is slightly simplified) +------------------+ +----------------------+ +-------------------+ | settings_fields | | customer_info | | customer_details | +------------------+ +----------------------+ +-------------------+ | field_id | | customer_id | | customer_id | | field_caption | | field_id | | progress | +------------------+ | field_value | +-------------------+ +----------------------+ I have this setup to allow my users to specify custom fields that they will want to save to the DB when adding a new customer, but there are several fields that I have set as a default that have field_id already set. When a customer is added a customer_id is generated and stored in customer_details and then all fields are saved as individual rows in customer_info. Customer_info field_id matches settings_fields.field_id. So, for example, settings_fields.field_id (2) is field_caption (Last Name) What I'm trying to do is this. 1. get all customer_details.customer_id where progress=1 2. get those customers' customer_info.field_value, settings_fields.field_caption WHERE field_id matches 3. Get those as individual rows for each customer. 4. Sort the list by last name of customer so ORDER BY settings_field.field_id = 7 Is this possible? My head is spinning and I've been trying to work on this for a while now. What I'm currently doing is getting all the customers where progress = 1 then foreach looping through and getting the details, but I can not figure out how to then sort it... Any advice?
  12. I don't have access to https for testing, I've been planning on migrating to that protocol anyhow, just haven't had the time. I understand what you are saying, but I'm still loss - unless this is the reason for requiring https. So, if I encrypt the password before sending to the server and someone does intercept what prevents them from being able to simply use that encrypted string? It will still be accepted when they submit it to the server.
  13. Hi all, I'm working on rewriting an application that is currently in place. I was thinking today about the login and I don't think that it's very secure, so I was hoping I could get some other's input. I have the basic form for email and password. upon submit, I'm using a JS library that HASH the password then submits the form which then sends various parameters to my API server. Here's the part I'm hung up on. Suppose the following: Username: user1 Password: pword (hash value = BZ7...H7F) The call the server would be ...?user=user1&password=BZ7...H7F The server will then query the DB for the stored password for user1, so from the DB I get BZ7...H7F they match, user logs in. What is so different than just sending a plain text password. If some one intercepts the hash value, all they have to do is submit it to the server. So, I was thinking, I'll just add a salt on both sides. $Salt='J7G...F4K'; so now, pword hash value = JU8..G9H and that is sent to server. Now the server queries the DB and gets the stored password, say it's a HASH value = L9K..HFI. The server will add the same Salt parameter and now the server has a hashed value of JU8...G9H - success user logs in. However, again, say someone is able to intercept the JU8...G9H value. I'm right back at square one. I thought about generating random Salt values, but then it would have to be sent with the login credentials rending it mute, because then the middle man would just send the password and the salt value. Is there something I'm missing or are logins really this insecure?
  14. Hi all, I'm working on creating a simple API for an application re-write, however I'm having a difficult time trying to accomplish request verification - in a simple way. Here is what I have so far.... $AvailableRequest = array( array ('Request1'), array ('Request2'), array ('Request3', 'req' => array('parm1', 'parm2'), 'opt' => array('parm3')), array ('Request4', 'opt' => array('parm1')), array ('Request5', 'req' => array('parm1'), 'opt' => array('parm2')) ); I use this array to store all the allowable request and they required (req) and optional (opt) parameters that can/must be submitted too. What I currently do is use a function that loops through the array using the submitted requested and makes sure that the request in valid. What I'd like to do next is make sure that all the keys in the req array were also submitted. For example. api.php?request=Request5&parm1=Foo - This should work api.php?request=Request5 - This should return an error response Is there a simple way to accomplish this that I'm overlooking? Thanks for all the help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.