Jump to content

Veltu

New Members
  • Posts

    9
  • Joined

  • Last visited

Veltu's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm looking to order my upload files in a specific order. I believe the default is a random upload order, but I would like to change this based on the file name, which I'm having difficulty with. The file names would be for example; '01 smiley' '02 dog' '03 cat' Currently I used a 'Drag & Drop' multiple file upload although this just uploads in any random order to my database table, I'd like to upload it by numeric order as above. Code so far (upload code works, just the order needs work)... $count = count($_FILES['upload']['name']); $in=0; while($in<$count) { //upload here $in++; } I think I need to sort()? before my while loop, but having difficulty getting this correct. How would I be able to sort each file into a correct order. Many thanks.
  2. Thank you Barand, problem solved and I can now insert my data into the table!
  3. Hi all, I'm posting JSON to an API call. If I use a var_dump within the API it will return correctly, although if I try to var_dump within the function it will return NULL. API: $json = file_get_contents('php://input'); if(isset($_GET['form_id']) && intval($_GET['form_id'])>0) { if(isset($json)) { $records = $questionnaire->logFormAnswers($_POST['answers'],$_GET['form_id']); Then using the logFormAnswers function... Function: public function logFormAnswers($answers = "", $form_id = 0) { $answers = json_decode($json,true); var_dump($answers); The JSON: [{"question_id":"3","answer":"dsf"},{"question_id":"3","answer":"sdfsdfdsfsd"}] Eventually, once the JSON has been decoded, it will be inserted into a database within the function. If anyone can see what I'm doing wrong, any help is appreciated, thanks!
  4. Thank you all, Great help for a beginner
  5. Thanks guys. If you could just answer this. If I now attempt to decrement $current. It returns: 7,6,5 - This has thrown me off a bit. How would I get it to negate off the $current value of 5 to return 4,3,2? Thanks!
  6. Hi all, I'm having trouble attempting to increment values in an array... I basically want it to use the $current value and then within the array increment the value to get the next three values; 6,7,8. Every attempt I keep getting 5,5,5 returned and I'm quite stuck. Would be great help if someone could point me in the right direction.
  7. Thank you trq. I will look into a 'slug'!
  8. Hi all, I'm creating a small news/blog and I was wondering is it safe (or if there is a better way) to pass the row id from the table as the URL to view the article... e.g. http://www.mysite.com/viewarticle?id=11 I then select the data from the table where the id is equal to the above. Kind Regards and Thank you.
  9. Hi everyone, I just need some help. I want the administrator to be able to select a specific date from a DB table, which will then display the results associated which that date selected. I have been able to do this with sessions, but of course only the administrator would be able to see this. How could this be done so the selection is permanent and the database results are displayed on the website? Regards, Veltu
×
×
  • 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.